@alloy-js/python 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/LICENSE +7 -0
  3. package/api-extractor.json +4 -0
  4. package/dist/src/builtins/python.d.ts +9 -0
  5. package/dist/src/builtins/python.d.ts.map +1 -0
  6. package/dist/src/builtins/python.js +17 -0
  7. package/dist/src/components/Atom.d.ts +19 -0
  8. package/dist/src/components/Atom.d.ts.map +1 -0
  9. package/dist/src/components/Atom.js +82 -0
  10. package/dist/src/components/CallSignature.d.ts +79 -0
  11. package/dist/src/components/CallSignature.d.ts.map +1 -0
  12. package/dist/src/components/CallSignature.js +201 -0
  13. package/dist/src/components/ClassDeclaration.d.ts +37 -0
  14. package/dist/src/components/ClassDeclaration.d.ts.map +1 -0
  15. package/dist/src/components/ClassDeclaration.js +83 -0
  16. package/dist/src/components/ClassInstantiation.d.ts +24 -0
  17. package/dist/src/components/ClassInstantiation.d.ts.map +1 -0
  18. package/dist/src/components/ClassInstantiation.js +35 -0
  19. package/dist/src/components/Declaration.d.ts +48 -0
  20. package/dist/src/components/Declaration.d.ts.map +1 -0
  21. package/dist/src/components/Declaration.js +37 -0
  22. package/dist/src/components/EnumDeclaration.d.ts +164 -0
  23. package/dist/src/components/EnumDeclaration.d.ts.map +1 -0
  24. package/dist/src/components/EnumDeclaration.js +278 -0
  25. package/dist/src/components/EnumMember.d.ts +46 -0
  26. package/dist/src/components/EnumMember.d.ts.map +1 -0
  27. package/dist/src/components/EnumMember.js +67 -0
  28. package/dist/src/components/FunctionCallExpression.d.ts +19 -0
  29. package/dist/src/components/FunctionCallExpression.d.ts.map +1 -0
  30. package/dist/src/components/FunctionCallExpression.js +40 -0
  31. package/dist/src/components/FunctionDeclaration.d.ts +47 -0
  32. package/dist/src/components/FunctionDeclaration.d.ts.map +1 -0
  33. package/dist/src/components/FunctionDeclaration.js +107 -0
  34. package/dist/src/components/ImportStatement.d.ts +39 -0
  35. package/dist/src/components/ImportStatement.d.ts.map +1 -0
  36. package/dist/src/components/ImportStatement.js +104 -0
  37. package/dist/src/components/MemberExpression.d.ts +97 -0
  38. package/dist/src/components/MemberExpression.d.ts.map +1 -0
  39. package/dist/src/components/MemberExpression.js +308 -0
  40. package/dist/src/components/NoNamePolicy.d.ts +23 -0
  41. package/dist/src/components/NoNamePolicy.d.ts.map +1 -0
  42. package/dist/src/components/NoNamePolicy.js +27 -0
  43. package/dist/src/components/PyDoc.d.ts +90 -0
  44. package/dist/src/components/PyDoc.d.ts.map +1 -0
  45. package/dist/src/components/PyDoc.js +280 -0
  46. package/dist/src/components/PythonBlock.d.ts +23 -0
  47. package/dist/src/components/PythonBlock.d.ts.map +1 -0
  48. package/dist/src/components/PythonBlock.js +31 -0
  49. package/dist/src/components/Reference.d.ts +13 -0
  50. package/dist/src/components/Reference.d.ts.map +1 -0
  51. package/dist/src/components/Reference.js +18 -0
  52. package/dist/src/components/SourceFile.d.ts +46 -0
  53. package/dist/src/components/SourceFile.d.ts.map +1 -0
  54. package/dist/src/components/SourceFile.js +75 -0
  55. package/dist/src/components/StatementList.d.ts +25 -0
  56. package/dist/src/components/StatementList.d.ts.map +1 -0
  57. package/dist/src/components/StatementList.js +29 -0
  58. package/dist/src/components/VariableDeclaration.d.ts +62 -0
  59. package/dist/src/components/VariableDeclaration.d.ts.map +1 -0
  60. package/dist/src/components/VariableDeclaration.js +131 -0
  61. package/dist/src/components/index.d.ts +19 -0
  62. package/dist/src/components/index.d.ts.map +1 -0
  63. package/dist/src/components/index.js +18 -0
  64. package/dist/src/create-module.d.ts +16 -0
  65. package/dist/src/create-module.d.ts.map +1 -0
  66. package/dist/src/create-module.js +64 -0
  67. package/dist/src/index.d.ts +8 -0
  68. package/dist/src/index.d.ts.map +1 -0
  69. package/dist/src/index.js +7 -0
  70. package/dist/src/name-policy.d.ts +5 -0
  71. package/dist/src/name-policy.d.ts.map +1 -0
  72. package/dist/src/name-policy.js +47 -0
  73. package/dist/src/parameter-descriptor.d.ts +31 -0
  74. package/dist/src/parameter-descriptor.d.ts.map +1 -0
  75. package/dist/src/parameter-descriptor.js +1 -0
  76. package/dist/src/symbol-creation.d.ts +4 -0
  77. package/dist/src/symbol-creation.d.ts.map +1 -0
  78. package/dist/src/symbol-creation.js +24 -0
  79. package/dist/src/symbols/custom-output-scope.d.ts +10 -0
  80. package/dist/src/symbols/custom-output-scope.d.ts.map +1 -0
  81. package/dist/src/symbols/custom-output-scope.js +25 -0
  82. package/dist/src/symbols/index.d.ts +7 -0
  83. package/dist/src/symbols/index.d.ts.map +1 -0
  84. package/dist/src/symbols/index.js +6 -0
  85. package/dist/src/symbols/python-member-scope.d.ts +7 -0
  86. package/dist/src/symbols/python-member-scope.d.ts.map +1 -0
  87. package/dist/src/symbols/python-member-scope.js +9 -0
  88. package/dist/src/symbols/python-module-scope.d.ts +25 -0
  89. package/dist/src/symbols/python-module-scope.d.ts.map +1 -0
  90. package/dist/src/symbols/python-module-scope.js +52 -0
  91. package/dist/src/symbols/python-output-symbol.d.ts +19 -0
  92. package/dist/src/symbols/python-output-symbol.d.ts.map +1 -0
  93. package/dist/src/symbols/python-output-symbol.js +22 -0
  94. package/dist/src/symbols/reference.d.ts +4 -0
  95. package/dist/src/symbols/reference.d.ts.map +1 -0
  96. package/dist/src/symbols/reference.js +60 -0
  97. package/dist/src/symbols/scopes.d.ts +5 -0
  98. package/dist/src/symbols/scopes.d.ts.map +1 -0
  99. package/dist/src/symbols/scopes.js +4 -0
  100. package/dist/src/utils.d.ts +7 -0
  101. package/dist/src/utils.d.ts.map +1 -0
  102. package/dist/src/utils.js +12 -0
  103. package/dist/test/callsignatures.test.d.ts +2 -0
  104. package/dist/test/callsignatures.test.d.ts.map +1 -0
  105. package/dist/test/callsignatures.test.js +276 -0
  106. package/dist/test/classdeclarations.test.d.ts +2 -0
  107. package/dist/test/classdeclarations.test.d.ts.map +1 -0
  108. package/dist/test/classdeclarations.test.js +397 -0
  109. package/dist/test/classinstantiations.test.d.ts +2 -0
  110. package/dist/test/classinstantiations.test.d.ts.map +1 -0
  111. package/dist/test/classinstantiations.test.js +168 -0
  112. package/dist/test/enums.test.d.ts +2 -0
  113. package/dist/test/enums.test.d.ts.map +1 -0
  114. package/dist/test/enums.test.js +211 -0
  115. package/dist/test/externals.test.d.ts +2 -0
  116. package/dist/test/externals.test.d.ts.map +1 -0
  117. package/dist/test/externals.test.js +219 -0
  118. package/dist/test/functioncallexpressions.test.d.ts +2 -0
  119. package/dist/test/functioncallexpressions.test.d.ts.map +1 -0
  120. package/dist/test/functioncallexpressions.test.js +156 -0
  121. package/dist/test/functiondeclaration.test.d.ts +2 -0
  122. package/dist/test/functiondeclaration.test.d.ts.map +1 -0
  123. package/dist/test/functiondeclaration.test.js +363 -0
  124. package/dist/test/imports.test.d.ts +2 -0
  125. package/dist/test/imports.test.d.ts.map +1 -0
  126. package/dist/test/imports.test.js +262 -0
  127. package/dist/test/memberexpressions.test.d.ts +2 -0
  128. package/dist/test/memberexpressions.test.d.ts.map +1 -0
  129. package/dist/test/memberexpressions.test.js +879 -0
  130. package/dist/test/namepolicies.test.d.ts +2 -0
  131. package/dist/test/namepolicies.test.d.ts.map +1 -0
  132. package/dist/test/namepolicies.test.js +109 -0
  133. package/dist/test/pydocs.test.d.ts +2 -0
  134. package/dist/test/pydocs.test.d.ts.map +1 -0
  135. package/dist/test/pydocs.test.js +500 -0
  136. package/dist/test/references.test.d.ts +2 -0
  137. package/dist/test/references.test.d.ts.map +1 -0
  138. package/dist/test/references.test.js +49 -0
  139. package/dist/test/sourcefiles.test.d.ts +2 -0
  140. package/dist/test/sourcefiles.test.d.ts.map +1 -0
  141. package/dist/test/sourcefiles.test.js +198 -0
  142. package/dist/test/utils.d.ts +23 -0
  143. package/dist/test/utils.d.ts.map +1 -0
  144. package/dist/test/utils.js +88 -0
  145. package/dist/test/values.test.d.ts +2 -0
  146. package/dist/test/values.test.d.ts.map +1 -0
  147. package/dist/test/values.test.js +78 -0
  148. package/dist/test/variables.test.d.ts +2 -0
  149. package/dist/test/variables.test.d.ts.map +1 -0
  150. package/dist/test/variables.test.js +173 -0
  151. package/dist/tsconfig.tsbuildinfo +1 -0
  152. package/package.json +39 -0
  153. package/src/builtins/python.ts +20 -0
  154. package/src/components/Atom.tsx +76 -0
  155. package/src/components/CallSignature.tsx +251 -0
  156. package/src/components/ClassDeclaration.tsx +98 -0
  157. package/src/components/ClassInstantiation.tsx +54 -0
  158. package/src/components/Declaration.tsx +91 -0
  159. package/src/components/EnumDeclaration.tsx +291 -0
  160. package/src/components/EnumMember.tsx +92 -0
  161. package/src/components/FunctionCallExpression.tsx +36 -0
  162. package/src/components/FunctionDeclaration.tsx +121 -0
  163. package/src/components/ImportStatement.tsx +134 -0
  164. package/src/components/MemberExpression.tsx +456 -0
  165. package/src/components/NoNamePolicy.tsx +31 -0
  166. package/src/components/PyDoc.tsx +331 -0
  167. package/src/components/PythonBlock.tsx +26 -0
  168. package/src/components/Reference.tsx +21 -0
  169. package/src/components/SourceFile.tsx +93 -0
  170. package/src/components/StatementList.tsx +28 -0
  171. package/src/components/VariableDeclaration.tsx +180 -0
  172. package/src/components/index.ts +18 -0
  173. package/src/create-module.ts +102 -0
  174. package/src/index.ts +7 -0
  175. package/src/name-policy.ts +101 -0
  176. package/src/parameter-descriptor.ts +36 -0
  177. package/src/symbol-creation.ts +36 -0
  178. package/src/symbols/custom-output-scope.ts +35 -0
  179. package/src/symbols/index.ts +6 -0
  180. package/src/symbols/python-member-scope.ts +12 -0
  181. package/src/symbols/python-module-scope.ts +89 -0
  182. package/src/symbols/python-output-symbol.ts +36 -0
  183. package/src/symbols/reference.ts +99 -0
  184. package/src/symbols/scopes.ts +9 -0
  185. package/src/utils.ts +27 -0
  186. package/temp/api.json +7207 -0
  187. package/test/callsignatures.test.tsx +256 -0
  188. package/test/classdeclarations.test.tsx +320 -0
  189. package/test/classinstantiations.test.tsx +159 -0
  190. package/test/enums.test.tsx +203 -0
  191. package/test/externals.test.tsx +190 -0
  192. package/test/functioncallexpressions.test.tsx +145 -0
  193. package/test/functiondeclaration.test.tsx +327 -0
  194. package/test/imports.test.tsx +214 -0
  195. package/test/memberexpressions.test.tsx +725 -0
  196. package/test/namepolicies.test.tsx +109 -0
  197. package/test/pydocs.test.tsx +528 -0
  198. package/test/references.test.tsx +36 -0
  199. package/test/sourcefiles.test.tsx +131 -0
  200. package/test/utils.tsx +131 -0
  201. package/test/values.test.tsx +61 -0
  202. package/test/variables.test.tsx +153 -0
  203. package/tsconfig.json +12 -0
  204. package/tsdoc-metadata.json +11 -0
  205. package/vitest.config.ts +10 -0
  206. package/vitest.setup.ts +1 -0
@@ -0,0 +1,131 @@
1
+ import { createComponent as _$createComponent, createIntrinsic as _$createIntrinsic, memo as _$memo } from "@alloy-js/core/jsx-runtime";
2
+ import { Declaration as CoreDeclaration, Name, OutputSymbolFlags, Show, createSymbolSlot, effect, emitSymbol, memo, useMemberScope, useScope } from "@alloy-js/core";
3
+ import { createPythonSymbol } from "../symbol-creation.js";
4
+ import { Atom } from "./Atom.js";
5
+ import { SimpleCommentBlock } from "./index.js";
6
+ /**
7
+ * A variable declaration component for Python.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <VariableDeclaration
12
+ * name="myVar"
13
+ * type="int"
14
+ * initializer={42} // Initial value
15
+ * />
16
+ * <VariableDeclaration
17
+ * name="myOtherVar"
18
+ * type="str"
19
+ * omitNone={true}
20
+ * />
21
+ * <VariableDeclaration
22
+ * name="myCallStmtVar"
23
+ * callStatementVar={true}
24
+ * initializer={12}
25
+ * />
26
+ * VariableDeclaration
27
+ * name=""
28
+ * callStatementVar={true}
29
+ * initializer={12}
30
+ * />
31
+ * ```
32
+ * renders to
33
+ * ```py
34
+ * myVar: int = 42
35
+ * myOtherVar: str
36
+ * myCallStmtVar=12
37
+ * 12
38
+ * ```
39
+ */
40
+ export function VariableDeclaration(props) {
41
+ const instanceVariable = props.instanceVariable ?? false;
42
+ const TypeSymbolSlot = createSymbolSlot();
43
+ const ValueTypeSymbolSlot = createSymbolSlot();
44
+ const memberScope = useMemberScope();
45
+ let scope = undefined;
46
+ // Only consider the member scope if this is an instance variable
47
+ if (memberScope !== undefined && instanceVariable) {
48
+ scope = memberScope.instanceMembers;
49
+ } else {
50
+ scope = useScope();
51
+ }
52
+ const sym = createPythonSymbol(props.name, {
53
+ scope: scope,
54
+ refkeys: props.refkey
55
+ }, "variable", true);
56
+ emitSymbol(sym);
57
+ // Handle optional type annotation
58
+ const type = memo(() => {
59
+ if (!props.type || props.callStatementVar) return undefined;
60
+ return [": ", _$createComponent(TypeSymbolSlot, {
61
+ get children() {
62
+ return props.type;
63
+ }
64
+ })];
65
+ });
66
+ effect(() => {
67
+ if (TypeSymbolSlot.ref.value) {
68
+ const takenSymbols = TypeSymbolSlot.ref.value;
69
+ for (const symbol of takenSymbols) {
70
+ // If the symbol is a type, instantiate it
71
+ symbol.instantiateTo(sym);
72
+ }
73
+ } else if (ValueTypeSymbolSlot.ref.value) {
74
+ const takenSymbols = ValueTypeSymbolSlot.ref.value;
75
+ for (const symbol of takenSymbols) {
76
+ // ignore non-transient symbols (likely not the result of an
77
+ // expression).
78
+ if (symbol.flags & OutputSymbolFlags.Transient) {
79
+ symbol.moveTo(sym);
80
+ }
81
+ }
82
+ }
83
+ });
84
+
85
+ // If we receive a symbol, resolve it to a name
86
+ const value = typeof props.initializer === "object" ? memo(() => props.initializer) : props.initializer;
87
+ const assignmentOperator = props.callStatementVar ? "=" : " = ";
88
+ const getRightSide = () => {
89
+ // Early return for omitNone case
90
+ if (props.omitNone && props.initializer === undefined) {
91
+ return [false, ""];
92
+ }
93
+
94
+ // Handle null/undefined values
95
+ if (value === null || value === undefined) {
96
+ return [true, ["None"]];
97
+ }
98
+ let renderRightSideOperator = true;
99
+ // Call statement with no name
100
+ if (props.callStatementVar && (props.name === undefined || props.name === "")) {
101
+ renderRightSideOperator = false;
102
+ }
103
+
104
+ // Standard assignment
105
+ return [renderRightSideOperator, _$createComponent(ValueTypeSymbolSlot, {
106
+ get children() {
107
+ return _$createComponent(Atom, {
108
+ jsValue: value
109
+ });
110
+ }
111
+ })];
112
+ };
113
+ const [renderRightSideOperator, rightSide] = getRightSide();
114
+ return [_$createComponent(Show, {
115
+ get when() {
116
+ return Boolean(props.doc);
117
+ },
118
+ get children() {
119
+ return [_$createComponent(SimpleCommentBlock, {
120
+ get children() {
121
+ return props.doc;
122
+ }
123
+ }), _$createIntrinsic("hbr", {})];
124
+ }
125
+ }), _$createComponent(CoreDeclaration, {
126
+ symbol: sym,
127
+ get children() {
128
+ return [_$memo(() => _$createComponent(Name, {})), type, renderRightSideOperator && assignmentOperator, rightSide];
129
+ }
130
+ })];
131
+ }
@@ -0,0 +1,19 @@
1
+ export * from "./Atom.js";
2
+ export * from "./CallSignature.js";
3
+ export * from "./ClassDeclaration.js";
4
+ export * from "./ClassInstantiation.js";
5
+ export * from "./Declaration.js";
6
+ export * from "./EnumDeclaration.js";
7
+ export * from "./EnumMember.js";
8
+ export * from "./FunctionCallExpression.js";
9
+ export * from "./FunctionDeclaration.js";
10
+ export * from "./ImportStatement.js";
11
+ export * from "./MemberExpression.js";
12
+ export * from "./NoNamePolicy.js";
13
+ export * from "./PyDoc.js";
14
+ export * from "./PythonBlock.js";
15
+ export * from "./Reference.js";
16
+ export * from "./SourceFile.js";
17
+ export * from "./StatementList.js";
18
+ export * from "./VariableDeclaration.js";
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,18 @@
1
+ export * from "./Atom.js";
2
+ export * from "./CallSignature.js";
3
+ export * from "./ClassDeclaration.js";
4
+ export * from "./ClassInstantiation.js";
5
+ export * from "./Declaration.js";
6
+ export * from "./EnumDeclaration.js";
7
+ export * from "./EnumMember.js";
8
+ export * from "./FunctionCallExpression.js";
9
+ export * from "./FunctionDeclaration.js";
10
+ export * from "./ImportStatement.js";
11
+ export * from "./MemberExpression.js";
12
+ export * from "./NoNamePolicy.js";
13
+ export * from "./PyDoc.js";
14
+ export * from "./PythonBlock.js";
15
+ export * from "./Reference.js";
16
+ export * from "./SourceFile.js";
17
+ export * from "./StatementList.js";
18
+ export * from "./VariableDeclaration.js";
@@ -0,0 +1,16 @@
1
+ import { type Refkey, SymbolCreator } from "@alloy-js/core";
2
+ export interface ModuleDescriptor {
3
+ [path: string]: string[];
4
+ }
5
+ export interface CreateModuleProps<T extends ModuleDescriptor> {
6
+ name: string;
7
+ descriptor: T;
8
+ }
9
+ export type NamedMap<TDescriptor extends readonly string[]> = {
10
+ [S in TDescriptor[number]]: Refkey;
11
+ };
12
+ export type ModuleRefkeys<PD extends Record<string, string[]>> = {
13
+ [P in keyof PD]: NamedMap<PD[P]>;
14
+ };
15
+ export declare function createModule<const T extends ModuleDescriptor>(props: CreateModuleProps<T>): ModuleRefkeys<T> & SymbolCreator;
16
+ //# sourceMappingURL=create-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-module.d.ts","sourceRoot":"","sources":["../../src/create-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,MAAM,EAEX,aAAa,EACd,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,gBAAgB;IAC/B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,gBAAgB;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,CAAC,CAAC;CACf;AAED,MAAM,MAAM,QAAQ,CAAC,WAAW,SAAS,SAAS,MAAM,EAAE,IAAI;KAC3D,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM;CACnC,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI;KAC9D,CAAC,IAAI,MAAM,EAAE,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACjC,CAAC;AA2DF,wBAAgB,YAAY,CAAC,KAAK,CAAC,CAAC,SAAS,gBAAgB,EAC3D,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC1B,aAAa,CAAC,CAAC,CAAC,GAAG,aAAa,CAelC"}
@@ -0,0 +1,64 @@
1
+ import { getSymbolCreatorSymbol, refkey } from "@alloy-js/core";
2
+ import { createPythonSymbol } from "./symbol-creation.js";
3
+ import { PythonModuleScope } from "./symbols/index.js";
4
+ function createSymbols(binder, props, refkeys) {
5
+ // Create a module scope for each path in the descriptor
6
+ for (const [path, symbols] of Object.entries(props.descriptor)) {
7
+ // If the path is ".", we use the module name directly
8
+ // Otherwise, we append the path to the module name
9
+ const fullModuleScopeName = props.name + (path === "." ? "" : `.${path}`);
10
+ const keys = refkeys[path];
11
+ const moduleScope = new PythonModuleScope(fullModuleScopeName, {
12
+ parent: undefined,
13
+ binder: binder
14
+ });
15
+
16
+ // Create a symbol for each exported name
17
+ for (const exportedName of symbols ?? []) {
18
+ const key = keys[exportedName];
19
+ const _ = createPythonSymbol(exportedName, {
20
+ binder: binder,
21
+ scope: moduleScope,
22
+ refkeys: key,
23
+ module: moduleScope.name
24
+ }, undefined, false);
25
+ }
26
+ }
27
+ }
28
+
29
+ // A module is a map of refkeys for each path in the descriptor.
30
+ // Each path maps to a set of named refkeys for the exported symbols.
31
+ // When one of the symbols is used, the relevant import will be added
32
+ // to the source file, and the symbol will be available in the output.
33
+ //
34
+ // Most of the use cases will be for templates and not for use in JSX,
35
+ // so the symbols will not be normally used directly in the code, but
36
+ // there may be cases where you want to use them directly.
37
+ //
38
+ // Example:
39
+ // ```ts
40
+ // const requestsLib = createModule({
41
+ // name: "requests",
42
+ // descriptor: {
43
+ // ".": ["get", "post"],
44
+ // },
45
+ // });
46
+ // ```
47
+ //
48
+ // For this scenario, if requestsLib["."].get is used, it will add
49
+ // the import `from requests import get` and would render the symbol
50
+ // as `get` in the output.
51
+ export function createModule(props) {
52
+ const refkeys = {
53
+ [getSymbolCreatorSymbol()](binder) {
54
+ createSymbols(binder, props, refkeys);
55
+ }
56
+ };
57
+ for (const [path, symbols] of Object.entries(props.descriptor)) {
58
+ const keys = refkeys[path] = {};
59
+ for (const named of symbols ?? []) {
60
+ keys[named] = refkey(props.descriptor, path, named);
61
+ }
62
+ }
63
+ return refkeys;
64
+ }
@@ -0,0 +1,8 @@
1
+ export * from "./builtins/python.js";
2
+ export * from "./components/index.js";
3
+ export * from "./create-module.js";
4
+ export * from "./name-policy.js";
5
+ export * from "./parameter-descriptor.js";
6
+ export * from "./symbols/index.js";
7
+ export * from "./utils.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from "./builtins/python.js";
2
+ export * from "./components/index.js";
3
+ export * from "./create-module.js";
4
+ export * from "./name-policy.js";
5
+ export * from "./parameter-descriptor.js";
6
+ export * from "./symbols/index.js";
7
+ export * from "./utils.js";
@@ -0,0 +1,5 @@
1
+ import { NamePolicy } from "@alloy-js/core";
2
+ export type PythonElements = "class" | "class-member" | "function" | "variable" | "object-member" | "constant" | "parameter" | "method" | "module" | "enum" | "enum-member";
3
+ export declare function createPythonNamePolicy(): NamePolicy<PythonElements>;
4
+ export declare function usePythonNamePolicy(): NamePolicy<PythonElements>;
5
+ //# sourceMappingURL=name-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"name-policy.d.ts","sourceRoot":"","sources":["../../src/name-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,UAAU,EAAiB,MAAM,gBAAgB,CAAC;AAG7E,MAAM,MAAM,cAAc,GACtB,OAAO,GACP,cAAc,GACd,UAAU,GACV,UAAU,GACV,eAAe,GACf,UAAU,GACV,WAAW,GACX,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,aAAa,CAAC;AA2DlB,wBAAgB,sBAAsB,IAAI,UAAU,CAAC,cAAc,CAAC,CAuBnE;AAED,wBAAgB,mBAAmB,IAAI,UAAU,CAAC,cAAc,CAAC,CAEhE"}
@@ -0,0 +1,47 @@
1
+ import { createNamePolicy, useNamePolicy } from "@alloy-js/core";
2
+ import { constantCase, pascalCase, snakeCase } from "change-case";
3
+ // Enum members
4
+
5
+ // Reserved words
6
+ const GLOBAL_RESERVED_WORDS = new Set(["False", "None", "True", "and", "as", "assert", "async", "await", "break", "class", "continue", "def", "del", "elif", "else", "except", "finally", "for", "from", "global", "if", "import", "in", "is", "lambda", "nonlocal", "not", "or", "pass", "raise", "return", "try", "while", "with", "and", "yield"]);
7
+
8
+ /**
9
+ * Ensures a valid Python identifier for the given element kind.
10
+ * @param name - The name to validate.
11
+ * @param element - The Python element kind.
12
+ * @returns A Python-safe name.
13
+ */
14
+ function ensureNonReservedName(name) {
15
+ const suffix = "_";
16
+
17
+ // Global reserved words always need handling
18
+ if (GLOBAL_RESERVED_WORDS.has(name)) {
19
+ return `${name}${suffix}`;
20
+ }
21
+ return name;
22
+ }
23
+ export function createPythonNamePolicy() {
24
+ return createNamePolicy((name, element) => {
25
+ let transformedName;
26
+ switch (element) {
27
+ case "class":
28
+ case "enum":
29
+ transformedName = pascalCase(name);
30
+ break;
31
+ case "constant":
32
+ case "enum-member":
33
+ transformedName = constantCase(name);
34
+ break;
35
+ case "module":
36
+ transformedName = snakeCase(name).toLowerCase();
37
+ break;
38
+ default:
39
+ transformedName = snakeCase(name);
40
+ break;
41
+ }
42
+ return ensureNonReservedName(transformedName);
43
+ });
44
+ }
45
+ export function usePythonNamePolicy() {
46
+ return useNamePolicy();
47
+ }
@@ -0,0 +1,31 @@
1
+ import type { Children, Refkey } from "@alloy-js/core";
2
+ /**
3
+ * Information for a Python function parameter.
4
+ */
5
+ export interface ParameterDescriptor {
6
+ /**
7
+ * The name of the parameter.
8
+ */
9
+ readonly name: string;
10
+ /**
11
+ * The type of the parameter.
12
+ */
13
+ readonly type?: Children;
14
+ /**
15
+ * The refkey for this parameter.
16
+ */
17
+ readonly refkey?: Refkey | Refkey[];
18
+ /**
19
+ * Whether the parameter is optional.
20
+ */
21
+ readonly optional?: boolean;
22
+ /**
23
+ * Documentation for the parameter.
24
+ */
25
+ readonly doc?: Children;
26
+ /**
27
+ * The default value of the parameter.
28
+ */
29
+ readonly default?: Children;
30
+ }
31
+ //# sourceMappingURL=parameter-descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameter-descriptor.d.ts","sourceRoot":"","sources":["../../src/parameter-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;CAC7B"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { PythonElements } from "./name-policy.js";
2
+ import { CreatePythonSymbolOptions, PythonOutputSymbol } from "./symbols/index.js";
3
+ export declare function createPythonSymbol(name: string, options: CreatePythonSymbolOptions, kind?: PythonElements, createRefkeyIfNeeded?: boolean): PythonOutputSymbol;
4
+ //# sourceMappingURL=symbol-creation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"symbol-creation.d.ts","sourceRoot":"","sources":["../../src/symbol-creation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAC;AACvE,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAE5B,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,yBAAyB,EAClC,IAAI,CAAC,EAAE,cAAc,EACrB,oBAAoB,UAAQ,GAC3B,kBAAkB,CAsBpB"}
@@ -0,0 +1,24 @@
1
+ import { refkey, useContext } from "@alloy-js/core";
2
+ import { PythonSourceFileContext } from "./components/SourceFile.js";
3
+ import { usePythonNamePolicy } from "./name-policy.js";
4
+ import { PythonOutputSymbol } from "./symbols/index.js";
5
+ export function createPythonSymbol(name, options, kind, createRefkeyIfNeeded = false) {
6
+ let processedName = name;
7
+ const sfContext = useContext(PythonSourceFileContext);
8
+ // Only apply the name policy if a kind is provided and name policy context is available
9
+ if (kind) {
10
+ const namePolicy = usePythonNamePolicy();
11
+ if (namePolicy) {
12
+ processedName = namePolicy.getName(name, kind);
13
+ }
14
+ }
15
+ return new PythonOutputSymbol(processedName, {
16
+ binder: options.binder,
17
+ aliasTarget: options.aliasTarget,
18
+ scope: options.scope,
19
+ refkeys: options.refkeys ?? (createRefkeyIfNeeded ? refkey(processedName) : undefined),
20
+ flags: options.flags,
21
+ metadata: options.metadata,
22
+ module: sfContext?.module
23
+ });
24
+ }
@@ -0,0 +1,10 @@
1
+ import { OutputScope, OutputScopeOptions, SymbolTable } from "@alloy-js/core";
2
+ export declare class CustomOutputScope extends OutputScope {
3
+ #private;
4
+ /**
5
+ * The symbols defined within this scope.
6
+ */
7
+ get symbols(): SymbolTable;
8
+ constructor(name: string, options?: OutputScopeOptions);
9
+ }
10
+ //# sourceMappingURL=custom-output-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custom-output-scope.d.ts","sourceRoot":"","sources":["../../../src/symbols/custom-output-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI9E,qBAAa,iBAAkB,SAAQ,WAAW;;IAEhD;;OAEG;IACH,IAAI,OAAO,gBAEV;gBAEW,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB;CAqB3D"}
@@ -0,0 +1,25 @@
1
+ import { OutputScope, SymbolTable } from "@alloy-js/core";
2
+
3
+ // This is named as CustomOutputScope and not PythonOutputScope to avoid confusion with the one defined in scopes.ts
4
+ // We are creating a custom output scope so we can add out custom name conflict resolution logic.
5
+ export class CustomOutputScope extends OutputScope {
6
+ #symbols;
7
+ /**
8
+ * The symbols defined within this scope.
9
+ */
10
+ get symbols() {
11
+ return this.#symbols;
12
+ }
13
+ constructor(name, options = {}) {
14
+ super(name, options);
15
+ this.#symbols = new SymbolTable(this, {
16
+ nameConflictResolver: (_, symbols) => {
17
+ for (let i = 1; i < symbols.length; i++) {
18
+ // Rename all but the first symbol to have a suffix of _2, _3, plus the scope name if available.
19
+ const symbol = symbols[i];
20
+ symbol.name = symbol.originalName + "_" + (i + 1) + "_" + (symbols[i].aliasTarget?.scope?.name ?? symbol.module ?? "");
21
+ }
22
+ }
23
+ });
24
+ }
25
+ }
@@ -0,0 +1,7 @@
1
+ export * from "./custom-output-scope.js";
2
+ export * from "./python-member-scope.js";
3
+ export * from "./python-module-scope.js";
4
+ export * from "./python-output-symbol.js";
5
+ export * from "./reference.js";
6
+ export * from "./scopes.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/symbols/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from "./custom-output-scope.js";
2
+ export * from "./python-member-scope.js";
3
+ export * from "./python-module-scope.js";
4
+ export * from "./python-output-symbol.js";
5
+ export * from "./reference.js";
6
+ export * from "./scopes.js";
@@ -0,0 +1,7 @@
1
+ import { CustomOutputScope } from "./custom-output-scope.js";
2
+ import { PythonOutputSymbol } from "./python-output-symbol.js";
3
+ export declare class PythonMemberScope extends CustomOutputScope {
4
+ get kind(): "member";
5
+ get owner(): PythonOutputSymbol;
6
+ }
7
+ //# sourceMappingURL=python-member-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-member-scope.d.ts","sourceRoot":"","sources":["../../../src/symbols/python-member-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,qBAAa,iBAAkB,SAAQ,iBAAiB;IACtD,IAAI,IAAI,IACC,QAAQ,CAChB;IAED,IAAI,KAAK,IACe,kBAAkB,CACzC;CACF"}
@@ -0,0 +1,9 @@
1
+ import { CustomOutputScope } from "./custom-output-scope.js";
2
+ export class PythonMemberScope extends CustomOutputScope {
3
+ get kind() {
4
+ return "member";
5
+ }
6
+ get owner() {
7
+ return super.owner;
8
+ }
9
+ }
@@ -0,0 +1,25 @@
1
+ import { CustomOutputScope } from "./custom-output-scope.js";
2
+ import { PythonOutputSymbol } from "./python-output-symbol.js";
3
+ export declare class ImportedSymbol {
4
+ local: PythonOutputSymbol;
5
+ target: PythonOutputSymbol;
6
+ constructor(target: PythonOutputSymbol, local: PythonOutputSymbol);
7
+ static from(target: PythonOutputSymbol, local: PythonOutputSymbol): ImportedSymbol;
8
+ }
9
+ export interface ImportRecordProps {
10
+ symbols: Set<ImportedSymbol>;
11
+ }
12
+ export type ImportRecords = Map<PythonModuleScope, ImportRecordProps>;
13
+ export declare const ImportRecords: {
14
+ new (): ImportRecords;
15
+ new (entries?: readonly (readonly [PythonModuleScope, ImportRecordProps])[] | null): ImportRecords;
16
+ prototype: Map<PythonModuleScope, ImportRecordProps>;
17
+ };
18
+ export declare class PythonModuleScope extends CustomOutputScope {
19
+ #private;
20
+ get kind(): "module";
21
+ get importedSymbols(): Map<PythonOutputSymbol, PythonOutputSymbol>;
22
+ get importedModules(): ImportRecords;
23
+ addImport(targetSymbol: PythonOutputSymbol, targetModule: PythonModuleScope): PythonOutputSymbol;
24
+ }
25
+ //# sourceMappingURL=python-module-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-module-scope.d.ts","sourceRoot":"","sources":["../../../src/symbols/python-module-scope.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,qBAAa,cAAc;IACzB,KAAK,EAAE,kBAAkB,CAAC;IAC1B,MAAM,EAAE,kBAAkB,CAAC;gBAEf,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB;IAKjE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,kBAAkB;CAGlE;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC9B;AAED,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;AAEtE,eAAO,MAAM,aAAa,EAAU;IAClC,QAAQ,aAAa,CAAC;IACtB,KACE,OAAO,CAAC,EACJ,SAAS,CAAC,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,EAAE,GAC5D,IAAI,GACP,aAAa,CAAC;IACjB,SAAS,EAAE,GAAG,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;CACtD,CAAC;AAEF,qBAAa,iBAAkB,SAAQ,iBAAiB;;IACtD,IAAI,IAAI,IACC,QAAQ,CAChB;IAID,IAAI,eAAe,gDAElB;IAGD,IAAI,eAAe,kBAElB;IAED,SAAS,CAAC,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,iBAAiB;CAqC5E"}
@@ -0,0 +1,52 @@
1
+ import { reactive, shallowReactive } from "@alloy-js/core";
2
+ import { createPythonSymbol } from "../symbol-creation.js";
3
+ import { CustomOutputScope } from "./custom-output-scope.js";
4
+ export class ImportedSymbol {
5
+ constructor(target, local) {
6
+ this.target = target;
7
+ this.local = local;
8
+ }
9
+ static from(target, local) {
10
+ return new ImportedSymbol(target, local);
11
+ }
12
+ }
13
+ export const ImportRecords = Map;
14
+ export class PythonModuleScope extends CustomOutputScope {
15
+ get kind() {
16
+ return "module";
17
+ }
18
+ #importedSymbols = shallowReactive(new Map());
19
+ get importedSymbols() {
20
+ return this.#importedSymbols;
21
+ }
22
+ #importedModules = reactive(new Map());
23
+ get importedModules() {
24
+ return this.#importedModules;
25
+ }
26
+ addImport(targetSymbol, targetModule) {
27
+ const existing = this.importedSymbols.get(targetSymbol);
28
+ if (existing) {
29
+ return existing;
30
+ }
31
+ if (targetModule.kind !== "module") {
32
+ throw new Error("Cannot import symbol that isn't in module scope");
33
+ }
34
+ if (!this.importedModules.has(targetModule)) {
35
+ this.importedModules.set(targetModule, {
36
+ symbols: new Set()
37
+ });
38
+ }
39
+ const localSymbol = createPythonSymbol(targetSymbol.name, {
40
+ binder: this.binder,
41
+ scope: this,
42
+ aliasTarget: targetSymbol
43
+ }, undefined, false);
44
+ targetSymbol.copyTo(localSymbol);
45
+ this.importedSymbols.set(targetSymbol, localSymbol);
46
+ this.importedModules.get(targetModule).symbols?.add({
47
+ local: localSymbol,
48
+ target: targetSymbol
49
+ });
50
+ return localSymbol;
51
+ }
52
+ }
@@ -0,0 +1,19 @@
1
+ import { OutputSymbol, OutputSymbolOptions } from "@alloy-js/core";
2
+ import { PythonMemberScope } from "./python-member-scope.js";
3
+ export interface CreatePythonSymbolOptions extends OutputSymbolOptions {
4
+ module?: string;
5
+ }
6
+ export interface CreatePythonSymbolFunctionOptions extends CreatePythonSymbolOptions {
7
+ name: string;
8
+ }
9
+ /**
10
+ * Represents an 'exported' symbol from a .py file. Class, enum, interface etc.
11
+ */
12
+ export declare class PythonOutputSymbol extends OutputSymbol {
13
+ #private;
14
+ constructor(name: string, options: CreatePythonSymbolOptions);
15
+ get module(): string | undefined;
16
+ set module(value: string | undefined);
17
+ get instanceMemberScope(): PythonMemberScope | undefined;
18
+ }
19
+ //# sourceMappingURL=python-output-symbol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python-output-symbol.d.ts","sourceRoot":"","sources":["../../../src/symbols/python-output-symbol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iCACf,SAAQ,yBAAyB;IACjC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,YAAY;;gBACtC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB;IAQ5D,IAAI,MAAM,IAIQ,MAAM,GAAG,SAAS,CAFnC;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAEnC;IAED,IAAI,mBAAmB,IACe,iBAAiB,GAAG,SAAS,CAClE;CACF"}
@@ -0,0 +1,22 @@
1
+ import { OutputSymbol } from "@alloy-js/core";
2
+ /**
3
+ * Represents an 'exported' symbol from a .py file. Class, enum, interface etc.
4
+ */
5
+ export class PythonOutputSymbol extends OutputSymbol {
6
+ constructor(name, options) {
7
+ super(name, options);
8
+ this.#module = options.module ?? undefined;
9
+ }
10
+
11
+ // The module in which the symbol is defined
12
+ #module;
13
+ get module() {
14
+ return this.#module;
15
+ }
16
+ set module(value) {
17
+ this.#module = value;
18
+ }
19
+ get instanceMemberScope() {
20
+ return super.instanceMemberScope;
21
+ }
22
+ }
@@ -0,0 +1,4 @@
1
+ import { Refkey } from "@alloy-js/core";
2
+ import { PythonOutputSymbol } from "./index.js";
3
+ export declare function ref(refkey: Refkey): () => [string, PythonOutputSymbol | undefined];
4
+ //# sourceMappingURL=reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../src/symbols/reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,EAKP,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAIL,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,wBAAgB,GAAG,CACjB,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,SAAS,CAAC,CA6DhD"}