@applitools/snippets 2.8.2 → 2.9.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/CHANGELOG.md +15 -0
- package/dist/index.js +34 -34
- package/package.json +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.9.0](https://github.com/Applitools-Dev/sdk/compare/js/snippets@2.8.2...js/snippets@2.9.0) (2026-05-05)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add bypassCSP support for UFG snapshot capture ([#3783](https://github.com/Applitools-Dev/sdk/issues/3783)) ([9e98933](https://github.com/Applitools-Dev/sdk/commit/9e98933b8ffba2ad1928aa2b2110e9a25209a599))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* @applitools/dom-shared bumped to 1.2.0
|
|
14
|
+
#### Features
|
|
15
|
+
|
|
16
|
+
* add bypassCSP support for UFG snapshot capture ([#3783](https://github.com/Applitools-Dev/sdk/issues/3783)) ([9e98933](https://github.com/Applitools-Dev/sdk/commit/9e98933b8ffba2ad1928aa2b2110e9a25209a599))
|
|
17
|
+
|
|
3
18
|
## [2.8.2](https://github.com/Applitools-Dev/sdk/compare/js/snippets@2.8.1...js/snippets@2.8.2) (2026-04-16)
|
|
4
19
|
|
|
5
20
|
|
package/dist/index.js
CHANGED
|
@@ -1,136 +1,136 @@
|
|
|
1
1
|
exports.translateTo=function(arg){
|
|
2
|
-
var s=function(){"use strict";function t(t){return t
|
|
2
|
+
var s=function(){"use strict";return function(){var t=function(t,r,n){return(e=function(r){var n=void 0===r?[]:r,e=n[0],o=n[1];e=e||t.documentElement;var i={value:"translate("+-o.x+"px, "+-o.y+"px)",important:!0};return function(t){var r=void 0===t?[]:t,n=r[0],e=r[1],o=Object.keys(e).sort();o.reduce((function(t,r){return t[r]={value:n.style.getPropertyValue(r),important:Boolean(n.style.getPropertyPriority(r))},t}),{});o.forEach((function(t){n.style.setProperty(t,"string"!=typeof e[t]&&e[t]?e[t].value:e[t],e[t]&&e[t].important?"important":"")}))}([e,{transform:i,"-webkit-transform":i}]),o})&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var e},r=!0;try{var n=function t(r){if(c.Array.isArray(r)){for(var n=new c.Array(r.length),e=0;e<r.length;e++)n[e]=t(r[e]);return n}if(r&&"object"==typeof r&&Object.getPrototypeOf(r)===Object.prototype){var o=new c.Object;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=t(r[i]));return o}return r},e=window.__applitools_sandbox;e||((e=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e),window.__applitools_sandbox=e);var o=Math.floor(4294967296*Math.random()),i=e.contentDocument.createElement("script");i.textContent="window['ctor-"+o+"'] = "+t.toString()+";",e.contentDocument.head.appendChild(i);var a=e.contentWindow["ctor-"+o];if(delete e.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");r=!1;var c=e.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var l=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};l._stringify&&l._stringify!==JSON.stringify||(l._stringify=c.JSON.stringify.bind(c.JSON));for(var p=new c.Array(arguments.length),u=0;u<arguments.length;u++)p[u]=n(u<0||arguments.length<=u?void 0:arguments[u]);return a(document,window,c).apply(void 0,p)}catch(n){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw r?t:n}}}}();
|
|
3
3
|
return s(arg)
|
|
4
4
|
}
|
|
5
5
|
exports.setElementStyleProperties=function(arg){
|
|
6
|
-
var s=function(){"use strict";function
|
|
6
|
+
var s=function(){"use strict";return function(){var t=function(t,r,n){return(e=function(t){var r=void 0===t?[]:t,n=r[0],e=r[1],o=Object.keys(e).sort(),i=o.reduce((function(t,r){return t[r]={value:n.style.getPropertyValue(r),important:Boolean(n.style.getPropertyPriority(r))},t}),{});return o.forEach((function(t){n.style.setProperty(t,"string"!=typeof e[t]&&e[t]?e[t].value:e[t],e[t]&&e[t].important?"important":"")})),i})&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var e},r=!0;try{var n=function t(r){if(c.Array.isArray(r)){for(var n=new c.Array(r.length),e=0;e<r.length;e++)n[e]=t(r[e]);return n}if(r&&"object"==typeof r&&Object.getPrototypeOf(r)===Object.prototype){var o=new c.Object;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=t(r[i]));return o}return r},e=window.__applitools_sandbox;e||((e=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e),window.__applitools_sandbox=e);var o=Math.floor(4294967296*Math.random()),i=e.contentDocument.createElement("script");i.textContent="window['ctor-"+o+"'] = "+t.toString()+";",e.contentDocument.head.appendChild(i);var a=e.contentWindow["ctor-"+o];if(delete e.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");r=!1;var c=e.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=c.JSON.stringify.bind(c.JSON));for(var l=new c.Array(arguments.length),p=0;p<arguments.length;p++)l[p]=n(p<0||arguments.length<=p?void 0:arguments[p]);return a(document,window,c).apply(void 0,l)}catch(n){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw r?t:n}}}}();
|
|
7
7
|
return s(arg)
|
|
8
8
|
}
|
|
9
9
|
exports.setElementAttributes=function(arg){
|
|
10
|
-
var s=function(){"use strict";function
|
|
10
|
+
var s=function(){"use strict";return function(){var t=function(t,n,r){return(e=function(t){var n=void 0===t?[]:t,r=n[0],e=n[1];return Object.keys(e).reduce((function(t,n){return t[n]=r.getAttribute(n),r.setAttribute(n,e[n]),t}),{})})&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var e},n=!0;try{var r=function t(n){if(c.Array.isArray(n)){for(var r=new c.Array(n.length),e=0;e<n.length;e++)r[e]=t(n[e]);return r}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var o=new c.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(o[i]=t(n[i]));return o}return n},e=window.__applitools_sandbox;e||((e=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e),window.__applitools_sandbox=e);var o=Math.floor(4294967296*Math.random()),i=e.contentDocument.createElement("script");i.textContent="window['ctor-"+o+"'] = "+t.toString()+";",e.contentDocument.head.appendChild(i);var a=e.contentWindow["ctor-"+o];if(delete e.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var c=e.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=c.JSON.stringify.bind(c.JSON));for(var u=new c.Array(arguments.length),f=0;f<arguments.length;f++)u[f]=r(f<0||arguments.length<=f?void 0:arguments[f]);return a(document,window,c).apply(void 0,u)}catch(r){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:r}}}}();
|
|
11
11
|
return s(arg)
|
|
12
12
|
}
|
|
13
13
|
exports.scrollTo=function(arg){
|
|
14
|
-
var s=function(){"use strict";function
|
|
14
|
+
var s=function(){"use strict";return function(){var t=function(t,r,o){return n=function(t){var r=void 0===t?[]:t,o=r[0],e=r[1],n=Object.keys(e).sort(),i=n.reduce((function(t,r){return t[r]={value:o.style.getPropertyValue(r),important:Boolean(o.style.getPropertyPriority(r))},t}),{});return n.forEach((function(t){o.style.setProperty(t,"string"!=typeof e[t]&&e[t]?e[t].value:e[t],e[t]&&e[t].important?"important":"")})),i},(e=function(r){var o=void 0===r?[]:r,e=o[0],i=o[1];e=e||t.documentElement;var a=n([e,{"scroll-behavior":{value:"auto",important:!0}}]);return e.scrollTo?e.scrollTo(i.x,i.y):(e.scrollLeft=i.x,e.scrollTop=i.y),n([e,a]),{x:e.scrollLeft,y:e.scrollTop}})&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var e,n},r=!0;try{var o=function t(r){if(c.Array.isArray(r)){for(var o=new c.Array(r.length),e=0;e<r.length;e++)o[e]=t(r[e]);return o}if(r&&"object"==typeof r&&Object.getPrototypeOf(r)===Object.prototype){var n=new c.Object;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=t(r[i]));return n}return r},e=window.__applitools_sandbox;e||((e=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e),window.__applitools_sandbox=e);var n=Math.floor(4294967296*Math.random()),i=e.contentDocument.createElement("script");i.textContent="window['ctor-"+n+"'] = "+t.toString()+";",e.contentDocument.head.appendChild(i);var a=e.contentWindow["ctor-"+n];if(delete e.contentWindow["ctor-"+n],"function"!=typeof a)throw new Error("Sandbox failed to extract function");r=!1;var c=e.contentWindow,l=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};l._stringify||(l._stringify=c.JSON.stringify.bind(c.JSON));var d=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};d._stringify&&d._stringify!==JSON.stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));for(var s=new c.Array(arguments.length),p=0;p<arguments.length;p++)s[p]=o(p<0||arguments.length<=p?void 0:arguments[p]);return a(document,window,c).apply(void 0,s)}catch(o){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw r?t:o}}}}();
|
|
15
15
|
return s(arg)
|
|
16
16
|
}
|
|
17
17
|
exports.reloadPage=function(arg){
|
|
18
|
-
var s=function(){"use strict";function t(t){return
|
|
18
|
+
var s=function(){"use strict";return function(){var t=function(t,n,o){return(r=function(){n.location.reload()})&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var r},n=!0;try{var o=function t(n){if(c.Array.isArray(n)){for(var o=new c.Array(n.length),r=0;r<n.length;r++)o[r]=t(n[r]);return o}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var e=new c.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=t(n[i]));return e}return n},r=window.__applitools_sandbox;r||((r=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),r.setAttribute("data-applitools-skip",""),document.head.appendChild(r),window.__applitools_sandbox=r);var e=Math.floor(4294967296*Math.random()),i=r.contentDocument.createElement("script");i.textContent="window['ctor-"+e+"'] = "+t.toString()+";",r.contentDocument.head.appendChild(i);var a=r.contentWindow["ctor-"+e];if(delete r.contentWindow["ctor-"+e],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var c=r.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=c.JSON.stringify.bind(c.JSON));for(var l=new c.Array(arguments.length),f=0;f<arguments.length;f++)l[f]=o(f<0||arguments.length<=f?void 0:arguments[f]);return a(document,window,c).apply(void 0,l)}catch(o){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:o}}}}();
|
|
19
19
|
return s(arg)
|
|
20
20
|
}
|
|
21
21
|
exports.lazyLoad=function(arg){
|
|
22
|
-
var s=function(){"use strict";function
|
|
22
|
+
var s=function(){"use strict";return function(){var t=function(t,r,o){return function(){var o=function(t){var r=void 0===t?[]:t,o=r[0],n=r[1],e=Object.keys(n).sort(),i=e.reduce((function(t,r){return t[r]={value:o.style.getPropertyValue(r),important:Boolean(o.style.getPropertyPriority(r))},t}),{});return e.forEach((function(t){o.style.setProperty(t,"string"!=typeof n[t]&&n[t]?n[t].value:n[t],n[t]&&n[t].important?"important":"")})),i},n="__EYES__APPLITOOLS__",e="lazyLoadResult";r[n]=r[n]||{};var i=function(t){var o=(void 0===t?[]:t)[0];return o?{x:o.scrollLeft,y:o.scrollTop}:{x:r.scrollX||r.pageXOffset,y:r.scrollY||r.pageYOffset}},a=function(r){var n=void 0===r?[]:r,e=n[0],i=n[1];e=e||t.documentElement;var a=o([e,{"scroll-behavior":{value:"auto",important:!0}}]);return e.scrollTo?e.scrollTo(i.x,i.y):(e.scrollLeft=i.x,e.scrollTop=i.y),o([e,a]),{x:e.scrollLeft,y:e.scrollTop}};return function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(t){var o=void 0===t?[]:t,l=o[0],c=o[1],s=void 0===c?{}:c,u=s.scrollLength,y=s.waitingTime,d=s.maxAmountToScroll;try{if(r[n][e]){var f=r[n][e];return"WIP"!==f.status&&delete r[n][e],JSON.stringify(f)}r[n][e]={status:"WIP"};var p=i(),_=[];_.push({maxAmountToScroll:d,scrollLength:u,waitingTime:y,startingScrollPositionX:p.x,startingScrollPositionY:p.y});var v=Date.now();return function t(o){var i=void 0===o?{}:o,c=i.doneScrolling,s=i.previousScrollResult,f=void 0===s?{}:s;setTimeout((function(){try{if(c){var o=a([l,p]),i=o.x,s=o.y;return _.push({x:i,y:s,msSinceStart:Date.now()-v}),void(r[n][e]={status:"SUCCESS",value:_})}var y=a([l,{x:p.x,y:f.y+u}]),S=y.x,w=y.y;_.push({x:S,y:w,msSinceStart:Date.now()-v}),t({doneScrolling:w===f.y||w===d,previousScrollResult:{x:S,y:w}})}catch(t){r[n][e]={status:"ERROR",error:t}}}),y)}(),JSON.stringify(r[n][e])}catch(t){return r[n][e]={status:"ERROR",error:t},JSON.stringify(r[n][e])}}))}()},r=!0;try{var o=function t(r){if(l.Array.isArray(r)){for(var o=new l.Array(r.length),n=0;n<r.length;n++)o[n]=t(r[n]);return o}if(r&&"object"==typeof r&&Object.getPrototypeOf(r)===Object.prototype){var e=new l.Object;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=t(r[i]));return e}return r},n=window.__applitools_sandbox;n||((n=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n),window.__applitools_sandbox=n);var e=Math.floor(4294967296*Math.random()),i=n.contentDocument.createElement("script");i.textContent="window['ctor-"+e+"'] = "+t.toString()+";",n.contentDocument.head.appendChild(i);var a=n.contentWindow["ctor-"+e];if(delete n.contentWindow["ctor-"+e],"function"!=typeof a)throw new Error("Sandbox failed to extract function");r=!1;var l=n.contentWindow,c=l.__EYES__APPLITOOLS__=l.__EYES__APPLITOOLS__||{};c._stringify||(c._stringify=l.JSON.stringify.bind(l.JSON));var s=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};s._stringify&&s._stringify!==JSON.stringify||(s._stringify=l.JSON.stringify.bind(l.JSON));for(var u=new l.Array(arguments.length),y=0;y<arguments.length;y++)u[y]=o(y<0||arguments.length<=y?void 0:arguments[y]);return a(document,window,l).apply(void 0,u)}catch(o){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw r?t:o}}}}();
|
|
23
23
|
return s(arg)
|
|
24
24
|
}
|
|
25
25
|
exports.isStaleElement=function(arg){
|
|
26
|
-
var s=function(){"use strict";function
|
|
26
|
+
var s=function(){"use strict";return function(){var t=function(t,n,e){return(o=function(e){var o=e&&e[0]||null;return!(o&&("isConnected"in n.Node.prototype?o.isConnected:t.documentElement.contains?t.documentElement.contains(o):o.ownerDocument.documentElement.contains(o)))})&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var o},n=!0;try{var e=function t(n){if(c.Array.isArray(n)){for(var e=new c.Array(n.length),o=0;o<n.length;o++)e[o]=t(n[o]);return e}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var r=new c.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=t(n[i]));return r}return n},o=window.__applitools_sandbox;o||((o=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),o.setAttribute("data-applitools-skip",""),document.head.appendChild(o),window.__applitools_sandbox=o);var r=Math.floor(4294967296*Math.random()),i=o.contentDocument.createElement("script");i.textContent="window['ctor-"+r+"'] = "+t.toString()+";",o.contentDocument.head.appendChild(i);var a=o.contentWindow["ctor-"+r];if(delete o.contentWindow["ctor-"+r],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var c=o.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=c.JSON.stringify.bind(c.JSON));for(var l=new c.Array(arguments.length),u=0;u<arguments.length;u++)l[u]=e(u<0||arguments.length<=u?void 0:arguments[u]);return a(document,window,c).apply(void 0,l)}catch(e){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:e}}}}();
|
|
27
27
|
return s(arg)
|
|
28
28
|
}
|
|
29
29
|
exports.isEqualElements=function(arg){
|
|
30
|
-
var s=function(){"use strict";function t(t){return t&&
|
|
30
|
+
var s=function(){"use strict";return function(){var t=function(t,n,r){return(o=function(t){var n=void 0===t?[]:t;return n[0]===n[1]})&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var o},n=!0;try{var r=function t(n){if(d.Array.isArray(n)){for(var r=new d.Array(n.length),o=0;o<n.length;o++)r[o]=t(n[o]);return r}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var e=new d.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=t(n[i]));return e}return n},o=window.__applitools_sandbox;o||((o=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),o.setAttribute("data-applitools-skip",""),document.head.appendChild(o),window.__applitools_sandbox=o);var e=Math.floor(4294967296*Math.random()),i=o.contentDocument.createElement("script");i.textContent="window['ctor-"+e+"'] = "+t.toString()+";",o.contentDocument.head.appendChild(i);var a=o.contentWindow["ctor-"+e];if(delete o.contentWindow["ctor-"+e],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var d=o.contentWindow,c=d.__EYES__APPLITOOLS__=d.__EYES__APPLITOOLS__||{};c._stringify||(c._stringify=d.JSON.stringify.bind(d.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=d.JSON.stringify.bind(d.JSON));for(var f=new d.Array(arguments.length),l=0;l<arguments.length;l++)f[l]=r(l<0||arguments.length<=l?void 0:arguments[l]);return a(document,window,d).apply(void 0,f)}catch(r){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:r}}}}();
|
|
31
31
|
return s(arg)
|
|
32
32
|
}
|
|
33
33
|
exports.isElementScrollable=function(arg){
|
|
34
|
-
var s=function(){"use strict";function t(t){return
|
|
34
|
+
var s=function(){"use strict";return function(){var t=function(t,n,o){return(r=function(t){var o=(void 0===t?[]:t)[0],r=function(t){var o=void 0===t?[]:t,r=o[0],e=o[1],i=void 0===e?[]:e,a=n.getComputedStyle(r);return a?i.map((function(t){return a.getPropertyValue(t)})):[]}([o,["overflow-x","overflow-y","overflow"]]);return("scroll"===r[0]||"auto"===r[0]||"hidden"===r[2])&&o.scrollWidth>o.clientWidth||("scroll"===r[1]||"auto"===r[1]||"hidden"===r[2])&&o.scrollHeight>o.clientHeight})&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var r},n=!0;try{var o=function t(n){if(d.Array.isArray(n)){for(var o=new d.Array(n.length),r=0;r<n.length;r++)o[r]=t(n[r]);return o}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var e=new d.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=t(n[i]));return e}return n},r=window.__applitools_sandbox;r||((r=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),r.setAttribute("data-applitools-skip",""),document.head.appendChild(r),window.__applitools_sandbox=r);var e=Math.floor(4294967296*Math.random()),i=r.contentDocument.createElement("script");i.textContent="window['ctor-"+e+"'] = "+t.toString()+";",r.contentDocument.head.appendChild(i);var a=r.contentWindow["ctor-"+e];if(delete r.contentWindow["ctor-"+e],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var d=r.contentWindow,c=d.__EYES__APPLITOOLS__=d.__EYES__APPLITOOLS__||{};c._stringify||(c._stringify=d.JSON.stringify.bind(d.JSON));var l=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};l._stringify&&l._stringify!==JSON.stringify||(l._stringify=d.JSON.stringify.bind(d.JSON));for(var _=new d.Array(arguments.length),u=0;u<arguments.length;u++)_[u]=o(u<0||arguments.length<=u?void 0:arguments[u]);return a(document,window,d).apply(void 0,_)}catch(o){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:o}}}}();
|
|
35
35
|
return s(arg)
|
|
36
36
|
}
|
|
37
37
|
exports.getViewport=function(arg){
|
|
38
|
-
var s=function(){"use strict";function
|
|
38
|
+
var s=function(){"use strict";return function(){var t=function(t,e,n){return(i=function(){var n,i=0,o=0;return e.innerHeight?o=e.innerHeight:t.documentElement&&t.documentElement.clientHeight?o=t.documentElement.clientHeight:t.body&&t.body.clientHeight&&(o=t.body.clientHeight),e.innerWidth?i=e.innerWidth:t.documentElement&&t.documentElement.clientWidth?i=t.documentElement.clientWidth:t.body&&t.body.clientWidth&&(i=t.body.clientWidth),e.screen&&e.screen.orientation?n=e.screen.orientation.type.replace(/-primary$/,""):null!=e.orientation&&(0===e.orientation?n="portrait":180===e.orientation?n="portrait-secondary":90===e.orientation?n="landscape":-90===e.orientation&&(n="landscape-secondary")),{viewportSize:{width:i,height:o},pixelRatio:e.devicePixelRatio,viewportScale:e.visualViewport&&e.visualViewport.scale,orientation:n}})&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i;var i},e=!0;try{var n=function t(e){if(c.Array.isArray(e)){for(var n=new c.Array(e.length),i=0;i<e.length;i++)n[i]=t(e[i]);return n}if(e&&"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype){var o=new c.Object;for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(o[r]=t(e[r]));return o}return e},i=window.__applitools_sandbox;i||((i=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),i.setAttribute("data-applitools-skip",""),document.head.appendChild(i),window.__applitools_sandbox=i);var o=Math.floor(4294967296*Math.random()),r=i.contentDocument.createElement("script");r.textContent="window['ctor-"+o+"'] = "+t.toString()+";",i.contentDocument.head.appendChild(r);var a=i.contentWindow["ctor-"+o];if(delete i.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");e=!1;var c=i.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var l=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};l._stringify&&l._stringify!==JSON.stringify||(l._stringify=c.JSON.stringify.bind(c.JSON));for(var p=new c.Array(arguments.length),_=0;_<arguments.length;_++)p[_]=n(_<0||arguments.length<=_?void 0:arguments[_]);return a(document,window,c).apply(void 0,p)}catch(n){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw e?t:n}}}}();
|
|
39
39
|
return s(arg)
|
|
40
40
|
}
|
|
41
41
|
exports.getUserAgent=function(arg){
|
|
42
|
-
var s=function(){"use strict";
|
|
42
|
+
var s=function(){"use strict";return function(){var t=function(t,r,n){return a="userAgent",r[o="__EYES__APPLITOOLS__"]=r[o]||{},(e=function(){try{if(r[o][a]){var t=r[o][a];return"WIP"!==t.status&&delete r[o][a],JSON.stringify(t)}return r.navigator.userAgentData?(r[o][a]={status:"WIP"},r.navigator.userAgentData.getHighEntropyValues(["brands","platform","platformVersion","model"]).then((function(t){r[o][a]={status:"SUCCESS",value:{legacy:r.navigator.userAgent,brands:t.brands,mobile:t.mobile,platform:t.platform,platformVersion:t.platformVersion,model:t.model}}})).catch((function(t){r[o][a]={status:"ERROR",error:t.message}}))):r[o][a]={status:"SUCCESS",value:r.navigator.userAgent},JSON.stringify(r[o][a])}catch(t){return r[o][a]={status:"ERROR",error:t.message},JSON.stringify(r[o][a])}})&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var e,o,a},r=!0;try{var n=function t(r){if(s.Array.isArray(r)){for(var n=new s.Array(r.length),e=0;e<r.length;e++)n[e]=t(r[e]);return n}if(r&&"object"==typeof r&&Object.getPrototypeOf(r)===Object.prototype){var o=new s.Object;for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(o[a]=t(r[a]));return o}return r},e=window.__applitools_sandbox;e||((e=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e),window.__applitools_sandbox=e);var o=Math.floor(4294967296*Math.random()),a=e.contentDocument.createElement("script");a.textContent="window['ctor-"+o+"'] = "+t.toString()+";",e.contentDocument.head.appendChild(a);var i=e.contentWindow["ctor-"+o];if(delete e.contentWindow["ctor-"+o],"function"!=typeof i)throw new Error("Sandbox failed to extract function");r=!1;var s=e.contentWindow,c=s.__EYES__APPLITOOLS__=s.__EYES__APPLITOOLS__||{};c._stringify||(c._stringify=s.JSON.stringify.bind(s.JSON));var d=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};d._stringify&&d._stringify!==JSON.stringify||(d._stringify=s.JSON.stringify.bind(s.JSON));for(var l=new s.Array(arguments.length),u=0;u<arguments.length;u++)l[u]=n(u<0||arguments.length<=u?void 0:arguments[u]);return i(document,window,s).apply(void 0,l)}catch(n){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw r?t:n}}}}();
|
|
43
43
|
return s(arg)
|
|
44
44
|
}
|
|
45
45
|
exports.getText=function(arg){
|
|
46
|
-
var s=function(){"use strict";function t(t){return t&&
|
|
46
|
+
var s=function(){"use strict";return function(){var t=function(t,n,r){return(e=function(t){return t[0].innerText})&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var e},n=!0;try{var r=function t(n){if(c.Array.isArray(n)){for(var r=new c.Array(n.length),e=0;e<n.length;e++)r[e]=t(n[e]);return r}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var o=new c.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(o[i]=t(n[i]));return o}return n},e=window.__applitools_sandbox;e||((e=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e),window.__applitools_sandbox=e);var o=Math.floor(4294967296*Math.random()),i=e.contentDocument.createElement("script");i.textContent="window['ctor-"+o+"'] = "+t.toString()+";",e.contentDocument.head.appendChild(i);var a=e.contentWindow["ctor-"+o];if(delete e.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var c=e.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=c.JSON.stringify.bind(c.JSON));for(var f=new c.Array(arguments.length),l=0;l<arguments.length;l++)f[l]=r(l<0||arguments.length<=l?void 0:arguments[l]);return a(document,window,c).apply(void 0,f)}catch(r){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:r}}}}();
|
|
47
47
|
return s(arg)
|
|
48
48
|
}
|
|
49
49
|
exports.getShadowRoot=function(arg){
|
|
50
|
-
var s=function(){"use strict";function t(t){return t
|
|
50
|
+
var s=function(){"use strict";return function(){var t=function(t,n,o){return(r=function(t){return(void 0===t?[]:t)[0].shadowRoot})&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var r},n=!0;try{var o=function t(n){if(d.Array.isArray(n)){for(var o=new d.Array(n.length),r=0;r<n.length;r++)o[r]=t(n[r]);return o}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var e=new d.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=t(n[i]));return e}return n},r=window.__applitools_sandbox;r||((r=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),r.setAttribute("data-applitools-skip",""),document.head.appendChild(r),window.__applitools_sandbox=r);var e=Math.floor(4294967296*Math.random()),i=r.contentDocument.createElement("script");i.textContent="window['ctor-"+e+"'] = "+t.toString()+";",r.contentDocument.head.appendChild(i);var a=r.contentWindow["ctor-"+e];if(delete r.contentWindow["ctor-"+e],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var d=r.contentWindow,c=d.__EYES__APPLITOOLS__=d.__EYES__APPLITOOLS__||{};c._stringify||(c._stringify=d.JSON.stringify.bind(d.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=d.JSON.stringify.bind(d.JSON));for(var f=new d.Array(arguments.length),l=0;l<arguments.length;l++)f[l]=o(l<0||arguments.length<=l?void 0:arguments[l]);return a(document,window,d).apply(void 0,f)}catch(o){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:o}}}}();
|
|
51
51
|
return s(arg)
|
|
52
52
|
}
|
|
53
53
|
exports.getElementXpath=function(arg){
|
|
54
|
-
var s=function(){"use strict";function
|
|
54
|
+
var s=function(){"use strict";return function(){var t=function(t,n,r){return(e=function(t){var n=(void 0===t?[]:t)[0],r="",e=n.ownerDocument;if(!e)return r;for(var o=n;o!==e;){var i=Array.prototype.filter.call(o.parentNode.childNodes,(function(t){return t.tagName===o.tagName})).indexOf(o);r="/"+o.tagName+"["+(i+1)+"]"+r,o=o.parentNode}return r})&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var e},n=!0;try{var r=function t(n){if(d.Array.isArray(n)){for(var r=new d.Array(n.length),e=0;e<n.length;e++)r[e]=t(n[e]);return r}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var o=new d.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(o[i]=t(n[i]));return o}return n},e=window.__applitools_sandbox;e||((e=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e),window.__applitools_sandbox=e);var o=Math.floor(4294967296*Math.random()),i=e.contentDocument.createElement("script");i.textContent="window['ctor-"+o+"'] = "+t.toString()+";",e.contentDocument.head.appendChild(i);var a=e.contentWindow["ctor-"+o];if(delete e.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var d=e.contentWindow,c=d.__EYES__APPLITOOLS__=d.__EYES__APPLITOOLS__||{};c._stringify||(c._stringify=d.JSON.stringify.bind(d.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=d.JSON.stringify.bind(d.JSON));for(var f=new d.Array(arguments.length),l=0;l<arguments.length;l++)f[l]=r(l<0||arguments.length<=l?void 0:arguments[l]);return a(document,window,d).apply(void 0,f)}catch(r){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:r}}}}();
|
|
55
55
|
return s(arg)
|
|
56
56
|
}
|
|
57
57
|
exports.getElementTranslateOffset=function(arg){
|
|
58
|
-
var s=function(){"use strict";function
|
|
58
|
+
var s=function(){"use strict";return function(){var t=function(t,r,n){return(e=function(r){var n=(void 0===r?[]:r)[0],e=function(t){var r=void 0===t?[]:t,n=r[0],e=r[1];return(void 0===e?[]:e).reduce((function(t,r){return t[r]={value:n.style.getPropertyValue(r),important:Boolean(n.style.getPropertyPriority(r))},t}),{})}([void 0===n?t.documentElement:n,["transform","-webkit-transform"]]),o=Object.keys(e).reduce((function(t,r){var n=e[r].value;if(n){var o=n.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(!o.every((function(t){return o[0].x===t.x||o[0].y===t.y})))throw new Error("Got different css positions!");return o[0]||{x:0,y:0}})&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var e},r=!0;try{var n=function t(r){if(d.Array.isArray(r)){for(var n=new d.Array(r.length),e=0;e<r.length;e++)n[e]=t(r[e]);return n}if(r&&"object"==typeof r&&Object.getPrototypeOf(r)===Object.prototype){var o=new d.Object;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=t(r[i]));return o}return r},e=window.__applitools_sandbox;e||((e=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e),window.__applitools_sandbox=e);var o=Math.floor(4294967296*Math.random()),i=e.contentDocument.createElement("script");i.textContent="window['ctor-"+o+"'] = "+t.toString()+";",e.contentDocument.head.appendChild(i);var a=e.contentWindow["ctor-"+o];if(delete e.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");r=!1;var d=e.contentWindow,c=d.__EYES__APPLITOOLS__=d.__EYES__APPLITOOLS__||{};c._stringify||(c._stringify=d.JSON.stringify.bind(d.JSON));var s=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};s._stringify&&s._stringify!==JSON.stringify||(s._stringify=d.JSON.stringify.bind(d.JSON));for(var u=new d.Array(arguments.length),f=0;f<arguments.length;f++)u[f]=n(f<0||arguments.length<=f?void 0:arguments[f]);return a(document,window,d).apply(void 0,u)}catch(n){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw r?t:n}}}}();
|
|
59
59
|
return s(arg)
|
|
60
60
|
}
|
|
61
61
|
exports.getElementStyleProperties=function(arg){
|
|
62
|
-
var s=function(){"use strict";function
|
|
62
|
+
var s=function(){"use strict";return function(){var t=function(t,n,r){return(e=function(t){var n=void 0===t?[]:t,r=n[0],e=n[1];return(void 0===e?[]:e).reduce((function(t,n){return t[n]={value:r.style.getPropertyValue(n),important:Boolean(r.style.getPropertyPriority(n))},t}),{})})&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var e},n=!0;try{var r=function t(n){if(d.Array.isArray(n)){for(var r=new d.Array(n.length),e=0;e<n.length;e++)r[e]=t(n[e]);return r}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var o=new d.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(o[i]=t(n[i]));return o}return n},e=window.__applitools_sandbox;e||((e=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e),window.__applitools_sandbox=e);var o=Math.floor(4294967296*Math.random()),i=e.contentDocument.createElement("script");i.textContent="window['ctor-"+o+"'] = "+t.toString()+";",e.contentDocument.head.appendChild(i);var a=e.contentWindow["ctor-"+o];if(delete e.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var d=e.contentWindow,c=d.__EYES__APPLITOOLS__=d.__EYES__APPLITOOLS__||{};c._stringify||(c._stringify=d.JSON.stringify.bind(d.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=d.JSON.stringify.bind(d.JSON));for(var l=new d.Array(arguments.length),p=0;p<arguments.length;p++)l[p]=r(p<0||arguments.length<=p?void 0:arguments[p]);return a(document,window,d).apply(void 0,l)}catch(r){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:r}}}}();
|
|
63
63
|
return s(arg)
|
|
64
64
|
}
|
|
65
65
|
exports.getElementScrollOffset=function(arg){
|
|
66
|
-
var s=function(){"use strict";function o(
|
|
66
|
+
var s=function(){"use strict";return function(){var t=function(t,n,r){return(o=function(t){var r=(void 0===t?[]:t)[0];return r?{x:r.scrollLeft,y:r.scrollTop}:{x:n.scrollX||n.pageXOffset,y:n.scrollY||n.pageYOffset}})&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var o},n=!0;try{var r=function t(n){if(c.Array.isArray(n)){for(var r=new c.Array(n.length),o=0;o<n.length;o++)r[o]=t(n[o]);return r}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var e=new c.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=t(n[i]));return e}return n},o=window.__applitools_sandbox;o||((o=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),o.setAttribute("data-applitools-skip",""),document.head.appendChild(o),window.__applitools_sandbox=o);var e=Math.floor(4294967296*Math.random()),i=o.contentDocument.createElement("script");i.textContent="window['ctor-"+e+"'] = "+t.toString()+";",o.contentDocument.head.appendChild(i);var a=o.contentWindow["ctor-"+e];if(delete o.contentWindow["ctor-"+e],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var c=o.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var l=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};l._stringify&&l._stringify!==JSON.stringify||(l._stringify=c.JSON.stringify.bind(c.JSON));for(var _=new c.Array(arguments.length),f=0;f<arguments.length;f++)_[f]=r(f<0||arguments.length<=f?void 0:arguments[f]);return a(document,window,c).apply(void 0,_)}catch(r){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:r}}}}();
|
|
67
67
|
return s(arg)
|
|
68
68
|
}
|
|
69
69
|
exports.getElementRect=function(arg){
|
|
70
|
-
var s=function(){"use strict";function t(t){return
|
|
70
|
+
var s=function(){"use strict";return function(){var t=function(t,e,r){return function(){var r=function(e){var r=(void 0===e?[]:e)[0],n=void 0===r?t.documentElement:r,o=function(t){var e=void 0===t?[]:t,r=e[0],n=e[1];return(void 0===n?[]:n).reduce((function(t,e){return t[e]={value:r.style.getPropertyValue(e),important:Boolean(r.style.getPropertyPriority(e))},t}),{})}([n,["transform","-webkit-transform"]]),i=Object.keys(o).reduce((function(t,e){var r=o[e].value;if(r){var n=r.match(/^translate\s*\(\s*(\-?[\d, \.]+)px\s*(,\s*(-?[\d, \.]+)px)?\s*\)/);if(n){var i=n[1],a=void 0!==n[3]?n[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}},n=function(t){var n=(void 0===t?[]:t)[0],o=function(t){var r=(void 0===t?[]:t)[0];return r?{x:r.scrollLeft,y:r.scrollTop}:{x:e.scrollX||e.pageXOffset,y:e.scrollY||e.pageYOffset}}([n]),i=r([n]);return{x:o.x+i.x,y:o.y+i.y}};return function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(r){var o=void 0===r?[]:r,i=o[0],a=o[1],d=void 0!==a&&a;if(i===t.documentElement||i.tagName.toLowerCase()===function(){var e="HTML",r=t.scrollingElement;return r&&(e=r.tagName),e.toLowerCase()}())return{x:0,y:0,width:i.clientWidth,height:i.clientHeight};var u=i.getBoundingClientRect(),f={x:u.left,y:u.top,width:u.width,height:u.height};if(d){var l=e.getComputedStyle(i);f.x+=parseInt(l.getPropertyValue("border-left-width")),f.y+=parseInt(l.getPropertyValue("border-top-width")),f.width=i.clientWidth,f.height=i.clientHeight}var c=function(r){for(var n=(void 0===r?[]:r)[0];n.offsetParent&&n.offsetParent!==t.body&&n.offsetParent!==t.documentElement;)n=n.offsetParent;return"fixed"===e.getComputedStyle(n).getPropertyValue("position")?n:null}([i]);if(c){if(c!==i){var s=n([c]);f.x+=s.x,f.y+=s.y}}else{var y=n();f.x+=y.x,f.y+=y.y}return f}))}()},e=!0;try{var r=function t(e){if(d.Array.isArray(e)){for(var r=new d.Array(e.length),n=0;n<e.length;n++)r[n]=t(e[n]);return r}if(e&&"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype){var o=new d.Object;for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=t(e[i]));return o}return e},n=window.__applitools_sandbox;n||((n=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n),window.__applitools_sandbox=n);var o=Math.floor(4294967296*Math.random()),i=n.contentDocument.createElement("script");i.textContent="window['ctor-"+o+"'] = "+t.toString()+";",n.contentDocument.head.appendChild(i);var a=n.contentWindow["ctor-"+o];if(delete n.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");e=!1;var d=n.contentWindow,u=d.__EYES__APPLITOOLS__=d.__EYES__APPLITOOLS__||{};u._stringify||(u._stringify=d.JSON.stringify.bind(d.JSON));var f=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};f._stringify&&f._stringify!==JSON.stringify||(f._stringify=d.JSON.stringify.bind(d.JSON));for(var l=new d.Array(arguments.length),c=0;c<arguments.length;c++)l[c]=r(c<0||arguments.length<=c?void 0:arguments[c]);return a(document,window,d).apply(void 0,l)}catch(r){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw e?t:r}}}}();
|
|
71
71
|
return s(arg)
|
|
72
72
|
}
|
|
73
73
|
exports.getElementProperties=function(arg){
|
|
74
|
-
var s=function(){"use strict";function t(t){return t
|
|
74
|
+
var s=function(){"use strict";return function(){var t=function(t,n,r){return(o=function(t){var n=void 0===t?[]:t,r=n[0],o=n[1];return(void 0===o?[]:o).reduce((function(t,n){return t[n]=r[n],t}),{})})&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var o},n=!0;try{var r=function t(n){if(d.Array.isArray(n)){for(var r=new d.Array(n.length),o=0;o<n.length;o++)r[o]=t(n[o]);return r}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var e=new d.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=t(n[i]));return e}return n},o=window.__applitools_sandbox;o||((o=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),o.setAttribute("data-applitools-skip",""),document.head.appendChild(o),window.__applitools_sandbox=o);var e=Math.floor(4294967296*Math.random()),i=o.contentDocument.createElement("script");i.textContent="window['ctor-"+e+"'] = "+t.toString()+";",o.contentDocument.head.appendChild(i);var a=o.contentWindow["ctor-"+e];if(delete o.contentWindow["ctor-"+e],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var d=o.contentWindow,c=d.__EYES__APPLITOOLS__=d.__EYES__APPLITOOLS__||{};c._stringify||(c._stringify=d.JSON.stringify.bind(d.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=d.JSON.stringify.bind(d.JSON));for(var f=new d.Array(arguments.length),u=0;u<arguments.length;u++)f[u]=r(u<0||arguments.length<=u?void 0:arguments[u]);return a(document,window,d).apply(void 0,f)}catch(r){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:r}}}}();
|
|
75
75
|
return s(arg)
|
|
76
76
|
}
|
|
77
77
|
exports.getElementInnerOffset=function(arg){
|
|
78
|
-
var s=function(){"use strict";function
|
|
78
|
+
var s=function(){"use strict";return function(){var t=function(t,r,e){return o=function(r){var e=(void 0===r?[]:r)[0],n=void 0===e?t.documentElement:e,o=function(t){var r=void 0===t?[]:t,e=r[0],n=r[1];return(void 0===n?[]:n).reduce((function(t,r){return t[r]={value:e.style.getPropertyValue(r),important:Boolean(e.style.getPropertyPriority(r))},t}),{})}([n,["transform","-webkit-transform"]]),i=Object.keys(o).reduce((function(t,r){var e=o[r].value;if(e){var n=e.match(/^translate\s*\(\s*(\-?[\d, \.]+)px\s*(,\s*(-?[\d, \.]+)px)?\s*\)/);if(n){var i=n[1],a=void 0!==n[3]?n[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}},(n=function(t){var e=(void 0===t?[]:t)[0],n=function(t){var e=(void 0===t?[]:t)[0];return e?{x:e.scrollLeft,y:e.scrollTop}:{x:r.scrollX||r.pageXOffset,y:r.scrollY||r.pageYOffset}}([e]),i=o([e]);return{x:n.x+i.x,y:n.y+i.y}})&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;var n,o},r=!0;try{var e=function t(r){if(c.Array.isArray(r)){for(var e=new c.Array(r.length),n=0;n<r.length;n++)e[n]=t(r[n]);return e}if(r&&"object"==typeof r&&Object.getPrototypeOf(r)===Object.prototype){var o=new c.Object;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=t(r[i]));return o}return r},n=window.__applitools_sandbox;n||((n=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n),window.__applitools_sandbox=n);var o=Math.floor(4294967296*Math.random()),i=n.contentDocument.createElement("script");i.textContent="window['ctor-"+o+"'] = "+t.toString()+";",n.contentDocument.head.appendChild(i);var a=n.contentWindow["ctor-"+o];if(delete n.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");r=!1;var c=n.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var s=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};s._stringify&&s._stringify!==JSON.stringify||(s._stringify=c.JSON.stringify.bind(c.JSON));for(var u=new c.Array(arguments.length),l=0;l<arguments.length;l++)u[l]=e(l<0||arguments.length<=l?void 0:arguments[l]);return a(document,window,c).apply(void 0,u)}catch(e){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw r?t:e}}}}();
|
|
79
79
|
return s(arg)
|
|
80
80
|
}
|
|
81
81
|
exports.getElementFixedAncestor=function(arg){
|
|
82
|
-
var s=function(){"use strict";function t(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(
|
|
82
|
+
var s=function(){"use strict";return function(){var t=function(t,n,e){return(o=function(e){for(var o=(void 0===e?[]:e)[0];o.offsetParent&&o.offsetParent!==t.body&&o.offsetParent!==t.documentElement;)o=o.offsetParent;return"fixed"===n.getComputedStyle(o).getPropertyValue("position")?o:null})&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var o},n=!0;try{var e=function t(n){if(d.Array.isArray(n)){for(var e=new d.Array(n.length),o=0;o<n.length;o++)e[o]=t(n[o]);return e}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var r=new d.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=t(n[i]));return r}return n},o=window.__applitools_sandbox;o||((o=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),o.setAttribute("data-applitools-skip",""),document.head.appendChild(o),window.__applitools_sandbox=o);var r=Math.floor(4294967296*Math.random()),i=o.contentDocument.createElement("script");i.textContent="window['ctor-"+r+"'] = "+t.toString()+";",o.contentDocument.head.appendChild(i);var a=o.contentWindow["ctor-"+r];if(delete o.contentWindow["ctor-"+r],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var d=o.contentWindow,c=d.__EYES__APPLITOOLS__=d.__EYES__APPLITOOLS__||{};c._stringify||(c._stringify=d.JSON.stringify.bind(d.JSON));var f=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};f._stringify&&f._stringify!==JSON.stringify||(f._stringify=d.JSON.stringify.bind(d.JSON));for(var _=new d.Array(arguments.length),l=0;l<arguments.length;l++)_[l]=e(l<0||arguments.length<=l?void 0:arguments[l]);return a(document,window,d).apply(void 0,_)}catch(e){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:e}}}}();
|
|
83
83
|
return s(arg)
|
|
84
84
|
}
|
|
85
85
|
exports.getElementContentSize=function(arg){
|
|
86
|
-
var s=function(){"use strict";function
|
|
86
|
+
var s=function(){"use strict";return function(){var t=function(t,r,e){return o=function(t){var r=void 0===t?[]:t,e=r[0],n=r[1],o=Object.keys(n).sort(),i=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":"")})),i},(n=function(r){var e,n=(void 0===r?[]:r)[0];n!==t.documentElement&&n.tagName.toLowerCase()!==function(){var r="HTML",e=t.scrollingElement;return e&&(r=e.tagName),r.toLowerCase()}()||(e=o([n,{transform:"none"}]));var i={width:n.scrollWidth,height:n.scrollHeight};return e&&o([n,e]),i})&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;var n,o},r=!0;try{var e=function t(r){if(c.Array.isArray(r)){for(var e=new c.Array(r.length),n=0;n<r.length;n++)e[n]=t(r[n]);return e}if(r&&"object"==typeof r&&Object.getPrototypeOf(r)===Object.prototype){var o=new c.Object;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(o[i]=t(r[i]));return o}return r},n=window.__applitools_sandbox;n||((n=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n),window.__applitools_sandbox=n);var o=Math.floor(4294967296*Math.random()),i=n.contentDocument.createElement("script");i.textContent="window['ctor-"+o+"'] = "+t.toString()+";",n.contentDocument.head.appendChild(i);var a=n.contentWindow["ctor-"+o];if(delete n.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");r=!1;var c=n.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var l=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};l._stringify&&l._stringify!==JSON.stringify||(l._stringify=c.JSON.stringify.bind(c.JSON));for(var s=new c.Array(arguments.length),u=0;u<arguments.length;u++)s[u]=e(u<0||arguments.length<=u?void 0:arguments[u]);return a(document,window,c).apply(void 0,s)}catch(e){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw r?t:e}}}}();
|
|
87
87
|
return s(arg)
|
|
88
88
|
}
|
|
89
89
|
exports.getElementComputedStyleProperties=function(arg){
|
|
90
|
-
var s=function(){"use strict";function t(t){return t
|
|
90
|
+
var s=function(){"use strict";return function(){var t=function(t,n,r){return(e=function(t){var r=void 0===t?[]:t,e=r[0],o=r[1],i=void 0===o?[]:o,a=n.getComputedStyle(e);return a?i.map((function(t){return a.getPropertyValue(t)})):[]})&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var e},n=!0;try{var r=function t(n){if(d.Array.isArray(n)){for(var r=new d.Array(n.length),e=0;e<n.length;e++)r[e]=t(n[e]);return r}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var o=new d.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(o[i]=t(n[i]));return o}return n},e=window.__applitools_sandbox;e||((e=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e),window.__applitools_sandbox=e);var o=Math.floor(4294967296*Math.random()),i=e.contentDocument.createElement("script");i.textContent="window['ctor-"+o+"'] = "+t.toString()+";",e.contentDocument.head.appendChild(i);var a=e.contentWindow["ctor-"+o];if(delete e.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var d=e.contentWindow,c=d.__EYES__APPLITOOLS__=d.__EYES__APPLITOOLS__||{};c._stringify||(c._stringify=d.JSON.stringify.bind(d.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=d.JSON.stringify.bind(d.JSON));for(var p=new d.Array(arguments.length),l=0;l<arguments.length;l++)p[l]=r(l<0||arguments.length<=l?void 0:arguments[l]);return a(document,window,d).apply(void 0,p)}catch(r){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:r}}}}();
|
|
91
91
|
return s(arg)
|
|
92
92
|
}
|
|
93
93
|
exports.getDocumentSize=function(arg){
|
|
94
|
-
var s=function(){"use strict";function t(t){return t
|
|
94
|
+
var s=function(){"use strict";return function(){var t=function(t,n,e){return(o=function(){var n=t.documentElement.scrollWidth,e=t.documentElement.scrollHeight,o=t.documentElement.clientHeight,r=t.body.scrollWidth,i=t.body.scrollHeight,a=t.body.clientHeight;return{width:Math.max(n,r),height:Math.max(o,e,a,i)}})&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var o},n=!0;try{var e=function t(n){if(c.Array.isArray(n)){for(var e=new c.Array(n.length),o=0;o<n.length;o++)e[o]=t(n[o]);return e}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var r=new c.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=t(n[i]));return r}return n},o=window.__applitools_sandbox;o||((o=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),o.setAttribute("data-applitools-skip",""),document.head.appendChild(o),window.__applitools_sandbox=o);var r=Math.floor(4294967296*Math.random()),i=o.contentDocument.createElement("script");i.textContent="window['ctor-"+r+"'] = "+t.toString()+";",o.contentDocument.head.appendChild(i);var a=o.contentWindow["ctor-"+r];if(delete o.contentWindow["ctor-"+r],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var c=o.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var l=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};l._stringify&&l._stringify!==JSON.stringify||(l._stringify=c.JSON.stringify.bind(c.JSON));for(var _=new c.Array(arguments.length),s=0;s<arguments.length;s++)_[s]=e(s<0||arguments.length<=s?void 0:arguments[s]);return a(document,window,c).apply(void 0,_)}catch(e){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:e}}}}();
|
|
95
95
|
return s(arg)
|
|
96
96
|
}
|
|
97
97
|
exports.getDocumentScrollingElement=function(arg){
|
|
98
|
-
var s=function(){"use strict";function t(t){return t&&
|
|
98
|
+
var s=function(){"use strict";return function(){var t=function(t,n,r){return(e=function(){var n="HTML",r=t.scrollingElement;return r&&(n=r.tagName),n.toLowerCase()})&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var e},n=!0;try{var r=function t(n){if(c.Array.isArray(n)){for(var r=new c.Array(n.length),e=0;e<n.length;e++)r[e]=t(n[e]);return r}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var o=new c.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(o[i]=t(n[i]));return o}return n},e=window.__applitools_sandbox;e||((e=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e),window.__applitools_sandbox=e);var o=Math.floor(4294967296*Math.random()),i=e.contentDocument.createElement("script");i.textContent="window['ctor-"+o+"'] = "+t.toString()+";",e.contentDocument.head.appendChild(i);var a=e.contentWindow["ctor-"+o];if(delete e.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var c=e.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=c.JSON.stringify.bind(c.JSON));for(var l=new c.Array(arguments.length),f=0;f<arguments.length;f++)l[f]=r(f<0||arguments.length<=f?void 0:arguments[f]);return a(document,window,c).apply(void 0,l)}catch(r){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:r}}}}();
|
|
99
99
|
return s(arg)
|
|
100
100
|
}
|
|
101
101
|
exports.getContextInfo=function(arg){
|
|
102
|
-
var s=function(){"use strict";function t(t){return
|
|
102
|
+
var s=function(){"use strict";return function(){var t=function(t,n,e){return(r=function(){var e,r,o;try{e=n.top.document===n.document||"root-context"===n.parent.document["applitools-marker"]}catch(t){e=!1}try{r=!n.parent.document===n.document}catch(e){r=!0}if(!r)try{o=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}([n.frameElement])}catch(e){o=null}return[t.documentElement,o,e,r]})&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var r},n=!0;try{var e=function t(n){if(c.Array.isArray(n)){for(var e=new c.Array(n.length),r=0;r<n.length;r++)e[r]=t(n[r]);return e}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var o=new c.Object;for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(o[a]=t(n[a]));return o}return n},r=window.__applitools_sandbox;r||((r=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),r.setAttribute("data-applitools-skip",""),document.head.appendChild(r),window.__applitools_sandbox=r);var o=Math.floor(4294967296*Math.random()),a=r.contentDocument.createElement("script");a.textContent="window['ctor-"+o+"'] = "+t.toString()+";",r.contentDocument.head.appendChild(a);var i=r.contentWindow["ctor-"+o];if(delete r.contentWindow["ctor-"+o],"function"!=typeof i)throw new Error("Sandbox failed to extract function");n=!1;var c=r.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var u=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};u._stringify&&u._stringify!==JSON.stringify||(u._stringify=c.JSON.stringify.bind(c.JSON));for(var l=new c.Array(arguments.length),p=0;p<arguments.length;p++)l[p]=e(p<0||arguments.length<=p?void 0:arguments[p]);return i(document,window,c).apply(void 0,l)}catch(e){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:e}}}}();
|
|
103
103
|
return s(arg)
|
|
104
104
|
}
|
|
105
105
|
exports.getChildFramesInfo=function(arg){
|
|
106
|
-
var s=function(){"use strict";function
|
|
106
|
+
var s=function(){"use strict";return function(){var t=function(t,n,r){return(o=function(){return function n(r){var o=[];(r=r||t).querySelectorAll("frame, iframe").forEach((function(t){return o.push([t,!t.contentDocument,t.src])}));var e=Array.prototype.filter.call(r.querySelectorAll("*"),(function(t){return t.shadowRoot})).map((function(t){return n(t.shadowRoot)}));return o.concat.apply(o,e)}()})&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var o},n=!0;try{var r=function t(n){if(c.Array.isArray(n)){for(var r=new c.Array(n.length),o=0;o<n.length;o++)r[o]=t(n[o]);return r}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var e=new c.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=t(n[i]));return e}return n},o=window.__applitools_sandbox;o||((o=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),o.setAttribute("data-applitools-skip",""),document.head.appendChild(o),window.__applitools_sandbox=o);var e=Math.floor(4294967296*Math.random()),i=o.contentDocument.createElement("script");i.textContent="window['ctor-"+e+"'] = "+t.toString()+";",o.contentDocument.head.appendChild(i);var a=o.contentWindow["ctor-"+e];if(delete o.contentWindow["ctor-"+e],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var c=o.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var l=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};l._stringify&&l._stringify!==JSON.stringify||(l._stringify=c.JSON.stringify.bind(c.JSON));for(var u=new c.Array(arguments.length),f=0;f<arguments.length;f++)u[f]=r(f<0||arguments.length<=f?void 0:arguments[f]);return a(document,window,c).apply(void 0,u)}catch(r){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:r}}}}();
|
|
107
107
|
return s(arg)
|
|
108
108
|
}
|
|
109
109
|
exports.focusElement=function(arg){
|
|
110
|
-
var s=function(){"use strict";function t(t){return t&&
|
|
110
|
+
var s=function(){"use strict";return function(){var t=function(t,n,o){return(r=function(t){var n=(void 0===t?[]:t)[0];n&&n.focus()})&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var r},n=!0;try{var o=function t(n){if(c.Array.isArray(n)){for(var o=new c.Array(n.length),r=0;r<n.length;r++)o[r]=t(n[r]);return o}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var e=new c.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=t(n[i]));return e}return n},r=window.__applitools_sandbox;r||((r=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),r.setAttribute("data-applitools-skip",""),document.head.appendChild(r),window.__applitools_sandbox=r);var e=Math.floor(4294967296*Math.random()),i=r.contentDocument.createElement("script");i.textContent="window['ctor-"+e+"'] = "+t.toString()+";",r.contentDocument.head.appendChild(i);var a=r.contentWindow["ctor-"+e];if(delete r.contentWindow["ctor-"+e],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var c=r.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=c.JSON.stringify.bind(c.JSON));for(var f=new c.Array(arguments.length),l=0;l<arguments.length;l++)f[l]=o(l<0||arguments.length<=l?void 0:arguments[l]);return a(document,window,c).apply(void 0,f)}catch(o){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:o}}}}();
|
|
111
111
|
return s(arg)
|
|
112
112
|
}
|
|
113
113
|
exports.cleanupPageMarker=function(arg){
|
|
114
|
-
var s=function(){"use strict";function
|
|
114
|
+
var s=function(){"use strict";return function(){var t=function(t,r,e){return n=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},(o=function(){var r=t.querySelector("[data-applitools-marker]");r&&t.body.removeChild(r);var e=t.documentElement.getAttribute("data-applitools-original-transforms"),o=t.body.getAttribute("data-applitools-original-transforms");e&&n([t.documentElement,JSON.parse(e)]),o&&n([t.body,JSON.parse(o)])})&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var o,n},r=!0;try{var e=function t(r){if(d.Array.isArray(r)){for(var e=new d.Array(r.length),o=0;o<r.length;o++)e[o]=t(r[o]);return e}if(r&&"object"==typeof r&&Object.getPrototypeOf(r)===Object.prototype){var n=new d.Object;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=t(r[i]));return n}return r},o=window.__applitools_sandbox;o||((o=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),o.setAttribute("data-applitools-skip",""),document.head.appendChild(o),window.__applitools_sandbox=o);var n=Math.floor(4294967296*Math.random()),i=o.contentDocument.createElement("script");i.textContent="window['ctor-"+n+"'] = "+t.toString()+";",o.contentDocument.head.appendChild(i);var a=o.contentWindow["ctor-"+n];if(delete o.contentWindow["ctor-"+n],"function"!=typeof a)throw new Error("Sandbox failed to extract function");r=!1;var d=o.contentWindow,l=d.__EYES__APPLITOOLS__=d.__EYES__APPLITOOLS__||{};l._stringify||(l._stringify=d.JSON.stringify.bind(d.JSON));var c=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};c._stringify&&c._stringify!==JSON.stringify||(c._stringify=d.JSON.stringify.bind(d.JSON));for(var p=new d.Array(arguments.length),s=0;s<arguments.length;s++)p[s]=e(s<0||arguments.length<=s?void 0:arguments[s]);return a(document,window,d).apply(void 0,p)}catch(e){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw r?t:e}}}}();
|
|
115
115
|
return s(arg)
|
|
116
116
|
}
|
|
117
117
|
exports.cleanupElementIds=function(arg){
|
|
118
|
-
var s=function(){"use strict";function
|
|
118
|
+
var s=function(){"use strict";return function(){var t=function(t,o,e){return(r=function(t){(t=t&&t[0])&&"function"==typeof t.forEach&&t.forEach((function(t){t.removeAttribute("data-applitools-selector");var o=t;if(o.getRootNode)try{for(;o;){var e=o.getRootNode();if(!e)break;(o=e.constructor&&"ShadowRoot"===e.constructor.name?e.host:e.defaultView?e.defaultView.frameElement:null)&&o.removeAttribute("data-applitools-selector")}}catch(t){}}))})&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var r},o=!0;try{var e=function t(o){if(c.Array.isArray(o)){for(var e=new c.Array(o.length),r=0;r<o.length;r++)e[r]=t(o[r]);return e}if(o&&"object"==typeof o&&Object.getPrototypeOf(o)===Object.prototype){var n=new c.Object;for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=t(o[i]));return n}return o},r=window.__applitools_sandbox;r||((r=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),r.setAttribute("data-applitools-skip",""),document.head.appendChild(r),window.__applitools_sandbox=r);var n=Math.floor(4294967296*Math.random()),i=r.contentDocument.createElement("script");i.textContent="window['ctor-"+n+"'] = "+t.toString()+";",r.contentDocument.head.appendChild(i);var a=r.contentWindow["ctor-"+n];if(delete r.contentWindow["ctor-"+n],"function"!=typeof a)throw new Error("Sandbox failed to extract function");o=!1;var c=r.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var f=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};f._stringify&&f._stringify!==JSON.stringify||(f._stringify=c.JSON.stringify.bind(c.JSON));for(var l=new c.Array(arguments.length),_=0;_<arguments.length;_++)l[_]=e(_<0||arguments.length<=_?void 0:arguments[_]);return a(document,window,c).apply(void 0,l)}catch(e){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw o?t:e}}}}();
|
|
119
119
|
return s(arg)
|
|
120
120
|
}
|
|
121
121
|
exports.blurElement=function(arg){
|
|
122
|
-
var s=function(){"use strict";function t(t){return t&&
|
|
122
|
+
var s=function(){"use strict";return function(){var t=function(t,n,r){return(e=function(n){var r=(void 0===n?[]:n)[0]||t.activeElement;return r&&r.blur(),r})&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var e},n=!0;try{var r=function t(n){if(c.Array.isArray(n)){for(var r=new c.Array(n.length),e=0;e<n.length;e++)r[e]=t(n[e]);return r}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var o=new c.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(o[i]=t(n[i]));return o}return n},e=window.__applitools_sandbox;e||((e=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e),window.__applitools_sandbox=e);var o=Math.floor(4294967296*Math.random()),i=e.contentDocument.createElement("script");i.textContent="window['ctor-"+o+"'] = "+t.toString()+";",e.contentDocument.head.appendChild(i);var a=e.contentWindow["ctor-"+o];if(delete e.contentWindow["ctor-"+o],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var c=e.contentWindow,d=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};d._stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));var _=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};_._stringify&&_._stringify!==JSON.stringify||(_._stringify=c.JSON.stringify.bind(c.JSON));for(var l=new c.Array(arguments.length),f=0;f<arguments.length;f++)l[f]=r(f<0||arguments.length<=f?void 0:arguments[f]);return a(document,window,c).apply(void 0,l)}catch(r){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:r}}}}();
|
|
123
123
|
return s(arg)
|
|
124
124
|
}
|
|
125
125
|
exports.addPageMarker=function(arg){
|
|
126
|
-
var s=function(){"use strict";function
|
|
126
|
+
var s=function(){"use strict";return function(){var t=function(t,r,e){return n=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},o=function(r){var e=r[0],o=e.mask,i=e.size,a=void 0===i?1:i,s={1:"rgb(0, 0, 0)",0:"rgb(255, 255, 255)"},p=a,l=t.createElement("div");l.setAttribute("data-applitools-marker",""),l.style.setProperty("position","fixed","important"),l.style.setProperty("top","0","important"),l.style.setProperty("left","0","important"),l.style.setProperty("box-sizing","content-box","important"),l.style.setProperty("padding",p+"px","important"),l.style.setProperty("background","rgb(128, 128, 128)","important"),l.style.setProperty("z-index","2147483647","important");for(var d,y=0;y<o.length;y+=d){for(d=1;o[y]===o[y+d];)++d;var c=o[y],f=t.createElement("div");f.style.setProperty("display","block","important"),f.style.setProperty("float","left","important"),f.style.setProperty("width",d*a+"px","important"),f.style.setProperty("height",a+"px","important"),f.style.setProperty("background",s[c],"important"),l.appendChild(f)}var u={value:"none",important:!0},m=n([t.documentElement,{transform:u,"-webkit-transform":u}]),_=n([t.body,{transform:u,"-webkit-transform":u}]);return t.documentElement.setAttribute("data-applitools-original-transforms",JSON.stringify(m)),t.body.setAttribute("data-applitools-original-transforms",JSON.stringify(_)),t.body.appendChild(l),{mask:o,size:a,offset:p}},o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var o,n},r=!0;try{var e=function t(r){if(s.Array.isArray(r)){for(var e=new s.Array(r.length),o=0;o<r.length;o++)e[o]=t(r[o]);return e}if(r&&"object"==typeof r&&Object.getPrototypeOf(r)===Object.prototype){var n=new s.Object;for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=t(r[i]));return n}return r},o=window.__applitools_sandbox;o||((o=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),o.setAttribute("data-applitools-skip",""),document.head.appendChild(o),window.__applitools_sandbox=o);var n=Math.floor(4294967296*Math.random()),i=o.contentDocument.createElement("script");i.textContent="window['ctor-"+n+"'] = "+t.toString()+";",o.contentDocument.head.appendChild(i);var a=o.contentWindow["ctor-"+n];if(delete o.contentWindow["ctor-"+n],"function"!=typeof a)throw new Error("Sandbox failed to extract function");r=!1;var s=o.contentWindow,p=s.__EYES__APPLITOOLS__=s.__EYES__APPLITOOLS__||{};p._stringify||(p._stringify=s.JSON.stringify.bind(s.JSON));var l=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};l._stringify&&l._stringify!==JSON.stringify||(l._stringify=s.JSON.stringify.bind(s.JSON));for(var d=new s.Array(arguments.length),y=0;y<arguments.length;y++)d[y]=e(y<0||arguments.length<=y?void 0:arguments[y]);return a(document,window,s).apply(void 0,d)}catch(e){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw r?t:e}}}}();
|
|
127
127
|
return s(arg)
|
|
128
128
|
}
|
|
129
129
|
exports.addFallbackSelectorIfNeeded=function(arg){
|
|
130
|
-
var s=function(){"use strict";function t(t){return
|
|
130
|
+
var s=function(){"use strict";return function(){var t=function(t,n,e){return(o=function(e){if(!e.hasAttribute("data-applitools-fallback-selector")){if(function(e){var o=e&&e[0]||null;return!(o&&("isConnected"in n.Node.prototype?o.isConnected:t.documentElement.contains?t.documentElement.contains(o):o.ownerDocument.documentElement.contains(o)))}([e]))throw new Error("The element is not connected to the DOM: "+function(t){var n=t.attributes,e=t.tagName,o=t.children.length,r=[].slice.call(n).map((function(t){return t.name+'="'+t.value+'"'})).join(" ");return"<"+e+" "+r+(o?">":"/>")}(e));e.setAttribute("data-applitools-fallback-selector",function(t){for(var n=[];t&&t.nodeType===Node.ELEMENT_NODE;)try{var e,o=t.tagName.toLowerCase(),r=[].slice.call((null==(e=t.parentNode)?void 0:e.children)||[]).indexOf(t);r>-1&&(o+=":nth-child("+(r+1)+")"),n.unshift(o),t=t.parentNode}catch(t){break}return n.length?n.join(" > "):"html"}(e))}})&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o;var o},n=!0;try{var e=function t(n){if(c.Array.isArray(n)){for(var e=new c.Array(n.length),o=0;o<n.length;o++)e[o]=t(n[o]);return e}if(n&&"object"==typeof n&&Object.getPrototypeOf(n)===Object.prototype){var r=new c.Object;for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=t(n[i]));return r}return n},o=window.__applitools_sandbox;o||((o=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),o.setAttribute("data-applitools-skip",""),document.head.appendChild(o),window.__applitools_sandbox=o);var r=Math.floor(4294967296*Math.random()),i=o.contentDocument.createElement("script");i.textContent="window['ctor-"+r+"'] = "+t.toString()+";",o.contentDocument.head.appendChild(i);var a=o.contentWindow["ctor-"+r];if(delete o.contentWindow["ctor-"+r],"function"!=typeof a)throw new Error("Sandbox failed to extract function");n=!1;var c=o.contentWindow,l=c.__EYES__APPLITOOLS__=c.__EYES__APPLITOOLS__||{};l._stringify||(l._stringify=c.JSON.stringify.bind(c.JSON));var d=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};d._stringify&&d._stringify!==JSON.stringify||(d._stringify=c.JSON.stringify.bind(c.JSON));for(var u=new c.Array(arguments.length),s=0;s<arguments.length;s++)u[s]=e(s<0||arguments.length<=s?void 0:arguments[s]);return a(document,window,c).apply(void 0,u)}catch(e){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw n?t:e}}}}();
|
|
131
131
|
return s(arg)
|
|
132
132
|
}
|
|
133
133
|
exports.addElementIds=function(arg){
|
|
134
|
-
var s=function(){"use strict";function
|
|
134
|
+
var s=function(){"use strict";return function(){var t=function(t,e,n){return function(){var n=function(n){var r=n&&n[0]||null;return!(r&&("isConnected"in e.Node.prototype?r.isConnected:t.documentElement.contains?t.documentElement.contains(r):r.ownerDocument.documentElement.contains(r)))},r=n,o=function(t){if(!t.hasAttribute("data-applitools-fallback-selector")){if(r([t]))throw new Error("The element is not connected to the DOM: "+function(t){var e=t.attributes,n=t.tagName,r=t.children.length,o=[].slice.call(e).map((function(t){return t.name+'="'+t.value+'"'})).join(" ");return"<"+n+" "+o+(r?">":"/>")}(t));t.setAttribute("data-applitools-fallback-selector",function(t){for(var e=[];t&&t.nodeType===Node.ELEMENT_NODE;)try{var n,r=t.tagName.toLowerCase(),o=[].slice.call((null==(n=t.parentNode)?void 0:n.children)||[]).indexOf(t);o>-1&&(r+=":nth-child("+(o+1)+")"),e.unshift(r),t=t.parentNode}catch(t){break}return e.length?e.join(" > "):"html"}(t))}},a=n;function i(e,n){if(a([e])){var r=function(t){return null!=t&&t.getAttribute?t.getAttribute("data-applitools-fallback-selector"):{error:"invalid element: "+JSON.stringify(t)}}(e);if(!r)return{error:"Failed to recover from stale element"};if(r.error)return r;var l=t.querySelectorAll(r);if(!l||1!==l.length)return{error:"Failed to recover from stale element - selector found: "+r};var c=l[0];return c.setAttribute("data-applitools-selector",n),c.setAttribute("data-applitools-recovered",!0),i(c,n)}o(e);var u=e.getAttribute("data-applitools-selector"),d=u?u+" "+n:n;return e.setAttribute("data-applitools-selector",d),'[data-applitools-selector~="'+n+'"]'}return function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}((function(t){return t.map((function(t){var e=t[0],n=t[1];return e.map((function(t){var e=function(t){for(var e=[{element:t,kind:"root"}],n=new Set([t]),r=t;r;){var o,a=r.getRootNode&&r.getRootNode();if(!a)break;if(a.constructor&&"ShadowRoot"===a.constructor.name?(r=a.host,o="shadow"):(r=a.defaultView?a.defaultView.frameElement:null,o="frame"),r){if(n.has(r))break;n.add(r),e.push({element:r,kind:o})}}return e}(t);return e.map((function(t){return{selector:i(t.element,n),kind:t.kind}}))}))}))}))}()},e=!0;try{var n=function t(e){if(l.Array.isArray(e)){for(var n=new l.Array(e.length),r=0;r<e.length;r++)n[r]=t(e[r]);return n}if(e&&"object"==typeof e&&Object.getPrototypeOf(e)===Object.prototype){var o=new l.Object;for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(o[a]=t(e[a]));return o}return e},r=window.__applitools_sandbox;r||((r=document.createElement("iframe")).setAttribute("data-applitools-sandbox",""),r.setAttribute("data-applitools-skip",""),document.head.appendChild(r),window.__applitools_sandbox=r);var o=Math.floor(4294967296*Math.random()),a=r.contentDocument.createElement("script");a.textContent="window['ctor-"+o+"'] = "+t.toString()+";",r.contentDocument.head.appendChild(a);var i=r.contentWindow["ctor-"+o];if(delete r.contentWindow["ctor-"+o],"function"!=typeof i)throw new Error("Sandbox failed to extract function");e=!1;var l=r.contentWindow,c=l.__EYES__APPLITOOLS__=l.__EYES__APPLITOOLS__||{};c._stringify||(c._stringify=l.JSON.stringify.bind(l.JSON));var u=window.__EYES__APPLITOOLS__=window.__EYES__APPLITOOLS__||{};u._stringify&&u._stringify!==JSON.stringify||(u._stringify=l.JSON.stringify.bind(l.JSON));for(var d=new l.Array(arguments.length),s=0;s<arguments.length;s++)d[s]=n(s<0||arguments.length<=s?void 0:arguments[s]);return i(document,window,l).apply(void 0,d)}catch(n){try{return t(document,window,window).apply(void 0,arguments)}catch(t){throw e?t:n}}}}();
|
|
135
135
|
return s(arg)
|
|
136
136
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applitools/snippets",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/applitools/eyes.sdk.javascript1.git",
|
|
@@ -23,15 +23,20 @@
|
|
|
23
23
|
"playwright:setup": "yarn playwright install --with-deps chromium"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
+
"@applitools/dom-shared": "1.2.0",
|
|
26
27
|
"@babel/core": "^7.26.0",
|
|
27
28
|
"@babel/preset-env": "^7.23.2",
|
|
28
29
|
"@rollup/plugin-babel": "^6.0.4",
|
|
29
30
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
31
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
32
|
+
"@rollup/plugin-replace": "^5.0.4",
|
|
30
33
|
"@rollup/plugin-terser": "^0.4.4",
|
|
34
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
31
35
|
"chalk": "^4.1.0",
|
|
32
36
|
"glob": "^10.3.10",
|
|
33
37
|
"playwright": "1.47.0",
|
|
34
38
|
"rollup": "^4.1.4",
|
|
39
|
+
"typescript": "^5.9.2",
|
|
35
40
|
"webdriverio": "^7.31.1",
|
|
36
41
|
"yargs": "^17.7.2"
|
|
37
42
|
},
|