@paulirish/trace_engine 0.0.12 → 0.0.14

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 (118) hide show
  1. package/core/platform/{array-utilities.js → ArrayUtilities.js} +1 -1
  2. package/core/platform/ArrayUtilities.js.map +1 -0
  3. package/core/platform/{brand.js → Brand.js} +1 -1
  4. package/core/platform/{brand.js.map → Brand.js.map} +1 -1
  5. package/core/platform/{dom-utilities.js → DOMUtilities.js} +1 -1
  6. package/core/platform/DOMUtilities.js.map +1 -0
  7. package/core/platform/{date-utilities.js → DateUtilities.js} +1 -1
  8. package/core/platform/DateUtilities.js.map +1 -0
  9. package/core/platform/DevToolsPath.d.ts +1 -1
  10. package/core/platform/DevToolsPath.js.map +1 -1
  11. package/core/platform/{keyboard-utilities.js → KeyboardUtilities.js} +1 -1
  12. package/core/platform/KeyboardUtilities.js.map +1 -0
  13. package/core/platform/{map-utilities.js → MapUtilities.js} +1 -1
  14. package/core/platform/MapUtilities.js.map +1 -0
  15. package/core/platform/{number-utilities.js → NumberUtilities.js} +1 -1
  16. package/core/platform/NumberUtilities.js.map +1 -0
  17. package/core/platform/{promise-utilities.js → PromiseUtilities.js} +1 -1
  18. package/core/platform/PromiseUtilities.js.map +1 -0
  19. package/core/platform/{set-utilities.js → SetUtilities.js} +1 -1
  20. package/core/platform/SetUtilities.js.map +1 -0
  21. package/core/platform/{string-utilities.js → StringUtilities.js} +4 -4
  22. package/core/platform/StringUtilities.js.map +1 -0
  23. package/core/platform/Timing.d.ts +1 -1
  24. package/core/platform/Timing.js.map +1 -1
  25. package/core/platform/{typescript-utilities.js → TypescriptUtilities.js} +1 -1
  26. package/core/platform/TypescriptUtilities.js.map +1 -0
  27. package/core/platform/UIString.d.ts +1 -1
  28. package/core/platform/UIString.js.map +1 -1
  29. package/core/platform/devtools_entrypoint-bundle-typescript-tsconfig.json +1 -2
  30. package/core/platform/platform-tsconfig.json +12 -18
  31. package/core/platform/platform.d.ts +12 -13
  32. package/core/platform/platform.js +16 -17
  33. package/core/platform/platform.js.map +1 -1
  34. package/generated/protocol.d.ts +90 -29
  35. package/models/cpu_profile/cpu_profile-tsconfig.json +1 -2
  36. package/models/cpu_profile/devtools_entrypoint-bundle-typescript-tsconfig.json +1 -2
  37. package/models/trace/EntriesFilter.d.ts +4 -0
  38. package/models/trace/EntriesFilter.js +29 -6
  39. package/models/trace/EntriesFilter.js.map +1 -1
  40. package/models/trace/ModelImpl.d.ts +3 -0
  41. package/models/trace/ModelImpl.js +10 -2
  42. package/models/trace/ModelImpl.js.map +1 -1
  43. package/models/trace/Processor.d.ts +3 -1
  44. package/models/trace/Processor.js +50 -5
  45. package/models/trace/Processor.js.map +1 -1
  46. package/models/trace/TracingManager.js.map +1 -1
  47. package/models/trace/devtools_entrypoint-bundle-typescript-tsconfig.json +1 -2
  48. package/models/trace/extras/FetchNodes.d.ts +10 -3
  49. package/models/trace/extras/FetchNodes.js +14 -1
  50. package/models/trace/extras/FetchNodes.js.map +1 -1
  51. package/models/trace/extras/devtools_entrypoint-bundle-typescript-tsconfig.json +1 -2
  52. package/models/trace/extras/extras-tsconfig.json +1 -2
  53. package/models/trace/handlers/NetworkRequestsHandler.js +5 -0
  54. package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
  55. package/models/trace/handlers/RendererHandler.js +2 -1
  56. package/models/trace/handlers/RendererHandler.js.map +1 -1
  57. package/models/trace/handlers/devtools_entrypoint-bundle-typescript-tsconfig.json +1 -2
  58. package/models/trace/handlers/handlers-tsconfig.json +1 -2
  59. package/models/trace/helpers/devtools_entrypoint-bundle-typescript-tsconfig.json +1 -2
  60. package/models/trace/helpers/helpers-tsconfig.json +1 -2
  61. package/models/trace/insights/InsightRunners.d.ts +1 -0
  62. package/models/trace/insights/InsightRunners.js +5 -0
  63. package/models/trace/insights/InsightRunners.js.map +1 -0
  64. package/models/trace/insights/RenderBlocking.d.ts +6 -0
  65. package/models/trace/insights/RenderBlocking.js +42 -0
  66. package/models/trace/insights/RenderBlocking.js.map +1 -0
  67. package/models/trace/insights/bundle-tsconfig.json +1 -0
  68. package/models/trace/insights/devtools_entrypoint-bundle-typescript-tsconfig.json +43 -0
  69. package/models/trace/insights/insights-tsconfig.json +45 -0
  70. package/models/trace/insights/insights.d.ts +2 -0
  71. package/models/trace/insights/insights.js +6 -0
  72. package/models/trace/insights/insights.js.map +1 -0
  73. package/models/trace/insights/types.d.ts +45 -0
  74. package/models/trace/insights/types.js +8 -0
  75. package/models/trace/insights/types.js.map +1 -0
  76. package/models/trace/root-causes/devtools_entrypoint-bundle-typescript-tsconfig.json +1 -2
  77. package/models/trace/root-causes/root-causes-tsconfig.json +1 -2
  78. package/models/trace/trace-tsconfig.json +4 -2
  79. package/models/trace/trace.d.ts +2 -1
  80. package/models/trace/trace.js +2 -1
  81. package/models/trace/trace.js.map +1 -1
  82. package/models/trace/types/Timing.js +0 -3
  83. package/models/trace/types/Timing.js.map +1 -1
  84. package/models/trace/types/TraceEvents.d.ts +24 -0
  85. package/models/trace/types/TraceEvents.js.map +1 -1
  86. package/models/trace/types/devtools_entrypoint-bundle-typescript-tsconfig.json +1 -2
  87. package/models/trace/types/types-tsconfig.json +1 -2
  88. package/package.json +6 -8
  89. package/LICENSE +0 -27
  90. package/PAUL.readme.md +0 -5
  91. package/README.md +0 -156
  92. package/analyze-trace.mjs +0 -184
  93. package/core/platform/array-utilities.js.map +0 -1
  94. package/core/platform/date-utilities.js.map +0 -1
  95. package/core/platform/dcheck-tsconfig.json +0 -8
  96. package/core/platform/dcheck.d.ts +0 -4
  97. package/core/platform/dcheck.js +0 -5
  98. package/core/platform/dom-utilities.js.map +0 -1
  99. package/core/platform/keyboard-utilities.js.map +0 -1
  100. package/core/platform/map-utilities.js.map +0 -1
  101. package/core/platform/number-utilities.js.map +0 -1
  102. package/core/platform/promise-utilities.js.map +0 -1
  103. package/core/platform/set-utilities.js.map +0 -1
  104. package/core/platform/string-utilities.js.map +0 -1
  105. package/core/platform/typescript-utilities.js.map +0 -1
  106. package/test/invalid-animation-events.json.gz +0 -0
  107. package/test/test-trace-engine.mjs +0 -52
  108. /package/core/platform/{array-utilities.d.ts → ArrayUtilities.d.ts} +0 -0
  109. /package/core/platform/{brand.d.ts → Brand.d.ts} +0 -0
  110. /package/core/platform/{dom-utilities.d.ts → DOMUtilities.d.ts} +0 -0
  111. /package/core/platform/{date-utilities.d.ts → DateUtilities.d.ts} +0 -0
  112. /package/core/platform/{keyboard-utilities.d.ts → KeyboardUtilities.d.ts} +0 -0
  113. /package/core/platform/{map-utilities.d.ts → MapUtilities.d.ts} +0 -0
  114. /package/core/platform/{number-utilities.d.ts → NumberUtilities.d.ts} +0 -0
  115. /package/core/platform/{promise-utilities.d.ts → PromiseUtilities.d.ts} +0 -0
  116. /package/core/platform/{set-utilities.d.ts → SetUtilities.d.ts} +0 -0
  117. /package/core/platform/{string-utilities.d.ts → StringUtilities.d.ts} +0 -0
  118. /package/core/platform/{typescript-utilities.d.ts → TypescriptUtilities.d.ts} +0 -0
@@ -36,8 +36,7 @@
36
36
  "../../../../../../../front_end/legacy/legacy-defs.d.ts",
37
37
  "../../../../../../../front_end/global_typings/global_defs.d.ts",
38
38
  "../../../../../../../front_end/global_typings/request_idle_callback.d.ts",
39
- "../../../../../../../node_modules/@types/filesystem/index.d.ts",
40
- "../../../../../../../node_modules/@webgpu/types/dist/index.d.ts"
39
+ "../../../../../../../node_modules/@types/filesystem/index.d.ts"
41
40
  ],
42
41
  "references": [
43
42
  {
package/package.json CHANGED
@@ -1,16 +1,14 @@
1
1
  {
2
2
  "name": "@paulirish/trace_engine",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "",
5
- "main": "models/trace/trace.js",
6
- "scripts": {
7
- "test": "node test/test-trace-engine.mjs",
8
- "prepublishOnly": "npm test"
9
- },
10
5
  "type": "module",
11
6
  "keywords": [],
12
7
  "author": "",
13
8
  "license": "BSD-3-Clause",
14
- "dependencies": {},
15
- "devDependencies": {}
9
+ "dependencies": {
10
+ },
11
+ "devDependencies": {
12
+
13
+ }
16
14
  }
package/LICENSE DELETED
@@ -1,27 +0,0 @@
1
- // Copyright 2014 The Chromium Authors. All rights reserved.
2
- //
3
- // Redistribution and use in source and binary forms, with or without
4
- // modification, are permitted provided that the following conditions are
5
- // met:
6
- //
7
- // * Redistributions of source code must retain the above copyright
8
- // notice, this list of conditions and the following disclaimer.
9
- // * Redistributions in binary form must reproduce the above
10
- // copyright notice, this list of conditions and the following disclaimer
11
- // in the documentation and/or other materials provided with the
12
- // distribution.
13
- // * Neither the name of Google Inc. nor the names of its
14
- // contributors may be used to endorse or promote products derived from
15
- // this software without specific prior written permission.
16
- //
17
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/PAUL.readme.md DELETED
@@ -1,5 +0,0 @@
1
- # see readme for cmds
2
-
3
- # some types thing that might work
4
-
5
- node out/Typed/../../third_party/typescript/../../node_modules/typescript/bin/tsc -p out/Typed/gen/front_end/models/trace/trace-tsconfig.json # this then has js/map/d.ts. should be able to use for typs
package/README.md DELETED
@@ -1,156 +0,0 @@
1
- # Trace Model (NOT FOR PUBLIC CONSUMPTION)
2
-
3
- This folder contains the new trace engine that was first implemented for the Performance Insights panel and is now being repurposed as the primary trace engine that we use within DevTools.
4
-
5
- ## API quickstart
6
-
7
- ```js
8
- import * as TraceModel from '@paulirish/trace_engine';
9
-
10
- polyfillDOMRect();
11
- const processor = TraceModel.Processor.TraceProcessor.createWithAllHandlers();
12
-
13
- await processor.parse(traceEvents);
14
- console.log(processor.data)
15
- ```
16
-
17
- **Note:** in reality to run in Node, you'll need to polyfill `window.DOMRect`. 😜
18
-
19
- See the included `analyze-trace.mjs` a runnable invocation.
20
-
21
- ## Maintainer cheatsheet
22
-
23
- See also http://go/btlax
24
-
25
- #### Build, run, extract
26
-
27
- ```sh
28
- # Build devtools and prep a package
29
- scripts/trace/build-trace-engine-lib.sh
30
-
31
- # run
32
- node scripts/trace/analyze-trace.mjs test/unittests/fixtures/traces/web-dev.json.gz
33
-
34
- # test
35
- node scripts/trace/test/test-trace-engine.mjs
36
-
37
- # copy built files to $HOME/code/trace_engine
38
- scripts/trace/copy-build-trace-engine-for-publish.sh
39
- ```
40
-
41
- #### Test and publish
42
-
43
- ```sh
44
- # switch to standalone
45
- cd $HOME/code/trace_engine
46
-
47
- # test
48
- node test/test-trace-engine.mjs
49
-
50
- # bump and publish
51
- npm version v0.0.XXX # Manually determine next version
52
- npm publish --access public --dry-run
53
- npm publish --access public
54
- ```
55
-
56
- ## High level architecture
57
-
58
- ```
59
- ┌──────────────┐
60
- │ Model#parse ├───┐
61
- └──────────────┘ │
62
-
63
- ┌──────────▼──────────┐
64
- │async processor#parse│
65
- └──────────┬──────────┘
66
-
67
- ┌──────────▼────────────┐
68
- │for handler of handlers│
69
- └───┬────────────────┬──┘
70
- │ │
71
- ┌────────────────▼────┐ ┌─────▼────────────────┐
72
- │NetworkRequestHandler│ │...many more handlers │
73
- │ │ │ │
74
- │ reset() │ │ │
75
- │ initialize() │ │ │
76
- │ │ │ │
77
- │ handleEvent() │ │ │
78
- │ │ │ │
79
- │ finalize() │ │ │
80
- │ │ │ │
81
- │ data() │ │ │ │
82
- └─────────────────────┘ │ └──────────────────────┘
83
-
84
-
85
- ┌──────────────────▼─────────────────┐
86
- │const data = model.traceParsedData()│
87
- └────────────────────────────────────┘
88
- ```
89
-
90
- `Model#parse` is the entrypoint into the engine and is the public interface that consumers use to initiate tracing and to fetch data back.
91
-
92
- All the processing is done by the `Processor`. The processor contains a series of *Handlers*, each of which is responsible for parsing events of a particular category.
93
-
94
- The trace processor loops over every event in the trace and calls each handler in turn (done this way so we only loop over the trace file once, rather than doing it once-per-handler). A Handler is a file that exposes a set of methods, most importantly `handleEvent()` and `data()`. The `handleEvent` function will be called for each event in the trace, and it is up to an individual handler to do something with that event if it needs to. The `data` method should return the final data that has been parsed and generated by the handler.
95
-
96
- Once processing is done (read on for more details on how to track this), you can use the `traceParsedData()` method to fetch the result of parsing a given trace.
97
-
98
- ## Enabled handlers and creating a model
99
-
100
- At the time of writing (06 June 2023) we are midway through a migration of the Performanc Panel's trace engine from the SDK.TracingModel to the new TraceEngine. Consequently, not all of the TraceEngine's handlers are currently active, because we don't want to run expensive handlers whose data we do not yet use in the UI.
101
-
102
- Therefore, to create a model instance, we use `Model.createWithRequiredHandlersForMigration()`, which initializes a model configured correctly with the right handlers.
103
-
104
- Once the migration is done, we can swap to `Model.createWithAllHandlers()` and remove the code that enables a subset of the handlers to run.
105
-
106
- If you want to strictly control the set of handlers that are run (for example, if you only want to run one particular handler), you can initialize the model yourself and pass in the set of handlers:
107
-
108
- ```ts
109
- const model = new Model({
110
- NetworkRequestHandler: Handlers.ModelHandlers.NetworkRequestHandler,
111
- })
112
- ```
113
-
114
- ## Parsing a trace and getting data back
115
-
116
- Once you have an instance of the model, you can call the `parse` method to take a set of raw events and parse them. Once parsed, you then have to call the `traceParsedData` method, providing an index of the trace you want to have the data for. This is because any model can store a number of traces. Each trace is given an index, which starts at 0 and increments by one as a new trace is parsed.
117
-
118
- If you are managing multiple traces, you should store them in some form of indexed data structure so you can easily know which index to use to fetch any data from the model. You may delete a trace with `deleteTraceByIndex`, which will then update the indexes of all other traces too.
119
-
120
- If you need to check how many traces you have, you can call `model.size()`. The latest trace's index is therefore always `model.size() - 1`.
121
-
122
- ## Waiting for updates from the model
123
-
124
- When you call `parse` you have two options. You can `await` it, which will wait until the trace is fully parsed:
125
-
126
- ```ts
127
- await this.model.parse();
128
- ```
129
-
130
- But it's likely preferable to instead use events, to avoid blocking the UI whilst parsing is in progress. You can listen to the `ModelUpdateEvent` for updates:
131
-
132
- ```ts
133
- this.model.addEventListener(Model.ModelUpdateEvent.eventName, event => {
134
- const {data} = event as Model.ModelUpdateEvent;
135
-
136
- if (data.data === 'done') {
137
- // trace is complete
138
- const newestData = this.model.traceParsedData(this.model.size() - 1);
139
- } else {
140
- // data.data will be an object: { index: X, total: Y}, which represents how many events (X) have been processed out of a total (Y).
141
- // This can be used to show a progress bar, for example.
142
- }
143
- })
144
- ```
145
-
146
- ## The structure of the final data object
147
-
148
- The object returned from `traceParsedData()` is an object of key-value pairs where each key is the name of a handler, and the value is the data that was parsed and returned from that handler.
149
-
150
- ```ts
151
- {
152
- NetworkRequestHandler: ReturnType<typeof NetworkRequestHandler['data']>,
153
- LayoutShiftHandler: ReturnType<typeof LayoutShiftHandler['data']>,
154
- // and so on for each enabled Handler
155
- }
156
- ```
package/analyze-trace.mjs DELETED
@@ -1,184 +0,0 @@
1
- // Copyright 2023 The Chromium Authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- // Run this first:
6
- // front_end/models/trace/build-trace-engine-lib.sh
7
-
8
- /* eslint-disable rulesdir/es_modules_import */
9
- import fs from 'node:fs';
10
- import zlib from 'node:zlib';
11
-
12
- /** @typedef {import('../front_end/models/trace/trace.ts')} TraceEngine */
13
-
14
- // For types... see Connor's manual hack here:
15
- // https://github.com/GoogleChrome/lighthouse/pull/15703/files#diff-ec7e073cf0e6135d4f2af9bc04fe6100ec0df80ad1686bee2da53871be5f1a7b
16
- // and https://github.com/GoogleChrome/lighthouse/pull/15703/files#diff-6dab4507247217209f5ab0f6c343ca2b00af1300878abba81fb74d51cdfbedf9
17
-
18
- /** @type {TraceEngine} */
19
- import * as TraceEngine from './models/trace/trace.js';
20
-
21
- polyfillDOMRect();
22
-
23
- /**
24
- * @param {string} filename
25
- * @returns {Promise<TraceEngine.TraceModel>}
26
- */
27
- export async function analyzeTrace(filename) {
28
- const traceEvents = loadTraceEventsFromFile(filename);
29
- const model = TraceEngine.TraceModel.Model.createWithAllHandlers(TraceEngine.Types.Configuration.DEFAULT); // aka `fullTraceEngine`
30
- await model.parse(traceEvents);
31
- return model.traceParsedData();
32
- }
33
-
34
- // If run as CLI, parse the argv trace (or a fallback)
35
- if (import.meta.url.endsWith(process?.argv[1])) {
36
- cli();
37
- }
38
-
39
- async function cli() {
40
- const filename = process.argv.at(2);
41
- const TraceEngine = await analyzeTrace(filename);
42
- console.log(TraceEngine);
43
- }
44
-
45
-
46
- /**
47
- * @param {string=} filename
48
- * @returns TraceEvent[]
49
- */
50
- function loadTraceEventsFromFile(filename) {
51
- const fileBuf = fs.readFileSync(filename);
52
- let data;
53
- if (isGzip(fileBuf)) {
54
- data = zlib.gunzipSync(fileBuf);
55
- } else {
56
- data = fileBuf.toString('utf8');
57
- }
58
- const json = JSON.parse(data);
59
- const traceEvents = json.traceEvents ?? json;
60
- console.assert(Array.isArray(traceEvents));
61
- return traceEvents;
62
- }
63
-
64
- /**
65
- * Read the first 3 bytes looking for the gzip signature in the file header
66
- * https://www.rfc-editor.org/rfc/rfc1952#page-6
67
- * @param {ArrayBuffer} ab
68
- * @returns boolean
69
- */
70
- function isGzip(ab) {
71
- const buf = new Uint8Array(ab);
72
- if (!buf || buf.length < 3) {
73
- return false;
74
- }
75
- return buf[0] === 0x1F && buf[1] === 0x8B && buf[2] === 0x08;
76
- }
77
-
78
- function polyfillDOMRect() {
79
-
80
- // devtools assumes clientside :(
81
-
82
- // Everything else in here is the DOMRect polyfill
83
- // https://raw.githubusercontent.com/JakeChampion/polyfill-library/master/polyfills/DOMRect/polyfill.js
84
-
85
- (function (global) {
86
- function number(v) {
87
- return v === undefined ? 0 : Number(v);
88
- }
89
-
90
- function different(u, v) {
91
- return u !== v && !(isNaN(u) && isNaN(v));
92
- }
93
-
94
- function DOMRect(xArg, yArg, wArg, hArg) {
95
- let x, y, width, height, left, right, top, bottom;
96
-
97
- x = number(xArg);
98
- y = number(yArg);
99
- width = number(wArg);
100
- height = number(hArg);
101
-
102
- Object.defineProperties(this, {
103
- x: {
104
- get: function () { return x; },
105
- set: function (newX) {
106
- if (different(x, newX)) {
107
- x = newX;
108
- left = right = undefined;
109
- }
110
- },
111
- enumerable: true
112
- },
113
- y: {
114
- get: function () { return y; },
115
- set: function (newY) {
116
- if (different(y, newY)) {
117
- y = newY;
118
- top = bottom = undefined;
119
- }
120
- },
121
- enumerable: true
122
- },
123
- width: {
124
- get: function () { return width; },
125
- set: function (newWidth) {
126
- if (different(width, newWidth)) {
127
- width = newWidth;
128
- left = right = undefined;
129
- }
130
- },
131
- enumerable: true
132
- },
133
- height: {
134
- get: function () { return height; },
135
- set: function (newHeight) {
136
- if (different(height, newHeight)) {
137
- height = newHeight;
138
- top = bottom = undefined;
139
- }
140
- },
141
- enumerable: true
142
- },
143
- left: {
144
- get: function () {
145
- if (left === undefined) {
146
- left = x + Math.min(0, width);
147
- }
148
- return left;
149
- },
150
- enumerable: true
151
- },
152
- right: {
153
- get: function () {
154
- if (right === undefined) {
155
- right = x + Math.max(0, width);
156
- }
157
- return right;
158
- },
159
- enumerable: true
160
- },
161
- top: {
162
- get: function () {
163
- if (top === undefined) {
164
- top = y + Math.min(0, height);
165
- }
166
- return top;
167
- },
168
- enumerable: true
169
- },
170
- bottom: {
171
- get: function () {
172
- if (bottom === undefined) {
173
- bottom = y + Math.max(0, height);
174
- }
175
- return bottom;
176
- },
177
- enumerable: true
178
- }
179
- });
180
- }
181
-
182
- globalThis.DOMRect = DOMRect;
183
- })(globalThis);
184
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"array-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/array-utilities.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,MAAM,CAAC,MAAM,aAAa,GAAG,CAAI,KAAU,EAAE,OAAU,EAAE,SAAmB,EAAW,EAAE;IACvF,IAAI,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;QAChB,OAAO,KAAK,CAAC;KACd;IACD,IAAI,SAAS,EAAE;QACb,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC;KACb;IACD,KAAK,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE;QACpD,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;YACxB,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3B;KACF;IACD,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;IACrB,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAIF,SAAS,IAAI,CAAC,KAAe,EAAE,EAAU,EAAE,EAAU;IACnD,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IACvB,KAAK,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;IACtB,KAAK,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;AACnB,CAAC;AAED,SAAS,SAAS,CACd,KAA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AAI,CAAC;AACd,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB,CAAI,GAAQ,EAAE,SAAoC;IACzF,OAAO,YAAY,CAAC,GAAG,EAAE,SAAS,iDAA+B,CAAC;AACpE,CAAC;AAED;;;;;;;;GAQG;AAEH,MAAM,UAAU,mBAAmB,CAAI,GAAiB,EAAE,SAAoC;IAC5F,OAAO,YAAY,CAAC,GAAG,EAAE,SAAS,qCAAyB,CAAC;AAC9D,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,kCAAkC,CAAI,GAAyB;IAC7E,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACzD,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const removeElement = <T>(array: T[], element: T, firstOnly?: boolean): boolean => {\n let index = array.indexOf(element);\n if (index === -1) {\n return false;\n }\n if (firstOnly) {\n array.splice(index, 1);\n return true;\n }\n for (let i = index + 1, n = array.length; i < n; ++i) {\n if (array[i] !== element) {\n array[index++] = array[i];\n }\n }\n array.length = index;\n return true;\n};\n\ntype NumberComparator = (a: number, b: number) => number;\n\nfunction swap(array: number[], i1: number, i2: number): void {\n const temp = array[i1];\n array[i1] = array[i2];\n array[i2] = temp;\n}\n\nfunction partition(\n array: number[], comparator: NumberComparator, left: number, right: number, pivotIndex: number): number {\n const pivotValue = array[pivotIndex];\n swap(array, right, pivotIndex);\n let storeIndex = left;\n for (let i = left; i < right; ++i) {\n if (comparator(array[i], pivotValue) < 0) {\n swap(array, storeIndex, i);\n ++storeIndex;\n }\n }\n swap(array, right, storeIndex);\n return storeIndex;\n}\n\nfunction quickSortRange(\n array: number[], comparator: NumberComparator, left: number, right: number, sortWindowLeft: number,\n sortWindowRight: number): void {\n if (right <= left) {\n return;\n }\n const pivotIndex = Math.floor(Math.random() * (right - left)) + left;\n const pivotNewIndex = partition(array, comparator, left, right, pivotIndex);\n if (sortWindowLeft < pivotNewIndex) {\n quickSortRange(array, comparator, left, pivotNewIndex - 1, sortWindowLeft, sortWindowRight);\n }\n if (pivotNewIndex < sortWindowRight) {\n quickSortRange(array, comparator, pivotNewIndex + 1, right, sortWindowLeft, sortWindowRight);\n }\n}\n\nexport function sortRange(\n array: number[], comparator: NumberComparator, leftBound: number, rightBound: number, sortWindowLeft: number,\n sortWindowRight: number): number[] {\n if (leftBound === 0 && rightBound === (array.length - 1) && sortWindowLeft === 0 && sortWindowRight >= rightBound) {\n array.sort(comparator);\n } else {\n quickSortRange(array, comparator, leftBound, rightBound, sortWindowLeft, sortWindowRight);\n }\n return array;\n}\nexport const binaryIndexOf = <T, S>(array: T[], value: S, comparator: (a: S, b: T) => number): number => {\n const index = lowerBound(array, value, comparator);\n return index < array.length && comparator(value, array[index]) === 0 ? index : -1;\n};\n\nfunction mergeOrIntersect<T>(\n array1: T[], array2: T[], comparator: (a: T, b: T) => number, mergeNotIntersect: boolean): T[] {\n const result = [];\n let i = 0;\n let j = 0;\n while (i < array1.length && j < array2.length) {\n const compareValue = comparator(array1[i], array2[j]);\n if (mergeNotIntersect || !compareValue) {\n result.push(compareValue <= 0 ? array1[i] : array2[j]);\n }\n if (compareValue <= 0) {\n i++;\n }\n if (compareValue >= 0) {\n j++;\n }\n }\n if (mergeNotIntersect) {\n while (i < array1.length) {\n result.push(array1[i++]);\n }\n while (j < array2.length) {\n result.push(array2[j++]);\n }\n }\n return result;\n}\n\nexport const intersectOrdered = <T>(array1: T[], array2: T[], comparator: (a: T, b: T) => number): T[] => {\n return mergeOrIntersect(array1, array2, comparator, false);\n};\n\nexport const mergeOrdered = <T>(array1: T[], array2: T[], comparator: (a: T, b: T) => number): T[] => {\n return mergeOrIntersect(array1, array2, comparator, true);\n};\n\nexport const DEFAULT_COMPARATOR = (a: string|number, b: string|number): -1|0|1 => {\n return a < b ? -1 : (a > b ? 1 : 0);\n};\n\n/**\n * Returns the index of the element closest to the needle that is equal to or\n * greater than it. Assumes that the provided array is sorted.\n *\n * If no element is found, the right bound is returned.\n *\n * Uses the provided comparator function to determine if two items are equal or\n * if one is greater than the other. If you are working with strings or\n * numbers, you can use ArrayUtilities.DEFAULT_COMPARATOR. Otherwise, you\n * should define one that takes the needle element and an element from the\n * array and returns a positive or negative number to indicate which is greater\n * than the other.\n *\n * When specified, |left| (inclusive) and |right| (exclusive) indices\n * define the search window.\n */\nexport function lowerBound<T>(\n array: Uint32Array|Int32Array, needle: T, comparator: (needle: T, b: number) => number, left?: number,\n right?: number): number;\nexport function lowerBound<S, T>(\n array: S[], needle: T, comparator: (needle: T, b: S) => number, left?: number, right?: number): number;\nexport function lowerBound<S, T>(\n array: readonly S[], needle: T, comparator: (needle: T, b: S) => number, left?: number, right?: number): number;\nexport function lowerBound<S, T, A extends S[]>(\n array: A, needle: T, comparator: (needle: T, b: S) => number, left?: number, right?: number): number {\n let l = left || 0;\n let r = right !== undefined ? right : array.length;\n while (l < r) {\n const m = (l + r) >> 1;\n if (comparator(needle, array[m]) > 0) {\n l = m + 1;\n } else {\n r = m;\n }\n }\n return r;\n}\n\n/**\n * Returns the index of the element closest to the needle that is greater than\n * it. Assumes that the provided array is sorted.\n *\n * If no element is found, the right bound is returned.\n *\n * Uses the provided comparator function to determine if two items are equal or\n * if one is greater than the other. If you are working with strings or\n * numbers, you can use ArrayUtilities.DEFAULT_COMPARATOR. Otherwise, you\n * should define one that takes the needle element and an element from the\n * array and returns a positive or negative number to indicate which is greater\n * than the other.\n *\n * When specified, |left| (inclusive) and |right| (exclusive) indices\n * define the search window.\n */\nexport function upperBound<T>(\n array: Uint32Array, needle: T, comparator: (needle: T, b: number) => number, left?: number, right?: number): number;\nexport function upperBound<S, T>(\n array: S[], needle: T, comparator: (needle: T, b: S) => number, left?: number, right?: number): number;\nexport function upperBound<S, T, A extends S[]>(\n array: A, needle: T, comparator: (needle: T, b: S) => number, left?: number, right?: number): number {\n let l = left || 0;\n let r = right !== undefined ? right : array.length;\n while (l < r) {\n const m = (l + r) >> 1;\n if (comparator(needle, array[m]) >= 0) {\n l = m + 1;\n } else {\n r = m;\n }\n }\n return r;\n}\n\nconst enum NearestSearchStart {\n BEGINNING = 'BEGINNING',\n END = 'END',\n}\n/**\n * Obtains the first or last item in the array that satisfies the predicate function.\n * So, for example, if the array were arr = [2, 4, 6, 8, 10], and you are looking for\n * the last item arr[i] such that arr[i] < 5 you would be returned 1, because\n * array[1] is 4, the last item in the array that satisfies the\n * predicate function.\n *\n * If instead you were looking for the first item in the same array that satisfies\n * arr[i] > 5 you would be returned 2 because array[2] = 6.\n *\n * Please note: this presupposes that the array is already ordered.\n */\nfunction nearestIndex<T>(\n arr: readonly T[], predicate: (arrayItem: T) => boolean, searchStart: NearestSearchStart): number|null {\n const searchFromEnd = searchStart === NearestSearchStart.END;\n if (arr.length === 0) {\n return null;\n }\n\n let left = 0;\n let right = arr.length - 1;\n let pivot = 0;\n let matchesPredicate = false;\n let moveToTheRight = false;\n let middle = 0;\n do {\n middle = left + (right - left) / 2;\n pivot = searchFromEnd ? Math.ceil(middle) : Math.floor(middle);\n matchesPredicate = predicate(arr[pivot]);\n moveToTheRight = matchesPredicate === searchFromEnd;\n if (moveToTheRight) {\n left = Math.min(right, pivot + (left === pivot ? 1 : 0));\n } else {\n right = Math.max(left, pivot + (right === pivot ? -1 : 0));\n }\n } while (right !== left);\n\n // Special-case: the indexed item doesn't pass the predicate. This\n // occurs when none of the items in the array are a match for the\n // predicate.\n if (!predicate(arr[left])) {\n return null;\n }\n return left;\n}\n\n/**\n * Obtains the first item in the array that satisfies the predicate function.\n * So, for example, if the array was arr = [2, 4, 6, 8, 10], and you are looking for\n * the first item arr[i] such that arr[i] > 5 you would be returned 2, because\n * array[2] is 6, the first item in the array that satisfies the\n * predicate function.\n *\n * Please note: this presupposes that the array is already ordered.\n */\nexport function nearestIndexFromBeginning<T>(arr: T[], predicate: (arrayItem: T) => boolean): number|null {\n return nearestIndex(arr, predicate, NearestSearchStart.BEGINNING);\n}\n\n/**\n * Obtains the last item in the array that satisfies the predicate function.\n * So, for example, if the array was arr = [2, 4, 6, 8, 10], and you are looking for\n * the last item arr[i] such that arr[i] < 5 you would be returned 1, because\n * arr[1] is 4, the last item in the array that satisfies the\n * predicate function.\n *\n * Please note: this presupposes that the array is already ordered.\n */\n\nexport function nearestIndexFromEnd<T>(arr: readonly T[], predicate: (arrayItem: T) => boolean): number|null {\n return nearestIndex(arr, predicate, NearestSearchStart.END);\n}\n\n// Type guard for ensuring that `arr` does not contain null or undefined\nexport function arrayDoesNotContainNullOrUndefined<T>(arr: (T|null|undefined)[]): arr is T[] {\n return !arr.includes(null) && !arr.includes(undefined);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"date-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/date-utilities.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAU,EAAW,EAAE;IAC7C,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAAU,EAAE;IACrD,SAAS,QAAQ,CAAC,CAAS;QACzB,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,GAAG;QACtF,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;AAC5F,CAAC,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const isValid = (date: Date): boolean => {\n return !isNaN(date.getTime());\n};\n\nexport const toISO8601Compact = (date: Date): string => {\n function leadZero(x: number): string {\n return (x > 9 ? '' : '0') + x;\n }\n return date.getFullYear() + leadZero(date.getMonth() + 1) + leadZero(date.getDate()) + 'T' +\n leadZero(date.getHours()) + leadZero(date.getMinutes()) + leadZero(date.getSeconds());\n};\n"]}
@@ -1,8 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true
4
- },
5
- "files": [
6
- "dcheck.js"
7
- ]
8
- }
@@ -1,4 +0,0 @@
1
- // Copyright 2021 The Chromium Authors. All rights reserved.
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
- export function DCHECK(condition: () => boolean, message?: string): void;
@@ -1,5 +0,0 @@
1
- export function DCHECK(condition, message = 'DCHECK') {
2
- if (!condition()) {
3
- throw new Error(message + ':' + new Error().stack);
4
- }
5
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"dom-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/dom-utilities.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAa;IAC7C,IAAI,aAAa,GAAiB,GAAG,CAAC,aAAa,CAAC;IACpD,OAAO,aAAa,IAAI,aAAa,CAAC,UAAU,IAAI,aAAa,CAAC,UAAU,CAAC,aAAa,EAAE;QAC1F,aAAa,GAAG,aAAa,CAAC,UAAU,CAAC,aAAa,CAAC;KACxD;IACD,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,IAAU;IACtD,I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C,gBAAgB,CAAC,cAAc,CAAC,CAAC;SAC9C;QAED,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,cAAc,CAAC;YACzB,SAAS,GAAG,cAAc,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC;gBACvC,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC;SAC3F;KACF;SAAM;QACL,OAAO,GAAG,QAAQ,CAAC;QACnB,SAAS,GAAG,MAAM,CAAC;KACpB;IAED,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE;QAC3B,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;KAC1D;IACD,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC;IACpD,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACxC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAElC,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright 2022 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/**\n * `document.activeElement` will not enter shadow roots to find the element\n * that has focus; use this method if you need to traverse through any shadow\n * roots to find the actual, specific focused element.\n */\nexport function deepActiveElement(doc: Document): Element|null {\n let activeElement: Element|null = doc.activeElement;\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) {\n activeElement = activeElement.shadowRoot.activeElement;\n }\n return activeElement;\n}\n\nexport function getEnclosingShadowRootForNode(node: Node): Node|null {\n let parentNode = node.parentNodeOrShadowHost();\n while (parentNode) {\n if (parentNode instanceof ShadowRoot) {\n return parentNode;\n }\n parentNode = parentNode.parentNodeOrShadowHost();\n }\n return null;\n}\n\nexport function rangeOfWord(\n rootNode: Node, offset: number, stopCharacters: string, stayWithinNode: Node, direction?: string): Range {\n let startNode;\n let startOffset = 0;\n let endNode;\n let endOffset = 0;\n\n if (!stayWithinNode) {\n stayWithinNode = rootNode;\n }\n\n if (!direction || direction === 'backward' || direction === 'both') {\n let node: Node|null = rootNode;\n while (node) {\n if (node === stayWithinNode) {\n if (!startNode) {\n startNode = stayWithinNode;\n }\n break;\n }\n\n if (node.nodeType === Node.TEXT_NODE && node.nodeValue !== null) {\n const start = (node === rootNode ? (offset - 1) : (node.nodeValue.length - 1));\n for (let i = start; i >= 0; --i) {\n if (stopCharacters.indexOf(node.nodeValue[i]) !== -1) {\n startNode = node;\n startOffset = i + 1;\n break;\n }\n }\n }\n\n if (startNode) {\n break;\n }\n\n node = node.traversePreviousNode(stayWithinNode);\n }\n\n if (!startNode) {\n startNode = stayWithinNode;\n startOffset = 0;\n }\n } else {\n startNode = rootNode;\n startOffset = offset;\n }\n\n if (!direction || direction === 'forward' || direction === 'both') {\n let node: (Node|null)|Node = rootNode;\n while (node) {\n if (node === stayWithinNode) {\n if (!endNode) {\n endNode = stayWithinNode;\n }\n break;\n }\n\n if (node.nodeType === Node.TEXT_NODE && node.nodeValue !== null) {\n const start = (node === rootNode ? offset : 0);\n for (let i = start; i < node.nodeValue.length; ++i) {\n if (stopCharacters.indexOf(node.nodeValue[i]) !== -1) {\n endNode = node;\n endOffset = i;\n break;\n }\n }\n }\n\n if (endNode) {\n break;\n }\n\n node = node.traverseNextNode(stayWithinNode);\n }\n\n if (!endNode) {\n endNode = stayWithinNode;\n endOffset = stayWithinNode.nodeType === Node.TEXT_NODE ? stayWithinNode.nodeValue?.length || 0 :\n stayWithinNode.childNodes.length;\n }\n } else {\n endNode = rootNode;\n endOffset = offset;\n }\n\n if (!rootNode.ownerDocument) {\n throw new Error('No `ownerDocument` found for rootNode');\n }\n const result = rootNode.ownerDocument.createRange();\n result.setStart(startNode, startOffset);\n result.setEnd(endNode, endOffset);\n\n return result;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"keyboard-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/keyboard-utilities.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAc7B,MAAM,CAAC,MAAM,SAAS,GAAG,OAAO,CAAC;AACjC,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAC;AACnC,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC;AAE7B,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAW;;;;;CAK3C,CAAC,CAAC;AAEH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,UAAU,CAAC,GAAG,CAAC,GAAe,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAoB;IACpD,OAAO,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC;AACpD,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const enum ArrowKey {\n UP = 'ArrowUp',\n DOWN = 'ArrowDown',\n LEFT = 'ArrowLeft',\n RIGHT = 'ArrowRight',\n}\n\nexport const enum PageKey {\n UP = 'PageUp',\n DOWN = 'PageDown',\n}\n\nexport const ENTER_KEY = 'Enter';\nexport const ESCAPE_KEY = 'Escape';\nexport const TAB_KEY = 'Tab';\n\nexport const ARROW_KEYS = new Set<ArrowKey>([\n ArrowKey.UP,\n ArrowKey.DOWN,\n ArrowKey.LEFT,\n ArrowKey.RIGHT,\n]);\n\nexport function keyIsArrowKey(key: string): key is ArrowKey {\n return ARROW_KEYS.has(key as ArrowKey);\n}\n\nexport function isEscKey(event: KeyboardEvent): boolean {\n return event.key === 'Escape';\n}\n\nexport function isEnterOrSpaceKey(event: KeyboardEvent): boolean {\n return event.key === 'Enter' || event.key === ' ';\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"map-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/map-utilities.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,MAAM,CAAC,MAAM,OAAO,GAAG,UAAe,GAAc;IAClD,MAAM,MAAM,GAAG,IAAI,QAAQ,EAAQ,CAAC;IACpC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,EAAE;QACxC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;KACxB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,OAAO,QAAQ;IACX,GAAG,GAAG,IAAI,GAAG,EAAa,CAAC;IAEnC,GAAG,CAAC,GAAM,EAAE,KAAQ;QAClB,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,CAAC,GAAG,EAAE;YACR,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;YAChB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;SACxB;QACD,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,GAAG,CAAC,GAAM;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;IACxC,CAAC;IAED,GAAG,CAAC,GAAM;QACR,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED,QAAQ,CAAC,GAAM,EAAE,KAAQ;QACvB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9B,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ACV,KAAK,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACjC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACrB;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const inverse = function<K, V>(map: Map<K, V>): Multimap<V, K> {\n const result = new Multimap<V, K>();\n for (const [key, value] of map.entries()) {\n result.set(value, key);\n }\n return result;\n};\n\nexport class Multimap<K, V> {\n private map = new Map<K, Set<V>>();\n\n set(key: K, value: V): void {\n let set = this.map.get(key);\n if (!set) {\n set = new Set();\n this.map.set(key, set);\n }\n set.add(value);\n }\n\n get(key: K): Set<V> {\n return this.map.get(key) || new Set();\n }\n\n has(key: K): boolean {\n return this.map.has(key);\n }\n\n hasValue(key: K, value: V): boolean {\n const set = this.map.get(key);\n if (!set) {\n return false;\n }\n return set.has(value);\n }\n\n get size(): number {\n return this.map.size;\n }\n\n delete(key: K, value: V): boolean {\n const values = this.get(key);\n if (!values) {\n return false;\n }\n const result = values.delete(value);\n if (!values.size) {\n this.map.delete(key);\n }\n return result;\n }\n\n deleteAll(key: K): void {\n this.map.delete(key);\n }\n\n keysArray(): K[] {\n return [...this.map.keys()];\n }\n\n valuesArray(): V[] {\n const result = [];\n for (const set of this.map.values()) {\n result.push(...set.values());\n }\n return result;\n }\n\n clear(): void {\n this.map.clear();\n }\n}\n\n/**\n * Gets value for key, assigning a default if value is falsy.\n */\nexport function getWithDefault<K extends {}, V>(\n map: WeakMap<K, V>|Map<K, V>, key: K, defaultValueFactory: (key?: K) => V): V {\n let value = map.get(key);\n if (!value) {\n value = defaultValueFactory(key);\n map.set(key, value);\n }\n\n return value;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"number-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/number-utilities.ts"],"names":[],"mappings":"AAA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AAM,CAAC,CAAC;IACrD,IAAI,OAAO,KAAK,CAAC,EAAE;QACjB,KAAK,IAAI,OAAO,CAAC;QACjB,MAAM,IAAI,OAAO,CAAC;KACnB;IACD,MAAM,MAAM,GAAG,GAAG,KAAK,IAAI,MAAM,EAAE,CAAC;IACpC,OAAO,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,UAAS,GAAW;IACxD,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,MAAM,EAAE,GAAG,cAAc,CAAC;IAC1B,OAAO,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;QACpB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;KACnC,CAAE,+BAA+B;IAClC,OAAO,GAAG,CAAC;AACb,CAAC,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const clamp = (num: number, min: number, max: number): number => {\n let clampedNumber = num;\n if (num < min) {\n clampedNumber = min;\n } else if (num > max) {\n clampedNumber = max;\n }\n return clampedNumber;\n};\n\nexport const mod = (m: number, n: number): number => {\n return ((m % n) + n) % n;\n};\n\nexport const bytesToString = (bytes: number): string => {\n if (bytes < 1000) {\n return `${bytes.toFixed(0)}\\xA0B`;\n }\n\n const kilobytes = bytes / 1000;\n if (kilobytes < 100) {\n return `${kilobytes.toFixed(1)}\\xA0kB`;\n }\n if (kilobytes < 1000) {\n return `${kilobytes.toFixed(0)}\\xA0kB`;\n }\n\n const megabytes = kilobytes / 1000;\n if (megabytes < 100) {\n return `${megabytes.toFixed(1)}\\xA0MB`;\n }\n return `${megabytes.toFixed(0)}\\xA0MB`;\n};\n\nexport const toFixedIfFloating = (value: string): string => {\n if (!value || Number.isNaN(Number(value))) {\n return value;\n }\n const number = Number(value);\n return number % 1 ? number.toFixed(3) : String(number);\n};\n\n/**\n * Rounds a number (including float) down.\n */\nexport const floor = (value: number, precision: number = 0): number => {\n const mult = Math.pow(10, precision);\n return Math.floor(value * mult) / mult;\n};\n\n/**\n * Computes the great common divisor for two numbers.\n * If the numbers are floats, they will be rounded to an integer.\n */\nexport const greatestCommonDivisor = (a: number, b: number): number => {\n a = Math.round(a);\n b = Math.round(b);\n while (b !== 0) {\n const t = b;\n b = a % b;\n a = t;\n }\n return a;\n};\n\nconst commonRatios = new Map([\n ['8∶5', '16∶10'],\n]);\n\nexport const aspectRatio = (width: number, height: number): string => {\n const divisor = greatestCommonDivisor(width, height);\n if (divisor !== 0) {\n width /= divisor;\n height /= divisor;\n }\n const result = `${width}∶${height}`;\n return commonRatios.get(result) || result;\n};\n\nexport const withThousandsSeparator = function(num: number): string {\n let str = String(num);\n const re = /(\\d+)(\\d{3})/;\n while (str.match(re)) {\n str = str.replace(re, '$1\\xA0$2');\n } // \\xa0 is a non-breaking space\n return str;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"promise-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/promise-utilities.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B;;;;GAIG;AACH,MAAM,UAAU,oBAAoB;IAKlC,IAAI,OAA2C,CAAC;IAChD,IAAI,MAAgC,CAAC;IACrC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QAC1C,OAAO,GAAG,GAAG,CAAC;QACd,MAAM,GAAG,GAAG,CAAC;IACf,CAAC,CAAC,CAAC;IACH,OAAO,EAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAC,CAAC;AACpC,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/**\n * Returns a new pending promise together with it's resolve and reject functions.\n *\n * Polyfill for https://github.com/tc39/proposal-promise-with-resolvers.\n */\nexport function promiseWithResolvers<T = unknown>(): {\n promise: Promise<T>,\n resolve: (value: T|PromiseLike<T>) => void,\n reject: (error?: Error) => void,\n} {\n let resolve!: (value: T|PromiseLike<T>) => void;\n let reject!: (error?: Error) => void;\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return {promise, resolve, reject};\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"set-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/set-utilities.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,MAAM,CAAC,MAAM,MAAM,GAAG,UAAY,GAAW,EAAE,QAAqB;IAClE,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE;QAC3B,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;KACf;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,UAAY,IAAY,EAAE,IAAY;IAC3D,IAAI,IAAI,KAAK,IAAI,EAAE;QACjB,OAAO,IAAI,CAAC;KACb;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE;QAC3B,OAAO,KAAK,CAAC;KACd;IACD,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;QACvB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACnB,OAAO,KAAK,CAAC;SACd;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const addAll = function<T>(set: Set<T>, iterable: Iterable<T>): void {\n for (const item of iterable) {\n set.add(item);\n }\n};\n\nexport const isEqual = function<T>(setA: Set<T>, setB: Set<T>): boolean {\n if (setA === setB) {\n return true;\n }\n if (setA.size !== setB.size) {\n return false;\n }\n for (const item of setA) {\n if (!setB.has(item)) {\n return false;\n }\n }\n return true;\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"string-utilities.js","sourceRoot":"","sources":["../../../../../../front_end/core/platform/string-utilities.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,yEAAyE;AACzE,6BAA6B;AAE7B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,WAAmB,EAAE,aAAqB,EAAU,EAAE;IACrF,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QAC7C,IAAI,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;YACvD,SAAS,GAAG,IAAI,CAAC;YACjB,MAAM;SACP;KACF;IAED,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC;KAC5B;IAED,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QAC3C,IAAI,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;YACvD,MAAM,IAAI,IAAI,CAAC;SAChB;QACD,MAAM,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KACjC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,WAAmB,EAAU,EAAE;IACtE,OAAO,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AACxE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AAM,CAAC,MAAM,YAAY,GAAG,UAAS,GAAW,EAAE,GAAW;IAC3D,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC1C,8DAA8D;QAC9D,OAAO,GAAG,GAAG,GAAG,CAAC;KAClB;IACD,MAAM,YAAY,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACtD,MAAM,WAAW,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAClD,OAAO,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACjF,CAAC,CAAC","sourcesContent":["// Copyright (c) 2020 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport const escapeCharacters = (inputString: string, charsToEscape: string): string => {\n let foundChar = false;\n for (let i = 0; i < charsToEscape.length; ++i) {\n if (inputString.indexOf(charsToEscape.charAt(i)) !== -1) {\n foundChar = true;\n break;\n }\n }\n\n if (!foundChar) {\n return String(inputString);\n }\n\n let result = '';\n for (let i = 0; i < inputString.length; ++i) {\n if (charsToEscape.indexOf(inputString.charAt(i)) !== -1) {\n result += '\\\\';\n }\n result += inputString.charAt(i);\n }\n\n return result;\n};\n\nconst toHexadecimal = (charCode: number, padToLength: number): string => {\n return charCode.toString(16).toUpperCase().padStart(padToLength, '0');\n};\n\n// Remember to update the third group in the regexps patternsToEscape and\n// patternsToEscapePlusSingleQuote when adding new entries in this map.\nconst escapedReplacements = new Map([\n ['\\b', '\\\\b'],\n ['\\f', '\\\\f'],\n ['\\n', '\\\\n'],\n ['\\r', '\\\\r'],\n ['\\t', '\\\\t'],\n ['\\v', '\\\\v'],\n ['\\'', '\\\\\\''],\n ['\\\\', '\\\\\\\\'],\n ['<!--', '\\\\x3C!--'],\n ['<script', '\\\\x3Cscript'],\n ['</script', '\\\\x3C/script'],\n]);\n\nexport const formatAsJSLiteral = (content: string): string => {\n const patternsToEscape = /(\\\\|<(?:!--|\\/?script))|(\\p{Control})|(\\p{Surrogate})/gu;\n const patternsToEscapePlusSingleQuote = /(\\\\|'|<(?:!--|\\/?script))|(\\p{Control})|(\\p{Surrogate})/gu;\n const escapePattern = (match: string, pattern: string, controlChar: string, loneSurrogate: string): string => {\n if (controlChar) {\n if (escapedReplacements.has(controlChar)) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/13086\n return escapedReplacements.get(controlChar);\n }\n const twoDigitHex = toHexadecimal(controlChar.charCodeAt(0), 2);\n return '\\\\x' + twoDigitHex;\n }\n if (loneSurrogate) {\n const fourDigitHex = toHexadecimal(loneSurrogate.charCodeAt(0), 4);\n return '\\\\u' + fourDigitHex;\n }\n if (pattern) {\n return escapedReplacements.get(pattern) || '';\n }\n return match;\n };\n\n let escapedContent = '';\n let quote = '';\n if (!content.includes('\\'')) {\n quote = '\\'';\n escapedContent = content.replaceAll(patternsToEscape, escapePattern);\n } else if (!content.includes('\"')) {\n quote = '\"';\n escapedContent = content.replaceAll(patternsToEscape, escapePattern);\n } else if (!content.includes('`') && !content.includes('${')) {\n quote = '`';\n escapedContent = content.replaceAll(patternsToEscape, escapePattern);\n } else {\n quote = '\\'';\n escapedContent = content.replaceAll(patternsToEscapePlusSingleQuote, escapePattern);\n }\n return `${quote}${escapedContent}${quote}`;\n};\n\n/**\n * This implements a subset of the sprintf() function described in the Single UNIX\n * Specification. It supports the %s, %f, %d, and %% formatting specifiers, and\n * understands the %m$d notation to select the m-th parameter for this substitution,\n * as well as the optional precision for %s, %f, and %d.\n *\n * @param fmt format string.\n * @param args parameters to the format string.\n * @returns the formatted output string.\n */\nexport const sprintf = (fmt: string, ...args: unknown[]): string => {\n let argIndex = 0;\n const RE = /%(?:(\\d+)\\$)?(?:\\.(\\d*))?([%dfs])/g;\n return fmt.replaceAll(RE, (_: string, index?: string, precision?: string, specifier?: string) => {\n if (specifier === '%') {\n return '%';\n }\n if (index !== undefined) {\n argIndex = parseInt(index, 10) - 1;\n if (argIndex < 0) {\n throw new RangeError(`Invalid parameter index ${argIndex + 1}`);\n }\n }\n if (argIndex >= args.length) {\n throw new RangeError(`Expected at least ${argIndex + 1} format parameters, but only ${args.length} where given.`);\n }\n if (specifier === 's') {\n const argValue = String(args[argIndex++]);\n if (precision !== undefined) {\n return argValue.substring(0, Number(precision));\n }\n return argValue;\n }\n let argValue = Number(args[argIndex++]);\n if (isNaN(argValue)) {\n argValue = 0;\n }\n if (specifier === 'd') {\n return String(Math.floor(argValue)).padStart(Number(precision), '0');\n }\n if (precision !== undefined) {\n return argValue.toFixed(Number(precision));\n }\n return String(argValue);\n });\n};\n\nexport const toBase64 = (inputString: string): string => {\n /* note to the reader: we can't use btoa here because we need to\n * support Unicode correctly. See the test cases for this function and\n * also\n * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem\n */\n\n function encodeBits(b: number): number {\n return b < 26 ? b + 65 : b < 52 ? b + 71 : b < 62 ? b - 4 : b === 62 ? 43 : b === 63 ? 47 : 65;\n }\n const encoder = new TextEncoder();\n const data = encoder.encode(inputString.toString());\n const n = data.length;\n let encoded = '';\n if (n === 0) {\n return encoded;\n }\n let shift;\n let v = 0;\n for (let i = 0; i < n; i++) {\n shift = i % 3;\n v |= data[i] << (16 >>> shift & 24);\n if (shift === 2) {\n encoded += String.fromCharCode(\n encodeBits(v >>> 18 & 63), encodeBits(v >>> 12 & 63), encodeBits(v >>> 6 & 63), encodeBits(v & 63));\n v = 0;\n }\n }\n if (shift === 0) {\n encoded += String.fromCharCode(encodeBits(v >>> 18 & 63), encodeBits(v >>> 12 & 63), 61, 61);\n } else if (shift === 1) {\n encoded += String.fromCharCode(encodeBits(v >>> 18 & 63), encodeBits(v >>> 12 & 63), encodeBits(v >>> 6 & 63), 61);\n }\n return encoded;\n};\n\nexport const findIndexesOfSubString = (inputString: string, searchString: string): number[] => {\n const matches = [];\n let i = inputString.indexOf(searchString);\n while (i !== -1) {\n matches.push(i);\n i = inputString.indexOf(searchString, i + searchString.length);\n }\n return matches;\n};\n\nexport const findLineEndingIndexes = (inputString: string): number[] => {\n const endings = findIndexesOfSubString(inputString, '\\n');\n endings.push(inputString.length);\n return endings;\n};\n\nexport const isWhitespace = (inputString: string): boolean => {\n return /^\\s*$/.test(inputString);\n};\n\nexport const trimURL = (url: string, baseURLDomain?: string): string => {\n let result = url.replace(/^(https|http|file):\\/\\//i, '');\n if (baseURLDomain) {\n if (result.toLowerCase().startsWith(baseURLDomain.toLowerCase())) {\n result = result.substr(baseURLDomain.length);\n }\n }\n return result;\n};\n\nexport const collapseWhitespace = (inputString: string): string => {\n return inputString.replace(/[\\s\\xA0]+/g, ' ');\n};\n\nexport const reverse = (inputString: string): string => {\n return inputString.split('').reverse().join('');\n};\n\nexport const replaceControlCharacters = (inputString: string): string => {\n // Replace C0 and C1 control character sets with replacement character.\n // Do not replace '\\t', \\n' and '\\r'.\n return inputString.replace(/[\\0-\\x08\\x0B\\f\\x0E-\\x1F\\x80-\\x9F]/g, '\\uFFFD');\n};\n\nexport const countWtf8Bytes = (inputString: string): number => {\n let count = 0;\n for (let i = 0; i < inputString.length; i++) {\n const c = inputString.charCodeAt(i);\n if (c <= 0x7F) {\n count++;\n } else if (c <= 0x07FF) {\n count += 2;\n } else if (c < 0xD800 || 0xDFFF < c) {\n count += 3;\n } else {\n if (c <= 0xDBFF && i + 1 < inputString.length) {\n // The current character is a leading surrogate, and there is a\n // next character.\n const next = inputString.charCodeAt(i + 1);\n if (0xDC00 <= next && next <= 0xDFFF) {\n // The next character is a trailing surrogate, meaning this\n // is a surrogate pair.\n count += 4;\n i++;\n continue;\n }\n }\n count += 3;\n }\n }\n return count;\n};\n\nexport const stripLineBreaks = (inputStr: string): string => {\n return inputStr.replace(/(\\r)?\\n/g, '');\n};\n\nconst EXTENDED_KEBAB_CASE_REGEXP = /^([a-z0-9]+(?:-[a-z0-9]+)*\\.)*[a-z0-9]+(?:-[a-z0-9]+)*$/;\n\n/**\n * Tests if the `inputStr` is following the extended Kebab Case naming convetion,\n * where words are separated with either a dash (`-`) or a dot (`.`), and all\n * characters must be lower-case alphanumeric.\n *\n * For example, it will yield `true` for `'my.amazing-string.literal'`, but `false`\n * for `'Another.AmazingLiteral'` or '`another_amazing_literal'`.\n *\n * @param inputStr the input string to test.\n * @return `true` if the `inputStr` follows the extended Kebab Case convention.\n */\nexport const isExtendedKebabCase = (inputStr: string): boolean => {\n return EXTENDED_KEBAB_CASE_REGEXP.test(inputStr);\n};\n\nexport const toTitleCase = (inputStr: string): string => {\n return inputStr.substring(0, 1).toUpperCase() + inputStr.substring(1);\n};\n\nexport const removeURLFragment = (inputStr: string): string => {\n const url = new URL(inputStr);\n url.hash = '';\n return url.toString();\n};\n\nconst SPECIAL_REGEX_CHARACTERS = '^[]{}()\\\\.^$*+?|-,';\n\nexport const regexSpecialCharacters = function(): string {\n return SPECIAL_REGEX_CHARACTERS;\n};\n\nexport const filterRegex = function(query: string): RegExp {\n let regexString = '^(?:.*\\\\0)?'; // Start from beginning or after a \\0\n for (let i = 0; i < query.length; ++i) {\n let c = query.charAt(i);\n if (SPECIAL_REGEX_CHARACTERS.indexOf(c) !== -1) {\n c = '\\\\' + c;\n }\n regexString += '[^\\\\0' + c + ']*' + c;\n }\n return new RegExp(regexString, 'i');\n};\n\nexport const createSearchRegex = function(\n query: string, caseSensitive: boolean, isRegex: boolean, matchWholeWord: boolean = false): RegExp {\n const regexFlags = caseSensitive ? 'g' : 'gi';\n let regexObject;\n\n if (isRegex) {\n try {\n regexObject = new RegExp(query, regexFlags);\n } catch (e) {\n // Silent catch.\n }\n }\n\n if (!regexObject) {\n regexObject = createPlainTextSearchRegex(query, regexFlags);\n }\n\n if (matchWholeWord && regexObject) {\n regexObject = new RegExp(`\\\\b${regexObject.source}\\\\b`, regexFlags);\n }\n\n return regexObject;\n};\n\nexport const caseInsensetiveComparator = function(a: string, b: string): number {\n a = a.toUpperCase();\n b = b.toUpperCase();\n if (a === b) {\n return 0;\n }\n return a > b ? 1 : -1;\n};\n\nexport const hashCode = function(string?: string): number {\n if (!string) {\n return 0;\n }\n // Hash algorithm for substrings is described in \"Über die Komplexität der Multiplikation in\n // eingeschränkten Branchingprogrammmodellen\" by Woelfe.\n // http://opendatastructures.org/versions/edition-0.1d/ods-java/node33.html#SECTION00832000000000000000\n const p = ((1 << 30) * 4 - 5); // prime: 2^32 - 5\n const z = 0x5033d967; // 32 bits from random.org\n const z2 = 0x59d2f15d; // random odd 32 bit number\n let s = 0;\n let zi = 1;\n for (let i = 0; i < string.length; i++) {\n const xi = string.charCodeAt(i) * z2;\n s = (s + zi * xi) % p;\n zi = (zi * z) % p;\n }\n s = (s + zi * (p - 1)) % p;\n return Math.abs(s | 0);\n};\n\nexport const compare = (a: string, b: string): number => {\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n return 0;\n};\n\nexport const trimMiddle = (str: string, maxLength: number): string => {\n if (str.length <= maxLength) {\n return String(str);\n }\n let leftHalf = maxLength >> 1;\n let rightHalf = maxLength - leftHalf - 1;\n if ((str.codePointAt(str.length - rightHalf - 1) as number) >= 0x10000) {\n --rightHalf;\n ++leftHalf;\n }\n if (leftHalf > 0 && (str.codePointAt(leftHalf - 1) as number) >= 0x10000) {\n --leftHalf;\n }\n return str.substr(0, leftHalf) + '…' + str.substr(str.length - rightHalf, rightHalf);\n};\n\nexport const trimEndWithMaxLength = (str: string, maxLength: number): string => {\n if (str.length <= maxLength) {\n return String(str);\n }\n return str.substr(0, maxLength - 1) + '…';\n};\n\nexport const escapeForRegExp = (str: string): string => {\n return escapeCharacters(str, SPECIAL_REGEX_CHARACTERS);\n};\n\nexport const naturalOrderComparator = (a: string, b: string): number => {\n const chunk = /^\\d+|^\\D+/;\n let chunka, chunkb, anum, bnum;\n while (true) {\n if (a) {\n if (!b) {\n return 1;\n }\n } else {\n if (b) {\n return -1;\n }\n return 0;\n }\n chunka = (a.match(chunk) as string[])[0];\n chunkb = (b.match(chunk) as string[])[0];\n anum = !Number.isNaN(Number(chunka));\n bnum = !Number.isNaN(Number(chunkb));\n if (anum && !bnum) {\n return -1;\n }\n if (bnum && !anum) {\n return 1;\n }\n if (anum && bnum) {\n const diff = Number(chunka) - Number(chunkb);\n if (diff) {\n return diff;\n }\n if (chunka.length !== chunkb.length) {\n if (!Number(chunka) && !Number(chunkb)) { // chunks are strings of all 0s (special case)\n return chunka.length - chunkb.length;\n }\n return chunkb.length - chunka.length;\n }\n } else if (chunka !== chunkb) {\n return (chunka < chunkb) ? -1 : 1;\n }\n a = a.substring(chunka.length);\n b = b.substring(chunkb.length);\n }\n};\n\nexport const base64ToSize = function(content: string|null): number {\n if (!content) {\n return 0;\n }\n let size = content.length * 3 / 4;\n if (content[content.length - 1] === '=') {\n size--;\n }\n if (content.length > 1 && content[content.length - 2] === '=') {\n size--;\n }\n return size;\n};\n\nexport const SINGLE_QUOTE = '\\'';\nexport const DOUBLE_QUOTE = '\"';\nconst BACKSLASH = '\\\\';\n\nexport const findUnclosedCssQuote = function(str: string): string {\n let unmatchedQuote = '';\n for (let i = 0; i < str.length; ++i) {\n const char = str[i];\n if (char === BACKSLASH) {\n i++;\n continue;\n }\n if (char === SINGLE_QUOTE || char === DOUBLE_QUOTE) {\n if (unmatchedQuote === char) {\n unmatchedQuote = '';\n } else if (unmatchedQuote === '') {\n unmatchedQuote = char;\n }\n }\n }\n return unmatchedQuote;\n};\n\nexport const countUnmatchedLeftParentheses = (str: string): number => {\n let unmatchedCount = 0;\n for (const c of str) {\n if (c === '(') {\n unmatchedCount++;\n } else if (c === ')' && unmatchedCount > 0) {\n unmatchedCount--;\n }\n }\n return unmatchedCount;\n};\n\nexport const createPlainTextSearchRegex = function(query: string, flags?: string): RegExp {\n // This should be kept the same as the one in StringUtil.cpp.\n let regex = '';\n for (let i = 0; i < query.length; ++i) {\n const c = query.charAt(i);\n if (regexSpecialCharacters().indexOf(c) !== -1) {\n regex += '\\\\';\n }\n regex += c;\n }\n return new RegExp(regex, flags || '');\n};\n\nclass LowerCaseStringTag {\n private lowerCaseStringTag: (string|undefined);\n}\n\nexport type LowerCaseString = string&LowerCaseStringTag;\n\nexport const toLowerCaseString = function(input: string): LowerCaseString {\n return input.toLowerCase() as LowerCaseString;\n};\n\nconst WORD = /[A-Z]{2,}(?=[A-Z0-9][a-z0-9]+|\\b)|[A-Za-z][0-9]+[a-z]|[A-Z]?[a-z]+|[0-9][A-Za-z]+|[A-Z]|[0-9]+|[.]/g;\n// <---1---><-----------2----------> <--------3--------> <-----4----> <------5-----> <-----6----> <7>\n// 1: two or more consecutive uppercase letters. This is useful for identifying acronyms\n// 2: lookahead assertion that matches a word boundary\n// 3: numeronym: single letter followed by number and another letter\n// 4: word starting with an optional uppercase letter\n// 5: single digit followed by word to handle '3D' or '2px' (this might be controverial)\n// 6: single uppercase letter or number\n// 7: a dot character. We extract it into a separate word and remove dashes around it later.\n// This is makes more sense conceptually and allows accounting for all possible word variants.\n// Making dot a part of a word prevent us from handling acronyms or numeronyms after the word\n// correctly without making the RegExp prohibitively complicated.\n// https://regex101.com/r/LtFugp/1\nexport const toKebabCase = function(input: string): Lowercase<string> {\n return (input.match?.(WORD)?.map(w => w.toLowerCase()).join('-').replaceAll('-.-', '.') || input) as\n Lowercase<string>;\n};\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport function toKebabCaseKeys(settingValue: {\n [x: string]: any,\n}): {[x: string]: any} {\n const result: {\n [x: string]: any,\n } = {};\n for (const [key, value] of Object.entries(settingValue)) {\n result[toKebabCase(key)] = value;\n }\n return result;\n}\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\n// Replaces the last ocurrence of parameter `search` with parameter `replacement` in `input`\nexport const replaceLast = function(input: string, search: string, replacement: string): string {\n const replacementStartIndex = input.lastIndexOf(search);\n if (replacementStartIndex === -1) {\n return input;\n }\n\n return input.slice(0, replacementStartIndex) + input.slice(replacementStartIndex).replace(search, replacement);\n};\n\nexport const stringifyWithPrecision = function stringifyWithPrecision(s: number, precision = 2): string {\n if (precision === 0) {\n return s.toFixed(0);\n }\n const string = s.toFixed(precision).replace(/\\.?0*$/, '');\n return string === '-0' ? '0' : string;\n};\n\n/**\n * Somewhat efficiently concatenates 2 base64 encoded strings.\n */\nexport const concatBase64 = function(lhs: string, rhs: string): string {\n if (lhs.length === 0 || !lhs.endsWith('=')) {\n // Empty string or no padding, we can straight-up concatenate.\n return lhs + rhs;\n }\n const lhsLeaveAsIs = lhs.substring(0, lhs.length - 4);\n const lhsToDecode = lhs.substring(lhs.length - 4);\n return lhsLeaveAsIs + window.btoa(window.atob(lhsToDecode) + window.atob(rhs));\n};\n"]}