@measured/puck-plugin-heading-analyzer 0.16.0-canary.60fe631 → 0.16.0-canary.6d43ba0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.mts +229 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1899 -78373
- package/dist/index.mjs +2075 -0
- package/package.json +9 -2
package/dist/index.mjs
ADDED
@@ -0,0 +1,2075 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __defProps = Object.defineProperties;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
12
|
+
var __spreadValues = (a, b) => {
|
13
|
+
for (var prop in b || (b = {}))
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
16
|
+
if (__getOwnPropSymbols)
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
18
|
+
if (__propIsEnum.call(b, prop))
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
20
|
+
}
|
21
|
+
return a;
|
22
|
+
};
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
24
|
+
var __objRest = (source, exclude) => {
|
25
|
+
var target = {};
|
26
|
+
for (var prop in source)
|
27
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
28
|
+
target[prop] = source[prop];
|
29
|
+
if (source != null && __getOwnPropSymbols)
|
30
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
31
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
32
|
+
target[prop] = source[prop];
|
33
|
+
}
|
34
|
+
return target;
|
35
|
+
};
|
36
|
+
var __esm = (fn, res) => function __init() {
|
37
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
38
|
+
};
|
39
|
+
var __commonJS = (cb, mod) => function __require() {
|
40
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
41
|
+
};
|
42
|
+
var __copyProps = (to, from, except, desc) => {
|
43
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
44
|
+
for (let key of __getOwnPropNames(from))
|
45
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
46
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
47
|
+
}
|
48
|
+
return to;
|
49
|
+
};
|
50
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
51
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
52
|
+
// file that has been converted to a CommonJS file using a Babel-
|
53
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
54
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
55
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
56
|
+
mod
|
57
|
+
));
|
58
|
+
|
59
|
+
// ../tsup-config/react-import.js
|
60
|
+
import React from "react";
|
61
|
+
var init_react_import = __esm({
|
62
|
+
"../tsup-config/react-import.js"() {
|
63
|
+
"use strict";
|
64
|
+
}
|
65
|
+
});
|
66
|
+
|
67
|
+
// ../../node_modules/classnames/index.js
|
68
|
+
var require_classnames = __commonJS({
|
69
|
+
"../../node_modules/classnames/index.js"(exports, module) {
|
70
|
+
"use strict";
|
71
|
+
init_react_import();
|
72
|
+
(function() {
|
73
|
+
"use strict";
|
74
|
+
var hasOwn = {}.hasOwnProperty;
|
75
|
+
var nativeCodeString = "[native code]";
|
76
|
+
function classNames() {
|
77
|
+
var classes = [];
|
78
|
+
for (var i = 0; i < arguments.length; i++) {
|
79
|
+
var arg = arguments[i];
|
80
|
+
if (!arg) continue;
|
81
|
+
var argType = typeof arg;
|
82
|
+
if (argType === "string" || argType === "number") {
|
83
|
+
classes.push(arg);
|
84
|
+
} else if (Array.isArray(arg)) {
|
85
|
+
if (arg.length) {
|
86
|
+
var inner = classNames.apply(null, arg);
|
87
|
+
if (inner) {
|
88
|
+
classes.push(inner);
|
89
|
+
}
|
90
|
+
}
|
91
|
+
} else if (argType === "object") {
|
92
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
93
|
+
classes.push(arg.toString());
|
94
|
+
continue;
|
95
|
+
}
|
96
|
+
for (var key in arg) {
|
97
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
98
|
+
classes.push(key);
|
99
|
+
}
|
100
|
+
}
|
101
|
+
}
|
102
|
+
}
|
103
|
+
return classes.join(" ");
|
104
|
+
}
|
105
|
+
if (typeof module !== "undefined" && module.exports) {
|
106
|
+
classNames.default = classNames;
|
107
|
+
module.exports = classNames;
|
108
|
+
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
109
|
+
define("classnames", [], function() {
|
110
|
+
return classNames;
|
111
|
+
});
|
112
|
+
} else {
|
113
|
+
window.classNames = classNames;
|
114
|
+
}
|
115
|
+
})();
|
116
|
+
}
|
117
|
+
});
|
118
|
+
|
119
|
+
// ../../node_modules/ua-parser-js/src/ua-parser.js
|
120
|
+
var require_ua_parser = __commonJS({
|
121
|
+
"../../node_modules/ua-parser-js/src/ua-parser.js"(exports, module) {
|
122
|
+
"use strict";
|
123
|
+
init_react_import();
|
124
|
+
(function(window2, undefined2) {
|
125
|
+
"use strict";
|
126
|
+
var LIBVERSION = "1.0.37", EMPTY = "", UNKNOWN = "?", FUNC_TYPE = "function", UNDEF_TYPE = "undefined", OBJ_TYPE = "object", STR_TYPE = "string", MAJOR = "major", MODEL = "model", NAME = "name", TYPE = "type", VENDOR = "vendor", VERSION = "version", ARCHITECTURE = "architecture", CONSOLE = "console", MOBILE = "mobile", TABLET = "tablet", SMARTTV = "smarttv", WEARABLE = "wearable", EMBEDDED = "embedded", UA_MAX_LENGTH = 500;
|
127
|
+
var AMAZON = "Amazon", APPLE = "Apple", ASUS = "ASUS", BLACKBERRY = "BlackBerry", BROWSER = "Browser", CHROME = "Chrome", EDGE = "Edge", FIREFOX = "Firefox", GOOGLE = "Google", HUAWEI = "Huawei", LG = "LG", MICROSOFT = "Microsoft", MOTOROLA = "Motorola", OPERA = "Opera", SAMSUNG = "Samsung", SHARP = "Sharp", SONY = "Sony", XIAOMI = "Xiaomi", ZEBRA = "Zebra", FACEBOOK = "Facebook", CHROMIUM_OS = "Chromium OS", MAC_OS = "Mac OS";
|
128
|
+
var extend = function(regexes2, extensions) {
|
129
|
+
var mergedRegexes = {};
|
130
|
+
for (var i in regexes2) {
|
131
|
+
if (extensions[i] && extensions[i].length % 2 === 0) {
|
132
|
+
mergedRegexes[i] = extensions[i].concat(regexes2[i]);
|
133
|
+
} else {
|
134
|
+
mergedRegexes[i] = regexes2[i];
|
135
|
+
}
|
136
|
+
}
|
137
|
+
return mergedRegexes;
|
138
|
+
}, enumerize = function(arr) {
|
139
|
+
var enums = {};
|
140
|
+
for (var i = 0; i < arr.length; i++) {
|
141
|
+
enums[arr[i].toUpperCase()] = arr[i];
|
142
|
+
}
|
143
|
+
return enums;
|
144
|
+
}, has = function(str1, str2) {
|
145
|
+
return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;
|
146
|
+
}, lowerize = function(str) {
|
147
|
+
return str.toLowerCase();
|
148
|
+
}, majorize = function(version) {
|
149
|
+
return typeof version === STR_TYPE ? version.replace(/[^\d\.]/g, EMPTY).split(".")[0] : undefined2;
|
150
|
+
}, trim = function(str, len) {
|
151
|
+
if (typeof str === STR_TYPE) {
|
152
|
+
str = str.replace(/^\s\s*/, EMPTY);
|
153
|
+
return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);
|
154
|
+
}
|
155
|
+
};
|
156
|
+
var rgxMapper = function(ua, arrays) {
|
157
|
+
var i = 0, j, k, p, q, matches, match;
|
158
|
+
while (i < arrays.length && !matches) {
|
159
|
+
var regex = arrays[i], props = arrays[i + 1];
|
160
|
+
j = k = 0;
|
161
|
+
while (j < regex.length && !matches) {
|
162
|
+
if (!regex[j]) {
|
163
|
+
break;
|
164
|
+
}
|
165
|
+
matches = regex[j++].exec(ua);
|
166
|
+
if (!!matches) {
|
167
|
+
for (p = 0; p < props.length; p++) {
|
168
|
+
match = matches[++k];
|
169
|
+
q = props[p];
|
170
|
+
if (typeof q === OBJ_TYPE && q.length > 0) {
|
171
|
+
if (q.length === 2) {
|
172
|
+
if (typeof q[1] == FUNC_TYPE) {
|
173
|
+
this[q[0]] = q[1].call(this, match);
|
174
|
+
} else {
|
175
|
+
this[q[0]] = q[1];
|
176
|
+
}
|
177
|
+
} else if (q.length === 3) {
|
178
|
+
if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {
|
179
|
+
this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined2;
|
180
|
+
} else {
|
181
|
+
this[q[0]] = match ? match.replace(q[1], q[2]) : undefined2;
|
182
|
+
}
|
183
|
+
} else if (q.length === 4) {
|
184
|
+
this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined2;
|
185
|
+
}
|
186
|
+
} else {
|
187
|
+
this[q] = match ? match : undefined2;
|
188
|
+
}
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
i += 2;
|
193
|
+
}
|
194
|
+
}, strMapper = function(str, map) {
|
195
|
+
for (var i in map) {
|
196
|
+
if (typeof map[i] === OBJ_TYPE && map[i].length > 0) {
|
197
|
+
for (var j = 0; j < map[i].length; j++) {
|
198
|
+
if (has(map[i][j], str)) {
|
199
|
+
return i === UNKNOWN ? undefined2 : i;
|
200
|
+
}
|
201
|
+
}
|
202
|
+
} else if (has(map[i], str)) {
|
203
|
+
return i === UNKNOWN ? undefined2 : i;
|
204
|
+
}
|
205
|
+
}
|
206
|
+
return str;
|
207
|
+
};
|
208
|
+
var oldSafariMap = {
|
209
|
+
"1.0": "/8",
|
210
|
+
"1.2": "/1",
|
211
|
+
"1.3": "/3",
|
212
|
+
"2.0": "/412",
|
213
|
+
"2.0.2": "/416",
|
214
|
+
"2.0.3": "/417",
|
215
|
+
"2.0.4": "/419",
|
216
|
+
"?": "/"
|
217
|
+
}, windowsVersionMap = {
|
218
|
+
"ME": "4.90",
|
219
|
+
"NT 3.11": "NT3.51",
|
220
|
+
"NT 4.0": "NT4.0",
|
221
|
+
"2000": "NT 5.0",
|
222
|
+
"XP": ["NT 5.1", "NT 5.2"],
|
223
|
+
"Vista": "NT 6.0",
|
224
|
+
"7": "NT 6.1",
|
225
|
+
"8": "NT 6.2",
|
226
|
+
"8.1": "NT 6.3",
|
227
|
+
"10": ["NT 6.4", "NT 10.0"],
|
228
|
+
"RT": "ARM"
|
229
|
+
};
|
230
|
+
var regexes = {
|
231
|
+
browser: [
|
232
|
+
[
|
233
|
+
/\b(?:crmo|crios)\/([\w\.]+)/i
|
234
|
+
// Chrome for Android/iOS
|
235
|
+
],
|
236
|
+
[VERSION, [NAME, "Chrome"]],
|
237
|
+
[
|
238
|
+
/edg(?:e|ios|a)?\/([\w\.]+)/i
|
239
|
+
// Microsoft Edge
|
240
|
+
],
|
241
|
+
[VERSION, [NAME, "Edge"]],
|
242
|
+
[
|
243
|
+
// Presto based
|
244
|
+
/(opera mini)\/([-\w\.]+)/i,
|
245
|
+
// Opera Mini
|
246
|
+
/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,
|
247
|
+
// Opera Mobi/Tablet
|
248
|
+
/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i
|
249
|
+
// Opera
|
250
|
+
],
|
251
|
+
[NAME, VERSION],
|
252
|
+
[
|
253
|
+
/opios[\/ ]+([\w\.]+)/i
|
254
|
+
// Opera mini on iphone >= 8.0
|
255
|
+
],
|
256
|
+
[VERSION, [NAME, OPERA + " Mini"]],
|
257
|
+
[
|
258
|
+
/\bopr\/([\w\.]+)/i
|
259
|
+
// Opera Webkit
|
260
|
+
],
|
261
|
+
[VERSION, [NAME, OPERA]],
|
262
|
+
[
|
263
|
+
// Mixed
|
264
|
+
/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i
|
265
|
+
// Baidu
|
266
|
+
],
|
267
|
+
[VERSION, [NAME, "Baidu"]],
|
268
|
+
[
|
269
|
+
/(kindle)\/([\w\.]+)/i,
|
270
|
+
// Kindle
|
271
|
+
/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,
|
272
|
+
// Lunascape/Maxthon/Netfront/Jasmine/Blazer
|
273
|
+
// Trident based
|
274
|
+
/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,
|
275
|
+
// Avant/IEMobile/SlimBrowser
|
276
|
+
/(?:ms|\()(ie) ([\w\.]+)/i,
|
277
|
+
// Internet Explorer
|
278
|
+
// Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
|
279
|
+
/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,
|
280
|
+
// Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ
|
281
|
+
/(heytap|ovi)browser\/([\d\.]+)/i,
|
282
|
+
// Heytap/Ovi
|
283
|
+
/(weibo)__([\d\.]+)/i
|
284
|
+
// Weibo
|
285
|
+
],
|
286
|
+
[NAME, VERSION],
|
287
|
+
[
|
288
|
+
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i
|
289
|
+
// UCBrowser
|
290
|
+
],
|
291
|
+
[VERSION, [NAME, "UC" + BROWSER]],
|
292
|
+
[
|
293
|
+
/microm.+\bqbcore\/([\w\.]+)/i,
|
294
|
+
// WeChat Desktop for Windows Built-in Browser
|
295
|
+
/\bqbcore\/([\w\.]+).+microm/i,
|
296
|
+
/micromessenger\/([\w\.]+)/i
|
297
|
+
// WeChat
|
298
|
+
],
|
299
|
+
[VERSION, [NAME, "WeChat"]],
|
300
|
+
[
|
301
|
+
/konqueror\/([\w\.]+)/i
|
302
|
+
// Konqueror
|
303
|
+
],
|
304
|
+
[VERSION, [NAME, "Konqueror"]],
|
305
|
+
[
|
306
|
+
/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i
|
307
|
+
// IE11
|
308
|
+
],
|
309
|
+
[VERSION, [NAME, "IE"]],
|
310
|
+
[
|
311
|
+
/ya(?:search)?browser\/([\w\.]+)/i
|
312
|
+
// Yandex
|
313
|
+
],
|
314
|
+
[VERSION, [NAME, "Yandex"]],
|
315
|
+
[
|
316
|
+
/slbrowser\/([\w\.]+)/i
|
317
|
+
// Smart Lenovo Browser
|
318
|
+
],
|
319
|
+
[VERSION, [NAME, "Smart Lenovo " + BROWSER]],
|
320
|
+
[
|
321
|
+
/(avast|avg)\/([\w\.]+)/i
|
322
|
+
// Avast/AVG Secure Browser
|
323
|
+
],
|
324
|
+
[[NAME, /(.+)/, "$1 Secure " + BROWSER], VERSION],
|
325
|
+
[
|
326
|
+
/\bfocus\/([\w\.]+)/i
|
327
|
+
// Firefox Focus
|
328
|
+
],
|
329
|
+
[VERSION, [NAME, FIREFOX + " Focus"]],
|
330
|
+
[
|
331
|
+
/\bopt\/([\w\.]+)/i
|
332
|
+
// Opera Touch
|
333
|
+
],
|
334
|
+
[VERSION, [NAME, OPERA + " Touch"]],
|
335
|
+
[
|
336
|
+
/coc_coc\w+\/([\w\.]+)/i
|
337
|
+
// Coc Coc Browser
|
338
|
+
],
|
339
|
+
[VERSION, [NAME, "Coc Coc"]],
|
340
|
+
[
|
341
|
+
/dolfin\/([\w\.]+)/i
|
342
|
+
// Dolphin
|
343
|
+
],
|
344
|
+
[VERSION, [NAME, "Dolphin"]],
|
345
|
+
[
|
346
|
+
/coast\/([\w\.]+)/i
|
347
|
+
// Opera Coast
|
348
|
+
],
|
349
|
+
[VERSION, [NAME, OPERA + " Coast"]],
|
350
|
+
[
|
351
|
+
/miuibrowser\/([\w\.]+)/i
|
352
|
+
// MIUI Browser
|
353
|
+
],
|
354
|
+
[VERSION, [NAME, "MIUI " + BROWSER]],
|
355
|
+
[
|
356
|
+
/fxios\/([-\w\.]+)/i
|
357
|
+
// Firefox for iOS
|
358
|
+
],
|
359
|
+
[VERSION, [NAME, FIREFOX]],
|
360
|
+
[
|
361
|
+
/\bqihu|(qi?ho?o?|360)browser/i
|
362
|
+
// 360
|
363
|
+
],
|
364
|
+
[[NAME, "360 " + BROWSER]],
|
365
|
+
[
|
366
|
+
/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i
|
367
|
+
],
|
368
|
+
[[NAME, /(.+)/, "$1 " + BROWSER], VERSION],
|
369
|
+
[
|
370
|
+
// Oculus/Sailfish/HuaweiBrowser/VivoBrowser
|
371
|
+
/samsungbrowser\/([\w\.]+)/i
|
372
|
+
// Samsung Internet
|
373
|
+
],
|
374
|
+
[VERSION, [NAME, SAMSUNG + " Internet"]],
|
375
|
+
[
|
376
|
+
/(comodo_dragon)\/([\w\.]+)/i
|
377
|
+
// Comodo Dragon
|
378
|
+
],
|
379
|
+
[[NAME, /_/g, " "], VERSION],
|
380
|
+
[
|
381
|
+
/metasr[\/ ]?([\d\.]+)/i
|
382
|
+
// Sogou Explorer
|
383
|
+
],
|
384
|
+
[VERSION, [NAME, "Sogou Explorer"]],
|
385
|
+
[
|
386
|
+
/(sogou)mo\w+\/([\d\.]+)/i
|
387
|
+
// Sogou Mobile
|
388
|
+
],
|
389
|
+
[[NAME, "Sogou Mobile"], VERSION],
|
390
|
+
[
|
391
|
+
/(electron)\/([\w\.]+) safari/i,
|
392
|
+
// Electron-based App
|
393
|
+
/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,
|
394
|
+
// Tesla
|
395
|
+
/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i
|
396
|
+
// QQBrowser/2345 Browser
|
397
|
+
],
|
398
|
+
[NAME, VERSION],
|
399
|
+
[
|
400
|
+
/(lbbrowser)/i,
|
401
|
+
// LieBao Browser
|
402
|
+
/\[(linkedin)app\]/i
|
403
|
+
// LinkedIn App for iOS & Android
|
404
|
+
],
|
405
|
+
[NAME],
|
406
|
+
[
|
407
|
+
// WebView
|
408
|
+
/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i
|
409
|
+
// Facebook App for iOS & Android
|
410
|
+
],
|
411
|
+
[[NAME, FACEBOOK], VERSION],
|
412
|
+
[
|
413
|
+
/(Klarna)\/([\w\.]+)/i,
|
414
|
+
// Klarna Shopping Browser for iOS & Android
|
415
|
+
/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,
|
416
|
+
// Kakao App
|
417
|
+
/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,
|
418
|
+
// Naver InApp
|
419
|
+
/safari (line)\/([\w\.]+)/i,
|
420
|
+
// Line App for iOS
|
421
|
+
/\b(line)\/([\w\.]+)\/iab/i,
|
422
|
+
// Line App for Android
|
423
|
+
/(alipay)client\/([\w\.]+)/i,
|
424
|
+
// Alipay
|
425
|
+
/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i
|
426
|
+
// Chromium/Instagram/Snapchat
|
427
|
+
],
|
428
|
+
[NAME, VERSION],
|
429
|
+
[
|
430
|
+
/\bgsa\/([\w\.]+) .*safari\//i
|
431
|
+
// Google Search Appliance on iOS
|
432
|
+
],
|
433
|
+
[VERSION, [NAME, "GSA"]],
|
434
|
+
[
|
435
|
+
/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i
|
436
|
+
// TikTok
|
437
|
+
],
|
438
|
+
[VERSION, [NAME, "TikTok"]],
|
439
|
+
[
|
440
|
+
/headlesschrome(?:\/([\w\.]+)| )/i
|
441
|
+
// Chrome Headless
|
442
|
+
],
|
443
|
+
[VERSION, [NAME, CHROME + " Headless"]],
|
444
|
+
[
|
445
|
+
/ wv\).+(chrome)\/([\w\.]+)/i
|
446
|
+
// Chrome WebView
|
447
|
+
],
|
448
|
+
[[NAME, CHROME + " WebView"], VERSION],
|
449
|
+
[
|
450
|
+
/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
|
451
|
+
// Android Browser
|
452
|
+
],
|
453
|
+
[VERSION, [NAME, "Android " + BROWSER]],
|
454
|
+
[
|
455
|
+
/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i
|
456
|
+
// Chrome/OmniWeb/Arora/Tizen/Nokia
|
457
|
+
],
|
458
|
+
[NAME, VERSION],
|
459
|
+
[
|
460
|
+
/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i
|
461
|
+
// Mobile Safari
|
462
|
+
],
|
463
|
+
[VERSION, [NAME, "Mobile Safari"]],
|
464
|
+
[
|
465
|
+
/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i
|
466
|
+
// Safari & Safari Mobile
|
467
|
+
],
|
468
|
+
[VERSION, NAME],
|
469
|
+
[
|
470
|
+
/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i
|
471
|
+
// Safari < 3.0
|
472
|
+
],
|
473
|
+
[NAME, [VERSION, strMapper, oldSafariMap]],
|
474
|
+
[
|
475
|
+
/(webkit|khtml)\/([\w\.]+)/i
|
476
|
+
],
|
477
|
+
[NAME, VERSION],
|
478
|
+
[
|
479
|
+
// Gecko based
|
480
|
+
/(navigator|netscape\d?)\/([-\w\.]+)/i
|
481
|
+
// Netscape
|
482
|
+
],
|
483
|
+
[[NAME, "Netscape"], VERSION],
|
484
|
+
[
|
485
|
+
/mobile vr; rv:([\w\.]+)\).+firefox/i
|
486
|
+
// Firefox Reality
|
487
|
+
],
|
488
|
+
[VERSION, [NAME, FIREFOX + " Reality"]],
|
489
|
+
[
|
490
|
+
/ekiohf.+(flow)\/([\w\.]+)/i,
|
491
|
+
// Flow
|
492
|
+
/(swiftfox)/i,
|
493
|
+
// Swiftfox
|
494
|
+
/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,
|
495
|
+
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar
|
496
|
+
/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,
|
497
|
+
// Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
|
498
|
+
/(firefox)\/([\w\.]+)/i,
|
499
|
+
// Other Firefox-based
|
500
|
+
/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,
|
501
|
+
// Mozilla
|
502
|
+
// Other
|
503
|
+
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
|
504
|
+
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser
|
505
|
+
/(links) \(([\w\.]+)/i,
|
506
|
+
// Links
|
507
|
+
/panasonic;(viera)/i
|
508
|
+
// Panasonic Viera
|
509
|
+
],
|
510
|
+
[NAME, VERSION],
|
511
|
+
[
|
512
|
+
/(cobalt)\/([\w\.]+)/i
|
513
|
+
// Cobalt
|
514
|
+
],
|
515
|
+
[NAME, [VERSION, /master.|lts./, ""]]
|
516
|
+
],
|
517
|
+
cpu: [
|
518
|
+
[
|
519
|
+
/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i
|
520
|
+
// AMD64 (x64)
|
521
|
+
],
|
522
|
+
[[ARCHITECTURE, "amd64"]],
|
523
|
+
[
|
524
|
+
/(ia32(?=;))/i
|
525
|
+
// IA32 (quicktime)
|
526
|
+
],
|
527
|
+
[[ARCHITECTURE, lowerize]],
|
528
|
+
[
|
529
|
+
/((?:i[346]|x)86)[;\)]/i
|
530
|
+
// IA32 (x86)
|
531
|
+
],
|
532
|
+
[[ARCHITECTURE, "ia32"]],
|
533
|
+
[
|
534
|
+
/\b(aarch64|arm(v?8e?l?|_?64))\b/i
|
535
|
+
// ARM64
|
536
|
+
],
|
537
|
+
[[ARCHITECTURE, "arm64"]],
|
538
|
+
[
|
539
|
+
/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i
|
540
|
+
// ARMHF
|
541
|
+
],
|
542
|
+
[[ARCHITECTURE, "armhf"]],
|
543
|
+
[
|
544
|
+
// PocketPC mistakenly identified as PowerPC
|
545
|
+
/windows (ce|mobile); ppc;/i
|
546
|
+
],
|
547
|
+
[[ARCHITECTURE, "arm"]],
|
548
|
+
[
|
549
|
+
/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
|
550
|
+
// PowerPC
|
551
|
+
],
|
552
|
+
[[ARCHITECTURE, /ower/, EMPTY, lowerize]],
|
553
|
+
[
|
554
|
+
/(sun4\w)[;\)]/i
|
555
|
+
// SPARC
|
556
|
+
],
|
557
|
+
[[ARCHITECTURE, "sparc"]],
|
558
|
+
[
|
559
|
+
/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
|
560
|
+
// IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
|
561
|
+
],
|
562
|
+
[[ARCHITECTURE, lowerize]]
|
563
|
+
],
|
564
|
+
device: [
|
565
|
+
[
|
566
|
+
//////////////////////////
|
567
|
+
// MOBILES & TABLETS
|
568
|
+
/////////////////////////
|
569
|
+
// Samsung
|
570
|
+
/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i
|
571
|
+
],
|
572
|
+
[MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]],
|
573
|
+
[
|
574
|
+
/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
|
575
|
+
/samsung[- ]([-\w]+)/i,
|
576
|
+
/sec-(sgh\w+)/i
|
577
|
+
],
|
578
|
+
[MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]],
|
579
|
+
[
|
580
|
+
// Apple
|
581
|
+
/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i
|
582
|
+
// iPod/iPhone
|
583
|
+
],
|
584
|
+
[MODEL, [VENDOR, APPLE], [TYPE, MOBILE]],
|
585
|
+
[
|
586
|
+
/\((ipad);[-\w\),; ]+apple/i,
|
587
|
+
// iPad
|
588
|
+
/applecoremedia\/[\w\.]+ \((ipad)/i,
|
589
|
+
/\b(ipad)\d\d?,\d\d?[;\]].+ios/i
|
590
|
+
],
|
591
|
+
[MODEL, [VENDOR, APPLE], [TYPE, TABLET]],
|
592
|
+
[
|
593
|
+
/(macintosh);/i
|
594
|
+
],
|
595
|
+
[MODEL, [VENDOR, APPLE]],
|
596
|
+
[
|
597
|
+
// Sharp
|
598
|
+
/\b(sh-?[altvz]?\d\d[a-ekm]?)/i
|
599
|
+
],
|
600
|
+
[MODEL, [VENDOR, SHARP], [TYPE, MOBILE]],
|
601
|
+
[
|
602
|
+
// Huawei
|
603
|
+
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
|
604
|
+
],
|
605
|
+
[MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]],
|
606
|
+
[
|
607
|
+
/(?:huawei|honor)([-\w ]+)[;\)]/i,
|
608
|
+
/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
|
609
|
+
],
|
610
|
+
[MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]],
|
611
|
+
[
|
612
|
+
// Xiaomi
|
613
|
+
/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,
|
614
|
+
// Xiaomi POCO
|
615
|
+
/\b; (\w+) build\/hm\1/i,
|
616
|
+
// Xiaomi Hongmi 'numeric' models
|
617
|
+
/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,
|
618
|
+
// Xiaomi Hongmi
|
619
|
+
/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,
|
620
|
+
// Xiaomi Redmi
|
621
|
+
/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,
|
622
|
+
// Xiaomi Redmi 'numeric' models
|
623
|
+
/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
|
624
|
+
// Xiaomi Mi
|
625
|
+
],
|
626
|
+
[[MODEL, /_/g, " "], [VENDOR, XIAOMI], [TYPE, MOBILE]],
|
627
|
+
[
|
628
|
+
/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,
|
629
|
+
// Redmi Pad
|
630
|
+
/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
|
631
|
+
// Mi Pad tablets
|
632
|
+
],
|
633
|
+
[[MODEL, /_/g, " "], [VENDOR, XIAOMI], [TYPE, TABLET]],
|
634
|
+
[
|
635
|
+
// OPPO
|
636
|
+
/; (\w+) bui.+ oppo/i,
|
637
|
+
/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
|
638
|
+
],
|
639
|
+
[MODEL, [VENDOR, "OPPO"], [TYPE, MOBILE]],
|
640
|
+
[
|
641
|
+
// Vivo
|
642
|
+
/vivo (\w+)(?: bui|\))/i,
|
643
|
+
/\b(v[12]\d{3}\w?[at])(?: bui|;)/i
|
644
|
+
],
|
645
|
+
[MODEL, [VENDOR, "Vivo"], [TYPE, MOBILE]],
|
646
|
+
[
|
647
|
+
// Realme
|
648
|
+
/\b(rmx[1-3]\d{3})(?: bui|;|\))/i
|
649
|
+
],
|
650
|
+
[MODEL, [VENDOR, "Realme"], [TYPE, MOBILE]],
|
651
|
+
[
|
652
|
+
// Motorola
|
653
|
+
/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
|
654
|
+
/\bmot(?:orola)?[- ](\w*)/i,
|
655
|
+
/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
|
656
|
+
],
|
657
|
+
[MODEL, [VENDOR, MOTOROLA], [TYPE, MOBILE]],
|
658
|
+
[
|
659
|
+
/\b(mz60\d|xoom[2 ]{0,2}) build\//i
|
660
|
+
],
|
661
|
+
[MODEL, [VENDOR, MOTOROLA], [TYPE, TABLET]],
|
662
|
+
[
|
663
|
+
// LG
|
664
|
+
/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
|
665
|
+
],
|
666
|
+
[MODEL, [VENDOR, LG], [TYPE, TABLET]],
|
667
|
+
[
|
668
|
+
/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
|
669
|
+
/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
|
670
|
+
/\blg-?([\d\w]+) bui/i
|
671
|
+
],
|
672
|
+
[MODEL, [VENDOR, LG], [TYPE, MOBILE]],
|
673
|
+
[
|
674
|
+
// Lenovo
|
675
|
+
/(ideatab[-\w ]+)/i,
|
676
|
+
/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
|
677
|
+
],
|
678
|
+
[MODEL, [VENDOR, "Lenovo"], [TYPE, TABLET]],
|
679
|
+
[
|
680
|
+
// Nokia
|
681
|
+
/(?:maemo|nokia).*(n900|lumia \d+)/i,
|
682
|
+
/nokia[-_ ]?([-\w\.]*)/i
|
683
|
+
],
|
684
|
+
[[MODEL, /_/g, " "], [VENDOR, "Nokia"], [TYPE, MOBILE]],
|
685
|
+
[
|
686
|
+
// Google
|
687
|
+
/(pixel c)\b/i
|
688
|
+
// Google Pixel C
|
689
|
+
],
|
690
|
+
[MODEL, [VENDOR, GOOGLE], [TYPE, TABLET]],
|
691
|
+
[
|
692
|
+
/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
|
693
|
+
// Google Pixel
|
694
|
+
],
|
695
|
+
[MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]],
|
696
|
+
[
|
697
|
+
// Sony
|
698
|
+
/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
|
699
|
+
],
|
700
|
+
[MODEL, [VENDOR, SONY], [TYPE, MOBILE]],
|
701
|
+
[
|
702
|
+
/sony tablet [ps]/i,
|
703
|
+
/\b(?:sony)?sgp\w+(?: bui|\))/i
|
704
|
+
],
|
705
|
+
[[MODEL, "Xperia Tablet"], [VENDOR, SONY], [TYPE, TABLET]],
|
706
|
+
[
|
707
|
+
// OnePlus
|
708
|
+
/ (kb2005|in20[12]5|be20[12][59])\b/i,
|
709
|
+
/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
|
710
|
+
],
|
711
|
+
[MODEL, [VENDOR, "OnePlus"], [TYPE, MOBILE]],
|
712
|
+
[
|
713
|
+
// Amazon
|
714
|
+
/(alexa)webm/i,
|
715
|
+
/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,
|
716
|
+
// Kindle Fire without Silk / Echo Show
|
717
|
+
/(kf[a-z]+)( bui|\)).+silk\//i
|
718
|
+
// Kindle Fire HD
|
719
|
+
],
|
720
|
+
[MODEL, [VENDOR, AMAZON], [TYPE, TABLET]],
|
721
|
+
[
|
722
|
+
/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
|
723
|
+
// Fire Phone
|
724
|
+
],
|
725
|
+
[[MODEL, /(.+)/g, "Fire Phone $1"], [VENDOR, AMAZON], [TYPE, MOBILE]],
|
726
|
+
[
|
727
|
+
// BlackBerry
|
728
|
+
/(playbook);[-\w\),; ]+(rim)/i
|
729
|
+
// BlackBerry PlayBook
|
730
|
+
],
|
731
|
+
[MODEL, VENDOR, [TYPE, TABLET]],
|
732
|
+
[
|
733
|
+
/\b((?:bb[a-f]|st[hv])100-\d)/i,
|
734
|
+
/\(bb10; (\w+)/i
|
735
|
+
// BlackBerry 10
|
736
|
+
],
|
737
|
+
[MODEL, [VENDOR, BLACKBERRY], [TYPE, MOBILE]],
|
738
|
+
[
|
739
|
+
// Asus
|
740
|
+
/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
|
741
|
+
],
|
742
|
+
[MODEL, [VENDOR, ASUS], [TYPE, TABLET]],
|
743
|
+
[
|
744
|
+
/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
|
745
|
+
],
|
746
|
+
[MODEL, [VENDOR, ASUS], [TYPE, MOBILE]],
|
747
|
+
[
|
748
|
+
// HTC
|
749
|
+
/(nexus 9)/i
|
750
|
+
// HTC Nexus 9
|
751
|
+
],
|
752
|
+
[MODEL, [VENDOR, "HTC"], [TYPE, TABLET]],
|
753
|
+
[
|
754
|
+
/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
|
755
|
+
// HTC
|
756
|
+
// ZTE
|
757
|
+
/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,
|
758
|
+
/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i
|
759
|
+
// Alcatel/GeeksPhone/Nexian/Panasonic/Sony
|
760
|
+
],
|
761
|
+
[VENDOR, [MODEL, /_/g, " "], [TYPE, MOBILE]],
|
762
|
+
[
|
763
|
+
// Acer
|
764
|
+
/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
|
765
|
+
],
|
766
|
+
[MODEL, [VENDOR, "Acer"], [TYPE, TABLET]],
|
767
|
+
[
|
768
|
+
// Meizu
|
769
|
+
/droid.+; (m[1-5] note) bui/i,
|
770
|
+
/\bmz-([-\w]{2,})/i
|
771
|
+
],
|
772
|
+
[MODEL, [VENDOR, "Meizu"], [TYPE, MOBILE]],
|
773
|
+
[
|
774
|
+
// Ulefone
|
775
|
+
/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i
|
776
|
+
],
|
777
|
+
[MODEL, [VENDOR, "Ulefone"], [TYPE, MOBILE]],
|
778
|
+
[
|
779
|
+
// MIXED
|
780
|
+
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,
|
781
|
+
// BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron
|
782
|
+
/(hp) ([\w ]+\w)/i,
|
783
|
+
// HP iPAQ
|
784
|
+
/(asus)-?(\w+)/i,
|
785
|
+
// Asus
|
786
|
+
/(microsoft); (lumia[\w ]+)/i,
|
787
|
+
// Microsoft Lumia
|
788
|
+
/(lenovo)[-_ ]?([-\w]+)/i,
|
789
|
+
// Lenovo
|
790
|
+
/(jolla)/i,
|
791
|
+
// Jolla
|
792
|
+
/(oppo) ?([\w ]+) bui/i
|
793
|
+
// OPPO
|
794
|
+
],
|
795
|
+
[VENDOR, MODEL, [TYPE, MOBILE]],
|
796
|
+
[
|
797
|
+
/(kobo)\s(ereader|touch)/i,
|
798
|
+
// Kobo
|
799
|
+
/(archos) (gamepad2?)/i,
|
800
|
+
// Archos
|
801
|
+
/(hp).+(touchpad(?!.+tablet)|tablet)/i,
|
802
|
+
// HP TouchPad
|
803
|
+
/(kindle)\/([\w\.]+)/i,
|
804
|
+
// Kindle
|
805
|
+
/(nook)[\w ]+build\/(\w+)/i,
|
806
|
+
// Nook
|
807
|
+
/(dell) (strea[kpr\d ]*[\dko])/i,
|
808
|
+
// Dell Streak
|
809
|
+
/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,
|
810
|
+
// Le Pan Tablets
|
811
|
+
/(trinity)[- ]*(t\d{3}) bui/i,
|
812
|
+
// Trinity Tablets
|
813
|
+
/(gigaset)[- ]+(q\w{1,9}) bui/i,
|
814
|
+
// Gigaset Tablets
|
815
|
+
/(vodafone) ([\w ]+)(?:\)| bui)/i
|
816
|
+
// Vodafone
|
817
|
+
],
|
818
|
+
[VENDOR, MODEL, [TYPE, TABLET]],
|
819
|
+
[
|
820
|
+
/(surface duo)/i
|
821
|
+
// Surface Duo
|
822
|
+
],
|
823
|
+
[MODEL, [VENDOR, MICROSOFT], [TYPE, TABLET]],
|
824
|
+
[
|
825
|
+
/droid [\d\.]+; (fp\du?)(?: b|\))/i
|
826
|
+
// Fairphone
|
827
|
+
],
|
828
|
+
[MODEL, [VENDOR, "Fairphone"], [TYPE, MOBILE]],
|
829
|
+
[
|
830
|
+
/(u304aa)/i
|
831
|
+
// AT&T
|
832
|
+
],
|
833
|
+
[MODEL, [VENDOR, "AT&T"], [TYPE, MOBILE]],
|
834
|
+
[
|
835
|
+
/\bsie-(\w*)/i
|
836
|
+
// Siemens
|
837
|
+
],
|
838
|
+
[MODEL, [VENDOR, "Siemens"], [TYPE, MOBILE]],
|
839
|
+
[
|
840
|
+
/\b(rct\w+) b/i
|
841
|
+
// RCA Tablets
|
842
|
+
],
|
843
|
+
[MODEL, [VENDOR, "RCA"], [TYPE, TABLET]],
|
844
|
+
[
|
845
|
+
/\b(venue[\d ]{2,7}) b/i
|
846
|
+
// Dell Venue Tablets
|
847
|
+
],
|
848
|
+
[MODEL, [VENDOR, "Dell"], [TYPE, TABLET]],
|
849
|
+
[
|
850
|
+
/\b(q(?:mv|ta)\w+) b/i
|
851
|
+
// Verizon Tablet
|
852
|
+
],
|
853
|
+
[MODEL, [VENDOR, "Verizon"], [TYPE, TABLET]],
|
854
|
+
[
|
855
|
+
/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i
|
856
|
+
// Barnes & Noble Tablet
|
857
|
+
],
|
858
|
+
[MODEL, [VENDOR, "Barnes & Noble"], [TYPE, TABLET]],
|
859
|
+
[
|
860
|
+
/\b(tm\d{3}\w+) b/i
|
861
|
+
],
|
862
|
+
[MODEL, [VENDOR, "NuVision"], [TYPE, TABLET]],
|
863
|
+
[
|
864
|
+
/\b(k88) b/i
|
865
|
+
// ZTE K Series Tablet
|
866
|
+
],
|
867
|
+
[MODEL, [VENDOR, "ZTE"], [TYPE, TABLET]],
|
868
|
+
[
|
869
|
+
/\b(nx\d{3}j) b/i
|
870
|
+
// ZTE Nubia
|
871
|
+
],
|
872
|
+
[MODEL, [VENDOR, "ZTE"], [TYPE, MOBILE]],
|
873
|
+
[
|
874
|
+
/\b(gen\d{3}) b.+49h/i
|
875
|
+
// Swiss GEN Mobile
|
876
|
+
],
|
877
|
+
[MODEL, [VENDOR, "Swiss"], [TYPE, MOBILE]],
|
878
|
+
[
|
879
|
+
/\b(zur\d{3}) b/i
|
880
|
+
// Swiss ZUR Tablet
|
881
|
+
],
|
882
|
+
[MODEL, [VENDOR, "Swiss"], [TYPE, TABLET]],
|
883
|
+
[
|
884
|
+
/\b((zeki)?tb.*\b) b/i
|
885
|
+
// Zeki Tablets
|
886
|
+
],
|
887
|
+
[MODEL, [VENDOR, "Zeki"], [TYPE, TABLET]],
|
888
|
+
[
|
889
|
+
/\b([yr]\d{2}) b/i,
|
890
|
+
/\b(dragon[- ]+touch |dt)(\w{5}) b/i
|
891
|
+
// Dragon Touch Tablet
|
892
|
+
],
|
893
|
+
[[VENDOR, "Dragon Touch"], MODEL, [TYPE, TABLET]],
|
894
|
+
[
|
895
|
+
/\b(ns-?\w{0,9}) b/i
|
896
|
+
// Insignia Tablets
|
897
|
+
],
|
898
|
+
[MODEL, [VENDOR, "Insignia"], [TYPE, TABLET]],
|
899
|
+
[
|
900
|
+
/\b((nxa|next)-?\w{0,9}) b/i
|
901
|
+
// NextBook Tablets
|
902
|
+
],
|
903
|
+
[MODEL, [VENDOR, "NextBook"], [TYPE, TABLET]],
|
904
|
+
[
|
905
|
+
/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i
|
906
|
+
// Voice Xtreme Phones
|
907
|
+
],
|
908
|
+
[[VENDOR, "Voice"], MODEL, [TYPE, MOBILE]],
|
909
|
+
[
|
910
|
+
/\b(lvtel\-)?(v1[12]) b/i
|
911
|
+
// LvTel Phones
|
912
|
+
],
|
913
|
+
[[VENDOR, "LvTel"], MODEL, [TYPE, MOBILE]],
|
914
|
+
[
|
915
|
+
/\b(ph-1) /i
|
916
|
+
// Essential PH-1
|
917
|
+
],
|
918
|
+
[MODEL, [VENDOR, "Essential"], [TYPE, MOBILE]],
|
919
|
+
[
|
920
|
+
/\b(v(100md|700na|7011|917g).*\b) b/i
|
921
|
+
// Envizen Tablets
|
922
|
+
],
|
923
|
+
[MODEL, [VENDOR, "Envizen"], [TYPE, TABLET]],
|
924
|
+
[
|
925
|
+
/\b(trio[-\w\. ]+) b/i
|
926
|
+
// MachSpeed Tablets
|
927
|
+
],
|
928
|
+
[MODEL, [VENDOR, "MachSpeed"], [TYPE, TABLET]],
|
929
|
+
[
|
930
|
+
/\btu_(1491) b/i
|
931
|
+
// Rotor Tablets
|
932
|
+
],
|
933
|
+
[MODEL, [VENDOR, "Rotor"], [TYPE, TABLET]],
|
934
|
+
[
|
935
|
+
/(shield[\w ]+) b/i
|
936
|
+
// Nvidia Shield Tablets
|
937
|
+
],
|
938
|
+
[MODEL, [VENDOR, "Nvidia"], [TYPE, TABLET]],
|
939
|
+
[
|
940
|
+
/(sprint) (\w+)/i
|
941
|
+
// Sprint Phones
|
942
|
+
],
|
943
|
+
[VENDOR, MODEL, [TYPE, MOBILE]],
|
944
|
+
[
|
945
|
+
/(kin\.[onetw]{3})/i
|
946
|
+
// Microsoft Kin
|
947
|
+
],
|
948
|
+
[[MODEL, /\./g, " "], [VENDOR, MICROSOFT], [TYPE, MOBILE]],
|
949
|
+
[
|
950
|
+
/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
|
951
|
+
// Zebra
|
952
|
+
],
|
953
|
+
[MODEL, [VENDOR, ZEBRA], [TYPE, TABLET]],
|
954
|
+
[
|
955
|
+
/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
|
956
|
+
],
|
957
|
+
[MODEL, [VENDOR, ZEBRA], [TYPE, MOBILE]],
|
958
|
+
[
|
959
|
+
///////////////////
|
960
|
+
// SMARTTVS
|
961
|
+
///////////////////
|
962
|
+
/smart-tv.+(samsung)/i
|
963
|
+
// Samsung
|
964
|
+
],
|
965
|
+
[VENDOR, [TYPE, SMARTTV]],
|
966
|
+
[
|
967
|
+
/hbbtv.+maple;(\d+)/i
|
968
|
+
],
|
969
|
+
[[MODEL, /^/, "SmartTV"], [VENDOR, SAMSUNG], [TYPE, SMARTTV]],
|
970
|
+
[
|
971
|
+
/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
|
972
|
+
// LG SmartTV
|
973
|
+
],
|
974
|
+
[[VENDOR, LG], [TYPE, SMARTTV]],
|
975
|
+
[
|
976
|
+
/(apple) ?tv/i
|
977
|
+
// Apple TV
|
978
|
+
],
|
979
|
+
[VENDOR, [MODEL, APPLE + " TV"], [TYPE, SMARTTV]],
|
980
|
+
[
|
981
|
+
/crkey/i
|
982
|
+
// Google Chromecast
|
983
|
+
],
|
984
|
+
[[MODEL, CHROME + "cast"], [VENDOR, GOOGLE], [TYPE, SMARTTV]],
|
985
|
+
[
|
986
|
+
/droid.+aft(\w+)( bui|\))/i
|
987
|
+
// Fire TV
|
988
|
+
],
|
989
|
+
[MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]],
|
990
|
+
[
|
991
|
+
/\(dtv[\);].+(aquos)/i,
|
992
|
+
/(aquos-tv[\w ]+)\)/i
|
993
|
+
// Sharp
|
994
|
+
],
|
995
|
+
[MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]],
|
996
|
+
[
|
997
|
+
/(bravia[\w ]+)( bui|\))/i
|
998
|
+
// Sony
|
999
|
+
],
|
1000
|
+
[MODEL, [VENDOR, SONY], [TYPE, SMARTTV]],
|
1001
|
+
[
|
1002
|
+
/(mitv-\w{5}) bui/i
|
1003
|
+
// Xiaomi
|
1004
|
+
],
|
1005
|
+
[MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]],
|
1006
|
+
[
|
1007
|
+
/Hbbtv.*(technisat) (.*);/i
|
1008
|
+
// TechniSAT
|
1009
|
+
],
|
1010
|
+
[VENDOR, MODEL, [TYPE, SMARTTV]],
|
1011
|
+
[
|
1012
|
+
/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
|
1013
|
+
// Roku
|
1014
|
+
/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i
|
1015
|
+
// HbbTV devices
|
1016
|
+
],
|
1017
|
+
[[VENDOR, trim], [MODEL, trim], [TYPE, SMARTTV]],
|
1018
|
+
[
|
1019
|
+
/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
|
1020
|
+
// SmartTV from Unidentified Vendors
|
1021
|
+
],
|
1022
|
+
[[TYPE, SMARTTV]],
|
1023
|
+
[
|
1024
|
+
///////////////////
|
1025
|
+
// CONSOLES
|
1026
|
+
///////////////////
|
1027
|
+
/(ouya)/i,
|
1028
|
+
// Ouya
|
1029
|
+
/(nintendo) ([wids3utch]+)/i
|
1030
|
+
// Nintendo
|
1031
|
+
],
|
1032
|
+
[VENDOR, MODEL, [TYPE, CONSOLE]],
|
1033
|
+
[
|
1034
|
+
/droid.+; (shield) bui/i
|
1035
|
+
// Nvidia
|
1036
|
+
],
|
1037
|
+
[MODEL, [VENDOR, "Nvidia"], [TYPE, CONSOLE]],
|
1038
|
+
[
|
1039
|
+
/(playstation [345portablevi]+)/i
|
1040
|
+
// Playstation
|
1041
|
+
],
|
1042
|
+
[MODEL, [VENDOR, SONY], [TYPE, CONSOLE]],
|
1043
|
+
[
|
1044
|
+
/\b(xbox(?: one)?(?!; xbox))[\); ]/i
|
1045
|
+
// Microsoft Xbox
|
1046
|
+
],
|
1047
|
+
[MODEL, [VENDOR, MICROSOFT], [TYPE, CONSOLE]],
|
1048
|
+
[
|
1049
|
+
///////////////////
|
1050
|
+
// WEARABLES
|
1051
|
+
///////////////////
|
1052
|
+
/((pebble))app/i
|
1053
|
+
// Pebble
|
1054
|
+
],
|
1055
|
+
[VENDOR, MODEL, [TYPE, WEARABLE]],
|
1056
|
+
[
|
1057
|
+
/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i
|
1058
|
+
// Apple Watch
|
1059
|
+
],
|
1060
|
+
[MODEL, [VENDOR, APPLE], [TYPE, WEARABLE]],
|
1061
|
+
[
|
1062
|
+
/droid.+; (glass) \d/i
|
1063
|
+
// Google Glass
|
1064
|
+
],
|
1065
|
+
[MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]],
|
1066
|
+
[
|
1067
|
+
/droid.+; (wt63?0{2,3})\)/i
|
1068
|
+
],
|
1069
|
+
[MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]],
|
1070
|
+
[
|
1071
|
+
/(quest( 2| pro)?)/i
|
1072
|
+
// Oculus Quest
|
1073
|
+
],
|
1074
|
+
[MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]],
|
1075
|
+
[
|
1076
|
+
///////////////////
|
1077
|
+
// EMBEDDED
|
1078
|
+
///////////////////
|
1079
|
+
/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
|
1080
|
+
// Tesla
|
1081
|
+
],
|
1082
|
+
[VENDOR, [TYPE, EMBEDDED]],
|
1083
|
+
[
|
1084
|
+
/(aeobc)\b/i
|
1085
|
+
// Echo Dot
|
1086
|
+
],
|
1087
|
+
[MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]],
|
1088
|
+
[
|
1089
|
+
////////////////////
|
1090
|
+
// MIXED (GENERIC)
|
1091
|
+
///////////////////
|
1092
|
+
/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i
|
1093
|
+
// Android Phones from Unidentified Vendors
|
1094
|
+
],
|
1095
|
+
[MODEL, [TYPE, MOBILE]],
|
1096
|
+
[
|
1097
|
+
/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
|
1098
|
+
// Android Tablets from Unidentified Vendors
|
1099
|
+
],
|
1100
|
+
[MODEL, [TYPE, TABLET]],
|
1101
|
+
[
|
1102
|
+
/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i
|
1103
|
+
// Unidentifiable Tablet
|
1104
|
+
],
|
1105
|
+
[[TYPE, TABLET]],
|
1106
|
+
[
|
1107
|
+
/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i
|
1108
|
+
// Unidentifiable Mobile
|
1109
|
+
],
|
1110
|
+
[[TYPE, MOBILE]],
|
1111
|
+
[
|
1112
|
+
/(android[-\w\. ]{0,9});.+buil/i
|
1113
|
+
// Generic Android Device
|
1114
|
+
],
|
1115
|
+
[MODEL, [VENDOR, "Generic"]]
|
1116
|
+
],
|
1117
|
+
engine: [
|
1118
|
+
[
|
1119
|
+
/windows.+ edge\/([\w\.]+)/i
|
1120
|
+
// EdgeHTML
|
1121
|
+
],
|
1122
|
+
[VERSION, [NAME, EDGE + "HTML"]],
|
1123
|
+
[
|
1124
|
+
/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
|
1125
|
+
// Blink
|
1126
|
+
],
|
1127
|
+
[VERSION, [NAME, "Blink"]],
|
1128
|
+
[
|
1129
|
+
/(presto)\/([\w\.]+)/i,
|
1130
|
+
// Presto
|
1131
|
+
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,
|
1132
|
+
// WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
|
1133
|
+
/ekioh(flow)\/([\w\.]+)/i,
|
1134
|
+
// Flow
|
1135
|
+
/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,
|
1136
|
+
// KHTML/Tasman/Links
|
1137
|
+
/(icab)[\/ ]([23]\.[\d\.]+)/i,
|
1138
|
+
// iCab
|
1139
|
+
/\b(libweb)/i
|
1140
|
+
],
|
1141
|
+
[NAME, VERSION],
|
1142
|
+
[
|
1143
|
+
/rv\:([\w\.]{1,9})\b.+(gecko)/i
|
1144
|
+
// Gecko
|
1145
|
+
],
|
1146
|
+
[VERSION, NAME]
|
1147
|
+
],
|
1148
|
+
os: [
|
1149
|
+
[
|
1150
|
+
// Windows
|
1151
|
+
/microsoft (windows) (vista|xp)/i
|
1152
|
+
// Windows (iTunes)
|
1153
|
+
],
|
1154
|
+
[NAME, VERSION],
|
1155
|
+
[
|
1156
|
+
/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i
|
1157
|
+
// Windows Phone
|
1158
|
+
],
|
1159
|
+
[NAME, [VERSION, strMapper, windowsVersionMap]],
|
1160
|
+
[
|
1161
|
+
/windows nt 6\.2; (arm)/i,
|
1162
|
+
// Windows RT
|
1163
|
+
/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,
|
1164
|
+
/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
|
1165
|
+
],
|
1166
|
+
[[VERSION, strMapper, windowsVersionMap], [NAME, "Windows"]],
|
1167
|
+
[
|
1168
|
+
// iOS/macOS
|
1169
|
+
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
|
1170
|
+
// iOS
|
1171
|
+
/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,
|
1172
|
+
/cfnetwork\/.+darwin/i
|
1173
|
+
],
|
1174
|
+
[[VERSION, /_/g, "."], [NAME, "iOS"]],
|
1175
|
+
[
|
1176
|
+
/(mac os x) ?([\w\. ]*)/i,
|
1177
|
+
/(macintosh|mac_powerpc\b)(?!.+haiku)/i
|
1178
|
+
// Mac OS
|
1179
|
+
],
|
1180
|
+
[[NAME, MAC_OS], [VERSION, /_/g, "."]],
|
1181
|
+
[
|
1182
|
+
// Mobile OSes
|
1183
|
+
/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i
|
1184
|
+
// Android-x86/HarmonyOS
|
1185
|
+
],
|
1186
|
+
[VERSION, NAME],
|
1187
|
+
[
|
1188
|
+
// Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS
|
1189
|
+
/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,
|
1190
|
+
/(blackberry)\w*\/([\w\.]*)/i,
|
1191
|
+
// Blackberry
|
1192
|
+
/(tizen|kaios)[\/ ]([\w\.]+)/i,
|
1193
|
+
// Tizen/KaiOS
|
1194
|
+
/\((series40);/i
|
1195
|
+
// Series 40
|
1196
|
+
],
|
1197
|
+
[NAME, VERSION],
|
1198
|
+
[
|
1199
|
+
/\(bb(10);/i
|
1200
|
+
// BlackBerry 10
|
1201
|
+
],
|
1202
|
+
[VERSION, [NAME, BLACKBERRY]],
|
1203
|
+
[
|
1204
|
+
/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
|
1205
|
+
// Symbian
|
1206
|
+
],
|
1207
|
+
[VERSION, [NAME, "Symbian"]],
|
1208
|
+
[
|
1209
|
+
/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i
|
1210
|
+
// Firefox OS
|
1211
|
+
],
|
1212
|
+
[VERSION, [NAME, FIREFOX + " OS"]],
|
1213
|
+
[
|
1214
|
+
/web0s;.+rt(tv)/i,
|
1215
|
+
/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i
|
1216
|
+
// WebOS
|
1217
|
+
],
|
1218
|
+
[VERSION, [NAME, "webOS"]],
|
1219
|
+
[
|
1220
|
+
/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i
|
1221
|
+
// watchOS
|
1222
|
+
],
|
1223
|
+
[VERSION, [NAME, "watchOS"]],
|
1224
|
+
[
|
1225
|
+
// Google Chromecast
|
1226
|
+
/crkey\/([\d\.]+)/i
|
1227
|
+
// Google Chromecast
|
1228
|
+
],
|
1229
|
+
[VERSION, [NAME, CHROME + "cast"]],
|
1230
|
+
[
|
1231
|
+
/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i
|
1232
|
+
// Chromium OS
|
1233
|
+
],
|
1234
|
+
[[NAME, CHROMIUM_OS], VERSION],
|
1235
|
+
[
|
1236
|
+
// Smart TVs
|
1237
|
+
/panasonic;(viera)/i,
|
1238
|
+
// Panasonic Viera
|
1239
|
+
/(netrange)mmh/i,
|
1240
|
+
// Netrange
|
1241
|
+
/(nettv)\/(\d+\.[\w\.]+)/i,
|
1242
|
+
// NetTV
|
1243
|
+
// Console
|
1244
|
+
/(nintendo|playstation) ([wids345portablevuch]+)/i,
|
1245
|
+
// Nintendo/Playstation
|
1246
|
+
/(xbox); +xbox ([^\);]+)/i,
|
1247
|
+
// Microsoft Xbox (360, One, X, S, Series X, Series S)
|
1248
|
+
// Other
|
1249
|
+
/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,
|
1250
|
+
// Joli/Palm
|
1251
|
+
/(mint)[\/\(\) ]?(\w*)/i,
|
1252
|
+
// Mint
|
1253
|
+
/(mageia|vectorlinux)[; ]/i,
|
1254
|
+
// Mageia/VectorLinux
|
1255
|
+
/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,
|
1256
|
+
// Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire
|
1257
|
+
/(hurd|linux) ?([\w\.]*)/i,
|
1258
|
+
// Hurd/Linux
|
1259
|
+
/(gnu) ?([\w\.]*)/i,
|
1260
|
+
// GNU
|
1261
|
+
/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,
|
1262
|
+
// FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly
|
1263
|
+
/(haiku) (\w+)/i
|
1264
|
+
// Haiku
|
1265
|
+
],
|
1266
|
+
[NAME, VERSION],
|
1267
|
+
[
|
1268
|
+
/(sunos) ?([\w\.\d]*)/i
|
1269
|
+
// Solaris
|
1270
|
+
],
|
1271
|
+
[[NAME, "Solaris"], VERSION],
|
1272
|
+
[
|
1273
|
+
/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,
|
1274
|
+
// Solaris
|
1275
|
+
/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,
|
1276
|
+
// AIX
|
1277
|
+
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,
|
1278
|
+
// BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS
|
1279
|
+
/(unix) ?([\w\.]*)/i
|
1280
|
+
// UNIX
|
1281
|
+
],
|
1282
|
+
[NAME, VERSION]
|
1283
|
+
]
|
1284
|
+
};
|
1285
|
+
var UAParser2 = function(ua, extensions) {
|
1286
|
+
if (typeof ua === OBJ_TYPE) {
|
1287
|
+
extensions = ua;
|
1288
|
+
ua = undefined2;
|
1289
|
+
}
|
1290
|
+
if (!(this instanceof UAParser2)) {
|
1291
|
+
return new UAParser2(ua, extensions).getResult();
|
1292
|
+
}
|
1293
|
+
var _navigator = typeof window2 !== UNDEF_TYPE && window2.navigator ? window2.navigator : undefined2;
|
1294
|
+
var _ua = ua || (_navigator && _navigator.userAgent ? _navigator.userAgent : EMPTY);
|
1295
|
+
var _uach = _navigator && _navigator.userAgentData ? _navigator.userAgentData : undefined2;
|
1296
|
+
var _rgxmap = extensions ? extend(regexes, extensions) : regexes;
|
1297
|
+
var _isSelfNav = _navigator && _navigator.userAgent == _ua;
|
1298
|
+
this.getBrowser = function() {
|
1299
|
+
var _browser = {};
|
1300
|
+
_browser[NAME] = undefined2;
|
1301
|
+
_browser[VERSION] = undefined2;
|
1302
|
+
rgxMapper.call(_browser, _ua, _rgxmap.browser);
|
1303
|
+
_browser[MAJOR] = majorize(_browser[VERSION]);
|
1304
|
+
if (_isSelfNav && _navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) {
|
1305
|
+
_browser[NAME] = "Brave";
|
1306
|
+
}
|
1307
|
+
return _browser;
|
1308
|
+
};
|
1309
|
+
this.getCPU = function() {
|
1310
|
+
var _cpu = {};
|
1311
|
+
_cpu[ARCHITECTURE] = undefined2;
|
1312
|
+
rgxMapper.call(_cpu, _ua, _rgxmap.cpu);
|
1313
|
+
return _cpu;
|
1314
|
+
};
|
1315
|
+
this.getDevice = function() {
|
1316
|
+
var _device = {};
|
1317
|
+
_device[VENDOR] = undefined2;
|
1318
|
+
_device[MODEL] = undefined2;
|
1319
|
+
_device[TYPE] = undefined2;
|
1320
|
+
rgxMapper.call(_device, _ua, _rgxmap.device);
|
1321
|
+
if (_isSelfNav && !_device[TYPE] && _uach && _uach.mobile) {
|
1322
|
+
_device[TYPE] = MOBILE;
|
1323
|
+
}
|
1324
|
+
if (_isSelfNav && _device[MODEL] == "Macintosh" && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) {
|
1325
|
+
_device[MODEL] = "iPad";
|
1326
|
+
_device[TYPE] = TABLET;
|
1327
|
+
}
|
1328
|
+
return _device;
|
1329
|
+
};
|
1330
|
+
this.getEngine = function() {
|
1331
|
+
var _engine = {};
|
1332
|
+
_engine[NAME] = undefined2;
|
1333
|
+
_engine[VERSION] = undefined2;
|
1334
|
+
rgxMapper.call(_engine, _ua, _rgxmap.engine);
|
1335
|
+
return _engine;
|
1336
|
+
};
|
1337
|
+
this.getOS = function() {
|
1338
|
+
var _os = {};
|
1339
|
+
_os[NAME] = undefined2;
|
1340
|
+
_os[VERSION] = undefined2;
|
1341
|
+
rgxMapper.call(_os, _ua, _rgxmap.os);
|
1342
|
+
if (_isSelfNav && !_os[NAME] && _uach && _uach.platform != "Unknown") {
|
1343
|
+
_os[NAME] = _uach.platform.replace(/chrome os/i, CHROMIUM_OS).replace(/macos/i, MAC_OS);
|
1344
|
+
}
|
1345
|
+
return _os;
|
1346
|
+
};
|
1347
|
+
this.getResult = function() {
|
1348
|
+
return {
|
1349
|
+
ua: this.getUA(),
|
1350
|
+
browser: this.getBrowser(),
|
1351
|
+
engine: this.getEngine(),
|
1352
|
+
os: this.getOS(),
|
1353
|
+
device: this.getDevice(),
|
1354
|
+
cpu: this.getCPU()
|
1355
|
+
};
|
1356
|
+
};
|
1357
|
+
this.getUA = function() {
|
1358
|
+
return _ua;
|
1359
|
+
};
|
1360
|
+
this.setUA = function(ua2) {
|
1361
|
+
_ua = typeof ua2 === STR_TYPE && ua2.length > UA_MAX_LENGTH ? trim(ua2, UA_MAX_LENGTH) : ua2;
|
1362
|
+
return this;
|
1363
|
+
};
|
1364
|
+
this.setUA(_ua);
|
1365
|
+
return this;
|
1366
|
+
};
|
1367
|
+
UAParser2.VERSION = LIBVERSION;
|
1368
|
+
UAParser2.BROWSER = enumerize([NAME, VERSION, MAJOR]);
|
1369
|
+
UAParser2.CPU = enumerize([ARCHITECTURE]);
|
1370
|
+
UAParser2.DEVICE = enumerize([MODEL, VENDOR, TYPE, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]);
|
1371
|
+
UAParser2.ENGINE = UAParser2.OS = enumerize([NAME, VERSION]);
|
1372
|
+
if (typeof exports !== UNDEF_TYPE) {
|
1373
|
+
if (typeof module !== UNDEF_TYPE && module.exports) {
|
1374
|
+
exports = module.exports = UAParser2;
|
1375
|
+
}
|
1376
|
+
exports.UAParser = UAParser2;
|
1377
|
+
} else {
|
1378
|
+
if (typeof define === FUNC_TYPE && define.amd) {
|
1379
|
+
define(function() {
|
1380
|
+
return UAParser2;
|
1381
|
+
});
|
1382
|
+
} else if (typeof window2 !== UNDEF_TYPE) {
|
1383
|
+
window2.UAParser = UAParser2;
|
1384
|
+
}
|
1385
|
+
}
|
1386
|
+
var $ = typeof window2 !== UNDEF_TYPE && (window2.jQuery || window2.Zepto);
|
1387
|
+
if ($ && !$.ua) {
|
1388
|
+
var parser = new UAParser2();
|
1389
|
+
$.ua = parser.getResult();
|
1390
|
+
$.ua.get = function() {
|
1391
|
+
return parser.getUA();
|
1392
|
+
};
|
1393
|
+
$.ua.set = function(ua) {
|
1394
|
+
parser.setUA(ua);
|
1395
|
+
var result = parser.getResult();
|
1396
|
+
for (var prop in result) {
|
1397
|
+
$.ua[prop] = result[prop];
|
1398
|
+
}
|
1399
|
+
};
|
1400
|
+
}
|
1401
|
+
})(typeof window === "object" ? window : exports);
|
1402
|
+
}
|
1403
|
+
});
|
1404
|
+
|
1405
|
+
// index.ts
|
1406
|
+
init_react_import();
|
1407
|
+
|
1408
|
+
// src/HeadingAnalyzer.tsx
|
1409
|
+
init_react_import();
|
1410
|
+
import { useEffect as useEffect2, useState as useState3 } from "react";
|
1411
|
+
|
1412
|
+
// css-module:/home/runner/work/puck/puck/packages/plugin-heading-analyzer/src/HeadingAnalyzer.module.css#css-module
|
1413
|
+
init_react_import();
|
1414
|
+
var HeadingAnalyzer_module_default = { "HeadingAnalyzer": "_HeadingAnalyzer_116v6_1", "HeadingAnalyzer-cssWarning": "_HeadingAnalyzer-cssWarning_116v6_5", "HeadingAnalyzerItem": "_HeadingAnalyzerItem_116v6_9", "HeadingAnalyzerItem--missing": "_HeadingAnalyzerItem--missing_116v6_13" };
|
1415
|
+
|
1416
|
+
// src/HeadingAnalyzer.tsx
|
1417
|
+
import { usePuck } from "@measured/puck";
|
1418
|
+
|
1419
|
+
// ../core/components/SidebarSection/index.tsx
|
1420
|
+
init_react_import();
|
1421
|
+
|
1422
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
|
1423
|
+
init_react_import();
|
1424
|
+
var styles_module_default = { "SidebarSection": "_SidebarSection_125qe_1", "SidebarSection-title": "_SidebarSection-title_125qe_12", "SidebarSection--noBorderTop": "_SidebarSection--noBorderTop_125qe_20", "SidebarSection-content": "_SidebarSection-content_125qe_24", "SidebarSection--noPadding": "_SidebarSection--noPadding_125qe_28", "SidebarSection-breadcrumbLabel": "_SidebarSection-breadcrumbLabel_125qe_41", "SidebarSection-breadcrumbs": "_SidebarSection-breadcrumbs_125qe_70", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_125qe_41", "SidebarSection-heading": "_SidebarSection-heading_125qe_82", "SidebarSection-loadingOverlay": "_SidebarSection-loadingOverlay_125qe_86" };
|
1425
|
+
|
1426
|
+
// ../core/lib/get-class-name-factory.ts
|
1427
|
+
init_react_import();
|
1428
|
+
var import_classnames = __toESM(require_classnames());
|
1429
|
+
var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}) => {
|
1430
|
+
if (typeof options === "string") {
|
1431
|
+
const descendant = options;
|
1432
|
+
const style = styles[`${rootClass}-${descendant}`];
|
1433
|
+
if (style) {
|
1434
|
+
return config.baseClass + styles[`${rootClass}-${descendant}`] || "";
|
1435
|
+
}
|
1436
|
+
return "";
|
1437
|
+
} else if (typeof options === "object") {
|
1438
|
+
const modifiers = options;
|
1439
|
+
const prefixedModifiers = {};
|
1440
|
+
for (let modifier in modifiers) {
|
1441
|
+
prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
|
1442
|
+
}
|
1443
|
+
const c = styles[rootClass];
|
1444
|
+
return config.baseClass + (0, import_classnames.default)(__spreadValues({
|
1445
|
+
[c]: !!c
|
1446
|
+
}, prefixedModifiers));
|
1447
|
+
} else {
|
1448
|
+
return config.baseClass + styles[rootClass] || "";
|
1449
|
+
}
|
1450
|
+
};
|
1451
|
+
var get_class_name_factory_default = getClassNameFactory;
|
1452
|
+
|
1453
|
+
// ../core/components/Heading/index.tsx
|
1454
|
+
init_react_import();
|
1455
|
+
|
1456
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css#css-module
|
1457
|
+
init_react_import();
|
1458
|
+
var styles_module_default2 = { "Heading": "_Heading_qxrry_1", "Heading--xxxxl": "_Heading--xxxxl_qxrry_12", "Heading--xxxl": "_Heading--xxxl_qxrry_18", "Heading--xxl": "_Heading--xxl_qxrry_22", "Heading--xl": "_Heading--xl_qxrry_26", "Heading--l": "_Heading--l_qxrry_30", "Heading--m": "_Heading--m_qxrry_34", "Heading--s": "_Heading--s_qxrry_38", "Heading--xs": "_Heading--xs_qxrry_42" };
|
1459
|
+
|
1460
|
+
// ../core/components/Heading/index.tsx
|
1461
|
+
import { jsx } from "react/jsx-runtime";
|
1462
|
+
var getClassName = get_class_name_factory_default("Heading", styles_module_default2);
|
1463
|
+
var Heading = ({ children, rank, size = "m" }) => {
|
1464
|
+
const Tag = rank ? `h${rank}` : "span";
|
1465
|
+
return /* @__PURE__ */ jsx(
|
1466
|
+
Tag,
|
1467
|
+
{
|
1468
|
+
className: getClassName({
|
1469
|
+
[size]: true
|
1470
|
+
}),
|
1471
|
+
children
|
1472
|
+
}
|
1473
|
+
);
|
1474
|
+
};
|
1475
|
+
|
1476
|
+
// ../../node_modules/lucide-react/dist/esm/lucide-react.js
|
1477
|
+
init_react_import();
|
1478
|
+
|
1479
|
+
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
1480
|
+
init_react_import();
|
1481
|
+
import { forwardRef, createElement } from "react";
|
1482
|
+
|
1483
|
+
// ../../node_modules/lucide-react/dist/esm/defaultAttributes.js
|
1484
|
+
init_react_import();
|
1485
|
+
var defaultAttributes = {
|
1486
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1487
|
+
width: 24,
|
1488
|
+
height: 24,
|
1489
|
+
viewBox: "0 0 24 24",
|
1490
|
+
fill: "none",
|
1491
|
+
stroke: "currentColor",
|
1492
|
+
strokeWidth: 2,
|
1493
|
+
strokeLinecap: "round",
|
1494
|
+
strokeLinejoin: "round"
|
1495
|
+
};
|
1496
|
+
|
1497
|
+
// ../../node_modules/lucide-react/dist/esm/createLucideIcon.js
|
1498
|
+
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().trim();
|
1499
|
+
var createLucideIcon = (iconName, iconNode) => {
|
1500
|
+
const Component = forwardRef(
|
1501
|
+
(_a, ref) => {
|
1502
|
+
var _b = _a, { color = "currentColor", size = 24, strokeWidth = 2, absoluteStrokeWidth, className = "", children } = _b, rest = __objRest(_b, ["color", "size", "strokeWidth", "absoluteStrokeWidth", "className", "children"]);
|
1503
|
+
return createElement(
|
1504
|
+
"svg",
|
1505
|
+
__spreadValues(__spreadProps(__spreadValues({
|
1506
|
+
ref
|
1507
|
+
}, defaultAttributes), {
|
1508
|
+
width: size,
|
1509
|
+
height: size,
|
1510
|
+
stroke: color,
|
1511
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
1512
|
+
className: ["lucide", `lucide-${toKebabCase(iconName)}`, className].join(" ")
|
1513
|
+
}), rest),
|
1514
|
+
[
|
1515
|
+
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
1516
|
+
...Array.isArray(children) ? children : [children]
|
1517
|
+
]
|
1518
|
+
);
|
1519
|
+
}
|
1520
|
+
);
|
1521
|
+
Component.displayName = `${iconName}`;
|
1522
|
+
return Component;
|
1523
|
+
};
|
1524
|
+
|
1525
|
+
// ../../node_modules/lucide-react/dist/esm/icons/chevron-right.js
|
1526
|
+
init_react_import();
|
1527
|
+
var ChevronRight = createLucideIcon("ChevronRight", [
|
1528
|
+
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
1529
|
+
]);
|
1530
|
+
|
1531
|
+
// ../core/lib/use-breadcrumbs.ts
|
1532
|
+
init_react_import();
|
1533
|
+
import { useContext as useContext2, useMemo } from "react";
|
1534
|
+
|
1535
|
+
// ../core/components/DropZone/context.tsx
|
1536
|
+
init_react_import();
|
1537
|
+
import {
|
1538
|
+
createContext,
|
1539
|
+
useCallback,
|
1540
|
+
useState
|
1541
|
+
} from "react";
|
1542
|
+
|
1543
|
+
// ../core/lib/get-item.ts
|
1544
|
+
init_react_import();
|
1545
|
+
|
1546
|
+
// ../core/lib/root-droppable-id.ts
|
1547
|
+
init_react_import();
|
1548
|
+
var rootDroppableId = "default-zone";
|
1549
|
+
|
1550
|
+
// ../core/lib/setup-zone.ts
|
1551
|
+
init_react_import();
|
1552
|
+
var setupZone = (data, zoneKey) => {
|
1553
|
+
if (zoneKey === rootDroppableId) {
|
1554
|
+
return data;
|
1555
|
+
}
|
1556
|
+
const newData = __spreadValues({}, data);
|
1557
|
+
newData.zones = data.zones || {};
|
1558
|
+
newData.zones[zoneKey] = newData.zones[zoneKey] || [];
|
1559
|
+
return newData;
|
1560
|
+
};
|
1561
|
+
|
1562
|
+
// ../core/lib/get-item.ts
|
1563
|
+
var getItem = (selector, data, dynamicProps = {}) => {
|
1564
|
+
if (!selector.zone || selector.zone === rootDroppableId) {
|
1565
|
+
const item2 = data.content[selector.index];
|
1566
|
+
return (item2 == null ? void 0 : item2.props) ? __spreadProps(__spreadValues({}, item2), { props: dynamicProps[item2.props.id] || item2.props }) : void 0;
|
1567
|
+
}
|
1568
|
+
const item = setupZone(data, selector.zone).zones[selector.zone][selector.index];
|
1569
|
+
return (item == null ? void 0 : item.props) ? __spreadProps(__spreadValues({}, item), { props: dynamicProps[item.props.id] || item.props }) : void 0;
|
1570
|
+
};
|
1571
|
+
|
1572
|
+
// ../core/lib/get-zone-id.ts
|
1573
|
+
init_react_import();
|
1574
|
+
var getZoneId = (zoneCompound) => {
|
1575
|
+
if (!zoneCompound) {
|
1576
|
+
return [];
|
1577
|
+
}
|
1578
|
+
if (zoneCompound && zoneCompound.indexOf(":") > -1) {
|
1579
|
+
return zoneCompound.split(":");
|
1580
|
+
}
|
1581
|
+
return [rootDroppableId, zoneCompound];
|
1582
|
+
};
|
1583
|
+
|
1584
|
+
// ../core/components/DropZone/context.tsx
|
1585
|
+
import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
|
1586
|
+
var dropZoneContext = createContext(null);
|
1587
|
+
|
1588
|
+
// ../core/components/Puck/context.tsx
|
1589
|
+
init_react_import();
|
1590
|
+
import {
|
1591
|
+
createContext as createContext2,
|
1592
|
+
useContext,
|
1593
|
+
useEffect,
|
1594
|
+
useState as useState2
|
1595
|
+
} from "react";
|
1596
|
+
|
1597
|
+
// ../core/components/ViewportControls/default-viewports.ts
|
1598
|
+
init_react_import();
|
1599
|
+
var defaultViewports = [
|
1600
|
+
{ width: 360, height: "auto", icon: "Smartphone", label: "Small" },
|
1601
|
+
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
1602
|
+
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
1603
|
+
];
|
1604
|
+
|
1605
|
+
// ../core/components/Puck/context.tsx
|
1606
|
+
var import_ua_parser_js = __toESM(require_ua_parser());
|
1607
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
1608
|
+
var defaultAppState = {
|
1609
|
+
data: { content: [], root: {} },
|
1610
|
+
ui: {
|
1611
|
+
leftSideBarVisible: true,
|
1612
|
+
rightSideBarVisible: true,
|
1613
|
+
arrayState: {},
|
1614
|
+
itemSelector: null,
|
1615
|
+
componentList: {},
|
1616
|
+
isDragging: false,
|
1617
|
+
viewports: {
|
1618
|
+
current: {
|
1619
|
+
width: defaultViewports[0].width,
|
1620
|
+
height: defaultViewports[0].height || "auto"
|
1621
|
+
},
|
1622
|
+
options: [],
|
1623
|
+
controlsVisible: true
|
1624
|
+
}
|
1625
|
+
}
|
1626
|
+
};
|
1627
|
+
var defaultContext = {
|
1628
|
+
state: defaultAppState,
|
1629
|
+
dispatch: () => null,
|
1630
|
+
config: { components: {} },
|
1631
|
+
componentState: {},
|
1632
|
+
resolveData: () => {
|
1633
|
+
},
|
1634
|
+
plugins: [],
|
1635
|
+
overrides: {},
|
1636
|
+
history: {},
|
1637
|
+
viewports: defaultViewports,
|
1638
|
+
zoomConfig: {
|
1639
|
+
autoZoom: 1,
|
1640
|
+
rootHeight: 0,
|
1641
|
+
zoom: 1
|
1642
|
+
},
|
1643
|
+
setZoomConfig: () => null,
|
1644
|
+
status: "LOADING",
|
1645
|
+
setStatus: () => null,
|
1646
|
+
iframe: {},
|
1647
|
+
safariFallbackMode: false,
|
1648
|
+
globalPermissions: {}
|
1649
|
+
};
|
1650
|
+
var appContext = createContext2(defaultContext);
|
1651
|
+
function useAppContext() {
|
1652
|
+
const mainContext = useContext(appContext);
|
1653
|
+
const selectedItem = mainContext.state.ui.itemSelector ? getItem(mainContext.state.ui.itemSelector, mainContext.state.data) : void 0;
|
1654
|
+
return __spreadProps(__spreadValues({}, mainContext), {
|
1655
|
+
// Helpers
|
1656
|
+
selectedItem,
|
1657
|
+
setUi: (ui, recordHistory) => {
|
1658
|
+
return mainContext.dispatch({
|
1659
|
+
type: "setUi",
|
1660
|
+
ui,
|
1661
|
+
recordHistory
|
1662
|
+
});
|
1663
|
+
}
|
1664
|
+
});
|
1665
|
+
}
|
1666
|
+
|
1667
|
+
// ../core/lib/use-breadcrumbs.ts
|
1668
|
+
var convertPathDataToBreadcrumbs = (selectedItem, pathData, data) => {
|
1669
|
+
const id = selectedItem ? selectedItem == null ? void 0 : selectedItem.props.id : "";
|
1670
|
+
const currentPathData = pathData && id && pathData[id] ? __spreadValues({}, pathData[id]) : { label: "Page", path: [] };
|
1671
|
+
if (!id) {
|
1672
|
+
return [];
|
1673
|
+
}
|
1674
|
+
return currentPathData == null ? void 0 : currentPathData.path.reduce((acc, zoneCompound) => {
|
1675
|
+
const [area] = getZoneId(zoneCompound);
|
1676
|
+
if (area === rootDroppableId) {
|
1677
|
+
return [
|
1678
|
+
{
|
1679
|
+
label: "Page",
|
1680
|
+
selector: null
|
1681
|
+
}
|
1682
|
+
];
|
1683
|
+
}
|
1684
|
+
const parentZoneCompound = acc.length > 0 ? acc[acc.length - 1].zoneCompound : rootDroppableId;
|
1685
|
+
let parentZone = data.content;
|
1686
|
+
if (parentZoneCompound && parentZoneCompound !== rootDroppableId) {
|
1687
|
+
parentZone = data.zones[parentZoneCompound];
|
1688
|
+
}
|
1689
|
+
if (!parentZone) {
|
1690
|
+
return acc;
|
1691
|
+
}
|
1692
|
+
const itemIndex = parentZone.findIndex(
|
1693
|
+
(queryItem) => queryItem.props.id === area
|
1694
|
+
);
|
1695
|
+
const item = parentZone[itemIndex];
|
1696
|
+
if (!item) {
|
1697
|
+
return acc;
|
1698
|
+
}
|
1699
|
+
return [
|
1700
|
+
...acc,
|
1701
|
+
{
|
1702
|
+
label: item.type.toString(),
|
1703
|
+
selector: {
|
1704
|
+
index: itemIndex,
|
1705
|
+
zone: parentZoneCompound
|
1706
|
+
},
|
1707
|
+
zoneCompound
|
1708
|
+
}
|
1709
|
+
];
|
1710
|
+
}, []);
|
1711
|
+
};
|
1712
|
+
var useBreadcrumbs = (renderCount) => {
|
1713
|
+
const {
|
1714
|
+
state: { data },
|
1715
|
+
selectedItem
|
1716
|
+
} = useAppContext();
|
1717
|
+
const dzContext = useContext2(dropZoneContext);
|
1718
|
+
return useMemo(() => {
|
1719
|
+
const breadcrumbs = convertPathDataToBreadcrumbs(
|
1720
|
+
selectedItem,
|
1721
|
+
dzContext == null ? void 0 : dzContext.pathData,
|
1722
|
+
data
|
1723
|
+
);
|
1724
|
+
if (renderCount) {
|
1725
|
+
return breadcrumbs.slice(breadcrumbs.length - renderCount);
|
1726
|
+
}
|
1727
|
+
return breadcrumbs;
|
1728
|
+
}, [selectedItem, dzContext == null ? void 0 : dzContext.pathData, renderCount]);
|
1729
|
+
};
|
1730
|
+
|
1731
|
+
// ../core/components/Loader/index.tsx
|
1732
|
+
init_react_import();
|
1733
|
+
|
1734
|
+
// ../core/lib/index.ts
|
1735
|
+
init_react_import();
|
1736
|
+
|
1737
|
+
// ../core/lib/filter.ts
|
1738
|
+
init_react_import();
|
1739
|
+
|
1740
|
+
// ../core/lib/reorder.ts
|
1741
|
+
init_react_import();
|
1742
|
+
|
1743
|
+
// ../core/lib/replace.ts
|
1744
|
+
init_react_import();
|
1745
|
+
|
1746
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
|
1747
|
+
init_react_import();
|
1748
|
+
var styles_module_default3 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
|
1749
|
+
|
1750
|
+
// ../core/components/Loader/index.tsx
|
1751
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
1752
|
+
var getClassName2 = get_class_name_factory_default("Loader", styles_module_default3);
|
1753
|
+
var Loader = (_a) => {
|
1754
|
+
var _b = _a, {
|
1755
|
+
color,
|
1756
|
+
size = 16
|
1757
|
+
} = _b, props = __objRest(_b, [
|
1758
|
+
"color",
|
1759
|
+
"size"
|
1760
|
+
]);
|
1761
|
+
return /* @__PURE__ */ jsx4(
|
1762
|
+
"span",
|
1763
|
+
__spreadValues({
|
1764
|
+
className: getClassName2(),
|
1765
|
+
style: {
|
1766
|
+
width: size,
|
1767
|
+
height: size,
|
1768
|
+
color
|
1769
|
+
},
|
1770
|
+
"aria-label": "loading"
|
1771
|
+
}, props)
|
1772
|
+
);
|
1773
|
+
};
|
1774
|
+
|
1775
|
+
// ../core/components/SidebarSection/index.tsx
|
1776
|
+
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
1777
|
+
var getClassName3 = get_class_name_factory_default("SidebarSection", styles_module_default);
|
1778
|
+
var SidebarSection = ({
|
1779
|
+
children,
|
1780
|
+
title,
|
1781
|
+
background,
|
1782
|
+
showBreadcrumbs,
|
1783
|
+
noBorderTop,
|
1784
|
+
noPadding,
|
1785
|
+
isLoading
|
1786
|
+
}) => {
|
1787
|
+
const { setUi } = useAppContext();
|
1788
|
+
const breadcrumbs = useBreadcrumbs(1);
|
1789
|
+
return /* @__PURE__ */ jsxs(
|
1790
|
+
"div",
|
1791
|
+
{
|
1792
|
+
className: getClassName3({ noBorderTop, noPadding }),
|
1793
|
+
style: { background },
|
1794
|
+
children: [
|
1795
|
+
/* @__PURE__ */ jsx5("div", { className: getClassName3("title"), children: /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumbs"), children: [
|
1796
|
+
showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumb"), children: [
|
1797
|
+
/* @__PURE__ */ jsx5(
|
1798
|
+
"button",
|
1799
|
+
{
|
1800
|
+
className: getClassName3("breadcrumbLabel"),
|
1801
|
+
onClick: () => setUi({ itemSelector: breadcrumb.selector }),
|
1802
|
+
children: breadcrumb.label
|
1803
|
+
}
|
1804
|
+
),
|
1805
|
+
/* @__PURE__ */ jsx5(ChevronRight, { size: 16 })
|
1806
|
+
] }, i)) : null,
|
1807
|
+
/* @__PURE__ */ jsx5("div", { className: getClassName3("heading"), children: /* @__PURE__ */ jsx5(Heading, { rank: "2", size: "xs", children: title }) })
|
1808
|
+
] }) }),
|
1809
|
+
/* @__PURE__ */ jsx5("div", { className: getClassName3("content"), children }),
|
1810
|
+
isLoading && /* @__PURE__ */ jsx5("div", { className: getClassName3("loadingOverlay"), children: /* @__PURE__ */ jsx5(Loader, { size: 32 }) })
|
1811
|
+
]
|
1812
|
+
}
|
1813
|
+
);
|
1814
|
+
};
|
1815
|
+
|
1816
|
+
// ../core/components/OutlineList/index.tsx
|
1817
|
+
init_react_import();
|
1818
|
+
|
1819
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
|
1820
|
+
init_react_import();
|
1821
|
+
var styles_module_default4 = { "OutlineList": "_OutlineList_18bgy_1", "OutlineListItem": "_OutlineListItem_18bgy_20", "OutlineListItem--clickable": "_OutlineListItem--clickable_18bgy_35" };
|
1822
|
+
|
1823
|
+
// ../core/components/OutlineList/index.tsx
|
1824
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
1825
|
+
var getClassName4 = get_class_name_factory_default("OutlineList", styles_module_default4);
|
1826
|
+
var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default4);
|
1827
|
+
var OutlineList = ({ children }) => {
|
1828
|
+
return /* @__PURE__ */ jsx6("ul", { className: getClassName4(), children });
|
1829
|
+
};
|
1830
|
+
OutlineList.Clickable = ({ children }) => /* @__PURE__ */ jsx6("div", { className: getClassNameItem({ clickable: true }), children });
|
1831
|
+
OutlineList.Item = ({
|
1832
|
+
children,
|
1833
|
+
onClick
|
1834
|
+
}) => {
|
1835
|
+
return /* @__PURE__ */ jsx6(
|
1836
|
+
"li",
|
1837
|
+
{
|
1838
|
+
className: getClassNameItem({ clickable: !!onClick }),
|
1839
|
+
onClick,
|
1840
|
+
children
|
1841
|
+
}
|
1842
|
+
);
|
1843
|
+
};
|
1844
|
+
|
1845
|
+
// ../core/lib/scroll-into-view.ts
|
1846
|
+
init_react_import();
|
1847
|
+
var scrollIntoView = (el) => {
|
1848
|
+
const oldStyle = __spreadValues({}, el.style);
|
1849
|
+
el.style.scrollMargin = "256px";
|
1850
|
+
if (el) {
|
1851
|
+
el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
|
1852
|
+
el.style.scrollMargin = oldStyle.scrollMargin || "";
|
1853
|
+
}
|
1854
|
+
};
|
1855
|
+
|
1856
|
+
// ../core/lib/get-frame.ts
|
1857
|
+
init_react_import();
|
1858
|
+
var getFrame = () => {
|
1859
|
+
let frame = document.querySelector("#preview-frame");
|
1860
|
+
if ((frame == null ? void 0 : frame.tagName) === "IFRAME") {
|
1861
|
+
frame = frame.contentDocument;
|
1862
|
+
}
|
1863
|
+
return frame;
|
1864
|
+
};
|
1865
|
+
|
1866
|
+
// src/HeadingAnalyzer.tsx
|
1867
|
+
import ReactFromJSONModule from "react-from-json";
|
1868
|
+
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
1869
|
+
var getClassName5 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
|
1870
|
+
var getClassNameItem2 = get_class_name_factory_default("HeadingAnalyzerItem", HeadingAnalyzer_module_default);
|
1871
|
+
var ReactFromJSON = ReactFromJSONModule.default || ReactFromJSONModule;
|
1872
|
+
var dataAttr = "data-puck-heading-analyzer-id";
|
1873
|
+
var getOutline = ({
|
1874
|
+
addDataAttr = false,
|
1875
|
+
frame
|
1876
|
+
} = {}) => {
|
1877
|
+
const headings = (frame == null ? void 0 : frame.querySelectorAll("h1,h2,h3,h4,h5,h6")) || [];
|
1878
|
+
const _outline = [];
|
1879
|
+
headings.forEach((item, i) => {
|
1880
|
+
if (addDataAttr) {
|
1881
|
+
item.setAttribute(dataAttr, i.toString());
|
1882
|
+
}
|
1883
|
+
_outline.push({
|
1884
|
+
rank: parseInt(item.tagName.split("H")[1]),
|
1885
|
+
text: item.textContent,
|
1886
|
+
analyzeId: i.toString()
|
1887
|
+
});
|
1888
|
+
});
|
1889
|
+
return _outline;
|
1890
|
+
};
|
1891
|
+
function buildHierarchy(frame) {
|
1892
|
+
var _a, _b;
|
1893
|
+
const headings = getOutline({ addDataAttr: true, frame });
|
1894
|
+
const root = { rank: 0, children: [], text: "" };
|
1895
|
+
let path = [root];
|
1896
|
+
for (let heading of headings) {
|
1897
|
+
const node = {
|
1898
|
+
rank: heading.rank,
|
1899
|
+
text: heading.text,
|
1900
|
+
analyzeId: heading.analyzeId,
|
1901
|
+
children: []
|
1902
|
+
};
|
1903
|
+
if (node.rank === 1) {
|
1904
|
+
path = [root];
|
1905
|
+
} else {
|
1906
|
+
while (path[path.length - 1].rank >= node.rank) {
|
1907
|
+
path.pop();
|
1908
|
+
}
|
1909
|
+
while (path.length < node.rank) {
|
1910
|
+
const missingNode = {
|
1911
|
+
rank: path.length,
|
1912
|
+
missing: true,
|
1913
|
+
children: [],
|
1914
|
+
text: ""
|
1915
|
+
};
|
1916
|
+
(_a = path[path.length - 1].children) == null ? void 0 : _a.push(missingNode);
|
1917
|
+
path.push(missingNode);
|
1918
|
+
}
|
1919
|
+
}
|
1920
|
+
(_b = path[path.length - 1].children) == null ? void 0 : _b.push(node);
|
1921
|
+
path.push(node);
|
1922
|
+
}
|
1923
|
+
return root.children;
|
1924
|
+
}
|
1925
|
+
var HeadingAnalyzer = () => {
|
1926
|
+
const { appState } = usePuck();
|
1927
|
+
const [hierarchy, setHierarchy] = useState3([]);
|
1928
|
+
const [firstRender, setFirstRender] = useState3(true);
|
1929
|
+
useEffect2(() => {
|
1930
|
+
const frame = getFrame();
|
1931
|
+
if (!frame) return;
|
1932
|
+
if (firstRender) {
|
1933
|
+
setTimeout(() => {
|
1934
|
+
setHierarchy(buildHierarchy(frame));
|
1935
|
+
setFirstRender(false);
|
1936
|
+
}, 100);
|
1937
|
+
} else {
|
1938
|
+
setHierarchy(buildHierarchy(frame));
|
1939
|
+
}
|
1940
|
+
}, [appState.data]);
|
1941
|
+
return /* @__PURE__ */ jsxs2("div", { className: getClassName5(), children: [
|
1942
|
+
/* @__PURE__ */ jsxs2(
|
1943
|
+
"small",
|
1944
|
+
{
|
1945
|
+
className: getClassName5("cssWarning"),
|
1946
|
+
style: {
|
1947
|
+
color: "var(--puck-color-red-04)",
|
1948
|
+
display: "block",
|
1949
|
+
marginBottom: 16
|
1950
|
+
},
|
1951
|
+
children: [
|
1952
|
+
"Heading analyzer styles not loaded. Please review the",
|
1953
|
+
" ",
|
1954
|
+
/* @__PURE__ */ jsx7("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
|
1955
|
+
"."
|
1956
|
+
]
|
1957
|
+
}
|
1958
|
+
),
|
1959
|
+
hierarchy.length === 0 && /* @__PURE__ */ jsx7("div", { children: "No headings." }),
|
1960
|
+
/* @__PURE__ */ jsx7(OutlineList, { children: /* @__PURE__ */ jsx7(
|
1961
|
+
ReactFromJSON,
|
1962
|
+
{
|
1963
|
+
mapping: {
|
1964
|
+
Root: (props) => /* @__PURE__ */ jsx7(Fragment2, { children: props.children }),
|
1965
|
+
OutlineListItem: (props) => /* @__PURE__ */ jsxs2(OutlineList.Item, { children: [
|
1966
|
+
/* @__PURE__ */ jsx7(OutlineList.Clickable, { children: /* @__PURE__ */ jsx7(
|
1967
|
+
"small",
|
1968
|
+
{
|
1969
|
+
className: getClassNameItem2({ missing: props.missing }),
|
1970
|
+
onClick: typeof props.analyzeId == "undefined" ? void 0 : (e) => {
|
1971
|
+
e.stopPropagation();
|
1972
|
+
const frame = getFrame();
|
1973
|
+
const el = frame == null ? void 0 : frame.querySelector(
|
1974
|
+
`[${dataAttr}="${props.analyzeId}"]`
|
1975
|
+
);
|
1976
|
+
const oldStyle = __spreadValues({}, el.style);
|
1977
|
+
if (el) {
|
1978
|
+
scrollIntoView(el);
|
1979
|
+
el.style.outline = "4px solid var(--puck-color-rose-06)";
|
1980
|
+
el.style.outlineOffset = "4px";
|
1981
|
+
setTimeout(() => {
|
1982
|
+
el.style.outline = oldStyle.outline || "";
|
1983
|
+
el.style.outlineOffset = oldStyle.outlineOffset || "";
|
1984
|
+
}, 2e3);
|
1985
|
+
}
|
1986
|
+
},
|
1987
|
+
children: props.missing ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
1988
|
+
/* @__PURE__ */ jsxs2("b", { children: [
|
1989
|
+
"H",
|
1990
|
+
props.rank
|
1991
|
+
] }),
|
1992
|
+
": Missing"
|
1993
|
+
] }) : /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
1994
|
+
/* @__PURE__ */ jsxs2("b", { children: [
|
1995
|
+
"H",
|
1996
|
+
props.rank
|
1997
|
+
] }),
|
1998
|
+
": ",
|
1999
|
+
props.text
|
2000
|
+
] })
|
2001
|
+
}
|
2002
|
+
) }),
|
2003
|
+
/* @__PURE__ */ jsx7(OutlineList, { children: props.children })
|
2004
|
+
] })
|
2005
|
+
},
|
2006
|
+
entry: {
|
2007
|
+
props: { children: hierarchy },
|
2008
|
+
type: "Root"
|
2009
|
+
},
|
2010
|
+
mapProp: (prop) => {
|
2011
|
+
if (prop && prop.rank) {
|
2012
|
+
return {
|
2013
|
+
type: "OutlineListItem",
|
2014
|
+
props: prop
|
2015
|
+
};
|
2016
|
+
}
|
2017
|
+
return prop;
|
2018
|
+
}
|
2019
|
+
}
|
2020
|
+
) })
|
2021
|
+
] });
|
2022
|
+
};
|
2023
|
+
var headingAnalyzer = {
|
2024
|
+
overrides: {
|
2025
|
+
fields: ({ children, itemSelector }) => /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
2026
|
+
children,
|
2027
|
+
/* @__PURE__ */ jsx7("div", { style: { display: itemSelector ? "none" : "block" }, children: /* @__PURE__ */ jsx7(SidebarSection, { title: "Heading Outline", children: /* @__PURE__ */ jsx7(HeadingAnalyzer, {}) }) })
|
2028
|
+
] })
|
2029
|
+
}
|
2030
|
+
};
|
2031
|
+
var HeadingAnalyzer_default = headingAnalyzer;
|
2032
|
+
export {
|
2033
|
+
HeadingAnalyzer_default as default
|
2034
|
+
};
|
2035
|
+
/*! Bundled license information:
|
2036
|
+
|
2037
|
+
classnames/index.js:
|
2038
|
+
(*!
|
2039
|
+
Copyright (c) 2018 Jed Watson.
|
2040
|
+
Licensed under the MIT License (MIT), see
|
2041
|
+
http://jedwatson.github.io/classnames
|
2042
|
+
*)
|
2043
|
+
|
2044
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
2045
|
+
(**
|
2046
|
+
* @license lucide-react v0.298.0 - ISC
|
2047
|
+
*
|
2048
|
+
* This source code is licensed under the ISC license.
|
2049
|
+
* See the LICENSE file in the root directory of this source tree.
|
2050
|
+
*)
|
2051
|
+
|
2052
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
2053
|
+
(**
|
2054
|
+
* @license lucide-react v0.298.0 - ISC
|
2055
|
+
*
|
2056
|
+
* This source code is licensed under the ISC license.
|
2057
|
+
* See the LICENSE file in the root directory of this source tree.
|
2058
|
+
*)
|
2059
|
+
|
2060
|
+
lucide-react/dist/esm/icons/chevron-right.js:
|
2061
|
+
(**
|
2062
|
+
* @license lucide-react v0.298.0 - ISC
|
2063
|
+
*
|
2064
|
+
* This source code is licensed under the ISC license.
|
2065
|
+
* See the LICENSE file in the root directory of this source tree.
|
2066
|
+
*)
|
2067
|
+
|
2068
|
+
lucide-react/dist/esm/lucide-react.js:
|
2069
|
+
(**
|
2070
|
+
* @license lucide-react v0.298.0 - ISC
|
2071
|
+
*
|
2072
|
+
* This source code is licensed under the ISC license.
|
2073
|
+
* See the LICENSE file in the root directory of this source tree.
|
2074
|
+
*)
|
2075
|
+
*/
|