@lavamoat/lavadome-core
Advanced tools
Comparing version 0.0.16 to 0.0.17
@@ -1,2 +0,2 @@ | ||
(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{LavaDome:()=>K,LavaDomeDebug:()=>V});const{Object:o,Array:n,Function:r,Math:a,parseInt:s,WeakMap:i,Error:l,JSON:p,crypto:u}=globalThis,{defineProperties:c,assign:d,getOwnPropertyDescriptor:f,entries:y,create:b,hasOwn:g}=o,{from:h}=n,{random:m}=a,{stringify:v}=p,w=(u?.randomUUID?.bind(u),(e,t,o)=>e&&r.prototype.call.bind(f(e,t)[o])),T=w(globalThis?.Element?.prototype,"attachShadow","value"),O=w(globalThis?.Document?.prototype,"createElement","value"),S=w(globalThis?.Node?.prototype,"appendChild","value"),I=w(globalThis?.Node?.prototype,"textContent","set"),x=w(globalThis?.Element?.prototype,"setAttribute","value"),D=w(globalThis?.String?.prototype,"toUpperCase","value"),M=w(globalThis?.Array?.prototype,"map","value"),j=w(globalThis?.Array?.prototype,"join","value"),k=w(globalThis?.Array?.prototype,"keys","value"),C=w(globalThis?.Array?.prototype,"at","value"),L=w(globalThis?.WeakMap?.prototype,"get","value"),A=w(globalThis?.WeakMap?.prototype,"set","value"),P=w(globalThis?.Number?.prototype,"toFixed","value"),_={isInnerInstance:Symbol("isInnerInstance"),unsafeOpenModeShadow:"unsafeOpenModeShadow"},E=e=>function(t,o,n){const r=e[t];return g(e,t)?typeof r!==o?n:r:n},N="abcdefghijklmnopqrstuvwxyz",$="0123456789",F="!@#$%^&*()?.;:\"'[]{}+=-_/",R={letters:N,digits:$,symbols:F,alphanumeric:N+$,all:N+D(N)+$+F},{letters:U,alphanumeric:W,all:q}=R,z=(e,t)=>e[s(P(m()*t))];function B(e,t,o=""){return e=j(M(y(e),(([e,t])=>`${e}: ${t} !important`)),"; "),function(){const n=O(document,t());return x(n,"style",e),I(n,o),n}}const G=e=>()=>e(),J=G(B({"-webkit-user-modify":"unset","-webkit-user-select":"none","user-select":"none"},(()=>(7,z(U,26)+j(M(h(k(n(7))),(()=>z(W,36))),""))))),Y=G(B({top:"-10px",right:"-10px",position:"fixed","font-size":"1px"},(()=>"span"),q)),H=new i;function K(e,t){t=function(e={}){const{unsafeOpenModeShadow:t,isInnerInstance:o}=_,n=E(d(b(null),e)),r=b(null);return r.isInnerInstance=n(o,"boolean",!1),r.unsafeOpenModeShadow=n(t,"boolean",!1),r}(t),c(this,{text:{value:function(e){if("string"!=typeof e)throw new l(`LavaDomeCore: first argument must be a string, instead got ${v(e)}`);if(void 0===C(h(e),1))return I(o,e);M(h(e),(e=>{const n=O(document,"span");t[_.isInnerInstance]=!0,new K(n,t).text(e),S(o,n)})),S(o,Y())}}});const o=J(),n=function(e,t){const{unsafeOpenModeShadow:o,isInnerInstance:n}=t;let r=L(H,e);if(!r){const t={mode:"closed"};o&&(t.mode="open",n||console.warn("LavaDome:",`Initiated with "${_.unsafeOpenModeShadow}" set to true.`,"This leaves LavaDome fully vulnerable, ONLY USE FOR TESTING!")),r=T(e,t),A(H,e,r)}return r}(e,t);S(n,o)}const{all:Q}=R,V={getTextByRoot:function(e){console.warn("LavaDomeDebug(getTextByRoot):","Call/include this function for testing/debugging purposes only!",`(remember, '${_.unsafeOpenModeShadow}' must be enabled for this function to work)`);let t="";const o=e?.shadowRoot;if(!o)return t;const n=h(o.querySelectorAll("span"));return M(n,(e=>{const o=e?.shadowRoot?.firstChild?.textContent;o&&(t+=o)})),t},stripDistractionFromText:function(e){return console.warn("LavaDomeDebug(stripDistractionFromText):","Call/include this function for testing/debugging purposes only!"),e.split(Q).join("").split("\n").join("").split("\r").join("").split("\t").join("")}};var X=exports;for(var Z in t)X[Z]=t[Z];t.__esModule&&Object.defineProperty(X,"__esModule",{value:!0})})(); | ||
(()=>{"use strict";var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{LavaDome:()=>K,LavaDomeDebug:()=>V});const{Object:o,Array:n,Function:r,Math:a,parseInt:s,WeakMap:l,Error:i,JSON:p}=globalThis,{defineProperties:u,assign:c,getOwnPropertyDescriptor:d,entries:f,create:g,hasOwn:y}=o,{from:b}=n,{random:h}=a,{stringify:m}=p,v=(e,t,o)=>e&&r.prototype.call.bind(d(e,t)[o]),w=v(globalThis?.DocumentFragment?.prototype,"replaceChildren","value"),T=v(globalThis?.Element?.prototype,"attachShadow","value"),O=v(globalThis?.Document?.prototype,"createElement","value"),S=v(globalThis?.Node?.prototype,"appendChild","value"),x=v(globalThis?.Node?.prototype,"textContent","set"),D=v(globalThis?.Element?.prototype,"setAttribute","value"),I=v(globalThis?.String?.prototype,"toUpperCase","value"),M=v(globalThis?.Array?.prototype,"map","value"),j=v(globalThis?.Array?.prototype,"join","value"),C=v(globalThis?.Array?.prototype,"keys","value"),k=v(globalThis?.Array?.prototype,"at","value"),L=v(globalThis?.WeakMap?.prototype,"get","value"),A=v(globalThis?.WeakMap?.prototype,"set","value"),P=v(globalThis?.Number?.prototype,"toFixed","value"),_={isInnerInstance:Symbol("isInnerInstance"),unsafeOpenModeShadow:"unsafeOpenModeShadow"},E=e=>function(t,o,n){const r=e[t];return y(e,t)?typeof r!==o?n:r:n},F="abcdefghijklmnopqrstuvwxyz",N="0123456789",$="!@#$%^&*()?.;:\"'[]{}+=-_/",R={letters:F,digits:N,symbols:$,alphanumeric:F+N,all:F+I(F)+N+$},{letters:W,alphanumeric:q,all:z}=R,B=(e,t)=>e[s(P(h()*t))];function U(e,t,o=""){return e=j(M(f(e),(([e,t])=>`${e}: ${t} !important`)),"; "),function(){const n=O(document,t());return D(n,"style",e),x(n,o),n}}const G=e=>()=>e(),J=G(U({"-webkit-user-modify":"unset","-webkit-user-select":"none","user-select":"none"},(()=>(7,B(W,26)+j(M(b(C(n(7))),(()=>B(q,36))),""))))),Y=G(U({top:"-10px",right:"-10px",position:"fixed","font-size":"1px"},(()=>"span"),z)),H=new l;function K(e,t){t=function(e={}){const{unsafeOpenModeShadow:t,isInnerInstance:o}=_,n=E(c(g(null),e)),r=g(null);return r.isInnerInstance=n(o,"boolean",!1),r.unsafeOpenModeShadow=n(t,"boolean",!1),r}(t),u(this,{text:{value:function(e){if("string"!=typeof e)throw new i(`LavaDomeCore: first argument must be a string, instead got ${m(e)}`);if(void 0===k(b(e),1))return x(n,e);M(b(e),(e=>{const o=O(document,"span");t[_.isInnerInstance]=!0,new K(o,t).text(e),S(n,o)})),S(n,Y())}}});const o=function(e,t){const{unsafeOpenModeShadow:o,isInnerInstance:n}=t;let r=L(H,e);if(!r){const t={mode:"closed"};o&&(t.mode="open",n||console.warn("LavaDome:",`Initiated with "${_.unsafeOpenModeShadow}" set to true.`,"This leaves LavaDome fully vulnerable, ONLY USE FOR TESTING!")),r=T(e,t),A(H,e,r)}return r}(e,t);w(o);const n=J();S(o,n)}const{all:Q}=R,V={getTextByRoot:function(e){console.warn("LavaDomeDebug(getTextByRoot):","Call/include this function for testing/debugging purposes only!",`(remember, '${_.unsafeOpenModeShadow}' must be enabled for this function to work)`);let t="";const o=e?.shadowRoot;if(!o)return t;const n=b(o.querySelectorAll("span"));return M(n,(e=>{const o=e?.shadowRoot?.firstChild?.textContent;o&&(t+=o)})),t},stripDistractionFromText:function(e){return console.warn("LavaDomeDebug(stripDistractionFromText):","Call/include this function for testing/debugging purposes only!"),e.split(Q).join("").split("\n").join("").split("\r").join("").split("\t").join("")}};var X=exports;for(var Z in t)X[Z]=t[Z];t.__esModule&&Object.defineProperty(X,"__esModule",{value:!0})})(); | ||
//# sourceMappingURL=main.js.map |
{ | ||
"name": "@lavamoat/lavadome-core", | ||
"version": "0.0.16", | ||
"version": "0.0.17", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
19173
265