@elizaos/plugin-whatsapp 2.0.0-beta.1 → 2.0.3-beta.6
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/LICENSE +21 -0
- package/README.md +104 -211
- package/auto-enable.ts +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/accounts.d.ts +2 -2
- package/dist/baileys/message-adapter.d.ts.map +1 -1
- package/dist/baileys/qr-code.d.ts.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/connector-account-provider.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +209 -49
- package/dist/index.js.map +16 -14
- package/dist/media.d.ts +2 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/qrcode-terminal-types.d.ts +6 -0
- package/dist/qrcode-terminal-types.d.ts.map +1 -0
- package/dist/runtime-service.d.ts +10 -1
- package/dist/runtime-service.d.ts.map +1 -1
- package/dist/setup-routes.d.ts.map +1 -1
- package/dist/webhook-auth.d.ts +11 -0
- package/dist/webhook-auth.d.ts.map +1 -0
- package/package.json +30 -5
- package/registry-entry.json +128 -0
- package/dist/actions/index.d.ts +0 -1
- package/dist/actions/index.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/validators.d.ts +0 -10
- package/dist/utils/validators.d.ts.map +0 -1
package/dist/media.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../src/media.ts"],"names":[],"mappings":"AAMA,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAiBhF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qrcode-terminal-types.d.ts","sourceRoot":"","sources":["../src/qrcode-terminal-types.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,iBAAiB,CAAC;IAC/B,SAAgB,QAAQ,CACtB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,EAC7B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAClC,IAAI,CAAC;CACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IAgentRuntime, type Memory, Service, type UUID } from "@elizaos/core";
|
|
1
|
+
import { type IAgentRuntime, type Media, type Memory, Service, type UUID } from "@elizaos/core";
|
|
2
2
|
import type { WhatsAppMessageResponse, WhatsAppWebhookEvent } from "./types";
|
|
3
3
|
type RuntimeServiceConfig = {
|
|
4
4
|
accountId: string;
|
|
@@ -103,6 +103,15 @@ export declare class WhatsAppConnectorService extends Service {
|
|
|
103
103
|
content: string;
|
|
104
104
|
replyToMessageId?: string;
|
|
105
105
|
}): Promise<WhatsAppMessageResponse>;
|
|
106
|
+
/** Coarse content type → WhatsApp media message kind. */
|
|
107
|
+
private whatsappMediaType;
|
|
108
|
+
/**
|
|
109
|
+
* Send an agent attachment as a native WhatsApp media message (#8876). Works
|
|
110
|
+
* across both transports: the Cloud-API client and the Baileys client each
|
|
111
|
+
* build their own payload from the shared `WhatsAppMessage` media type, both
|
|
112
|
+
* keyed on a media URL (`link`).
|
|
113
|
+
*/
|
|
114
|
+
sendMediaMessage(accountId: string | null | undefined, to: string, media: Media): Promise<void>;
|
|
106
115
|
fetchConnectorMessages(context: MessageConnectorQueryContext, params: ConnectorFetchMessagesParams): Promise<Memory[]>;
|
|
107
116
|
searchConnectorMessages(context: MessageConnectorQueryContext, params: ConnectorSearchMessagesParams): Promise<Memory[]>;
|
|
108
117
|
reactConnectorMessage(runtime: IAgentRuntime, params: ConnectorReactionParams): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-service.d.ts","sourceRoot":"","sources":["../src/runtime-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,aAAa,EAElB,KAAK,MAAM,EAEX,OAAO,EACP,KAAK,IAAI,EACV,MAAM,eAAe,CAAC;AAqBvB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"runtime-service.d.ts","sourceRoot":"","sources":["../src/runtime-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,aAAa,EAElB,KAAK,KAAK,EACV,KAAK,MAAM,EAEX,OAAO,EACP,KAAK,IAAI,EACV,MAAM,eAAe,CAAC;AAqBvB,OAAO,KAAK,EAOV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,KAAK,oBAAoB,GACrB;IACE,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;IACzD,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,GACD;IACE,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,UAAU,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;IACzD,WAAW,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,EAA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M,GAAG,IAAI,GAAG,mBAAmB,EAAE;IAOlE,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,mBAAmB,GAAG,IAAI;IAcrF,0BAA0B,CACxB,WAAW,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GACxB,mBAAmB,GAAG,IAAI;IAiB7B,OAAO,CAAC,cAAc;CAMvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-routes.d.ts","sourceRoot":"","sources":["../src/setup-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAiB,KAAK,EAA+B,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"setup-routes.d.ts","sourceRoot":"","sources":["../src/setup-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAiB,KAAK,EAA+B,MAAM,eAAe,CAAC;AAiZvF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,EAyCtC,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAS7C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IAgentRuntime, RouteRequest } from "@elizaos/core";
|
|
2
|
+
export declare function resolveWhatsAppAppSecret(runtime: IAgentRuntime): string | null;
|
|
3
|
+
/**
|
|
4
|
+
* Verify Meta WhatsApp webhook signature (X-Hub-Signature-256).
|
|
5
|
+
* @see https://developers.facebook.com/docs/graph-api/webhooks/getting-started#verification-requests
|
|
6
|
+
*/
|
|
7
|
+
export declare function verifyWhatsAppWebhookSignature(appSecret: string, signatureHeader: string | undefined, rawBody: string): boolean;
|
|
8
|
+
export declare function readRouteHeader(req: RouteRequest, name: string): string | undefined;
|
|
9
|
+
export declare function readWebhookRawBody(req: RouteRequest): string | null;
|
|
10
|
+
export declare function isWhatsAppWebhookAuthorized(runtime: IAgentRuntime, req: RouteRequest): boolean;
|
|
11
|
+
//# sourceMappingURL=webhook-auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook-auth.d.ts","sourceRoot":"","sources":["../src/webhook-auth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIjE,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAU9E;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,OAAO,EAAE,MAAM,GACd,OAAO,CAiBT;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASnF;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI,CAKnE;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAU9F"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elizaos/plugin-whatsapp",
|
|
3
3
|
"description": "WhatsApp plugin for ElizaOS (Cloud API + Baileys QR auth)",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.3-beta.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -21,13 +21,30 @@
|
|
|
21
21
|
"exports": {
|
|
22
22
|
"./package.json": "./package.json",
|
|
23
23
|
".": {
|
|
24
|
+
"eliza-source": {
|
|
25
|
+
"types": "./src/index.ts",
|
|
26
|
+
"import": "./src/index.ts",
|
|
27
|
+
"default": "./src/index.ts"
|
|
28
|
+
},
|
|
24
29
|
"import": {
|
|
25
30
|
"types": "./dist/src/index.d.ts",
|
|
26
31
|
"default": "./dist/index.js"
|
|
27
32
|
}
|
|
33
|
+
},
|
|
34
|
+
"./*.css": "./dist/*.css",
|
|
35
|
+
"./*": {
|
|
36
|
+
"types": "./dist/*.d.ts",
|
|
37
|
+
"eliza-source": {
|
|
38
|
+
"types": "./src/*.ts",
|
|
39
|
+
"import": "./src/*.ts",
|
|
40
|
+
"default": "./src/*.ts"
|
|
41
|
+
},
|
|
42
|
+
"import": "./dist/*.js",
|
|
43
|
+
"default": "./dist/*.js"
|
|
28
44
|
}
|
|
29
45
|
},
|
|
30
46
|
"files": [
|
|
47
|
+
"registry-entry.json",
|
|
31
48
|
"dist",
|
|
32
49
|
"README.md",
|
|
33
50
|
"package.json",
|
|
@@ -49,11 +66,12 @@
|
|
|
49
66
|
"qrcode-terminal": "^0.12.0"
|
|
50
67
|
},
|
|
51
68
|
"peerDependencies": {
|
|
52
|
-
"@elizaos/core": "2.0.
|
|
69
|
+
"@elizaos/core": "2.0.3-beta.6"
|
|
53
70
|
},
|
|
54
71
|
"devDependencies": {
|
|
55
72
|
"@biomejs/biome": "^2.4.14",
|
|
56
73
|
"@types/node": "^25.0.3",
|
|
74
|
+
"@types/qrcode": "^1.5.5",
|
|
57
75
|
"typescript": "^6.0.3",
|
|
58
76
|
"vitest": "^4.0.0"
|
|
59
77
|
},
|
|
@@ -61,8 +79,8 @@
|
|
|
61
79
|
"dev": "bun --hot build.ts",
|
|
62
80
|
"test": "vitest run --config ./vitest.config.ts",
|
|
63
81
|
"lint": "bunx @biomejs/biome check --write --config-path ./biome.json .",
|
|
64
|
-
"typecheck": "
|
|
65
|
-
"clean": "rm
|
|
82
|
+
"typecheck": "tsgo --noEmit -p tsconfig.json",
|
|
83
|
+
"clean": "node ../../packages/scripts/rm-path-recursive.mjs dist .turbo",
|
|
66
84
|
"lint:check": "bunx @biomejs/biome check --config-path ./biome.json .",
|
|
67
85
|
"build": "bun run build.ts",
|
|
68
86
|
"build:ts": "bun run build.ts",
|
|
@@ -110,6 +128,12 @@
|
|
|
110
128
|
"required": false,
|
|
111
129
|
"sensitive": true
|
|
112
130
|
},
|
|
131
|
+
"WHATSAPP_APP_SECRET": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"description": "WhatsApp App Secret used to verify X-Hub-Signature-256 on webhook POSTs (required for Cloud API webhooks)",
|
|
134
|
+
"required": false,
|
|
135
|
+
"sensitive": true
|
|
136
|
+
},
|
|
113
137
|
"WHATSAPP_BUSINESS_ACCOUNT_ID": {
|
|
114
138
|
"type": "string",
|
|
115
139
|
"description": "Business account ID",
|
|
@@ -135,5 +159,6 @@
|
|
|
135
159
|
"sensitive": false
|
|
136
160
|
}
|
|
137
161
|
}
|
|
138
|
-
}
|
|
162
|
+
},
|
|
163
|
+
"gitHead": "990dc996172b3e0fb525a75052a5ac28a4cd4de5"
|
|
139
164
|
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "whatsapp",
|
|
3
|
+
"name": "Whatsapp",
|
|
4
|
+
"description": "A plugin for integrating WhatsApp Cloud API with applications, enabling messaging capabilities and webhook handling.",
|
|
5
|
+
"npmName": "@elizaos/plugin-whatsapp",
|
|
6
|
+
"version": "2.0.0-beta.0",
|
|
7
|
+
"source": "bundled",
|
|
8
|
+
"tags": [
|
|
9
|
+
"whatsapp",
|
|
10
|
+
"connector",
|
|
11
|
+
"social",
|
|
12
|
+
"social-chat",
|
|
13
|
+
"messaging"
|
|
14
|
+
],
|
|
15
|
+
"config": {
|
|
16
|
+
"WHATSAPP_ACCESS_TOKEN": {
|
|
17
|
+
"type": "secret",
|
|
18
|
+
"required": false,
|
|
19
|
+
"sensitive": true,
|
|
20
|
+
"label": "Access Token",
|
|
21
|
+
"help": "Access token for WhatsApp Cloud API (required for cloudapi auth)",
|
|
22
|
+
"advanced": false
|
|
23
|
+
},
|
|
24
|
+
"WHATSAPP_PHONE_NUMBER_ID": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"required": false,
|
|
27
|
+
"sensitive": false,
|
|
28
|
+
"label": "Phone Number Id",
|
|
29
|
+
"help": "Phone number ID for WhatsApp Cloud API (required for cloudapi auth)",
|
|
30
|
+
"advanced": false
|
|
31
|
+
},
|
|
32
|
+
"WHATSAPP_AUTH_METHOD": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"required": false,
|
|
35
|
+
"sensitive": false,
|
|
36
|
+
"label": "Auth Method",
|
|
37
|
+
"help": "Authentication method: cloudapi or baileys",
|
|
38
|
+
"advanced": false
|
|
39
|
+
},
|
|
40
|
+
"WHATSAPP_AUTH_DIR": {
|
|
41
|
+
"type": "file-path",
|
|
42
|
+
"required": false,
|
|
43
|
+
"sensitive": false,
|
|
44
|
+
"label": "Auth Dir",
|
|
45
|
+
"help": "Directory used to persist Baileys session files (required for baileys auth)",
|
|
46
|
+
"advanced": false
|
|
47
|
+
},
|
|
48
|
+
"WHATSAPP_PRINT_QR": {
|
|
49
|
+
"type": "boolean",
|
|
50
|
+
"required": false,
|
|
51
|
+
"sensitive": false,
|
|
52
|
+
"label": "Print Qr",
|
|
53
|
+
"help": "Print QR code in terminal when using Baileys auth",
|
|
54
|
+
"advanced": false
|
|
55
|
+
},
|
|
56
|
+
"WHATSAPP_WEBHOOK_VERIFY_TOKEN": {
|
|
57
|
+
"type": "secret",
|
|
58
|
+
"required": false,
|
|
59
|
+
"sensitive": true,
|
|
60
|
+
"label": "Webhook Verify Token",
|
|
61
|
+
"help": "Webhook verification token",
|
|
62
|
+
"advanced": false
|
|
63
|
+
},
|
|
64
|
+
"WHATSAPP_BUSINESS_ACCOUNT_ID": {
|
|
65
|
+
"type": "number",
|
|
66
|
+
"required": false,
|
|
67
|
+
"sensitive": false,
|
|
68
|
+
"label": "Business Account Id",
|
|
69
|
+
"help": "Business account ID",
|
|
70
|
+
"advanced": false,
|
|
71
|
+
"min": 0
|
|
72
|
+
},
|
|
73
|
+
"WHATSAPP_API_VERSION": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"required": false,
|
|
76
|
+
"sensitive": false,
|
|
77
|
+
"label": "Api Version",
|
|
78
|
+
"help": "API version string",
|
|
79
|
+
"advanced": false
|
|
80
|
+
},
|
|
81
|
+
"WHATSAPP_DM_POLICY": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"required": false,
|
|
84
|
+
"sensitive": false,
|
|
85
|
+
"label": "Dm Policy",
|
|
86
|
+
"help": "DM policy (e.g. allow, deny, allowlist)",
|
|
87
|
+
"advanced": false
|
|
88
|
+
},
|
|
89
|
+
"WHATSAPP_GROUP_POLICY": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"required": false,
|
|
92
|
+
"sensitive": false,
|
|
93
|
+
"label": "Group Policy",
|
|
94
|
+
"help": "Group message policy",
|
|
95
|
+
"advanced": false
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"render": {
|
|
99
|
+
"visible": true,
|
|
100
|
+
"pinTo": [],
|
|
101
|
+
"style": "setup-panel",
|
|
102
|
+
"icon": "Smartphone",
|
|
103
|
+
"group": "connector",
|
|
104
|
+
"groupOrder": 1,
|
|
105
|
+
"actions": [
|
|
106
|
+
"enable",
|
|
107
|
+
"configure",
|
|
108
|
+
"setup-guide"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"resources": {
|
|
112
|
+
"homepage": "https://github.com/elizaos/eliza#readme",
|
|
113
|
+
"repository": "https://github.com/elizaos/eliza",
|
|
114
|
+
"setupGuideUrl": "https://docs.eliza.ai/plugin-setup-guide#whatsapp"
|
|
115
|
+
},
|
|
116
|
+
"dependsOn": [],
|
|
117
|
+
"kind": "connector",
|
|
118
|
+
"subtype": "messaging",
|
|
119
|
+
"auth": {
|
|
120
|
+
"kind": "token",
|
|
121
|
+
"credentialKeys": [
|
|
122
|
+
"WHATSAPP_ACCESS_TOKEN"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"channels": [
|
|
126
|
+
"whatsapp"
|
|
127
|
+
]
|
|
128
|
+
}
|
package/dist/actions/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":""}
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { WhatsAppConfig, WhatsAppMessage, WhatsAppTemplate } from "../types";
|
|
2
|
-
export declare function validateConfig(config: WhatsAppConfig): void;
|
|
3
|
-
export declare function validateMessage(message: WhatsAppMessage): void;
|
|
4
|
-
export declare function validateTemplate(template: WhatsAppTemplate): void;
|
|
5
|
-
/**
|
|
6
|
-
* Validates a WhatsApp phone number using robust E.164 format checking.
|
|
7
|
-
* Requires at minimum 10 digits and validates against WhatsApp JID normalization rules.
|
|
8
|
-
*/
|
|
9
|
-
export declare function validatePhoneNumber(phoneNumber: string): boolean;
|
|
10
|
-
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/utils/validators.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGlF,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAgB3D;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAgB9D;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAQjE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAEhE"}
|