@truewatchtech/cocos-sdk 0.1.0-alpha.4

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.
Files changed (200) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +31 -0
  3. package/THIRD_PARTY_NOTICES +5 -0
  4. package/bin/cli.cjs +138 -0
  5. package/components/creator2/ReplayPrivacy.ts +23 -0
  6. package/components/creator3/ReplayPrivacy.ts +25 -0
  7. package/creator2/package.json +4 -0
  8. package/creator3/package.json +5 -0
  9. package/dist/creator2/core/auto-tracking.d.ts +35 -0
  10. package/dist/creator2/core/auto-tracking.d.ts.map +1 -0
  11. package/dist/creator2/core/auto-tracking.js +337 -0
  12. package/dist/creator2/core/auto-tracking.js.map +1 -0
  13. package/dist/creator2/core/client.d.ts +74 -0
  14. package/dist/creator2/core/client.d.ts.map +1 -0
  15. package/dist/creator2/core/client.js +176 -0
  16. package/dist/creator2/core/client.js.map +1 -0
  17. package/dist/creator2/core/index.d.ts +3 -0
  18. package/dist/creator2/core/index.d.ts.map +1 -0
  19. package/dist/creator2/core/index.js +6 -0
  20. package/dist/creator2/core/index.js.map +1 -0
  21. package/dist/creator2/core/modules.d.ts +159 -0
  22. package/dist/creator2/core/modules.d.ts.map +1 -0
  23. package/dist/creator2/core/modules.js +319 -0
  24. package/dist/creator2/core/modules.js.map +1 -0
  25. package/dist/creator2/core/replay-async-transport.d.ts +4 -0
  26. package/dist/creator2/core/replay-async-transport.d.ts.map +1 -0
  27. package/dist/creator2/core/replay-async-transport.js +67 -0
  28. package/dist/creator2/core/replay-async-transport.js.map +1 -0
  29. package/dist/creator2/core/replay-budget.d.ts +28 -0
  30. package/dist/creator2/core/replay-budget.d.ts.map +1 -0
  31. package/dist/creator2/core/replay-budget.js +113 -0
  32. package/dist/creator2/core/replay-budget.js.map +1 -0
  33. package/dist/creator2/core/replay-diagnostics.d.ts +36 -0
  34. package/dist/creator2/core/replay-diagnostics.d.ts.map +1 -0
  35. package/dist/creator2/core/replay-diagnostics.js +40 -0
  36. package/dist/creator2/core/replay-diagnostics.js.map +1 -0
  37. package/dist/creator2/core/replay-encoding.d.ts +31 -0
  38. package/dist/creator2/core/replay-encoding.d.ts.map +1 -0
  39. package/dist/creator2/core/replay-encoding.js +63 -0
  40. package/dist/creator2/core/replay-encoding.js.map +1 -0
  41. package/dist/creator2/core/replay-file.d.ts +5 -0
  42. package/dist/creator2/core/replay-file.d.ts.map +1 -0
  43. package/dist/creator2/core/replay-file.js +101 -0
  44. package/dist/creator2/core/replay-file.js.map +1 -0
  45. package/dist/creator2/core/replay-pixels.d.ts +3 -0
  46. package/dist/creator2/core/replay-pixels.d.ts.map +1 -0
  47. package/dist/creator2/core/replay-pixels.js +16 -0
  48. package/dist/creator2/core/replay-pixels.js.map +1 -0
  49. package/dist/creator2/core/replay-privacy-nodes.d.ts +14 -0
  50. package/dist/creator2/core/replay-privacy-nodes.d.ts.map +1 -0
  51. package/dist/creator2/core/replay-privacy-nodes.js +18 -0
  52. package/dist/creator2/core/replay-privacy-nodes.js.map +1 -0
  53. package/dist/creator2/core/replay-privacy.d.ts +15 -0
  54. package/dist/creator2/core/replay-privacy.d.ts.map +1 -0
  55. package/dist/creator2/core/replay-privacy.js +36 -0
  56. package/dist/creator2/core/replay-privacy.js.map +1 -0
  57. package/dist/creator2/core/replay.d.ts +99 -0
  58. package/dist/creator2/core/replay.d.ts.map +1 -0
  59. package/dist/creator2/core/replay.js +611 -0
  60. package/dist/creator2/core/replay.js.map +1 -0
  61. package/dist/creator2/core/transport.d.ts +17 -0
  62. package/dist/creator2/core/transport.d.ts.map +1 -0
  63. package/dist/creator2/core/transport.js +33 -0
  64. package/dist/creator2/core/transport.js.map +1 -0
  65. package/dist/creator2/core/types.d.ts +260 -0
  66. package/dist/creator2/core/types.d.ts.map +1 -0
  67. package/dist/creator2/core/types.js +3 -0
  68. package/dist/creator2/core/types.js.map +1 -0
  69. package/dist/creator2/core/validation.d.ts +14 -0
  70. package/dist/creator2/core/validation.d.ts.map +1 -0
  71. package/dist/creator2/core/validation.js +81 -0
  72. package/dist/creator2/core/validation.js.map +1 -0
  73. package/dist/creator2/core/version.d.ts +9 -0
  74. package/dist/creator2/core/version.d.ts.map +1 -0
  75. package/dist/creator2/core/version.js +14 -0
  76. package/dist/creator2/core/version.js.map +1 -0
  77. package/dist/creator2/creator2/auto.d.ts +9 -0
  78. package/dist/creator2/creator2/auto.d.ts.map +1 -0
  79. package/dist/creator2/creator2/auto.js +65 -0
  80. package/dist/creator2/creator2/auto.js.map +1 -0
  81. package/dist/creator2/creator2/capture.d.ts +17 -0
  82. package/dist/creator2/creator2/capture.d.ts.map +1 -0
  83. package/dist/creator2/creator2/capture.js +168 -0
  84. package/dist/creator2/creator2/capture.js.map +1 -0
  85. package/dist/creator2/creator2/index.d.ts +12 -0
  86. package/dist/creator2/creator2/index.d.ts.map +1 -0
  87. package/dist/creator2/creator2/index.js +41 -0
  88. package/dist/creator2/creator2/index.js.map +1 -0
  89. package/dist/creator2/creator2/transport.d.ts +8 -0
  90. package/dist/creator2/creator2/transport.d.ts.map +1 -0
  91. package/dist/creator2/creator2/transport.js +38 -0
  92. package/dist/creator2/creator2/transport.js.map +1 -0
  93. package/dist/creator3/core/auto-tracking.d.ts +35 -0
  94. package/dist/creator3/core/auto-tracking.d.ts.map +1 -0
  95. package/dist/creator3/core/auto-tracking.js +247 -0
  96. package/dist/creator3/core/auto-tracking.js.map +1 -0
  97. package/dist/creator3/core/client.d.ts +74 -0
  98. package/dist/creator3/core/client.d.ts.map +1 -0
  99. package/dist/creator3/core/client.js +158 -0
  100. package/dist/creator3/core/client.js.map +1 -0
  101. package/dist/creator3/core/index.d.ts +3 -0
  102. package/dist/creator3/core/index.d.ts.map +1 -0
  103. package/dist/creator3/core/index.js +2 -0
  104. package/dist/creator3/core/index.js.map +1 -0
  105. package/dist/creator3/core/modules.d.ts +159 -0
  106. package/dist/creator3/core/modules.d.ts.map +1 -0
  107. package/dist/creator3/core/modules.js +293 -0
  108. package/dist/creator3/core/modules.js.map +1 -0
  109. package/dist/creator3/core/replay-async-transport.d.ts +4 -0
  110. package/dist/creator3/core/replay-async-transport.d.ts.map +1 -0
  111. package/dist/creator3/core/replay-async-transport.js +16 -0
  112. package/dist/creator3/core/replay-async-transport.js.map +1 -0
  113. package/dist/creator3/core/replay-budget.d.ts +28 -0
  114. package/dist/creator3/core/replay-budget.d.ts.map +1 -0
  115. package/dist/creator3/core/replay-budget.js +105 -0
  116. package/dist/creator3/core/replay-budget.js.map +1 -0
  117. package/dist/creator3/core/replay-diagnostics.d.ts +36 -0
  118. package/dist/creator3/core/replay-diagnostics.d.ts.map +1 -0
  119. package/dist/creator3/core/replay-diagnostics.js +36 -0
  120. package/dist/creator3/core/replay-diagnostics.js.map +1 -0
  121. package/dist/creator3/core/replay-encoding.d.ts +31 -0
  122. package/dist/creator3/core/replay-encoding.d.ts.map +1 -0
  123. package/dist/creator3/core/replay-encoding.js +62 -0
  124. package/dist/creator3/core/replay-encoding.js.map +1 -0
  125. package/dist/creator3/core/replay-file.d.ts +5 -0
  126. package/dist/creator3/core/replay-file.d.ts.map +1 -0
  127. package/dist/creator3/core/replay-file.js +31 -0
  128. package/dist/creator3/core/replay-file.js.map +1 -0
  129. package/dist/creator3/core/replay-pixels.d.ts +3 -0
  130. package/dist/creator3/core/replay-pixels.d.ts.map +1 -0
  131. package/dist/creator3/core/replay-pixels.js +13 -0
  132. package/dist/creator3/core/replay-pixels.js.map +1 -0
  133. package/dist/creator3/core/replay-privacy-nodes.d.ts +14 -0
  134. package/dist/creator3/core/replay-privacy-nodes.d.ts.map +1 -0
  135. package/dist/creator3/core/replay-privacy-nodes.js +15 -0
  136. package/dist/creator3/core/replay-privacy-nodes.js.map +1 -0
  137. package/dist/creator3/core/replay-privacy.d.ts +15 -0
  138. package/dist/creator3/core/replay-privacy.d.ts.map +1 -0
  139. package/dist/creator3/core/replay-privacy.js +33 -0
  140. package/dist/creator3/core/replay-privacy.js.map +1 -0
  141. package/dist/creator3/core/replay.d.ts +99 -0
  142. package/dist/creator3/core/replay.d.ts.map +1 -0
  143. package/dist/creator3/core/replay.js +534 -0
  144. package/dist/creator3/core/replay.js.map +1 -0
  145. package/dist/creator3/core/transport.d.ts +17 -0
  146. package/dist/creator3/core/transport.d.ts.map +1 -0
  147. package/dist/creator3/core/transport.js +27 -0
  148. package/dist/creator3/core/transport.js.map +1 -0
  149. package/dist/creator3/core/types.d.ts +260 -0
  150. package/dist/creator3/core/types.d.ts.map +1 -0
  151. package/dist/creator3/core/types.js +2 -0
  152. package/dist/creator3/core/types.js.map +1 -0
  153. package/dist/creator3/core/validation.d.ts +14 -0
  154. package/dist/creator3/core/validation.d.ts.map +1 -0
  155. package/dist/creator3/core/validation.js +75 -0
  156. package/dist/creator3/core/validation.js.map +1 -0
  157. package/dist/creator3/core/version.d.ts +9 -0
  158. package/dist/creator3/core/version.d.ts.map +1 -0
  159. package/dist/creator3/core/version.js +11 -0
  160. package/dist/creator3/core/version.js.map +1 -0
  161. package/dist/creator3/creator3/auto.d.ts +9 -0
  162. package/dist/creator3/creator3/auto.d.ts.map +1 -0
  163. package/dist/creator3/creator3/auto.js +73 -0
  164. package/dist/creator3/creator3/auto.js.map +1 -0
  165. package/dist/creator3/creator3/capture.d.ts +17 -0
  166. package/dist/creator3/creator3/capture.d.ts.map +1 -0
  167. package/dist/creator3/creator3/capture.js +112 -0
  168. package/dist/creator3/creator3/capture.js.map +1 -0
  169. package/dist/creator3/creator3/index.d.ts +12 -0
  170. package/dist/creator3/creator3/index.d.ts.map +1 -0
  171. package/dist/creator3/creator3/index.js +23 -0
  172. package/dist/creator3/creator3/index.js.map +1 -0
  173. package/dist/creator3/creator3/replay-render-cycle.d.ts +9 -0
  174. package/dist/creator3/creator3/replay-render-cycle.d.ts.map +1 -0
  175. package/dist/creator3/creator3/replay-render-cycle.js +12 -0
  176. package/dist/creator3/creator3/replay-render-cycle.js.map +1 -0
  177. package/dist/creator3/creator3/transport.d.ts +9 -0
  178. package/dist/creator3/creator3/transport.d.ts.map +1 -0
  179. package/dist/creator3/creator3/transport.js +28 -0
  180. package/dist/creator3/creator3/transport.js.map +1 -0
  181. package/dist/creator3/package.json +1 -0
  182. package/extensions/creator2/install-native.cjs +385 -0
  183. package/extensions/creator2/main.js +23 -0
  184. package/extensions/creator2/package.json +6 -0
  185. package/extensions/creator3/dist/builder.js +9 -0
  186. package/extensions/creator3/dist/hooks.js +70 -0
  187. package/extensions/creator3/dist/main.js +4 -0
  188. package/extensions/creator3/install-native.cjs +385 -0
  189. package/extensions/creator3/package.json +10 -0
  190. package/native/android/src/main/java/com/ft/sdk/cocos/FTCocosBridge.java +536 -0
  191. package/native/android/src/main/java/com/ft/sdk/cocos/FTCocosBridgeProvider.java +70 -0
  192. package/native/android/src/main/java/com/ft/sdk/cocos/FTCocosReplayImageJobs.java +55 -0
  193. package/native/ios/FTCocosBridge.h +10 -0
  194. package/native/ios/FTCocosBridge.m +487 -0
  195. package/native/ios/FTCocosBridge.podspec +18 -0
  196. package/native/ios/FTCocosReplayImageJobs.h +11 -0
  197. package/native/ios/FTCocosReplayImageJobs.m +54 -0
  198. package/native/shared/FTReplayFileBridge.h +62 -0
  199. package/native/shared/FTReplayFileWorker.h +88 -0
  200. package/package.json +61 -0
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.FTReplayBudget = exports.REPLAY_KEY_FRAME_BURST_BYTES = void 0;
15
+ var WINDOW_MS = 60000;
16
+ var THROTTLED_CAPTURE_INTERVAL_MS = 2000;
17
+ exports.REPLAY_KEY_FRAME_BURST_BYTES = 100 * 1024;
18
+ /** Rolling image budget. Segment and pointer bytes intentionally remain outside this controller. */
19
+ var FTReplayBudget = /** @class */ (function () {
20
+ function FTReplayBudget(policy) {
21
+ this.policy = policy;
22
+ this.entries = [];
23
+ this.burstKeys = [];
24
+ this.pressure = 'normal';
25
+ }
26
+ FTReplayBudget.prototype.reset = function () {
27
+ this.entries = [];
28
+ this.lastCaptureAttempt = undefined;
29
+ this.burstKeys = [];
30
+ this.pressure = 'normal';
31
+ };
32
+ FTReplayBudget.prototype.decide = function (timestamp, priorityKey) {
33
+ var used = this.usedBytes(timestamp);
34
+ var ratio = used / this.policy.maxBytesPerMinute;
35
+ this.updatePressure(ratio);
36
+ var hasBurst = priorityKey !== undefined && !this.burstKeys.includes(priorityKey);
37
+ if (ratio >= 1 && !hasBurst)
38
+ return this.decision(false, 0, used, hasBurst, 'budget');
39
+ if (this.policy.adaptiveCapture
40
+ && this.pressure !== 'normal'
41
+ && this.lastCaptureAttempt !== undefined
42
+ && timestamp - this.lastCaptureAttempt < THROTTLED_CAPTURE_INTERVAL_MS
43
+ && !hasBurst) {
44
+ return this.decision(false, 0, used, hasBurst, 'throttle');
45
+ }
46
+ this.lastCaptureAttempt = timestamp;
47
+ var normalRemaining = Math.max(0, this.policy.maxBytesPerMinute - used);
48
+ var available = normalRemaining + (hasBurst ? exports.REPLAY_KEY_FRAME_BURST_BYTES : 0);
49
+ var frameLimit = hasBurst
50
+ ? Math.min(Math.max(this.policy.maxFrameBytes, exports.REPLAY_KEY_FRAME_BURST_BYTES), available)
51
+ : Math.min(this.policy.maxFrameBytes, available);
52
+ return this.decision(frameLimit >= 1024, frameLimit, used, hasBurst, frameLimit >= 1024 ? undefined : 'budget');
53
+ };
54
+ FTReplayBudget.prototype.record = function (timestamp, byteSize, priorityKey) {
55
+ if (!Number.isFinite(byteSize) || byteSize <= 0)
56
+ return;
57
+ this.prune(timestamp);
58
+ this.entries.push({ timestamp: timestamp, byteSize: Math.round(byteSize) });
59
+ if (priorityKey && !this.burstKeys.includes(priorityKey)) {
60
+ this.burstKeys.push(priorityKey);
61
+ if (this.burstKeys.length > 64)
62
+ this.burstKeys.shift();
63
+ }
64
+ };
65
+ FTReplayBudget.prototype.usedBytes = function (timestamp) {
66
+ this.prune(timestamp);
67
+ return this.entries.reduce(function (total, entry) { return total + entry.byteSize; }, 0);
68
+ };
69
+ FTReplayBudget.prototype.prune = function (timestamp) {
70
+ var cutoff = timestamp - WINDOW_MS;
71
+ while (this.entries.length > 0 && this.entries[0].timestamp <= cutoff)
72
+ this.entries.shift();
73
+ };
74
+ FTReplayBudget.prototype.decision = function (allowed, maxFrameBytes, usedBytes, priority, reason) {
75
+ var degraded = this.policy.adaptiveCapture
76
+ && (this.pressure === 'degraded' || this.pressure === 'paused');
77
+ return __assign({ allowed: allowed, compressionQuality: degraded
78
+ ? Math.max(0.25, Math.round(this.policy.compressionQuality * 0.75 * 100) / 100)
79
+ : this.policy.compressionQuality, maxImageDimension: degraded
80
+ ? Math.min(this.policy.maxImageDimension, Math.max(240, Math.floor(this.policy.maxImageDimension * 0.75)))
81
+ : this.policy.maxImageDimension, maxFrameBytes: Math.max(0, Math.floor(maxFrameBytes)), usedBytes: usedBytes, priority: priority }, (reason ? { reason: reason } : {}));
82
+ };
83
+ FTReplayBudget.prototype.updatePressure = function (ratio) {
84
+ if (!this.policy.adaptiveCapture) {
85
+ this.pressure = 'normal';
86
+ return;
87
+ }
88
+ if (ratio >= 1) {
89
+ this.pressure = 'paused';
90
+ return;
91
+ }
92
+ if (ratio >= 0.9) {
93
+ this.pressure = 'degraded';
94
+ return;
95
+ }
96
+ if (this.pressure === 'paused' || this.pressure === 'degraded') {
97
+ if (ratio >= 0.8) {
98
+ this.pressure = 'degraded';
99
+ return;
100
+ }
101
+ }
102
+ if (ratio >= 0.75) {
103
+ this.pressure = 'throttled';
104
+ return;
105
+ }
106
+ if (this.pressure === 'throttled' && ratio >= 0.65)
107
+ return;
108
+ this.pressure = 'normal';
109
+ };
110
+ return FTReplayBudget;
111
+ }());
112
+ exports.FTReplayBudget = FTReplayBudget;
113
+ //# sourceMappingURL=replay-budget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-budget.js","sourceRoot":"","sources":["../../../../../src/core/replay-budget.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,IAAM,SAAS,GAAG,KAAM,CAAC;AACzB,IAAM,6BAA6B,GAAG,IAAK,CAAC;AAC/B,QAAA,4BAA4B,GAAG,GAAG,GAAG,IAAI,CAAC;AAiBvD,oGAAoG;AACpG;IAME,wBAA6B,MAAmC;QAAnC,WAAM,GAAN,MAAM,CAA6B;QALxD,YAAO,GAA0B,EAAE,CAAC;QAEpC,cAAS,GAAa,EAAE,CAAC;QACzB,aAAQ,GAAmD,QAAQ,CAAC;IAET,CAAC;IAEpE,8BAAK,GAAL;QACE,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QACpB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,+BAAM,GAAN,UAAO,SAAiB,EAAE,WAAoB;QAC5C,IAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QACvC,IAAM,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC;QACnD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAM,QAAQ,GAAG,WAAW,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACpF,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACtF,IACE,IAAI,C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AAI,CAAC,QAAQ,GAAG,UAAU,CAAC;gBAC3B,OAAO;YACT,CAAC;QACH,CAAC;QACD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC;YAC5B,OAAO;QACT,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ,KAAK,WAAW,IAAI,KAAK,IAAI,IAAI;YAAE,OAAO;QAC3D,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IACH,qBAAC;AAAD,CAAC,AAvHD,IAuHC;AAvHY,wCAAc"}
@@ -0,0 +1,36 @@
1
+ export type FTReplaySkipReason = 'dedupe' | 'approx_static' | 'throttle' | 'budget' | 'busy' | 'error';
2
+ export type FTReplayDiagnosticEvent = {
3
+ type: 'capture_attempt';
4
+ timestamp: number;
5
+ usedBytes: number;
6
+ maxBytesPerMinute: number;
7
+ } | {
8
+ type: 'capture_skipped';
9
+ timestamp: number;
10
+ reason: FTReplaySkipReason;
11
+ } | {
12
+ type: 'image_saved';
13
+ timestamp: number;
14
+ byteSize: number;
15
+ width: number;
16
+ height: number;
17
+ mimeType?: string;
18
+ priority: boolean;
19
+ byteSizeSource: 'native' | 'frame_limit_estimate';
20
+ } | {
21
+ type: 'segment_encoded';
22
+ timestamp: number;
23
+ byteSize: number;
24
+ recordCount: number;
25
+ pointerRecordCount: number;
26
+ hasImage: boolean;
27
+ } | {
28
+ type: 'pointer_received';
29
+ timestamp: number;
30
+ eventType: 'down' | 'up' | 'move';
31
+ } | {
32
+ type: 'replay_stopped';
33
+ timestamp: number;
34
+ };
35
+ export declare function replayUtf8ByteLength(value: string): number;
36
+ //# sourceMappingURL=replay-diagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-diagnostics.d.ts","sourceRoot":"","sources":["../../../../../src/core/replay-diagnostics.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,eAAe,GACf,UAAU,GACV,QAAQ,GACR,MAAM,GACN,OAAO,CAAC;AAEZ,MAAM,MAAM,uBAAuB,GAC/B;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,GAC5F;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,GAC1E;IACA,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,QAAQ,GAAG,sBAAsB,CAAC;CACnD,GACC;IACA,IAAI,EAAE,iBAAiB,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;CACnB,GACC;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAA;CAAE,GAClF;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAmBlD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAiB1D"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.emitReplayDiagnostic = emitReplayDiagnostic;
4
+ exports.replayUtf8ByteLength = replayUtf8ByteLength;
5
+ /** @internal Benchmark-only observer hook. Production builds leave it unset. */
6
+ function emitReplayDiagnostic(event) {
7
+ var observer = globalThis.__FT_COCOS_REPLAY_BENCHMARK_OBSERVER__;
8
+ if (typeof observer !== 'function')
9
+ return;
10
+ try {
11
+ observer(event);
12
+ }
13
+ catch (_a) {
14
+ // Diagnostics must never affect capture, storage, or upload behavior.
15
+ }
16
+ }
17
+ function replayUtf8ByteLength(value) {
18
+ var bytes = 0;
19
+ for (var index = 0; index < value.length; index += 1) {
20
+ var code = value.charCodeAt(index);
21
+ if (code < 0x80)
22
+ bytes += 1;
23
+ else if (code < 0x800)
24
+ bytes += 2;
25
+ else if (code >= 0xd800 && code <= 0xdbff && index + 1 < value.length) {
26
+ var low = value.charCodeAt(index + 1);
27
+ if (low >= 0xdc00 && low <= 0xdfff) {
28
+ bytes += 4;
29
+ index += 1;
30
+ }
31
+ else {
32
+ bytes += 3;
33
+ }
34
+ }
35
+ else
36
+ bytes += 3;
37
+ }
38
+ return bytes;
39
+ }
40
+ //# sourceMappingURL=replay-diagnostics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-diagnostics.js","sourceRoot":"","sources":["../../../../../src/core/replay-diagnostics.ts"],"names":[],"mappings":";;AAuCA,oDAQC;AAED,oDAiBC;AA5BD,gFAAgF;AAChF,SAAgB,oBAAoB,CAAC,KAA8B;IACjE,IAAM,QAAQ,GAAI,UAAuC,CAAC,sCAAsC,CAAC;IACjG,IAAI,OAAO,QAAQ,KAAK,UAAU;QAAE,OAAO;IAC3C,IAAI,CAAC;QACH,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;IAAC,WAAM,CAAC;QACP,sEAAsE;IACxE,CAAC;AACH,CAAC;AAED,SAAgB,oBAAoB,CAAC,KAAa;IAChD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACrD,IAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,IAAI,GAAG,IAAI;YAAE,KAAK,IAAI,CAAC,CAAC;aACvB,IAAI,IAAI,GAAG,KAAK;YAAE,KAAK,IAAI,CAAC,CAAC;aAC7B,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,IAAI,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC;YACtE,IAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YACxC,IAAI,GAAG,IAAI,MAAM,IAAI,GAAG,IAAI,MAAM,EAAE,CAAC;gBACnC,KAAK,IAAI,CAAC,CAAC;gBACX,KAAK,IAAI,CAAC,CAAC;YACb,CAAC;iBAAM,CAAC;gBACN,KAAK,IAAI,CAAC,CAAC;YACb,CAAC;QACH,CAAC;;YAAM,KAAK,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { FTRUMContext } from './types.js';
2
+ export interface FTReplayImageRecord {
3
+ context: FTRUMContext;
4
+ resourceId: string;
5
+ width: number;
6
+ height: number;
7
+ mimeType?: `image/${string}`;
8
+ timestamp: number;
9
+ contextChanged: boolean;
10
+ pointerEvents?: FTReplayPointerRecord[];
11
+ }
12
+ export interface FTReplayPointerRecord {
13
+ eventType: 'down' | 'up' | 'move';
14
+ pointerId: number;
15
+ x: number;
16
+ y: number;
17
+ timestamp: number;
18
+ }
19
+ export interface FTReplayPointerRecords {
20
+ context: FTRUMContext;
21
+ pointerEvents: FTReplayPointerRecord[];
22
+ }
23
+ export declare function encodeReplayImageRecord(input: FTReplayImageRecord): {
24
+ segment: string;
25
+ recordCount: number;
26
+ };
27
+ export declare function encodeReplayPointerRecords(input: FTReplayPointerRecords): {
28
+ segment: string;
29
+ recordCount: number;
30
+ };
31
+ //# sourceMappingURL=replay-encoding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-encoding.d.ts","sourceRoot":"","sources":["../../../../../src/core/replay-encoding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,YAAY,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,YAAY,CAAC;IACtB,aAAa,EAAE,qBAAqB,EAAE,CAAC;CACxC;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,mBAAmB,GAAG;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,CAiCA;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,sBAAsB,GAAG;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB,CAMA"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.encodeReplayImageRecord = encodeReplayImageRecord;
15
+ exports.encodeReplayPointerRecords = encodeReplayPointerRecords;
16
+ function encodeReplayImageRecord(input) {
17
+ var _a;
18
+ var wireframe = __assign(__assign({ id: 1, type: 'image', x: 0, y: 0, width: input.width, height: input.height, base64: null, border: null, clip: null, isEmpty: false }, (input.mimeType ? { mimeType: input.mimeType } : {})), { resourceId: input.resourceId, shapeStyle: null });
19
+ var records = [];
20
+ if (input.contextChanged) {
21
+ records.push({ type: 4, data: { width: input.width, height: input.height }, timestamp: input.timestamp }, { type: 6, data: { has_focus: true }, timestamp: input.timestamp });
22
+ }
23
+ records.push({
24
+ type: 10,
25
+ data: { wireframes: [wireframe] },
26
+ timestamp: input.timestamp,
27
+ });
28
+ records.push.apply(records, ((_a = input.pointerEvents) === null || _a === void 0 ? void 0 : _a.map(pointerRecord)) || []);
29
+ return {
30
+ segment: encodeEnvelope(input.context, records),
31
+ recordCount: records.length,
32
+ };
33
+ }
34
+ function encodeReplayPointerRecords(input) {
35
+ var records = input.pointerEvents.map(pointerRecord);
36
+ return {
37
+ segment: encodeEnvelope(input.context, records),
38
+ recordCount: records.length,
39
+ };
40
+ }
41
+ function pointerRecord(pointer) {
42
+ return {
43
+ type: 11,
44
+ data: {
45
+ source: 9,
46
+ pointerEventType: pointer.eventType,
47
+ pointerType: 'touch',
48
+ pointerId: pointer.pointerId,
49
+ x: pointer.x,
50
+ y: pointer.y,
51
+ },
52
+ timestamp: pointer.timestamp,
53
+ };
54
+ }
55
+ function encodeEnvelope(context, records) {
56
+ return JSON.stringify({
57
+ records: records,
58
+ applicationID: context.applicationId,
59
+ sessionID: context.sessionId,
60
+ viewID: context.viewId,
61
+ });
62
+ }
63
+ //# sourceMappingURL=replay-encoding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-encoding.js","sourceRo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AAA,KAAK,CAAC,aAAa,0CAAE,GAAG,CAAC,aAAa,CAAC,KAAI,EAAE,EAAE;IAC/D,OAAO;QACL,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC;QAC/C,WAAW,EAAE,OAAO,CAAC,MAAM;KAC5B,CAAC;AACJ,CAAC;AAED,SAAgB,0BAA0B,CAAC,KAA6B;IAItE,IAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACvD,OAAO;QACL,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC;QAC/C,WAAW,EAAE,OAAO,CAAC,MAAM;KAC5B,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,OAA8B;IACnD,OAAO;QACL,IAAI,EAAE,EAAE;QACR,IAAI,EAAE;YACJ,MAAM,EAAE,CAAC;YACT,gBAAgB,EAAE,OAAO,CAAC,SAAS;YACnC,WAAW,EAAE,OAAO;YACpB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,CAAC,EAAE,OAAO,CAAC,CAAC;YACZ,CAAC,EAAE,OAAO,CAAC,CAAC;SACb;QACD,SAAS,EAAE,OAAO,CAAC,SAAS;KAC7B,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,OAAqB,EAAE,OAAkB;IAC/D,OAAO,IAAI,CAAC,SAAS,CAAC;QACpB,OAAO,SAAA;QACP,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { FTCapturedFrame, FTStoredFrame } from './types.js';
2
+ /** Copies pixels into native-owned memory; all file operations run off the game thread. */
3
+ export declare function persistReplayFrame(frame: FTCapturedFrame, fingerprint: string, writablePath: string): Promise<FTStoredFrame>;
4
+ export declare function disposeReplayFrame(frame: FTStoredFrame): Promise<void>;
5
+ //# sourceMappingURL=replay-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-file.d.ts","sourceRoot":"","sources":["../../../../../src/core/replay-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAwBjE,2FAA2F;AAC3F,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,eAAe,EACtB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,aAAa,CAAC,CAKxB;AAED,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAG5E"}
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.persistReplayFrame = persistReplayFrame;
40
+ exports.disposeReplayFrame = disposeReplayFrame;
41
+ var sequence = 0;
42
+ function bridge() {
43
+ var value = globalThis.__ftCocosReplayFile;
44
+ if (!value)
45
+ throw new Error('Rebuild the native project with the Cocos SDK extension to enable asynchronous Replay storage');
46
+ return value;
47
+ }
48
+ function waitForFile(expected) {
49
+ return __awaiter(this, void 0, void 0, function () {
50
+ var status_1;
51
+ return __generator(this, function (_a) {
52
+ switch (_a.label) {
53
+ case 0: return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, 16); })];
54
+ case 1:
55
+ _a.sent();
56
+ status_1 = bridge().poll();
57
+ if (status_1 === expected)
58
+ return [2 /*return*/];
59
+ if (status_1 !== 'pending')
60
+ throw new Error("Replay file operation failed: ".concat(status_1));
61
+ _a.label = 2;
62
+ case 2: return [3 /*break*/, 0];
63
+ case 3: return [2 /*return*/];
64
+ }
65
+ });
66
+ });
67
+ }
68
+ /** Copies pixels into native-owned memory; all file operations run off the game thread. */
69
+ function persistReplayFrame(frame, fingerprint, writablePath) {
70
+ return __awaiter(this, void 0, void 0, function () {
71
+ var path;
72
+ return __generator(this, function (_a) {
73
+ switch (_a.label) {
74
+ case 0:
75
+ path = "".concat(writablePath, "cocos-sdk-replay-").concat(Date.now(), "-").concat(++sequence, "-").concat(fingerprint, ".rgba");
76
+ if (!bridge().write(frame.rgba, path))
77
+ throw new Error('Replay file writer is busy');
78
+ return [4 /*yield*/, waitForFile('written')];
79
+ case 1:
80
+ _a.sent();
81
+ return [2 /*return*/, { path: path, width: frame.width, height: frame.height, timestamp: frame.timestamp, fingerprint: fingerprint }];
82
+ }
83
+ });
84
+ });
85
+ }
86
+ function disposeReplayFrame(frame) {
87
+ return __awaiter(this, void 0, void 0, function () {
88
+ return __generator(this, function (_a) {
89
+ switch (_a.label) {
90
+ case 0:
91
+ if (!bridge().remove(frame.path))
92
+ throw new Error('Replay file writer is busy or the frame has expired');
93
+ return [4 /*yield*/, waitForFile('removed')];
94
+ case 1:
95
+ _a.sent();
96
+ return [2 /*return*/];
97
+ }
98
+ });
99
+ });
100
+ }
101
+ //# sourceMappingURL=replay-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-file.js","sourceRoot":"","sources":["../../../../../src/core/replay-file.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,gDASC;AAED,gDAGC;AA/BD,IAAI,QAAQ,GAAG,CAAC,CAAC;AACjB,SAAS,MAAM;IACb,IAAM,KAAK,GAAI,UAAsE,CAAC,mBAAmB,CAAC;IAC1G,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,+FAA+F,CAAC,CAAC;IAC7H,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAe,WAAW,C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els from bottom-left to top-left row order. */
2
+ export declare function flipRgbaRows(bytes: Uint8Array, width: number, height: number): void;
3
+ //# sourceMappingURL=replay-pixels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-pixels.d.ts","sourceRoot":"","sources":["../../../../../src/core/replay-pixels.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAUnF"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.flipRgbaRows = flipRgbaRows;
4
+ /** Converts tightly packed RGBA pixels from bottom-left to top-left row order. */
5
+ function flipRgbaRows(bytes, width, height) {
6
+ var rowSize = width * 4;
7
+ var swap = new Uint8Array(rowSize);
8
+ for (var top_1 = 0, bottom = height - 1; top_1 < bottom; top_1 += 1, bottom -= 1) {
9
+ var topOffset = top_1 * rowSize;
10
+ var bottomOffset = bottom * rowSize;
11
+ swap.set(bytes.subarray(topOffset, topOffset + rowSize));
12
+ bytes.copyWithin(topOffset, bottomOffset, bottomOffset + rowSize);
13
+ bytes.set(swap, bottomOffset);
14
+ }
15
+ }
16
+ //# sourceMappingURL=replay-pixels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-pixels.js","sourceRoot":"","sources":["../../../../../src/core/replay-pixels.ts"],"names":[],"mappings":";;AACA,oCAUC;AAXD,kFAAkF;AAClF,SAAgB,YAAY,CAAC,KAAiB,EAAE,KAAa,EAAE,MAAc;IAC3E,IAAM,OAAO,GAAG,KAAK,GAAG,CAAC,CAAC;IAC1B,IAAM,IAAI,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;IACrC,KAAK,IAAI,KAAG,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,EAAE,KAAG,GAAG,MAAM,EAAE,KAAG,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC,EAAE,CAAC;QAC3E,IAAM,SAAS,GAAG,KAAG,GAAG,OAAO,CAAC;QAChC,IAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;QACtC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC;QACzD,KAAK,CAAC,UAAU,CAAC,SAAS,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC;QAClE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { FTReplayPrivacyMode } from './types.js';
2
+ /** Shape of the ReplayPrivacy editor script installed in the project's assets. */
3
+ interface ReplayPrivacyComponent {
4
+ node: unknown;
5
+ enabledInHierarchy: boolean;
6
+ isValid: boolean;
7
+ readonly replayPrivacyMode: 'mask' | 'hide';
8
+ }
9
+ /** Resolve rules afresh for each capture, including newly instantiated prefabs. */
10
+ export declare function collectReplayPrivacyNodes(overrides: ReadonlyMap<unknown, FTReplayPrivacyMode>, components: ReplayPrivacyComponent[], editBoxes: {
11
+ node: unknown;
12
+ }[]): Map<unknown, FTReplayPrivacyMode>;
13
+ export {};
14
+ //# sourceMappingURL=replay-privacy-nodes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-privacy-nodes.d.ts","sourceRoot":"","sources":["../../../../../src/core/replay-privacy-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,kFAAkF;AAClF,UAAU,sBAAsB;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,kBAAkB,EAAE,OAAO,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC;CAC7C;AAED,mFAAmF;AACnF,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,WAAW,CAAC,OAAO,EAAE,mBAAmB,CAAC,EACpD,UAAU,EAAE,sBAAsB,EAAE,EACpC,SAAS,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,EAAE,GAC7B,GAAG,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAUnC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.collectReplayPrivacyNodes = collectReplayPrivacyNodes;
4
+ /** Resolve rules afresh for each capture, including newly instantiated prefabs. */
5
+ function collectReplayPrivacyNodes(overrides, components, editBoxes) {
6
+ var nodes = new Map(overrides);
7
+ components.forEach(function (component) {
8
+ if (!component.isValid || !component.enabledInHierarchy || nodes.has(component.node))
9
+ return;
10
+ nodes.set(component.node, component.replayPrivacyMode === 'hide' ? 'hide' : 'mask');
11
+ });
12
+ editBoxes.forEach(function (editBox) {
13
+ if (!nodes.has(editBox.node))
14
+ nodes.set(editBox.node, 'mask');
15
+ });
16
+ return nodes;
17
+ }
18
+ //# sourceMappingURL=replay-privacy-nodes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-privacy-nodes.js","sourceRoot":"","sources":["../../../../../src/core/replay-privacy-nodes.ts"],"names":[],"mappings":";;AAWA,8DAcC;AAfD,mFAAmF;AACnF,SAAgB,yBAAyB,CACvC,SAAoD,EACpD,UAAoC,EACpC,SAA8B;IAE9B,IAAM,KAAK,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IACjC,UAAU,CAAC,OAAO,CAAC,UAAC,SAAS;QAC3B,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,kBAAkB,IAAI,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC;YAAE,OAAO;QAC7F,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,iBAAiB,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;IACH,SAAS,CAAC,OAAO,CAAC,UAAC,OAAO;QACxB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;YAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { FTPrivacyRegion } from './types.js';
2
+ interface FTPoint {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ interface FTRect {
7
+ x: number;
8
+ y: number;
9
+ width: number;
10
+ height: number;
11
+ }
12
+ /** Projects a world-space node rectangle into a top-left-origin Replay frame. */
13
+ export declare function projectPrivacyBounds(bounds: FTRect, frameWidth: number, frameHeight: number, screenWidth: number, screenHeight: number, project: (x: number, y: number) => FTPoint | undefined): Omit<FTPrivacyRegion, 'mode'> | undefined;
14
+ export {};
15
+ //# sourceMappingURL=replay-privacy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-privacy.d.ts","sourceRoot":"","sources":["../../../../../src/core/replay-privacy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,UAAU,OAAO;IACf,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,UAAU,MAAM;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,GACrD,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,GAAG,SAAS,CA6B3C"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.projectPrivacyBounds = projectPrivacyBounds;
4
+ /** Projects a world-space node rectangle into a top-left-origin Replay frame. */
5
+ function projectPrivacyBounds(bounds, frameWidth, frameHeight, screenWidth, screenHeight, project) {
6
+ if ([frameWidth, frameHeight, screenWidth, screenHeight].some(function (size) { return !Number.isFinite(size) || size <= 0; })) {
7
+ return undefined;
8
+ }
9
+ var points = [
10
+ project(bounds.x, bounds.y),
11
+ project(bounds.x + bounds.width, bounds.y),
12
+ project(bounds.x, bounds.y + bounds.height),
13
+ project(bounds.x + bounds.width, bounds.y + bounds.height),
14
+ ];
15
+ if (points.some(function (point) { return !point || !Number.isFinite(point.x) || !Number.isFinite(point.y); })) {
16
+ return undefined;
17
+ }
18
+ var projected = points;
19
+ var minimumX = Math.min.apply(Math, projected.map(function (point) { return point.x; }));
20
+ var maximumX = Math.max.apply(Math, projected.map(function (point) { return point.x; }));
21
+ var minimumY = Math.min.apply(Math, projected.map(function (point) { return point.y; }));
22
+ var maximumY = Math.max.apply(Math, projected.map(function (point) { return point.y; }));
23
+ // A native projection can reject its input without throwing and return a
24
+ // zero vector. Do not treat its zero-area result as a valid privacy mask.
25
+ if (maximumX <= minimumX || maximumY <= minimumY)
26
+ return undefined;
27
+ var scaleX = frameWidth / screenWidth;
28
+ var scaleY = frameHeight / screenHeight;
29
+ return {
30
+ x: minimumX * scaleX,
31
+ y: (screenHeight - maximumY) * scaleY,
32
+ width: (maximumX - minimumX) * scaleX,
33
+ height: (maximumY - minimumY) * scaleY,
34
+ };
35
+ }
36
+ //# sourceMappingURL=replay-privacy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-privacy.js","s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