@measured/puck-plugin-heading-analyzer 0.14.2-canary.03ab0bd → 0.14.2-canary.23db292

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1490 -50
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -35204,6 +35204,26 @@ function getFurthestAway({
35204
35204
  }).sort((a2, b) => b.distance - a2.distance);
35205
35205
  return sorted[0] ? sorted[0].id : null;
35206
35206
  }
35207
+ function normalizeFamilies(pageBorderBox, candidates) {
35208
+ const families = candidates.reduce((acc, candidate) => {
35209
+ var _a3;
35210
+ const familyName = ((_a3 = candidate.parents[0]) == null ? void 0 : _a3.id) || candidate.descriptor.id;
35211
+ const family = acc[familyName] || [];
35212
+ const generation = candidate.parents.length;
35213
+ family[generation] = [...family[generation] || [], candidate];
35214
+ return __spreadProps(__spreadValues({}, acc), {
35215
+ [familyName]: family
35216
+ });
35217
+ }, {});
35218
+ return Object.keys(families).map((familyName) => {
35219
+ const family = families[familyName].flat();
35220
+ const reversedFamily = [...family].reverse();
35221
+ const chosenMember = reversedFamily.find((member) => {
35222
+ return pageBorderBox.center.x < member.page.borderBox.right && pageBorderBox.center.x > member.page.borderBox.left && pageBorderBox.center.y > member.page.borderBox.top && pageBorderBox.center.y < member.page.borderBox.bottom;
35223
+ });
35224
+ return chosenMember || family[0];
35225
+ });
35226
+ }
35207
35227
  function getDroppableOver({
35208
35228
  pageBorderBox,
35209
35229
  draggable: draggable2,
@@ -35244,10 +35264,14 @@ function getDroppableOver({
35244
35264
  if (candidates.length === 1) {
35245
35265
  return candidates[0].descriptor.id;
35246
35266
  }
35267
+ const normalizedCandidates = normalizeFamilies(pageBorderBox, candidates);
35268
+ if (normalizedCandidates.length === 1) {
35269
+ return normalizedCandidates[0].descriptor.id;
35270
+ }
35247
35271
  return getFurthestAway({
35248
35272
  pageBorderBox,
35249
35273
  draggable: draggable2,
35250
- candidates
35274
+ candidates: normalizedCandidates
35251
35275
  });
35252
35276
  }
35253
35277
  function getIsDisplaced({
@@ -35470,7 +35494,10 @@ function querySelectorAllIframe(selector) {
35470
35494
  iframes = iframes.filter((iframe) => iframe.hasAttribute("data-rfd-iframe"));
35471
35495
  iframeCache.set("iframes", iframes);
35472
35496
  }
35473
- const iframePossible = iframes.reduce((acc, iframe) => [...acc, ...querySelectorAll(iframe.contentWindow.document, selector)], []);
35497
+ const iframePossible = iframes.reduce((acc, iframe) => {
35498
+ var _a3;
35499
+ return [...acc, ...((_a3 = iframe.contentWindow) == null ? void 0 : _a3.document) ? querySelectorAll(iframe.contentWindow.document, selector) : []];
35500
+ }, []);
35474
35501
  return [...querySelectorAll(document, selector), ...iframePossible];
35475
35502
  }
35476
35503
  function useStyleMarshal(contextId, nonce) {
@@ -35492,7 +35519,10 @@ function useStyleMarshal(contextId, nonce) {
35492
35519
  useLayoutEffect2(() => {
35493
35520
  const alwaysSelector = `[${alwaysDataAttr}="${contextId}"]`;
35494
35521
  const dynamicSelector = `[${dynamicDataAttr}="${contextId}"]`;
35495
- const heads = [getHead(document), ...querySelectorAll(document, `[${prefix2}-iframe]`).map((iframe) => getHead(iframe.contentWindow.document))];
35522
+ const heads = [getHead(document), ...querySelectorAll(document, `[${prefix2}-iframe]`).filter((iframe) => {
35523
+ var _a3;
35524
+ return (_a3 = iframe.contentWindow) == null ? void 0 : _a3.document;
35525
+ }).map((iframe) => getHead(iframe.contentWindow.document))];
35496
35526
  heads.forEach((head) => {
35497
35527
  if (!head)
35498
35528
  return;
@@ -35926,20 +35956,22 @@ function offsetPoint(x, y, win) {
35926
35956
  let offsetY = 0;
35927
35957
  if (win.parent !== win.self) {
35928
35958
  const iframe = win.frameElement;
35929
- const rect = iframe.getBoundingClientRect();
35930
- const transform = getTransform(iframe);
35931
- offsetX = rect.left;
35932
- offsetY = rect.top;
35933
- if (transform) {
35934
- const {
35935
- x: transformedX,
35936
- y: transformedY
35937
- } = applyTransformPoint(x, y, transform.matrix, transform.origin);
35938
- const point2 = {
35939
- x: transformedX + offsetX,
35940
- y: transformedY + offsetY
35941
- };
35942
- return point2;
35959
+ if (iframe) {
35960
+ const rect = iframe.getBoundingClientRect();
35961
+ const transform = getTransform(iframe);
35962
+ offsetX = rect.left;
35963
+ offsetY = rect.top;
35964
+ if (transform) {
35965
+ const {
35966
+ x: transformedX,
35967
+ y: transformedY
35968
+ } = applyTransformPoint(x, y, transform.matrix, transform.origin);
35969
+ const point2 = {
35970
+ x: transformedX + offsetX,
35971
+ y: transformedY + offsetY
35972
+ };
35973
+ return point2;
35974
+ }
35943
35975
  }
35944
35976
  }
35945
35977
  const point = {
@@ -37612,7 +37644,7 @@ function getBody() {
37612
37644
  !document.body ? process.env.NODE_ENV !== "production" ? invariant2(false, "document.body is not ready") : invariant2(false) : void 0;
37613
37645
  return document.body;
37614
37646
  }
37615
- var import_react5, import_react_dom2, isProduction$1, spacesAndTabs, lineStartWithSpaces, clean$2, getDevMessage, getFormattedMessage, isDisabledFlag, warning2, error, loaded, isProduction2, prefix$1, RbdInvariant, ErrorBoundary, dragHandleUsageInstructions, position, onDragStart, withLocation, withCombine, onDragUpdate, returnedToStart, onDragEnd, preset, preset$1, origin, add, subtract, isEqual$1, negate, patch, distance2, closest$1, apply, executeClip, offsetByPosition, getCorners, noSpacing2, scroll$1, increase, clip2, getSubject, scrollDroppable, toDroppableMap, toDraggableMap, toDroppableList, toDraggableList, getDraggablesInsideDroppable, removeDraggableFromList, moveToNextCombine, isHomeOf, noDisplacedBy, emptyGroups, noImpact, noImpact$1, isWithin, isPartiallyVisibleThroughFrame, isTotallyVisibleThroughFrame, vertical, horizontal, isTotallyVisibleThroughFrameOnAxis, getDroppableDisplaced, isVisibleInDroppable, isVisibleInViewport, isVisible$1, isPartiallyVisible, isTotallyVisible, isTotallyVisibleOnAxis, getShouldAnimate, fromCombine, fromReorder, moveToNextIndex, getCombinedItemDisplacement, whenCombining, distanceFromStartToBorderBoxCenter, distanceFromEndToBorderBoxCenter, getCrossAxisBorderBoxCenter, goAfter, goBefore, goIntoStart, whenReordering, withDroppableDisplacement, getResultWithoutDroppableDisplacement, getPageBorderBoxCenterFromImpact, scrollViewport, speculativelyIncrease, withViewportDisplacement, getClientFromPageBorderBoxCenter, isTotallyVisibleInNewLocation, moveToNextPlace, getKnownActive, getBestCrossAxisDroppable, getCurrentPageBorderBoxCenter, getCurrentPageBorderBox, getClosestDraggable, getDisplacedBy, getRequiredGrowthForPlaceholder, withMaxScroll, addPlaceholder, removePlaceholder, moveToNewDroppable, moveCrossAxis, whatIsDraggedOver, getDroppableOver$1, moveInDirection, offsetRectByPosition, withDroppableScroll, getReorderImpact, combineThresholdDivisor, getCombineImpact, getDragImpact, patchDroppableMap, clearUnusedPlaceholder, recomputePlaceholders, update, recompute, getClientBorderBoxCenter, refreshSnap, getHomeLocation, getLiftEffect, patchDimensionMap, start, finish, offsetDraggable, getFrame, adjustAdditionsForScrollChanges, timingsKey, publishWhileDraggingInVirtual, isSnapping, postDroppableChange, idle$2, reducer, beforeInitialCapture, lift$1, initialPublish, publishWhileDragging, collectionStarting, updateDroppableScroll, updateDroppableIsEnabled, updateDroppableIsCombineEnabled, move, moveByWindowScroll, updateViewportMaxScroll, moveUp, moveDown, moveRight, moveLeft, flush, animateDrop, completeDrop, drop$1, dropPending, dropAnimationFinished, lift, style, curves, combine, timings, outOfTheWayTiming, transitions, moveTo, transforms, minDropTime, maxDropTime, dropTimeRange, maxDropTimeAtDistance, cancelDropModifier, getDropDuration, getNewHomeClientOffset, getDropImpact, dropMiddleware, drop, getWindowScroll3, shouldEnd, scrollListener, scrollListener$1, getExpiringAnnounce, getAsyncMarshal, areLocationsEqual, isCombineEqual, isCriticalEqual, withTimings, getDragStart, getPublisher, responders, dropAnimationFinishMiddleware, dropAnimationFinish, dropAnimationFlushOnScrollMiddleware, dropAnimationFlushOnScroll, dimensionMarshalStopper, focus, shouldStop, autoScroll, pendingDrop, pendingDrop$1, composeEnhancers, createStore2, clean$1, getMaxScroll, getDocumentElement, getMaxWindowScroll, getViewport, getInitialPublish, createDimensionMarshal, canStartDrag, scrollWindow, getScrollableDroppables, getScrollableDroppableOver, getBestScrollableDroppable, defaultAutoScrollerOptions, getDistanceThresholds, getPercentage, minScroll, getValueFromDistance, dampenValueByTime, getValue, getScrollOnAxis, adjustForSizeLimits, clean, getScroll$1, smallestSigned, getOverlap, canPartiallyScroll, canScrollWindow, getWindowOverlap, canScrollDroppable, getDroppableOverlap, getWindowScrollChange, getDroppableScrollChange, iframeCache, createCol, matrixPattern, getMatrix, getOrigin, findNearestTransform, defaultTransform, getTransform, applyTransformPoint, applyTransformRect, applyTransformSpacing, applyTransformBox, resetToOrigin, getIframeScroll, scroll, createFluidScroller, createJumpScroller, createAutoScroller, prefix2, dragHandle, draggable, droppable, scrollContainer, makeGetSelector, getStyles, noPointerEvents, getStyles$1, useIsomorphicLayoutEffect2, useLayoutEffect2, getHead, createStyleEl, alwaysDataAttr, dynamicDataAttr, getWindowFromEl, dragHandleCache, StoreContext, getBodyElement, visuallyHidden, visuallyHidden$1, getId, count$1, defaults, useUniqueId$1, AppContext, peerDependencies, semver, getVersion, isSatisfied, checkReactVersion, suffix, checkDoctype, tab, enter, escape, space, pageUp, pageDown, end, home, arrowLeft, arrowUp, arrowRight, arrowDown, preventedKeys, preventStandardKeyEvents, supportedEventName, supportedPageVisibilityEventName, primaryButton, sloppyClickThreshold, idle$1, scrollJumpKeys, idle, timeForLongPress, forcePressThreshold, interactiveTagNames, getBorderBoxCenterPosition, supportedMatchesName, defaultSensors, createResponders, createAutoScrollerOptions, count, useUniqueContextId$1, zIndexOptions, getDraggingTransition, getDraggingOpacity, getShouldDraggingAnimate, applyOffsetBox, DroppableContext, Draggable, Draggable$1, isStrictEqual, whatIsDraggedOverFromResult, getCombineWithFromResult, getCombineWithFromImpact, atRest, makeMapStateToProps$1, mapDispatchToProps$1, ConnectedDraggable, ConnectedDraggable$1, getScroll, isEqual2, isScroll, isAuto, isVisible, isEither, isBoth, isElementScrollable, isBodyScrollable, getClosestScrollable, getClosestScrollable$1, getIsFixed, getEnv, getDroppableDimension, getClient, getDimension, immediate, delayed, getListenerOptions, getScrollable, getClosestScrollableFromDrag, empty, getSize, getStyle, Placeholder, Placeholder$1, shared, standard, virtual, AnimateInOut, Droppable, Droppable$1, defaultProps, attachDefaultPropsToOwnProps, isMatchingType, getDraggable, makeMapStateToProps, mapDispatchToProps, ConnectedDroppable, ConnectedDroppable$1;
37647
+ var import_react5, import_react_dom2, isProduction$1, spacesAndTabs, lineStartWithSpaces, clean$2, getDevMessage, getFormattedMessage, isDisabledFlag, warning2, error, loaded, isProduction2, prefix$1, RbdInvariant, ErrorBoundary, dragHandleUsageInstructions, position, onDragStart, withLocation, withCombine, onDragUpdate, returnedToStart, onDragEnd, preset, preset$1, origin, add, subtract, isEqual$1, negate, patch, distance2, closest$1, apply, executeClip, offsetByPosition, getCorners, noSpacing2, scroll$1, increase, clip2, getSubject, scrollDroppable, toDroppableMap, toDraggableMap, toDroppableList, toDraggableList, getDraggablesInsideDroppable, removeDraggableFromList, moveToNextCombine, isHomeOf, noDisplacedBy, emptyGroups, noImpact, noImpact$1, isWithin, isPartiallyVisibleThroughFrame, isTotallyVisibleThroughFrame, vertical, horizontal, isTotallyVisibleThroughFrameOnAxis, getDroppableDisplaced, isVisibleInDroppable, isVisibleInViewport, isVisible$1, isPartiallyVisible, isTotallyVisible, isTotallyVisibleOnAxis, getShouldAnimate, fromCombine, fromReorder, moveToNextIndex, getCombinedItemDisplacement, whenCombining, distanceFromStartToBorderBoxCenter, distanceFromEndToBorderBoxCenter, getCrossAxisBorderBoxCenter, goAfter, goBefore, goIntoStart, whenReordering, withDroppableDisplacement, getResultWithoutDroppableDisplacement, getPageBorderBoxCenterFromImpact, scrollViewport, speculativelyIncrease, withViewportDisplacement, getClientFromPageBorderBoxCenter, isTotallyVisibleInNewLocation, moveToNextPlace, getKnownActive, getBestCrossAxisDroppable, getCurrentPageBorderBoxCenter, getCurrentPageBorderBox, getClosestDraggable, getDisplacedBy, getRequiredGrowthForPlaceholder, withMaxScroll, addPlaceholder, removePlaceholder, moveToNewDroppable, moveCrossAxis, whatIsDraggedOver, getDroppableOver$1, moveInDirection, offsetRectByPosition, withDroppableScroll, getReorderImpact, combineThresholdDivisor, getCombineImpact, getDragImpact, patchDroppableMap, clearUnusedPlaceholder, recomputePlaceholders, update, recompute, getClientBorderBoxCenter, refreshSnap, getHomeLocation, getLiftEffect, patchDimensionMap, start, finish, offsetDraggable, getFrame, adjustAdditionsForScrollChanges, timingsKey, publishWhileDraggingInVirtual, isSnapping, postDroppableChange, idle$2, reducer, beforeInitialCapture, lift$1, initialPublish, publishWhileDragging, collectionStarting, updateDroppableScroll, updateDroppableIsEnabled, updateDroppableIsCombineEnabled, move, moveByWindowScroll, updateViewportMaxScroll, moveUp, moveDown, moveRight, moveLeft, flush, animateDrop, completeDrop, drop$1, dropPending, dropAnimationFinished, lift, style, curves, combine, timings, outOfTheWayTiming, transitions, moveTo, transforms, minDropTime, maxDropTime, dropTimeRange, maxDropTimeAtDistance, cancelDropModifier, getDropDuration, getNewHomeClientOffset, getDropImpact, dropMiddleware, drop, getWindowScroll3, shouldEnd, scrollListener, scrollListener$1, getExpiringAnnounce, getAsyncMarshal, areLocationsEqual, isCombineEqual, isCriticalEqual, withTimings, getDragStart, getPublisher, responders, dropAnimationFinishMiddleware, dropAnimationFinish, dropAnimationFlushOnScrollMiddleware, dropAnimationFlushOnScroll, dimensionMarshalStopper, focus, shouldStop, autoScroll, pendingDrop, pendingDrop$1, composeEnhancers, createStore2, clean$1, getMaxScroll, getDocumentElement, getMaxWindowScroll, getViewport, getInitialPublish, createDimensionMarshal, canStartDrag, scrollWindow, getScrollableDroppables, getScrollableDroppableOver, getBestScrollableDroppable, defaultAutoScrollerOptions, getDistanceThresholds, getPercentage, minScroll, getValueFromDistance, dampenValueByTime, getValue, getScrollOnAxis, adjustForSizeLimits, clean, getScroll$1, smallestSigned, getOverlap, canPartiallyScroll, canScrollWindow, getWindowOverlap, canScrollDroppable, getDroppableOverlap, getWindowScrollChange, getDroppableScrollChange, iframeCache, createCol, matrixPattern, getMatrix, getOrigin, findNearestTransform, defaultTransform, getTransform, applyTransformPoint, applyTransformRect, applyTransformSpacing, applyTransformBox, resetToOrigin, getIframeScroll, scroll, createFluidScroller, createJumpScroller, createAutoScroller, prefix2, dragHandle, draggable, droppable, scrollContainer, makeGetSelector, getStyles, noPointerEvents, getStyles$1, useIsomorphicLayoutEffect2, useLayoutEffect2, getHead, createStyleEl, alwaysDataAttr, dynamicDataAttr, getWindowFromEl, dragHandleCache, StoreContext, getBodyElement, visuallyHidden, visuallyHidden$1, getId, count$1, defaults, useUniqueId$1, AppContext, peerDependencies, semver, getVersion, isSatisfied, checkReactVersion, suffix, checkDoctype, tab, enter, escape, space, pageUp, pageDown, end, home, arrowLeft, arrowUp, arrowRight, arrowDown, preventedKeys, preventStandardKeyEvents, supportedEventName, supportedPageVisibilityEventName, primaryButton, sloppyClickThreshold, idle$1, scrollJumpKeys, idle, timeForLongPress, forcePressThreshold, interactiveTagNames, getBorderBoxCenterPosition, supportedMatchesName, defaultSensors, createResponders, createAutoScrollerOptions, count, useUniqueContextId$1, zIndexOptions, getDraggingTransition, getDraggingOpacity, getShouldDraggingAnimate, applyOffsetBox, DroppableContext, Draggable, Draggable$1, isStrictEqual, whatIsDraggedOverFromResult, getCombineWithFromResult, getCombineWithFromImpact, atRest, makeMapStateToProps$1, mapDispatchToProps$1, ConnectedDraggable, ConnectedDraggable$1, getScroll, isEqual2, isScroll, isAuto, isVisible, isEither, isBoth, isElementScrollable, isBodyScrollable, getClosestScrollable, getClosestScrollable$1, getIsFixed, getEnv, getDroppableDimension, getClient, getParents, getDimension, immediate, delayed, getListenerOptions, getScrollable, getClosestScrollableFromDrag, empty, getSize, getStyle, Placeholder, Placeholder$1, shared, standard, virtual, AnimateInOut, Droppable, Droppable$1, defaultProps, attachDefaultPropsToOwnProps, isMatchingType, getDraggable, makeMapStateToProps, mapDispatchToProps, ConnectedDroppable, ConnectedDroppable$1;
37616
37648
  var init_dnd_esm = __esm({
37617
37649
  "../../node_modules/@measured/dnd/dist/dnd.esm.js"() {
37618
37650
  init_react_import();
@@ -41020,7 +41052,7 @@ var init_dnd_esm = __esm({
41020
41052
  }
41021
41053
  if (!el.parentElement) {
41022
41054
  const refWindow = el.ownerDocument.defaultView;
41023
- if (refWindow && refWindow.self !== refWindow.parent) {
41055
+ if (refWindow && refWindow.self !== refWindow.parent && refWindow.frameElement) {
41024
41056
  const iframe = refWindow.frameElement;
41025
41057
  return findNearestTransform(iframe);
41026
41058
  }
@@ -41142,7 +41174,7 @@ var init_dnd_esm = __esm({
41142
41174
  }) => {
41143
41175
  const el = querySelectorAllIframe(`[data-rfd-draggable-id="${state.critical.draggable.id}"]`)[0];
41144
41176
  const win = (el == null ? void 0 : el.ownerDocument.defaultView) || window;
41145
- const isInIframe = win !== window;
41177
+ const isInIframe = win !== window && win.frameElement;
41146
41178
  if (isInIframe) {
41147
41179
  const iframe = win.frameElement;
41148
41180
  const viewportBox = getBox(iframe);
@@ -41981,7 +42013,8 @@ var init_dnd_esm = __esm({
41981
42013
  client,
41982
42014
  page,
41983
42015
  closest: closest2,
41984
- transform
42016
+ transform,
42017
+ parents
41985
42018
  }) => {
41986
42019
  const frame = (() => {
41987
42020
  if (!closest2) {
@@ -42030,7 +42063,8 @@ var init_dnd_esm = __esm({
42030
42063
  page,
42031
42064
  frame,
42032
42065
  subject,
42033
- transform
42066
+ transform,
42067
+ parents
42034
42068
  };
42035
42069
  return dimension;
42036
42070
  };
@@ -42067,6 +42101,27 @@ var init_dnd_esm = __esm({
42067
42101
  });
42068
42102
  return client;
42069
42103
  };
42104
+ getParents = (ref2) => {
42105
+ var _a3;
42106
+ const contextId = ref2.getAttribute(`${prefix2}-droppable-context-id`);
42107
+ const parentDescriptors = [];
42108
+ if (!contextId)
42109
+ return [];
42110
+ let currentEl = ref2;
42111
+ while (currentEl) {
42112
+ currentEl = (_a3 = currentEl.parentElement) == null ? void 0 : _a3.closest(`[${prefix2}-droppable-context-id="${contextId}"]`);
42113
+ const id = currentEl == null ? void 0 : currentEl.getAttribute(`${prefix2}-droppable-id`);
42114
+ if (id) {
42115
+ parentDescriptors.push({
42116
+ id,
42117
+ mode: "standard",
42118
+ type: "DEFAULT"
42119
+ });
42120
+ }
42121
+ }
42122
+ parentDescriptors.reverse();
42123
+ return parentDescriptors;
42124
+ };
42070
42125
  getDimension = ({
42071
42126
  ref: ref2,
42072
42127
  descriptor,
@@ -42102,6 +42157,7 @@ var init_dnd_esm = __esm({
42102
42157
  shouldClipSubject
42103
42158
  };
42104
42159
  })();
42160
+ const parents = getParents(ref2);
42105
42161
  const dimension = getDroppableDimension({
42106
42162
  descriptor,
42107
42163
  isEnabled: !isDropDisabled,
@@ -42111,7 +42167,8 @@ var init_dnd_esm = __esm({
42111
42167
  client,
42112
42168
  page,
42113
42169
  closest: closest2,
42114
- transform
42170
+ transform,
42171
+ parents
42115
42172
  });
42116
42173
  return dimension;
42117
42174
  };
@@ -42582,6 +42639,1291 @@ var init_dnd_esm = __esm({
42582
42639
  }
42583
42640
  });
42584
42641
 
42642
+ // ../../node_modules/ua-parser-js/src/ua-parser.js
42643
+ var require_ua_parser = __commonJS({
42644
+ "../../node_modules/ua-parser-js/src/ua-parser.js"(exports, module2) {
42645
+ init_react_import();
42646
+ (function(window2, undefined2) {
42647
+ "use strict";
42648
+ 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", TYPE2 = "type", VENDOR = "vendor", VERSION = "version", ARCHITECTURE = "architecture", CONSOLE = "console", MOBILE = "mobile", TABLET = "tablet", SMARTTV = "smarttv", WEARABLE = "wearable", EMBEDDED = "embedded", UA_MAX_LENGTH = 500;
42649
+ 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";
42650
+ var extend = function(regexes2, extensions) {
42651
+ var mergedRegexes = {};
42652
+ for (var i2 in regexes2) {
42653
+ if (extensions[i2] && extensions[i2].length % 2 === 0) {
42654
+ mergedRegexes[i2] = extensions[i2].concat(regexes2[i2]);
42655
+ } else {
42656
+ mergedRegexes[i2] = regexes2[i2];
42657
+ }
42658
+ }
42659
+ return mergedRegexes;
42660
+ }, enumerize = function(arr) {
42661
+ var enums = {};
42662
+ for (var i2 = 0; i2 < arr.length; i2++) {
42663
+ enums[arr[i2].toUpperCase()] = arr[i2];
42664
+ }
42665
+ return enums;
42666
+ }, has = function(str1, str2) {
42667
+ return typeof str1 === STR_TYPE ? lowerize(str2).indexOf(lowerize(str1)) !== -1 : false;
42668
+ }, lowerize = function(str) {
42669
+ return str.toLowerCase();
42670
+ }, majorize = function(version2) {
42671
+ return typeof version2 === STR_TYPE ? version2.replace(/[^\d\.]/g, EMPTY).split(".")[0] : undefined2;
42672
+ }, trim = function(str, len) {
42673
+ if (typeof str === STR_TYPE) {
42674
+ str = str.replace(/^\s\s*/, EMPTY);
42675
+ return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);
42676
+ }
42677
+ };
42678
+ var rgxMapper = function(ua, arrays) {
42679
+ var i2 = 0, j, k, p, q, matches, match;
42680
+ while (i2 < arrays.length && !matches) {
42681
+ var regex = arrays[i2], props = arrays[i2 + 1];
42682
+ j = k = 0;
42683
+ while (j < regex.length && !matches) {
42684
+ if (!regex[j]) {
42685
+ break;
42686
+ }
42687
+ matches = regex[j++].exec(ua);
42688
+ if (!!matches) {
42689
+ for (p = 0; p < props.length; p++) {
42690
+ match = matches[++k];
42691
+ q = props[p];
42692
+ if (typeof q === OBJ_TYPE && q.length > 0) {
42693
+ if (q.length === 2) {
42694
+ if (typeof q[1] == FUNC_TYPE) {
42695
+ this[q[0]] = q[1].call(this, match);
42696
+ } else {
42697
+ this[q[0]] = q[1];
42698
+ }
42699
+ } else if (q.length === 3) {
42700
+ if (typeof q[1] === FUNC_TYPE && !(q[1].exec && q[1].test)) {
42701
+ this[q[0]] = match ? q[1].call(this, match, q[2]) : undefined2;
42702
+ } else {
42703
+ this[q[0]] = match ? match.replace(q[1], q[2]) : undefined2;
42704
+ }
42705
+ } else if (q.length === 4) {
42706
+ this[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined2;
42707
+ }
42708
+ } else {
42709
+ this[q] = match ? match : undefined2;
42710
+ }
42711
+ }
42712
+ }
42713
+ }
42714
+ i2 += 2;
42715
+ }
42716
+ }, strMapper = function(str, map) {
42717
+ for (var i2 in map) {
42718
+ if (typeof map[i2] === OBJ_TYPE && map[i2].length > 0) {
42719
+ for (var j = 0; j < map[i2].length; j++) {
42720
+ if (has(map[i2][j], str)) {
42721
+ return i2 === UNKNOWN ? undefined2 : i2;
42722
+ }
42723
+ }
42724
+ } else if (has(map[i2], str)) {
42725
+ return i2 === UNKNOWN ? undefined2 : i2;
42726
+ }
42727
+ }
42728
+ return str;
42729
+ };
42730
+ var oldSafariMap = {
42731
+ "1.0": "/8",
42732
+ "1.2": "/1",
42733
+ "1.3": "/3",
42734
+ "2.0": "/412",
42735
+ "2.0.2": "/416",
42736
+ "2.0.3": "/417",
42737
+ "2.0.4": "/419",
42738
+ "?": "/"
42739
+ }, windowsVersionMap = {
42740
+ "ME": "4.90",
42741
+ "NT 3.11": "NT3.51",
42742
+ "NT 4.0": "NT4.0",
42743
+ "2000": "NT 5.0",
42744
+ "XP": ["NT 5.1", "NT 5.2"],
42745
+ "Vista": "NT 6.0",
42746
+ "7": "NT 6.1",
42747
+ "8": "NT 6.2",
42748
+ "8.1": "NT 6.3",
42749
+ "10": ["NT 6.4", "NT 10.0"],
42750
+ "RT": "ARM"
42751
+ };
42752
+ var regexes = {
42753
+ browser: [
42754
+ [
42755
+ /\b(?:crmo|crios)\/([\w\.]+)/i
42756
+ // Chrome for Android/iOS
42757
+ ],
42758
+ [VERSION, [NAME, "Chrome"]],
42759
+ [
42760
+ /edg(?:e|ios|a)?\/([\w\.]+)/i
42761
+ // Microsoft Edge
42762
+ ],
42763
+ [VERSION, [NAME, "Edge"]],
42764
+ [
42765
+ // Presto based
42766
+ /(opera mini)\/([-\w\.]+)/i,
42767
+ // Opera Mini
42768
+ /(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,
42769
+ // Opera Mobi/Tablet
42770
+ /(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i
42771
+ // Opera
42772
+ ],
42773
+ [NAME, VERSION],
42774
+ [
42775
+ /opios[\/ ]+([\w\.]+)/i
42776
+ // Opera mini on iphone >= 8.0
42777
+ ],
42778
+ [VERSION, [NAME, OPERA + " Mini"]],
42779
+ [
42780
+ /\bopr\/([\w\.]+)/i
42781
+ // Opera Webkit
42782
+ ],
42783
+ [VERSION, [NAME, OPERA]],
42784
+ [
42785
+ // Mixed
42786
+ /\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i
42787
+ // Baidu
42788
+ ],
42789
+ [VERSION, [NAME, "Baidu"]],
42790
+ [
42791
+ /(kindle)\/([\w\.]+)/i,
42792
+ // Kindle
42793
+ /(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,
42794
+ // Lunascape/Maxthon/Netfront/Jasmine/Blazer
42795
+ // Trident based
42796
+ /(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,
42797
+ // Avant/IEMobile/SlimBrowser
42798
+ /(?:ms|\()(ie) ([\w\.]+)/i,
42799
+ // Internet Explorer
42800
+ // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
42801
+ /(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,
42802
+ // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ
42803
+ /(heytap|ovi)browser\/([\d\.]+)/i,
42804
+ // Heytap/Ovi
42805
+ /(weibo)__([\d\.]+)/i
42806
+ // Weibo
42807
+ ],
42808
+ [NAME, VERSION],
42809
+ [
42810
+ /(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i
42811
+ // UCBrowser
42812
+ ],
42813
+ [VERSION, [NAME, "UC" + BROWSER]],
42814
+ [
42815
+ /microm.+\bqbcore\/([\w\.]+)/i,
42816
+ // WeChat Desktop for Windows Built-in Browser
42817
+ /\bqbcore\/([\w\.]+).+microm/i,
42818
+ /micromessenger\/([\w\.]+)/i
42819
+ // WeChat
42820
+ ],
42821
+ [VERSION, [NAME, "WeChat"]],
42822
+ [
42823
+ /konqueror\/([\w\.]+)/i
42824
+ // Konqueror
42825
+ ],
42826
+ [VERSION, [NAME, "Konqueror"]],
42827
+ [
42828
+ /trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i
42829
+ // IE11
42830
+ ],
42831
+ [VERSION, [NAME, "IE"]],
42832
+ [
42833
+ /ya(?:search)?browser\/([\w\.]+)/i
42834
+ // Yandex
42835
+ ],
42836
+ [VERSION, [NAME, "Yandex"]],
42837
+ [
42838
+ /slbrowser\/([\w\.]+)/i
42839
+ // Smart Lenovo Browser
42840
+ ],
42841
+ [VERSION, [NAME, "Smart Lenovo " + BROWSER]],
42842
+ [
42843
+ /(avast|avg)\/([\w\.]+)/i
42844
+ // Avast/AVG Secure Browser
42845
+ ],
42846
+ [[NAME, /(.+)/, "$1 Secure " + BROWSER], VERSION],
42847
+ [
42848
+ /\bfocus\/([\w\.]+)/i
42849
+ // Firefox Focus
42850
+ ],
42851
+ [VERSION, [NAME, FIREFOX + " Focus"]],
42852
+ [
42853
+ /\bopt\/([\w\.]+)/i
42854
+ // Opera Touch
42855
+ ],
42856
+ [VERSION, [NAME, OPERA + " Touch"]],
42857
+ [
42858
+ /coc_coc\w+\/([\w\.]+)/i
42859
+ // Coc Coc Browser
42860
+ ],
42861
+ [VERSION, [NAME, "Coc Coc"]],
42862
+ [
42863
+ /dolfin\/([\w\.]+)/i
42864
+ // Dolphin
42865
+ ],
42866
+ [VERSION, [NAME, "Dolphin"]],
42867
+ [
42868
+ /coast\/([\w\.]+)/i
42869
+ // Opera Coast
42870
+ ],
42871
+ [VERSION, [NAME, OPERA + " Coast"]],
42872
+ [
42873
+ /miuibrowser\/([\w\.]+)/i
42874
+ // MIUI Browser
42875
+ ],
42876
+ [VERSION, [NAME, "MIUI " + BROWSER]],
42877
+ [
42878
+ /fxios\/([-\w\.]+)/i
42879
+ // Firefox for iOS
42880
+ ],
42881
+ [VERSION, [NAME, FIREFOX]],
42882
+ [
42883
+ /\bqihu|(qi?ho?o?|360)browser/i
42884
+ // 360
42885
+ ],
42886
+ [[NAME, "360 " + BROWSER]],
42887
+ [
42888
+ /(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i
42889
+ ],
42890
+ [[NAME, /(.+)/, "$1 " + BROWSER], VERSION],
42891
+ [
42892
+ // Oculus/Sailfish/HuaweiBrowser/VivoBrowser
42893
+ /samsungbrowser\/([\w\.]+)/i
42894
+ // Samsung Internet
42895
+ ],
42896
+ [VERSION, [NAME, SAMSUNG + " Internet"]],
42897
+ [
42898
+ /(comodo_dragon)\/([\w\.]+)/i
42899
+ // Comodo Dragon
42900
+ ],
42901
+ [[NAME, /_/g, " "], VERSION],
42902
+ [
42903
+ /metasr[\/ ]?([\d\.]+)/i
42904
+ // Sogou Explorer
42905
+ ],
42906
+ [VERSION, [NAME, "Sogou Explorer"]],
42907
+ [
42908
+ /(sogou)mo\w+\/([\d\.]+)/i
42909
+ // Sogou Mobile
42910
+ ],
42911
+ [[NAME, "Sogou Mobile"], VERSION],
42912
+ [
42913
+ /(electron)\/([\w\.]+) safari/i,
42914
+ // Electron-based App
42915
+ /(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,
42916
+ // Tesla
42917
+ /m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i
42918
+ // QQBrowser/2345 Browser
42919
+ ],
42920
+ [NAME, VERSION],
42921
+ [
42922
+ /(lbbrowser)/i,
42923
+ // LieBao Browser
42924
+ /\[(linkedin)app\]/i
42925
+ // LinkedIn App for iOS & Android
42926
+ ],
42927
+ [NAME],
42928
+ [
42929
+ // WebView
42930
+ /((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i
42931
+ // Facebook App for iOS & Android
42932
+ ],
42933
+ [[NAME, FACEBOOK], VERSION],
42934
+ [
42935
+ /(Klarna)\/([\w\.]+)/i,
42936
+ // Klarna Shopping Browser for iOS & Android
42937
+ /(kakao(?:talk|story))[\/ ]([\w\.]+)/i,
42938
+ // Kakao App
42939
+ /(naver)\(.*?(\d+\.[\w\.]+).*\)/i,
42940
+ // Naver InApp
42941
+ /safari (line)\/([\w\.]+)/i,
42942
+ // Line App for iOS
42943
+ /\b(line)\/([\w\.]+)\/iab/i,
42944
+ // Line App for Android
42945
+ /(alipay)client\/([\w\.]+)/i,
42946
+ // Alipay
42947
+ /(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i
42948
+ // Chromium/Instagram/Snapchat
42949
+ ],
42950
+ [NAME, VERSION],
42951
+ [
42952
+ /\bgsa\/([\w\.]+) .*safari\//i
42953
+ // Google Search Appliance on iOS
42954
+ ],
42955
+ [VERSION, [NAME, "GSA"]],
42956
+ [
42957
+ /musical_ly(?:.+app_?version\/|_)([\w\.]+)/i
42958
+ // TikTok
42959
+ ],
42960
+ [VERSION, [NAME, "TikTok"]],
42961
+ [
42962
+ /headlesschrome(?:\/([\w\.]+)| )/i
42963
+ // Chrome Headless
42964
+ ],
42965
+ [VERSION, [NAME, CHROME + " Headless"]],
42966
+ [
42967
+ / wv\).+(chrome)\/([\w\.]+)/i
42968
+ // Chrome WebView
42969
+ ],
42970
+ [[NAME, CHROME + " WebView"], VERSION],
42971
+ [
42972
+ /droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i
42973
+ // Android Browser
42974
+ ],
42975
+ [VERSION, [NAME, "Android " + BROWSER]],
42976
+ [
42977
+ /(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i
42978
+ // Chrome/OmniWeb/Arora/Tizen/Nokia
42979
+ ],
42980
+ [NAME, VERSION],
42981
+ [
42982
+ /version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i
42983
+ // Mobile Safari
42984
+ ],
42985
+ [VERSION, [NAME, "Mobile Safari"]],
42986
+ [
42987
+ /version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i
42988
+ // Safari & Safari Mobile
42989
+ ],
42990
+ [VERSION, NAME],
42991
+ [
42992
+ /webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i
42993
+ // Safari < 3.0
42994
+ ],
42995
+ [NAME, [VERSION, strMapper, oldSafariMap]],
42996
+ [
42997
+ /(webkit|khtml)\/([\w\.]+)/i
42998
+ ],
42999
+ [NAME, VERSION],
43000
+ [
43001
+ // Gecko based
43002
+ /(navigator|netscape\d?)\/([-\w\.]+)/i
43003
+ // Netscape
43004
+ ],
43005
+ [[NAME, "Netscape"], VERSION],
43006
+ [
43007
+ /mobile vr; rv:([\w\.]+)\).+firefox/i
43008
+ // Firefox Reality
43009
+ ],
43010
+ [VERSION, [NAME, FIREFOX + " Reality"]],
43011
+ [
43012
+ /ekiohf.+(flow)\/([\w\.]+)/i,
43013
+ // Flow
43014
+ /(swiftfox)/i,
43015
+ // Swiftfox
43016
+ /(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,
43017
+ // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror/Klar
43018
+ /(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,
43019
+ // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix
43020
+ /(firefox)\/([\w\.]+)/i,
43021
+ // Other Firefox-based
43022
+ /(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,
43023
+ // Mozilla
43024
+ // Other
43025
+ /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,
43026
+ // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser
43027
+ /(links) \(([\w\.]+)/i,
43028
+ // Links
43029
+ /panasonic;(viera)/i
43030
+ // Panasonic Viera
43031
+ ],
43032
+ [NAME, VERSION],
43033
+ [
43034
+ /(cobalt)\/([\w\.]+)/i
43035
+ // Cobalt
43036
+ ],
43037
+ [NAME, [VERSION, /master.|lts./, ""]]
43038
+ ],
43039
+ cpu: [
43040
+ [
43041
+ /(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i
43042
+ // AMD64 (x64)
43043
+ ],
43044
+ [[ARCHITECTURE, "amd64"]],
43045
+ [
43046
+ /(ia32(?=;))/i
43047
+ // IA32 (quicktime)
43048
+ ],
43049
+ [[ARCHITECTURE, lowerize]],
43050
+ [
43051
+ /((?:i[346]|x)86)[;\)]/i
43052
+ // IA32 (x86)
43053
+ ],
43054
+ [[ARCHITECTURE, "ia32"]],
43055
+ [
43056
+ /\b(aarch64|arm(v?8e?l?|_?64))\b/i
43057
+ // ARM64
43058
+ ],
43059
+ [[ARCHITECTURE, "arm64"]],
43060
+ [
43061
+ /\b(arm(?:v[67])?ht?n?[fl]p?)\b/i
43062
+ // ARMHF
43063
+ ],
43064
+ [[ARCHITECTURE, "armhf"]],
43065
+ [
43066
+ // PocketPC mistakenly identified as PowerPC
43067
+ /windows (ce|mobile); ppc;/i
43068
+ ],
43069
+ [[ARCHITECTURE, "arm"]],
43070
+ [
43071
+ /((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i
43072
+ // PowerPC
43073
+ ],
43074
+ [[ARCHITECTURE, /ower/, EMPTY, lowerize]],
43075
+ [
43076
+ /(sun4\w)[;\)]/i
43077
+ // SPARC
43078
+ ],
43079
+ [[ARCHITECTURE, "sparc"]],
43080
+ [
43081
+ /((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i
43082
+ // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
43083
+ ],
43084
+ [[ARCHITECTURE, lowerize]]
43085
+ ],
43086
+ device: [
43087
+ [
43088
+ //////////////////////////
43089
+ // MOBILES & TABLETS
43090
+ /////////////////////////
43091
+ // Samsung
43092
+ /\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
43093
+ ],
43094
+ [MODEL, [VENDOR, SAMSUNG], [TYPE2, TABLET]],
43095
+ [
43096
+ /\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,
43097
+ /samsung[- ]([-\w]+)/i,
43098
+ /sec-(sgh\w+)/i
43099
+ ],
43100
+ [MODEL, [VENDOR, SAMSUNG], [TYPE2, MOBILE]],
43101
+ [
43102
+ // Apple
43103
+ /(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i
43104
+ // iPod/iPhone
43105
+ ],
43106
+ [MODEL, [VENDOR, APPLE], [TYPE2, MOBILE]],
43107
+ [
43108
+ /\((ipad);[-\w\),; ]+apple/i,
43109
+ // iPad
43110
+ /applecoremedia\/[\w\.]+ \((ipad)/i,
43111
+ /\b(ipad)\d\d?,\d\d?[;\]].+ios/i
43112
+ ],
43113
+ [MODEL, [VENDOR, APPLE], [TYPE2, TABLET]],
43114
+ [
43115
+ /(macintosh);/i
43116
+ ],
43117
+ [MODEL, [VENDOR, APPLE]],
43118
+ [
43119
+ // Sharp
43120
+ /\b(sh-?[altvz]?\d\d[a-ekm]?)/i
43121
+ ],
43122
+ [MODEL, [VENDOR, SHARP], [TYPE2, MOBILE]],
43123
+ [
43124
+ // Huawei
43125
+ /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
43126
+ ],
43127
+ [MODEL, [VENDOR, HUAWEI], [TYPE2, TABLET]],
43128
+ [
43129
+ /(?:huawei|honor)([-\w ]+)[;\)]/i,
43130
+ /\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
43131
+ ],
43132
+ [MODEL, [VENDOR, HUAWEI], [TYPE2, MOBILE]],
43133
+ [
43134
+ // Xiaomi
43135
+ /\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,
43136
+ // Xiaomi POCO
43137
+ /\b; (\w+) build\/hm\1/i,
43138
+ // Xiaomi Hongmi 'numeric' models
43139
+ /\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,
43140
+ // Xiaomi Hongmi
43141
+ /\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,
43142
+ // Xiaomi Redmi
43143
+ /oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,
43144
+ // Xiaomi Redmi 'numeric' models
43145
+ /\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i
43146
+ // Xiaomi Mi
43147
+ ],
43148
+ [[MODEL, /_/g, " "], [VENDOR, XIAOMI], [TYPE2, MOBILE]],
43149
+ [
43150
+ /oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,
43151
+ // Redmi Pad
43152
+ /\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i
43153
+ // Mi Pad tablets
43154
+ ],
43155
+ [[MODEL, /_/g, " "], [VENDOR, XIAOMI], [TYPE2, TABLET]],
43156
+ [
43157
+ // OPPO
43158
+ /; (\w+) bui.+ oppo/i,
43159
+ /\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
43160
+ ],
43161
+ [MODEL, [VENDOR, "OPPO"], [TYPE2, MOBILE]],
43162
+ [
43163
+ // Vivo
43164
+ /vivo (\w+)(?: bui|\))/i,
43165
+ /\b(v[12]\d{3}\w?[at])(?: bui|;)/i
43166
+ ],
43167
+ [MODEL, [VENDOR, "Vivo"], [TYPE2, MOBILE]],
43168
+ [
43169
+ // Realme
43170
+ /\b(rmx[1-3]\d{3})(?: bui|;|\))/i
43171
+ ],
43172
+ [MODEL, [VENDOR, "Realme"], [TYPE2, MOBILE]],
43173
+ [
43174
+ // Motorola
43175
+ /\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,
43176
+ /\bmot(?:orola)?[- ](\w*)/i,
43177
+ /((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i
43178
+ ],
43179
+ [MODEL, [VENDOR, MOTOROLA], [TYPE2, MOBILE]],
43180
+ [
43181
+ /\b(mz60\d|xoom[2 ]{0,2}) build\//i
43182
+ ],
43183
+ [MODEL, [VENDOR, MOTOROLA], [TYPE2, TABLET]],
43184
+ [
43185
+ // LG
43186
+ /((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i
43187
+ ],
43188
+ [MODEL, [VENDOR, LG], [TYPE2, TABLET]],
43189
+ [
43190
+ /(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,
43191
+ /\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,
43192
+ /\blg-?([\d\w]+) bui/i
43193
+ ],
43194
+ [MODEL, [VENDOR, LG], [TYPE2, MOBILE]],
43195
+ [
43196
+ // Lenovo
43197
+ /(ideatab[-\w ]+)/i,
43198
+ /lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i
43199
+ ],
43200
+ [MODEL, [VENDOR, "Lenovo"], [TYPE2, TABLET]],
43201
+ [
43202
+ // Nokia
43203
+ /(?:maemo|nokia).*(n900|lumia \d+)/i,
43204
+ /nokia[-_ ]?([-\w\.]*)/i
43205
+ ],
43206
+ [[MODEL, /_/g, " "], [VENDOR, "Nokia"], [TYPE2, MOBILE]],
43207
+ [
43208
+ // Google
43209
+ /(pixel c)\b/i
43210
+ // Google Pixel C
43211
+ ],
43212
+ [MODEL, [VENDOR, GOOGLE], [TYPE2, TABLET]],
43213
+ [
43214
+ /droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i
43215
+ // Google Pixel
43216
+ ],
43217
+ [MODEL, [VENDOR, GOOGLE], [TYPE2, MOBILE]],
43218
+ [
43219
+ // Sony
43220
+ /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
43221
+ ],
43222
+ [MODEL, [VENDOR, SONY], [TYPE2, MOBILE]],
43223
+ [
43224
+ /sony tablet [ps]/i,
43225
+ /\b(?:sony)?sgp\w+(?: bui|\))/i
43226
+ ],
43227
+ [[MODEL, "Xperia Tablet"], [VENDOR, SONY], [TYPE2, TABLET]],
43228
+ [
43229
+ // OnePlus
43230
+ / (kb2005|in20[12]5|be20[12][59])\b/i,
43231
+ /(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i
43232
+ ],
43233
+ [MODEL, [VENDOR, "OnePlus"], [TYPE2, MOBILE]],
43234
+ [
43235
+ // Amazon
43236
+ /(alexa)webm/i,
43237
+ /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,
43238
+ // Kindle Fire without Silk / Echo Show
43239
+ /(kf[a-z]+)( bui|\)).+silk\//i
43240
+ // Kindle Fire HD
43241
+ ],
43242
+ [MODEL, [VENDOR, AMAZON], [TYPE2, TABLET]],
43243
+ [
43244
+ /((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i
43245
+ // Fire Phone
43246
+ ],
43247
+ [[MODEL, /(.+)/g, "Fire Phone $1"], [VENDOR, AMAZON], [TYPE2, MOBILE]],
43248
+ [
43249
+ // BlackBerry
43250
+ /(playbook);[-\w\),; ]+(rim)/i
43251
+ // BlackBerry PlayBook
43252
+ ],
43253
+ [MODEL, VENDOR, [TYPE2, TABLET]],
43254
+ [
43255
+ /\b((?:bb[a-f]|st[hv])100-\d)/i,
43256
+ /\(bb10; (\w+)/i
43257
+ // BlackBerry 10
43258
+ ],
43259
+ [MODEL, [VENDOR, BLACKBERRY], [TYPE2, MOBILE]],
43260
+ [
43261
+ // Asus
43262
+ /(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i
43263
+ ],
43264
+ [MODEL, [VENDOR, ASUS], [TYPE2, TABLET]],
43265
+ [
43266
+ / (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i
43267
+ ],
43268
+ [MODEL, [VENDOR, ASUS], [TYPE2, MOBILE]],
43269
+ [
43270
+ // HTC
43271
+ /(nexus 9)/i
43272
+ // HTC Nexus 9
43273
+ ],
43274
+ [MODEL, [VENDOR, "HTC"], [TYPE2, TABLET]],
43275
+ [
43276
+ /(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,
43277
+ // HTC
43278
+ // ZTE
43279
+ /(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,
43280
+ /(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i
43281
+ // Alcatel/GeeksPhone/Nexian/Panasonic/Sony
43282
+ ],
43283
+ [VENDOR, [MODEL, /_/g, " "], [TYPE2, MOBILE]],
43284
+ [
43285
+ // Acer
43286
+ /droid.+; ([ab][1-7]-?[0178a]\d\d?)/i
43287
+ ],
43288
+ [MODEL, [VENDOR, "Acer"], [TYPE2, TABLET]],
43289
+ [
43290
+ // Meizu
43291
+ /droid.+; (m[1-5] note) bui/i,
43292
+ /\bmz-([-\w]{2,})/i
43293
+ ],
43294
+ [MODEL, [VENDOR, "Meizu"], [TYPE2, MOBILE]],
43295
+ [
43296
+ // Ulefone
43297
+ /; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i
43298
+ ],
43299
+ [MODEL, [VENDOR, "Ulefone"], [TYPE2, MOBILE]],
43300
+ [
43301
+ // MIXED
43302
+ /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,
43303
+ // BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron
43304
+ /(hp) ([\w ]+\w)/i,
43305
+ // HP iPAQ
43306
+ /(asus)-?(\w+)/i,
43307
+ // Asus
43308
+ /(microsoft); (lumia[\w ]+)/i,
43309
+ // Microsoft Lumia
43310
+ /(lenovo)[-_ ]?([-\w]+)/i,
43311
+ // Lenovo
43312
+ /(jolla)/i,
43313
+ // Jolla
43314
+ /(oppo) ?([\w ]+) bui/i
43315
+ // OPPO
43316
+ ],
43317
+ [VENDOR, MODEL, [TYPE2, MOBILE]],
43318
+ [
43319
+ /(kobo)\s(ereader|touch)/i,
43320
+ // Kobo
43321
+ /(archos) (gamepad2?)/i,
43322
+ // Archos
43323
+ /(hp).+(touchpad(?!.+tablet)|tablet)/i,
43324
+ // HP TouchPad
43325
+ /(kindle)\/([\w\.]+)/i,
43326
+ // Kindle
43327
+ /(nook)[\w ]+build\/(\w+)/i,
43328
+ // Nook
43329
+ /(dell) (strea[kpr\d ]*[\dko])/i,
43330
+ // Dell Streak
43331
+ /(le[- ]+pan)[- ]+(\w{1,9}) bui/i,
43332
+ // Le Pan Tablets
43333
+ /(trinity)[- ]*(t\d{3}) bui/i,
43334
+ // Trinity Tablets
43335
+ /(gigaset)[- ]+(q\w{1,9}) bui/i,
43336
+ // Gigaset Tablets
43337
+ /(vodafone) ([\w ]+)(?:\)| bui)/i
43338
+ // Vodafone
43339
+ ],
43340
+ [VENDOR, MODEL, [TYPE2, TABLET]],
43341
+ [
43342
+ /(surface duo)/i
43343
+ // Surface Duo
43344
+ ],
43345
+ [MODEL, [VENDOR, MICROSOFT], [TYPE2, TABLET]],
43346
+ [
43347
+ /droid [\d\.]+; (fp\du?)(?: b|\))/i
43348
+ // Fairphone
43349
+ ],
43350
+ [MODEL, [VENDOR, "Fairphone"], [TYPE2, MOBILE]],
43351
+ [
43352
+ /(u304aa)/i
43353
+ // AT&T
43354
+ ],
43355
+ [MODEL, [VENDOR, "AT&T"], [TYPE2, MOBILE]],
43356
+ [
43357
+ /\bsie-(\w*)/i
43358
+ // Siemens
43359
+ ],
43360
+ [MODEL, [VENDOR, "Siemens"], [TYPE2, MOBILE]],
43361
+ [
43362
+ /\b(rct\w+) b/i
43363
+ // RCA Tablets
43364
+ ],
43365
+ [MODEL, [VENDOR, "RCA"], [TYPE2, TABLET]],
43366
+ [
43367
+ /\b(venue[\d ]{2,7}) b/i
43368
+ // Dell Venue Tablets
43369
+ ],
43370
+ [MODEL, [VENDOR, "Dell"], [TYPE2, TABLET]],
43371
+ [
43372
+ /\b(q(?:mv|ta)\w+) b/i
43373
+ // Verizon Tablet
43374
+ ],
43375
+ [MODEL, [VENDOR, "Verizon"], [TYPE2, TABLET]],
43376
+ [
43377
+ /\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i
43378
+ // Barnes & Noble Tablet
43379
+ ],
43380
+ [MODEL, [VENDOR, "Barnes & Noble"], [TYPE2, TABLET]],
43381
+ [
43382
+ /\b(tm\d{3}\w+) b/i
43383
+ ],
43384
+ [MODEL, [VENDOR, "NuVision"], [TYPE2, TABLET]],
43385
+ [
43386
+ /\b(k88) b/i
43387
+ // ZTE K Series Tablet
43388
+ ],
43389
+ [MODEL, [VENDOR, "ZTE"], [TYPE2, TABLET]],
43390
+ [
43391
+ /\b(nx\d{3}j) b/i
43392
+ // ZTE Nubia
43393
+ ],
43394
+ [MODEL, [VENDOR, "ZTE"], [TYPE2, MOBILE]],
43395
+ [
43396
+ /\b(gen\d{3}) b.+49h/i
43397
+ // Swiss GEN Mobile
43398
+ ],
43399
+ [MODEL, [VENDOR, "Swiss"], [TYPE2, MOBILE]],
43400
+ [
43401
+ /\b(zur\d{3}) b/i
43402
+ // Swiss ZUR Tablet
43403
+ ],
43404
+ [MODEL, [VENDOR, "Swiss"], [TYPE2, TABLET]],
43405
+ [
43406
+ /\b((zeki)?tb.*\b) b/i
43407
+ // Zeki Tablets
43408
+ ],
43409
+ [MODEL, [VENDOR, "Zeki"], [TYPE2, TABLET]],
43410
+ [
43411
+ /\b([yr]\d{2}) b/i,
43412
+ /\b(dragon[- ]+touch |dt)(\w{5}) b/i
43413
+ // Dragon Touch Tablet
43414
+ ],
43415
+ [[VENDOR, "Dragon Touch"], MODEL, [TYPE2, TABLET]],
43416
+ [
43417
+ /\b(ns-?\w{0,9}) b/i
43418
+ // Insignia Tablets
43419
+ ],
43420
+ [MODEL, [VENDOR, "Insignia"], [TYPE2, TABLET]],
43421
+ [
43422
+ /\b((nxa|next)-?\w{0,9}) b/i
43423
+ // NextBook Tablets
43424
+ ],
43425
+ [MODEL, [VENDOR, "NextBook"], [TYPE2, TABLET]],
43426
+ [
43427
+ /\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i
43428
+ // Voice Xtreme Phones
43429
+ ],
43430
+ [[VENDOR, "Voice"], MODEL, [TYPE2, MOBILE]],
43431
+ [
43432
+ /\b(lvtel\-)?(v1[12]) b/i
43433
+ // LvTel Phones
43434
+ ],
43435
+ [[VENDOR, "LvTel"], MODEL, [TYPE2, MOBILE]],
43436
+ [
43437
+ /\b(ph-1) /i
43438
+ // Essential PH-1
43439
+ ],
43440
+ [MODEL, [VENDOR, "Essential"], [TYPE2, MOBILE]],
43441
+ [
43442
+ /\b(v(100md|700na|7011|917g).*\b) b/i
43443
+ // Envizen Tablets
43444
+ ],
43445
+ [MODEL, [VENDOR, "Envizen"], [TYPE2, TABLET]],
43446
+ [
43447
+ /\b(trio[-\w\. ]+) b/i
43448
+ // MachSpeed Tablets
43449
+ ],
43450
+ [MODEL, [VENDOR, "MachSpeed"], [TYPE2, TABLET]],
43451
+ [
43452
+ /\btu_(1491) b/i
43453
+ // Rotor Tablets
43454
+ ],
43455
+ [MODEL, [VENDOR, "Rotor"], [TYPE2, TABLET]],
43456
+ [
43457
+ /(shield[\w ]+) b/i
43458
+ // Nvidia Shield Tablets
43459
+ ],
43460
+ [MODEL, [VENDOR, "Nvidia"], [TYPE2, TABLET]],
43461
+ [
43462
+ /(sprint) (\w+)/i
43463
+ // Sprint Phones
43464
+ ],
43465
+ [VENDOR, MODEL, [TYPE2, MOBILE]],
43466
+ [
43467
+ /(kin\.[onetw]{3})/i
43468
+ // Microsoft Kin
43469
+ ],
43470
+ [[MODEL, /\./g, " "], [VENDOR, MICROSOFT], [TYPE2, MOBILE]],
43471
+ [
43472
+ /droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i
43473
+ // Zebra
43474
+ ],
43475
+ [MODEL, [VENDOR, ZEBRA], [TYPE2, TABLET]],
43476
+ [
43477
+ /droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i
43478
+ ],
43479
+ [MODEL, [VENDOR, ZEBRA], [TYPE2, MOBILE]],
43480
+ [
43481
+ ///////////////////
43482
+ // SMARTTVS
43483
+ ///////////////////
43484
+ /smart-tv.+(samsung)/i
43485
+ // Samsung
43486
+ ],
43487
+ [VENDOR, [TYPE2, SMARTTV]],
43488
+ [
43489
+ /hbbtv.+maple;(\d+)/i
43490
+ ],
43491
+ [[MODEL, /^/, "SmartTV"], [VENDOR, SAMSUNG], [TYPE2, SMARTTV]],
43492
+ [
43493
+ /(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i
43494
+ // LG SmartTV
43495
+ ],
43496
+ [[VENDOR, LG], [TYPE2, SMARTTV]],
43497
+ [
43498
+ /(apple) ?tv/i
43499
+ // Apple TV
43500
+ ],
43501
+ [VENDOR, [MODEL, APPLE + " TV"], [TYPE2, SMARTTV]],
43502
+ [
43503
+ /crkey/i
43504
+ // Google Chromecast
43505
+ ],
43506
+ [[MODEL, CHROME + "cast"], [VENDOR, GOOGLE], [TYPE2, SMARTTV]],
43507
+ [
43508
+ /droid.+aft(\w+)( bui|\))/i
43509
+ // Fire TV
43510
+ ],
43511
+ [MODEL, [VENDOR, AMAZON], [TYPE2, SMARTTV]],
43512
+ [
43513
+ /\(dtv[\);].+(aquos)/i,
43514
+ /(aquos-tv[\w ]+)\)/i
43515
+ // Sharp
43516
+ ],
43517
+ [MODEL, [VENDOR, SHARP], [TYPE2, SMARTTV]],
43518
+ [
43519
+ /(bravia[\w ]+)( bui|\))/i
43520
+ // Sony
43521
+ ],
43522
+ [MODEL, [VENDOR, SONY], [TYPE2, SMARTTV]],
43523
+ [
43524
+ /(mitv-\w{5}) bui/i
43525
+ // Xiaomi
43526
+ ],
43527
+ [MODEL, [VENDOR, XIAOMI], [TYPE2, SMARTTV]],
43528
+ [
43529
+ /Hbbtv.*(technisat) (.*);/i
43530
+ // TechniSAT
43531
+ ],
43532
+ [VENDOR, MODEL, [TYPE2, SMARTTV]],
43533
+ [
43534
+ /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,
43535
+ // Roku
43536
+ /hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i
43537
+ // HbbTV devices
43538
+ ],
43539
+ [[VENDOR, trim], [MODEL, trim], [TYPE2, SMARTTV]],
43540
+ [
43541
+ /\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i
43542
+ // SmartTV from Unidentified Vendors
43543
+ ],
43544
+ [[TYPE2, SMARTTV]],
43545
+ [
43546
+ ///////////////////
43547
+ // CONSOLES
43548
+ ///////////////////
43549
+ /(ouya)/i,
43550
+ // Ouya
43551
+ /(nintendo) ([wids3utch]+)/i
43552
+ // Nintendo
43553
+ ],
43554
+ [VENDOR, MODEL, [TYPE2, CONSOLE]],
43555
+ [
43556
+ /droid.+; (shield) bui/i
43557
+ // Nvidia
43558
+ ],
43559
+ [MODEL, [VENDOR, "Nvidia"], [TYPE2, CONSOLE]],
43560
+ [
43561
+ /(playstation [345portablevi]+)/i
43562
+ // Playstation
43563
+ ],
43564
+ [MODEL, [VENDOR, SONY], [TYPE2, CONSOLE]],
43565
+ [
43566
+ /\b(xbox(?: one)?(?!; xbox))[\); ]/i
43567
+ // Microsoft Xbox
43568
+ ],
43569
+ [MODEL, [VENDOR, MICROSOFT], [TYPE2, CONSOLE]],
43570
+ [
43571
+ ///////////////////
43572
+ // WEARABLES
43573
+ ///////////////////
43574
+ /((pebble))app/i
43575
+ // Pebble
43576
+ ],
43577
+ [VENDOR, MODEL, [TYPE2, WEARABLE]],
43578
+ [
43579
+ /(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i
43580
+ // Apple Watch
43581
+ ],
43582
+ [MODEL, [VENDOR, APPLE], [TYPE2, WEARABLE]],
43583
+ [
43584
+ /droid.+; (glass) \d/i
43585
+ // Google Glass
43586
+ ],
43587
+ [MODEL, [VENDOR, GOOGLE], [TYPE2, WEARABLE]],
43588
+ [
43589
+ /droid.+; (wt63?0{2,3})\)/i
43590
+ ],
43591
+ [MODEL, [VENDOR, ZEBRA], [TYPE2, WEARABLE]],
43592
+ [
43593
+ /(quest( 2| pro)?)/i
43594
+ // Oculus Quest
43595
+ ],
43596
+ [MODEL, [VENDOR, FACEBOOK], [TYPE2, WEARABLE]],
43597
+ [
43598
+ ///////////////////
43599
+ // EMBEDDED
43600
+ ///////////////////
43601
+ /(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i
43602
+ // Tesla
43603
+ ],
43604
+ [VENDOR, [TYPE2, EMBEDDED]],
43605
+ [
43606
+ /(aeobc)\b/i
43607
+ // Echo Dot
43608
+ ],
43609
+ [MODEL, [VENDOR, AMAZON], [TYPE2, EMBEDDED]],
43610
+ [
43611
+ ////////////////////
43612
+ // MIXED (GENERIC)
43613
+ ///////////////////
43614
+ /droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i
43615
+ // Android Phones from Unidentified Vendors
43616
+ ],
43617
+ [MODEL, [TYPE2, MOBILE]],
43618
+ [
43619
+ /droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i
43620
+ // Android Tablets from Unidentified Vendors
43621
+ ],
43622
+ [MODEL, [TYPE2, TABLET]],
43623
+ [
43624
+ /\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i
43625
+ // Unidentifiable Tablet
43626
+ ],
43627
+ [[TYPE2, TABLET]],
43628
+ [
43629
+ /(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i
43630
+ // Unidentifiable Mobile
43631
+ ],
43632
+ [[TYPE2, MOBILE]],
43633
+ [
43634
+ /(android[-\w\. ]{0,9});.+buil/i
43635
+ // Generic Android Device
43636
+ ],
43637
+ [MODEL, [VENDOR, "Generic"]]
43638
+ ],
43639
+ engine: [
43640
+ [
43641
+ /windows.+ edge\/([\w\.]+)/i
43642
+ // EdgeHTML
43643
+ ],
43644
+ [VERSION, [NAME, EDGE + "HTML"]],
43645
+ [
43646
+ /webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i
43647
+ // Blink
43648
+ ],
43649
+ [VERSION, [NAME, "Blink"]],
43650
+ [
43651
+ /(presto)\/([\w\.]+)/i,
43652
+ // Presto
43653
+ /(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,
43654
+ // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
43655
+ /ekioh(flow)\/([\w\.]+)/i,
43656
+ // Flow
43657
+ /(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,
43658
+ // KHTML/Tasman/Links
43659
+ /(icab)[\/ ]([23]\.[\d\.]+)/i,
43660
+ // iCab
43661
+ /\b(libweb)/i
43662
+ ],
43663
+ [NAME, VERSION],
43664
+ [
43665
+ /rv\:([\w\.]{1,9})\b.+(gecko)/i
43666
+ // Gecko
43667
+ ],
43668
+ [VERSION, NAME]
43669
+ ],
43670
+ os: [
43671
+ [
43672
+ // Windows
43673
+ /microsoft (windows) (vista|xp)/i
43674
+ // Windows (iTunes)
43675
+ ],
43676
+ [NAME, VERSION],
43677
+ [
43678
+ /(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i
43679
+ // Windows Phone
43680
+ ],
43681
+ [NAME, [VERSION, strMapper, windowsVersionMap]],
43682
+ [
43683
+ /windows nt 6\.2; (arm)/i,
43684
+ // Windows RT
43685
+ /windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,
43686
+ /(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i
43687
+ ],
43688
+ [[VERSION, strMapper, windowsVersionMap], [NAME, "Windows"]],
43689
+ [
43690
+ // iOS/macOS
43691
+ /ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,
43692
+ // iOS
43693
+ /(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,
43694
+ /cfnetwork\/.+darwin/i
43695
+ ],
43696
+ [[VERSION, /_/g, "."], [NAME, "iOS"]],
43697
+ [
43698
+ /(mac os x) ?([\w\. ]*)/i,
43699
+ /(macintosh|mac_powerpc\b)(?!.+haiku)/i
43700
+ // Mac OS
43701
+ ],
43702
+ [[NAME, MAC_OS], [VERSION, /_/g, "."]],
43703
+ [
43704
+ // Mobile OSes
43705
+ /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i
43706
+ // Android-x86/HarmonyOS
43707
+ ],
43708
+ [VERSION, NAME],
43709
+ [
43710
+ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS
43711
+ /(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,
43712
+ /(blackberry)\w*\/([\w\.]*)/i,
43713
+ // Blackberry
43714
+ /(tizen|kaios)[\/ ]([\w\.]+)/i,
43715
+ // Tizen/KaiOS
43716
+ /\((series40);/i
43717
+ // Series 40
43718
+ ],
43719
+ [NAME, VERSION],
43720
+ [
43721
+ /\(bb(10);/i
43722
+ // BlackBerry 10
43723
+ ],
43724
+ [VERSION, [NAME, BLACKBERRY]],
43725
+ [
43726
+ /(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i
43727
+ // Symbian
43728
+ ],
43729
+ [VERSION, [NAME, "Symbian"]],
43730
+ [
43731
+ /mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i
43732
+ // Firefox OS
43733
+ ],
43734
+ [VERSION, [NAME, FIREFOX + " OS"]],
43735
+ [
43736
+ /web0s;.+rt(tv)/i,
43737
+ /\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i
43738
+ // WebOS
43739
+ ],
43740
+ [VERSION, [NAME, "webOS"]],
43741
+ [
43742
+ /watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i
43743
+ // watchOS
43744
+ ],
43745
+ [VERSION, [NAME, "watchOS"]],
43746
+ [
43747
+ // Google Chromecast
43748
+ /crkey\/([\d\.]+)/i
43749
+ // Google Chromecast
43750
+ ],
43751
+ [VERSION, [NAME, CHROME + "cast"]],
43752
+ [
43753
+ /(cros) [\w]+(?:\)| ([\w\.]+)\b)/i
43754
+ // Chromium OS
43755
+ ],
43756
+ [[NAME, CHROMIUM_OS], VERSION],
43757
+ [
43758
+ // Smart TVs
43759
+ /panasonic;(viera)/i,
43760
+ // Panasonic Viera
43761
+ /(netrange)mmh/i,
43762
+ // Netrange
43763
+ /(nettv)\/(\d+\.[\w\.]+)/i,
43764
+ // NetTV
43765
+ // Console
43766
+ /(nintendo|playstation) ([wids345portablevuch]+)/i,
43767
+ // Nintendo/Playstation
43768
+ /(xbox); +xbox ([^\);]+)/i,
43769
+ // Microsoft Xbox (360, One, X, S, Series X, Series S)
43770
+ // Other
43771
+ /\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,
43772
+ // Joli/Palm
43773
+ /(mint)[\/\(\) ]?(\w*)/i,
43774
+ // Mint
43775
+ /(mageia|vectorlinux)[; ]/i,
43776
+ // Mageia/VectorLinux
43777
+ /([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,
43778
+ // Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware/Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus/Raspbian/Plan9/Minix/RISCOS/Contiki/Deepin/Manjaro/elementary/Sabayon/Linspire
43779
+ /(hurd|linux) ?([\w\.]*)/i,
43780
+ // Hurd/Linux
43781
+ /(gnu) ?([\w\.]*)/i,
43782
+ // GNU
43783
+ /\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,
43784
+ // FreeBSD/NetBSD/OpenBSD/PC-BSD/GhostBSD/DragonFly
43785
+ /(haiku) (\w+)/i
43786
+ // Haiku
43787
+ ],
43788
+ [NAME, VERSION],
43789
+ [
43790
+ /(sunos) ?([\w\.\d]*)/i
43791
+ // Solaris
43792
+ ],
43793
+ [[NAME, "Solaris"], VERSION],
43794
+ [
43795
+ /((?:open)?solaris)[-\/ ]?([\w\.]*)/i,
43796
+ // Solaris
43797
+ /(aix) ((\d)(?=\.|\)| )[\w\.])*/i,
43798
+ // AIX
43799
+ /\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,
43800
+ // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS
43801
+ /(unix) ?([\w\.]*)/i
43802
+ // UNIX
43803
+ ],
43804
+ [NAME, VERSION]
43805
+ ]
43806
+ };
43807
+ var UAParser2 = function(ua, extensions) {
43808
+ if (typeof ua === OBJ_TYPE) {
43809
+ extensions = ua;
43810
+ ua = undefined2;
43811
+ }
43812
+ if (!(this instanceof UAParser2)) {
43813
+ return new UAParser2(ua, extensions).getResult();
43814
+ }
43815
+ var _navigator = typeof window2 !== UNDEF_TYPE && window2.navigator ? window2.navigator : undefined2;
43816
+ var _ua = ua || (_navigator && _navigator.userAgent ? _navigator.userAgent : EMPTY);
43817
+ var _uach = _navigator && _navigator.userAgentData ? _navigator.userAgentData : undefined2;
43818
+ var _rgxmap = extensions ? extend(regexes, extensions) : regexes;
43819
+ var _isSelfNav = _navigator && _navigator.userAgent == _ua;
43820
+ this.getBrowser = function() {
43821
+ var _browser = {};
43822
+ _browser[NAME] = undefined2;
43823
+ _browser[VERSION] = undefined2;
43824
+ rgxMapper.call(_browser, _ua, _rgxmap.browser);
43825
+ _browser[MAJOR] = majorize(_browser[VERSION]);
43826
+ if (_isSelfNav && _navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) {
43827
+ _browser[NAME] = "Brave";
43828
+ }
43829
+ return _browser;
43830
+ };
43831
+ this.getCPU = function() {
43832
+ var _cpu = {};
43833
+ _cpu[ARCHITECTURE] = undefined2;
43834
+ rgxMapper.call(_cpu, _ua, _rgxmap.cpu);
43835
+ return _cpu;
43836
+ };
43837
+ this.getDevice = function() {
43838
+ var _device = {};
43839
+ _device[VENDOR] = undefined2;
43840
+ _device[MODEL] = undefined2;
43841
+ _device[TYPE2] = undefined2;
43842
+ rgxMapper.call(_device, _ua, _rgxmap.device);
43843
+ if (_isSelfNav && !_device[TYPE2] && _uach && _uach.mobile) {
43844
+ _device[TYPE2] = MOBILE;
43845
+ }
43846
+ if (_isSelfNav && _device[MODEL] == "Macintosh" && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) {
43847
+ _device[MODEL] = "iPad";
43848
+ _device[TYPE2] = TABLET;
43849
+ }
43850
+ return _device;
43851
+ };
43852
+ this.getEngine = function() {
43853
+ var _engine = {};
43854
+ _engine[NAME] = undefined2;
43855
+ _engine[VERSION] = undefined2;
43856
+ rgxMapper.call(_engine, _ua, _rgxmap.engine);
43857
+ return _engine;
43858
+ };
43859
+ this.getOS = function() {
43860
+ var _os = {};
43861
+ _os[NAME] = undefined2;
43862
+ _os[VERSION] = undefined2;
43863
+ rgxMapper.call(_os, _ua, _rgxmap.os);
43864
+ if (_isSelfNav && !_os[NAME] && _uach && _uach.platform != "Unknown") {
43865
+ _os[NAME] = _uach.platform.replace(/chrome os/i, CHROMIUM_OS).replace(/macos/i, MAC_OS);
43866
+ }
43867
+ return _os;
43868
+ };
43869
+ this.getResult = function() {
43870
+ return {
43871
+ ua: this.getUA(),
43872
+ browser: this.getBrowser(),
43873
+ engine: this.getEngine(),
43874
+ os: this.getOS(),
43875
+ device: this.getDevice(),
43876
+ cpu: this.getCPU()
43877
+ };
43878
+ };
43879
+ this.getUA = function() {
43880
+ return _ua;
43881
+ };
43882
+ this.setUA = function(ua2) {
43883
+ _ua = typeof ua2 === STR_TYPE && ua2.length > UA_MAX_LENGTH ? trim(ua2, UA_MAX_LENGTH) : ua2;
43884
+ return this;
43885
+ };
43886
+ this.setUA(_ua);
43887
+ return this;
43888
+ };
43889
+ UAParser2.VERSION = LIBVERSION;
43890
+ UAParser2.BROWSER = enumerize([NAME, VERSION, MAJOR]);
43891
+ UAParser2.CPU = enumerize([ARCHITECTURE]);
43892
+ UAParser2.DEVICE = enumerize([MODEL, VENDOR, TYPE2, CONSOLE, MOBILE, SMARTTV, TABLET, WEARABLE, EMBEDDED]);
43893
+ UAParser2.ENGINE = UAParser2.OS = enumerize([NAME, VERSION]);
43894
+ if (typeof exports !== UNDEF_TYPE) {
43895
+ if (typeof module2 !== UNDEF_TYPE && module2.exports) {
43896
+ exports = module2.exports = UAParser2;
43897
+ }
43898
+ exports.UAParser = UAParser2;
43899
+ } else {
43900
+ if (typeof define === FUNC_TYPE && define.amd) {
43901
+ define(function() {
43902
+ return UAParser2;
43903
+ });
43904
+ } else if (typeof window2 !== UNDEF_TYPE) {
43905
+ window2.UAParser = UAParser2;
43906
+ }
43907
+ }
43908
+ var $ = typeof window2 !== UNDEF_TYPE && (window2.jQuery || window2.Zepto);
43909
+ if ($ && !$.ua) {
43910
+ var parser = new UAParser2();
43911
+ $.ua = parser.getResult();
43912
+ $.ua.get = function() {
43913
+ return parser.getUA();
43914
+ };
43915
+ $.ua.set = function(ua) {
43916
+ parser.setUA(ua);
43917
+ var result = parser.getResult();
43918
+ for (var prop in result) {
43919
+ $.ua[prop] = result[prop];
43920
+ }
43921
+ };
43922
+ }
43923
+ })(typeof window === "object" ? window : exports);
43924
+ }
43925
+ });
43926
+
42585
43927
  // ../../node_modules/use-debounce/dist/index.module.js
42586
43928
  var index_module_exports = {};
42587
43929
  __export(index_module_exports, {
@@ -44526,6 +45868,26 @@ var require_dist = __commonJS({
44526
45868
  mod
44527
45869
  ));
44528
45870
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
45871
+ var __async2 = (__this, __arguments, generator) => {
45872
+ return new Promise((resolve, reject) => {
45873
+ var fulfilled = (value) => {
45874
+ try {
45875
+ step(generator.next(value));
45876
+ } catch (e2) {
45877
+ reject(e2);
45878
+ }
45879
+ };
45880
+ var rejected = (value) => {
45881
+ try {
45882
+ step(generator.throw(value));
45883
+ } catch (e2) {
45884
+ reject(e2);
45885
+ }
45886
+ };
45887
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45888
+ step((generator = generator.apply(__this, __arguments)).next());
45889
+ });
45890
+ };
44529
45891
  var auto_frame_component_exports = {};
44530
45892
  __export2(auto_frame_component_exports, {
44531
45893
  default: () => AutoFrameComponent_default
@@ -44544,6 +45906,23 @@ var require_dist = __commonJS({
44544
45906
  });
44545
45907
  return collected;
44546
45908
  };
45909
+ var getStyleSheet = (el) => {
45910
+ return Array.from(document.styleSheets).find((ss) => ss.ownerNode === el);
45911
+ };
45912
+ var getStyles2 = (styleSheet) => {
45913
+ if (styleSheet) {
45914
+ try {
45915
+ return [...styleSheet.cssRules].map((rule) => rule.cssText).join("");
45916
+ } catch (e2) {
45917
+ console.warn(
45918
+ "Access to stylesheet %s is denied. Ignoring\u2026",
45919
+ styleSheet.href
45920
+ );
45921
+ }
45922
+ }
45923
+ return "";
45924
+ };
45925
+ var defer = (fn) => setTimeout(fn, 0);
44547
45926
  var CopyHostStyles = ({
44548
45927
  children,
44549
45928
  debug = false,
@@ -44558,7 +45937,7 @@ var require_dist = __commonJS({
44558
45937
  const elements = [];
44559
45938
  const lookupEl = (el) => elements.findIndex((elementMap) => elementMap.original === el);
44560
45939
  const addEl = (el, onLoad = () => {
44561
- }) => {
45940
+ }) => __async2(void 0, null, function* () {
44562
45941
  const index = lookupEl(el);
44563
45942
  if (index > -1) {
44564
45943
  if (debug)
@@ -44569,10 +45948,34 @@ var require_dist = __commonJS({
44569
45948
  onLoad();
44570
45949
  return;
44571
45950
  }
44572
- const elHash = (0, import_object_hash.default)(el.outerHTML);
45951
+ let mirror;
45952
+ if (el.nodeName === "LINK") {
45953
+ mirror = document.createElement("style");
45954
+ mirror.type = "text/css";
45955
+ let styleSheet = getStyleSheet(el);
45956
+ if (!styleSheet) {
45957
+ yield new Promise((resolve) => el.onload = resolve);
45958
+ styleSheet = getStyleSheet(el);
45959
+ }
45960
+ const styles = getStyles2(styleSheet);
45961
+ if (!styles) {
45962
+ if (debug) {
45963
+ console.warn(
45964
+ `Tried to load styles for link element, but couldn't find them. Skipping...`
45965
+ );
45966
+ }
45967
+ onLoad();
45968
+ return;
45969
+ }
45970
+ mirror.innerHTML = styles;
45971
+ mirror.setAttribute("data-href", el.getAttribute("href"));
45972
+ } else {
45973
+ mirror = el.cloneNode(true);
45974
+ }
45975
+ const elHash = (0, import_object_hash.default)(mirror.outerHTML);
44573
45976
  const existingHashes = collectStyles(doc).map(
44574
- (existingStyle) => (0, import_object_hash.default)(existingStyle.outerHTML)
44575
- );
45977
+ (existingStyle) => existingStyle !== mirror && (0, import_object_hash.default)(existingStyle.outerHTML)
45978
+ ).filter(Boolean);
44576
45979
  if (existingHashes.indexOf(elHash) > -1) {
44577
45980
  if (debug)
44578
45981
  console.log(
@@ -44581,13 +45984,12 @@ var require_dist = __commonJS({
44581
45984
  onLoad();
44582
45985
  return;
44583
45986
  }
44584
- const mirror = el.cloneNode(true);
44585
45987
  mirror.onload = onLoad;
44586
45988
  doc.head.append(mirror);
44587
45989
  elements.push({ original: el, mirror });
44588
45990
  if (debug)
44589
45991
  console.log(`Added style node ${el.outerHTML}`);
44590
- };
45992
+ });
44591
45993
  const removeEl = (el) => {
44592
45994
  const index = lookupEl(el);
44593
45995
  if (index === -1) {
@@ -44608,7 +46010,7 @@ var require_dist = __commonJS({
44608
46010
  if (node.nodeType === Node.TEXT_NODE || node.nodeType === Node.ELEMENT_NODE) {
44609
46011
  const el = node.nodeType === Node.TEXT_NODE ? node.parentElement : node;
44610
46012
  if (el && el.matches(styleSelector)) {
44611
- addEl(el);
46013
+ defer(() => addEl(el));
44612
46014
  }
44613
46015
  }
44614
46016
  });
@@ -44616,7 +46018,7 @@ var require_dist = __commonJS({
44616
46018
  if (node.nodeType === Node.TEXT_NODE || node.nodeType === Node.ELEMENT_NODE) {
44617
46019
  const el = node.nodeType === Node.TEXT_NODE ? node.parentElement : node;
44618
46020
  if (el && el.matches(styleSelector)) {
44619
- removeEl(el);
46021
+ defer(() => removeEl(el));
44620
46022
  }
44621
46023
  }
44622
46024
  });
@@ -44627,12 +46029,14 @@ var require_dist = __commonJS({
44627
46029
  const collectedStyles = collectStyles(parentDocument);
44628
46030
  let mountedCounter = 0;
44629
46031
  collectedStyles.forEach((styleNode) => {
44630
- addEl(styleNode, () => {
44631
- mountedCounter += 1;
44632
- if (mountedCounter === collectedStyles.length) {
44633
- onStylesLoaded();
44634
- }
44635
- });
46032
+ defer(
46033
+ () => addEl(styleNode, () => {
46034
+ mountedCounter += 1;
46035
+ if (mountedCounter === collectedStyles.length) {
46036
+ onStylesLoaded();
46037
+ }
46038
+ })
46039
+ );
44636
46040
  });
44637
46041
  observer.observe(parentDocument.head, { childList: true, subtree: true });
44638
46042
  return () => {
@@ -44641,10 +46045,14 @@ var require_dist = __commonJS({
44641
46045
  }, []);
44642
46046
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children });
44643
46047
  };
44644
- var AutoFrameComponent_default = import_react22.default.forwardRef(function(_a3, ref2) {
44645
- var _b = _a3, { children, debug, onStylesLoaded } = _b, props = __objRest2(_b, ["children", "debug", "onStylesLoaded"]);
44646
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_frame_component.default, __spreadProps2(__spreadValues2({}, props), { ref: ref2, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CopyHostStyles, { debug, onStylesLoaded, children }) }));
44647
- });
46048
+ var AutoFrameComponent = import_react22.default.forwardRef(
46049
+ function(_a3, ref2) {
46050
+ var _b = _a3, { children, debug, onStylesLoaded } = _b, props = __objRest2(_b, ["children", "debug", "onStylesLoaded"]);
46051
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_frame_component.default, __spreadProps2(__spreadValues2({}, props), { ref: ref2, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CopyHostStyles, { debug, onStylesLoaded, children }) }));
46052
+ }
46053
+ );
46054
+ AutoFrameComponent.displayName = "AutoFrameComponent";
46055
+ var AutoFrameComponent_default = AutoFrameComponent;
44648
46056
  }
44649
46057
  });
44650
46058
 
@@ -74385,6 +75793,7 @@ var require_dist2 = __commonJS({
74385
75793
  { width: 768, height: "auto", icon: "Tablet", label: "Medium" },
74386
75794
  { width: 1280, height: "auto", icon: "Monitor", label: "Large" }
74387
75795
  ];
75796
+ var import_ua_parser_js2 = require_ua_parser();
74388
75797
  var import_jsx_runtime22 = require("react/jsx-runtime");
74389
75798
  var defaultAppState2 = {
74390
75799
  data: { content: [], root: { props: { title: "" } } },
@@ -74424,7 +75833,8 @@ var require_dist2 = __commonJS({
74424
75833
  setZoomConfig: () => null,
74425
75834
  status: "LOADING",
74426
75835
  setStatus: () => null,
74427
- iframe: {}
75836
+ iframe: {},
75837
+ safariFallbackMode: false
74428
75838
  };
74429
75839
  var appContext2 = (0, import_react32.createContext)(defaultContext2);
74430
75840
  var AppProvider = ({
@@ -74436,10 +75846,34 @@ var require_dist2 = __commonJS({
74436
75846
  (0, import_react32.useEffect)(() => {
74437
75847
  setStatus("MOUNTED");
74438
75848
  }, []);
75849
+ const [safariFallbackMode, setSafariFallbackMode] = (0, import_react32.useState)(false);
75850
+ (0, import_react32.useEffect)(() => {
75851
+ var _a3, _b, _c;
75852
+ const ua = new import_ua_parser_js2.UAParser(navigator.userAgent);
75853
+ const { browser } = ua.getResult();
75854
+ if (browser.name === "Safari" && (((_a3 = browser.version) == null ? void 0 : _a3.indexOf("17.2.")) || ((_b = browser.version) == null ? void 0 : _b.indexOf("17.3.")) || ((_c = browser.version) == null ? void 0 : _c.indexOf("17.4.")))) {
75855
+ if (process.env.NODE_ENV !== "production" && value.iframe.enabled) {
75856
+ console.warn(
75857
+ `Detected Safari ${browser.version}, which contains a bug that prevents Puck DropZones from detecting a mouseover event within an iframe. This affects Safari versions 17.2, 17.3 and 17.4.
75858
+
75859
+ Running in compatibility mode, which may have some DropZone side-effects. Alternatively, consider disabling iframes: https://puckeditor.com/docs/integrating-puck/viewports#opting-out-of-iframes.
75860
+
75861
+ See https://github.com/measuredco/puck/issues/411 for more information. This message will not show in production.`
75862
+ );
75863
+ }
75864
+ setSafariFallbackMode(true);
75865
+ }
75866
+ }, []);
74439
75867
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
74440
75868
  appContext2.Provider,
74441
75869
  {
74442
- value: __spreadProps2(__spreadValues2({}, value), { zoomConfig, setZoomConfig, status, setStatus }),
75870
+ value: __spreadProps2(__spreadValues2({}, value), {
75871
+ zoomConfig,
75872
+ setZoomConfig,
75873
+ status,
75874
+ setStatus,
75875
+ safariFallbackMode
75876
+ }),
74443
75877
  children
74444
75878
  }
74445
75879
  );
@@ -74635,7 +76069,7 @@ var require_dist2 = __commonJS({
74635
76069
  var import_react72 = require("react");
74636
76070
  var import_dnd3 = (init_dnd_esm(), __toCommonJS(dnd_esm_exports));
74637
76071
  init_react_import2();
74638
- var styles_module_default32 = { "DraggableComponent": "_DraggableComponent_1542z_1", "DraggableComponent--isDragging": "_DraggableComponent--isDragging_1542z_11", "DraggableComponent-contents": "_DraggableComponent-contents_1542z_16", "DraggableComponent-overlay": "_DraggableComponent-overlay_1542z_29", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_1542z_49", "DraggableComponent--isLocked": "_DraggableComponent--isLocked_1542z_65", "DraggableComponent--forceHover": "_DraggableComponent--forceHover_1542z_71", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_1542z_76", "DraggableComponent--indicativeHover": "_DraggableComponent--indicativeHover_1542z_81", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_1542z_97", "DraggableComponent-actions": "_DraggableComponent-actions_1542z_97", "DraggableComponent-actionsLabel": "_DraggableComponent-actionsLabel_1542z_127", "DraggableComponent-action": "_DraggableComponent-action_1542z_97" };
76072
+ var styles_module_default32 = { "DraggableComponent": "_DraggableComponent_59z7f_1", "DraggableComponent--isDragging": "_DraggableComponent--isDragging_59z7f_11", "DraggableComponent-contents": "_DraggableComponent-contents_59z7f_16", "DraggableComponent-overlay": "_DraggableComponent-overlay_59z7f_29", "DraggableComponent-loadingOverlay": "_DraggableComponent-loadingOverlay_59z7f_49", "DraggableComponent--isLocked": "_DraggableComponent--isLocked_59z7f_65", "DraggableComponent--forceHover": "_DraggableComponent--forceHover_59z7f_71", "DraggableComponent--isSelected": "_DraggableComponent--isSelected_59z7f_76", "DraggableComponent--indicativeHover": "_DraggableComponent--indicativeHover_59z7f_81", "DraggableComponent-actionsOverlay": "_DraggableComponent-actionsOverlay_59z7f_97", "DraggableComponent-actions": "_DraggableComponent-actions_59z7f_97", "DraggableComponent-actionsLabel": "_DraggableComponent-actionsLabel_59z7f_127", "DraggableComponent-action": "_DraggableComponent-action_59z7f_97" };
74639
76073
  init_react_import2();
74640
76074
  init_react_import2();
74641
76075
  var import_react52 = require("react");
@@ -74976,7 +76410,7 @@ var require_dist2 = __commonJS({
74976
76410
  );
74977
76411
  };
74978
76412
  init_react_import2();
74979
- var styles_module_default42 = { "DropZone": "_DropZone_w4btq_1", "DropZone-content": "_DropZone-content_w4btq_10", "DropZone--userIsDragging": "_DropZone--userIsDragging_w4btq_15", "DropZone--draggingOverArea": "_DropZone--draggingOverArea_w4btq_19", "DropZone--draggingNewComponent": "_DropZone--draggingNewComponent_w4btq_20", "DropZone--isAreaSelected": "_DropZone--isAreaSelected_w4btq_26", "DropZone--hoveringOverArea": "_DropZone--hoveringOverArea_w4btq_27", "DropZone--isDisabled": "_DropZone--isDisabled_w4btq_28", "DropZone--isRootZone": "_DropZone--isRootZone_w4btq_29", "DropZone--hasChildren": "_DropZone--hasChildren_w4btq_30", "DropZone--isDestination": "_DropZone--isDestination_w4btq_40", "DropZone-item": "_DropZone-item_w4btq_52", "DropZone-hitbox": "_DropZone-hitbox_w4btq_56" };
76413
+ var styles_module_default42 = { "DropZone": "_DropZone_djoti_1", "DropZone-content": "_DropZone-content_djoti_10", "DropZone--userIsDragging": "_DropZone--userIsDragging_djoti_15", "DropZone--draggingOverArea": "_DropZone--draggingOverArea_djoti_19", "DropZone--draggingNewComponent": "_DropZone--draggingNewComponent_djoti_20", "DropZone--isAreaSelected": "_DropZone--isAreaSelected_djoti_26", "DropZone--hoveringOverArea": "_DropZone--hoveringOverArea_djoti_27", "DropZone--isDisabled": "_DropZone--isDisabled_djoti_28", "DropZone--isRootZone": "_DropZone--isRootZone_djoti_29", "DropZone--hasChildren": "_DropZone--hasChildren_djoti_30", "DropZone--isDestination": "_DropZone--isDestination_djoti_40", "DropZone-item": "_DropZone-item_djoti_52", "DropZone-hitbox": "_DropZone-hitbox_djoti_56" };
74980
76414
  init_react_import2();
74981
76415
  var import_react82 = require("react");
74982
76416
  var import_use_debounce = (init_index_module(), __toCommonJS(index_module_exports));
@@ -75161,7 +76595,11 @@ var require_dist2 = __commonJS({
75161
76595
  let isEnabled = userWillDrag;
75162
76596
  if (userIsDragging) {
75163
76597
  if (draggingNewComponent) {
75164
- isEnabled = hoveringOverArea;
76598
+ if (appContext22.safariFallbackMode) {
76599
+ isEnabled = true;
76600
+ } else {
76601
+ isEnabled = hoveringOverArea;
76602
+ }
75165
76603
  } else {
75166
76604
  isEnabled = draggingOverArea && hoveringOverZone;
75167
76605
  }
@@ -76927,7 +78365,7 @@ var require_dist2 = __commonJS({
76927
78365
  disabled: readOnly,
76928
78366
  onChange: (e2) => {
76929
78367
  if (e2.currentTarget.value === "true" || e2.currentTarget.value === "false") {
76930
- onChange(Boolean(e2.currentTarget.value));
78368
+ onChange(JSON.parse(e2.currentTarget.value));
76931
78369
  return;
76932
78370
  }
76933
78371
  onChange(e2.currentTarget.value);
@@ -77422,7 +78860,7 @@ var require_dist2 = __commonJS({
77422
78860
  var import_react222 = require("react");
77423
78861
  var import_auto_frame_component = __toESM2(require_dist());
77424
78862
  init_react_import2();
77425
- var styles_module_default16 = { "PuckPreview": "_PuckPreview_1mia0_1", "PuckPreview-frame": "_PuckPreview-frame_1mia0_5" };
78863
+ var styles_module_default16 = { "PuckPreview": "_PuckPreview_rxwlr_1", "PuckPreview-frame": "_PuckPreview-frame_rxwlr_5" };
77426
78864
  var import_jsx_runtime29 = require("react/jsx-runtime");
77427
78865
  var getClassName21 = get_class_name_factory_default2("PuckPreview", styles_module_default16);
77428
78866
  var Preview = ({ id = "puck-preview" }) => {
@@ -78150,7 +79588,7 @@ var require_dist2 = __commonJS({
78150
79588
  {
78151
79589
  className: getClassName24("root"),
78152
79590
  style: {
78153
- width: iframe.enabled ? ui.viewports.current.width : void 0,
79591
+ width: iframe.enabled ? ui.viewports.current.width : "100%",
78154
79592
  height: zoomConfig.rootHeight,
78155
79593
  transform: iframe.enabled ? `scale(${zoomConfig.zoom})` : void 0,
78156
79594
  transition: showTransition ? "width 150ms ease-out, height 150ms ease-out, transform 150ms ease-out" : "",
@@ -78942,6 +80380,7 @@ var defaultViewports = [
78942
80380
  ];
78943
80381
 
78944
80382
  // ../core/components/Puck/context.tsx
80383
+ var import_ua_parser_js = __toESM(require_ua_parser());
78945
80384
  var import_jsx_runtime4 = require("react/jsx-runtime");
78946
80385
  var defaultAppState = {
78947
80386
  data: { content: [], root: { props: { title: "" } } },
@@ -78981,7 +80420,8 @@ var defaultContext = {
78981
80420
  setZoomConfig: () => null,
78982
80421
  status: "LOADING",
78983
80422
  setStatus: () => null,
78984
- iframe: {}
80423
+ iframe: {},
80424
+ safariFallbackMode: false
78985
80425
  };
78986
80426
  var appContext = (0, import_react10.createContext)(defaultContext);
78987
80427
  function useAppContext() {