@wundr.io/prompt-templates 1.0.3

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.
@@ -0,0 +1,566 @@
1
+ "use strict";
2
+ /**
3
+ * @wundr/prompt-templates - Built-in Handlebars helpers for prompt templating
4
+ */
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.formatTools = formatTools;
10
+ exports.ifDefined = ifDefined;
11
+ exports.codeBlock = codeBlock;
12
+ exports.formatMemory = formatMemory;
13
+ exports.repeat = repeat;
14
+ exports.formatDate = formatDate;
15
+ exports.json = json;
16
+ exports.truncate = truncate;
17
+ exports.join = join;
18
+ exports.compare = compare;
19
+ exports.capitalize = capitalize;
20
+ exports.uppercase = uppercase;
21
+ exports.lowercase = lowercase;
22
+ exports.indent = indent;
23
+ exports.wrap = wrap;
24
+ exports.bulletList = bulletList;
25
+ exports.numberedList = numberedList;
26
+ exports.getBuiltinHelpers = getBuiltinHelpers;
27
+ const handlebars_1 = __importDefault(require("handlebars"));
28
+ /**
29
+ * Format tools array into a structured prompt format
30
+ *
31
+ * @param tools - Array of tool definitions
32
+ * @param options - Handlebars helper options
33
+ * @returns Formatted tools string
34
+ *
35
+ * @example
36
+ * {{formatTools tools}}
37
+ */
38
+ function formatTools(tools, options) {
39
+ if (!tools || tools.length === 0) {
40
+ return '';
41
+ }
42
+ const format = options?.hash?.['format'];
43
+ if (format === 'json') {
44
+ return JSON.stringify(tools, null, 2);
45
+ }
46
+ if (format === 'compact') {
47
+ return tools.map(t => `- ${t.name}: ${t.description}`).join('\n');
48
+ }
49
+ // Default detailed format
50
+ const formatted = tools
51
+ .map(tool => {
52
+ let output = `### ${tool.name}\n${tool.description}`;
53
+ if (tool.parameters?.properties) {
54
+ output += '\n\n**Parameters:**';
55
+ for (const [name, prop] of Object.entries(tool.parameters.properties)) {
56
+ const required = tool.parameters.required?.includes(name)
57
+ ? ' (required)'
58
+ : '';
59
+ const paramProp = prop;
60
+ output += `\n- \`${name}\`${required}: ${paramProp.type || 'any'} - ${paramProp.description || 'No description'}`;
61
+ }
62
+ }
63
+ if (tool.examples && tool.examples.length > 0) {
64
+ output += '\n\n**Examples:**';
65
+ for (const example of tool.examples) {
66
+ output += `\n\`\`\`\n${example}\n\`\`\``;
67
+ }
68
+ }
69
+ return output;
70
+ })
71
+ .join('\n\n---\n\n');
72
+ return formatted;
73
+ }
74
+ /**
75
+ * Conditionally render block if value is defined and not null/undefined
76
+ *
77
+ * @param value - Value to check
78
+ * @param options - Handlebars helper options
79
+ * @returns Rendered block or empty string
80
+ *
81
+ * @example
82
+ * {{#ifDefined user.name}}Hello, {{user.name}}{{/ifDefined}}
83
+ */
84
+ function ifDefined(value, options) {
85
+ if (value !== undefined && value !== null) {
86
+ return options.fn(this);
87
+ }
88
+ return options.inverse ? options.inverse(this) : '';
89
+ }
90
+ /**
91
+ * Wrap content in a code block with optional language
92
+ *
93
+ * @param language - Programming language for syntax highlighting
94
+ * @param options - Handlebars helper options
95
+ * @returns Code block formatted string
96
+ *
97
+ * @example
98
+ * {{#codeBlock "javascript"}}
99
+ * const x = 1;
100
+ * {{/codeBlock}}
101
+ */
102
+ function codeBlock(language, options) {
103
+ // Handle case where language is not provided
104
+ if (typeof language === 'object' && !options) {
105
+ options = language;
106
+ language = '';
107
+ }
108
+ const content = options?.fn(this) || '';
109
+ const lang = typeof language === 'string' ? language : '';
110
+ return `\`\`\`${lang}\n${content.trim()}\n\`\`\``;
111
+ }
112
+ /**
113
+ * Format memory/conversation history into a readable format
114
+ *
115
+ * @param messages - Array of conversation messages
116
+ * @param options - Handlebars helper options
117
+ * @returns Formatted memory string
118
+ *
119
+ * @example
120
+ * {{formatMemory memory.messages}}
121
+ */
122
+ function formatMemory(messages, options) {
123
+ if (!messages || messages.length === 0) {
124
+ return '';
125
+ }
126
+ const maxMessages = options?.hash?.['max'] ?? messages.length;
127
+ const format = options?.hash?.['format'];
128
+ const slicedMessages = messages.slice(-maxMessages);
129
+ if (format === 'compact') {
130
+ return slicedMessages
131
+ .map(m => `[${m.role.toUpperCase()}]: ${m.content}`)
132
+ .join('\n');
133
+ }
134
+ if (format === 'xml') {
135
+ return slicedMessages
136
+ .map(m => `<message role="${m.role}"${m.name ? ` name="${m.name}"` : ''}>\n${m.content}\n</message>`)
137
+ .join('\n\n');
138
+ }
139
+ // Default format
140
+ return slicedMessages
141
+ .map(m => {
142
+ const roleLabel = m.role.charAt(0).toUpperCase() + m.role.slice(1).toLowerCase();
143
+ const nameLabel = m.name ? ` (${m.name})` : '';
144
+ return `**${roleLabel}${nameLabel}:**\n${m.content}`;
145
+ })
146
+ .join('\n\n');
147
+ }
148
+ /**
149
+ * Repeat content n times
150
+ *
151
+ * @param count - Number of times to repeat
152
+ * @param options - Handlebars helper options
153
+ * @returns Repeated content
154
+ *
155
+ * @example
156
+ * {{#repeat 3}}Item {{@index}}{{/repeat}}
157
+ */
158
+ function repeat(count, options) {
159
+ const results = [];
160
+ for (let i = 0; i < count; i++) {
161
+ const data = handlebars_1.default.createFrame(options.data || {});
162
+ data['index'] = i;
163
+ data['first'] = i === 0;
164
+ data['last'] = i === count - 1;
165
+ results.push(options.fn(this, { data }));
166
+ }
167
+ return results.join('');
168
+ }
169
+ /**
170
+ * Format a date value
171
+ *
172
+ * @param date - Date to format
173
+ * @param formatStr - Format string (iso, locale, relative, or custom)
174
+ * @returns Formatted date string
175
+ *
176
+ * @example
177
+ * {{formatDate timestamp "iso"}}
178
+ */
179
+ function formatDate(date, formatStr) {
180
+ if (!date) {
181
+ return '';
182
+ }
183
+ const dateObj = date instanceof Date ? date : new Date(date);
184
+ if (isNaN(dateObj.getTime())) {
185
+ return '';
186
+ }
187
+ const format = typeof formatStr === 'string' ? formatStr : 'iso';
188
+ switch (format) {
189
+ case 'iso':
190
+ return dateObj.toISOString();
191
+ case 'locale':
192
+ return dateObj.toLocaleString();
193
+ case 'date':
194
+ return dateObj.toLocaleDateString();
195
+ case 'time':
196
+ return dateObj.toLocaleTimeString();
197
+ case 'relative': {
198
+ const now = Date.now();
199
+ const diff = now - dateObj.getTime();
200
+ const seconds = Math.floor(diff / 1000);
201
+ const minutes = Math.floor(seconds / 60);
202
+ const hours = Math.floor(minutes / 60);
203
+ const days = Math.floor(hours / 24);
204
+ if (days > 0) {
205
+ return `${days} day${days > 1 ? 's' : ''} ago`;
206
+ }
207
+ if (hours > 0) {
208
+ return `${hours} hour${hours > 1 ? 's' : ''} ago`;
209
+ }
210
+ if (minutes > 0) {
211
+ return `${minutes} minute${minutes > 1 ? 's' : ''} ago`;
212
+ }
213
+ return 'just now';
214
+ }
215
+ default:
216
+ return dateObj.toISOString();
217
+ }
218
+ }
219
+ /**
220
+ * JSON stringify with formatting options
221
+ *
222
+ * @param value - Value to stringify
223
+ * @param options - Handlebars helper options
224
+ * @returns JSON string
225
+ *
226
+ * @example
227
+ * {{json data indent=2}}
228
+ */
229
+ function json(value, options) {
230
+ const indent = options?.hash?.['indent'] ?? 2;
231
+ try {
232
+ return JSON.stringify(value, null, indent);
233
+ }
234
+ catch {
235
+ return String(value);
236
+ }
237
+ }
238
+ /**
239
+ * Truncate text to a maximum length
240
+ *
241
+ * @param text - Text to truncate
242
+ * @param length - Maximum length
243
+ * @param suffix - Suffix to add when truncated (default: '...')
244
+ * @returns Truncated text
245
+ *
246
+ * @example
247
+ * {{truncate description 100 "..."}}
248
+ */
249
+ function truncate(text, length, suffix) {
250
+ if (!text) {
251
+ return '';
252
+ }
253
+ const maxLength = typeof length === 'number' ? length : 100;
254
+ const ellipsis = typeof suffix === 'string' ? suffix : '...';
255
+ if (text.length <= maxLength) {
256
+ return text;
257
+ }
258
+ return text.substring(0, maxLength - ellipsis.length) + ellipsis;
259
+ }
260
+ /**
261
+ * Join array items with a separator
262
+ *
263
+ * @param items - Array to join
264
+ * @param separator - Separator string (default: ', ')
265
+ * @returns Joined string
266
+ *
267
+ * @example
268
+ * {{join tags ", "}}
269
+ */
270
+ function join(items, separator) {
271
+ if (!items || !Array.isArray(items)) {
272
+ return '';
273
+ }
274
+ const sep = typeof separator === 'string' ? separator : ', ';
275
+ return items.map(String).join(sep);
276
+ }
277
+ /**
278
+ * String comparison helper
279
+ *
280
+ * @param a - First value
281
+ * @param operator - Comparison operator
282
+ * @param b - Second value
283
+ * @param options - Handlebars helper options
284
+ * @returns Rendered block based on comparison result
285
+ *
286
+ * @example
287
+ * {{#compare role "eq" "admin"}}Admin content{{/compare}}
288
+ */
289
+ function compare(a, operator, b, options) {
290
+ let result = false;
291
+ switch (operator) {
292
+ case 'eq':
293
+ case '==':
294
+ case '===':
295
+ result = a === b;
296
+ break;
297
+ case 'ne':
298
+ case '!=':
299
+ case '!==':
300
+ result = a !== b;
301
+ break;
302
+ case 'lt':
303
+ case '<':
304
+ result = Number(a) < Number(b);
305
+ break;
306
+ case 'lte':
307
+ case '<=':
308
+ result = Number(a) <= Number(b);
309
+ break;
310
+ case 'gt':
311
+ case '>':
312
+ result = Number(a) > Number(b);
313
+ break;
314
+ case 'gte':
315
+ case '>=':
316
+ result = Number(a) >= Number(b);
317
+ break;
318
+ case 'contains':
319
+ result = typeof a === 'string' && typeof b === 'string' && a.includes(b);
320
+ break;
321
+ case 'startsWith':
322
+ result =
323
+ typeof a === 'string' && typeof b === 'string' && a.startsWith(b);
324
+ break;
325
+ case 'endsWith':
326
+ result = typeof a === 'string' && typeof b === 'string' && a.endsWith(b);
327
+ break;
328
+ default:
329
+ result = false;
330
+ }
331
+ if (result) {
332
+ return options.fn(this);
333
+ }
334
+ return options.inverse ? options.inverse(this) : '';
335
+ }
336
+ /**
337
+ * Capitalize first letter of string
338
+ *
339
+ * @param text - Text to capitalize
340
+ * @returns Capitalized text
341
+ *
342
+ * @example
343
+ * {{capitalize name}}
344
+ */
345
+ function capitalize(text) {
346
+ if (!text) {
347
+ return '';
348
+ }
349
+ return text.charAt(0).toUpperCase() + text.slice(1);
350
+ }
351
+ /**
352
+ * Convert string to uppercase
353
+ *
354
+ * @param text - Text to convert
355
+ * @returns Uppercase text
356
+ *
357
+ * @example
358
+ * {{uppercase status}}
359
+ */
360
+ function uppercase(text) {
361
+ if (!text) {
362
+ return '';
363
+ }
364
+ return text.toUpperCase();
365
+ }
366
+ /**
367
+ * Convert string to lowercase
368
+ *
369
+ * @param text - Text to convert
370
+ * @returns Lowercase text
371
+ *
372
+ * @example
373
+ * {{lowercase status}}
374
+ */
375
+ function lowercase(text) {
376
+ if (!text) {
377
+ return '';
378
+ }
379
+ return text.toLowerCase();
380
+ }
381
+ /**
382
+ * Indent text by a number of spaces
383
+ *
384
+ * @param text - Text to indent
385
+ * @param spaces - Number of spaces (default: 2)
386
+ * @returns Indented text
387
+ *
388
+ * @example
389
+ * {{indent content 4}}
390
+ */
391
+ function indent(text, spaces) {
392
+ if (!text) {
393
+ return '';
394
+ }
395
+ const numSpaces = typeof spaces === 'number' ? spaces : 2;
396
+ const indentStr = ' '.repeat(numSpaces);
397
+ return text
398
+ .split('\n')
399
+ .map(line => indentStr + line)
400
+ .join('\n');
401
+ }
402
+ /**
403
+ * Wrap text to a maximum line width
404
+ *
405
+ * @param text - Text to wrap
406
+ * @param width - Maximum line width (default: 80)
407
+ * @returns Wrapped text
408
+ *
409
+ * @example
410
+ * {{wrap longText 72}}
411
+ */
412
+ function wrap(text, width) {
413
+ if (!text) {
414
+ return '';
415
+ }
416
+ const maxWidth = typeof width === 'number' ? width : 80;
417
+ const words = text.split(' ');
418
+ const lines = [];
419
+ let currentLine = '';
420
+ for (const word of words) {
421
+ if (currentLine.length + word.length + 1 > maxWidth) {
422
+ if (currentLine) {
423
+ lines.push(currentLine);
424
+ }
425
+ currentLine = word;
426
+ }
427
+ else {
428
+ currentLine = currentLine ? `${currentLine} ${word}` : word;
429
+ }
430
+ }
431
+ if (currentLine) {
432
+ lines.push(currentLine);
433
+ }
434
+ return lines.join('\n');
435
+ }
436
+ /**
437
+ * Create a bulleted list from array
438
+ *
439
+ * @param items - Array of items
440
+ * @param options - Handlebars helper options
441
+ * @returns Bulleted list string
442
+ *
443
+ * @example
444
+ * {{bulletList items bullet="*"}}
445
+ */
446
+ function bulletList(items, options) {
447
+ if (!items || !Array.isArray(items)) {
448
+ return '';
449
+ }
450
+ const bullet = options?.hash?.['bullet'] || '-';
451
+ return items.map(item => `${bullet} ${String(item)}`).join('\n');
452
+ }
453
+ /**
454
+ * Create a numbered list from array
455
+ *
456
+ * @param items - Array of items
457
+ * @param options - Handlebars helper options
458
+ * @returns Numbered list string
459
+ *
460
+ * @example
461
+ * {{numberedList steps start=1}}
462
+ */
463
+ function numberedList(items, options) {
464
+ if (!items || !Array.isArray(items)) {
465
+ return '';
466
+ }
467
+ const start = options?.hash?.['start'] || 1;
468
+ return items
469
+ .map((item, index) => `${start + index}. ${String(item)}`)
470
+ .join('\n');
471
+ }
472
+ /**
473
+ * Get all built-in helper definitions
474
+ *
475
+ * @returns Array of helper definitions
476
+ */
477
+ function getBuiltinHelpers() {
478
+ return [
479
+ {
480
+ name: 'formatTools',
481
+ description: 'Format tools array into a structured prompt format',
482
+ fn: formatTools,
483
+ },
484
+ {
485
+ name: 'ifDefined',
486
+ description: 'Conditionally render block if value is defined and not null/undefined',
487
+ fn: ifDefined,
488
+ },
489
+ {
490
+ name: 'codeBlock',
491
+ description: 'Wrap content in a code block with optional language',
492
+ fn: codeBlock,
493
+ },
494
+ {
495
+ name: 'formatMemory',
496
+ description: 'Format memory/conversation history into a readable format',
497
+ fn: formatMemory,
498
+ },
499
+ {
500
+ name: 'repeat',
501
+ description: 'Repeat content n times',
502
+ fn: repeat,
503
+ },
504
+ {
505
+ name: 'formatDate',
506
+ description: 'Format a date value',
507
+ fn: formatDate,
508
+ },
509
+ {
510
+ name: 'json',
511
+ description: 'JSON stringify with formatting options',
512
+ fn: json,
513
+ },
514
+ {
515
+ name: 'truncate',
516
+ description: 'Truncate text to a maximum length',
517
+ fn: truncate,
518
+ },
519
+ {
520
+ name: 'join',
521
+ description: 'Join array items with a separator',
522
+ fn: join,
523
+ },
524
+ {
525
+ name: 'compare',
526
+ description: 'String comparison helper',
527
+ fn: compare,
528
+ },
529
+ {
530
+ name: 'capitalize',
531
+ description: 'Capitalize first letter of string',
532
+ fn: capitalize,
533
+ },
534
+ {
535
+ name: 'uppercase',
536
+ description: 'Convert string to uppercase',
537
+ fn: uppercase,
538
+ },
539
+ {
540
+ name: 'lowercase',
541
+ description: 'Convert string to lowercase',
542
+ fn: lowercase,
543
+ },
544
+ {
545
+ name: 'indent',
546
+ description: 'Indent text by a number of spaces',
547
+ fn: indent,
548
+ },
549
+ {
550
+ name: 'wrap',
551
+ description: 'Wrap text to a maximum line width',
552
+ fn: wrap,
553
+ },
554
+ {
555
+ name: 'bulletList',
556
+ description: 'Create a bulleted list from array',
557
+ fn: bulletList,
558
+ },
559
+ {
560
+ name: 'numberedList',
561
+ description: 'Create a numbered list from array',
562
+ fn: numberedList,
563
+ },
564
+ ];
565
+ }
566
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;AAoBH,kCA8CC;AAYD,8BASC;AAcD,8BAcC;AAYD,oCAoCC;AAYD,wBAcC;AAYD,gCA+CC;AAYD,oBAUC;AAaD,4BAiBC;AAYD,oBAUC;AAcD,0BAsDC;AAWD,gCAKC;AAWD,8BAKC;AAWD,8BAKC;AAYD,wBAcC;AAYD,oBA6BC;AAYD,gCAUC;AAYD,oCAYC;AAOD,8CAyFC;AAroBD,4DAAoC;AAQpC;;;;;;;;;GASG;AACH,SAAgB,WAAW,CACzB,KAAmC,EACnC,OAAkC;IAElC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,EAAE,IAAI,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/**
2
+ * @wundr/prompt-templates - Jinja2-style dynamic prompt templating using Handlebars
3
+ *
4
+ * This package provides a powerful templating engine for creating dynamic AI prompts
5
+ * with support for variables, helpers, macros, and context-aware rendering.
6
+ *
7
+ * @example Basic usage
8
+ * ```typescript
9
+ * import { createEngine } from '@wundr.io/prompt-templates';
10
+ *
11
+ * const engine = createEngine();
12
+ *
13
+ * const result = engine.render(
14
+ * 'Hello, {{name}}! You are a {{role}}.',
15
+ * { variables: { name: 'Claude', role: 'helpful assistant' } }
16
+ * );
17
+ *
18
+ * console.log(result.output);
19
+ * // Output: "Hello, Claude! You are a helpful assistant."
20
+ * ```
21
+ *
22
+ * @example Using macros
23
+ * ```typescript
24
+ * import { createEngine } from '@wundr.io/prompt-templates';
25
+ *
26
+ * const engine = createEngine();
27
+ *
28
+ * const result = engine.render(
29
+ * '{{> systemRole role="a coding assistant" expertise="TypeScript" }}',
30
+ * { variables: {} }
31
+ * );
32
+ * ```
33
+ *
34
+ * @example Loading templates from files
35
+ * ```typescript
36
+ * import { createEngine } from '@wundr.io/prompt-templates';
37
+ *
38
+ * const engine = createEngine({}, '/path/to/templates');
39
+ * engine.loadTemplate('my-prompt');
40
+ *
41
+ * const result = engine.render('my-prompt', {
42
+ * variables: { user: 'John' }
43
+ * });
44
+ * ```
45
+ *
46
+ * @packageDocumentation
47
+ */
48
+ export type { JsonPrimitive, JsonValue, JsonObject, JsonArray, TemplateContext, SystemContext, MemoryContext, ConversationMessage, ToolDefinition, ToolParameters, ToolParameterProperty, PromptTemplateConfig, MacroDefinition, MacroParameter, HelperDefinition, HelperFunction, SafeString, RenderOptions, RenderResult, RenderMetadata, TemplateError, LoaderOptions, EngineEvents, EngineEventHandler, } from './types.js';
49
+ export { PromptTemplateConfigSchema, ToolDefinitionSchema, MacroDefinitionSchema, } from './types.js';
50
+ export { PromptTemplateEngine, createEngine } from './engine.js';
51
+ export { TemplateLoader, createLoader } from './loader.js';
52
+ export { formatTools, ifDefined, codeBlock, formatMemory, repeat, formatDate, json, truncate, join, compare, capitalize, uppercase, lowercase, indent, wrap, bulletList, numberedList, getBuiltinHelpers, } from './helpers.js';
53
+ export { systemRoleMacro, taskContextMacro, outputFormatMacro, conversationHistoryMacro, toolsSectionMacro, codeContextMacro, chainOfThoughtMacro, fewShotExamplesMacro, safetyGuardrailsMacro, personaMacro, getBuiltinMacros, getMacroByName, getMacroNames, } from './macros.js';
54
+ export declare const version = "1.0.3";
55
+ export declare const name = "@wundr.io/prompt-templates";
56
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAGH,YAAY,EAEV,aAAa,EACb,SAAS,EACT,UAAU,EACV,SAAS,EAET,eAAe,EACf,aAAa,EACb,aAAa,EACb,mBAAmB,EAEnB,cAAc,EACd,cAAc,EACd,qBAAqB,EAErB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,UAAU,EAEV,aAAa,EACb,YAAY,EACZ,cAAc,EACd,aAAa,EAEb,aAAa,EAEb,YAAY,EACZ,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGjE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3D,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,EACZ,MAAM,EACN,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,EACT,MAAM,EACN,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,aAAa,GACd,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,IAAI,+BAA+B,CAAC"}