@soyio/soyio-widget 2.16.1 → 2.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +5 -1
package/dist/index.js
CHANGED
package/dist/index.umd.cjs
CHANGED
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
0% { background-position: 200% 0; }
|
|
122
122
|
100% { background-position: -200% 0; }
|
|
123
123
|
}
|
|
124
|
-
`,document.head.appendChild(X)}d.appendChild(v),d.appendChild(y),d.appendChild(E),F.appendChild(q),F.appendChild(oe),W.appendChild(U),W.appendChild(F),g.appendChild(d),g.appendChild(W),this.element.appendChild(g)}cleanupExistingSkeleton(){const l=document.getElementById(this.identifier);l&&l.remove()}mount(l){this.cleanupExistingSkeleton(),l.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}const ze="2.16.
|
|
124
|
+
`,document.head.appendChild(X)}d.appendChild(v),d.appendChild(y),d.appendChild(E),F.appendChild(q),F.appendChild(oe),W.appendChild(U),W.appendChild(F),g.appendChild(d),g.appendChild(W),this.element.appendChild(g)}cleanupExistingSkeleton(){const l=document.getElementById(this.identifier);l&&l.remove()}mount(l){this.cleanupExistingSkeleton(),l.appendChild(this.element)}hide(){this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300)}}const ze="2.16.3";function mn(f){var E;const l=["actionToken","entityId","context","optionalReconsentBehavior","mandatoryReconsentBehavior"],g=(E=f.isSandbox)!=null?E:!1,d=f.developmentUrl||(g?at:it),v=new URLSearchParams;v.set("sdkVersion",ze),l.forEach(W=>{f[W]&&v.set(W,f[W])});const y=v.toString();return`${d}/embed/consents/${f.consentTemplateId}${y?`?${y}`:""}`}class Le extends xe{constructor(g){super(g);j(this,"defaultIframePrefix","consent-box");j(this,"defaultIframeCSSConfig",fn);j(this,"state",{isSelected:!1,actionToken:null});this.Skeleton=hn}get uniqueIdentifier(){return this.options.consentTemplateId}iframeUrl(){return mn(this.options)}handleStateChange(g){const{isSelected:d,actionToken:v}=g;this.state={isSelected:d,actionToken:v},this.options.onEvent({eventName:"CONSENT_CHECKBOX_CHANGE",isSelected:d,actionToken:v})}setupListeners(){return G(this,null,function*(){yield Vt(Le.prototype,this,"setupListeners").call(this),ot(this.uniqueIdentifier,{onStateChange:this.handleStateChange.bind(this)})})}getState(){return this.state}}function pn(f){var y,E,W;const l=(y=f.isSandbox)!=null?y:!1,g=f.developmentUrl||(l?rn:nn),d=new URLSearchParams;if(d.set("sdkVersion",ze),f.sessionToken?d.set("sessionToken",f.sessionToken):f.companyId&&d.set("companyId",f.companyId),(E=f.enabledFeatures)!=null&&E.length&&d.set("enabledFeatures",f.enabledFeatures.join(",")),(W=f.dataSubjects)!=null&&W.length&&d.set("dataSubjects",f.dataSubjects.join(",")),f.requestReference&&d.set("requestReference",f.requestReference),f.fileRequisites){const U=JSON.stringify(f.fileRequisites);U!=="{}"&&d.set("fileRequisites",U)}const v=d.toString();return`${g}${v?`?${v}`:""}`}class vn extends xe{constructor(){super(...arguments);j(this,"defaultIframePrefix","privacy-center");j(this,"_uniqueIdentifier","privacy-center");j(this,"defaultIframeCSSConfig",ln)}get uniqueIdentifier(){return this._uniqueIdentifier}iframeUrl(){return pn(this.options)}}const wn=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gn="WIDGET_EVENT";function yn(f){let l="widget/";return"disclosureRequestId"in f.configProps?l+=["disclosures",f.configProps.disclosureRequestId].join("/"):l+=f.request,l}function En(f){var y;const l=(y=f.isSandbox)!=null?y:!1,g=f.developmentUrl||(l?at:it),d=Object.entries(f.configProps).filter(([E,W])=>W||E==="disclosureRequestId").map(([E,W])=>`${E}=${encodeURIComponent(W)}`).join("&"),v=yn(f);return`${g}/${v}?sdk=web&sdkVersion=${ze}&${d}`}let Q=null,ke=null;function Ue(f=null){Q&&!Q.closed&&Q.focus(),f==null||f.preventDefault()}function Ie(){document.body.style.filter="",document.body.removeEventListener("click",Ue)}function Sn(){ke=setInterval(()=>{(!Q||Q.closed)&&(ke&&clearInterval(ke),Ie())},cn)}function bn(f){const l=En(f),g=sn,d=un,v=window.screenLeft!==void 0?window.screenLeft:window.screenX,y=window.screenTop!==void 0?window.screenTop:window.screenY,E=window.innerWidth||document.documentElement.clientWidth||window.screen.width,W=window.innerHeight||document.documentElement.clientHeight||window.screen.height,U=E/window.screen.availWidth,F=(E-g)/2/U+v,q=(W-d)/2/U+y,oe=["scrollbars=yes",`width=${g}`,`height=${d}`,`top=${q}`,`left=${F}`].join(","),X=window.open("about:blank","Soyio",oe);X?(Q=X,Q.location.href=l,document.body.style.filter="blur(5px)",document.body.addEventListener("click",Ue),Ue(),Sn()):(Ie(),alert("Debes habilitar las ventanas emergentes para poder iniciar el flujo."))}function xn(){Q&&(Q.close(),Q=null),Ie()}let he=null;function In(){he&&(he.cancel(),he=null)}function Wn(f){return G(this,null,function*(){const{onEvent:l}=f,g=yield Promise.resolve().then(()=>He);he&&In(),he=g.on(gn,v=>G(null,[v],function*({data:d}){return l(d),on.includes(d.eventName)?xn():d.eventName===an&&Ie(),Promise.resolve()}))})}function Pn(f){Wn(f)}class st{constructor(l){$t(this,Pe);j(this,"onEvent");this.onEvent=l.onEvent,R&&(bn(l),Pn({onEvent:Gt(this,Pe,Jt).bind(this)}))}}Pe=new WeakSet,Jt=function(l){this.onEvent(l)};function Tn(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var Fe={exports:{}},We={exports:{}},Cn=We.exports,ut;function Rn(){return ut||(ut=1,function(f,l){(function(g,d){f.exports=d()})(typeof self!="undefined"?self:Cn,function(){return function(g){var d={};function v(y){if(d[y])return d[y].exports;var E=d[y]={i:y,l:!1,exports:{}};return g[y].call(E.exports,E,E.exports,v),E.l=!0,E.exports}return v.m=g,v.c=d,v.d=function(y,E,W){v.o(y,E)||Object.defineProperty(y,E,{enumerable:!0,get:W})},v.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},v.t=function(y,E){if(1&E&&(y=v(y)),8&E||4&E&&typeof y=="object"&&y&&y.__esModule)return y;var W=Object.create(null);if(v.r(W),Object.defineProperty(W,"default",{enumerable:!0,value:y}),2&E&&typeof y!="string")for(var U in y)v.d(W,U,function(F){return y[F]}.bind(null,U));return W},v.n=function(y){var E=y&&y.__esModule?function(){return y.default}:function(){return y};return v.d(E,"a",E),E},v.o=function(y,E){return{}.hasOwnProperty.call(y,E)},v.p="",v(v.s=0)}([function(g,d,v){v.r(d),v.d(d,"Promise",function(){return C}),v.d(d,"TYPES",function(){return Xn}),v.d(d,"ProxyWindow",function(){return Y}),v.d(d,"setup",function(){return Ht}),v.d(d,"destroy",function(){return Kn}),v.d(d,"serializeMessage",function(){return Vn}),v.d(d,"deserializeMessage",function(){return Jn}),v.d(d,"createProxyWindow",function(){return Yn}),v.d(d,"toProxyWindow",function(){return Zn}),v.d(d,"on",function(){return ce}),v.d(d,"once",function(){return Gn}),v.d(d,"send",function(){return ne}),v.d(d,"markWindowKnown",function(){return Rt}),v.d(d,"cleanUpWindow",function(){return Qn}),v.d(d,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var E=`Call was rejected by callee.\r
|
|
125
125
|
`;function W(e){return e===void 0&&(e=window),e.location.protocol}function U(e){if(e===void 0&&(e=window),e.mockDomain){var n=e.mockDomain.split("//")[0];if(n)return n}return W(e)}function F(e){return e===void 0&&(e=window),U(e)==="about:"}function q(e){if(e===void 0&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch(n){}}function oe(e){if(e===void 0&&(e=window),e&&!q(e))try{return e.opener}catch(n){}}function X(e){try{return!0}catch(n){}return!1}function Te(e){e===void 0&&(e=window);var n=e.location;if(!n)throw new Error("Can not read window location");var t=W(e);if(!t)throw new Error("Can not read window protocol");if(t==="file:")return"file://";if(t==="about:"){var r=q(e);return r&&X()?Te(r):"about://"}var o=n.host;if(!o)throw new Error("Can not read window host");return t+"//"+o}function B(e){e===void 0&&(e=window);var n=Te(e);return n&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:n}function ie(e){if(!function(n){try{if(n===window)return!0}catch(r){}try{var t=Object.getOwnPropertyDescriptor(n,"location");if(t&&t.enumerable===!1)return!1}catch(r){}try{if(F(n)&&X())return!0}catch(r){}try{if(function(r){return r===void 0&&(r=window),U(r)==="mock:"}(n)&&X())return!0}catch(r){}try{if(Te(n)===Te(window))return!0}catch(r){}return!1}(e))return!1;try{if(e===window||F(e)&&X()||B(window)===B(e))return!0}catch(n){}return!1}function Ce(e){if(!ie(e))throw new Error("Expected window to be same domain");return e}function ft(e,n){if(!e||!n)return!1;var t=q(n);return t?t===e:function(r){var o=[];try{for(;r.parent!==r;)o.push(r.parent),r=r.parent}catch(i){}return o}(n).indexOf(e)!==-1}function lt(e){var n=[],t;try{t=e.frames}catch(u){t=e}var r;try{r=t.length}catch(u){}if(r===0)return n;if(r){for(var o=0;o<r;o++){var i=void 0;try{i=t[o]}catch(u){continue}n.push(i)}return n}for(var a=0;a<100;a++){var c=void 0;try{c=t[a]}catch(u){return n}if(!c)return n;n.push(c)}return n}var An=[],Nn=[];function Z(e,n){n===void 0&&(n=!0);try{if(e===window)return!1}catch(o){return!0}try{if(!e)return!0}catch(o){return!0}try{if(e.closed)return!0}catch(o){return!o||o.message!==E}if(n&&ie(e))try{if(e.mockclosed)return!0}catch(o){}try{if(!e.parent||!e.top)return!0}catch(o){}var t=function(o,i){for(var a=0;a<o.length;a++)try{if(o[a]===i)return a}catch(c){}return-1}(An,e);if(t!==-1){var r=Nn[t];if(r&&function(o){if(!o.contentWindow||!o.parentNode)return!0;var i=o.ownerDocument;if(i&&i.documentElement&&!i.documentElement.contains(o)){for(var a=o;a.parentNode&&a.parentNode!==a;)a=a.parentNode;if(!a.host||!i.documentElement.contains(a.host))return!0}return!1}(r))return!0}return!1}function ht(e){return e===void 0&&(e=window),oe(e=e||window)||q(e)||void 0}function de(e,n){if(typeof e=="string"){if(typeof n=="string")return e==="*"||n===e;if(y(n)||Array.isArray(n))return!1}return y(e)?y(n)?e.toString()===n.toString():!Array.isArray(n)&&!!n.match(e):!!Array.isArray(e)&&(Array.isArray(n)?JSON.stringify(e)===JSON.stringify(n):!y(n)&&e.some(function(t){return de(t,n)}))}function Re(e){try{if(e===window)return!0}catch(n){if(n&&n.message===E)return!0}try{if({}.toString.call(e)==="[object Window]")return!0}catch(n){if(n&&n.message===E)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.self===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.parent===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.top===e)return!0}catch(n){if(n&&n.message===E)return!0}try{if(e&&e.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch(n){return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch(n){}return!1}function mt(e){if(ie(e))return Ce(e).frameElement;for(var n=0,t=document.querySelectorAll("iframe");n<t.length;n++){var r=t[n];if(r&&r.contentWindow&&r.contentWindow===e)return r}}function Dn(e){if(function(t){return t===void 0&&(t=window),!!q(t)}(e)){var n=mt(e);if(n&&n.parentElement){n.parentElement.removeChild(n);return}}try{e.close()}catch(t){}}function ae(e){try{if(!e)return!1;if(typeof Promise!="undefined"&&e instanceof Promise)return!0;if(typeof window!="undefined"&&typeof window.Window=="function"&&e instanceof window.Window||typeof window!="undefined"&&typeof window.constructor=="function"&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var t=n.call(e);if(t==="[object Window]"||t==="[object global]"||t==="[object DOMWindow]")return!1}if(typeof e.then=="function")return!0}catch(r){return!1}return!1}var pt=[],me=[],qe=0,pe;function vt(){if(!qe&&pe){var e=pe;pe=null,e.resolve()}}function _e(){qe+=1}function ve(){qe-=1,vt()}var C=function(){function e(t){var r=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var o,i,a=!1,c=!1,u=!1;_e();try{t(function(s){u?r.resolve(s):(a=!0,o=s)},function(s){u?r.reject(s):(c=!0,i=s)})}catch(s){ve(),this.reject(s);return}ve(),u=!0,a?this.resolve(o):c&&this.reject(i)}}var n=e.prototype;return n.resolve=function(t){if(this.resolved||this.rejected)return this;if(ae(t))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=t,this.dispatch(),this},n.reject=function(t){var r=this;if(this.resolved||this.rejected)return this;if(ae(t))throw new Error("Can not reject promise with another promise");if(!t){var o=t&&typeof t.toString=="function"?t.toString():{}.toString.call(t);t=new Error("Expected reject to be called with Error, got "+o)}return this.rejected=!0,this.error=t,this.errorHandled||setTimeout(function(){r.errorHandled||function(i,a){if(pt.indexOf(i)===-1){pt.push(i),setTimeout(function(){throw i},1);for(var c=0;c<me.length;c++)me[c](i,a)}}(t,r)},1),this.dispatch(),this},n.asyncReject=function(t){return this.errorHandled=!0,this.reject(t),this},n.dispatch=function(){var t=this.resolved,r=this.rejected,o=this.handlers;if(!this.dispatching&&(t||r)){this.dispatching=!0,_e();for(var i=function(w,x){return w.then(function(S){x.resolve(S)},function(S){x.reject(S)})},a=0;a<o.length;a++){var c=o[a],u=c.onSuccess,s=c.onError,p=c.promise,h=void 0;if(t)try{h=u?u(this.value):this.value}catch(w){p.reject(w);continue}else if(r){if(!s){p.reject(this.error);continue}try{h=s(this.error)}catch(w){p.reject(w);continue}}if(h instanceof e&&(h.resolved||h.rejected)){var m=h;m.resolved?p.resolve(m.value):p.reject(m.error),m.errorHandled=!0}else ae(h)?h instanceof e&&(h.resolved||h.rejected)?h.resolved?p.resolve(h.value):p.reject(h.error):i(h,p):p.resolve(h)}o.length=0,this.dispatching=!1,ve()}},n.then=function(t,r){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.then expected a function for success handler");if(r&&typeof r!="function"&&!r.call)throw new Error("Promise.then expected a function for error handler");var o=new e;return this.handlers.push({promise:o,onSuccess:t,onError:r}),this.errorHandled=!0,this.dispatch(),o},n.catch=function(t){return this.then(void 0,t)},n.finally=function(t){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(t).then(function(){return r})},function(r){return e.try(t).then(function(){throw r})})},n.timeout=function(t,r){var o=this;if(this.resolved||this.rejected)return this;var i=setTimeout(function(){o.resolved||o.rejected||o.reject(r||new Error("Promise timed out after "+t+"ms"))},t);return this.then(function(a){return clearTimeout(i),a})},n.toPromise=function(){if(typeof Promise=="undefined")throw new TypeError("Could not find Promise");return Promise.resolve(this)},n.lazy=function(){return this.errorHandled=!0,this},e.resolve=function(t){return t instanceof e?t:ae(t)?new e(function(r,o){return t.then(r,o)}):new e().resolve(t)},e.reject=function(t){return new e().reject(t)},e.asyncReject=function(t){return new e().asyncReject(t)},e.all=function(t){var r=new e,o=t.length,i=[].slice();if(!o)return r.resolve(i),r;for(var a=function(s,p,h){return p.then(function(m){i[s]=m,(o-=1)==0&&r.resolve(i)},function(m){h.reject(m)})},c=0;c<t.length;c++){var u=t[c];if(u instanceof e){if(u.resolved){i[c]=u.value,o-=1;continue}}else if(!ae(u)){i[c]=u,o-=1;continue}a(c,e.resolve(u),r)}return o===0&&r.resolve(i),r},e.hash=function(t){var r={},o=[],i=function(c){if(t.hasOwnProperty(c)){var u=t[c];ae(u)?o.push(u.then(function(s){r[c]=s})):r[c]=u}};for(var a in t)i(a);return e.all(o).then(function(){return r})},e.map=function(t,r){return e.all(t.map(r))},e.onPossiblyUnhandledException=function(t){return function(r){return me.push(r),{cancel:function(){me.splice(me.indexOf(r),1)}}}(t)},e.try=function(t,r,o){if(t&&typeof t!="function"&&!t.call)throw new Error("Promise.try expected a function");var i;_e();try{i=t.apply(r,o||[])}catch(a){return ve(),e.reject(a)}return ve(),e.resolve(i)},e.delay=function(t){return new e(function(r){setTimeout(r,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||ae(t)},e.flush=function(){return function(t){var r=pe=pe||new t;return vt(),r}(e)},e}();function Oe(e,n){for(var t=0;t<e.length;t++)try{if(e[t]===n)return t}catch(r){}return-1}var Be=function(){function e(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap=="undefined"||Object.freeze===void 0)return!1;try{var t=new WeakMap,r={};return Object.freeze(r),t.set(r,"__testvalue__"),t.get(r)==="__testvalue__"}catch(o){return!1}}())try{this.weakmap=new WeakMap}catch(t){}this.keys=[],this.values=[]}var n=e.prototype;return n._cleanupClosedWindows=function(){for(var t=this.weakmap,r=this.keys,o=0;o<r.length;o++){var i=r[o];if(Re(i)&&Z(i)){if(t)try{t.delete(i)}catch(a){}r.splice(o,1),this.values.splice(o,1),o-=1}}},n.isSafeToReadWrite=function(t){return!Re(t)},n.set=function(t,r){if(!t)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.set(t,r)}catch(p){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var i=this.name,a=t[i];a&&a[0]===t?a[1]=r:Object.defineProperty(t,i,{value:[t,r],writable:!0});return}catch(p){}this._cleanupClosedWindows();var c=this.keys,u=this.values,s=Oe(c,t);s===-1?(c.push(t),u.push(r)):u[s]=r},n.get=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return r.get(t)}catch(a){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return o&&o[0]===t?o[1]:void 0}catch(a){}this._cleanupClosedWindows();var i=Oe(this.keys,t);if(i!==-1)return this.values[i]},n.delete=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.delete(t)}catch(c){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];o&&o[0]===t&&(o[0]=o[1]=void 0)}catch(c){}this._cleanupClosedWindows();var i=this.keys,a=Oe(i,t);a!==-1&&(i.splice(a,1),this.values.splice(a,1))},n.has=function(t){if(!t)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(t))return!0}catch(i){delete this.weakmap}if(this.isSafeToReadWrite(t))try{var o=t[this.name];return!(!o||o[0]!==t)}catch(i){}return this._cleanupClosedWindows(),Oe(this.keys,t)!==-1},n.getOrSet=function(t,r){if(this.has(t))return this.get(t);var o=r();return this.set(t,o),o},e}();function wt(e){return e.name||e.__name__||e.displayName||"anonymous"}function gt(e,n){try{delete e.name,e.name=n}catch(t){}return e.__name__=e.displayName=n,e}function ee(){var e="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+function(n){if(typeof btoa=="function")return btoa(encodeURIComponent(n).replace(/%([0-9A-F]{2})/g,function(t,r){return String.fromCharCode(parseInt(r,16))})).replace(/[=]/g,"");if(typeof Buffer!="undefined")return Buffer.from(n,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var Ae;function yt(e){try{return JSON.stringify([].slice.call(e),function(n,t){return typeof t=="function"?"memoize["+function(r){if(Ae=Ae||new Be,r==null||typeof r!="object"&&typeof r!="function")throw new Error("Invalid object");var o=Ae.get(r);return o||(o=typeof r+":"+ee(),Ae.set(r,o)),o}(t)+"]":typeof window!="undefined"&&t instanceof window.Element||t!==null&&typeof t=="object"&&t.nodeType===1&&typeof t.style=="object"&&typeof t.ownerDocument=="object"?{}:t})}catch(n){throw new Error("Arguments not serializable -- can not be used to memoize")}}function jn(){return{}}var we=0,Et=0;function ge(e,n){n===void 0&&(n={});var t=n.thisNamespace,r=t!==void 0&&t,o=n.time,i,a,c=we;we+=1;var u=function(){for(var s=arguments.length,p=new Array(s),h=0;h<s;h++)p[h]=arguments[h];c<Et&&(i=null,a=null,c=we,we+=1);var m;m=r?(a=a||new Be).getOrSet(this,jn):i=i||{};var w;try{w=yt(p)}catch(O){return e.apply(this,arguments)}var x=m[w];if(x&&o&&Date.now()-x.time<o&&(delete m[w],x=null),x)return x.value;var S=Date.now(),b=e.apply(this,arguments);return m[w]={time:S,value:b},b};return u.reset=function(){i=null,a=null},gt(u,(n.name||wt(e))+"::memoized")}ge.clear=function(){Et=we};function Mn(e){var n={};function t(){for(var r=arguments,o=this,i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];var u=yt(a);return n.hasOwnProperty(u)||(n[u]=C.try(function(){return e.apply(o,r)}).finally(function(){delete n[u]})),n[u]}return t.reset=function(){n={}},gt(t,wt(e)+"::promiseMemoized")}function se(){}function ye(e,n){if(n===void 0&&(n=1),n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+{}.toString.call(e)+">";if(typeof e=="string")return e;if(e instanceof Error){var t=e&&e.stack,r=e&&e.message;if(t&&r)return t.indexOf(r)!==-1?t:r+`
|
|
126
126
|
`+t;if(t)return t;if(r)return r}return e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}catch(o){return"Error while stringifying error: "+ye(o,n+1)}}function St(e){return typeof e=="string"?e:e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}ge(function(e){if(Object.values)return Object.values(e);var n=[];for(var t in e)e.hasOwnProperty(t)&&n.push(e[t]);return n});function $e(e){return{}.toString.call(e)==="[object RegExp]"}function Ee(e,n,t){if(e.hasOwnProperty(n))return e[n];var r=t();return e[n]=r,r}function bt(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function xt(){return!!document.body&&document.readyState==="complete"}function It(){return!!document.body&&document.readyState==="interactive"}ge(function(){return new C(function(e){if(xt()||It())return e();var n=setInterval(function(){if(xt()||It())return clearInterval(n),e()},10)})});var Ne=typeof document!="undefined"?document.currentScript:null,zn=ge(function(){if(Ne||(Ne=function(){try{var e=function(){try{throw new Error("_")}catch(a){return a.stack||""}}(),n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e),t=n&&n[1];if(!t)return;for(var r=0,o=[].slice.call(document.getElementsByTagName("script")).reverse();r<o.length;r++){var i=o[r];if(i.src&&i.src===t)return i}}catch(a){}}()))return Ne;throw new Error("Can not determine current script")}),Ln=ee();ge(function(){var e;try{e=zn()}catch(r){return Ln}var n=e.getAttribute("data-uid");if(n&&typeof n=="string"||(n=e.getAttribute("data-uid-auto"))&&typeof n=="string")return n;if(e.src){var t=function(r){for(var o="",i=0;i<r.length;i++){var a=r[i].charCodeAt(0)*i;r[i+1]&&(a+=r[i+1].charCodeAt(0)*(i-1)),o+=String.fromCharCode(97+Math.abs(a)%26)}return o}(JSON.stringify({src:e.src,dataset:e.dataset}));n="uid_"+t.slice(t.length-30)}else n=ee();return e.setAttribute("data-uid-auto",n),n});function Se(e){e===void 0&&(e=window);var n="__post_robot_10_0_46__";return e!==window?e[n]:e[n]=e[n]||{}}var Wt=function(){return{}};function L(e,n){return e===void 0&&(e="store"),n===void 0&&(n=Wt),Ee(Se(),e,function(){var t=n();return{has:function(r){return t.hasOwnProperty(r)},get:function(r,o){return t.hasOwnProperty(r)?t[r]:o},set:function(r,o){return t[r]=o,o},del:function(r){delete t[r]},getOrSet:function(r,o){return Ee(t,r,o)},reset:function(){t=n()},keys:function(){return Object.keys(t)}}})}var kn=function(){};function De(){var e=Se();return e.WINDOW_WILDCARD=e.WINDOW_WILDCARD||new kn,e.WINDOW_WILDCARD}function $(e,n){return e===void 0&&(e="store"),n===void 0&&(n=Wt),L("windowStore").getOrSet(e,function(){var t=new Be,r=function(o){return t.getOrSet(o,n)};return{has:function(o){return r(o).hasOwnProperty(e)},get:function(o,i){var a=r(o);return a.hasOwnProperty(e)?a[e]:i},set:function(o,i){return r(o)[e]=i,i},del:function(o){delete r(o)[e]},getOrSet:function(o,i){return Ee(r(o),e,i)}}})}function Pt(){return L("instance").getOrSet("instanceID",ee)}function Tt(e,n){var t=n.domain,r=$("helloPromises"),o=r.get(e);o&&o.resolve({domain:t});var i=C.resolve({domain:t});return r.set(e,i),i}function Ge(e,n){return(0,n.send)(e,"postrobot_hello",{instanceID:Pt()},{domain:"*",timeout:-1}).then(function(t){var r=t.origin,o=t.data.instanceID;return Tt(e,{domain:r}),{win:e,domain:r,instanceID:o}})}function Ct(e,n){var t=n.send;return $("windowInstanceIDPromises").getOrSet(e,function(){return Ge(e,{send:t}).then(function(r){return r.instanceID})})}function Rt(e){$("knownWindows").set(e,!0)}function Ve(e){return typeof e=="object"&&e!==null&&typeof e.__type__=="string"}function Ot(e){return e===void 0?"undefined":e===null?"null":Array.isArray(e)?"array":typeof e=="function"?"function":typeof e=="object"?e instanceof Error?"error":typeof e.then=="function"?"promise":{}.toString.call(e)==="[object RegExp]"?"regex":{}.toString.call(e)==="[object Date]"?"date":"object":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":void 0}function ue(e,n){return{__type__:e,__val__:n}}var V,Un=((V={}).function=function(){},V.error=function(e){return ue("error",{message:e.message,stack:e.stack,code:e.code,data:e.data})},V.promise=function(){},V.regex=function(e){return ue("regex",e.source)},V.date=function(e){return ue("date",e.toJSON())},V.array=function(e){return e},V.object=function(e){return e},V.string=function(e){return e},V.number=function(e){return e},V.boolean=function(e){return e},V.null=function(e){return e},V[void 0]=function(e){return ue("undefined",e)},V),Fn={},J,Hn=((J={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},J.error=function(e){var n=e.stack,t=e.code,r=e.data,o=new Error(e.message);return o.code=t,r&&(o.data=r),o.stack=n+`
|
|
127
127
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soyio/soyio-widget",
|
|
3
|
-
"version": "2.16.
|
|
3
|
+
"version": "2.16.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.umd.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/Soyio-id/soy-io-widget"
|
|
11
|
+
},
|
|
8
12
|
"exports": {
|
|
9
13
|
".": {
|
|
10
14
|
"import": "./dist/index.js",
|