/* @applitools/dom-snapshot@4.2.8 */

function __pollResult() {
  var pollResult=function(){"use strict";let t,e,o,r,n,c;try{const s=document.createElement("iframe");s.style.display="none";const u=document.body.appendChild(s);t=u.contentWindow.Set,e=u.contentWindow.Map,o=u.contentWindow.Array,r=u.contentWindow.Object,n=u.contentWindow.Promise;const{isPrototypeOf:p}=r.prototype,{Node:i}=u.contentWindow;c=Object.getOwnPropertyNames(u.contentWindow).filter(t=>p.call(i,u.contentWindow[t])).reduce((t,e)=>Object.assign(t,Object.setPrototypeOf({[e]:u.contentWindow[e]},Object.prototype)),Object.setPrototypeOf({Node:i},Object.prototype)),document.body.removeChild(s)}catch(t){}var s=e||Map,u=t||Set,p=o||Array,i=r||Object,a=n||Promise,l=c||Object.setPrototypeOf({},Object.prototype);Object.setPrototypeOf({Map:s,Set:u,Array:p,Object:i,Promise:a,elementConstructors:l},Object.prototype);function f(t,e=0){const o=t.charCodeAt(e);if(o>=55296&&o<56320){return 1024*(o-55296)+(t.charCodeAt(e+1)-56320)+65536}return 56320<=o&&o<=57343?-1:o}var y=function(t,e){const o=p.of();let r=0;for(let n=0;n<t.length;++n){const c=f(t,n);let s=0;c>0&&(s=c<128?1:c<2048?2:c<65536?3:c<2097152?4:c<67108864?5:6),r+s>e?(o.push(n),r=s):r+=s}return o};const O=i.setPrototypeOf({WIP:"WIP",SUCCESS:"SUCCESS",SUCCESS_CHUNKED:"SUCCESS_CHUNKED",ERROR:"ERROR"},i.prototype);var S=function(t,e,o=i.setPrototypeOf({},i.prototype)){const r=function(t,{chunkByteLength:e=0}=i.setPrototypeOf({},i.prototype)){if(t){if(t.value){if(e){if(!t.chunks){const o=JSON.stringify(t.value);t.chunks=y(o,e),t.chunks.length>0&&(t.from=0,t.value=o)}if(t.from>=0)return i.setPrototypeOf({status:O.SUCCESS_CHUNKED,value:t.value.substring(t.from,t.from=t.chunks.shift()),done:!t.from},i.prototype)}return i.setPrototypeOf({status:O.SUCCESS,value:t.value},i.prototype)}return t.error?i.setPrototypeOf({status:O.ERROR,error:t.error},i.prototype):i.setPrototypeOf({status:O.WIP},i.prototype)}return i.setPrototypeOf({status:O.ERROR,error:"unexpected poll request received - cannot find state of current operation"},i.prototype)}((t=t||i.setPrototypeOf({},i.prototype))[e],o);return(r.status===O.SUCCESS||r.status===O.ERROR||r.status===O.SUCCESS_CHUNKED&&r.done)&&(t[e]=null),r};var d=function(t,e,o){return r=>function(){return e[o]||(e[o]=i.setPrototypeOf({},i.prototype),t.apply(null,arguments).then(t=>e[o].value=t).catch(t=>e[o].error=t.message)),S(e,o,r)}};var E=function(t,e){return new URL(t,e).href};var m=function(t){return!/^https?:.+/.test(t.src)||t.contentDocument&&t.contentDocument.location&&(p.of("about:blank","about:srcdoc").includes(t.contentDocument.location.href)||""===t.getAttribute("src")&&t.contentDocument.location.href===E(t.getAttribute("src"),t.ownerDocument.location.href))};var P=function(t){try{const e=t.contentDocument;return Boolean(e&&e.defaultView&&e.defaultView.frameElement)}catch(t){return!1}},C=i.setPrototypeOf({chunkify:y,pollify:d,poll:S,absolutizeUrl:E,isInlineFrame:m,isAccessibleFrame:P},i.prototype),h=(C.chunkify,C.pollify,C.poll,C.absolutizeUrl,C.isInlineFrame,C.isAccessibleFrame,i.setPrototypeOf({EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_SNAPSHOT_KEY:"domSnapshotResult"},i.prototype));const{poll:b}=C,{EYES_NAMESPACE:v,DOM_SNAPSHOT_KEY:R}=h;return function(t){return JSON.stringify(b(window[v],R,t))}}();

  return pollResult.apply(this, arguments);
}