(()=>{var t={294:(t,e,n)=>{const r=n(342),{getFramesArray:o,getFrameTag:c}=n(312),{getOnload:i,setOnload:s,removeAttribute:u,addEventListener:a}=n(524);function p(t,e,n){if(!c(e))return;a(e,"load",(function(){r(t,[this],n)}));const o=i(e);o&&(s(e,null),u(e,"onload"),s(e,o))}t.exports=function(t,e,n){for(let r=0;r{t.exports=function(t){t&&t.contentWindow}},342:(t,e,n)=>{const r=n(851),o=n(507),{shadows:c,getFramesArray:i,getFrameTag:s}=n(312),{getContentWindow:u,Object:a,getFrameElement:p}=n(524);function l(t,e){let n=-1;for(;t[++n];)if(!r(t[n],t,a)&&p(t[n])===e)return t[n];for(let t=0;t{const{getFramesArray:r}=n(312),{removeAttribute:o,getAttribute:c,getTemplateContent:i,createElement:s,getInnerHTML:u,setInnerHTML:a}=n(524),{warn:p,WARN_IFRAME_ONLOAD_ATTRIBUTE_REMOVED:l}=n(914);function f(t){for(let e=0;e{const r=n(342),o=n(974),c=n(274),i=n(753),{hookShadowDOM:s}=n(617),{securely:u,addEventListener:a,getFrameElement:p}=n(524),{isMarked:l,mark:f}=n(5),{error:m,ERR_MARK_NEW_WINDOW_FAILED:d}=n(914);function g(t){try{const e=!l(t);return e&&f(t),e}catch(e){m(d,t,e)}return g(t)}function y(t,e){g(e)&&function(t,e,n,r){o(t,e),c(t,"load",e),i(t,e),s(t,e),r(t,n)}(e,(function(n){y(t,n),a(p(n),"load",(function(){r(e,[this],(function(){y(t,n)}))}))}),u,t)}let E=!1;t.exports=function(t,e){E||(E=!0,y(t,e||window))}},753:(t,e,n)=>{const{protectShadows:r}=n(617),o=n(294),{getFramesArray:c,shadows:i}=n(312),{getParentElement:s,slice:u,Object:a,Function:p}=n(524),l=n(899),f=n(342),m={DocumentFragment:["replaceChildren","append","prepend"],Document:["replaceChildren","append","prepend","write","writeln"],Node:["appendChild","insertBefore","replaceChild"],Element:["innerHTML","outerHTML","insertAdjacentHTML","replaceWith","insertAdjacentElement","append","before","prepend","after","replaceChildren"],ShadowRoot:["innerHTML"],HTMLIFrameElement:["srcdoc"]};function d(t,e,n){return function(){const a=u(arguments),m=s(this)||this;o(t,a,n),o(t,i,n),l(t,a),l(t,i);const d=p.prototype.apply.call(e,this,a),g=c(m,!1);return f(t,g,n),f(t,a,n),r(t,n,!0),d}}t.exports=function(t,e){for(const n in m){const r=m[n];for(let o=0;o{const r=n(342),{removeEventListener:o,addEventListener:c,slice:i,Map:s,Object:u}=n(524),a=new s;function p(t,e,n){if(e)return e.handleEvent?e.handleEvent.apply(e,n):e.apply(t,n)}function l(t,e,n){return function(o,s,u){let l=s;return o===e&&(a.has(s)||a.set(s,(function(){r(t,[this],n);const e=i(arguments);p(this,s,e)})),l=a.get(s)),c(this||t,o,l,u)}}function f(t,e){return function(n,r,c){let i=r;return n===e&&(i=a.get(r),a.delete(r)),o(this||t,n,i,c)}}t.exports=function(t,e,n){u.defineProperty(t.EventTarget.prototype,"addEventListener",{value:l(t,e,n)}),u.defineProperty(t.EventTarget.prototype,"removeEventListener",{value:f(t,e)})}},914:(t,e,n)=>{const{console:r}=n(524);t.exports={warn:function(t,e,n){let o;switch(t){case 1:const t=e,c=n;o=!1,r.warn("SNOW:","removing html string iframe onload attribute:",t,`"${c}"`,".","\n","if this prevents your application from running correctly, please visit/report at","https://github.com/LavaMoat/snow/issues/32#issuecomment-1239273328",".");break;case 4:const i=e,s=n;o=!0,r.warn("SNOW:",o?"":"NOT",'blocking open attempt to "javascript:" url:',i,"by window: ",s,".","\n","if this prevents your application from running correctly, please visit/report at","https://github.com/LavaMoat/snow/issues/2#issuecomment-1239264255",".");break;case 3:const u=e,a=n;o=!0,r.warn("SNOW:","blocking access to property:",`"${u}"`,"of opened window: ",a,".","\n","if this prevents your application from running correctly, please visit/report at","https://github.com/LavaMoat/snow/issues/2#issuecomment-1239264255",".")}return o},error:function(t,e,n){let o;if(2===t){const t=e,c=n;o=!0,r.error("SNOW:","failed to mark new window:",t,".","\n","if this prevents your application from running correctly, please visit/report at","https://github.com/LavaMoat/snow/issues/33#issuecomment-1239280063",".","\n","in order to maintain a bulletproof defense mechanism, failing to mark a new window typically causes an infinite loop",".","\n","error caught:","\n",c)}return o},WARN_IFRAME_ONLOAD_ATTRIBUTE_REMOVED:1,ERR_MARK_NEW_WINDOW_FAILED:2,WARN_OPEN_API_LIMITED:3,WARN_OPEN_API_URL_ARG_JAVASCRIPT_SCHEME:4}},5:(t,e,n)=>{const{Map:r,Object:o,Array:c}=n(524),i=(Math.random()+1).toString(36).substring(7),s=new r;t.exports={isMarked:function(t){if(!s.has(t))return!1;const e=o.getOwnPropertyDescriptor(t,"SNOW_ID");if(!e||!o.hasOwnProperty.call(e,"value"))return!1;if("function"!=typeof e.value)return!1;const n=s.get(t);return e.value(i)===n},mark:function(t){const e=new c;o.defineProperty(t,"SNOW_ID",{configurable:!1,writable:!1,value:t=>t===i&&e}),s.set(t,e)}}},524:t=>{t.exports=function(t){const e=function(t){return function(t,e){const n=t.document.createElement("iframe");(t.document.head||t.document.documentElement).appendChild(n);const r=function(t){const{console:e,Proxy:n,JSON:r,Attr:o,String:c,Function:i,Map:s,Node:u,Document:a,DocumentFragment:p,ShadowRoot:l,Object:f,Reflect:m,Array:d,Element:g,HTMLElement:y,HTMLTemplateElement:E,EventTarget:w,HTMLIFrameElement:O,HTMLFrameElement:h,HTMLObjectElement:v}=t,S={console:e,Proxy:n,JSON:r,Attr:o,String:c,Function:i,Map:s,Node:u,Document:a,DocumentFragment:p,ShadowRoot:l,Object:f,Reflect:m,Array:d,Element:g,HTMLElement:y,HTMLTemplateElement:E,EventTarget:w,HTMLIFrameElement:O,HTMLFrameElement:h,HTMLObjectElement:v};return S.document={createElement:t.document.createElement},S}(n.contentWindow);return n.parentElement.removeChild(n),r}(t)}(t),{console:n,Proxy:r,Function:o,Map:c,Node:i,Document:s,DocumentFragment:u,ShadowRoot:a,Object:p,Reflect:l,Array:f,Element:m,HTMLElement:d,HTMLTemplateElement:g,EventTarget:y,HTMLIFrameElement:E,HTMLFrameElement:w,HTMLObjectElement:O}=e;return p.assign(e,{iframeContentWindow:p.getOwnPropertyDescriptor(E.prototype,"contentWindow").get,frameContentWindow:p.getOwnPropertyDescriptor(w.prototype,"contentWindow").get,objectContentWindow:p.getOwnPropertyDescriptor(O.prototype,"contentWindow").get,createElement:p.getOwnPropertyDescriptor(s.prototype,"createElement").value,slice:p.getOwnPropertyDescriptor(f.prototype,"slice").value,nodeType:p.getOwnPropertyDescriptor(i.prototype,"nodeType").get,tagName:p.getOwnPropertyDescriptor(m.prototype,"tagName").get,getInnerHTML:p.getOwnPropertyDescriptor(m.prototype,"innerHTML").get,setInnerHTML:p.getOwnPropertyDescriptor(m.prototype,"innerHTML").set,toString:p.getOwnPropertyDescriptor(p.prototype,"toString").value,getOnload:p.getOwnPropertyDescriptor(d.prototype,"onload").get,setOnload:p.getOwnPropertyDescriptor(d.prototype,"onload").set,getAttribute:p.getOwnPropertyDescriptor(m.prototype,"getAttribute").value,removeAttribute:p.getOwnPropertyDescriptor(m.prototype,"removeAttribute").value,addEventListener:p.getOwnPropertyDescriptor(y.prototype,"addEventListener").value,removeEventListener:p.getOwnPropertyDescriptor(y.prototype,"removeEventListener").value,getTemplateContent:p.getOwnPropertyDescriptor(g.prototype,"content").get,getFrameElement:p.getOwnPropertyDescriptor(t,"frameElement").get,getParentElement:p.getOwnPropertyDescriptor(i.prototype,"parentElement").get}),{console:n,Proxy:r,Object:p,Reflect:l,Function:o,Node:i,Element:m,Document:s,DocumentFragment:u,ShadowRoot:a,Array:f,Map:c,getContentWindow:function(t,n){switch(n){case"IFRAME":return e.iframeContentWindow.call(t);case"FRAME":return e.frameContentWindow.call(t);case"OBJECT":return e.objectContentWindow.call(t);default:return null}},stringToLowerCase:function(t){return e.String.prototype.toLowerCase.call(t)},stringStartsWith:function(t,n){return e.String.prototype.startsWith.call(t,n)},parse:function(t,n){return e.JSON.parse(t,n)},stringify:function(t,n,r){return e.JSON.stringify(t,n,r)},slice:function(t,n,r){return e.slice.call(t,n,r)},nodeType:function(t){return e.nodeType.call(t)},tagName:function(t){return e.tagName.call(t)},toString:function(t){return e.toString.call(t)},getOnload:function(t){return e.getOnload.call(t)},setOnload:function(t,n){return e.setOnload.call(t,n)},removeAttribute:function(t,n){return e.removeAttribute.call(t,n)},getAttribute:function(t,n){return e.getAttribute.call(t,n)},addEventListener:function(t,n,r,o){return e.addEventListener.call(t,n,r,o)},removeEventListener:function(t,n,r,o){return e.removeEventListener.call(t,n,r,o)},createElement:function(t,n,r){return e.createElement.call(t,n,r)},getInnerHTML:function(t){return e.getInnerHTML.call(t)},setInnerHTML:function(t,n){return e.setInnerHTML.call(t,n)},getTemplateContent:function(t){return e.getTemplateContent.call(t)},getFrameElement:function(t){return e.Function.prototype.call.call(e.getFrameElement,t)},getParentElement:function(t){return e.getParentElement.call(t)}}}(top)},974:(t,e,n)=>{const{stringToLowerCase:r,stringStartsWith:o,slice:c,Function:i,Object:s,Reflect:u,Proxy:a,Map:p}=n(524),{warn:l,WARN_OPEN_API_LIMITED:f,WARN_OPEN_API_URL_ARG_JAVASCRIPT_SCHEME:m}=n(914),d=new p;function g(t,e){const n={};return s.defineProperty(n,"closed",{get:function(){return e.closed}}),s.defineProperty(n,"close",{value:function(){return e.close()}}),s.defineProperty(n,"focus",{value:function(){return e.focus()}}),s.defineProperty(n,"postMessage",{value:function(t,n,r){return e.postMessage(t,n,r)}}),new a(n,{get:function(n,r){let o=u.get(n,r);return u.has(n,r)||u.has(e,r)&&(l(f,r,t)||(o=u.get(e,r))),o},set:function(){}})}t.exports=function(t,e){!function(t){const e=s.getOwnPropertyDescriptor(t.MessageEvent.prototype,"source"),n=e.get;e.get=function(){const t=n.call(this);return d.get(t)||t},s.defineProperty(t.MessageEvent.prototype,"source",e)}(t),t.open=function(t,e,n){return function(){const s=c(arguments),u=s[0]+"",a=s[1],p=s[2];if(o(r(u),"javascript")&&l(m,u,t))return null;const f=i.prototype.call.call(e,this,u,a,p);if(!f)return null;n(f);const y=g(t,f);return d.set(f,y),y}}(t,t.open,e)}},617:(t,e,n)=>{const r=n(342),{getFramesArray:o,shadows:c}=n(312),{Object:i,Function:s}=n(524);function u(t,e,n){for(let i=0;i{const{tagName:r,nodeType:o,slice:c,Array:i,parse:s,stringify:u,Node:a,Document:p,DocumentFragment:l,Element:f,ShadowRoot:m}=n(524),d=new i;function g(t){return d.includes(t)}function y(t,e){let n=!1;for(let r=0;rt||r!==e?"":e)))||!function(t){if(g(t))return!0;const e=o(t);return e===f.prototype.ELEMENT_NODE||e===f.prototype.DOCUMENT_FRAGMENT_NODE||e===f.prototype.DOCUMENT_NODE}(t))return n;var r;const d=function(t){if(g(t))return m;switch(o(t)){case a.prototype.DOCUMENT_NODE:return p;case a.prototype.DOCUMENT_FRAGMENT_NODE:return l;default:return f}}(t).prototype.querySelectorAll.call(t,"iframe,frame,object,embed");return y(n,c(d)),e&&y(n,[t]),n},getFrameTag:function(t){if(!t||"object"!=typeof t)return null;if(o(t)!==f.prototype.ELEMENT_NODE)return null;if(g(t))return null;const e=r(t);return"IFRAME"!==e&&"FRAME"!==e&&"OBJECT"!==e&&"EMBED"!==e?null:e},shadows:d}},352:(t,e,n)=>{const r=n(575),{getScriptSrc:o,getDocumentCurrentScript:c,includes:i,push:s}=n(14),u=n(944),a=[],p={};function l(t){const e=c(document);if(!e||i(a,e))return function(){};const n=o(e);return n?(p[n]||(p[n]=t),function(t,e){const r=p[t];return r&&r(n,e)}):function(){}}t.exports=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};Object.defineProperty(document,"onmessage",{value:l}),r((e=>{u(e,(t=>s(a,t))),t(e)}))}},14:t=>{t.exports=function(t){const e=function(t){return function(t,e){const n=t.document.createElement("iframe");(t.document.head||t.document.documentElement).appendChild(n);const r=function(t){const{Object:e,Array:n,Element:r,Attr:o,String:c,Node:i,HTMLScriptElement:s}=t,u={Object:e,Array:n,Element:r,Attr:o,String:c,Node:i,HTMLScriptElement:s};return u.document={currentScript:{get:e.getOwnPropertyDescriptor(t.Document.prototype,"currentScript").get}},u}(n.contentWindow);return n.parentElement.removeChild(n),r}(t)}(top),{Object:n,Array:r,Element:o,Attr:c,String:i,Node:s,HTMLScriptElement:u}=e;return n.assign(e,{scriptSrcGet:n.getOwnPropertyDescriptor(u.prototype,"src").get,scriptSrcSet:n.getOwnPropertyDescriptor(u.prototype,"src").set,push:n.getOwnPropertyDescriptor(r.prototype,"push").value,includes:n.getOwnPropertyDescriptor(r.prototype,"includes").value}),{Object:n,Array:r,Element:o,Attr:c,String:i,Node:s,stringToLowerCase:function(t){return e.String.prototype.toLowerCase.call(t)},getDocumentCurrentScript:function(t){return e.document.currentScript.get.call(t)},setScriptSrc:function(t,n){return e.scriptSrcSet.call(t,n)},getScriptSrc:function(t){return e.scriptSrcGet.call(t)},push:function(t,n){return e.push.call(t,n)},includes:function(t,n){return e.includes.call(t,n)}}}()},944:(t,e,n)=>{const{Object:r,Attr:o,Element:c,Node:i,getDocumentCurrentScript:s,stringToLowerCase:u,setScriptSrc:a}=n(14);function p(t){return"string"==typeof t&&"script"===u(t)}function l(t,e){return function(t){return"string"==typeof t&&"src"===u(t)}(t)&&function(t){return p(d.call(t))}(e)}function f(t){return"object"==typeof t&&("src"===u(g.call(t))||"src"===u(E.call(t))||"src"===u(y.call(t)))}function m(t,e,n,o){const c=r.getOwnPropertyDescriptor(e,n),i=c.set?"set":"value",u=c[i];c[i]=function(t,e,n){if(!s(document)||!o.call(this,t,e,n))return u.call(this,t,e,n)},r.defineProperty(e,n,c)}let d,g,y,E;t.exports=function(t,e){function n(t,n){return(l(t,this)||l(n,this))&&e(this),!1}function s(t){return l(E(t),this)&&e(this),!1}function u(t,e){return f(t)||f(e)}g=g||r.getOwnPropertyDescriptor(o.prototype,"name").get,y=y||r.getOwnPropertyDescriptor(o.prototype,"localName").get,E=E||r.getOwnPropertyDescriptor(i.prototype,"nodeName").get,d=d||r.getOwnPropertyDescriptor(c.prototype,"tagName").get,m(0,t.Element.prototype,"setAttribute",n),m(0,t.Element.prototype,"setAttributeNS",n),m(0,t.Element.prototype,"setAttributeNode",s),m(0,t.Element.prototype,"setAttributeNodeNS",s),m(0,t.HTMLScriptElement.prototype,"src",(function(){return e(this),!1})),m(0,t.Attr.prototype,"value",(function(){return f(this)})),m(0,t.NamedNodeMap.prototype,"setNamedItem",u),m(0,t.NamedNodeMap.prototype,"setNamedItemNS",u),function(t){const e=t.document.createElement;t.document.createElement=function(n,r,o){const c=e.call(t.document,n,r,o);return p(n)&&("string"==typeof r&&a(c,r),"string"==typeof o&&a(c,o)),c}}(t)}},626:t=>{t.exports={SRC_IS_NOT_A_WINDOW:'provided argument "src" must be a proper window of instance Window',DST_IS_NOT_A_WINDOW:'provided argument "dst" must be a proper window of instance Window',SRC_IS_NOT_SAME_ORIGIN_AS_WINDOW:'provided argument "src" must be a window in the same origin as the current context window'}},851:(t,e,n)=>{const{DST_IS_NOT_A_WINDOW:r,SRC_IS_NOT_A_WINDOW:o,SRC_IS_NOT_SAME_ORIGIN_AS_WINDOW:c}=n(626);function i(t,e){const n=e(t);return n===n.window}function s(t,e,n){return null===n.getPrototypeOf.call(e,t)}t.exports=function(t,e=window,n=window.Object){if(!i(e,n))throw new Error(o);if(!i(t,n))throw new Error(r);if(s(window,e,n))throw new Error(c);return s(t,e,n)}}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var c=e[r]={exports:{}};return t[r](c,c.exports,n),c.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t,e=n(352),r=n.n(e);t=window,Object.defineProperty(t,"ACROSS",{value:r()})})()})();