@wardic/three 0.0.0-stage → 1.3.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/LICENSE +21 -0
- package/README.md +84 -2
- package/THIRD_PARTY_NOTICES.md +145 -0
- package/dist/TestStage.d.ts +45 -0
- package/dist/TestStage.d.ts.map +1 -0
- package/dist/TestStage.js +140 -0
- package/dist/TestStage.js.map +1 -0
- package/dist/ThreeColours.d.ts +52 -0
- package/dist/ThreeColours.d.ts.map +1 -0
- package/dist/ThreeColours.js +237 -0
- package/dist/ThreeColours.js.map +1 -0
- package/dist/ThreeDrag.d.ts +82 -0
- package/dist/ThreeDrag.d.ts.map +1 -0
- package/dist/ThreeDrag.js +243 -0
- package/dist/ThreeDrag.js.map +1 -0
- package/dist/ThreeInput.d.ts +69 -0
- package/dist/ThreeInput.d.ts.map +1 -0
- package/dist/ThreeInput.js +592 -0
- package/dist/ThreeInput.js.map +1 -0
- package/dist/ThreeInstances.d.ts +47 -0
- package/dist/ThreeInstances.d.ts.map +1 -0
- package/dist/ThreeInstances.js +392 -0
- package/dist/ThreeInstances.js.map +1 -0
- package/dist/ThreeRenderer.d.ts +45 -0
- package/dist/ThreeRenderer.d.ts.map +1 -0
- package/dist/ThreeRenderer.js +121 -0
- package/dist/ThreeRenderer.js.map +1 -0
- package/dist/ThreeValues.d.ts +15 -0
- package/dist/ThreeValues.d.ts.map +1 -0
- package/dist/ThreeValues.js +61 -0
- package/dist/ThreeValues.js.map +1 -0
- package/dist/WardicThree.d.ts +194 -0
- package/dist/WardicThree.d.ts.map +1 -0
- package/dist/WardicThree.js +162 -0
- package/dist/WardicThree.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/dev.d.ts +10 -0
- package/dist/internal/dev.d.ts.map +1 -0
- package/dist/internal/dev.js +11 -0
- package/dist/internal/dev.js.map +1 -0
- package/dist/internal/dev.production.d.ts +8 -0
- package/dist/internal/dev.production.d.ts.map +1 -0
- package/dist/internal/dev.production.js +8 -0
- package/dist/internal/dev.production.js.map +1 -0
- package/dist/internal/lookup.d.ts +29 -0
- package/dist/internal/lookup.d.ts.map +1 -0
- package/dist/internal/lookup.js +245 -0
- package/dist/internal/lookup.js.map +1 -0
- package/dist/internal/shared-material.d.ts +8 -0
- package/dist/internal/shared-material.d.ts.map +1 -0
- package/dist/internal/shared-material.js +95 -0
- package/dist/internal/shared-material.js.map +1 -0
- package/dist/solid/feature.d.ts +42 -0
- package/dist/solid/feature.d.ts.map +1 -0
- package/dist/solid/feature.js +2 -0
- package/dist/solid/feature.js.map +1 -0
- package/dist/solid/scene-batch.d.ts +10 -0
- package/dist/solid/scene-batch.d.ts.map +1 -0
- package/dist/solid/scene-batch.js +436 -0
- package/dist/solid/scene-batch.js.map +1 -0
- package/dist/solid/scene-object.d.ts +27 -0
- package/dist/solid/scene-object.d.ts.map +1 -0
- package/dist/solid/scene-object.js +111 -0
- package/dist/solid/scene-object.js.map +1 -0
- package/dist/solid/stage-batches.d.ts +10 -0
- package/dist/solid/stage-batches.d.ts.map +1 -0
- package/dist/solid/stage-batches.js +6 -0
- package/dist/solid/stage-batches.js.map +1 -0
- package/dist/solid/stage-drag.d.ts +4 -0
- package/dist/solid/stage-drag.d.ts.map +1 -0
- package/dist/solid/stage-drag.js +19 -0
- package/dist/solid/stage-drag.js.map +1 -0
- package/dist/solid/stage.d.ts +107 -0
- package/dist/solid/stage.d.ts.map +1 -0
- package/dist/solid/stage.js +320 -0
- package/dist/solid/stage.js.map +1 -0
- package/dist/solid/test-stage.d.ts +29 -0
- package/dist/solid/test-stage.d.ts.map +1 -0
- package/dist/solid/test-stage.js +16 -0
- package/dist/solid/test-stage.js.map +1 -0
- package/dist/solid.d.ts +55 -0
- package/dist/solid.d.ts.map +1 -0
- package/dist/solid.js +9 -0
- package/dist/solid.js.map +1 -0
- package/package.json +99 -4
- package/src/TestStage.ts +177 -0
- package/src/ThreeColours.ts +247 -0
- package/src/ThreeDrag.ts +341 -0
- package/src/ThreeInput.ts +744 -0
- package/src/ThreeInstances.ts +481 -0
- package/src/ThreeRenderer.ts +159 -0
- package/src/ThreeValues.ts +69 -0
- package/src/WardicThree.ts +347 -0
- package/src/index.ts +26 -0
- package/src/internal/dev.production.ts +7 -0
- package/src/internal/dev.ts +10 -0
- package/src/internal/lookup.ts +247 -0
- package/src/internal/shared-material.ts +101 -0
- package/src/solid/feature.ts +38 -0
- package/src/solid/scene-batch.ts +490 -0
- package/src/solid/scene-object.ts +145 -0
- package/src/solid/stage-batches.ts +13 -0
- package/src/solid/stage-drag.ts +26 -0
- package/src/solid/stage.ts +409 -0
- package/src/solid/test-stage.ts +40 -0
- package/src/solid.ts +111 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A scene's colours, as Wardic animates them: in linear light, three's working space, each as three
|
|
3
|
+
* channel keys. A colour key's target (a CSS colour, a hex number, or a three `Color`, copied) is read
|
|
4
|
+
* once into its linear channels, `color` into `colorR`, `colorG` and `colorB`, which springs move as
|
|
5
|
+
* they move `x`, keeping their speed through a change of target, and which the writer sets on the
|
|
6
|
+
* `Color` itself. Red to blue passes `#bc00bc`, as three's own `Color.lerp` does.
|
|
7
|
+
*
|
|
8
|
+
* A channel rests by its share of the distance it goes, as a blended key's progress does, so a move
|
|
9
|
+
* from black to a near black animates, and every colour lands in the same time.
|
|
10
|
+
*
|
|
11
|
+
* A Batch's colours split the same way: one for every member, two stops, or a function of a member's
|
|
12
|
+
* index, each member's colour read once. An `InstancedMesh`'s instance's `color` is its instance colour.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* import * as ThreeColours from "@wardic/three/ThreeColours"
|
|
16
|
+
*
|
|
17
|
+
* ThreeColours.split(mesh, { color: "#0000ff", opacity: 1 })
|
|
18
|
+
* // { opacity: 1, colorR: 0, colorG: 0, colorB: 1 }
|
|
19
|
+
*/
|
|
20
|
+
// `@wardic/three/ThreeColours` (#883, PR 3; ADR-0069 decision 7; ADR-0073 *Amendment (#883)*, PR 3's
|
|
21
|
+
// Q1–Q3, a Batch's PR 4's Q5): probe `.tmp/883-colour/` measured channel keys keeping a retarget's
|
|
22
|
+
// velocity, where a colour blended on a progress (Motion's) starts from rest. Split at the call, so core's values stay numbers
|
|
23
|
+
// and strings. A target is read by the Subject's own `Color` class: no import of three, and the app's
|
|
24
|
+
// colour management applies.
|
|
25
|
+
import * as UnitScale from "@wardic/core/UnitScale";
|
|
26
|
+
import * as Arr from "effect/Array";
|
|
27
|
+
import * as Predicate from "effect/Predicate";
|
|
28
|
+
import * as Rec from "effect/Record";
|
|
29
|
+
import * as Result from "effect/Result";
|
|
30
|
+
import * as Lookup from "./internal/lookup.js";
|
|
31
|
+
import * as ThreeInstances from "./ThreeInstances.js";
|
|
32
|
+
/** The suffixes of a colour's channel keys: `colorR`, `colorG`, `colorB`. */
|
|
33
|
+
export const CHANNELS = ["R", "G", "B"];
|
|
34
|
+
/** A colour's channel key: a name, then `R`, `G` or `B`. */
|
|
35
|
+
const CHANNEL_KEY = /[a-z0-9][RGB]$/;
|
|
36
|
+
/** Whether `key` names a colour's channel: `colorR`, `emissiveG`, `uTintB`. */
|
|
37
|
+
export const isChannel = (key) => CHANNEL_KEY.test(key);
|
|
38
|
+
/** The least distance a channel's rest counts, in linear light: about a hundredth of an 8-bit step near black. */
|
|
39
|
+
const CHANNEL_FLOOR = 0.001;
|
|
40
|
+
/**
|
|
41
|
+
* A scene's unit scale: `x`, `y` and `z` at `scale` of Motion's units, a colour's channels by their
|
|
42
|
+
* share of the distance, every other key at 1.
|
|
43
|
+
*/
|
|
44
|
+
export const unitScale = (scale) => {
|
|
45
|
+
const position = UnitScale.position(scale);
|
|
46
|
+
return (key, distance) => {
|
|
47
|
+
if (isChannel(key))
|
|
48
|
+
return UnitScale.relative(distance, CHANNEL_FLOOR);
|
|
49
|
+
return position(key, distance);
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/** `value`'s linear channels, read by `colour`'s class: `null`, a keyframe's "where it is", for each. */
|
|
53
|
+
const channelsOfStop = (colour, value) => {
|
|
54
|
+
if (Predicate.isNull(value))
|
|
55
|
+
return [null, null, null];
|
|
56
|
+
const read = colour.clone().set(value);
|
|
57
|
+
return [read.r, read.g, read.b];
|
|
58
|
+
};
|
|
59
|
+
/** A Batch's function value, `(i, n) => …`, as its three channels' functions: each member's colour read once, its channels from it. */
|
|
60
|
+
const channelsOfFunction = (colour, value) => {
|
|
61
|
+
// Called key by key over the members (core's `BatchCalls`): each member's read kept for its other channels.
|
|
62
|
+
const read = [];
|
|
63
|
+
const at = (i, n) => {
|
|
64
|
+
const known = read[i];
|
|
65
|
+
if (Predicate.isNotUndefined(known))
|
|
66
|
+
return known;
|
|
67
|
+
const channels = channelsOf(colour, value(i, n));
|
|
68
|
+
read[i] = channels;
|
|
69
|
+
return channels;
|
|
70
|
+
};
|
|
71
|
+
return [(i, n) => at(i, n)[0], (i, n) => at(i, n)[1], (i, n) => at(i, n)[2]];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* A colour key's value, as its three channels' values: a stop each, or keyframes of them (a Batch's two
|
|
75
|
+
* stops, a Segment's stops). A Batch's function of a member's index gives each channel a function.
|
|
76
|
+
*/
|
|
77
|
+
const channelsOf = (colour, value) => {
|
|
78
|
+
if (Predicate.isFunction(value))
|
|
79
|
+
return channelsOfFunction(colour, value);
|
|
80
|
+
if (!Arr.isArray(value))
|
|
81
|
+
return channelsOfStop(colour, value);
|
|
82
|
+
const stops = Arr.map(value, (stop) => channelsOf(colour, stop));
|
|
83
|
+
return [Arr.map(stops, (stop) => stop[0]), Arr.map(stops, (stop) => stop[1]), Arr.map(stops, (stop) => stop[2])];
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* The Color `key` names on `subject`, by whose class a colour is read: the lookup's, or, for an
|
|
87
|
+
* `InstancedMesh`'s instance, its material's for `color`, the instance's colour.
|
|
88
|
+
*/
|
|
89
|
+
const colourFor = (subject, key) => {
|
|
90
|
+
if (ThreeInstances.isInstance(subject)) {
|
|
91
|
+
if (key !== "color")
|
|
92
|
+
return undefined;
|
|
93
|
+
return Lookup.colourOf(subject.mesh, "color");
|
|
94
|
+
}
|
|
95
|
+
return Lookup.colourOf(subject, key);
|
|
96
|
+
};
|
|
97
|
+
/** The keys of `target` that name a Color on `subject`, with it. */
|
|
98
|
+
const coloursIn = (subject, target) => Arr.filterMap(Rec.keys(target), (key) => {
|
|
99
|
+
if (key === "transition" || key === "transitionEnd")
|
|
100
|
+
return Result.failVoid;
|
|
101
|
+
const colour = colourFor(subject, key);
|
|
102
|
+
if (Predicate.isUndefined(colour))
|
|
103
|
+
return Result.failVoid;
|
|
104
|
+
return Result.succeed([key, colour]);
|
|
105
|
+
});
|
|
106
|
+
/** `values` with each of `colours`' keys given as its three channels' values. */
|
|
107
|
+
const splitValues = (values, colours) => {
|
|
108
|
+
const out = { ...values };
|
|
109
|
+
Arr.forEach(colours, ([key, colour]) => {
|
|
110
|
+
if (!(key in values))
|
|
111
|
+
return;
|
|
112
|
+
const channels = channelsOf(colour, values[key]);
|
|
113
|
+
delete out[key];
|
|
114
|
+
Arr.forEach(CHANNELS, (channel, i) => {
|
|
115
|
+
out[`${key}${channel}`] = channels[i];
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
return out;
|
|
119
|
+
};
|
|
120
|
+
/** `transition` with each of `colours`' keys' own entry given to its three channels. */
|
|
121
|
+
const splitEntries = (transition, colours) => {
|
|
122
|
+
if (!Predicate.isObject(transition))
|
|
123
|
+
return transition;
|
|
124
|
+
const entries = transition;
|
|
125
|
+
if (!Arr.some(colours, ([key]) => key in entries))
|
|
126
|
+
return transition;
|
|
127
|
+
const out = { ...entries };
|
|
128
|
+
Arr.forEach(colours, ([key]) => {
|
|
129
|
+
if (!(key in entries))
|
|
130
|
+
return;
|
|
131
|
+
const entry = entries[key];
|
|
132
|
+
delete out[key];
|
|
133
|
+
Arr.forEach(CHANNELS, (channel) => {
|
|
134
|
+
out[`${key}${channel}`] = entry;
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
return out;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* A call's target and options on `subject`, each colour key split into its channels: its value or
|
|
141
|
+
* keyframes, its `transitionEnd`, and its own entry in the target's `transition` or the options. A
|
|
142
|
+
* target with no colour key comes back as it is. For a Batch, `subject` is a member, and a value may be
|
|
143
|
+
* two stops or a function of a member's index.
|
|
144
|
+
*/
|
|
145
|
+
export const splitCall = (subject, target, options) => {
|
|
146
|
+
if (!Predicate.isObject(subject) || !Predicate.isObject(target))
|
|
147
|
+
return [target, options];
|
|
148
|
+
const given = target;
|
|
149
|
+
const colours = coloursIn(subject, given);
|
|
150
|
+
if (colours.length === 0)
|
|
151
|
+
return [target, options];
|
|
152
|
+
const split = { ...splitValues(given, colours) };
|
|
153
|
+
if (Predicate.isObject(given.transitionEnd))
|
|
154
|
+
split.transitionEnd = splitValues(given.transitionEnd, colours);
|
|
155
|
+
if ("transition" in given)
|
|
156
|
+
split.transition = splitEntries(given.transition, colours);
|
|
157
|
+
return [split, splitEntries(options, colours)];
|
|
158
|
+
};
|
|
159
|
+
/** `target` on `subject`, each colour key split into its channels. */
|
|
160
|
+
export const split = (subject, target) => splitCall(subject, target, undefined)[0];
|
|
161
|
+
/** A ward's config's keys that hold a target: values, variant names, or an accessor of either. */
|
|
162
|
+
const TARGET_KEYS = new Set(["initial", "animate", "exit", "whileHover", "whileTap", "whileDrag", "whileFocus", "whileInView"]);
|
|
163
|
+
/** A target's value on the Subject now, its colour keys split: values split, names and `false` as they are. */
|
|
164
|
+
const splitTargetValue = (subjectNow, value) => {
|
|
165
|
+
const subject = subjectNow();
|
|
166
|
+
if (!Predicate.isObject(subject) || !Predicate.isObject(value) || Arr.isArray(value))
|
|
167
|
+
return value;
|
|
168
|
+
return splitCall(subject, value, undefined)[0];
|
|
169
|
+
};
|
|
170
|
+
/** `transition` on the Subject now, each colour key's own entry given to its channels. */
|
|
171
|
+
const splitTransition = (subjectNow, transition) => {
|
|
172
|
+
const subject = subjectNow();
|
|
173
|
+
if (!Predicate.isObject(subject) || !Predicate.isObject(transition))
|
|
174
|
+
return transition;
|
|
175
|
+
const colours = Arr.filterMap(Rec.keys(transition), (key) => {
|
|
176
|
+
const colour = colourFor(subject, key);
|
|
177
|
+
if (Predicate.isUndefined(colour))
|
|
178
|
+
return Result.failVoid;
|
|
179
|
+
return Result.succeed([key, colour]);
|
|
180
|
+
});
|
|
181
|
+
if (colours.length === 0)
|
|
182
|
+
return transition;
|
|
183
|
+
return splitEntries(transition, colours);
|
|
184
|
+
};
|
|
185
|
+
/** `value` through `f`: an accessor's value as it's read, any other's now. */
|
|
186
|
+
const throughAccessor = (value, f) => {
|
|
187
|
+
if (Predicate.isFunction(value))
|
|
188
|
+
return () => f(value());
|
|
189
|
+
return f(value);
|
|
190
|
+
};
|
|
191
|
+
/** A variant through `f`: a function's values as it's called, any other's now. */
|
|
192
|
+
const throughVariant = (variant, f) => {
|
|
193
|
+
if (Predicate.isFunction(variant))
|
|
194
|
+
return (...args) => f(variant(...args));
|
|
195
|
+
return f(variant);
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* A ward's config on a scene's Subject, each colour key split into its channels in linear light,
|
|
199
|
+
* as a call's are (`splitCall`): each target's values, an accessor's as it's read, each variant's (a
|
|
200
|
+
* function's as it's called), and the transition's colour entries. `subjectNow` is the Subject now, read
|
|
201
|
+
* as each is split, so an accessor Subject's colours are its current one's. Every other key is as given.
|
|
202
|
+
*/
|
|
203
|
+
// #885.
|
|
204
|
+
export const splitConfig = (subjectNow, config) => {
|
|
205
|
+
const out = { ...config };
|
|
206
|
+
Arr.forEach(Rec.keys(config), (key) => {
|
|
207
|
+
const value = config[key];
|
|
208
|
+
if (TARGET_KEYS.has(key)) {
|
|
209
|
+
out[key] = throughAccessor(value, (given) => splitTargetValue(subjectNow, given));
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
if (key === "transition") {
|
|
213
|
+
out[key] = throughAccessor(value, (given) => splitTransition(subjectNow, given));
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if (key !== "variants" || !Predicate.isObject(value))
|
|
217
|
+
return;
|
|
218
|
+
out[key] = Rec.map(value, (variant) => throughVariant(variant, (given) => splitTargetValue(subjectNow, given)));
|
|
219
|
+
});
|
|
220
|
+
return out;
|
|
221
|
+
};
|
|
222
|
+
/** Whether `key` is a colour key of a Batch made of `given`: `color` on an `InstancedMesh`'s instances, a Color on a list's first member. */
|
|
223
|
+
const isBatchColour = (given, key) => {
|
|
224
|
+
if (ThreeInstances.isInstancedMesh(given))
|
|
225
|
+
return key === "color";
|
|
226
|
+
if (!Arr.isArray(given))
|
|
227
|
+
return false;
|
|
228
|
+
const first = given[0];
|
|
229
|
+
return Predicate.isObject(first) && Predicate.isNotUndefined(colourFor(first, key));
|
|
230
|
+
};
|
|
231
|
+
/** The `keys` of a Batch made of `given` (an `InstancedMesh`, or a list), each colour key given as its three channels. */
|
|
232
|
+
export const splitBatchKeys = (given, keys) => Arr.flatMap(keys, (key) => {
|
|
233
|
+
if (!isBatchColour(given, key))
|
|
234
|
+
return [key];
|
|
235
|
+
return Arr.map(CHANNELS, (channel) => `${key}${channel}`);
|
|
236
|
+
});
|
|
237
|
+
//# sourceMappingURL=ThreeColours.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreeColours.js","sourceRoot":"","sources":["../src/ThreeColours.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,qGAAqG;AACrG,mGAAmG;AACnG,+HAA+H;AAC/H,sGAAsG;AACtG,6BAA6B;AAC7B,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,SAAS,MA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H;AAC1H,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAc,EAAE,IAA2B,EAAyB,EAAE,CACnG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;IACxB,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,CAAA;IAC5C,OAAO,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,OAAO,EAAE,CAAC,CAAA;AAC3D,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drag in 3D (ADR-0070 decision 9, kept by ADR-0073 decision 18): a pointer moves in 2D, so each of its
|
|
3
|
+
* moves is cast into the scene, and the object moves with what it meets.
|
|
4
|
+
*
|
|
5
|
+
* - **`drag: true`** moves the object on the plane through the point grabbed, facing the camera, as
|
|
6
|
+
* three's `DragControls` and drei's do.
|
|
7
|
+
* - **`drag: "x" | "y" | "z"`** moves it along that axis of its parent's space, matching the `x`, `y`
|
|
8
|
+
* and `z` keys.
|
|
9
|
+
* - **`dragPlane`** drags it on a fixed plane, in world space: the ground.
|
|
10
|
+
* - **`dragConstraints`**, `{ x: [-2, 2], z: [-2, 2] }`, are its ranges per axis in its parent's space,
|
|
11
|
+
* which `dragElastic` lets it be pulled past.
|
|
12
|
+
* - **Its release** glides on at the pointer's speed, cast into the scene the same way, in world units a
|
|
13
|
+
* second, on Motion's inertia per axis (`dragMomentum`, `dragTransition`), back within its ranges,
|
|
14
|
+
* or back where it was picked up from (`dragSnapToOrigin`). Its rest thresholds are Motion's, in the
|
|
15
|
+
* scene's units through its unit scale.
|
|
16
|
+
*
|
|
17
|
+
* Its moves are written through `animate`, a 0 s change each: a ward on the object takes them as the
|
|
18
|
+
* Stage's `animate` (#433), holding `x`, `y` and `z` where the drag leaves them until its own target
|
|
19
|
+
* for one changes. `@wardic/three/solid`'s Stage drags with it.
|
|
20
|
+
*
|
|
21
|
+
* @module
|
|
22
|
+
*/
|
|
23
|
+
import * as Drag from "@wardic/core/Drag";
|
|
24
|
+
import type * as InputFeed from "@wardic/core/InputFeed";
|
|
25
|
+
import type * as InputSource from "@wardic/core/InputSource";
|
|
26
|
+
import type * as UnitScale from "@wardic/core/UnitScale";
|
|
27
|
+
import type * as Config from "@wardic/core/unstable/Config";
|
|
28
|
+
import type * as Imperative from "@wardic/core/unstable/Imperative";
|
|
29
|
+
import * as Effect from "effect/Effect";
|
|
30
|
+
import type * as Scope from "effect/Scope";
|
|
31
|
+
import { type Camera, Plane } from "three";
|
|
32
|
+
/** An axis of an object's parent's space. */
|
|
33
|
+
export type DragAxis = "x" | "y" | "z";
|
|
34
|
+
/** A range on one axis: its least, then its most. */
|
|
35
|
+
export type DragRange = readonly [min: number, max: number];
|
|
36
|
+
/** A release's inertia, as `type: "inertia"`'s: Motion's `dragTransition`. */
|
|
37
|
+
export type DragTransition = Omit<Config.WardicInertia, "type" | "velocity" | "min" | "max">;
|
|
38
|
+
/** A drag's config, read at each gesture's start. */
|
|
39
|
+
export interface DragConfig {
|
|
40
|
+
readonly drag?: boolean | DragAxis | undefined;
|
|
41
|
+
readonly dragPlane?: Plane | undefined;
|
|
42
|
+
readonly dragConstraints?: Partial<Readonly<Record<DragAxis, DragRange>>> | undefined;
|
|
43
|
+
readonly dragElastic?: number | undefined;
|
|
44
|
+
readonly dragMomentum?: boolean | undefined;
|
|
45
|
+
readonly dragTransition?: DragTransition | undefined;
|
|
46
|
+
readonly dragSnapToOrigin?: boolean | undefined;
|
|
47
|
+
}
|
|
48
|
+
/** What a drag tells: each pointer sample, after the object has moved, and its release coming to rest. */
|
|
49
|
+
export interface DragHandlers {
|
|
50
|
+
readonly sample: (sample: Drag.Sample) => void;
|
|
51
|
+
readonly released: () => void;
|
|
52
|
+
readonly onDefect?: InputFeed.OnDefect | undefined;
|
|
53
|
+
}
|
|
54
|
+
/** A canvas, as the drag reads it: where it is on the page. */
|
|
55
|
+
export interface CanvasRect {
|
|
56
|
+
readonly getBoundingClientRect: () => {
|
|
57
|
+
readonly left: number;
|
|
58
|
+
readonly top: number;
|
|
59
|
+
readonly width: number;
|
|
60
|
+
readonly height: number;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** What a scene's drags run on: its `animate`, its camera, its canvas, and its unit scale. */
|
|
64
|
+
export interface Options {
|
|
65
|
+
readonly animate: (subject: object, target: Readonly<Record<string, unknown>>, options?: Imperative.WardicAnimateOptions) => Imperative.WardicPlaybackControls;
|
|
66
|
+
/** The camera it's drawn with, or a function giving the one active now. */
|
|
67
|
+
readonly camera: Camera | (() => Camera);
|
|
68
|
+
/** Its canvas, once there is one. */
|
|
69
|
+
readonly canvas: () => CanvasRect | undefined;
|
|
70
|
+
/** How many of Motion's units a key counts as, for the release's rest thresholds. */
|
|
71
|
+
readonly unitScale: UnitScale.Rule;
|
|
72
|
+
}
|
|
73
|
+
/** A scene's drags. */
|
|
74
|
+
export interface ThreeDrag {
|
|
75
|
+
/** Watch `subject`'s drags on the scene's input: `config()` read at each gesture's start. */
|
|
76
|
+
readonly watch: (subject: object, config: () => DragConfig, handlers: DragHandlers) => Effect.Effect<void, never, Scope.Scope | InputSource.InputSource>;
|
|
77
|
+
}
|
|
78
|
+
/** How far an object is pulled past a range by default: Motion's. */
|
|
79
|
+
export declare const DEFAULT_ELASTIC = 0.35;
|
|
80
|
+
/** A scene's drags on `options`' camera and canvas, moving each object through `options.animate`. */
|
|
81
|
+
export declare const make: (options: Options) => ThreeDrag;
|
|
82
|
+
//# sourceMappingURL=ThreeDrag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreeDrag.d.ts","sourceRoot":"","sources":["../src/ThreeDrag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAA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UAAU,EAAE,QAAQ,EAAE,YAAY,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,GAAG,WAAW,CAAC,WAAW,CAAC,CAAA;CACzJ;AAED,qEAAqE;AACrE,eAAO,MAAM,eAAe,OAAO,CAAA;AAwGnC,qGAAqG;AACrG,eAAO,MAAM,IAAI,YAAa,OAAO,KAAG,SAiJvC,CAAA"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drag in 3D (ADR-0070 decision 9, kept by ADR-0073 decision 18): a pointer moves in 2D, so each of its
|
|
3
|
+
* moves is cast into the scene, and the object moves with what it meets.
|
|
4
|
+
*
|
|
5
|
+
* - **`drag: true`** moves the object on the plane through the point grabbed, facing the camera, as
|
|
6
|
+
* three's `DragControls` and drei's do.
|
|
7
|
+
* - **`drag: "x" | "y" | "z"`** moves it along that axis of its parent's space, matching the `x`, `y`
|
|
8
|
+
* and `z` keys.
|
|
9
|
+
* - **`dragPlane`** drags it on a fixed plane, in world space: the ground.
|
|
10
|
+
* - **`dragConstraints`**, `{ x: [-2, 2], z: [-2, 2] }`, are its ranges per axis in its parent's space,
|
|
11
|
+
* which `dragElastic` lets it be pulled past.
|
|
12
|
+
* - **Its release** glides on at the pointer's speed, cast into the scene the same way, in world units a
|
|
13
|
+
* second, on Motion's inertia per axis (`dragMomentum`, `dragTransition`), back within its ranges,
|
|
14
|
+
* or back where it was picked up from (`dragSnapToOrigin`). Its rest thresholds are Motion's, in the
|
|
15
|
+
* scene's units through its unit scale.
|
|
16
|
+
*
|
|
17
|
+
* Its moves are written through `animate`, a 0 s change each: a ward on the object takes them as the
|
|
18
|
+
* Stage's `animate` (#433), holding `x`, `y` and `z` where the drag leaves them until its own target
|
|
19
|
+
* for one changes. `@wardic/three/solid`'s Stage drags with it.
|
|
20
|
+
*
|
|
21
|
+
* @module
|
|
22
|
+
*/
|
|
23
|
+
// #885's PR 4 (ADR-0073, *Amendment (#885)*, Q8).
|
|
24
|
+
import * as Drag from "@wardic/core/Drag";
|
|
25
|
+
import * as DragRecognizer from "@wardic/core/DragRecognizer";
|
|
26
|
+
import * as Arr from "effect/Array";
|
|
27
|
+
import * as Bool from "effect/Boolean";
|
|
28
|
+
import * as Effect from "effect/Effect";
|
|
29
|
+
import * as Option from "effect/Option";
|
|
30
|
+
import * as Predicate from "effect/Predicate";
|
|
31
|
+
import * as UndefinedOr from "effect/UndefinedOr";
|
|
32
|
+
import { Plane, Raycaster, Vector2, Vector3 } from "three";
|
|
33
|
+
/** How far an object is pulled past a range by default: Motion's. */
|
|
34
|
+
export const DEFAULT_ELASTIC = 0.35;
|
|
35
|
+
const AXES = ["x", "y", "z"];
|
|
36
|
+
/** Each axis's unit vector. */
|
|
37
|
+
const UNIT = { x: new Vector3(1, 0, 0), y: new Vector3(0, 1, 0), z: new Vector3(0, 0, 1) };
|
|
38
|
+
/** Motion's release: a 750 ms time constant, power 0.8, at rest within 1 of its units and below 10 a second. */
|
|
39
|
+
const RELEASE = { power: 0.8, timeConstant: 750 };
|
|
40
|
+
const REST_DELTA = 1;
|
|
41
|
+
const REST_SPEED = 10;
|
|
42
|
+
/** Its bounce back within a range: soft with an elastic edge, at once with none. Motion's. */
|
|
43
|
+
const ELASTIC_BOUNCE = { bounceStiffness: 200, bounceDamping: 40 };
|
|
44
|
+
const RIGID_BOUNCE = { bounceStiffness: 1e6, bounceDamping: 1e7 };
|
|
45
|
+
/** A 1/60 s step back along the pointer's velocity: where a release's speed is cast from. */
|
|
46
|
+
const STEP = 1 / 60;
|
|
47
|
+
/** A drag's moves, written at once. */
|
|
48
|
+
const AT_ONCE = { duration: 0 };
|
|
49
|
+
// Module state: scratch for the casts, each used and read before the next.
|
|
50
|
+
const raycaster = new Raycaster();
|
|
51
|
+
const ndc = new Vector2();
|
|
52
|
+
/** The camera now: one given, or the one a function gives. */
|
|
53
|
+
const cameraOf = (camera) => {
|
|
54
|
+
if (Predicate.isFunction(camera))
|
|
55
|
+
return camera();
|
|
56
|
+
return camera;
|
|
57
|
+
};
|
|
58
|
+
/** The pointer's ray through `point` on the page, from the camera. */
|
|
59
|
+
const rayAt = (point, rect, camera) => {
|
|
60
|
+
ndc.set(((point.x - rect.left) / rect.width) * 2 - 1, -((point.y - rect.top) / rect.height) * 2 + 1);
|
|
61
|
+
raycaster.setFromCamera(ndc, camera);
|
|
62
|
+
return raycaster.ray;
|
|
63
|
+
};
|
|
64
|
+
/** Where `ray` meets the drag: on its plane, and for an axis drag on its line; none where the ray runs along the plane. */
|
|
65
|
+
const meet = (plane, line, through, ray, out) => {
|
|
66
|
+
if (Predicate.isNull(ray.intersectPlane(plane, out)))
|
|
67
|
+
return undefined;
|
|
68
|
+
return UndefinedOr.match(line, {
|
|
69
|
+
onUndefined: () => out,
|
|
70
|
+
onDefined: (along) => {
|
|
71
|
+
const d = out.sub(through).dot(along);
|
|
72
|
+
return out.copy(through).addScaledVector(along, d);
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* The plane an axis drag moves on: through `through`, holding the axis `line`, and facing the camera as
|
|
78
|
+
* nearly as one can. Looking down the axis, one holding it at all.
|
|
79
|
+
*/
|
|
80
|
+
const axisPlane = (line, through, camera) => {
|
|
81
|
+
const view = camera.getWorldDirection(new Vector3());
|
|
82
|
+
const normal = view.addScaledVector(line, -view.dot(line));
|
|
83
|
+
if (normal.lengthSq() < 1e-12)
|
|
84
|
+
normal.crossVectors(line, Bool.match(Math.abs(line.y) < 0.9, { onTrue: () => UNIT.y, onFalse: () => UNIT.x }));
|
|
85
|
+
return new Plane().setFromNormalAndCoplanarPoint(normal.normalize(), through);
|
|
86
|
+
};
|
|
87
|
+
/** `object`'s parent: none at the root. */
|
|
88
|
+
const parentOf = (object) => Option.getOrUndefined(Option.fromNullishOr(object.parent));
|
|
89
|
+
/** `world`, a point, in `object`'s parent's space: as it is at the root. */
|
|
90
|
+
const toParent = (object, world) => UndefinedOr.match(parentOf(object), { onUndefined: () => world, onDefined: (parent) => parent.worldToLocal(world) });
|
|
91
|
+
/** `config`'s range on `axis`, as core's: none without one. */
|
|
92
|
+
const rangeOf = (config, axis) => {
|
|
93
|
+
const constraints = config.dragConstraints;
|
|
94
|
+
if (Predicate.isUndefined(constraints))
|
|
95
|
+
return undefined;
|
|
96
|
+
return UndefinedOr.map(constraints[axis], ([min, max]) => ({ min, max }));
|
|
97
|
+
};
|
|
98
|
+
/** The object's place, its keys' values. */
|
|
99
|
+
const valuesOf = (grab) => {
|
|
100
|
+
const values = {};
|
|
101
|
+
Arr.forEach(grab.keys, (key) => {
|
|
102
|
+
values[key] = grab.now[key];
|
|
103
|
+
});
|
|
104
|
+
return values;
|
|
105
|
+
};
|
|
106
|
+
/** A scene's drags on `options`' camera and canvas, moving each object through `options.animate`. */
|
|
107
|
+
export const make = (options) => {
|
|
108
|
+
/** Its canvas's place on the page now, once there's a canvas. */
|
|
109
|
+
const rectNow = () => UndefinedOr.map(options.canvas(), (canvas) => canvas.getBoundingClientRect());
|
|
110
|
+
/** A gesture's start: where the pointer went down on the object, and what it moves on from there. */
|
|
111
|
+
const begin = (object, config, sample) => {
|
|
112
|
+
const rect = rectNow();
|
|
113
|
+
if (Predicate.isUndefined(rect))
|
|
114
|
+
return undefined;
|
|
115
|
+
const camera = cameraOf(options.camera);
|
|
116
|
+
object.updateWorldMatrix(true, false);
|
|
117
|
+
const down = { x: sample.point.x - sample.offset.x, y: sample.point.y - sample.offset.y };
|
|
118
|
+
const ray = rayAt(down, rect, camera);
|
|
119
|
+
const from = object.getWorldPosition(new Vector3());
|
|
120
|
+
// Where it was grabbed: where the pointer's ray met it, else its middle.
|
|
121
|
+
const through = Option.match(Arr.head(raycaster.intersectObject(object, true)), {
|
|
122
|
+
onNone: () => from.clone(),
|
|
123
|
+
onSome: (hit) => hit.point.clone(),
|
|
124
|
+
});
|
|
125
|
+
const axis = Option.getOrUndefined(Arr.findFirst(AXES, (one) => one === config.drag));
|
|
126
|
+
const line = UndefinedOr.map(axis, (one) => UndefinedOr.match(parentOf(object), {
|
|
127
|
+
onUndefined: () => UNIT[one].clone(),
|
|
128
|
+
onDefined: (parent) => UNIT[one].clone().transformDirection(parent.matrixWorld),
|
|
129
|
+
}));
|
|
130
|
+
const plane = UndefinedOr.match(config.dragPlane, {
|
|
131
|
+
onDefined: (given) => given,
|
|
132
|
+
onUndefined: () => UndefinedOr.match(line, {
|
|
133
|
+
onDefined: (along) => axisPlane(along, through, camera),
|
|
134
|
+
onUndefined: () => new Plane().setFromNormalAndCoplanarPoint(camera.getWorldDirection(new Vector3()), through),
|
|
135
|
+
}),
|
|
136
|
+
});
|
|
137
|
+
return UndefinedOr.map(meet(plane, line, through, ray, new Vector3()), (grabbed) => {
|
|
138
|
+
const start = { x: object.position.x, y: object.position.y, z: object.position.z };
|
|
139
|
+
const keys = UndefinedOr.match(axis, { onUndefined: () => AXES, onDefined: (one) => [one] });
|
|
140
|
+
return { object, config, keys, plane, line, grabbed, from, start, now: { ...start } };
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
// Scratch for a move's cast: each used and read before the next.
|
|
144
|
+
const met = new Vector3();
|
|
145
|
+
const world = new Vector3();
|
|
146
|
+
/** The object where the pointer at `point` has it, within its ranges' give, written. Whether the plane was met. */
|
|
147
|
+
const moveTo = (grab, point) => UndefinedOr.match(rectNow(), {
|
|
148
|
+
onUndefined: () => false,
|
|
149
|
+
onDefined: (rect) => UndefinedOr.match(meet(grab.plane, grab.line, grab.grabbed, rayAt(point, rect, cameraOf(options.camera)), met), {
|
|
150
|
+
onUndefined: () => false,
|
|
151
|
+
onDefined: (hit) => {
|
|
152
|
+
const local = toParent(grab.object, world.copy(grab.from).add(hit).sub(grab.grabbed));
|
|
153
|
+
const elastic = UndefinedOr.match(grab.config.dragElastic, { onUndefined: () => DEFAULT_ELASTIC, onDefined: (given) => given });
|
|
154
|
+
Arr.forEach(grab.keys, (key) => {
|
|
155
|
+
grab.now[key] = Drag.constrain(local[key], rangeOf(grab.config, key), elastic);
|
|
156
|
+
});
|
|
157
|
+
void options.animate(grab.object, valuesOf(grab), AT_ONCE);
|
|
158
|
+
return true;
|
|
159
|
+
},
|
|
160
|
+
}),
|
|
161
|
+
});
|
|
162
|
+
/** The pointer's velocity at its release, cast into the scene: in its parent's space's units a second. */
|
|
163
|
+
const velocityOf = (grab, sample) => {
|
|
164
|
+
const none = { x: 0, y: 0, z: 0 };
|
|
165
|
+
if (Bool.and(sample.velocity.x === 0, sample.velocity.y === 0))
|
|
166
|
+
return none;
|
|
167
|
+
return UndefinedOr.match(rectNow(), {
|
|
168
|
+
onUndefined: () => none,
|
|
169
|
+
onDefined: (rect) => {
|
|
170
|
+
const camera = cameraOf(options.camera);
|
|
171
|
+
const back = { x: sample.point.x - sample.velocity.x * STEP, y: sample.point.y - sample.velocity.y * STEP };
|
|
172
|
+
const here = meet(grab.plane, grab.line, grab.grabbed, rayAt(sample.point, rect, camera), new Vector3());
|
|
173
|
+
const there = meet(grab.plane, grab.line, grab.grabbed, rayAt(back, rect, camera), new Vector3());
|
|
174
|
+
if (Bool.or(Predicate.isUndefined(here), Predicate.isUndefined(there)))
|
|
175
|
+
return none;
|
|
176
|
+
const a = toParent(grab.object, here.clone());
|
|
177
|
+
const b = toParent(grab.object, there.clone());
|
|
178
|
+
const out = { ...none };
|
|
179
|
+
Arr.forEach(grab.keys, (key) => {
|
|
180
|
+
out[key] = (a[key] - b[key]) / STEP;
|
|
181
|
+
});
|
|
182
|
+
return out;
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Its release, Motion's: inertia per key at the release's speed (none with `dragMomentum: false`),
|
|
188
|
+
* bounded by its ranges, or by where it was picked up from with `dragSnapToOrigin`.
|
|
189
|
+
*/
|
|
190
|
+
const release = (grab, sample, handlers) => {
|
|
191
|
+
const config = grab.config;
|
|
192
|
+
const velocity = Bool.match(config.dragMomentum === false, { onTrue: () => ({ x: 0, y: 0, z: 0 }), onFalse: () => velocityOf(grab, sample) });
|
|
193
|
+
const elastic = UndefinedOr.match(config.dragElastic, { onUndefined: () => DEFAULT_ELASTIC, onDefined: (given) => given });
|
|
194
|
+
const bounce = Bool.match(elastic > 0, { onTrue: () => ELASTIC_BOUNCE, onFalse: () => RIGID_BOUNCE });
|
|
195
|
+
const transition = {};
|
|
196
|
+
Arr.forEach(grab.keys, (key) => {
|
|
197
|
+
const scale = options.unitScale(key, 1);
|
|
198
|
+
const range = Bool.match(config.dragSnapToOrigin === true, {
|
|
199
|
+
onTrue: () => ({ min: grab.start[key], max: grab.start[key] }),
|
|
200
|
+
onFalse: () => rangeOf(config, key),
|
|
201
|
+
});
|
|
202
|
+
transition[key] = {
|
|
203
|
+
type: "inertia",
|
|
204
|
+
velocity: velocity[key],
|
|
205
|
+
...RELEASE,
|
|
206
|
+
restDelta: REST_DELTA / scale,
|
|
207
|
+
restSpeed: REST_SPEED / scale,
|
|
208
|
+
...bounce,
|
|
209
|
+
...range,
|
|
210
|
+
...config.dragTransition,
|
|
211
|
+
};
|
|
212
|
+
});
|
|
213
|
+
void options.animate(grab.object, valuesOf(grab), transition).then(handlers.released);
|
|
214
|
+
};
|
|
215
|
+
return {
|
|
216
|
+
watch: (subject, config, handlers) => {
|
|
217
|
+
let grab;
|
|
218
|
+
return DragRecognizer.watchDrag(subject, { axis: "xy" }, {
|
|
219
|
+
on: (sample) => {
|
|
220
|
+
if (sample.phase === "start") {
|
|
221
|
+
grab = begin(subject, config(), sample);
|
|
222
|
+
UndefinedOr.map(grab, (g) => moveTo(g, sample.point));
|
|
223
|
+
}
|
|
224
|
+
if (sample.phase === "move")
|
|
225
|
+
UndefinedOr.map(grab, (g) => moveTo(g, sample.point));
|
|
226
|
+
if (sample.phase === "end") {
|
|
227
|
+
// A cancelled gesture stops where it is: no release, as Motion's `cancel`.
|
|
228
|
+
UndefinedOr.map(grab, (g) => {
|
|
229
|
+
if (sample.cancelled === true)
|
|
230
|
+
return;
|
|
231
|
+
moveTo(g, sample.point);
|
|
232
|
+
release(g, sample, handlers);
|
|
233
|
+
});
|
|
234
|
+
grab = undefined;
|
|
235
|
+
}
|
|
236
|
+
handlers.sample(sample);
|
|
237
|
+
},
|
|
238
|
+
onDefect: handlers.onDefect,
|
|
239
|
+
}).pipe(Effect.asVoid);
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
//# sourceMappingURL=ThreeDrag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreeDrag.js","sourceRoot":"","sources":["../src/ThreeDrag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,kDAAkD;AAClD,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAA;AACzC,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAA;AAO7D,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,IAAI,MAAM,gBAAgB,CAAA;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAE7C,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAA8B,KAAK,EAAY,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAmDhG,qEAAqE;AACrE,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAA;AAEnC,MAAM,IAAI,GAA4B,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAErD,+BAA+B;AAC/B,MAAM,IAAI,GAAwC,EAAE,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,E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