@pulumi/random 4.8.0 → 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulumi/random",
3
- "version": "v4.8.0",
3
+ "version": "v4.8.1",
4
4
  "description": "A Pulumi package to safely use randomness in Pulumi programs.",
5
5
  "keywords": [
6
6
  "pulumi",
@@ -11,7 +11,7 @@
11
11
  "license": "Apache-2.0",
12
12
  "scripts": {
13
13
  "build": "tsc",
14
- "install": "node scripts/install-pulumi-plugin.js resource random v4.8.0"
14
+ "install": "node scripts/install-pulumi-plugin.js resource random v4.8.1"
15
15
  },
16
16
  "dependencies": {
17
17
  "@pulumi/pulumi": "^3.0.0"
@@ -21,6 +21,7 @@
21
21
  "typescript": "^4.3.5"
22
22
  },
23
23
  "pulumi": {
24
- "resource": true
24
+ "resource": true,
25
+ "name": "random"
25
26
  }
26
27
  }
package/package.json.bak CHANGED
@@ -21,6 +21,7 @@
21
21
  "typescript": "^4.3.5"
22
22
  },
23
23
  "pulumi": {
24
- "resource": true
24
+ "resource": true,
25
+ "name": "random"
25
26
  }
26
27
  }
package/package.json.dev CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulumi/random",
3
- "version": "v4.8.0",
3
+ "version": "v4.8.1",
4
4
  "description": "A Pulumi package to safely use randomness in Pulumi programs.",
5
5
  "keywords": [
6
6
  "pulumi",
@@ -11,7 +11,7 @@
11
11
  "license": "Apache-2.0",
12
12
  "scripts": {
13
13
  "build": "tsc",
14
- "install": "node scripts/install-pulumi-plugin.js resource random v4.8.0"
14
+ "install": "node scripts/install-pulumi-plugin.js resource random v4.8.1"
15
15
  },
16
16
  "dependencies": {
17
17
  "@pulumi/pulumi": "^3.0.0"
@@ -21,6 +21,7 @@
21
21
  "typescript": "^4.3.5"
22
22
  },
23
23
  "pulumi": {
24
- "resource": true
24
+ "resource": true,
25
+ "name": "random"
25
26
  }
26
27
  }
package/randomId.d.ts CHANGED
@@ -15,37 +15,38 @@ import * as pulumi from "@pulumi/pulumi";
15
15
  *
16
16
  * ## Example Usage
17
17
  *
18
+ * The following example shows how to generate a unique name for an AWS EC2
19
+ * instance that changes each time a new AMI id is selected.
20
+ *
18
21
  * ```typescript
19
22
  * import * as pulumi from "@pulumi/pulumi";
20
23
  * import * as aws from "@pulumi/aws";
21
24
  * import * as random from "@pulumi/random";
22
25
  *
23
- * // The following example shows how to generate a unique name for an AWS EC2
24
- * // instance that changes each time a new AMI id is selected.
25
- * const serverRandomId = new random.RandomId("serverRandomId", {
26
+ * const serverRandomId = new random.RandomId("server", {
27
+ * byteLength: 8,
26
28
  * keepers: {
27
- * ami_id: _var.ami_id,
29
+ * // Generate a new id each time we switch to a new AMI id
30
+ * ami_id: var_ami_id,
28
31
  * },
29
- * byteLength: 8,
30
32
  * });
31
- * const serverInstance = new aws.ec2.Instance("serverInstance", {
33
+ * const serverInstance = new aws.ec2.Instance("server", {
34
+ * ami: serverRandomId.keepers.apply(keepers => keepers.amiId),
32
35
  * tags: {
33
36
  * Name: pulumi.interpolate`web-server ${serverRandomId.hex}`,
34
37
  * },
35
- * ami: serverRandomId.keepers.apply(keepers => keepers?.amiId),
36
38
  * });
37
- * // ... (other aws_instance arguments) ...
38
39
  * ```
39
40
  *
40
41
  * ## Import
41
42
  *
42
- * # Random IDs can be imported using the b64_url with an optional prefix. This # can be used to replace a config value with a value interpolated from the # random provider without experiencing diffs. # Example with no prefix
43
+ * Random Ids can be imported using the `b64_url` with an optional `prefix`. This can be used to replace a config value with a value interpolated from the random provider without experiencing diffs. Example with no prefix
43
44
  *
44
45
  * ```sh
45
46
  * $ pulumi import random:index/randomId:RandomId server p-9hUg
46
47
  * ```
47
48
  *
48
- * # Example with prefix (prefix is separated by a ,)
49
+ * Example with prefix (prefix is separated by a `,`)
49
50
  *
50
51
  * ```sh
51
52
  * $ pulumi import random:index/randomId:RandomId server my-prefix-,p-9hUg
@@ -72,12 +73,12 @@ export declare class RandomId extends pulumi.CustomResource {
72
73
  */
73
74
  readonly b64Std: pulumi.Output<string>;
74
75
  /**
75
- * The generated id presented in base64, using the URL-friendly character set: case-sensitive letters, digits and the
76
- * characters `_` and `-`.
76
+ * The generated id presented in base64, using the URL-friendly character set: case-sensitive letters, digits and the characters `_` and `-`.
77
77
  */
78
78
  readonly b64Url: pulumi.Output<string>;
79
79
  /**
80
- * The number of random bytes to produce. The minimum value is 1, which produces eight bits of randomness.
80
+ * The number of random bytes to produce. The
81
+ * minimum value is 1, which produces eight bits of randomness.
81
82
  */
82
83
  readonly byteLength: pulumi.Output<number>;
83
84
  /**
@@ -85,20 +86,21 @@ export declare class RandomId extends pulumi.CustomResource {
85
86
  */
86
87
  readonly dec: pulumi.Output<string>;
87
88
  /**
88
- * The generated id presented in padded hexadecimal digits. This result will always be twice as long as the requested byte
89
- * length.
89
+ * The generated id presented in padded hexadecimal digits. This result will always be twice as long as the requested byte length.
90
90
  */
91
91
  readonly hex: pulumi.Output<string>;
92
92
  /**
93
- * Arbitrary map of values that, when changed, will trigger recreation of resource. See [the main provider
94
- * documentation](../index.html) for more information.
93
+ * Arbitrary map of values that, when changed, will
94
+ * trigger a new id to be generated. See
95
+ * the main provider documentation for more information.
95
96
  */
96
97
  readonly keepers: pulumi.Output<{
97
98
  [key: string]: any;
98
99
  } | undefined>;
99
100
  /**
100
- * Arbitrary string to prefix the output value with. This string is supplied as-is, meaning it is not guaranteed to be
101
- * URL-safe or base64 encoded.
101
+ * Arbitrary string to prefix the output value with. This
102
+ * string is supplied as-is, meaning it is not guaranteed to be URL-safe or
103
+ * base64 encoded.
102
104
  */
103
105
  readonly prefix: pulumi.Output<string | undefined>;
104
106
  /**
@@ -119,12 +121,12 @@ export interface RandomIdState {
119
121
  */
120
122
  b64Std?: pulumi.Input<string>;
121
123
  /**
122
- * The generated id presented in base64, using the URL-friendly character set: case-sensitive letters, digits and the
123
- * characters `_` and `-`.
124
+ * The generated id presented in base64, using the URL-friendly character set: case-sensitive letters, digits and the characters `_` and `-`.
124
125
  */
125
126
  b64Url?: pulumi.Input<string>;
126
127
  /**
127
- * The number of random bytes to produce. The minimum value is 1, which produces eight bits of randomness.
128
+ * The number of random bytes to produce. The
129
+ * minimum value is 1, which produces eight bits of randomness.
128
130
  */
129
131
  byteLength?: pulumi.Input<number>;
130
132
  /**
@@ -132,20 +134,21 @@ export interface RandomIdState {
132
134
  */
133
135
  dec?: pulumi.Input<string>;
134
136
  /**
135
- * The generated id presented in padded hexadecimal digits. This result will always be twice as long as the requested byte
136
- * length.
137
+ * The generated id presented in padded hexadecimal digits. This result will always be twice as long as the requested byte length.
137
138
  */
138
139
  hex?: pulumi.Input<string>;
139
140
  /**
140
- * Arbitrary map of values that, when changed, will trigger recreation of resource. See [the main provider
141
- * documentation](../index.html) for more information.
141
+ * Arbitrary map of values that, when changed, will
142
+ * trigger a new id to be generated. See
143
+ * the main provider documentation for more information.
142
144
  */
143
145
  keepers?: pulumi.Input<{
144
146
  [key: string]: any;
145
147
  }>;
146
148
  /**
147
- * Arbitrary string to prefix the output value with. This string is supplied as-is, meaning it is not guaranteed to be
148
- * URL-safe or base64 encoded.
149
+ * Arbitrary string to prefix the output value with. This
150
+ * string is supplied as-is, meaning it is not guaranteed to be URL-safe or
151
+ * base64 encoded.
149
152
  */
150
153
  prefix?: pulumi.Input<string>;
151
154
  }
@@ -154,19 +157,22 @@ export interface RandomIdState {
154
157
  */
155
158
  export interface RandomIdArgs {
156
159
  /**
157
- * The number of random bytes to produce. The minimum value is 1, which produces eight bits of randomness.
160
+ * The number of random bytes to produce. The
161
+ * minimum value is 1, which produces eight bits of randomness.
158
162
  */
159
163
  byteLength: pulumi.Input<number>;
160
164
  /**
161
- * Arbitrary map of values that, when changed, will trigger recreation of resource. See [the main provider
162
- * documentation](../index.html) for more information.
165
+ * Arbitrary map of values that, when changed, will
166
+ * trigger a new id to be generated. See
167
+ * the main provider documentation for more information.
163
168
  */
164
169
  keepers?: pulumi.Input<{
165
170
  [key: string]: any;
166
171
  }>;
167
172
  /**
168
- * Arbitrary string to prefix the output value with. This string is supplied as-is, meaning it is not guaranteed to be
169
- * URL-safe or base64 encoded.
173
+ * Arbitrary string to prefix the output value with. This
174
+ * string is supplied as-is, meaning it is not guaranteed to be URL-safe or
175
+ * base64 encoded.
170
176
  */
171
177
  prefix?: pulumi.Input<string>;
172
178
  }
package/randomId.js CHANGED
@@ -21,37 +21,38 @@ const utilities = require("./utilities");
21
21
  *
22
22
  * ## Example Usage
23
23
  *
24
+ * The following example shows how to generate a unique name for an AWS EC2
25
+ * instance that changes each time a new AMI id is selected.
26
+ *
24
27
  * ```typescript
25
28
  * import * as pulumi from "@pulumi/pulumi";
26
29
  * import * as aws from "@pulumi/aws";
27
30
  * import * as random from "@pulumi/random";
28
31
  *
29
- * // The following example shows how to generate a unique name for an AWS EC2
30
- * // instance that changes each time a new AMI id is selected.
31
- * const serverRandomId = new random.RandomId("serverRandomId", {
32
+ * const serverRandomId = new random.RandomId("server", {
33
+ * byteLength: 8,
32
34
  * keepers: {
33
- * ami_id: _var.ami_id,
35
+ * // Generate a new id each time we switch to a new AMI id
36
+ * ami_id: var_ami_id,
34
37
  * },
35
- * byteLength: 8,
36
38
  * });
37
- * const serverInstance = new aws.ec2.Instance("serverInstance", {
39
+ * const serverInstance = new aws.ec2.Instance("server", {
40
+ * ami: serverRandomId.keepers.apply(keepers => keepers.amiId),
38
41
  * tags: {
39
42
  * Name: pulumi.interpolate`web-server ${serverRandomId.hex}`,
40
43
  * },
41
- * ami: serverRandomId.keepers.apply(keepers => keepers?.amiId),
42
44
  * });
43
- * // ... (other aws_instance arguments) ...
44
45
  * ```
45
46
  *
46
47
  * ## Import
47
48
  *
48
- * # Random IDs can be imported using the b64_url with an optional prefix. This # can be used to replace a config value with a value interpolated from the # random provider without experiencing diffs. # Example with no prefix
49
+ * Random Ids can be imported using the `b64_url` with an optional `prefix`. This can be used to replace a config value with a value interpolated from the random provider without experiencing diffs. Example with no prefix
49
50
  *
50
51
  * ```sh
51
52
  * $ pulumi import random:index/randomId:RandomId server p-9hUg
52
53
  * ```
53
54
  *
54
- * # Example with prefix (prefix is separated by a ,)
55
+ * Example with prefix (prefix is separated by a `,`)
55
56
  *
56
57
  * ```sh
57
58
  * $ pulumi import random:index/randomId:RandomId server my-prefix-,p-9hUg
package/randomId.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"randomId.js","sourceRoot":"","sources":["../randomId.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAa,QAAS,SAAQ,MAAM,CAAC,cAAc;IAqE/C,YAAY,IAAY,EAAE,WAA0C,EAAE,IAAmC;QACrG,IAAI,cAAc,GAAkB,EAAE,CAAC;QACvC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAClB,IAAI,IAAI,CAAC,EAAE,EAAE;YACT,MAAM,KAAK,GAAG,WAAwC,CAAC;YACvD,cAAc,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAC5D,cAAc,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAC5D,cAAc,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;YACpE,cAAc,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;YACtD,cAAc,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,C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S,CAAC,OAAO,CAAC;SAC7C;QACD,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,oBAAoB,EAAE,EAAE,IAAI,CAAC,CAAC;QACnE,KAAK,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IAhGD;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,CAAC,IAAY,EAAE,EAA2B,EAAE,KAAqB,EAAE,IAAmC;QACnH,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAO,KAAK,kCAAO,IAAI,KAAE,EAAE,EAAE,EAAE,IAAG,CAAC;IAC/D,CAAC;IAKD;;;OAGG;IACI,MAAM,CAAC,UAAU,CAAC,GAAQ;QAC7B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,EAAE;YACnC,OAAO,KAAK,CAAC;SAChB;QACD,OAAO,GAAG,CAAC,cAAc,CAAC,KAAK,QAAQ,CAAC,YAAY,CAAC;IACzD,CAAC;;AA1BL,4BAkGC;AApFG,gBAAgB;AACO,qBAAY,GAAG,gCAAgC,CAAC"}
@@ -2,38 +2,44 @@ import * as pulumi from "@pulumi/pulumi";
2
2
  /**
3
3
  * The resource `random.RandomInteger` generates random values from a given range, described by the `min` and `max` attributes of a given resource.
4
4
  *
5
- * This resource can be used in conjunction with resources that have the `createBeforeDestroy` lifecycle flag set, to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.
5
+ * This resource can be used in conjunction with resources that have
6
+ * the `createBeforeDestroy` lifecycle flag set, to avoid conflicts with
7
+ * unique names during the brief period where both the old and new resources
8
+ * exist concurrently.
6
9
  *
7
10
  * ## Example Usage
8
11
  *
12
+ * The following example shows how to generate a random priority between 1 and 50000 for
13
+ * a `awsAlbListenerRule` resource:
14
+ *
9
15
  * ```typescript
10
16
  * import * as pulumi from "@pulumi/pulumi";
11
17
  * import * as aws from "@pulumi/aws";
12
18
  * import * as random from "@pulumi/random";
13
19
  *
14
- * // The following example shows how to generate a random priority
15
- * // between 1 and 50000 for a aws_alb_listener_rule resource:
16
20
  * const priority = new random.RandomInteger("priority", {
17
- * min: 1,
18
- * max: 50000,
19
21
  * keepers: {
20
- * listener_arn: _var.listener_arn,
22
+ * // Generate a new integer each time we switch to a new listener ARN
23
+ * listener_arn: var_listener_arn,
21
24
  * },
25
+ * max: 50000,
26
+ * min: 1,
22
27
  * });
23
28
  * const main = new aws.alb.ListenerRule("main", {
24
- * listenerArn: priority.keepers.apply(keepers => keepers?.listenerArn),
25
- * priority: priority.result,
26
29
  * actions: [{
30
+ * targetGroupArn: var_target_group_arn,
27
31
  * type: "forward",
28
- * targetGroupArn: _var.target_group_arn,
29
32
  * }],
33
+ * listenerArn: var_listener_arn,
34
+ * priority: priority.result,
30
35
  * });
31
- * // ... (other aws_alb_listener_rule arguments) ...
32
36
  * ```
33
37
  *
38
+ * The result of the above will set a random priority.
39
+ *
34
40
  * ## Import
35
41
  *
36
- * # Random integers can be imported using the result, min, and max, with an # optional seed. This can be used to replace a config value with a value # interpolated from the random provider without experiencing diffs. # Example (values are separated by a ,)
42
+ * Random integers can be imported using the `result`, `min`, and `max`, with an optional `seed`. This can be used to replace a config value with a value interpolated from the random provider without experiencing diffs. Example (values are separated by a `,`)
37
43
  *
38
44
  * ```sh
39
45
  * $ pulumi import random:index/randomInteger:RandomInteger priority 15390,1,50000
@@ -56,8 +62,9 @@ export declare class RandomInteger extends pulumi.CustomResource {
56
62
  */
57
63
  static isInstance(obj: any): obj is RandomInteger;
58
64
  /**
59
- * Arbitrary map of values that, when changed, will trigger recreation of resource. See [the main provider
60
- * documentation](../index.html) for more information.
65
+ * Arbitrary map of values that, when changed, will
66
+ * trigger a new id to be generated. See
67
+ * the main provider documentation for more information.
61
68
  */
62
69
  readonly keepers: pulumi.Output<{
63
70
  [key: string]: any;
@@ -71,7 +78,7 @@ export declare class RandomInteger extends pulumi.CustomResource {
71
78
  */
72
79
  readonly min: pulumi.Output<number>;
73
80
  /**
74
- * The random integer result.
81
+ * (int) The random Integer result.
75
82
  */
76
83
  readonly result: pulumi.Output<number>;
77
84
  /**
@@ -92,8 +99,9 @@ export declare class RandomInteger extends pulumi.CustomResource {
92
99
  */
93
100
  export interface RandomIntegerState {
94
101
  /**
95
- * Arbitrary map of values that, when changed, will trigger recreation of resource. See [the main provider
96
- * documentation](../index.html) for more information.
102
+ * Arbitrary map of values that, when changed, will
103
+ * trigger a new id to be generated. See
104
+ * the main provider documentation for more information.
97
105
  */
98
106
  keepers?: pulumi.Input<{
99
107
  [key: string]: any;
@@ -107,7 +115,7 @@ export interface RandomIntegerState {
107
115
  */
108
116
  min?: pulumi.Input<number>;
109
117
  /**
110
- * The random integer result.
118
+ * (int) The random Integer result.
111
119
  */
112
120
  result?: pulumi.Input<number>;
113
121
  /**
@@ -120,8 +128,9 @@ export interface RandomIntegerState {
120
128
  */
121
129
  export interface RandomIntegerArgs {
122
130
  /**
123
- * Arbitrary map of values that, when changed, will trigger recreation of resource. See [the main provider
124
- * documentation](../index.html) for more information.
131
+ * Arbitrary map of values that, when changed, will
132
+ * trigger a new id to be generated. See
133
+ * the main provider documentation for more information.
125
134
  */
126
135
  keepers?: pulumi.Input<{
127
136
  [key: string]: any;
package/randomInteger.js CHANGED
@@ -8,38 +8,44 @@ const utilities = require("./utilities");
8
8
  /**
9
9
  * The resource `random.RandomInteger` generates random values from a given range, described by the `min` and `max` attributes of a given resource.
10
10
  *
11
- * This resource can be used in conjunction with resources that have the `createBeforeDestroy` lifecycle flag set, to avoid conflicts with unique names during the brief period where both the old and new resources exist concurrently.
11
+ * This resource can be used in conjunction with resources that have
12
+ * the `createBeforeDestroy` lifecycle flag set, to avoid conflicts with
13
+ * unique names during the brief period where both the old and new resources
14
+ * exist concurrently.
12
15
  *
13
16
  * ## Example Usage
14
17
  *
18
+ * The following example shows how to generate a random priority between 1 and 50000 for
19
+ * a `awsAlbListenerRule` resource:
20
+ *
15
21
  * ```typescript
16
22
  * import * as pulumi from "@pulumi/pulumi";
17
23
  * import * as aws from "@pulumi/aws";
18
24
  * import * as random from "@pulumi/random";
19
25
  *
20
- * // The following example shows how to generate a random priority
21
- * // between 1 and 50000 for a aws_alb_listener_rule resource:
22
26
  * const priority = new random.RandomInteger("priority", {
23
- * min: 1,
24
- * max: 50000,
25
27
  * keepers: {
26
- * listener_arn: _var.listener_arn,
28
+ * // Generate a new integer each time we switch to a new listener ARN
29
+ * listener_arn: var_listener_arn,
27
30
  * },
31
+ * max: 50000,
32
+ * min: 1,
28
33
  * });
29
34
  * const main = new aws.alb.ListenerRule("main", {
30
- * listenerArn: priority.keepers.apply(keepers => keepers?.listenerArn),
31
- * priority: priority.result,
32
35
  * actions: [{
36
+ * targetGroupArn: var_target_group_arn,
33
37
  * type: "forward",
34
- * targetGroupArn: _var.target_group_arn,
35
38
  * }],
39
+ * listenerArn: var_listener_arn,
40
+ * priority: priority.result,
36
41
  * });
37
- * // ... (other aws_alb_listener_rule arguments) ...
38
42
  * ```
39
43
  *
44
+ * The result of the above will set a random priority.
45
+ *
40
46
  * ## Import
41
47
  *
42
- * # Random integers can be imported using the result, min, and max, with an # optional seed. This can be used to replace a config value with a value # interpolated from the random provider without experiencing diffs. # Example (values are separated by a ,)
48
+ * Random integers can be imported using the `result`, `min`, and `max`, with an optional `seed`. This can be used to replace a config value with a value interpolated from the random provider without experiencing diffs. Example (values are separated by a `,`)
43
49
  *
44
50
  * ```sh
45
51
  * $ pulumi import random:index/randomInteger:RandomInteger priority 15390,1,50000
@@ -1 +1 @@
1
- {"version":3,"file":"randomInteger.js","sourceRoot":"","sources":["../randomInteger.ts"],"names":[],"mappings":";AAAA,wFAAwF;AACxF,iFAAiF;;;AAEjF,yCAAyC;AACzC,yCAAyC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAa,aAAc,SAAQ,MAAM,CAAC,cAAc;IA0DpD,YAAY,IAAY,EAAE,WAAoD,EAAE,IAA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