@deephaven/console 0.21.2-beta.0 → 0.21.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,7 +12,19 @@ declare global {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
declare class MonacoUtils {
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Initializes Monaco for the environment
|
|
17
|
+
* @param getWorker The getWorker function Monaco should use
|
|
18
|
+
* The workers should be provided by the caller and bundled by their build system (e.g. Vite, Webpack)
|
|
19
|
+
*/
|
|
20
|
+
static init({ getWorker, }?: {
|
|
21
|
+
getWorker?: Environment['getWorker'];
|
|
22
|
+
}): void;
|
|
23
|
+
/**
|
|
24
|
+
* Register the getWorker function for Monaco
|
|
25
|
+
* @param getWorker The getWorker function for Monaco
|
|
26
|
+
*/
|
|
27
|
+
static registerGetWorker(getWorker: Environment['getWorker']): void;
|
|
16
28
|
/**
|
|
17
29
|
* Remove the hashtag prefix from a CSS color string.
|
|
18
30
|
* Monaco expects colors to be the value only, no hashtag.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonacoUtils.d.ts","sourceRoot":"","sources":["../../src/monaco/MonacoUtils.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"MonacoUtils.d.ts","sourceRoot":"","sources":["../../src/monaco/MonacoUtils.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,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H,MAAM,CAAC,4BAA4B,CACjC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,qBAAqB,GAC1C,IAAI;IAmCP;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,gBAAgB,CACrB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAC3C,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,IAAI;IA8BP,MAAM,CAAC,4BAA4B,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM;CA6BhE;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
+
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
1
7
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
8
|
|
|
3
9
|
/**
|
|
@@ -6,9 +12,7 @@
|
|
|
6
12
|
import { assertNotNull } from '@deephaven/utils';
|
|
7
13
|
import * as monaco from 'monaco-editor';
|
|
8
14
|
// @ts-ignore
|
|
9
|
-
import { KeyCodeUtils } from 'monaco-editor/esm/vs/base/common/keyCodes.js';
|
|
10
|
-
|
|
11
|
-
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
|
15
|
+
import { KeyCodeUtils } from 'monaco-editor/esm/vs/base/common/keyCodes.js';
|
|
12
16
|
import Log from '@deephaven/log';
|
|
13
17
|
import MonacoTheme from "./MonacoTheme.module.css";
|
|
14
18
|
import PyLang from "./lang/python.js";
|
|
@@ -17,16 +21,23 @@ import ScalaLang from "./lang/scala.js";
|
|
|
17
21
|
import DbLang from "./lang/db.js";
|
|
18
22
|
import LogLang from "./lang/log.js";
|
|
19
23
|
var log = Log.module('MonacoUtils');
|
|
20
|
-
window.MonacoEnvironment = {
|
|
21
|
-
getWorker() {
|
|
22
|
-
return new EditorWorker();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
};
|
|
26
24
|
|
|
27
25
|
class MonacoUtils {
|
|
26
|
+
/**
|
|
27
|
+
* Initializes Monaco for the environment
|
|
28
|
+
* @param getWorker The getWorker function Monaco should use
|
|
29
|
+
* The workers should be provided by the caller and bundled by their build system (e.g. Vite, Webpack)
|
|
30
|
+
*/
|
|
28
31
|
static init() {
|
|
32
|
+
var {
|
|
33
|
+
getWorker
|
|
34
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
29
35
|
log.debug('Initializing Monaco...');
|
|
36
|
+
|
|
37
|
+
if (getWorker !== undefined) {
|
|
38
|
+
MonacoUtils.registerGetWorker(getWorker);
|
|
39
|
+
}
|
|
40
|
+
|
|
30
41
|
var {
|
|
31
42
|
registerLanguages,
|
|
32
43
|
removeHashtag
|
|
@@ -131,6 +142,17 @@ class MonacoUtils {
|
|
|
131
142
|
registerLanguages([DbLang, PyLang, GroovyLang, LogLang, ScalaLang]);
|
|
132
143
|
log.debug('Monaco initialized.');
|
|
133
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Register the getWorker function for Monaco
|
|
147
|
+
* @param getWorker The getWorker function for Monaco
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
static registerGetWorker(getWorker) {
|
|
152
|
+
window.MonacoEnvironment = _objectSpread(_objectSpread({}, window.MonacoEnvironment), {}, {
|
|
153
|
+
getWorker
|
|
154
|
+
});
|
|
155
|
+
}
|
|
134
156
|
/**
|
|
135
157
|
* Remove the hashtag prefix from a CSS color string.
|
|
136
158
|
* Monaco expects colors to be the value only, no hashtag.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonacoUtils.js","names":["assertNotNull","monaco","KeyCodeUtils","EditorWorker","Log","MonacoTheme","PyLang","GroovyLang","ScalaLang","DbLang","LogLang","log","module","window","MonacoEnvironment","getWorker","MonacoUtils","init","debug","registerLanguages","removeHashtag","dhDarkRules","token","foreground","string","keyword","delimiter","comment","number","storage","identifier","operator","predefined","substring","dhDarkColors","errorForeground","background","focusBorder","editor","defineTheme","base","inherit","rules","colors","debug2","setTheme","color","languages","languageIds","map","id","getLanguages","filter","includes","forEach","languageParam","language","registerLanguage","register","onLanguage","setLanguageConfiguration","conf","setMonarchTokensProvider","setEOL","eolSequence","EndOfLineSequence","LF","getModel","openDocument","session","model","didOpenDocumentParams","textDocument","uri","languageId","getLanguageId","version","getVersionId","text","getValue","dispose","onDidChangeModelContent","changedEvent","changes","versionId","contentChanges","i","length","change","range","rangeLength","contentChange","start","line","startLineNumber","character","startColumn","end","endLineNumber","endColumn","push","didChangeDocumentParams","changeDocument","closeDocument","didCloseDocumentParams","registerPasteHandler","onDidPaste","pasteEvent","smartQuotes","invalidChars","editorModel","pastedText","getValueInRange","test","applyEdits","replace","isMacPlatform","platform","navigator","startsWith","removeConflictingKeybindings","keybindings","windows","mac","keybinding","removeKeybinding","err","error","undefined","_standaloneKeybindingService","_getResolver","_map","get","elem","command","addDynamicKeybinding","warn","getMonacoKeyCodeFromShortcut","shortcut","keyState","keyValue","isMac","metaKey","KeyMod","CtrlCmd","shiftKey","Shift","altKey","Alt","ctrlKey","WinCtrl","fromString"],"sources":["../../src/monaco/MonacoUtils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\n/**\n * Exports a function for initializing monaco with the deephaven theme/config\n */\nimport { Shortcut } from '@deephaven/components';\nimport { IdeSession } from '@deephaven/jsapi-shim';\nimport { assertNotNull } from '@deephaven/utils';\nimport * as monaco from 'monaco-editor';\nimport type { Environment } from 'monaco-editor';\n// @ts-ignore\nimport { KeyCodeUtils } from 'monaco-editor/esm/vs/base/common/keyCodes.js';\n// @ts-ignore\nimport EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';\nimport Log from '@deephaven/log';\nimport MonacoTheme from './MonacoTheme.module.scss';\nimport PyLang from './lang/python';\nimport GroovyLang from './lang/groovy';\nimport ScalaLang from './lang/scala';\nimport DbLang from './lang/db';\nimport LogLang from './lang/log';\nimport { Language } from './lang/Language';\n\nconst log = Log.module('MonacoUtils');\n\ndeclare global {\n interface Window {\n MonacoEnvironment?: Environment;\n }\n}\n\nwindow.MonacoEnvironment = {\n getWorker() {\n return new EditorWorker();\n },\n};\n\nclass MonacoUtils {\n static init(): void {\n log.debug('Initializing Monaco...');\n\n const { registerLanguages, removeHashtag } = MonacoUtils;\n\n const dhDarkRules = [\n { token: '', foreground: removeHashtag(MonacoTheme.foreground) },\n { token: 'string', foreground: removeHashtag(MonacoTheme.string) },\n {\n token: 'string.delim',\n foreground: removeHashtag(MonacoTheme['string-delim']),\n },\n { token: 'keyword', foreground: removeHashtag(MonacoTheme.keyword) },\n {\n token: 'identifier.js',\n foreground: removeHashtag(MonacoTheme['identifier-js']),\n },\n {\n token: 'delimiter',\n foreground: removeHashtag(MonacoTheme.delimiter),\n },\n { token: 'comment', foreground: removeHashtag(MonacoTheme.comment) },\n { token: 'number', foreground: removeHashtag(MonacoTheme.number) },\n { token: 'storage', foreground: removeHashtag(MonacoTheme.storage) },\n {\n token: 'identifier',\n foreground: removeHashtag(MonacoTheme.identifier),\n },\n {\n token: 'namespace.identifier',\n foreground: removeHashtag(MonacoTheme['namespace-identifier']),\n },\n { token: 'operator', foreground: removeHashtag(MonacoTheme.operator) },\n {\n token: 'predefined',\n foreground: removeHashtag(MonacoTheme.predefined),\n },\n {\n token: 'error.log',\n foreground: MonacoTheme['log-error'].substring(1),\n },\n {\n token: 'warn.log',\n foreground: removeHashtag(MonacoTheme['log-warn']),\n },\n {\n token: 'info.log',\n foreground: removeHashtag(MonacoTheme['log-info']),\n },\n {\n token: 'stdout.log',\n foreground: removeHashtag(MonacoTheme['log-stdout']),\n },\n {\n token: 'trace.log',\n foreground: removeHashtag(MonacoTheme['log-trace']),\n },\n {\n token: 'debug.log',\n foreground: removeHashtag(MonacoTheme['log-debug']),\n },\n {\n token: 'date.log',\n foreground: removeHashtag(MonacoTheme['log-date']),\n },\n ];\n\n const dhDarkColors = {\n errorForeground: MonacoTheme['error-foreground'],\n 'inputOption.activeBorder': MonacoTheme['input-option-active-border'],\n 'editor.background': MonacoTheme.background,\n 'editor.foreground': MonacoTheme.foreground,\n 'editor.lineHighlightBackground': MonacoTheme['editor-line-highlight-bg'],\n 'editorLineNumber.foreground':\n MonacoTheme['editor-line-number-foreground'],\n 'editor.selectionBackground': MonacoTheme['editor-selection-background'],\n 'editor.findMatchBackground': MonacoTheme['editor-find-match-background'],\n 'editor.findMatchHighlightBackground':\n MonacoTheme['editor-find-match-highlight-background'],\n 'editorSuggestWidget.background':\n MonacoTheme['editor-suggest-widget-background'],\n 'editorSuggestWidget.border': MonacoTheme['editor-suggest-widget-border'],\n 'editorSuggestWidget.foreground':\n MonacoTheme['editor-suggest-widget-foreground'],\n 'editorSuggestWidget.selectedBackground':\n MonacoTheme['editor-suggest-widget-selected-background'],\n 'editorSuggestWidget.highlightForeground':\n MonacoTheme['editor-suggest-widget-highlightForeground'],\n 'list.hoverBackground': MonacoTheme['list-hover-background'],\n 'dropdown.background': MonacoTheme['context-menu-background'],\n 'dropdown.foreground': MonacoTheme['context-menu-foreground'],\n 'menu.selectionBackground': MonacoTheme['menu-selection-background'],\n 'list.focusBackground': MonacoTheme['menu-selection-background'],\n 'editorWidget.background': MonacoTheme['editor-widget-background'],\n 'inputOption.activeBackground':\n MonacoTheme['input-option-active-background'],\n 'inputOption.activeForeground':\n MonacoTheme['input-option-active-foreground'],\n focusBorder: MonacoTheme['focus-border'],\n 'input.background': MonacoTheme['input-background'],\n 'input.foreground': MonacoTheme['input-foreground'],\n 'input.border': MonacoTheme['input-border'],\n };\n\n monaco.editor.defineTheme('dh-dark', {\n base: 'vs-dark',\n inherit: true,\n rules: dhDarkRules,\n colors: dhDarkColors,\n });\n log.debug2('monaco theme: ', MonacoTheme);\n monaco.editor.setTheme('dh-dark');\n\n registerLanguages([DbLang, PyLang, GroovyLang, LogLang, ScalaLang]);\n\n log.debug('Monaco initialized.');\n }\n\n /**\n * Remove the hashtag prefix from a CSS color string.\n * Monaco expects colors to be the value only, no hashtag.\n * @param color The hex color string to remove the hashtag from, eg. '#ffffff'\n */\n static removeHashtag(color: string): string {\n return color.substring(1);\n }\n\n static registerLanguages(languages: Language[]): void {\n // First override the default loader for any language we have a custom definition for\n // https://github.com/Microsoft/monaco-editor/issues/252#issuecomment-482786867\n const languageIds = languages.map(({ id }) => id);\n monaco.languages\n .getLanguages()\n .filter(({ id }) => languageIds.includes(id))\n .forEach(languageParam => {\n const language = languageParam;\n log.debug2('Overriding default language loader:', language.id);\n });\n\n // Then register our language definitions\n languages.forEach(language => {\n MonacoUtils.registerLanguage(language);\n });\n }\n\n static registerLanguage(language: Language): void {\n log.debug2('Registering language: ', language.id);\n monaco.languages.register(language);\n\n monaco.languages.onLanguage(language.id, () => {\n monaco.languages.setLanguageConfiguration(language.id, language.conf);\n monaco.languages.setMonarchTokensProvider(language.id, language.language);\n });\n }\n\n /**\n * Set EOL preference for the editor\n * @param editor The editor to set the EOL for\n * @param eolSequence EOL sequence\n */\n static setEOL(\n editor: monaco.editor.IStandaloneCodeEditor,\n eolSequence = monaco.editor.EndOfLineSequence.LF\n ): void {\n editor.getModel()?.setEOL(eolSequence);\n }\n\n /**\n * Links an editor with a provided session to provide completion items.\n * @param session The IdeSession to link\n * @param editor The editor to link the session to\n * @returns A cleanup function for disposing of the created listeners\n */\n static openDocument(\n editor: monaco.editor.IStandaloneCodeEditor,\n session: IdeSession\n ): monaco.IDisposable {\n const model = editor.getModel();\n assertNotNull(model);\n const didOpenDocumentParams = {\n textDocument: {\n uri: `${model.uri}`,\n languageId: model.getLanguageId(),\n version: model.getVersionId(),\n text: model.getValue(),\n },\n };\n log.debug2('didOpenDocumentParams: ', didOpenDocumentParams);\n\n session.openDocument(didOpenDocumentParams);\n\n const dispose = editor.onDidChangeModelContent(changedEvent => {\n const { changes, versionId } = changedEvent;\n\n const contentChanges = [];\n for (let i = 0; i < changes.length; i += 1) {\n const change = changes[i];\n const { range, rangeLength, text } = change;\n const contentChange = {\n range: {\n start: {\n line: range.startLineNumber - 1,\n character: range.startColumn - 1,\n },\n end: {\n line: range.endLineNumber - 1,\n character: range.endColumn - 1,\n },\n },\n rangeLength,\n text,\n };\n\n contentChanges.push(contentChange);\n }\n\n if (contentChanges.length > 0) {\n const didChangeDocumentParams = {\n textDocument: {\n version: versionId,\n uri: `${model.uri}`,\n },\n contentChanges,\n };\n log.debug2('didChangeDocumentParams', didChangeDocumentParams);\n session.changeDocument(didChangeDocumentParams);\n }\n });\n\n return dispose;\n }\n\n static closeDocument(\n editor: monaco.editor.IStandaloneCodeEditor,\n session: IdeSession\n ): void {\n const model = editor.getModel();\n assertNotNull(model);\n const didCloseDocumentParams = {\n textDocument: {\n uri: `${model.uri}`,\n },\n };\n session.closeDocument(didCloseDocumentParams);\n }\n\n /**\n * Register a paste handle to clean up any garbage code pasted.\n * Most of this comes from copying from Slack, which has a bad habit of injecting their own characters in your code snippets.\n * I've emailed Slack about the issue and they're working on it. I can't reference a ticket number because their ticket system is entirely internally facing.\n * @param editor The editor the register the paste handler for\n */\n static registerPasteHandler(\n editor: monaco.editor.IStandaloneCodeEditor\n ): void {\n editor.onDidPaste(pasteEvent => {\n const smartQuotes = /“|”/g;\n const invalidChars = /\\u200b/g;\n const editorModel = editor.getModel();\n assertNotNull(editorModel);\n const pastedText = editorModel.getValueInRange(pasteEvent.range);\n if (smartQuotes.test(pastedText) || invalidChars.test(pastedText)) {\n editorModel.applyEdits([\n {\n range: pasteEvent.range,\n text: pastedText\n .replace(smartQuotes, '\"')\n .replace(invalidChars, ''),\n },\n ]);\n }\n });\n }\n\n static isMacPlatform(): boolean {\n const { platform } = window.navigator;\n return platform.startsWith('Mac');\n }\n\n /**\n * Remove any keybindings which are used for our own shortcuts.\n * This allows the key events to bubble up so a component higher up can capture them\n * @param editor The editor to remove the keybindings from\n */\n static removeConflictingKeybindings(\n editor: monaco.editor.IStandaloneCodeEditor\n ): void {\n // Multi-mod key events have a specific order\n // E.g. ctrl+alt+UpArrow is not found, but alt+ctrl+UpArrow is found\n // meta is WindowsKey on Windows and cmd on Mac\n // ctrl is ctrl Windows and ctrl on Mac\n // alt is alt on Windows and option on Mac\n const keybindings = [\n {\n windows: 'ctrl+D',\n mac: 'meta+D',\n },\n {\n windows: 'ctrl+H',\n },\n ];\n\n try {\n keybindings.forEach(keybinding => {\n if (\n (MonacoUtils.isMacPlatform() && keybinding.mac === '') ||\n (!MonacoUtils.isMacPlatform() && keybinding.windows === '')\n ) {\n return;\n }\n MonacoUtils.removeKeybinding(\n editor,\n MonacoUtils.isMacPlatform() ? keybinding.mac : keybinding.windows\n );\n });\n } catch (err) {\n // This is probably only caused by Monaco changing private methods used here\n log.error(err);\n }\n }\n\n /**\n * Remove a keybinding and allow the events to bubble up\n * If you want the keybinding removed for all editors, add it to removeConflictingKeybindings\n * Monaco still captures the event if you choose to override the keybinding with a no-op function\n *\n * Based on the following comment to remove a keybinding and let the event bubble up\n * https://github.com/microsoft/monaco-editor/issues/287#issuecomment-331447475\n * The issue for an API for this has apparently been open since 2016. Link below\n * https://github.com/microsoft/monaco-editor/issues/102\n * @param editor The editor to remove the keybinding from\n * @param keybinding The key string to remove. E.g. 'ctrl+C' for copy on Windows\n */\n static removeKeybinding(\n editor: monaco.editor.IStandaloneCodeEditor,\n keybinding: string | undefined\n ): void {\n if (keybinding === undefined) {\n return;\n }\n\n /* eslint-disable no-underscore-dangle */\n // It's possible a single keybinding has multiple commands depending on context\n // @ts-ignore\n const keybindings = editor._standaloneKeybindingService\n ._getResolver()\n ._map.get(keybinding);\n\n if (keybindings != null) {\n keybindings.forEach((elem: { command: unknown }) => {\n log.debug2(\n `Removing Monaco keybinding ${keybinding} for ${elem.command}`\n );\n // @ts-ignore\n editor._standaloneKeybindingService.addDynamicKeybinding(\n `-${elem.command}`,\n null,\n () => undefined\n );\n });\n } else {\n log.warn(`Did not find any keybindings to remove for ${keybinding}`);\n }\n /* eslint-enable no-underscore-dangle */\n }\n\n static getMonacoKeyCodeFromShortcut(shortcut: Shortcut): number {\n const { keyState } = shortcut;\n const { keyValue } = keyState;\n if (keyValue === null) {\n return 0;\n }\n\n const isMac = MonacoUtils.isMacPlatform();\n\n if (isMac) {\n return (\n // eslint-disable-next-line no-bitwise\n (keyState.metaKey ? monaco.KeyMod.CtrlCmd : 0) |\n (keyState.shiftKey ? monaco.KeyMod.Shift : 0) |\n (keyState.altKey ? monaco.KeyMod.Alt : 0) |\n (keyState.ctrlKey ? monaco.KeyMod.WinCtrl : 0) |\n KeyCodeUtils.fromString(keyValue)\n );\n }\n\n return (\n // eslint-disable-next-line no-bitwise\n (keyState.ctrlKey ? monaco.KeyMod.CtrlCmd : 0) |\n (keyState.shiftKey ? monaco.KeyMod.Shift : 0) |\n (keyState.altKey ? monaco.KeyMod.Alt : 0) |\n (keyState.metaKey ? monaco.KeyMod.WinCtrl : 0) |\n KeyCodeUtils.fromString(keyValue)\n );\n }\n}\n\nexport default MonacoUtils;\n"],"mappings":"AAAA;;AACA;AACA;AACA;AAGA,SAASA,aAAT,QAA8B,kBAA9B;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AAEA;AACA,SAASC,YAAT,QAA6B,8CAA7B,C,CACA;;A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IAED,IAAMC,KAAK,GAAG7H,WAAW,CAACoG,aAAZ,EAAd;;IAEA,IAAIyB,KAAJ,EAAW;MACT,OACE;QACA,CAACF,QAAQ,CAACG,OAAT,GAAmB7I,MAAM,CAAC8I,MAAP,CAAcC,OAAjC,GAA2C,CAA5C,KACCL,QAAQ,CAACM,QAAT,GAAoBhJ,MAAM,CAAC8I,MAAP,CAAcG,KAAlC,GAA0C,CAD3C,KAECP,QAAQ,CAACQ,MAAT,GAAkBlJ,MAAM,CAAC8I,MAAP,CAAcK,GAAhC,GAAsC,CAFvC,KAGCT,QAAQ,CAACU,OAAT,GAAmBpJ,MAAM,CAAC8I,MAAP,CAAcO,OAAjC,GAA2C,CAH5C,IAIApJ,YAAY,CAACqJ,UAAb,CAAwBX,QAAxB;MANF;IAQD;;IAED,OACE;MACA,CAACD,QAAQ,CAACU,OAAT,GAAmBpJ,MAAM,CAAC8I,MAAP,CAAcC,OAAjC,GAA2C,CAA5C,KACCL,QAAQ,CAACM,QAAT,GAAoBhJ,MAAM,CAAC8I,MAAP,CAAcG,KAAlC,GAA0C,CAD3C,KAECP,QAAQ,CAACQ,MAAT,GAAkBlJ,MAAM,CAAC8I,MAAP,CAAcK,GAAhC,GAAsC,CAFvC,KAGCT,QAAQ,CAACG,OAAT,GAAmB7I,MAAM,CAAC8I,MAAP,CAAcO,OAAjC,GAA2C,CAH5C,IAIApJ,YAAY,CAACqJ,UAAb,CAAwBX,QAAxB;IANF;EAQD;;AA3Ye;;AA8YlB,eAAe5H,WAAf"}
|
|
1
|
+
{"version":3,"file":"MonacoUtils.js","names":["assertNotNull","monaco","KeyCodeUtils","Log","MonacoTheme","PyLang","GroovyLang","ScalaLang","DbLang","LogLang","log","module","MonacoUtils","init","getWorker","debug","undefined","registerGetWorker","registerLanguages","removeHashtag","dhDarkRules","token","foreground","string","keyword","delimiter","comment","number","storage","identifier","operator","predefined","substring","dhDarkColors","errorForeground","background","focusBorder","editor","defineTheme","base","inherit","rules","colors","debug2","setTheme","window","MonacoEnvironment","color","languages","languageIds","map","id","getLanguages","filter","includes","forEach","languageParam","language","registerLanguage","register","onLanguage","setLanguageConfiguration","conf","setMonarchTokensProvider","setEOL","eolSequence","EndOfLineSequence","LF","getModel","openDocument","session","model","didOpenDocumentParams","textDocument","uri","languageId","getLanguageId","version","getVersionId","text","getValue","dispose","onDidChangeModelContent","changedEvent","changes","versionId","contentChanges","i","length","change","range","rangeLength","contentChange","start","line","startLineNumber","character","startColumn","end","endLineNumber","endColumn","push","didChangeDocumentParams","changeDocument","closeDocument","didCloseDocumentParams","registerPasteHandler","onDidPaste","pasteEvent","smartQuotes","invalidChars","editorModel","pastedText","getValueInRange","test","applyEdits","replace","isMacPlatform","platform","navigator","startsWith","removeConflictingKeybindings","keybindings","windows","mac","keybinding","removeKeybinding","err","error","_standaloneKeybindingService","_getResolver","_map","get","elem","command","addDynamicKeybinding","warn","getMonacoKeyCodeFromShortcut","shortcut","keyState","keyValue","isMac","metaKey","KeyMod","CtrlCmd","shiftKey","Shift","altKey","Alt","ctrlKey","WinCtrl","fromString"],"sources":["../../src/monaco/MonacoUtils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\n/**\n * Exports a function for initializing monaco with the deephaven theme/config\n */\nimport { Shortcut } from '@deephaven/components';\nimport { IdeSession } from '@deephaven/jsapi-shim';\nimport { assertNotNull } from '@deephaven/utils';\nimport * as monaco from 'monaco-editor';\nimport type { Environment } from 'monaco-editor';\n// @ts-ignore\nimport { KeyCodeUtils } from 'monaco-editor/esm/vs/base/common/keyCodes.js';\nimport Log from '@deephaven/log';\nimport MonacoTheme from './MonacoTheme.module.scss';\nimport PyLang from './lang/python';\nimport GroovyLang from './lang/groovy';\nimport ScalaLang from './lang/scala';\nimport DbLang from './lang/db';\nimport LogLang from './lang/log';\nimport { Language } from './lang/Language';\n\nconst log = Log.module('MonacoUtils');\n\ndeclare global {\n interface Window {\n MonacoEnvironment?: Environment;\n }\n}\n\nclass MonacoUtils {\n /**\n * Initializes Monaco for the environment\n * @param getWorker The getWorker function Monaco should use\n * The workers should be provided by the caller and bundled by their build system (e.g. Vite, Webpack)\n */\n static init({\n getWorker,\n }: { getWorker?: Environment['getWorker'] } = {}): void {\n log.debug('Initializing Monaco...');\n\n if (getWorker !== undefined) {\n MonacoUtils.registerGetWorker(getWorker);\n }\n\n const { registerLanguages, removeHashtag } = MonacoUtils;\n\n const dhDarkRules = [\n { token: '', foreground: removeHashtag(MonacoTheme.foreground) },\n { token: 'string', foreground: removeHashtag(MonacoTheme.string) },\n {\n token: 'string.delim',\n foreground: removeHashtag(MonacoTheme['string-delim']),\n },\n { token: 'keyword', foreground: removeHashtag(MonacoTheme.keyword) },\n {\n token: 'identifier.js',\n foreground: removeHashtag(MonacoTheme['identifier-js']),\n },\n {\n token: 'delimiter',\n foreground: removeHashtag(MonacoTheme.delimiter),\n },\n { token: 'comment', foreground: removeHashtag(MonacoTheme.comment) },\n { token: 'number', foreground: removeHashtag(MonacoTheme.number) },\n { token: 'storage', foreground: removeHashtag(MonacoTheme.storage) },\n {\n token: 'identifier',\n foreground: removeHashtag(MonacoTheme.identifier),\n },\n {\n token: 'namespace.identifier',\n foreground: removeHashtag(MonacoTheme['namespace-identifier']),\n },\n { token: 'operator', foreground: removeHashtag(MonacoTheme.operator) },\n {\n token: 'predefined',\n foreground: removeHashtag(MonacoTheme.predefined),\n },\n {\n token: 'error.log',\n foreground: MonacoTheme['log-error'].substring(1),\n },\n {\n token: 'warn.log',\n foreground: removeHashtag(MonacoTheme['log-warn']),\n },\n {\n token: 'info.log',\n foreground: removeHashtag(MonacoTheme['log-info']),\n },\n {\n token: 'stdout.log',\n foreground: removeHashtag(MonacoTheme['log-stdout']),\n },\n {\n token: 'trace.log',\n foreground: removeHashtag(MonacoTheme['log-trace']),\n },\n {\n token: 'debug.log',\n foreground: removeHashtag(MonacoTheme['log-debug']),\n },\n {\n token: 'date.log',\n foreground: removeHashtag(MonacoTheme['log-date']),\n },\n ];\n\n const dhDarkColors = {\n errorForeground: MonacoTheme['error-foreground'],\n 'inputOption.activeBorder': MonacoTheme['input-option-active-border'],\n 'editor.background': MonacoTheme.background,\n 'editor.foreground': MonacoTheme.foreground,\n 'editor.lineHighlightBackground': MonacoTheme['editor-line-highlight-bg'],\n 'editorLineNumber.foreground':\n MonacoTheme['editor-line-number-foreground'],\n 'editor.selectionBackground': MonacoTheme['editor-selection-background'],\n 'editor.findMatchBackground': MonacoTheme['editor-find-match-background'],\n 'editor.findMatchHighlightBackground':\n MonacoTheme['editor-find-match-highlight-background'],\n 'editorSuggestWidget.background':\n MonacoTheme['editor-suggest-widget-background'],\n 'editorSuggestWidget.border': MonacoTheme['editor-suggest-widget-border'],\n 'editorSuggestWidget.foreground':\n MonacoTheme['editor-suggest-widget-foreground'],\n 'editorSuggestWidget.selectedBackground':\n MonacoTheme['editor-suggest-widget-selected-background'],\n 'editorSuggestWidget.highlightForeground':\n MonacoTheme['editor-suggest-widget-highlightForeground'],\n 'list.hoverBackground': MonacoTheme['list-hover-background'],\n 'dropdown.background': MonacoTheme['context-menu-background'],\n 'dropdown.foreground': MonacoTheme['context-menu-foreground'],\n 'menu.selectionBackground': MonacoTheme['menu-selection-background'],\n 'list.focusBackground': MonacoTheme['menu-selection-background'],\n 'editorWidget.background': MonacoTheme['editor-widget-background'],\n 'inputOption.activeBackground':\n MonacoTheme['input-option-active-background'],\n 'inputOption.activeForeground':\n MonacoTheme['input-option-active-foreground'],\n focusBorder: MonacoTheme['focus-border'],\n 'input.background': MonacoTheme['input-background'],\n 'input.foreground': MonacoTheme['input-foreground'],\n 'input.border': MonacoTheme['input-border'],\n };\n\n monaco.editor.defineTheme('dh-dark', {\n base: 'vs-dark',\n inherit: true,\n rules: dhDarkRules,\n colors: dhDarkColors,\n });\n log.debug2('monaco theme: ', MonacoTheme);\n monaco.editor.setTheme('dh-dark');\n\n registerLanguages([DbLang, PyLang, GroovyLang, LogLang, ScalaLang]);\n\n log.debug('Monaco initialized.');\n }\n\n /**\n * Register the getWorker function for Monaco\n * @param getWorker The getWorker function for Monaco\n */\n static registerGetWorker(getWorker: Environment['getWorker']): void {\n window.MonacoEnvironment = {\n ...window.MonacoEnvironment,\n getWorker,\n };\n }\n\n /**\n * Remove the hashtag prefix from a CSS color string.\n * Monaco expects colors to be the value only, no hashtag.\n * @param color The hex color string to remove the hashtag from, eg. '#ffffff'\n */\n static removeHashtag(color: string): string {\n return color.substring(1);\n }\n\n static registerLanguages(languages: Language[]): void {\n // First override the default loader for any language we have a custom definition for\n // https://github.com/Microsoft/monaco-editor/issues/252#issuecomment-482786867\n const languageIds = languages.map(({ id }) => id);\n monaco.languages\n .getLanguages()\n .filter(({ id }) => languageIds.includes(id))\n .forEach(languageParam => {\n const language = languageParam;\n log.debug2('Overriding default language loader:', language.id);\n });\n\n // Then register our language definitions\n languages.forEach(language => {\n MonacoUtils.registerLanguage(language);\n });\n }\n\n static registerLanguage(language: Language): void {\n log.debug2('Registering language: ', language.id);\n monaco.languages.register(language);\n\n monaco.languages.onLanguage(language.id, () => {\n monaco.languages.setLanguageConfiguration(language.id, language.conf);\n monaco.languages.setMonarchTokensProvider(language.id, language.language);\n });\n }\n\n /**\n * Set EOL preference for the editor\n * @param editor The editor to set the EOL for\n * @param eolSequence EOL sequence\n */\n static setEOL(\n editor: monaco.editor.IStandaloneCodeEditor,\n eolSequence = monaco.editor.EndOfLineSequence.LF\n ): void {\n editor.getModel()?.setEOL(eolSequence);\n }\n\n /**\n * Links an editor with a provided session to provide completion items.\n * @param session The IdeSession to link\n * @param editor The editor to link the session to\n * @returns A cleanup function for disposing of the created listeners\n */\n static openDocument(\n editor: monaco.editor.IStandaloneCodeEditor,\n session: IdeSession\n ): monaco.IDisposable {\n const model = editor.getModel();\n assertNotNull(model);\n const didOpenDocumentParams = {\n textDocument: {\n uri: `${model.uri}`,\n languageId: model.getLanguageId(),\n version: model.getVersionId(),\n text: model.getValue(),\n },\n };\n log.debug2('didOpenDocumentParams: ', didOpenDocumentParams);\n\n session.openDocument(didOpenDocumentParams);\n\n const dispose = editor.onDidChangeModelContent(changedEvent => {\n const { changes, versionId } = changedEvent;\n\n const contentChanges = [];\n for (let i = 0; i < changes.length; i += 1) {\n const change = changes[i];\n const { range, rangeLength, text } = change;\n const contentChange = {\n range: {\n start: {\n line: range.startLineNumber - 1,\n character: range.startColumn - 1,\n },\n end: {\n line: range.endLineNumber - 1,\n character: range.endColumn - 1,\n },\n },\n rangeLength,\n text,\n };\n\n contentChanges.push(contentChange);\n }\n\n if (contentChanges.length > 0) {\n const didChangeDocumentParams = {\n textDocument: {\n version: versionId,\n uri: `${model.uri}`,\n },\n contentChanges,\n };\n log.debug2('didChangeDocumentParams', didChangeDocumentParams);\n session.changeDocument(didChangeDocumentParams);\n }\n });\n\n return dispose;\n }\n\n static closeDocument(\n editor: monaco.editor.IStandaloneCodeEditor,\n session: IdeSession\n ): void {\n const model = editor.getModel();\n assertNotNull(model);\n const didCloseDocumentParams = {\n textDocument: {\n uri: `${model.uri}`,\n },\n };\n session.closeDocument(didCloseDocumentParams);\n }\n\n /**\n * Register a paste handle to clean up any garbage code pasted.\n * Most of this comes from copying from Slack, which has a bad habit of injecting their own characters in your code snippets.\n * I've emailed Slack about the issue and they're working on it. I can't reference a ticket number because their ticket system is entirely internally facing.\n * @param editor The editor the register the paste handler for\n */\n static registerPasteHandler(\n editor: monaco.editor.IStandaloneCodeEditor\n ): void {\n editor.onDidPaste(pasteEvent => {\n const smartQuotes = /“|”/g;\n const invalidChars = /\\u200b/g;\n const editorModel = editor.getModel();\n assertNotNull(editorModel);\n const pastedText = editorModel.getValueInRange(pasteEvent.range);\n if (smartQuotes.test(pastedText) || invalidChars.test(pastedText)) {\n editorModel.applyEdits([\n {\n range: pasteEvent.range,\n text: pastedText\n .replace(smartQuotes, '\"')\n .replace(invalidChars, ''),\n },\n ]);\n }\n });\n }\n\n static isMacPlatform(): boolean {\n const { platform } = window.navigator;\n return platform.startsWith('Mac');\n }\n\n /**\n * Remove any keybindings which are used for our own shortcuts.\n * This allows the key events to bubble up so a component higher up can capture them\n * @param editor The editor to remove the keybindings from\n */\n static removeConflictingKeybindings(\n editor: monaco.editor.IStandaloneCodeEditor\n ): void {\n // Multi-mod key events have a specific order\n // E.g. ctrl+alt+UpArrow is not found, but alt+ctrl+UpArrow is found\n // meta is WindowsKey on Windows and cmd on Mac\n // ctrl is ctrl Windows and ctrl on Mac\n // alt is alt on Windows and option on Mac\n const keybindings = [\n {\n windows: 'ctrl+D',\n mac: 'meta+D',\n },\n {\n windows: 'ctrl+H',\n },\n ];\n\n try {\n keybindings.forEach(keybinding => {\n if (\n (MonacoUtils.isMacPlatform() && keybinding.mac === '') ||\n (!MonacoUtils.isMacPlatform() && keybinding.windows === '')\n ) {\n return;\n }\n MonacoUtils.removeKeybinding(\n editor,\n MonacoUtils.isMacPlatform() ? keybinding.mac : keybinding.windows\n );\n });\n } catch (err) {\n // This is probably only caused by Monaco changing private methods used here\n log.error(err);\n }\n }\n\n /**\n * Remove a keybinding and allow the events to bubble up\n * If you want the keybinding removed for all editors, add it to removeConflictingKeybindings\n * Monaco still captures the event if you choose to override the keybinding with a no-op function\n *\n * Based on the following comment to remove a keybinding and let the event bubble up\n * https://github.com/microsoft/monaco-editor/issues/287#issuecomment-331447475\n * The issue for an API for this has apparently been open since 2016. Link below\n * https://github.com/microsoft/monaco-editor/issues/102\n * @param editor The editor to remove the keybinding from\n * @param keybinding The key string to remove. E.g. 'ctrl+C' for copy on Windows\n */\n static removeKeybinding(\n editor: monaco.editor.IStandaloneCodeEditor,\n keybinding: string | undefined\n ): void {\n if (keybinding === undefined) {\n return;\n }\n\n /* eslint-disable no-underscore-dangle */\n // It's possible a single keybinding has multiple commands depending on context\n // @ts-ignore\n const keybindings = editor._standaloneKeybindingService\n ._getResolver()\n ._map.get(keybinding);\n\n if (keybindings != null) {\n keybindings.forEach((elem: { command: unknown }) => {\n log.debug2(\n `Removing Monaco keybinding ${keybinding} for ${elem.command}`\n );\n // @ts-ignore\n editor._standaloneKeybindingService.addDynamicKeybinding(\n `-${elem.command}`,\n null,\n () => undefined\n );\n });\n } else {\n log.warn(`Did not find any keybindings to remove for ${keybinding}`);\n }\n /* eslint-enable no-underscore-dangle */\n }\n\n static getMonacoKeyCodeFromShortcut(shortcut: Shortcut): number {\n const { keyState } = shortcut;\n const { keyValue } = keyState;\n if (keyValue === null) {\n return 0;\n }\n\n const isMac = MonacoUtils.isMacPlatform();\n\n if (isMac) {\n return (\n // eslint-disable-next-line no-bitwise\n (keyState.metaKey ? monaco.KeyMod.CtrlCmd : 0) |\n (keyState.shiftKey ? monaco.KeyMod.Shift : 0) |\n (keyState.altKey ? monaco.KeyMod.Alt : 0) |\n (keyState.ctrlKey ? monaco.KeyMod.WinCtrl : 0) |\n KeyCodeUtils.fromString(keyValue)\n );\n }\n\n return (\n // eslint-disable-next-line no-bitwise\n (keyState.ctrlKey ? monaco.KeyMod.CtrlCmd : 0) |\n (keyState.shiftKey ? monaco.KeyMod.Shift : 0) |\n (keyState.altKey ? monaco.KeyMod.Alt : 0) |\n (keyState.metaKey ? monaco.KeyMod.WinCtrl : 0) |\n KeyCodeUtils.fromString(keyValue)\n );\n }\n}\n\nexport default MonacoUtils;\n"],"mappings":";;;;;;AAAA;;AACA;AACA;AACA;AAGA,SAASA,aAAT,QAA8B,kBAA9B;AACA,OAAO,KAAKC,MAAZ,MAAwB,eAAxB;AAEA;AACA,SAASC,YAAT,QAA6B,8CAA7B;AACA,OAAOC,GAAP,MAAgB,gBAAhB;OACOC,W;OACAC,M;OACAC,U;OACAC,S;OACAC,M;OACAC,O;AAGP,IAAMC,GAAG,GAAGP,GAAG,CAACQ,MAAJ,CAAW,aAAX,CAAZ;;AAQA,MAAMC,WAAN,CAAkB;EAChB;AACF;AACA;AACA;AACA;EACa,OAAJC,IAAI,GAE6C;IAAA,IAF5C;MACVC;IADU,CAE4C,uEAAV,EAAU;IACtDJ,GAAG,CAACK,KAAJ,CAAU,wBAAV;;IAEA,IAAID,SA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C,CAA5C,KACCL,QAAQ,CAACM,QAAT,GAAoBhJ,MAAM,CAAC8I,MAAP,CAAcG,KAAlC,GAA0C,CAD3C,KAECP,QAAQ,CAACQ,MAAT,GAAkBlJ,MAAM,CAAC8I,MAAP,CAAcK,GAAhC,GAAsC,CAFvC,KAGCT,QAAQ,CAACU,OAAT,GAAmBpJ,MAAM,CAAC8I,MAAP,CAAcO,OAAjC,GAA2C,CAH5C,IAIApJ,YAAY,CAACqJ,UAAb,CAAwBX,QAAxB;MANF;IAQD;;IAED,OACE;MACA,CAACD,QAAQ,CAACU,OAAT,GAAmBpJ,MAAM,CAAC8I,MAAP,CAAcC,OAAjC,GAA2C,CAA5C,KACCL,QAAQ,CAACM,QAAT,GAAoBhJ,MAAM,CAAC8I,MAAP,CAAcG,KAAlC,GAA0C,CAD3C,KAECP,QAAQ,CAACQ,MAAT,GAAkBlJ,MAAM,CAAC8I,MAAP,CAAcK,GAAhC,GAAsC,CAFvC,KAGCT,QAAQ,CAACG,OAAT,GAAmB7I,MAAM,CAAC8I,MAAP,CAAcO,OAAjC,GAA2C,CAH5C,IAIApJ,YAAY,CAACqJ,UAAb,CAAwBX,QAAxB;IANF;EAQD;;AAjae;;AAoalB,eAAehI,WAAf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/console",
|
|
3
|
-
"version": "0.21.2-beta.
|
|
3
|
+
"version": "0.21.2-beta.2+37e42ec",
|
|
4
4
|
"description": "Deephaven Console",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"start": "cross-env NODE_ENV=development npm run watch"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@deephaven/chart": "^0.21.2-beta.
|
|
35
|
-
"@deephaven/components": "^0.21.2-beta.
|
|
36
|
-
"@deephaven/icons": "^0.21.2-beta.
|
|
37
|
-
"@deephaven/jsapi-shim": "^0.21.2-beta.
|
|
38
|
-
"@deephaven/log": "^0.21.2-beta.
|
|
39
|
-
"@deephaven/storage": "^0.21.2-beta.
|
|
40
|
-
"@deephaven/utils": "^0.21.2-beta.
|
|
34
|
+
"@deephaven/chart": "^0.21.2-beta.2+37e42ec",
|
|
35
|
+
"@deephaven/components": "^0.21.2-beta.2+37e42ec",
|
|
36
|
+
"@deephaven/icons": "^0.21.2-beta.2+37e42ec",
|
|
37
|
+
"@deephaven/jsapi-shim": "^0.21.2-beta.2+37e42ec",
|
|
38
|
+
"@deephaven/log": "^0.21.2-beta.2+37e42ec",
|
|
39
|
+
"@deephaven/storage": "^0.21.2-beta.2+37e42ec",
|
|
40
|
+
"@deephaven/utils": "^0.21.2-beta.2+37e42ec",
|
|
41
41
|
"@fortawesome/react-fontawesome": "^0.1.18",
|
|
42
42
|
"classnames": "^2.3.1",
|
|
43
43
|
"lodash.debounce": "^4.0.8",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"react-dom": "^17.x"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@deephaven/mocks": "^0.21.2-beta.
|
|
59
|
-
"@deephaven/tsconfig": "^0.21.2-beta.
|
|
58
|
+
"@deephaven/mocks": "^0.21.2-beta.2+37e42ec",
|
|
59
|
+
"@deephaven/tsconfig": "^0.21.2-beta.2+37e42ec"
|
|
60
60
|
},
|
|
61
61
|
"files": [
|
|
62
62
|
"dist"
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"publishConfig": {
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "37e42ecdc341b935f525f5eb50034c2cb908c49d"
|
|
71
71
|
}
|