@measured/puck-plugin-heading-analyzer 0.16.0-canary.0c7fc83 → 0.16.0-canary.2bef00b

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