@fedify/fedify 0.9.0-dev.172 → 0.9.0-dev.174
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of @fedify/fedify might be problematic. Click here for more details.
- package/CHANGES.md +17 -0
- package/esm/federation/collection.js +1 -1
- package/esm/federation/middleware.js +2 -1
- package/esm/federation/send.js +5 -1
- package/esm/httpsig/mod.js +1 -1
- package/esm/runtime/key.js +1 -1
- package/esm/vocab/actor.js +32 -5
- package/package.json +1 -1
- package/types/deps/jsr.io/@std/encoding/{0.224.0 → 0.224.1}/_util.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/encoding/{0.224.0 → 0.224.1}/base64.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/encoding/{0.224.0 → 0.224.1}/hex.d.ts.map +1 -1
- package/types/federation/context.d.ts +11 -0
- package/types/federation/context.d.ts.map +1 -1
- package/types/federation/middleware.d.ts +1 -1
- package/types/federation/middleware.d.ts.map +1 -1
- package/types/federation/send.d.ts +10 -1
- package/types/federation/send.d.ts.map +1 -1
- package/types/vocab/actor.d.ts +29 -2
- package/types/vocab/actor.d.ts.map +1 -1
- /package/esm/deps/jsr.io/@std/encoding/{0.224.0 → 0.224.1}/_util.js +0 -0
- /package/esm/deps/jsr.io/@std/encoding/{0.224.0 → 0.224.1}/base64.js +0 -0
- /package/esm/deps/jsr.io/@std/encoding/{0.224.0 → 0.224.1}/hex.js +0 -0
- /package/types/deps/jsr.io/@std/encoding/{0.224.0 → 0.224.1}/_util.d.ts +0 -0
- /package/types/deps/jsr.io/@std/encoding/{0.224.0 → 0.224.1}/base64.d.ts +0 -0
- /package/types/deps/jsr.io/@std/encoding/{0.224.0 → 0.224.1}/hex.d.ts +0 -0
package/CHANGES.md
CHANGED
@@ -12,6 +12,23 @@ To be released.
|
|
12
12
|
|
13
13
|
- Added `Emoji` class to Activity Vocabulary API. [[#48]]
|
14
14
|
|
15
|
+
- Added an actor handle normalization function.
|
16
|
+
|
17
|
+
- Added `normalizeActorHandle()` function.
|
18
|
+
- Added `NormalizeActorHandleOptions` interface.
|
19
|
+
- The `getActorHandle()` function now guarantees that the returned
|
20
|
+
actor handle is normalized.
|
21
|
+
- Added the second optional parameter to `getActorHandle()` function.
|
22
|
+
- The return type of `getActorHandle()` function became
|
23
|
+
``Promise<`@${string}@${string}` | `${string}@${string}`>``
|
24
|
+
(was ``Promise<`@${string}@${string}`>``).
|
25
|
+
|
26
|
+
- Added `excludeBaseUris` option to `Context.sendActivity()` and
|
27
|
+
`Federation.sendActivity()` methods.
|
28
|
+
|
29
|
+
- Added `SendActivityOptions.excludeBaseUris` property.
|
30
|
+
- Added `ExtractInboxesParameters.excludeBaseUris` property.
|
31
|
+
|
15
32
|
- Added more log messages using the [LogTape] library. Currently the below
|
16
33
|
logger categories are used:
|
17
34
|
|
@@ -749,7 +749,7 @@ export class Federation {
|
|
749
749
|
* @param options Options for sending the activity.
|
750
750
|
* @throws {TypeError} If the activity to send does not have an actor.
|
751
751
|
*/
|
752
|
-
async sendActivity({ keyId, privateKey }, recipients, activity, { preferSharedInbox, immediate, collectionSync } = {}) {
|
752
|
+
async sendActivity({ keyId, privateKey }, recipients, activity, { preferSharedInbox, immediate, excludeBaseUris, collectionSync } = {}) {
|
753
753
|
const logger = getLogger(["fedify", "federation", "outbox"]);
|
754
754
|
if (activity.actorId == null) {
|
755
755
|
logger.error("Activity {activityId} to send does not have an actor.", { activity, activityId: activity?.id?.href });
|
@@ -765,6 +765,7 @@ export class Federation {
|
|
765
765
|
const inboxes = extractInboxes({
|
766
766
|
recipients: Array.isArray(recipients) ? recipients : [recipients],
|
767
767
|
preferSharedInbox,
|
768
|
+
excludeBaseUris,
|
768
769
|
});
|
769
770
|
logger.debug("Sending activity {activityId} to inboxes:\n{inboxes}", {
|
770
771
|
inboxes: globalThis.Object.keys(inboxes),
|
package/esm/federation/send.js
CHANGED
@@ -6,13 +6,17 @@ import { sign } from "../httpsig/mod.js";
|
|
6
6
|
* See also {@link ExtractInboxesParameters}.
|
7
7
|
* @returns The inboxes as a map of inbox URL to actor URIs.
|
8
8
|
*/
|
9
|
-
export function extractInboxes({ recipients, preferSharedInbox }) {
|
9
|
+
export function extractInboxes({ recipients, preferSharedInbox, excludeBaseUris }) {
|
10
10
|
const inboxes = {};
|
11
11
|
for (const recipient of recipients) {
|
12
12
|
const inbox = preferSharedInbox
|
13
13
|
? recipient.endpoints?.sharedInbox ?? recipient.inboxId
|
14
14
|
: recipient.inboxId;
|
15
15
|
if (inbox != null && recipient.id != null) {
|
16
|
+
if (excludeBaseUris != null &&
|
17
|
+
excludeBaseUris.some((u) => u.origin == inbox.origin)) {
|
18
|
+
continue;
|
19
|
+
}
|
16
20
|
inboxes[inbox.href] ??= new Set();
|
17
21
|
inboxes[inbox.href].add(recipient.id.href);
|
18
22
|
}
|
package/esm/httpsig/mod.js
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
import * as dntShim from "../_dnt.shims.js";
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
9
9
|
import { equals } from "../deps/jsr.io/@std/bytes/0.224.0/mod.js";
|
10
|
-
import { decodeBase64, encodeBase64 } from "../deps/jsr.io/@std/encoding/0.224.
|
10
|
+
import { decodeBase64, encodeBase64 } from "../deps/jsr.io/@std/encoding/0.224.1/base64.js";
|
11
11
|
import { fetchDocumentLoader, } from "../runtime/docloader.js";
|
12
12
|
import { isActor } from "../vocab/actor.js";
|
13
13
|
import { CryptographicKey, Object as ASObject, } from "../vocab/vocab.js";
|
package/esm/runtime/key.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as dntShim from "../_dnt.shims.js";
|
2
|
-
import { decodeBase64, encodeBase64 } from "../deps/jsr.io/@std/encoding/0.224.
|
2
|
+
import { decodeBase64, encodeBase64 } from "../deps/jsr.io/@std/encoding/0.224.1/base64.js";
|
3
3
|
/**
|
4
4
|
* Imports a PEM-SPKI formatted public key.
|
5
5
|
* @param pem The PEM-SPKI formatted public key.
|
package/esm/vocab/actor.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { toASCII, toUnicode } from "node:punycode";
|
1
2
|
import { lookupWebFinger } from "../webfinger/lookup.js";
|
2
3
|
import { Application, Group, Organization, Person, Service } from "./vocab.js";
|
3
4
|
/**
|
@@ -66,13 +67,15 @@ export function getActorClassByTypeName(typeName) {
|
|
66
67
|
* ```
|
67
68
|
*
|
68
69
|
* @param actor The actor or actor URI to get the handle from.
|
70
|
+
* @param options The options for normalizing the actor handle.
|
69
71
|
* @returns The actor handle. It starts with `@` and is followed by the
|
70
|
-
* username and domain, separated by
|
72
|
+
* username and domain, separated by `@` by default (it can be
|
73
|
+
* customized with the options).
|
71
74
|
* @throws {TypeError} If the actor does not have enough information to get the
|
72
75
|
* handle.
|
73
76
|
* @since 0.4.0
|
74
77
|
*/
|
75
|
-
export async function getActorHandle(actor) {
|
78
|
+
export async function getActorHandle(actor, options = {}) {
|
76
79
|
const actorId = actor instanceof URL ? actor : actor.id;
|
77
80
|
if (actorId != null) {
|
78
81
|
const result = await lookupWebFinger(actorId);
|
@@ -82,14 +85,38 @@ export async function getActorHandle(actor) {
|
|
82
85
|
aliases.unshift(result.subject);
|
83
86
|
for (const alias of aliases) {
|
84
87
|
const match = alias.match(/^acct:([^@]+)@([^@]+)$/);
|
85
|
-
if (match != null)
|
86
|
-
return `@${match[1]}@${match[2]}
|
88
|
+
if (match != null) {
|
89
|
+
return normalizeActorHandle(`@${match[1]}@${match[2]}`, options);
|
90
|
+
}
|
87
91
|
}
|
88
92
|
}
|
89
93
|
}
|
90
94
|
if (!(actor instanceof URL) && actor.preferredUsername != null &&
|
91
95
|
actor.id != null) {
|
92
|
-
return `@${actor.preferredUsername}@${actor.id.host}
|
96
|
+
return normalizeActorHandle(`@${actor.preferredUsername}@${actor.id.host}`, options);
|
93
97
|
}
|
94
98
|
throw new TypeError("Actor does not have enough information to get the handle.");
|
95
99
|
}
|
100
|
+
/**
|
101
|
+
* Normalizes the given actor handle.
|
102
|
+
* @param handle The full handle of the actor to normalize.
|
103
|
+
* @param options The options for normalizing the actor handle.
|
104
|
+
* @returns The normalized actor handle.
|
105
|
+
* @throws {TypeError} If the actor handle is invalid.
|
106
|
+
* @since 0.9.0
|
107
|
+
*/
|
108
|
+
export function normalizeActorHandle(handle, options = {}) {
|
109
|
+
handle = handle.replace(/^@/, "");
|
110
|
+
const atPos = handle.indexOf("@");
|
111
|
+
if (atPos < 1)
|
112
|
+
throw new TypeError("Invalid actor handle.");
|
113
|
+
let domain = handle.substring(atPos + 1);
|
114
|
+
if (domain.length < 1 || domain.includes("@")) {
|
115
|
+
throw new TypeError("Invalid actor handle.");
|
116
|
+
}
|
117
|
+
domain = domain.toLowerCase();
|
118
|
+
domain = options.punycode ? toASCII(domain) : toUnicode(domain);
|
119
|
+
domain = domain.toLowerCase();
|
120
|
+
const user = handle.substring(0, atPos);
|
121
|
+
return options.trimLeadingAt ? `${user}@${domain}` : `@${user}@${domain}`;
|
122
|
+
}
|
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"_util.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/0.224.
|
1
|
+
{"version":3,"file":"_util.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/0.224.1/_util.ts"],"names":[],"mappings":"AAeA,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,UAAU,CAa9D"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/0.224.
|
1
|
+
{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/0.224.1/base64.ts"],"names":[],"mappings":"AA6FA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAmC5E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAQpD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/0.224.
|
1
|
+
{"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/0.224.1/hex.ts"],"names":[],"mappings":"AAoDA;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,CAUxE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAiBjD"}
|
@@ -233,7 +233,18 @@ export interface SendActivityOptions {
|
|
233
233
|
* Whether to send the activity immediately, without enqueuing it.
|
234
234
|
* If `true`, the activity will be sent immediately and the retrial
|
235
235
|
* policy will not be applied.
|
236
|
+
*
|
237
|
+
* @since 0.3.0
|
236
238
|
*/
|
237
239
|
immediate?: boolean;
|
240
|
+
/**
|
241
|
+
* The base URIs to exclude from the recipients' inboxes. It is useful
|
242
|
+
* for excluding the recipients having the same shared inbox with the sender.
|
243
|
+
*
|
244
|
+
* Note that the only `origin` parts of the `URL`s are compared.
|
245
|
+
*
|
246
|
+
* @since 0.9.0
|
247
|
+
*/
|
248
|
+
excludeBaseUris?: URL[];
|
238
249
|
}
|
239
250
|
//# sourceMappingURL=context.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/federation/context.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAA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AI,CAAC,CAAC;IAEjB;;;;;;;;OAQG;IACH,YAAY,CACV,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,EAC1B,UAAU,EAAE,WAAW,EACvB,QAAQ,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC;CACzB"}
|
@@ -339,7 +339,7 @@ export declare class Federation<TContextData> {
|
|
339
339
|
sendActivity({ keyId, privateKey }: {
|
340
340
|
keyId: URL;
|
341
341
|
privateKey: dntShim.CryptoKey;
|
342
|
-
}, recipients: Recipient | Recipient[], activity: Activity, { preferSharedInbox, immediate, collectionSync }?: SendActivityInternalOptions): Promise<void>;
|
342
|
+
}, recipients: Recipient | Recipient[], activity: Activity, { preferSharedInbox, immediate, excludeBaseUris, collectionSync }?: SendActivityInternalOptions): Promise<void>;
|
343
343
|
/**
|
344
344
|
* Handles a request related to federation. If a request is not related to
|
345
345
|
* federation, the `onNotFound` or `onNotAcceptable` callback is called.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/federation/middleware.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAK5C,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,cAAc,EAIpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAoB,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE1E,OAAO,KAAK,EACV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IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,SAAS,EACvC,QAAQ,EAAE,aAAa,CAAC,YAAY,EAAE,SAAS,CAAC,GAC/C,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAErC;;;;;;OAMG;IACH,OAAO,CACL,OAAO,EAAE,iBAAiB,CAAC,YAAY,CAAC,GACvC,mBAAmB,CAAC,YAAY,CAAC,CAAC;CACtC;AAED,UAAU,2BAA4B,SAAQ,mBAAmB;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
@@ -17,6 +17,15 @@ export interface ExtractInboxesParameters {
|
|
17
17
|
* Defaults to `false`.
|
18
18
|
*/
|
19
19
|
preferSharedInbox?: boolean;
|
20
|
+
/**
|
21
|
+
* The base URIs to exclude from the recipients' inboxes. It is useful
|
22
|
+
* for excluding the recipients having the same shared inbox with the sender.
|
23
|
+
*
|
24
|
+
* Note that the only `origin` parts of the `URL`s are compared.
|
25
|
+
*
|
26
|
+
* @since 0.9.0
|
27
|
+
*/
|
28
|
+
excludeBaseUris?: URL[];
|
20
29
|
}
|
21
30
|
/**
|
22
31
|
* Extracts the inbox URLs from recipients.
|
@@ -24,7 +33,7 @@ export interface ExtractInboxesParameters {
|
|
24
33
|
* See also {@link ExtractInboxesParameters}.
|
25
34
|
* @returns The inboxes as a map of inbox URL to actor URIs.
|
26
35
|
*/
|
27
|
-
export declare function extractInboxes({ recipients, preferSharedInbox }: ExtractInboxesParameters): Record<string, Set<string>>;
|
36
|
+
export declare function extractInboxes({ recipients, preferSharedInbox, excludeBaseUris }: ExtractInboxesParameters): Record<string, Set<string>>;
|
28
37
|
/**
|
29
38
|
* Parameters for {@link sendActivity}.
|
30
39
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/federation/send.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAG5C,OAAO,KAAK,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CAAC;IAE/B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,EACE,QAAQ,EACR,UAAU,EACV,KAAK,EACL,KAAK,EACL,aAAa,EACb,OAAO,GACR,EAAE,sBAAsB,GACxB,OAAO,CAAC,IAAI,CAAC,CAwCf"}
|
package/types/vocab/actor.d.ts
CHANGED
@@ -43,13 +43,40 @@ export declare function getActorClassByTypeName(typeName: ActorTypeName): typeof
|
|
43
43
|
* ```
|
44
44
|
*
|
45
45
|
* @param actor The actor or actor URI to get the handle from.
|
46
|
+
* @param options The options for normalizing the actor handle.
|
46
47
|
* @returns The actor handle. It starts with `@` and is followed by the
|
47
|
-
* username and domain, separated by
|
48
|
+
* username and domain, separated by `@` by default (it can be
|
49
|
+
* customized with the options).
|
48
50
|
* @throws {TypeError} If the actor does not have enough information to get the
|
49
51
|
* handle.
|
50
52
|
* @since 0.4.0
|
51
53
|
*/
|
52
|
-
export declare function getActorHandle(actor: Actor | URL): Promise<`@${string}@${string}`>;
|
54
|
+
export declare function getActorHandle(actor: Actor | URL, options?: NormalizeActorHandleOptions): Promise<`@${string}@${string}` | `${string}@${string}`>;
|
55
|
+
/**
|
56
|
+
* Options for {@link normalizeActorHandle}.
|
57
|
+
* @since 0.9.0
|
58
|
+
*/
|
59
|
+
export interface NormalizeActorHandleOptions {
|
60
|
+
/**
|
61
|
+
* Whether to trim the leading `@` from the actor handle. Turned off by
|
62
|
+
* default.
|
63
|
+
*/
|
64
|
+
trimLeadingAt?: boolean;
|
65
|
+
/**
|
66
|
+
* Whether to convert the domain part of the actor handle to punycode, if it
|
67
|
+
* is an internationalized domain name. Turned off by default.
|
68
|
+
*/
|
69
|
+
punycode?: boolean;
|
70
|
+
}
|
71
|
+
/**
|
72
|
+
* Normalizes the given actor handle.
|
73
|
+
* @param handle The full handle of the actor to normalize.
|
74
|
+
* @param options The options for normalizing the actor handle.
|
75
|
+
* @returns The normalized actor handle.
|
76
|
+
* @throws {TypeError} If the actor handle is invalid.
|
77
|
+
* @since 0.9.0
|
78
|
+
*/
|
79
|
+
export declare function normalizeActorHandle(handle: string, options?: NormalizeActorHandleOptions): `@${string}@${string}` | `${string}@${string}`;
|
53
80
|
/**
|
54
81
|
* The object that can be a recipient of an activity.
|
55
82
|
*
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"actor.d.ts","sourceRoot":"","sources":["../../src/vocab/actor.ts"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"actor.d.ts","sourceRoot":"","sources":["../../src/vocab/actor.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE/E;;;GAGG;AACH,MAAM,MAAM,KAAK,GAAG,WAAW,GAAG,KAAK,GAAG,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1E;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,KAAK,CAQxD;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,aAAa,GACb,OAAO,GACP,cAAc,GACd,QAAQ,GACR,SAAS,CAAC;AAEd;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,GACX,aAAa,CAOf;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,aAAa,GAErB,OAAO,WAAW,GAClB,OAAO,KAAK,GACZ,OAAO,YAAY,GACnB,OAAO,MAAM,GACb,OAAO,OAAO,CAcjB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,KAAK,GAAG,GAAG,EAClB,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,IAAI,MAAM,IAAI,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC,CA2BzD;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,2BAAgC,GACxC,IAAI,MAAM,IAAI,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAahD;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,GAAG,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE;QACnB;;WAEG;QACH,WAAW,EAAE,GAAG,GAAG,IAAI,CAAC;KACzB,GAAG,IAAI,CAAC;CACV"}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|