@measured/puck-plugin-heading-analyzer 0.16.0-canary.6386bd1 → 0.16.0-canary.72b8720
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 +47 -39
- package/dist/index.js +1900 -78360
- package/dist/index.mjs +2084 -0
- package/package.json +9 -2
package/dist/index.mjs
ADDED
@@ -0,0 +1,2084 @@
|
|
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 useEffect4, useState as useState5 } 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
|
+
|
1553
|
+
// ../core/lib/get-zone-id.ts
|
1554
|
+
init_react_import();
|
1555
|
+
var getZoneId = (zoneCompound) => {
|
1556
|
+
if (!zoneCompound) {
|
1557
|
+
return [];
|
1558
|
+
}
|
1559
|
+
if (zoneCompound && zoneCompound.indexOf(":") > -1) {
|
1560
|
+
return zoneCompound.split(":");
|
1561
|
+
}
|
1562
|
+
return [rootDroppableId, zoneCompound];
|
1563
|
+
};
|
1564
|
+
|
1565
|
+
// ../core/components/DropZone/context.tsx
|
1566
|
+
import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
|
1567
|
+
var dropZoneContext = createContext(null);
|
1568
|
+
|
1569
|
+
// ../core/components/Puck/context.tsx
|
1570
|
+
init_react_import();
|
1571
|
+
import {
|
1572
|
+
createContext as createContext2,
|
1573
|
+
useContext,
|
1574
|
+
useEffect as useEffect3,
|
1575
|
+
useState as useState4
|
1576
|
+
} from "react";
|
1577
|
+
|
1578
|
+
// ../core/components/ViewportControls/default-viewports.ts
|
1579
|
+
init_react_import();
|
1580
|
+
var defaultViewports = [
|
1581
|
+
{ width: 360, height: "auto", icon: "Smartphone", label: "Small" },
|
1582
|
+
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
1583
|
+
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
1584
|
+
];
|
1585
|
+
|
1586
|
+
// ../core/components/Puck/context.tsx
|
1587
|
+
var import_ua_parser_js = __toESM(require_ua_parser());
|
1588
|
+
|
1589
|
+
// ../core/lib/use-resolved-permissions.ts
|
1590
|
+
init_react_import();
|
1591
|
+
import { useCallback as useCallback2, useEffect, useState as useState2 } from "react";
|
1592
|
+
|
1593
|
+
// ../core/lib/flatten-data.ts
|
1594
|
+
init_react_import();
|
1595
|
+
|
1596
|
+
// ../core/lib/get-changed.ts
|
1597
|
+
init_react_import();
|
1598
|
+
|
1599
|
+
// ../core/lib/use-resolved-data.ts
|
1600
|
+
init_react_import();
|
1601
|
+
import { useCallback as useCallback3, useEffect as useEffect2, useState as useState3 } from "react";
|
1602
|
+
|
1603
|
+
// ../core/lib/resolve-component-data.ts
|
1604
|
+
init_react_import();
|
1605
|
+
|
1606
|
+
// ../core/lib/apply-dynamic-props.ts
|
1607
|
+
init_react_import();
|
1608
|
+
|
1609
|
+
// ../core/lib/resolve-root-data.ts
|
1610
|
+
init_react_import();
|
1611
|
+
|
1612
|
+
// ../core/components/Puck/context.tsx
|
1613
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
1614
|
+
var defaultAppState = {
|
1615
|
+
data: { content: [], root: {} },
|
1616
|
+
ui: {
|
1617
|
+
leftSideBarVisible: true,
|
1618
|
+
rightSideBarVisible: true,
|
1619
|
+
arrayState: {},
|
1620
|
+
itemSelector: null,
|
1621
|
+
componentList: {},
|
1622
|
+
isDragging: false,
|
1623
|
+
viewports: {
|
1624
|
+
current: {
|
1625
|
+
width: defaultViewports[0].width,
|
1626
|
+
height: defaultViewports[0].height || "auto"
|
1627
|
+
},
|
1628
|
+
options: [],
|
1629
|
+
controlsVisible: true
|
1630
|
+
}
|
1631
|
+
}
|
1632
|
+
};
|
1633
|
+
var defaultContext = {
|
1634
|
+
state: defaultAppState,
|
1635
|
+
dispatch: () => null,
|
1636
|
+
config: { components: {} },
|
1637
|
+
componentState: {},
|
1638
|
+
setComponentState: () => {
|
1639
|
+
},
|
1640
|
+
resolveData: () => {
|
1641
|
+
},
|
1642
|
+
plugins: [],
|
1643
|
+
overrides: {},
|
1644
|
+
history: {},
|
1645
|
+
viewports: defaultViewports,
|
1646
|
+
zoomConfig: {
|
1647
|
+
autoZoom: 1,
|
1648
|
+
rootHeight: 0,
|
1649
|
+
zoom: 1
|
1650
|
+
},
|
1651
|
+
setZoomConfig: () => null,
|
1652
|
+
status: "LOADING",
|
1653
|
+
setStatus: () => null,
|
1654
|
+
iframe: {},
|
1655
|
+
safariFallbackMode: false,
|
1656
|
+
globalPermissions: {},
|
1657
|
+
getPermissions: () => ({}),
|
1658
|
+
refreshPermissions: () => null
|
1659
|
+
};
|
1660
|
+
var appContext = createContext2(defaultContext);
|
1661
|
+
function useAppContext() {
|
1662
|
+
const mainContext = useContext(appContext);
|
1663
|
+
return __spreadProps(__spreadValues({}, mainContext), {
|
1664
|
+
// Helpers
|
1665
|
+
setUi: (ui, recordHistory) => {
|
1666
|
+
return mainContext.dispatch({
|
1667
|
+
type: "setUi",
|
1668
|
+
ui,
|
1669
|
+
recordHistory
|
1670
|
+
});
|
1671
|
+
}
|
1672
|
+
});
|
1673
|
+
}
|
1674
|
+
|
1675
|
+
// ../core/lib/use-breadcrumbs.ts
|
1676
|
+
var convertPathDataToBreadcrumbs = (selectedItem, pathData, data) => {
|
1677
|
+
const id = selectedItem ? selectedItem == null ? void 0 : selectedItem.props.id : "";
|
1678
|
+
const currentPathData = pathData && id && pathData[id] ? __spreadValues({}, pathData[id]) : { label: "Page", path: [] };
|
1679
|
+
if (!id) {
|
1680
|
+
return [];
|
1681
|
+
}
|
1682
|
+
return currentPathData == null ? void 0 : currentPathData.path.reduce((acc, zoneCompound) => {
|
1683
|
+
const [area] = getZoneId(zoneCompound);
|
1684
|
+
if (area === rootDroppableId) {
|
1685
|
+
return [
|
1686
|
+
{
|
1687
|
+
label: "Page",
|
1688
|
+
selector: null
|
1689
|
+
}
|
1690
|
+
];
|
1691
|
+
}
|
1692
|
+
const parentZoneCompound = acc.length > 0 ? acc[acc.length - 1].zoneCompound : rootDroppableId;
|
1693
|
+
let parentZone = data.content;
|
1694
|
+
if (parentZoneCompound && parentZoneCompound !== rootDroppableId) {
|
1695
|
+
parentZone = data.zones[parentZoneCompound];
|
1696
|
+
}
|
1697
|
+
if (!parentZone) {
|
1698
|
+
return acc;
|
1699
|
+
}
|
1700
|
+
const itemIndex = parentZone.findIndex(
|
1701
|
+
(queryItem) => queryItem.props.id === area
|
1702
|
+
);
|
1703
|
+
const item = parentZone[itemIndex];
|
1704
|
+
if (!item) {
|
1705
|
+
return acc;
|
1706
|
+
}
|
1707
|
+
return [
|
1708
|
+
...acc,
|
1709
|
+
{
|
1710
|
+
label: item.type.toString(),
|
1711
|
+
selector: {
|
1712
|
+
index: itemIndex,
|
1713
|
+
zone: parentZoneCompound
|
1714
|
+
},
|
1715
|
+
zoneCompound
|
1716
|
+
}
|
1717
|
+
];
|
1718
|
+
}, []);
|
1719
|
+
};
|
1720
|
+
var useBreadcrumbs = (renderCount) => {
|
1721
|
+
const {
|
1722
|
+
state: { data },
|
1723
|
+
selectedItem
|
1724
|
+
} = useAppContext();
|
1725
|
+
const dzContext = useContext2(dropZoneContext);
|
1726
|
+
return useMemo(() => {
|
1727
|
+
const breadcrumbs = convertPathDataToBreadcrumbs(
|
1728
|
+
selectedItem,
|
1729
|
+
dzContext == null ? void 0 : dzContext.pathData,
|
1730
|
+
data
|
1731
|
+
);
|
1732
|
+
if (renderCount) {
|
1733
|
+
return breadcrumbs.slice(breadcrumbs.length - renderCount);
|
1734
|
+
}
|
1735
|
+
return breadcrumbs;
|
1736
|
+
}, [selectedItem, dzContext == null ? void 0 : dzContext.pathData, renderCount]);
|
1737
|
+
};
|
1738
|
+
|
1739
|
+
// ../core/components/Loader/index.tsx
|
1740
|
+
init_react_import();
|
1741
|
+
|
1742
|
+
// ../core/lib/index.ts
|
1743
|
+
init_react_import();
|
1744
|
+
|
1745
|
+
// ../core/lib/filter.ts
|
1746
|
+
init_react_import();
|
1747
|
+
|
1748
|
+
// ../core/lib/reorder.ts
|
1749
|
+
init_react_import();
|
1750
|
+
|
1751
|
+
// ../core/lib/replace.ts
|
1752
|
+
init_react_import();
|
1753
|
+
|
1754
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css#css-module
|
1755
|
+
init_react_import();
|
1756
|
+
var styles_module_default3 = { "Loader": "_Loader_nacdm_13", "loader-animation": "_loader-animation_nacdm_1" };
|
1757
|
+
|
1758
|
+
// ../core/components/Loader/index.tsx
|
1759
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
1760
|
+
var getClassName2 = get_class_name_factory_default("Loader", styles_module_default3);
|
1761
|
+
var Loader = (_a) => {
|
1762
|
+
var _b = _a, {
|
1763
|
+
color,
|
1764
|
+
size = 16
|
1765
|
+
} = _b, props = __objRest(_b, [
|
1766
|
+
"color",
|
1767
|
+
"size"
|
1768
|
+
]);
|
1769
|
+
return /* @__PURE__ */ jsx4(
|
1770
|
+
"span",
|
1771
|
+
__spreadValues({
|
1772
|
+
className: getClassName2(),
|
1773
|
+
style: {
|
1774
|
+
width: size,
|
1775
|
+
height: size,
|
1776
|
+
color
|
1777
|
+
},
|
1778
|
+
"aria-label": "loading"
|
1779
|
+
}, props)
|
1780
|
+
);
|
1781
|
+
};
|
1782
|
+
|
1783
|
+
// ../core/components/SidebarSection/index.tsx
|
1784
|
+
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
1785
|
+
var getClassName3 = get_class_name_factory_default("SidebarSection", styles_module_default);
|
1786
|
+
var SidebarSection = ({
|
1787
|
+
children,
|
1788
|
+
title,
|
1789
|
+
background,
|
1790
|
+
showBreadcrumbs,
|
1791
|
+
noBorderTop,
|
1792
|
+
noPadding,
|
1793
|
+
isLoading
|
1794
|
+
}) => {
|
1795
|
+
const { setUi } = useAppContext();
|
1796
|
+
const breadcrumbs = useBreadcrumbs(1);
|
1797
|
+
return /* @__PURE__ */ jsxs(
|
1798
|
+
"div",
|
1799
|
+
{
|
1800
|
+
className: getClassName3({ noBorderTop, noPadding }),
|
1801
|
+
style: { background },
|
1802
|
+
children: [
|
1803
|
+
/* @__PURE__ */ jsx5("div", { className: getClassName3("title"), children: /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumbs"), children: [
|
1804
|
+
showBreadcrumbs ? breadcrumbs.map((breadcrumb, i) => /* @__PURE__ */ jsxs("div", { className: getClassName3("breadcrumb"), children: [
|
1805
|
+
/* @__PURE__ */ jsx5(
|
1806
|
+
"button",
|
1807
|
+
{
|
1808
|
+
type: "button",
|
1809
|
+
className: getClassName3("breadcrumbLabel"),
|
1810
|
+
onClick: () => setUi({ itemSelector: breadcrumb.selector }),
|
1811
|
+
children: breadcrumb.label
|
1812
|
+
}
|
1813
|
+
),
|
1814
|
+
/* @__PURE__ */ jsx5(ChevronRight, { size: 16 })
|
1815
|
+
] }, i)) : null,
|
1816
|
+
/* @__PURE__ */ jsx5("div", { className: getClassName3("heading"), children: /* @__PURE__ */ jsx5(Heading, { rank: "2", size: "xs", children: title }) })
|
1817
|
+
] }) }),
|
1818
|
+
/* @__PURE__ */ jsx5("div", { className: getClassName3("content"), children }),
|
1819
|
+
isLoading && /* @__PURE__ */ jsx5("div", { className: getClassName3("loadingOverlay"), children: /* @__PURE__ */ jsx5(Loader, { size: 32 }) })
|
1820
|
+
]
|
1821
|
+
}
|
1822
|
+
);
|
1823
|
+
};
|
1824
|
+
|
1825
|
+
// ../core/components/OutlineList/index.tsx
|
1826
|
+
init_react_import();
|
1827
|
+
|
1828
|
+
// css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css#css-module
|
1829
|
+
init_react_import();
|
1830
|
+
var styles_module_default4 = { "OutlineList": "_OutlineList_18bgy_1", "OutlineListItem": "_OutlineListItem_18bgy_20", "OutlineListItem--clickable": "_OutlineListItem--clickable_18bgy_35" };
|
1831
|
+
|
1832
|
+
// ../core/components/OutlineList/index.tsx
|
1833
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
1834
|
+
var getClassName4 = get_class_name_factory_default("OutlineList", styles_module_default4);
|
1835
|
+
var getClassNameItem = get_class_name_factory_default("OutlineListItem", styles_module_default4);
|
1836
|
+
var OutlineList = ({ children }) => {
|
1837
|
+
return /* @__PURE__ */ jsx6("ul", { className: getClassName4(), children });
|
1838
|
+
};
|
1839
|
+
OutlineList.Clickable = ({ children }) => /* @__PURE__ */ jsx6("div", { className: getClassNameItem({ clickable: true }), children });
|
1840
|
+
OutlineList.Item = ({
|
1841
|
+
children,
|
1842
|
+
onClick
|
1843
|
+
}) => {
|
1844
|
+
return /* @__PURE__ */ jsx6(
|
1845
|
+
"li",
|
1846
|
+
{
|
1847
|
+
className: getClassNameItem({ clickable: !!onClick }),
|
1848
|
+
onClick,
|
1849
|
+
children
|
1850
|
+
}
|
1851
|
+
);
|
1852
|
+
};
|
1853
|
+
|
1854
|
+
// ../core/lib/scroll-into-view.ts
|
1855
|
+
init_react_import();
|
1856
|
+
var scrollIntoView = (el) => {
|
1857
|
+
const oldStyle = __spreadValues({}, el.style);
|
1858
|
+
el.style.scrollMargin = "256px";
|
1859
|
+
if (el) {
|
1860
|
+
el == null ? void 0 : el.scrollIntoView({ behavior: "smooth" });
|
1861
|
+
el.style.scrollMargin = oldStyle.scrollMargin || "";
|
1862
|
+
}
|
1863
|
+
};
|
1864
|
+
|
1865
|
+
// ../core/lib/get-frame.ts
|
1866
|
+
init_react_import();
|
1867
|
+
var getFrame = () => {
|
1868
|
+
let frame = document.querySelector("#preview-frame");
|
1869
|
+
if ((frame == null ? void 0 : frame.tagName) === "IFRAME") {
|
1870
|
+
frame = frame.contentDocument;
|
1871
|
+
}
|
1872
|
+
return frame;
|
1873
|
+
};
|
1874
|
+
|
1875
|
+
// src/HeadingAnalyzer.tsx
|
1876
|
+
import ReactFromJSONModule from "react-from-json";
|
1877
|
+
import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
1878
|
+
var getClassName5 = get_class_name_factory_default("HeadingAnalyzer", HeadingAnalyzer_module_default);
|
1879
|
+
var getClassNameItem2 = get_class_name_factory_default("HeadingAnalyzerItem", HeadingAnalyzer_module_default);
|
1880
|
+
var ReactFromJSON = ReactFromJSONModule.default || ReactFromJSONModule;
|
1881
|
+
var dataAttr = "data-puck-heading-analyzer-id";
|
1882
|
+
var getOutline = ({
|
1883
|
+
addDataAttr = false,
|
1884
|
+
frame
|
1885
|
+
} = {}) => {
|
1886
|
+
const headings = (frame == null ? void 0 : frame.querySelectorAll("h1,h2,h3,h4,h5,h6")) || [];
|
1887
|
+
const _outline = [];
|
1888
|
+
headings.forEach((item, i) => {
|
1889
|
+
if (addDataAttr) {
|
1890
|
+
item.setAttribute(dataAttr, i.toString());
|
1891
|
+
}
|
1892
|
+
_outline.push({
|
1893
|
+
rank: parseInt(item.tagName.split("H")[1]),
|
1894
|
+
text: item.textContent,
|
1895
|
+
analyzeId: i.toString()
|
1896
|
+
});
|
1897
|
+
});
|
1898
|
+
return _outline;
|
1899
|
+
};
|
1900
|
+
function buildHierarchy(frame) {
|
1901
|
+
var _a, _b;
|
1902
|
+
const headings = getOutline({ addDataAttr: true, frame });
|
1903
|
+
const root = { rank: 0, children: [], text: "" };
|
1904
|
+
let path = [root];
|
1905
|
+
for (let heading of headings) {
|
1906
|
+
const node = {
|
1907
|
+
rank: heading.rank,
|
1908
|
+
text: heading.text,
|
1909
|
+
analyzeId: heading.analyzeId,
|
1910
|
+
children: []
|
1911
|
+
};
|
1912
|
+
if (node.rank === 1) {
|
1913
|
+
path = [root];
|
1914
|
+
} else {
|
1915
|
+
while (path[path.length - 1].rank >= node.rank) {
|
1916
|
+
path.pop();
|
1917
|
+
}
|
1918
|
+
while (path.length < node.rank) {
|
1919
|
+
const missingNode = {
|
1920
|
+
rank: path.length,
|
1921
|
+
missing: true,
|
1922
|
+
children: [],
|
1923
|
+
text: ""
|
1924
|
+
};
|
1925
|
+
(_a = path[path.length - 1].children) == null ? void 0 : _a.push(missingNode);
|
1926
|
+
path.push(missingNode);
|
1927
|
+
}
|
1928
|
+
}
|
1929
|
+
(_b = path[path.length - 1].children) == null ? void 0 : _b.push(node);
|
1930
|
+
path.push(node);
|
1931
|
+
}
|
1932
|
+
return root.children;
|
1933
|
+
}
|
1934
|
+
var HeadingAnalyzer = () => {
|
1935
|
+
const { appState } = usePuck();
|
1936
|
+
const [hierarchy, setHierarchy] = useState5([]);
|
1937
|
+
const [firstRender, setFirstRender] = useState5(true);
|
1938
|
+
useEffect4(() => {
|
1939
|
+
const frame = getFrame();
|
1940
|
+
if (!frame) return;
|
1941
|
+
if (firstRender) {
|
1942
|
+
setTimeout(() => {
|
1943
|
+
setHierarchy(buildHierarchy(frame));
|
1944
|
+
setFirstRender(false);
|
1945
|
+
}, 100);
|
1946
|
+
} else {
|
1947
|
+
setHierarchy(buildHierarchy(frame));
|
1948
|
+
}
|
1949
|
+
}, [appState.data]);
|
1950
|
+
return /* @__PURE__ */ jsxs2("div", { className: getClassName5(), children: [
|
1951
|
+
/* @__PURE__ */ jsxs2(
|
1952
|
+
"small",
|
1953
|
+
{
|
1954
|
+
className: getClassName5("cssWarning"),
|
1955
|
+
style: {
|
1956
|
+
color: "var(--puck-color-red-04)",
|
1957
|
+
display: "block",
|
1958
|
+
marginBottom: 16
|
1959
|
+
},
|
1960
|
+
children: [
|
1961
|
+
"Heading analyzer styles not loaded. Please review the",
|
1962
|
+
" ",
|
1963
|
+
/* @__PURE__ */ jsx7("a", { href: "https://github.com/measuredco/puck/blob/main/packages/plugin-heading-analyzer/README.md", children: "README" }),
|
1964
|
+
"."
|
1965
|
+
]
|
1966
|
+
}
|
1967
|
+
),
|
1968
|
+
hierarchy.length === 0 && /* @__PURE__ */ jsx7("div", { children: "No headings." }),
|
1969
|
+
/* @__PURE__ */ jsx7(OutlineList, { children: /* @__PURE__ */ jsx7(
|
1970
|
+
ReactFromJSON,
|
1971
|
+
{
|
1972
|
+
mapping: {
|
1973
|
+
Root: (props) => /* @__PURE__ */ jsx7(Fragment2, { children: props.children }),
|
1974
|
+
OutlineListItem: (props) => /* @__PURE__ */ jsxs2(OutlineList.Item, { children: [
|
1975
|
+
/* @__PURE__ */ jsx7(OutlineList.Clickable, { children: /* @__PURE__ */ jsx7(
|
1976
|
+
"small",
|
1977
|
+
{
|
1978
|
+
className: getClassNameItem2({ missing: props.missing }),
|
1979
|
+
onClick: typeof props.analyzeId == "undefined" ? void 0 : (e) => {
|
1980
|
+
e.stopPropagation();
|
1981
|
+
const frame = getFrame();
|
1982
|
+
const el = frame == null ? void 0 : frame.querySelector(
|
1983
|
+
`[${dataAttr}="${props.analyzeId}"]`
|
1984
|
+
);
|
1985
|
+
const oldStyle = __spreadValues({}, el.style);
|
1986
|
+
if (el) {
|
1987
|
+
scrollIntoView(el);
|
1988
|
+
el.style.outline = "4px solid var(--puck-color-rose-06)";
|
1989
|
+
el.style.outlineOffset = "4px";
|
1990
|
+
setTimeout(() => {
|
1991
|
+
el.style.outline = oldStyle.outline || "";
|
1992
|
+
el.style.outlineOffset = oldStyle.outlineOffset || "";
|
1993
|
+
}, 2e3);
|
1994
|
+
}
|
1995
|
+
},
|
1996
|
+
children: props.missing ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
1997
|
+
/* @__PURE__ */ jsxs2("b", { children: [
|
1998
|
+
"H",
|
1999
|
+
props.rank
|
2000
|
+
] }),
|
2001
|
+
": Missing"
|
2002
|
+
] }) : /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
2003
|
+
/* @__PURE__ */ jsxs2("b", { children: [
|
2004
|
+
"H",
|
2005
|
+
props.rank
|
2006
|
+
] }),
|
2007
|
+
": ",
|
2008
|
+
props.text
|
2009
|
+
] })
|
2010
|
+
}
|
2011
|
+
) }),
|
2012
|
+
/* @__PURE__ */ jsx7(OutlineList, { children: props.children })
|
2013
|
+
] })
|
2014
|
+
},
|
2015
|
+
entry: {
|
2016
|
+
props: { children: hierarchy },
|
2017
|
+
type: "Root"
|
2018
|
+
},
|
2019
|
+
mapProp: (prop) => {
|
2020
|
+
if (prop && prop.rank) {
|
2021
|
+
return {
|
2022
|
+
type: "OutlineListItem",
|
2023
|
+
props: prop
|
2024
|
+
};
|
2025
|
+
}
|
2026
|
+
return prop;
|
2027
|
+
}
|
2028
|
+
}
|
2029
|
+
) })
|
2030
|
+
] });
|
2031
|
+
};
|
2032
|
+
var headingAnalyzer = {
|
2033
|
+
overrides: {
|
2034
|
+
fields: ({ children, itemSelector }) => /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
2035
|
+
children,
|
2036
|
+
/* @__PURE__ */ jsx7("div", { style: { display: itemSelector ? "none" : "block" }, children: /* @__PURE__ */ jsx7(SidebarSection, { title: "Heading Outline", children: /* @__PURE__ */ jsx7(HeadingAnalyzer, {}) }) })
|
2037
|
+
] })
|
2038
|
+
}
|
2039
|
+
};
|
2040
|
+
var HeadingAnalyzer_default = headingAnalyzer;
|
2041
|
+
export {
|
2042
|
+
HeadingAnalyzer_default as default
|
2043
|
+
};
|
2044
|
+
/*! Bundled license information:
|
2045
|
+
|
2046
|
+
classnames/index.js:
|
2047
|
+
(*!
|
2048
|
+
Copyright (c) 2018 Jed Watson.
|
2049
|
+
Licensed under the MIT License (MIT), see
|
2050
|
+
http://jedwatson.github.io/classnames
|
2051
|
+
*)
|
2052
|
+
|
2053
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
2054
|
+
(**
|
2055
|
+
* @license lucide-react v0.298.0 - ISC
|
2056
|
+
*
|
2057
|
+
* This source code is licensed under the ISC license.
|
2058
|
+
* See the LICENSE file in the root directory of this source tree.
|
2059
|
+
*)
|
2060
|
+
|
2061
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
2062
|
+
(**
|
2063
|
+
* @license lucide-react v0.298.0 - ISC
|
2064
|
+
*
|
2065
|
+
* This source code is licensed under the ISC license.
|
2066
|
+
* See the LICENSE file in the root directory of this source tree.
|
2067
|
+
*)
|
2068
|
+
|
2069
|
+
lucide-react/dist/esm/icons/chevron-right.js:
|
2070
|
+
(**
|
2071
|
+
* @license lucide-react v0.298.0 - ISC
|
2072
|
+
*
|
2073
|
+
* This source code is licensed under the ISC license.
|
2074
|
+
* See the LICENSE file in the root directory of this source tree.
|
2075
|
+
*)
|
2076
|
+
|
2077
|
+
lucide-react/dist/esm/lucide-react.js:
|
2078
|
+
(**
|
2079
|
+
* @license lucide-react v0.298.0 - ISC
|
2080
|
+
*
|
2081
|
+
* This source code is licensed under the ISC license.
|
2082
|
+
* See the LICENSE file in the root directory of this source tree.
|
2083
|
+
*)
|
2084
|
+
*/
|