@applitools/snippets 2.2.1 → 2.4.0

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.
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ var s=function(){"use strict";return function(){var r=document.querySelectorAll(
27
27
  return s(arg)
28
28
  }
29
29
  exports.getContextInfo=function(arg){
30
- var s=function(){"use strict";var t=function(t){var n=(void 0===t?[]:t)[0],e="",r=n.ownerDocument;if(!r)return e;for(var o=n;o!==r;){var a=Array.prototype.filter.call(o.parentNode.childNodes,(function(t){return t.tagName===o.tagName})).indexOf(o);e="/"+o.tagName+"["+(a+1)+"]"+e,o=o.parentNode}return e};return function(){var n,e,r;try{n=window.top.document===window.document}catch(t){n=!1}try{e=!window.parent.document===window.document}catch(t){e=!0}if(!e)try{r=t([window.frameElement])}catch(t){r=null}return[document.documentElement,r,n,e]}}();
30
+ var s=function(){"use strict";var t=function(t){var n=(void 0===t?[]:t)[0],e="",r=n.ownerDocument;if(!r)return e;for(var o=n;o!==r;){var a=Array.prototype.filter.call(o.parentNode.childNodes,(function(t){return t.tagName===o.tagName})).indexOf(o);e="/"+o.tagName+"["+(a+1)+"]"+e,o=o.parentNode}return e};return function(){var n,e,r;try{n=window.top.document===window.document||"root-context"===window.document["applitools-marker"]}catch(t){n=!1}try{e=!window.parent.document===window.document}catch(t){e=!0}if(!e)try{r=t([window.frameElement])}catch(t){r=null}return[document.documentElement,r,n,e]}}();
31
31
  return s(arg)
32
32
  }
33
33
  exports.getDocumentScrollingElement=function(arg){
@@ -99,13 +99,17 @@ var s=function(){"use strict";return function(){var e=0,t=0;return window.innerH
99
99
  return s(arg)
100
100
  }
101
101
  exports.isElementScrollable=function(arg){
102
- var s=function(){"use strict";return function(t){var i=(void 0===t?[]:t)[0];return i.scrollWidth>i.clientWidth||i.scrollHeight>i.clientHeight}}();
102
+ var s=function(){"use strict";var t=function(t){var o=void 0===t?[]:t,r=o[0],e=o[1],i=void 0===e?[]:e,n=window.getComputedStyle(r);return n?i.map((function(t){return n.getPropertyValue(t)})):[]};return function(o){var r=(void 0===o?[]:o)[0],e=t([r,["overflow-x","overflow-y","overflow"]]);return("scroll"===e[0]||"auto"===e[0]||"hidden"===e[2])&&r.scrollWidth>r.clientWidth||("scroll"===e[1]||"auto"===e[1]||"hidden"===e[2])&&r.scrollHeight>r.clientHeight}}();
103
103
  return s(arg)
104
104
  }
105
105
  exports.isEqualElements=function(arg){
106
106
  var s=function(){"use strict";return function(r){var n=void 0===r?[]:r;return n[0]===n[1]}}();
107
107
  return s(arg)
108
108
  }
109
+ exports.lazyLoad=function(arg){
110
+ var s=function(){"use strict";var o=function(o){var t=(void 0===o?[]:o)[0];return t?{x:t.scrollLeft,y:t.scrollTop}:{x:window.scrollX||window.pageXOffset,y:window.scrollY||window.pageYOffset}};var t=function(o){var t=void 0===o?[]:o,r=t[0],e=t[1],l=Object.keys(e).sort(),n=l.reduce((function(o,t){return o[t]={value:r.style.getPropertyValue(t),important:Boolean(r.style.getPropertyPriority(t))},o}),{});return l.forEach((function(o){r.style.setProperty(o,"string"!=typeof e[o]&&e[o]?e[o].value:e[o],e[o]&&e[o].important?"important":"")})),n};var r=function(o){var r=void 0===o?[]:o,e=r[0],l=r[1];e=e||document.documentElement;var n=t([e,{"scroll-behavior":{value:"auto",important:!0}}]);return e.scrollTo?e.scrollTo(l.x,l.y):(e.scrollLeft=l.x,e.scrollTop=l.y),t([e,n]),{x:e.scrollLeft,y:e.scrollTop}},e="__EYES__APPLITOOLS__";return window[e]=window[e]||{},function(t){var l=(void 0===t?[]:t)[0],n=(l=void 0===l?{}:l).scrollLength,i=l.waitingTime,a=l.maxAmountToScroll;try{if(window[e].lazyLoadResult){var s=window[e].lazyLoadResult;return"WIP"!==s.status&&delete window[e].lazyLoadResult,JSON.stringify(s)}window[e].lazyLoadResult={status:"WIP"};var u=o(),c=[];c.push({maxAmountToScroll:a,scrollLength:n,waitingTime:i,startingScrollPositionX:u.x,startingScrollPositionY:u.y});var d=Date.now();return function o(t){var l=void 0===t?{}:t,s=l.doneScrolling,y=l.previousScrollResult,w=void 0===y?{}:y;setTimeout((function(){try{if(s){var t=r([void 0,u]),l=t.x,i=t.y;return c.push({x:l,y:i,msSinceStart:Date.now()-d}),void(window[e].lazyLoadResult={status:"SUCCESS",value:c})}var y=r([void 0,{x:u.x,y:w.y+n}]),v=y.x,f=y.y;c.push({x:v,y:f,msSinceStart:Date.now()-d}),o({doneScrolling:f===w.y||f===a,previousScrollResult:{x:v,y:f}})}catch(o){window[e].lazyLoadResult={status:"ERROR",error:o}}}),i)}(),JSON.stringify(window[e].lazyLoadResult)}catch(o){return window[e].lazyLoadResult={status:"ERROR",error:o},JSON.stringify(window[e].lazyLoadResult)}}}();
111
+ return s(arg)
112
+ }
109
113
  exports.scrollTo=function(arg){
110
114
  var s=function(){"use strict";var t=function(t){var r=void 0===t?[]:t,o=r[0],e=r[1],l=Object.keys(e).sort(),n=l.reduce((function(t,r){return t[r]={value:o.style.getPropertyValue(r),important:Boolean(o.style.getPropertyPriority(r))},t}),{});return l.forEach((function(t){o.style.setProperty(t,"string"!=typeof e[t]&&e[t]?e[t].value:e[t],e[t]&&e[t].important?"important":"")})),n};return function(r){var o=void 0===r?[]:r,e=o[0],l=o[1];e=e||document.documentElement;var n=t([e,{"scroll-behavior":{value:"auto",important:!0}}]);return e.scrollTo?e.scrollTo(l.x,l.y):(e.scrollLeft=l.x,e.scrollTop=l.y),t([e,n]),{x:e.scrollLeft,y:e.scrollTop}}}();
111
115
  return s(arg)
package/package.json CHANGED
@@ -1,15 +1,23 @@
1
1
  {
2
2
  "name": "@applitools/snippets",
3
- "version": "2.2.1",
3
+ "version": "2.4.0",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/applitools/eyes.sdk.javascript1.git",
7
+ "directory": "packages/snippets"
8
+ },
4
9
  "license": "SEE LICENSE IN LICENSE",
10
+ "aliases": [
11
+ "snippets"
12
+ ],
5
13
  "main": "./dist/index.js",
6
14
  "files": [
7
15
  "dist"
8
16
  ],
9
17
  "scripts": {
10
18
  "lint": "eslint '**/*.js'",
11
- "build": "node ./rollup/cli bundle --format json --format snippet",
12
- "build:watch": "node ./rollup/cli watch --format json --format snippet",
19
+ "build": "node ./rollup/cli bundle --format snippet",
20
+ "build:watch": "node ./rollup/cli watch --format snippet",
13
21
  "test": "mocha --no-timeouts --require test/util/hook.js ./test/*.spec.js",
14
22
  "test:chrome": "mocha --no-timeouts --require test/util/hook.js --grep chrome ./test/*.spec.js",
15
23
  "test:ie": "mocha --no-timeouts --require test/util/hook.js --grep 'internet explorer' ./test/*.spec.js",
@@ -19,19 +27,9 @@
19
27
  "version": "bongo version",
20
28
  "postversion": "bongo postversion --skip-release-notification"
21
29
  },
22
- "husky": {
23
- "hooks": {
24
- "pre-push": "yarn bongo lint"
25
- }
26
- },
27
- "repository": {
28
- "type": "git",
29
- "url": "https://github.com/applitools/eyes.sdk.javascript1.git",
30
- "directory": "packages/snippets"
31
- },
32
30
  "dependencies": {},
33
31
  "devDependencies": {
34
- "@applitools/sdk-release-kit": "^0.3.3",
32
+ "@applitools/bongo": "^2.1.5",
35
33
  "@babel/core": "^7.11.6",
36
34
  "@babel/preset-env": "^7.11.5",
37
35
  "@rollup/plugin-babel": "^5.2.1",
@@ -51,10 +49,15 @@
51
49
  "webdriverio": "^6.1.24",
52
50
  "yargs": "^16.0.3"
53
51
  },
54
- "engines": {
55
- "node": ">=8.9.0"
56
- },
57
52
  "resolutions": {
58
53
  "chromedriver": "^98.0.0"
54
+ },
55
+ "engines": {
56
+ "node": ">=12.13.0"
57
+ },
58
+ "husky": {
59
+ "hooks": {
60
+ "pre-push": "yarn bongo lint"
61
+ }
59
62
  }
60
63
  }
package/CHANGELOG.md DELETED
@@ -1,124 +0,0 @@
1
-
2
- # Changelog
3
-
4
- ## Unreleased
5
-
6
-
7
- ## 2.2.1 - 2022/3/12
8
-
9
- - consider dynamic scrollingElement in other snippets
10
-
11
- ## 2.2.0 - 2022/3/6
12
-
13
- - support assigning 'scrollingElement' as 'body' or 'html' dom element
14
-
15
- ## 2.1.15 - 2022/2/16
16
-
17
- - revert 2.1.14
18
-
19
- ## 2.1.14 - 2022/2/15
20
-
21
- - fix `getElementRect` for `document.scrollingElement`
22
-
23
- ## 2.1.13 - 2022/2/15
24
-
25
- - add `getViewportScale` snippet
26
- - remove auto scaling from `getViewportSize` and `addPageMarker`
27
- - marker mask and size have to be passed as arguments in `addPageMarker`
28
-
29
- ## 2.1.12 - 2021/12/22
30
-
31
- - round fractional values in `getViewportSize`
32
-
33
- ## 2.1.11 - 2021/12/22
34
-
35
- - add neutral color border around marker in `addPageMarker`
36
- - improve handling of pages without viewport tag in `addPageMarker` and `getViewportSize`
37
-
38
- ## 2.1.10 - 2021/12/20
39
-
40
- - overwrite `transform` style property with `!important` in `translateTo`
41
-
42
- ## 2.1.9 - 2021/12/17
43
-
44
- - fix `scrollTo` which was returning the wrong actual scroll position due to `scroll-behavior: smooth` style on the scrollable element
45
-
46
- ## 2.1.8 - 2021/12/16
47
-
48
- - fix `addPageMarker` to handle different pixel densities
49
- - change shape and size of marker added by `addPageMarker`
50
-
51
- ## 2.1.7 - 2021/9/9
52
-
53
- - fix `getShadowRoot` to follow convention for arguments
54
-
55
- ## 2.1.6 - 2021/9/6
56
-
57
- - return array instead of object from `addElementIds`
58
-
59
- ## 2.1.5 - 2021/9/6
60
-
61
- - add `getShadowRoot` snippet
62
- - replace `setElementMarkers` with `addElementIds` snippet, which will return a selector mapping
63
-
64
- ## 2.1.4 - 2021/8/4
65
-
66
- - add `isEqualElements` snippet
67
-
68
- ## 2.1.3 - 2021/3/11
69
-
70
- - fix exception thrown in getElementTranslateOffset [Trello](https://trello.com/c/duAwaupv)
71
-
72
- ## 2.1.1 - 2021/1/26
73
-
74
- - handle translated html elements during content size extracting
75
- - chore: add husky
76
-
77
- ## 2.1.0 - 2020/10/23
78
-
79
- - fix `blurElement`: use default value if element passed as `null`
80
- - fix `getElementRect`: extract element fixed ancestor inner offset even if it not scrollable
81
- - fix `setElementMarkers`: concat ids instead of override
82
-
83
- ## 2.0.3 - 2020/10/6
84
-
85
- - publish with dist folder
86
-
87
- ## 2.0.2 - 2020/10/6
88
-
89
- - added `addPageMarker` and `cleanupPageMarker` snippets
90
- - handle priority of the style properties in `getElementStyleProperties` and `setElementStyleProperties`
91
-
92
- ## 2.0.1 - 2020/9/28
93
-
94
- - remove yarn workspaces
95
-
96
- ## 2.0.0 - 2020/9/14
97
-
98
- - Breaking change: changed snippets argument format from object to array
99
- - Breaking change: changed snippets return value format from object to array
100
- - add ios tests
101
-
102
- ## 1.1.1 - 2020/8/30
103
-
104
- - nothing added, technical issue with unreleased commits
105
-
106
- ## 1.1.0 - 2020/8/30
107
-
108
- - add `markElements` and `cleanupElementIds`
109
-
110
- ## 1.0.3 - 2020/8/10
111
-
112
- - bumped sdk-release-kit version to latest
113
-
114
- ## 1.0.2 - 2020/8/4
115
-
116
- - Fix git tagging
117
-
118
- ## 1.0.1 - 2020/8/4
119
-
120
- - Fix IE capabilities
121
-
122
- ## 1.0.0 - 2020/8/4
123
-
124
- - First release
@@ -1,33 +0,0 @@
1
- {
2
- "addElementIds": "function(arg){var s=function(){\"use strict\";return function(t){var o=t[0],e=t[1];return o.map((function(t,o){var r=[t];if(t.getRootNode)for(var a=t.getRootNode();a!==document;a=a.host.getRootNode())r.push(a.host);var n=e[o];return r.map((function(t){var o=t.getAttribute(\"data-applitools-selector\"),e=o?o+\" \"+n:n;return t.setAttribute(\"data-applitools-selector\",e),'[data-applitools-selector~=\"'+n+'\"]'}))}))}}();\nreturn s(arg)}",
3
- "addPageMarker": "function(arg){var s=function(){\"use strict\";var t=function(t){var e=void 0===t?[]:t,r=e[0],o=e[1],n=Object.keys(o).sort(),i=n.reduce((function(t,e){return t[e]={value:r.style.getPropertyValue(e),important:Boolean(r.style.getPropertyPriority(e))},t}),{});return n.forEach((function(t){r.style.setProperty(t,\"string\"!=typeof o[t]&&o[t]?o[t].value:o[t],o[t]&&o[t].important?\"important\":\"\")})),i};return function(e){var r=e[0],o=r.mask,n=r.size,i=void 0===n?1:n,a={1:\"rgb(0, 0, 0)\",0:\"rgb(255, 255, 255)\"},s=i,p=document.createElement(\"div\");p.setAttribute(\"data-applitools-marker\",\"\"),p.style.setProperty(\"position\",\"fixed\",\"important\"),p.style.setProperty(\"top\",\"0\",\"important\"),p.style.setProperty(\"left\",\"0\",\"important\"),p.style.setProperty(\"box-sizing\",\"content-box\",\"important\"),p.style.setProperty(\"padding\",s+\"px\",\"important\"),p.style.setProperty(\"background\",\"rgb(128, 128, 128)\",\"important\"),p.style.setProperty(\"z-index\",\"2147483647\",\"important\");for(var l,y=0;y<o.length;y+=l){for(l=1;o[y]===o[y+l];)++l;var m=o[y],d=document.createElement(\"div\");d.style.setProperty(\"display\",\"block\",\"important\"),d.style.setProperty(\"float\",\"left\",\"important\"),d.style.setProperty(\"width\",l*i+\"px\",\"important\"),d.style.setProperty(\"height\",i+\"px\",\"important\"),d.style.setProperty(\"background\",a[m],\"important\"),p.appendChild(d)}var u={value:\"none\",important:!0},c=t([document.documentElement,{transform:u,\"-webkit-transform\":u}]),f=t([document.body,{transform:u,\"-webkit-transform\":u}]);return document.documentElement.setAttribute(\"data-applitools-original-transforms\",JSON.stringify(c)),document.body.setAttribute(\"data-applitools-original-transforms\",JSON.stringify(f)),document.body.appendChild(p),{mask:o,size:i,offset:s}}}();\nreturn s(arg)}",
4
- "blurElement": "function(arg){var s=function(){\"use strict\";return function(t){var n=(void 0===t?[]:t)[0]||document.activeElement;return n&&n.blur(),n}}();\nreturn s(arg)}",
5
- "cleanupElementIds": "function(arg){var s=function(){\"use strict\";return function(t){t[0].forEach((function(t){if(t.removeAttribute(\"data-applitools-selector\"),t.getRootNode)for(var o=t.getRootNode();o!==document;o=o.host.getRootNode())o.host.removeAttribute(\"data-applitools-selector\")}))}}();\nreturn s(arg)}",
6
- "cleanupPageMarker": "function(arg){var s=function(){\"use strict\";var t=function(t){var e=void 0===t?[]:t,r=e[0],o=e[1],n=Object.keys(o).sort(),a=n.reduce((function(t,e){return t[e]={value:r.style.getPropertyValue(e),important:Boolean(r.style.getPropertyPriority(e))},t}),{});return n.forEach((function(t){r.style.setProperty(t,\"string\"!=typeof o[t]&&o[t]?o[t].value:o[t],o[t]&&o[t].important?\"important\":\"\")})),a};return function(){var e=document.querySelector(\"[data-applitools-marker]\");e&&document.body.removeChild(e);var r=document.documentElement.getAttribute(\"data-applitools-original-transforms\"),o=document.body.getAttribute(\"data-applitools-original-transforms\");r&&t([document.documentElement,JSON.parse(r)]),o&&t([document.body,JSON.parse(o)])}}();\nreturn s(arg)}",
7
- "focusElement": "function(arg){var s=function(){\"use strict\";return function(n){var r=(void 0===n?[]:n)[0];r&&r.focus()}}();\nreturn s(arg)}",
8
- "getChildFramesInfo": "function(arg){var s=function(){\"use strict\";return function(){var r=document.querySelectorAll(\"frame, iframe\");return Array.prototype.map.call(r,(function(r){return[r,!r.contentDocument,r.src]}))}}();\nreturn s(arg)}",
9
- "getContextInfo": "function(arg){var s=function(){\"use strict\";var t=function(t){var n=(void 0===t?[]:t)[0],e=\"\",r=n.ownerDocument;if(!r)return e;for(var o=n;o!==r;){var a=Array.prototype.filter.call(o.parentNode.childNodes,(function(t){return t.tagName===o.tagName})).indexOf(o);e=\"/\"+o.tagName+\"[\"+(a+1)+\"]\"+e,o=o.parentNode}return e};return function(){var n,e,r;try{n=window.top.document===window.document}catch(t){n=!1}try{e=!window.parent.document===window.document}catch(t){e=!0}if(!e)try{r=t([window.frameElement])}catch(t){r=null}return[document.documentElement,r,n,e]}}();\nreturn s(arg)}",
10
- "getDocumentScrollingElement": "function(arg){var s=function(){\"use strict\";return function(){var t=\"HTML\",e=document.scrollingElement;return e&&(t=e.tagName),t.toLowerCase()}}();\nreturn s(arg)}",
11
- "getDocumentSize": "function(arg){var s=function(){\"use strict\";return function(){var t=document.documentElement.scrollWidth,e=document.documentElement.scrollHeight,n=document.documentElement.clientHeight,c=document.body.scrollWidth,o=document.body.scrollHeight,d=document.body.clientHeight;return{width:Math.max(t,c),height:Math.max(n,e,d,o)}}}();\nreturn s(arg)}",
12
- "getElementComputedStyleProperties": "function(arg){var s=function(){\"use strict\";return function(t){var r=void 0===t?[]:t,e=r[0],n=r[1],u=void 0===n?[]:n,o=window.getComputedStyle(e);return o?u.map((function(t){return o.getPropertyValue(t)})):[]}}();\nreturn s(arg)}",
13
- "getElementContentSize": "function(arg){var s=function(){\"use strict\";var t=function(t){var e=void 0===t?[]:t,r=e[0],o=e[1],n=Object.keys(o).sort(),a=n.reduce((function(t,e){return t[e]={value:r.style.getPropertyValue(e),important:Boolean(r.style.getPropertyPriority(e))},t}),{});return n.forEach((function(t){r.style.setProperty(t,\"string\"!=typeof o[t]&&o[t]?o[t].value:o[t],o[t]&&o[t].important?\"important\":\"\")})),a};return function(e){var r,o,n,a=(void 0===e?[]:e)[0];a!==document.documentElement&&a.tagName.toLowerCase()!==(o=\"HTML\",(n=document.scrollingElement)&&(o=n.tagName),o.toLowerCase())||(r=t([a,{transform:\"none\"}]));var i={width:a.scrollWidth,height:a.scrollHeight};return r&&t([a,r]),i}}();\nreturn s(arg)}",
14
- "getElementFixedAncestor": "function(arg){var s=function(){\"use strict\";return function(t){for(var e=(void 0===t?[]:t)[0];e.offsetParent&&e.offsetParent!==document.body&&e.offsetParent!==document.documentElement;)e=e.offsetParent;return\"fixed\"===window.getComputedStyle(e).getPropertyValue(\"position\")?e:null}}();\nreturn s(arg)}",
15
- "getElementInnerOffset": "function(arg){var s=function(){\"use strict\";var r=function(r){var t=(void 0===r?[]:r)[0];return t?{x:t.scrollLeft,y:t.scrollTop}:{x:window.scrollX||window.pageXOffset,y:window.scrollY||window.pageYOffset}};var t=function(r){var t=void 0===r?[]:r,e=t[0],o=t[1];return(void 0===o?[]:o).reduce((function(r,t){return r[t]={value:e.style.getPropertyValue(t),important:Boolean(e.style.getPropertyPriority(t))},r}),{})};var e=function(r){var e=(void 0===r?[]:r)[0],o=void 0===e?document.documentElement:e,n=t([o,[\"transform\",\"-webkit-transform\"]]),i=Object.keys(n).reduce((function(r,t){var e=n[t].value;if(e){var o=e.match(/^translate\\s*\\(\\s*(\\-?[\\d, \\.]+)px\\s*(,\\s*(-?[\\d, \\.]+)px)?\\s*\\)/);if(o){var i=o[1],a=void 0!==o[3]?o[3]:0;r.push({x:Math.round(-parseFloat(i)),y:Math.round(-parseFloat(a))})}else r.push({x:0,y:0})}return r}),[]);if(!i.every((function(r){return i[0].x===r.x||i[0].y===r.y})))throw new Error(\"Got different css positions!\");return i[0]||{x:0,y:0}};return function(t){var o=(void 0===t?[]:t)[0],n=r([o]),i=e([o]);return{x:n.x+i.x,y:n.y+i.y}}}();\nreturn s(arg)}",
16
- "getElementProperties": "function(arg){var s=function(){\"use strict\";return function(r){var n=void 0===r?[]:r,t=n[0],u=n[1];return(void 0===u?[]:u).reduce((function(r,n){return r[n]=t[n],r}),{})}}();\nreturn s(arg)}",
17
- "getElementRect": "function(arg){var s=function(){\"use strict\";var t=function(t){for(var e=(void 0===t?[]:t)[0];e.offsetParent&&e.offsetParent!==document.body&&e.offsetParent!==document.documentElement;)e=e.offsetParent;return\"fixed\"===window.getComputedStyle(e).getPropertyValue(\"position\")?e:null};var e=function(t){var e=(void 0===t?[]:t)[0];return e?{x:e.scrollLeft,y:e.scrollTop}:{x:window.scrollX||window.pageXOffset,y:window.scrollY||window.pageYOffset}};var r=function(t){var e=void 0===t?[]:t,r=e[0],o=e[1];return(void 0===o?[]:o).reduce((function(t,e){return t[e]={value:r.style.getPropertyValue(e),important:Boolean(r.style.getPropertyPriority(e))},t}),{})};var o=function(t){var e=(void 0===t?[]:t)[0],o=void 0===e?document.documentElement:e,n=r([o,[\"transform\",\"-webkit-transform\"]]),i=Object.keys(n).reduce((function(t,e){var r=n[e].value;if(r){var o=r.match(/^translate\\s*\\(\\s*(\\-?[\\d, \\.]+)px\\s*(,\\s*(-?[\\d, \\.]+)px)?\\s*\\)/);if(o){var i=o[1],a=void 0!==o[3]?o[3]:0;t.push({x:Math.round(-parseFloat(i)),y:Math.round(-parseFloat(a))})}else t.push({x:0,y:0})}return t}),[]);if(!i.every((function(t){return i[0].x===t.x||i[0].y===t.y})))throw new Error(\"Got different css positions!\");return i[0]||{x:0,y:0}};var n=function(t){var r=(void 0===t?[]:t)[0],n=e([r]),i=o([r]);return{x:n.x+i.x,y:n.y+i.y}};return function(e){var r,o,i=void 0===e?[]:e,a=i[0],d=i[1],u=void 0!==d&&d;if(a===document.documentElement||a.tagName.toLowerCase()===(r=\"HTML\",(o=document.scrollingElement)&&(r=o.tagName),r.toLowerCase()))return{x:0,y:0,width:a.clientWidth,height:a.clientHeight};var s=a.getBoundingClientRect(),l={x:s.left,y:s.top,width:s.width,height:s.height};if(u){var f=window.getComputedStyle(a);l.x+=parseInt(f.getPropertyValue(\"border-left-width\")),l.y+=parseInt(f.getPropertyValue(\"border-top-width\")),l.width=a.clientWidth,l.height=a.clientHeight}var c=t([a]);if(c){if(c!==a){var v=n([c]);l.x+=v.x,l.y+=v.y}}else{var y=n();l.x+=y.x,l.y+=y.y}return l}}();\nreturn s(arg)}",
18
- "getElementScrollOffset": "function(arg){var s=function(){\"use strict\";return function(o){var r=(void 0===o?[]:o)[0];return r?{x:r.scrollLeft,y:r.scrollTop}:{x:window.scrollX||window.pageXOffset,y:window.scrollY||window.pageYOffset}}}();\nreturn s(arg)}",
19
- "getElementStyleProperties": "function(arg){var s=function(){\"use strict\";return function(r){var t=void 0===r?[]:r,e=t[0],n=t[1];return(void 0===n?[]:n).reduce((function(r,t){return r[t]={value:e.style.getPropertyValue(t),important:Boolean(e.style.getPropertyPriority(t))},r}),{})}}();\nreturn s(arg)}",
20
- "getElementTranslateOffset": "function(arg){var s=function(){\"use strict\";var r=function(r){var t=void 0===r?[]:r,e=t[0],n=t[1];return(void 0===n?[]:n).reduce((function(r,t){return r[t]={value:e.style.getPropertyValue(t),important:Boolean(e.style.getPropertyPriority(t))},r}),{})};return function(t){var e=(void 0===t?[]:t)[0],n=void 0===e?document.documentElement:e,o=r([n,[\"transform\",\"-webkit-transform\"]]),u=Object.keys(o).reduce((function(r,t){var e=o[t].value;if(e){var n=e.match(/^translate\\s*\\(\\s*(\\-?[\\d, \\.]+)px\\s*(,\\s*(-?[\\d, \\.]+)px)?\\s*\\)/);if(n){var u=n[1],a=void 0!==n[3]?n[3]:0;r.push({x:Math.round(-parseFloat(u)),y:Math.round(-parseFloat(a))})}else r.push({x:0,y:0})}return r}),[]);if(!u.every((function(r){return u[0].x===r.x||u[0].y===r.y})))throw new Error(\"Got different css positions!\");return u[0]||{x:0,y:0}}}();\nreturn s(arg)}",
21
- "getElementXpath": "function(arg){var s=function(){\"use strict\";return function(r){var e=(void 0===r?[]:r)[0],t=\"\",n=e.ownerDocument;if(!n)return t;for(var a=e;a!==n;){var o=Array.prototype.filter.call(a.parentNode.childNodes,(function(r){return r.tagName===a.tagName})).indexOf(a);t=\"/\"+a.tagName+\"[\"+(o+1)+\"]\"+t,a=a.parentNode}return t}}();\nreturn s(arg)}",
22
- "getPixelRatio": "function(arg){var s=function(){\"use strict\";return function(){return window.devicePixelRatio}}();\nreturn s(arg)}",
23
- "getShadowRoot": "function(arg){var s=function(){\"use strict\";return function(t){return(void 0===t?[]:t)[0].shadowRoot}}();\nreturn s(arg)}",
24
- "getUserAgent": "function(arg){var s=function(){\"use strict\";return function(){return window.navigator.userAgent}}();\nreturn s(arg)}",
25
- "getViewportScale": "function(arg){var s=function(){\"use strict\";return function(){return window.visualViewport&&window.visualViewport.scale}}();\nreturn s(arg)}",
26
- "getViewportSize": "function(arg){var s=function(){\"use strict\";return function(){var e=0,t=0;return window.innerHeight?t=window.innerHeight:document.documentElement&&document.documentElement.clientHeight?t=document.documentElement.clientHeight:document.body&&document.body.clientHeight&&(t=document.body.clientHeight),window.innerWidth?e=window.innerWidth:document.documentElement&&document.documentElement.clientWidth?e=document.documentElement.clientWidth:document.body&&document.body.clientWidth&&(e=document.body.clientWidth),{width:e,height:t}}}();\nreturn s(arg)}",
27
- "isElementScrollable": "function(arg){var s=function(){\"use strict\";return function(t){var i=(void 0===t?[]:t)[0];return i.scrollWidth>i.clientWidth||i.scrollHeight>i.clientHeight}}();\nreturn s(arg)}",
28
- "isEqualElements": "function(arg){var s=function(){\"use strict\";return function(r){var n=void 0===r?[]:r;return n[0]===n[1]}}();\nreturn s(arg)}",
29
- "scrollTo": "function(arg){var s=function(){\"use strict\";var t=function(t){var r=void 0===t?[]:t,o=r[0],e=r[1],l=Object.keys(e).sort(),n=l.reduce((function(t,r){return t[r]={value:o.style.getPropertyValue(r),important:Boolean(o.style.getPropertyPriority(r))},t}),{});return l.forEach((function(t){o.style.setProperty(t,\"string\"!=typeof e[t]&&e[t]?e[t].value:e[t],e[t]&&e[t].important?\"important\":\"\")})),n};return function(r){var o=void 0===r?[]:r,e=o[0],l=o[1];e=e||document.documentElement;var n=t([e,{\"scroll-behavior\":{value:\"auto\",important:!0}}]);return e.scrollTo?e.scrollTo(l.x,l.y):(e.scrollLeft=l.x,e.scrollTop=l.y),t([e,n]),{x:e.scrollLeft,y:e.scrollTop}}}();\nreturn s(arg)}",
30
- "setElementAttributes": "function(arg){var s=function(){\"use strict\";return function(t){var e=void 0===t?[]:t,r=e[0],u=e[1];return Object.keys(u).reduce((function(t,e){return t[e]=r.getAttribute(e),r.setAttribute(e,u[e]),t}),{})}}();\nreturn s(arg)}",
31
- "setElementStyleProperties": "function(arg){var s=function(){\"use strict\";return function(t){var r=void 0===t?[]:t,e=r[0],o=r[1],n=Object.keys(o).sort(),i=n.reduce((function(t,r){return t[r]={value:e.style.getPropertyValue(r),important:Boolean(e.style.getPropertyPriority(r))},t}),{});return n.forEach((function(t){e.style.setProperty(t,\"string\"!=typeof o[t]&&o[t]?o[t].value:o[t],o[t]&&o[t].important?\"important\":\"\")})),i}}();\nreturn s(arg)}",
32
- "translateTo": "function(arg){var s=function(){\"use strict\";var t=function(t){var r=void 0===t?[]:t,e=r[0],n=r[1],o=Object.keys(n).sort(),a=o.reduce((function(t,r){return t[r]={value:e.style.getPropertyValue(r),important:Boolean(e.style.getPropertyPriority(r))},t}),{});return o.forEach((function(t){e.style.setProperty(t,\"string\"!=typeof n[t]&&n[t]?n[t].value:n[t],n[t]&&n[t].important?\"important\":\"\")})),a};return function(r){var e=void 0===r?[]:r,n=e[0],o=e[1];n=n||document.documentElement;var a={value:\"translate(\"+-o.x+\"px, \"+-o.y+\"px)\",important:!0};return t([n,{transform:a,\"-webkit-transform\":a}]),o}}();\nreturn s(arg)}"
33
- }