@anymux/connect 0.1.0
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/GitBrowser-BLgTNQyd.js +905 -0
- package/dist/GitBrowser-BLgTNQyd.js.map +1 -0
- package/dist/GitBrowser-CIyWiuX-.js +3 -0
- package/dist/ObjectStorageBrowser-B2YkUxMl.js +3 -0
- package/dist/ObjectStorageBrowser-B_25Emfu.js +267 -0
- package/dist/ObjectStorageBrowser-B_25Emfu.js.map +1 -0
- package/dist/RepoPicker-BprFGOn7.js +3 -0
- package/dist/RepoPicker-CoHMiJ-3.js +168 -0
- package/dist/RepoPicker-CoHMiJ-3.js.map +1 -0
- package/dist/index.d.ts +697 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2539 -0
- package/dist/index.js.map +1 -0
- package/dist/registry.d.ts +2 -0
- package/dist/registry.js +3 -0
- package/dist/scope-labels-B4VAwoL6.js +582 -0
- package/dist/scope-labels-B4VAwoL6.js.map +1 -0
- package/dist/scope-labels-DvdJLcSL.d.ts +50 -0
- package/dist/scope-labels-DvdJLcSL.d.ts.map +1 -0
- package/package.json +87 -0
- package/src/adapters/adapter-registry.ts +177 -0
- package/src/auth/auth-client.ts +101 -0
- package/src/auth/token-manager.ts +27 -0
- package/src/components/ActionHistoryPanel.tsx +137 -0
- package/src/components/CapabilityCell.tsx +97 -0
- package/src/components/CapabilityError.tsx +50 -0
- package/src/components/CapabilityPanel.tsx +530 -0
- package/src/components/CapabilityPill.tsx +56 -0
- package/src/components/ConnectButton.tsx +149 -0
- package/src/components/ConnectedMenu.tsx +142 -0
- package/src/components/ConnectionStatus.tsx +28 -0
- package/src/components/CredentialForm.tsx +246 -0
- package/src/components/FullScreenBrowser.tsx +84 -0
- package/src/components/GitBrowser.tsx +705 -0
- package/src/components/GitHubRepoPicker.tsx +125 -0
- package/src/components/ObjectStorageBrowser.tsx +176 -0
- package/src/components/RepoPicker.tsx +93 -0
- package/src/components/ServiceCard.tsx +77 -0
- package/src/components/ServiceCardGrid.tsx +141 -0
- package/src/components/ServiceDashboard.tsx +84 -0
- package/src/components/ServiceIcon.tsx +37 -0
- package/src/components/ServiceRow.tsx +50 -0
- package/src/components/useAdapter.ts +33 -0
- package/src/demos/ServiceDashboardDemo.tsx +108 -0
- package/src/index.ts +68 -0
- package/src/models/ActionNotificationModel.ts +72 -0
- package/src/models/ConnectionManagerModel.ts +410 -0
- package/src/models/CredentialFormModel.ts +111 -0
- package/src/models/DashboardModel.ts +157 -0
- package/src/models/GitHostBrowserModel.ts +89 -0
- package/src/models/GitRepoBrowserModel.ts +285 -0
- package/src/models/ObjectStorageBrowserModel.ts +131 -0
- package/src/models/RepoPickerModel.ts +132 -0
- package/src/registry/service-registry.ts +46 -0
- package/src/registry/services/apple.ts +22 -0
- package/src/registry/services/bitbucket.ts +24 -0
- package/src/registry/services/box.ts +22 -0
- package/src/registry/services/browser-fs.ts +19 -0
- package/src/registry/services/dropbox.ts +22 -0
- package/src/registry/services/flickr.ts +22 -0
- package/src/registry/services/gitea.ts +24 -0
- package/src/registry/services/github.ts +24 -0
- package/src/registry/services/gitlab.ts +24 -0
- package/src/registry/services/google.ts +24 -0
- package/src/registry/services/icloud.ts +23 -0
- package/src/registry/services/indexeddb.ts +19 -0
- package/src/registry/services/instagram.ts +22 -0
- package/src/registry/services/microsoft.ts +24 -0
- package/src/registry/services/s3.ts +21 -0
- package/src/registry/services/webdav.ts +21 -0
- package/src/registry.ts +4 -0
- package/src/types/connection-state.ts +33 -0
- package/src/types/connection.ts +11 -0
- package/src/types/optional-deps.d.ts +149 -0
- package/src/types/service.ts +18 -0
- package/src/types/user-profile.ts +21 -0
- package/src/utils/action-toast.ts +53 -0
- package/src/utils/scope-labels.ts +91 -0
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
//#region src/registry/services/google.ts
|
|
2
|
+
const googleService = {
|
|
3
|
+
id: "google",
|
|
4
|
+
name: "Google",
|
|
5
|
+
icon: "Cloud",
|
|
6
|
+
color: "#4285F4",
|
|
7
|
+
authProvider: "google",
|
|
8
|
+
grantsUrl: "https://myaccount.google.com/permissions",
|
|
9
|
+
capabilities: [
|
|
10
|
+
{
|
|
11
|
+
id: "file-system",
|
|
12
|
+
supported: true
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: "object-storage",
|
|
16
|
+
supported: false
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "git-repo",
|
|
20
|
+
supported: false
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: "git-host",
|
|
24
|
+
supported: false
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "media",
|
|
28
|
+
supported: false
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "contacts",
|
|
32
|
+
supported: true
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "calendar",
|
|
36
|
+
supported: true
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
scopes: {
|
|
40
|
+
"file-system": ["https://www.googleapis.com/auth/drive"],
|
|
41
|
+
"calendar": ["https://www.googleapis.com/auth/calendar.readonly"],
|
|
42
|
+
"contacts": ["https://www.googleapis.com/auth/contacts.readonly"]
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/registry/services/dropbox.ts
|
|
48
|
+
const dropboxService = {
|
|
49
|
+
id: "dropbox",
|
|
50
|
+
name: "Dropbox",
|
|
51
|
+
icon: "Box",
|
|
52
|
+
color: "#0061FF",
|
|
53
|
+
authProvider: "dropbox",
|
|
54
|
+
grantsUrl: "https://www.dropbox.com/account/connected_apps",
|
|
55
|
+
capabilities: [
|
|
56
|
+
{
|
|
57
|
+
id: "file-system",
|
|
58
|
+
supported: true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "object-storage",
|
|
62
|
+
supported: false
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "git-repo",
|
|
66
|
+
supported: false
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: "git-host",
|
|
70
|
+
supported: false
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "media",
|
|
74
|
+
supported: false
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "contacts",
|
|
78
|
+
supported: false
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "calendar",
|
|
82
|
+
supported: false
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
scopes: { "file-system": [
|
|
86
|
+
"files.metadata.read",
|
|
87
|
+
"files.content.read",
|
|
88
|
+
"files.content.write"
|
|
89
|
+
] }
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/registry/services/github.ts
|
|
94
|
+
const githubService = {
|
|
95
|
+
id: "github",
|
|
96
|
+
name: "GitHub",
|
|
97
|
+
icon: "Github",
|
|
98
|
+
color: "#24292F",
|
|
99
|
+
authProvider: "github",
|
|
100
|
+
grantsUrl: "https://github.com/settings/applications",
|
|
101
|
+
capabilities: [
|
|
102
|
+
{
|
|
103
|
+
id: "file-system",
|
|
104
|
+
supported: true
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: "object-storage",
|
|
108
|
+
supported: false
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "git-repo",
|
|
112
|
+
supported: true
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: "git-host",
|
|
116
|
+
supported: true
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "media",
|
|
120
|
+
supported: false
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
id: "contacts",
|
|
124
|
+
supported: false
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: "calendar",
|
|
128
|
+
supported: false
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
scopes: {
|
|
132
|
+
"file-system": ["repo"],
|
|
133
|
+
"git-repo": ["repo"],
|
|
134
|
+
"git-host": ["repo"]
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region src/registry/services/s3.ts
|
|
140
|
+
const s3Service = {
|
|
141
|
+
id: "s3",
|
|
142
|
+
name: "Amazon S3",
|
|
143
|
+
icon: "Database",
|
|
144
|
+
color: "#FF9900",
|
|
145
|
+
authProvider: "s3",
|
|
146
|
+
capabilities: [
|
|
147
|
+
{
|
|
148
|
+
id: "file-system",
|
|
149
|
+
supported: false
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
id: "object-storage",
|
|
153
|
+
supported: true
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: "git-repo",
|
|
157
|
+
supported: false
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: "git-host",
|
|
161
|
+
supported: false
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: "media",
|
|
165
|
+
supported: false
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: "contacts",
|
|
169
|
+
supported: false
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
id: "calendar",
|
|
173
|
+
supported: false
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
scopes: { "object-storage": [
|
|
177
|
+
"s3:GetObject",
|
|
178
|
+
"s3:PutObject",
|
|
179
|
+
"s3:ListBucket"
|
|
180
|
+
] }
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/registry/services/webdav.ts
|
|
185
|
+
const webdavService = {
|
|
186
|
+
id: "webdav",
|
|
187
|
+
name: "WebDAV",
|
|
188
|
+
icon: "Server",
|
|
189
|
+
color: "#6B7280",
|
|
190
|
+
authProvider: "webdav",
|
|
191
|
+
capabilities: [
|
|
192
|
+
{
|
|
193
|
+
id: "file-system",
|
|
194
|
+
supported: true
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: "object-storage",
|
|
198
|
+
supported: false
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: "git-repo",
|
|
202
|
+
supported: false
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: "git-host",
|
|
206
|
+
supported: false
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
id: "media",
|
|
210
|
+
supported: false
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: "contacts",
|
|
214
|
+
supported: false
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: "calendar",
|
|
218
|
+
supported: false
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
scopes: { "file-system": [] }
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/registry/services/gitlab.ts
|
|
226
|
+
const gitlabService = {
|
|
227
|
+
id: "gitlab",
|
|
228
|
+
name: "GitLab",
|
|
229
|
+
icon: "GitBranch",
|
|
230
|
+
color: "#FC6D26",
|
|
231
|
+
authProvider: "gitlab",
|
|
232
|
+
grantsUrl: "https://gitlab.com/-/user_settings/applications",
|
|
233
|
+
capabilities: [
|
|
234
|
+
{
|
|
235
|
+
id: "file-system",
|
|
236
|
+
supported: true
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
id: "object-storage",
|
|
240
|
+
supported: false
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
id: "git-repo",
|
|
244
|
+
supported: true
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
id: "git-host",
|
|
248
|
+
supported: true
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: "media",
|
|
252
|
+
supported: false
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
id: "contacts",
|
|
256
|
+
supported: false
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
id: "calendar",
|
|
260
|
+
supported: false
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
scopes: {
|
|
264
|
+
"file-system": ["read_api"],
|
|
265
|
+
"git-repo": ["read_api"],
|
|
266
|
+
"git-host": ["read_api"]
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region src/registry/services/bitbucket.ts
|
|
272
|
+
const bitbucketService = {
|
|
273
|
+
id: "bitbucket",
|
|
274
|
+
name: "Bitbucket",
|
|
275
|
+
icon: "GitBranch",
|
|
276
|
+
color: "#0052CC",
|
|
277
|
+
authProvider: "bitbucket",
|
|
278
|
+
grantsUrl: "https://bitbucket.org/account/settings/app-authorizations/",
|
|
279
|
+
capabilities: [
|
|
280
|
+
{
|
|
281
|
+
id: "file-system",
|
|
282
|
+
supported: true
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
id: "object-storage",
|
|
286
|
+
supported: false
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
id: "git-repo",
|
|
290
|
+
supported: true
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
id: "git-host",
|
|
294
|
+
supported: true
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
id: "media",
|
|
298
|
+
supported: false
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
id: "contacts",
|
|
302
|
+
supported: false
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
id: "calendar",
|
|
306
|
+
supported: false
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
scopes: {
|
|
310
|
+
"file-system": ["repository"],
|
|
311
|
+
"git-repo": ["repository"],
|
|
312
|
+
"git-host": ["repository", "pullrequest"]
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
//#endregion
|
|
317
|
+
//#region src/registry/services/gitea.ts
|
|
318
|
+
const giteaService = {
|
|
319
|
+
id: "gitea",
|
|
320
|
+
name: "Gitea",
|
|
321
|
+
icon: "GitBranch",
|
|
322
|
+
color: "#609926",
|
|
323
|
+
authProvider: "gitea",
|
|
324
|
+
grantsUrl: "https://gitea.io/en-us/user_settings/applications",
|
|
325
|
+
capabilities: [
|
|
326
|
+
{
|
|
327
|
+
id: "file-system",
|
|
328
|
+
supported: true
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
id: "object-storage",
|
|
332
|
+
supported: false
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
id: "git-repo",
|
|
336
|
+
supported: true
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
id: "git-host",
|
|
340
|
+
supported: true
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
id: "media",
|
|
344
|
+
supported: false
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
id: "contacts",
|
|
348
|
+
supported: false
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
id: "calendar",
|
|
352
|
+
supported: false
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
scopes: {
|
|
356
|
+
"file-system": ["read:repository"],
|
|
357
|
+
"git-repo": ["read:repository"],
|
|
358
|
+
"git-host": ["read:repository", "read:user"]
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region src/registry/services/browser-fs.ts
|
|
364
|
+
const browserFsService = {
|
|
365
|
+
id: "browser-fs",
|
|
366
|
+
name: "Local Files",
|
|
367
|
+
icon: "FolderOpen",
|
|
368
|
+
color: "#4CAF50",
|
|
369
|
+
authProvider: "browser-fs",
|
|
370
|
+
capabilities: [
|
|
371
|
+
{
|
|
372
|
+
id: "file-system",
|
|
373
|
+
supported: true
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
id: "object-storage",
|
|
377
|
+
supported: false
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
id: "git-repo",
|
|
381
|
+
supported: false
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
id: "git-host",
|
|
385
|
+
supported: false
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
id: "media",
|
|
389
|
+
supported: false
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
id: "contacts",
|
|
393
|
+
supported: false
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
id: "calendar",
|
|
397
|
+
supported: false
|
|
398
|
+
}
|
|
399
|
+
],
|
|
400
|
+
scopes: {}
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region src/registry/services/indexeddb.ts
|
|
405
|
+
const indexeddbService = {
|
|
406
|
+
id: "indexeddb",
|
|
407
|
+
name: "IndexedDB",
|
|
408
|
+
icon: "Database",
|
|
409
|
+
color: "#FF9800",
|
|
410
|
+
authProvider: "indexeddb",
|
|
411
|
+
capabilities: [
|
|
412
|
+
{
|
|
413
|
+
id: "file-system",
|
|
414
|
+
supported: true
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
id: "object-storage",
|
|
418
|
+
supported: false
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
id: "git-repo",
|
|
422
|
+
supported: false
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
id: "git-host",
|
|
426
|
+
supported: false
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
id: "media",
|
|
430
|
+
supported: false
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
id: "contacts",
|
|
434
|
+
supported: false
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
id: "calendar",
|
|
438
|
+
supported: false
|
|
439
|
+
}
|
|
440
|
+
],
|
|
441
|
+
scopes: {}
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
//#endregion
|
|
445
|
+
//#region src/registry/services/box.ts
|
|
446
|
+
const boxService = {
|
|
447
|
+
id: "box",
|
|
448
|
+
name: "Box",
|
|
449
|
+
icon: "Box",
|
|
450
|
+
color: "#0061D5",
|
|
451
|
+
authProvider: "box",
|
|
452
|
+
grantsUrl: "https://app.box.com/account/security",
|
|
453
|
+
capabilities: [
|
|
454
|
+
{
|
|
455
|
+
id: "file-system",
|
|
456
|
+
supported: true
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
id: "object-storage",
|
|
460
|
+
supported: false
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
id: "git-repo",
|
|
464
|
+
supported: false
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
id: "git-host",
|
|
468
|
+
supported: false
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
id: "media",
|
|
472
|
+
supported: false
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
id: "contacts",
|
|
476
|
+
supported: false
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
id: "calendar",
|
|
480
|
+
supported: false
|
|
481
|
+
}
|
|
482
|
+
],
|
|
483
|
+
scopes: { "file-system": ["root_readwrite"] }
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
//#endregion
|
|
487
|
+
//#region src/registry/service-registry.ts
|
|
488
|
+
const services = new Map();
|
|
489
|
+
function register(service) {
|
|
490
|
+
services.set(service.id, service);
|
|
491
|
+
}
|
|
492
|
+
register(googleService);
|
|
493
|
+
register(dropboxService);
|
|
494
|
+
register(githubService);
|
|
495
|
+
register(s3Service);
|
|
496
|
+
register(webdavService);
|
|
497
|
+
register(gitlabService);
|
|
498
|
+
register(bitbucketService);
|
|
499
|
+
register(giteaService);
|
|
500
|
+
register(browserFsService);
|
|
501
|
+
register(indexeddbService);
|
|
502
|
+
register(boxService);
|
|
503
|
+
const serviceRegistry = {
|
|
504
|
+
get(id) {
|
|
505
|
+
return services.get(id);
|
|
506
|
+
},
|
|
507
|
+
getAll() {
|
|
508
|
+
return Array.from(services.values());
|
|
509
|
+
},
|
|
510
|
+
getByCapability(capability) {
|
|
511
|
+
return Array.from(services.values()).filter((s) => s.capabilities.some((c) => c.id === capability && c.supported));
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
//#endregion
|
|
516
|
+
//#region src/utils/scope-labels.ts
|
|
517
|
+
/**
|
|
518
|
+
* Maps raw OAuth scope strings to human-readable descriptions.
|
|
519
|
+
* Falls back to a cleaned-up version of the scope string for unknown scopes.
|
|
520
|
+
*/
|
|
521
|
+
const SCOPE_LABELS = {
|
|
522
|
+
"repo": "Repository access",
|
|
523
|
+
"read:user": "Read user profile",
|
|
524
|
+
"user:email": "Read email address",
|
|
525
|
+
"gist": "Gist access",
|
|
526
|
+
"read:org": "Read organizations",
|
|
527
|
+
"https://www.googleapis.com/auth/drive": "Google Drive",
|
|
528
|
+
"https://www.googleapis.com/auth/drive.readonly": "Google Drive (read-only)",
|
|
529
|
+
"https://www.googleapis.com/auth/calendar.readonly": "Calendar (read-only)",
|
|
530
|
+
"https://www.googleapis.com/auth/calendar": "Calendar",
|
|
531
|
+
"https://www.googleapis.com/auth/contacts.readonly": "Contacts (read-only)",
|
|
532
|
+
"https://www.googleapis.com/auth/contacts": "Contacts",
|
|
533
|
+
"Files.ReadWrite.All": "File read/write",
|
|
534
|
+
"Files.Read.All": "File read",
|
|
535
|
+
"Contacts.Read": "Contacts (read-only)",
|
|
536
|
+
"Calendars.Read": "Calendar (read-only)",
|
|
537
|
+
"User.Read": "User profile",
|
|
538
|
+
"read_api": "API read access",
|
|
539
|
+
"read_repository": "Repository read access",
|
|
540
|
+
"api": "Full API access",
|
|
541
|
+
"read_user": "Read user profile",
|
|
542
|
+
"repository": "Repository access",
|
|
543
|
+
"pullrequest": "Pull request access",
|
|
544
|
+
"account": "Account access",
|
|
545
|
+
"files.metadata.read": "Read file metadata",
|
|
546
|
+
"files.content.read": "Read file content",
|
|
547
|
+
"files.content.write": "Write file content",
|
|
548
|
+
"s3:GetObject": "Read objects",
|
|
549
|
+
"s3:PutObject": "Write objects",
|
|
550
|
+
"s3:ListBucket": "List buckets",
|
|
551
|
+
"root_readwrite": "Read & write all files",
|
|
552
|
+
"read:repository": "Repository read access",
|
|
553
|
+
"write:repository": "Repository write access"
|
|
554
|
+
};
|
|
555
|
+
/**
|
|
556
|
+
* Returns a human-readable label for a scope string.
|
|
557
|
+
* Unknown scopes get cleaned up: URL paths are extracted, dots/underscores become spaces.
|
|
558
|
+
*/
|
|
559
|
+
function getScopeLabel(scope) {
|
|
560
|
+
if (SCOPE_LABELS[scope]) return SCOPE_LABELS[scope];
|
|
561
|
+
if (scope.startsWith("https://")) {
|
|
562
|
+
const last = scope.split("/").pop() ?? scope;
|
|
563
|
+
return formatScopeSegment(last);
|
|
564
|
+
}
|
|
565
|
+
return formatScopeSegment(scope);
|
|
566
|
+
}
|
|
567
|
+
/** Turn a scope segment like "files.content.read" into "Files content read" */
|
|
568
|
+
function formatScopeSegment(segment) {
|
|
569
|
+
return segment.replace(/[._:]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()).trim();
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Deduplicate and label a list of scope strings.
|
|
573
|
+
* Returns unique human-readable labels sorted alphabetically.
|
|
574
|
+
*/
|
|
575
|
+
function getScopeLabels(scopes) {
|
|
576
|
+
const unique = [...new Set(scopes)];
|
|
577
|
+
return unique.map(getScopeLabel).sort();
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
//#endregion
|
|
581
|
+
export { bitbucketService, browserFsService, dropboxService, getScopeLabel, getScopeLabels, giteaService, githubService, gitlabService, googleService, indexeddbService, s3Service, serviceRegistry, webdavService };
|
|
582
|
+
//# sourceMappingURL=scope-labels-B4VAwoL6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-labels-B4VAwoL6.js","names":["googleService: ServiceDefinition","dropboxService: ServiceDefinition","githubService: ServiceDefinition","s3Service: ServiceDefinition","webdavService: ServiceDefinition","gitlabService: ServiceDefinition","bitbucketService: ServiceDefinition","giteaService: ServiceDefinition","browserFsService: ServiceDefinition","indexeddbService: ServiceDefinition","boxService: ServiceDefinition","service: ServiceDefinition","id: string","capability: CapabilityId","SCOPE_LABELS: Record<string, string>","scope: string","segment: string","scopes: string[]"],"sources":["../src/registry/services/google.ts","../src/registry/services/dropbox.ts","../src/registry/services/github.ts","../src/registry/services/s3.ts","../src/registry/services/webdav.ts","../src/registry/services/gitlab.ts","../src/registry/services/bitbucket.ts","../src/registry/services/gitea.ts","../src/registry/services/browser-fs.ts","../src/registry/services/indexeddb.ts","../src/registry/services/box.ts","../src/registry/service-registry.ts","../src/utils/scope-labels.ts"],"sourcesContent":["import type { ServiceDefinition } from '../../types/service';\n\nexport const googleService: ServiceDefinition = {\n id: 'google',\n name: 'Google',\n icon: 'Cloud',\n color: '#4285F4',\n authProvider: 'google',\n grantsUrl: 'https://myaccount.google.com/permissions',\n capabilities: [\n { id: 'file-system', supported: true },\n { id: 'object-storage', supported: false },\n { id: 'git-repo', supported: false },\n { id: 'git-host', supported: false },\n { id: 'media', supported: false },\n { id: 'contacts', supported: true },\n { id: 'calendar', supported: true },\n ],\n scopes: {\n 'file-system': ['https://www.googleapis.com/auth/drive'],\n 'calendar': ['https://www.googleapis.com/auth/calendar.readonly'],\n 'contacts': ['https://www.googleapis.com/auth/contacts.readonly'],\n },\n};\n","import type { ServiceDefinition } from '../../types/service';\n\nexport const dropboxService: ServiceDefinition = {\n id: 'dropbox',\n name: 'Dropbox',\n icon: 'Box',\n color: '#0061FF',\n authProvider: 'dropbox',\n grantsUrl: 'https://www.dropbox.com/account/connected_apps',\n capabilities: [\n { id: 'file-system', supported: true },\n { id: 'object-storage', supported: false },\n { id: 'git-repo', supported: false },\n { id: 'git-host', supported: false },\n { id: 'media', supported: false },\n { id: 'contacts', supported: false },\n { id: 'calendar', supported: false },\n ],\n scopes: {\n 'file-system': ['files.metadata.read', 'files.content.read', 'files.content.write'],\n },\n};\n","import type { ServiceDefinition } from '../../types/service';\n\nexport const githubService: ServiceDefinition = {\n id: 'github',\n name: 'GitHub',\n icon: 'Github',\n color: '#24292F',\n authProvider: 'github',\n grantsUrl: 'https://github.com/settings/applications',\n capabilities: [\n { id: 'file-system', supported: true },\n { id: 'object-storage', supported: false },\n { id: 'git-repo', supported: true },\n { id: 'git-host', supported: true },\n { id: 'media', supported: false },\n { id: 'contacts', supported: false },\n { id: 'calendar', supported: false },\n ],\n scopes: {\n 'file-system': ['repo'],\n 'git-repo': ['repo'],\n 'git-host': ['repo'],\n },\n};\n","import type { ServiceDefinition } from '../../types/service';\n\nexport const s3Service: ServiceDefinition = {\n id: 's3',\n name: 'Amazon S3',\n icon: 'Database',\n color: '#FF9900',\n authProvider: 's3',\n capabilities: [\n { id: 'file-system', supported: false },\n { id: 'object-storage', supported: true },\n { id: 'git-repo', supported: false },\n { id: 'git-host', supported: false },\n { id: 'media', supported: false },\n { id: 'contacts', supported: false },\n { id: 'calendar', supported: false },\n ],\n scopes: {\n 'object-storage': ['s3:GetObject', 's3:PutObject', 's3:ListBucket'],\n },\n};\n","import type { ServiceDefinition } from '../../types/service';\n\nexport const webdavService: ServiceDefinition = {\n id: 'webdav',\n name: 'WebDAV',\n icon: 'Server',\n color: '#6B7280',\n authProvider: 'webdav',\n capabilities: [\n { id: 'file-system', supported: true },\n { id: 'object-storage', supported: false },\n { id: 'git-repo', supported: false },\n { id: 'git-host', supported: false },\n { id: 'media', supported: false },\n { id: 'contacts', supported: false },\n { id: 'calendar', supported: false },\n ],\n scopes: {\n 'file-system': [],\n },\n};\n","import type { ServiceDefinition } from '../../types/service';\n\nexport const gitlabService: ServiceDefinition = {\n id: 'gitlab',\n name: 'GitLab',\n icon: 'GitBranch',\n color: '#FC6D26',\n authProvider: 'gitlab',\n grantsUrl: 'https://gitlab.com/-/user_settings/applications',\n capabilities: [\n { id: 'file-system', supported: true },\n { id: 'object-storage', supported: false },\n { id: 'git-repo', supported: true },\n { id: 'git-host', supported: true },\n { id: 'media', supported: false },\n { id: 'contacts', supported: false },\n { id: 'calendar', supported: false },\n ],\n scopes: {\n 'file-system': ['read_api'],\n 'git-repo': ['read_api'],\n 'git-host': ['read_api'],\n },\n};\n","import type { ServiceDefinition } from '../../types/service';\n\nexport const bitbucketService: ServiceDefinition = {\n id: 'bitbucket',\n name: 'Bitbucket',\n icon: 'GitBranch',\n color: '#0052CC',\n authProvider: 'bitbucket',\n grantsUrl: 'https://bitbucket.org/account/settings/app-authorizations/',\n capabilities: [\n { id: 'file-system', supported: true },\n { id: 'object-storage', supported: false },\n { id: 'git-repo', supported: true },\n { id: 'git-host', supported: true },\n { id: 'media', supported: false },\n { id: 'contacts', supported: false },\n { id: 'calendar', supported: false },\n ],\n scopes: {\n 'file-system': ['repository'],\n 'git-repo': ['repository'],\n 'git-host': ['repository', 'pullrequest'],\n },\n};\n","import type { ServiceDefinition } from '../../types/service';\n\nexport const giteaService: ServiceDefinition = {\n id: 'gitea',\n name: 'Gitea',\n icon: 'GitBranch',\n color: '#609926',\n authProvider: 'gitea',\n grantsUrl: 'https://gitea.io/en-us/user_settings/applications',\n capabilities: [\n { id: 'file-system', supported: true },\n { id: 'object-storage', supported: false },\n { id: 'git-repo', supported: true },\n { id: 'git-host', supported: true },\n { id: 'media', supported: false },\n { id: 'contacts', supported: false },\n { id: 'calendar', supported: false },\n ],\n scopes: {\n 'file-system': ['read:repository'],\n 'git-repo': ['read:repository'],\n 'git-host': ['read:repository', 'read:user'],\n },\n};\n","import type { ServiceDefinition } from '../../types/service';\n\nexport const browserFsService: ServiceDefinition = {\n id: 'browser-fs',\n name: 'Local Files',\n icon: 'FolderOpen',\n color: '#4CAF50',\n authProvider: 'browser-fs',\n capabilities: [\n { id: 'file-system', supported: true },\n { id: 'object-storage', supported: false },\n { id: 'git-repo', supported: false },\n { id: 'git-host', supported: false },\n { id: 'media', supported: false },\n { id: 'contacts', supported: false },\n { id: 'calendar', supported: false },\n ],\n scopes: {},\n};\n","import type { ServiceDefinition } from '../../types/service';\n\nexport const indexeddbService: ServiceDefinition = {\n id: 'indexeddb',\n name: 'IndexedDB',\n icon: 'Database',\n color: '#FF9800',\n authProvider: 'indexeddb',\n capabilities: [\n { id: 'file-system', supported: true },\n { id: 'object-storage', supported: false },\n { id: 'git-repo', supported: false },\n { id: 'git-host', supported: false },\n { id: 'media', supported: false },\n { id: 'contacts', supported: false },\n { id: 'calendar', supported: false },\n ],\n scopes: {},\n};\n","import type { ServiceDefinition } from '../../types/service';\n\nexport const boxService: ServiceDefinition = {\n id: 'box',\n name: 'Box',\n icon: 'Box',\n color: '#0061D5',\n authProvider: 'box',\n grantsUrl: 'https://app.box.com/account/security',\n capabilities: [\n { id: 'file-system', supported: true },\n { id: 'object-storage', supported: false },\n { id: 'git-repo', supported: false },\n { id: 'git-host', supported: false },\n { id: 'media', supported: false },\n { id: 'contacts', supported: false },\n { id: 'calendar', supported: false },\n ],\n scopes: {\n 'file-system': ['root_readwrite'],\n },\n};\n","import type { CapabilityId, ServiceDefinition } from '../types/service';\nimport { googleService } from './services/google';\nimport { dropboxService } from './services/dropbox';\nimport { githubService } from './services/github';\nimport { s3Service } from './services/s3';\nimport { webdavService } from './services/webdav';\nimport { gitlabService } from './services/gitlab';\nimport { bitbucketService } from './services/bitbucket';\nimport { giteaService } from './services/gitea';\nimport { browserFsService } from './services/browser-fs';\nimport { indexeddbService } from './services/indexeddb';\nimport { boxService } from './services/box';\n\nconst services = new Map<string, ServiceDefinition>();\n\nfunction register(service: ServiceDefinition) {\n services.set(service.id, service);\n}\n\nregister(googleService);\nregister(dropboxService);\nregister(githubService);\nregister(s3Service);\nregister(webdavService);\nregister(gitlabService);\nregister(bitbucketService);\nregister(giteaService);\nregister(browserFsService);\nregister(indexeddbService);\nregister(boxService);\n\nexport const serviceRegistry = {\n get(id: string): ServiceDefinition | undefined {\n return services.get(id);\n },\n\n getAll(): ServiceDefinition[] {\n return Array.from(services.values());\n },\n\n getByCapability(capability: CapabilityId): ServiceDefinition[] {\n return Array.from(services.values()).filter((s) =>\n s.capabilities.some((c) => c.id === capability && c.supported)\n );\n },\n};\n","/**\n * Maps raw OAuth scope strings to human-readable descriptions.\n * Falls back to a cleaned-up version of the scope string for unknown scopes.\n */\n\nconst SCOPE_LABELS: Record<string, string> = {\n // GitHub\n 'repo': 'Repository access',\n 'read:user': 'Read user profile',\n 'user:email': 'Read email address',\n 'gist': 'Gist access',\n 'read:org': 'Read organizations',\n\n // Google\n 'https://www.googleapis.com/auth/drive': 'Google Drive',\n 'https://www.googleapis.com/auth/drive.readonly': 'Google Drive (read-only)',\n 'https://www.googleapis.com/auth/calendar.readonly': 'Calendar (read-only)',\n 'https://www.googleapis.com/auth/calendar': 'Calendar',\n 'https://www.googleapis.com/auth/contacts.readonly': 'Contacts (read-only)',\n 'https://www.googleapis.com/auth/contacts': 'Contacts',\n\n // Microsoft\n 'Files.ReadWrite.All': 'File read/write',\n 'Files.Read.All': 'File read',\n 'Contacts.Read': 'Contacts (read-only)',\n 'Calendars.Read': 'Calendar (read-only)',\n 'User.Read': 'User profile',\n\n // GitLab\n 'read_api': 'API read access',\n 'read_repository': 'Repository read access',\n 'api': 'Full API access',\n 'read_user': 'Read user profile',\n\n // Bitbucket\n 'repository': 'Repository access',\n 'pullrequest': 'Pull request access',\n 'account': 'Account access',\n\n // Dropbox\n 'files.metadata.read': 'Read file metadata',\n 'files.content.read': 'Read file content',\n 'files.content.write': 'Write file content',\n\n // S3\n 's3:GetObject': 'Read objects',\n 's3:PutObject': 'Write objects',\n 's3:ListBucket': 'List buckets',\n\n // Box\n 'root_readwrite': 'Read & write all files',\n\n // Gitea\n 'read:repository': 'Repository read access',\n 'write:repository': 'Repository write access',\n};\n\n/**\n * Returns a human-readable label for a scope string.\n * Unknown scopes get cleaned up: URL paths are extracted, dots/underscores become spaces.\n */\nexport function getScopeLabel(scope: string): string {\n if (SCOPE_LABELS[scope]) {\n return SCOPE_LABELS[scope];\n }\n\n // Google-style URL scopes: extract the last path segment\n if (scope.startsWith('https://')) {\n const last = scope.split('/').pop() ?? scope;\n return formatScopeSegment(last);\n }\n\n return formatScopeSegment(scope);\n}\n\n/** Turn a scope segment like \"files.content.read\" into \"Files content read\" */\nfunction formatScopeSegment(segment: string): string {\n return segment\n .replace(/[._:]/g, ' ')\n .replace(/\\b\\w/g, c => c.toUpperCase())\n .trim();\n}\n\n/**\n * Deduplicate and label a list of scope strings.\n * Returns unique human-readable labels sorted alphabetically.\n */\nexport function getScopeLabels(scopes: string[]): string[] {\n const unique = [...new Set(scopes)];\n return unique.map(getScopeLabel).sort();\n}\n"],"mappings":";AAEA,MAAaA,gBAAmC;CAC9C,IAAI;CACJ,MAAM;CACN,MAAM;CACN,OAAO;CACP,cAAc;CACd,WAAW;CACX,cAAc;EACZ;GAAE,IAAI;GAAe,WAAW;EAAM;EACtC;GAAE,IAAI;GAAkB,WAAW;EAAO;EAC1C;GAAE,IAAI;GAAY,WAAW;EAAO;EACpC;GAAE,IAAI;GAAY,WAAW;EAAO;EACpC;GAAE,IAAI;GAAS,WAAW;EAAO;EACjC;GAAE,IAAI;GAAY,WAAW;EAAM;EACnC;GAAE,IAAI;GAAY,WAAW;EAAM;CACpC;CACD,QAAQ;EACN,eAAe,CAAC,uCAAwC;EACxD,YAAY,CAAC,mDAAoD;EACjE,YAAY,CAAC,mDAAoD;CAClE;AACF;;;;ACrBD,MAAaC,iBAAoC;CAC/C,IAAI;CACJ,MAAM;CACN,MAAM;CACN,OAAO;CACP,cAAc;CACd,WAAW;CACX,cAAc;EACZ;GAAE,IAAI;GAAe,WAAW;EAAM;EACtC;GAAE,IAAI;GAAkB,WAAW;EAAO;EAC1C;GAAE,IAAI;GAAY,WAAW;EAAO;EACpC;GAAE,IAAI;GAAY,WAAW;EAAO;EACpC;GAAE,IAAI;GAAS,WAAW;EAAO;EACjC;GAAE,IAAI;GAAY,WAAW;EAAO;EACpC;GAAE,IAAI;GAAY,WAAW;EAAO;CACrC;CACD,QAAQ,EACN,eAAe;EAAC;EAAuB;EAAsB;CAAsB,EACpF;AACF;;;;ACnBD,MAAaC,gBAAmC;CAC9C,IAAI;CACJ,MAAM;CACN,MAAM;CACN,OAAO;CACP,cAAc;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I,MAAM,WAAW,WAAW,EAAE;EAChC,MAAM,OAAO,MAAM,MAAM,IAAI,CAAC,KAAK,IAAI;AACvC,SAAO,mBAAmB,KAAK;CAChC;AAED,QAAO,mBAAmB,MAAM;AACjC;;AAGD,SAAS,mBAAmBC,SAAyB;AACnD,QAAO,QACJ,QAAQ,UAAU,IAAI,CACtB,QAAQ,SAAS,CAAA,MAAK,EAAE,aAAa,CAAC,CACtC,MAAM;AACV;;;;;AAMD,SAAgB,eAAeC,QAA4B;CACzD,MAAM,SAAS,CAAC,GAAG,IAAI,IAAI,OAAQ;AACnC,QAAO,OAAO,IAAI,cAAc,CAAC,MAAM;AACxC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//#region src/types/service.d.ts
|
|
2
|
+
type CapabilityId = 'file-system' | 'object-storage' | 'git-repo' | 'git-host' | 'media' | 'contacts' | 'calendar';
|
|
3
|
+
interface ServiceCapability {
|
|
4
|
+
id: CapabilityId;
|
|
5
|
+
supported: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface ServiceDefinition {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
icon: string;
|
|
11
|
+
color: string;
|
|
12
|
+
authProvider: string;
|
|
13
|
+
capabilities: ServiceCapability[];
|
|
14
|
+
scopes: Partial<Record<CapabilityId, string[]>>;
|
|
15
|
+
/** URL to the provider's app permissions/grants page where users can manage access */
|
|
16
|
+
grantsUrl?: string;
|
|
17
|
+
} //#endregion
|
|
18
|
+
//#region src/registry/service-registry.d.ts
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=service.d.ts.map
|
|
21
|
+
declare const serviceRegistry: {
|
|
22
|
+
get(id: string): ServiceDefinition | undefined;
|
|
23
|
+
getAll(): ServiceDefinition[];
|
|
24
|
+
getByCapability(capability: CapabilityId): ServiceDefinition[];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/utils/scope-labels.d.ts
|
|
29
|
+
//# sourceMappingURL=service-registry.d.ts.map
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Maps raw OAuth scope strings to human-readable descriptions.
|
|
33
|
+
* Falls back to a cleaned-up version of the scope string for unknown scopes.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Returns a human-readable label for a scope string.
|
|
37
|
+
* Unknown scopes get cleaned up: URL paths are extracted, dots/underscores become spaces.
|
|
38
|
+
*/
|
|
39
|
+
declare function getScopeLabel(scope: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Deduplicate and label a list of scope strings.
|
|
42
|
+
* Returns unique human-readable labels sorted alphabetically.
|
|
43
|
+
*/
|
|
44
|
+
declare function getScopeLabels(scopes: string[]): string[];
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
//# sourceMappingURL=scope-labels.d.ts.map
|
|
48
|
+
|
|
49
|
+
export { CapabilityId, ServiceCapability, ServiceDefinition, getScopeLabel as getScopeLabel$1, getScopeLabels as getScopeLabels$1, serviceRegistry as serviceRegistry$1 };
|
|
50
|
+
//# sourceMappingURL=scope-labels-DvdJLcSL.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-labels-DvdJLcSL.d.ts","names":[],"sources":["../src/types/service.ts","../src/registry/service-registry.ts","../src/utils/scope-labels.ts"],"sourcesContent":null,"mappings":";KAAY,YAAA;AAAA,UAEK,iBAAA,CAFO;EAEP,EAAA,EACX,YADW;EAKA,SAAA,EAAA,OAAA;;AAMD,UANC,iBAAA,CAMD;EAAiB,EAAA,EACR,MAAA;EAAY,IAAnB,EAAA,MAAA;EAAM,IAAd,EAAA,MAAA;EAAO,KAAA,EAAA,MAAA;;gBADD;UACN,QAAQ,OAAO;ECiBZ;EAcZ,SAAA,CAAA,EAAA,MAAA;CAAA;;;;AD7CW,cC+BC,eD/BW,EAAA;EAEP,GAAA,CAAA,EAAA,EAAA,MAAA,CAAA,EC8BE,iBD7Bb,GAAA,SAAY;EAID,MAAA,EAAA,EC6BL,iBD7BsB,EAAA;EAAA,eAAA,CAAA,UAAA,ECiCJ,YDjCI,CAAA,ECiCW,iBDjCX,EAAA;CAAA;;;;;;;AAPlC;AAEA;AAKA;;;;;AAOU,iBE+CM,aAAA,CF/CN,KAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAAO;;;;ACiBJ,iBCwDG,cAAA,CD1Cf,MAAA,EAAA,MAAA,EAAA,CAAA,EAAA,MAAA,EAAA"}
|