@eclipse-lyra/extension-notebook 0.7.33 → 0.7.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/javascript-kernel.d.ts +3 -0
- package/dist/javascript-kernel.d.ts.map +1 -0
- package/dist/{notebook-extension-CepcmisO.js → notebook-extension-DNAFwHgc.js} +47 -10
- package/dist/notebook-extension-DNAFwHgc.js.map +1 -0
- package/dist/notebook-extension.d.ts.map +1 -1
- package/dist/notebook-kernel-api--RBL5TaE.js +11 -0
- package/dist/notebook-kernel-api--RBL5TaE.js.map +1 -0
- package/dist/notebook-kernel-api.d.ts +34 -0
- package/dist/notebook-kernel-api.d.ts.map +1 -0
- package/dist/{notebook-runtime-yB3_aIh0.js → notebook-runtime-DFffRmNN.js} +267 -205
- package/dist/notebook-runtime-DFffRmNN.js.map +1 -0
- package/dist/notebook-runtime.d.ts +13 -7
- package/dist/notebook-runtime.d.ts.map +1 -1
- package/dist/notebook-types.d.ts +1 -0
- package/dist/notebook-types.d.ts.map +1 -1
- package/package.json +1 -2
- package/dist/notebook-extension-CepcmisO.js.map +0 -1
- package/dist/notebook-runtime-yB3_aIh0.js.map +0 -1
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { T, i } from "./notebook-kernel-api--RBL5TaE.js";
|
|
1
2
|
import { i18n, extensionRegistry } from "@eclipse-lyra/core";
|
|
2
3
|
import pkg from "../package.json";
|
|
3
4
|
const t = await i18n(/* @__PURE__ */ Object.assign({ "./i18n.de.json": () => import("./i18n.de-a9KEn_KU.js"), "./i18n.en.json": () => import("./i18n.en-Bsu797kK.js") }), true);
|
|
@@ -5,8 +6,12 @@ extensionRegistry.registerExtension({
|
|
|
5
6
|
id: pkg.name,
|
|
6
7
|
name: t.EXT_NOTEBOOK_NAME,
|
|
7
8
|
description: t.EXT_NOTEBOOK_DESC,
|
|
8
|
-
loader: () => import("./notebook-extension-
|
|
9
|
+
loader: () => import("./notebook-extension-DNAFwHgc.js"),
|
|
9
10
|
icon: "lyra jupyter",
|
|
10
|
-
dependencies: [
|
|
11
|
+
dependencies: []
|
|
11
12
|
});
|
|
13
|
+
export {
|
|
14
|
+
T as TARGET_NOTEBOOK_KERNELS,
|
|
15
|
+
i as isNotebookEditorLike
|
|
16
|
+
};
|
|
12
17
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["export * from './notebook-types';\nexport * from './notebook-kernel-api';\nimport { extensionRegistry, i18n } from '@eclipse-lyra/core';\nimport pkg from '../package.json';\n\nconst t = await i18n(import.meta.glob('./i18n*.json'), true);\n\nextensionRegistry.registerExtension({\n id: pkg.name,\n name: t.EXT_NOTEBOOK_NAME,\n description: t.EXT_NOTEBOOK_DESC,\n loader: () => import(\"./notebook-extension\"),\n icon: \"lyra jupyter\",\n dependencies: [],\n});\n"],"names":[],"mappings":";;;AAKA,MAAM,IAAI,MAAM,KAAK,uBAAA,OAAA,EAAA,kBAAA,MAAA,OAAA,uBAAA,GAAA,kBAAA,MAAA,OAAA,uBAAA,EAAA,CAAA,GAAkC,IAAI;AAE3D,kBAAkB,kBAAkB;AAAA,EAClC,IAAI,IAAI;AAAA,EACR,MAAM,EAAE;AAAA,EACR,aAAa,EAAE;AAAA,EACf,QAAQ,MAAM,OAAO,kCAAsB;AAAA,EAC3C,MAAM;AAAA,EACN,cAAc,CAAA;AAChB,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"javascript-kernel.d.ts","sourceRoot":"","sources":["../src/javascript-kernel.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA2C,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAwCjH,eAAO,MAAM,4BAA4B,EAAE,0BAK1C,CAAC"}
|
|
@@ -1,11 +1,48 @@
|
|
|
1
1
|
import { html } from "lit";
|
|
2
|
-
import { activeEditorSignal, File } from "@eclipse-lyra/core";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { createJsRuntime, activeEditorSignal, File } from "@eclipse-lyra/core";
|
|
3
|
+
import { T as TARGET_NOTEBOOK_KERNELS, i as isNotebookEditorLike } from "./notebook-kernel-api--RBL5TaE.js";
|
|
4
|
+
class JavaScriptNotebookKernel {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.id = "javascript";
|
|
7
|
+
this.label = "JavaScript";
|
|
8
|
+
this.language = "javascript";
|
|
9
|
+
this.runtime = null;
|
|
10
|
+
}
|
|
11
|
+
getRuntime() {
|
|
12
|
+
if (!this.runtime) {
|
|
13
|
+
this.runtime = createJsRuntime();
|
|
14
|
+
}
|
|
15
|
+
return this.runtime;
|
|
16
|
+
}
|
|
17
|
+
async getVersion() {
|
|
18
|
+
return "JavaScript";
|
|
19
|
+
}
|
|
20
|
+
async execute(code) {
|
|
21
|
+
try {
|
|
22
|
+
const result = await this.getRuntime().execute(code);
|
|
23
|
+
if (result === void 0 || result === null) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
return { data: String(result) };
|
|
27
|
+
} catch (err) {
|
|
28
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
close() {
|
|
32
|
+
if (this.runtime) {
|
|
33
|
+
this.runtime.close();
|
|
34
|
+
this.runtime = null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
7
37
|
}
|
|
38
|
+
const javascriptKernelContribution = {
|
|
39
|
+
id: "javascript",
|
|
40
|
+
label: "JavaScript",
|
|
41
|
+
language: "javascript",
|
|
42
|
+
loadKernel: async () => new JavaScriptNotebookKernel()
|
|
43
|
+
};
|
|
8
44
|
const notebookExtension = ({ editorRegistry, commandRegistry, contributionRegistry }) => {
|
|
45
|
+
contributionRegistry.registerContribution(TARGET_NOTEBOOK_KERNELS, javascriptKernelContribution);
|
|
9
46
|
const INITIAL_NOTEBOOK_CONTENT = {
|
|
10
47
|
cells: [
|
|
11
48
|
{
|
|
@@ -15,17 +52,17 @@ const notebookExtension = ({ editorRegistry, commandRegistry, contributionRegist
|
|
|
15
52
|
},
|
|
16
53
|
{
|
|
17
54
|
cell_type: "code",
|
|
18
|
-
source: ['
|
|
55
|
+
source: ['self.postMessage("Hello, World!")'],
|
|
19
56
|
execution_count: null,
|
|
20
57
|
outputs: [],
|
|
21
58
|
metadata: {}
|
|
22
59
|
}
|
|
23
60
|
],
|
|
24
|
-
metadata: {},
|
|
61
|
+
metadata: { kernel: "javascript" },
|
|
25
62
|
nbformat: 4,
|
|
26
63
|
nbformat_minor: 4
|
|
27
64
|
};
|
|
28
|
-
commandRegistry.registerHandler("
|
|
65
|
+
commandRegistry.registerHandler("notebook.runCell", {
|
|
29
66
|
ranking: 10,
|
|
30
67
|
canExecute: (context) => {
|
|
31
68
|
const activeEditor = activeEditorSignal.get();
|
|
@@ -52,7 +89,7 @@ const notebookExtension = ({ editorRegistry, commandRegistry, contributionRegist
|
|
|
52
89
|
editorId: "system.notebooeditor",
|
|
53
90
|
label: "Jupyter Notebook",
|
|
54
91
|
icon: "lyra jupyter",
|
|
55
|
-
lazyInit: () => import("./notebook-runtime-
|
|
92
|
+
lazyInit: () => import("./notebook-runtime-DFffRmNN.js"),
|
|
56
93
|
canHandle: (input) => input instanceof File && input.getName().toLowerCase().endsWith(".ipynb"),
|
|
57
94
|
handle: async (input) => {
|
|
58
95
|
const editorInput = {
|
|
@@ -84,4 +121,4 @@ const notebookExtension = ({ editorRegistry, commandRegistry, contributionRegist
|
|
|
84
121
|
export {
|
|
85
122
|
notebookExtension as default
|
|
86
123
|
};
|
|
87
|
-
//# sourceMappingURL=notebook-extension-
|
|
124
|
+
//# sourceMappingURL=notebook-extension-DNAFwHgc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-extension-DNAFwHgc.js","sources":["../src/javascript-kernel.ts","../src/notebook-extension.ts"],"sourcesContent":["import { createJsRuntime, type JsRuntime } from '@eclipse-lyra/core';\nimport type { NotebookExecutionResult, NotebookKernel, NotebookKernelContribution } from './notebook-kernel-api';\n\nclass JavaScriptNotebookKernel implements NotebookKernel {\n readonly id = 'javascript';\n readonly label = 'JavaScript';\n readonly language = 'javascript';\n\n private runtime: JsRuntime | null = null;\n\n private getRuntime(): JsRuntime {\n if (!this.runtime) {\n this.runtime = createJsRuntime();\n }\n return this.runtime;\n }\n\n async getVersion(): Promise<string> {\n return 'JavaScript';\n }\n\n async execute(code: string): Promise<NotebookExecutionResult> {\n try {\n const result = await this.getRuntime().execute(code);\n if (result === undefined || result === null) {\n return {};\n }\n return { data: String(result) };\n } catch (err) {\n return { error: err instanceof Error ? err.message : String(err) };\n }\n }\n\n close(): void {\n if (this.runtime) {\n this.runtime.close();\n this.runtime = null;\n }\n }\n}\n\nexport const javascriptKernelContribution: NotebookKernelContribution = {\n id: 'javascript',\n label: 'JavaScript',\n language: 'javascript',\n loadKernel: async (): Promise<NotebookKernel> => new JavaScriptNotebookKernel(),\n};\n","import { html } from \"lit\";\nimport type { EditorInput } from \"@eclipse-lyra/core\";\nimport { File } from \"@eclipse-lyra/core\";\nimport { activeEditorSignal } from \"@eclipse-lyra/core\";\nimport type { ExecutionContext } from \"@eclipse-lyra/core\";\nimport { NotebookData, isNotebookEditorLike } from \"./notebook-types\";\nimport { TARGET_NOTEBOOK_KERNELS } from \"./notebook-kernel-api\";\nimport { javascriptKernelContribution } from \"./javascript-kernel\";\n\nexport default ({ editorRegistry, commandRegistry, contributionRegistry }: any) => {\n contributionRegistry.registerContribution(TARGET_NOTEBOOK_KERNELS, javascriptKernelContribution);\n\n const INITIAL_NOTEBOOK_CONTENT: NotebookData = {\n cells: [\n {\n cell_type: 'markdown',\n source: ['Press the **Run** button in the code cell below to execute it.'],\n metadata: {}\n },\n {\n cell_type: 'code',\n source: ['self.postMessage(\"Hello, World!\")'],\n execution_count: null,\n outputs: [],\n metadata: {}\n }\n ],\n metadata: { kernel: 'javascript' },\n nbformat: 4,\n nbformat_minor: 4\n };\n commandRegistry.registerHandler('notebook.runCell', {\n ranking: 10,\n canExecute: (context: ExecutionContext) => {\n const activeEditor = activeEditorSignal.get();\n if (isNotebookEditorLike(activeEditor)) {\n const cellIndex = context.params?.cellIndex;\n if (cellIndex !== undefined) {\n return cellIndex >= 0 && cellIndex < (activeEditor.notebook?.cells.length ?? 0);\n }\n return activeEditor.focusedCellIndex >= 0;\n }\n return false;\n },\n execute: async (context: ExecutionContext) => {\n const activeEditor = activeEditorSignal.get();\n if (isNotebookEditorLike(activeEditor)) {\n const cellIndex = context.params?.cellIndex ?? activeEditor.focusedCellIndex;\n if (cellIndex >= 0) {\n await activeEditor.executeCell(cellIndex);\n }\n }\n }\n });\n\n editorRegistry.registerEditorInputHandler({\n editorId: \"system.notebooeditor\",\n label: \"Jupyter Notebook\",\n icon: \"lyra jupyter\",\n lazyInit: () => import('./notebook-runtime'),\n canHandle: (input: any) => input instanceof File && input.getName().toLowerCase().endsWith(\".ipynb\"),\n handle: async (input: File) => {\n const editorInput = {\n title: input.getName(),\n data: input,\n key: input.getName(),\n icon: \"lyra jupyter\",\n noOverflow: true,\n state: {},\n } as EditorInput;\n editorInput.component = () => html`\n <lyra-notebook-editor .input=${editorInput}></lyra-notebook-editor>`;\n return editorInput;\n },\n ranking: 100,\n });\n\n contributionRegistry.registerContribution('filebrowser.create', {\n label: 'Jupyter Notebook',\n icon: 'lyra jupyter',\n command: 'touch',\n params: {\n path: \"notebook.ipynb\",\n extension: '.ipynb',\n ask: true,\n contents: JSON.stringify(INITIAL_NOTEBOOK_CONTENT, null, 2)\n }\n });\n};\n\n\n"],"names":[],"mappings":";;;AAGA,MAAM,yBAAmD;AAAA,EAAzD,cAAA;AACE,SAAS,KAAK;AACd,SAAS,QAAQ;AACjB,SAAS,WAAW;AAEpB,SAAQ,UAA4B;AAAA,EAAA;AAAA,EAE5B,aAAwB;AAC9B,QAAI,CAAC,KAAK,SAAS;AACjB,WAAK,UAAU,gBAAA;AAAA,IACjB;AACA,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAM,aAA8B;AAClC,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,QAAQ,MAAgD;AAC5D,QAAI;AACF,YAAM,SAAS,MAAM,KAAK,WAAA,EAAa,QAAQ,IAAI;AACnD,UAAI,WAAW,UAAa,WAAW,MAAM;AAC3C,eAAO,CAAA;AAAA,MACT;AACA,aAAO,EAAE,MAAM,OAAO,MAAM,EAAA;AAAA,IAC9B,SAAS,KAAK;AACZ,aAAO,EAAE,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,EAAA;AAAA,IACjE;AAAA,EACF;AAAA,EAEA,QAAc;AACZ,QAAI,KAAK,SAAS;AAChB,WAAK,QAAQ,MAAA;AACb,WAAK,UAAU;AAAA,IACjB;AAAA,EACF;AACF;AAEO,MAAM,+BAA2D;AAAA,EACtE,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY,YAAqC,IAAI,yBAAA;AACvD;ACrCA,MAAA,oBAAe,CAAC,EAAE,gBAAgB,iBAAiB,2BAAgC;AAC/E,uBAAqB,qBAAqB,yBAAyB,4BAA4B;AAE/F,QAAM,2BAAyC;AAAA,IAC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QACN,KAAK,MAAM,QAAA;AAAA,QACX,MAAM;AAAA,QACN,YAAY;AAAA,QACZ,OAAO,CAAA;AAAA,MAAC;AAEZ,kBAAY,YAAY,MAAM;AAAA,+CACK,WAAW;AAC9C,aAAO;AAAA,IACX;AAAA,IACA,SAAS;AAAA,EAAA,CACZ;AAED,uBAAqB,qBAAqB,sBAAsB;AAAA,IAC5D,OAAO;AAAA,IACP,MAAM;AAAA,IACN,SAAS;AAAA,IACT,QAAQ;AAAA,MACJ,MAAM;AAAA,MACN,WAAW;AAAA,MACX,KAAK;AAAA,MACL,UAAU,KAAK,UAAU,0BAA0B,MAAM,CAAC;AAAA,IAAA;AAAA,EAC9D,CACH;AACL;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notebook-extension.d.ts","sourceRoot":"","sources":["../src/notebook-extension.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notebook-extension.d.ts","sourceRoot":"","sources":["../src/notebook-extension.ts"],"names":[],"mappings":"yBASgB,2DAA2D,GAAG;AAA9E,wBA+EE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function isNotebookEditorLike(value) {
|
|
2
|
+
return Boolean(
|
|
3
|
+
value && typeof value.executeCell === "function" && typeof value.focusedCellIndex === "number"
|
|
4
|
+
);
|
|
5
|
+
}
|
|
6
|
+
const TARGET_NOTEBOOK_KERNELS = "system.notebookkernels";
|
|
7
|
+
export {
|
|
8
|
+
TARGET_NOTEBOOK_KERNELS as T,
|
|
9
|
+
isNotebookEditorLike as i
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=notebook-kernel-api--RBL5TaE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-kernel-api--RBL5TaE.js","sources":["../src/notebook-types.ts","../src/notebook-kernel-api.ts"],"sourcesContent":["export interface NotebookCell {\n cell_type: 'code' | 'markdown' | 'raw';\n source: string | string[];\n outputs?: any[];\n execution_count?: number | null;\n metadata?: any;\n}\n\nexport interface NotebookData {\n cells: NotebookCell[];\n metadata?: {\n kernel?: string;\n required_packages?: string[];\n [key: string]: any;\n };\n nbformat?: number;\n nbformat_minor?: number;\n}\n\nexport interface NotebookEditorLike {\n notebook?: NotebookData;\n focusedCellIndex: number;\n executeCell(index: number): Promise<void>;\n}\n\nexport function isNotebookEditorLike(value: unknown): value is NotebookEditorLike {\n return Boolean(\n value &&\n typeof (value as NotebookEditorLike).executeCell === 'function' &&\n typeof (value as NotebookEditorLike).focusedCellIndex === 'number'\n );\n}\n\n\n","export const TARGET_NOTEBOOK_KERNELS = 'system.notebookkernels';\n\nexport interface NotebookExecutionResult {\n data?: string;\n imageData?: string;\n error?: string;\n}\n\nexport interface NotebookKernel {\n readonly id: string;\n readonly label: string;\n readonly icon?: string;\n readonly language: string;\n execute(code: string): Promise<NotebookExecutionResult>;\n connect?(options?: { requiredPackages?: string[] }): Promise<void>;\n disconnect?(): Promise<void>;\n restart?(): Promise<void>;\n interrupt?(): void;\n getVersion?(): Promise<string | undefined>;\n openPackageManager?(\n context?: {\n requiredPackages: string[];\n onPackageAdded: (name: string) => void;\n onPackageRemoved: (name: string) => void;\n }\n ): void;\n close?(): void | Promise<void>;\n}\n\nexport interface NotebookKernelContribution {\n id: string;\n label: string;\n icon?: string;\n language: string;\n loadKernel(): Promise<NotebookKernel>;\n}\n"],"names":[],"mappings":"AAyBO,SAAS,qBAAqB,OAA6C;AAC9E,SAAO;AAAA,IACH,SACA,OAAQ,MAA6B,gBAAgB,cACrD,OAAQ,MAA6B,qBAAqB;AAAA,EAAA;AAElE;AC/BO,MAAM,0BAA0B;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const TARGET_NOTEBOOK_KERNELS = "system.notebookkernels";
|
|
2
|
+
export interface NotebookExecutionResult {
|
|
3
|
+
data?: string;
|
|
4
|
+
imageData?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface NotebookKernel {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly label: string;
|
|
10
|
+
readonly icon?: string;
|
|
11
|
+
readonly language: string;
|
|
12
|
+
execute(code: string): Promise<NotebookExecutionResult>;
|
|
13
|
+
connect?(options?: {
|
|
14
|
+
requiredPackages?: string[];
|
|
15
|
+
}): Promise<void>;
|
|
16
|
+
disconnect?(): Promise<void>;
|
|
17
|
+
restart?(): Promise<void>;
|
|
18
|
+
interrupt?(): void;
|
|
19
|
+
getVersion?(): Promise<string | undefined>;
|
|
20
|
+
openPackageManager?(context?: {
|
|
21
|
+
requiredPackages: string[];
|
|
22
|
+
onPackageAdded: (name: string) => void;
|
|
23
|
+
onPackageRemoved: (name: string) => void;
|
|
24
|
+
}): void;
|
|
25
|
+
close?(): void | Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export interface NotebookKernelContribution {
|
|
28
|
+
id: string;
|
|
29
|
+
label: string;
|
|
30
|
+
icon?: string;
|
|
31
|
+
language: string;
|
|
32
|
+
loadKernel(): Promise<NotebookKernel>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=notebook-kernel-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notebook-kernel-api.d.ts","sourceRoot":"","sources":["../src/notebook-kernel-api.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,2BAA2B,CAAC;AAEhE,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,IAAI,EAAE,MAA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