@imtbl/sdk 0.23.1 → 0.23.2-alpha.2

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.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_imtbl_checkout_widgets_lib=self.webpackChunk_imtbl_checkout_widgets_lib||[]).push([[464],{264:function(t,n,i){function e(t,n){var i,e;return"boolean"===typeof(null===n||void 0===n?void 0:n.enabled)?n.enabled:null===(e=null===(i=null===t||void 0===t?void 0:t.__default)||void 0===i?void 0:i.enabled)||void 0===e||e}i.d(n,{n:function(){return e}})},74345:function(t,n,i){i.r(n),i.d(n,{LegacyDestination:function(){return S},ajsDestinations:function(){return I}});var e=i(33621),o=i(38667),r=i(99817),s=i(17999),a=i(80985),u=i(68119),c=i(41133),d=i(264),l=i(82263),h=i(69052),v=i(10001),f=i(90462),p=i(17677),g=i(3256),m=i(93325);function y(t){return t.toLowerCase().replace(".","").replace(/\s+/g,"-")}function w(t,n){return void 0===n&&(n=!1),n?btoa(t).replace(/=/g,""):void 0}function b(t,n,i,o){return(0,e.mG)(this,void 0,void 0,(function(){var r,s,a,u,c,d;return(0,e.Jh)(this,(function(l){switch(l.label){case 0:r=y(n),s=w(r,o),a=(0,g.Kg)(),u="".concat(a,"/integrations/").concat(null!==s&&void 0!==s?s:r,"/").concat(i,"/").concat(null!==s&&void 0!==s?s:r,".dynamic.js.gz"),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,(0,m.v)(u)];case 2:return l.sent(),function(t,n,i){var o,r;try{var s=(null!==(r=null===(o=null===window||void 0===window?void 0:window.performance)||void 0===o?void 0:o.getEntriesByName(t,"resource"))&&void 0!==r?r:[])[0];s&&n.stats.gauge("legacy_destination_time",Math.round(s.duration),(0,e.ev)([i],s.duration<100?["cached"]:[],!0))}catch(a){}}(u,t,n),[3,4];case 3:throw c=l.sent(),t.stats.gauge("legacy_destination_time",-1,["plugin:".concat(n),"failed"]),c;case 4:return d=window["".concat(r,"Deps")],[4,Promise.all(d.map((function(t){return(0,m.v)(a+t+".gz")})))];case 5:return l.sent(),window["".concat(r,"Loader")](),[2,window["".concat(r,"Integration")]]}}))}))}var _=i(20298),k=function(t,n){var i,e=n.type,o=n.bundlingStatus,r=n.versionSettings,s="unbundled"!==o&&("browser"===e||(null===(i=null===r||void 0===r?void 0:r.componentTypes)||void 0===i?void 0:i.includes("browser")));return!t.startsWith("Segment")&&"Iterable"!==t&&s},z=function(t,n){var i=!1===n.All&&void 0===n[t];return!1===n[t]||i};function G(t,n){return(0,e.mG)(this,void 0,void 0,(function(){var i,o=this;return(0,e.Jh)(this,(function(a){switch(a.label){case 0:return i=[],(0,r.s)()?[2,n]:[4,(0,h.x)((function(){return n.length>0&&(0,r.G)()}),(function(){return(0,e.mG)(o,void 0,void 0,(function(){var o,r;return(0,e.Jh)(this,(function(e){switch(e.label){case 0:return(o=n.pop())?[4,(0,c.a)(o,t)]:[2];case 1:return r=e.sent(),r instanceof s._||i.push(o),[2]}}))}))}))];case 1:return a.sent(),i.map((function(t){return n.pushWithBackoff(t)})),[2,n]}}))}))}var S=function(){function t(t,n,i,o,r,s){void 0===o&&(o={}),this.options={},this.type="destination",this.middleware=[],this._ready=!1,this._initialized=!1,this.flushing=!1,this.name=t,this.version=n,this.settings=(0,e.pi)({},o),this.disableAutoISOConversion=r.disableAutoISOConversion||!1,this.integrationSource=s,this.settings.type&&"browser"===this.settings.type&&delete this.settings.type,this.options=r,this.buffer=r.disableClientPersistence?new v.Z(4,[]):new f.$(4,"".concat(i,":dest-").concat(t)),this.scheduleFlush()}return t.prototype.isLoaded=function(){return this._ready},t.prototype.ready=function(){var t;return null!==(t=this.onReady)&&void 0!==t?t:Promise.resolve()},t.prototype.load=function(t,n){var i;return(0,e.mG)(this,void 0,void 0,(function(){var o,r,s=this;return(0,e.Jh)(this,(function(e){switch(e.label){case 0:return this._ready||void 0!==this.onReady?[2]:null===(i=this.integrationSource)||void 0===i?[3,1]:(r=i,[3,3]);case 1:return[4,b(t,this.name,this.version,this.options.obfuscate)];case 2:r=e.sent(),e.label=3;case 3:o=r,this.integration=function(t,n,i){var e;"Integration"in t?(t({user:function(){return i.user()},addIntegration:function(){}}),e=t.Integration):e=t;var o=new e(n);return o.analytics=i,o}(o,this.settings,n),this.onReady=new Promise((function(t){s.integration.once("ready",(function(){s._ready=!0,t(!0)}))})),this.onInitialize=new Promise((function(t){s.integration.on("initialize",(function(){s._initialized=!0,t(!0)}))}));try{t.stats.increment("analytics_js.integration.invoke",1,["method:initialize","integration_name:".concat(this.name)]),this.integration.initialize()}catch(a){throw t.stats.increment("analytics_js.integration.invoke.error",1,["method:initialize","integration_name:".concat(this.name)]),a}return[2]}}))}))},t.prototype.unload=function(t,n){return function(t,n,i){return(0,e.mG)(this,void 0,void 0,(function(){var o,r,s,a;return(0,e.Jh)(this,(function(e){return o=(0,g.Kg)(),r=y(t),s=w(t,i),a="".concat(o,"/integrations/").concat(null!==s&&void 0!==s?s:r,"/").concat(n,"/").concat(null!==s&&void 0!==s?s:r,".dynamic.js.gz"),[2,(0,m.t)(a)]}))}))}(this.name,this.version,this.options.obfuscate)},t.prototype.addMiddleware=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];this.middleware=(t=this.middleware).concat.apply(t,n)},t.prototype.shouldBuffer=function(t){return"page"!==t.event.type&&((0,r.s)()||!1===this._ready||!1===this._initialized)},t.prototype.send=function(t,n,i){var o,r;return(0,e.mG)(this,void 0,void 0,(function(){var s,u,c,l,h,v;return(0,e.Jh)(this,(function(f){switch(f.label){case 0:if(this.shouldBuffer(t))return this.buffer.push(t),this.scheduleFlush(),[2,t];if(s=null===(r=null===(o=this.options)||void 0===o?void 0:o.plan)||void 0===r?void 0:r.track,u=t.event.event,s&&u&&"Segment.io"!==this.name){if(c=s[u],!(0,d.n)(s,c))return t.updateEvent("integrations",(0,e.pi)((0,e.pi)({},t.event.integrations),{All:!1,"Segment.io":!0})),t.cancel(new a.Y({retry:!1,reason:"Event ".concat(u," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t];if(t.updateEvent("integrations",(0,e.pi)((0,e.pi)({},t.event.integrations),null===c||void 0===c?void 0:c.integrations)),(null===c||void 0===c?void 0:c.enabled)&&!1===(null===c||void 0===c?void 0:c.integrations[this.name]))return t.cancel(new a.Y({retry:!1,reason:"Event ".concat(u," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t]}return[4,(0,p.applyDestinationMiddleware)(this.name,t.event,this.middleware)];case 1:if(null===(l=f.sent()))return[2,t];h=new n(l,{traverse:!this.disableAutoISOConversion}),t.stats.increment("analytics_js.integration.invoke",1,["method:".concat(i),"integration_name:".concat(this.name)]),f.label=2;case 2:return f.trys.push([2,5,,6]),this.integration?[4,this.integration.invoke.call(this.integration,i,h)]:[3,4];case 3:f.sent(),f.label=4;case 4:return[3,6];case 5:throw v=f.sent(),t.stats.increment("analytics_js.integration.invoke.error",1,["method:".concat(i),"integration_name:".concat(this.name)]),v;case 6:return[2,t]}}))}))},t.prototype.track=function(t){return(0,e.mG)(this,void 0,void 0,(function(){return(0,e.Jh)(this,(function(n){return[2,this.send(t,o.Track,"track")]}))}))},t.prototype.page=function(t){var n;return(0,e.mG)(this,void 0,void 0,(function(){var i=this;return(0,e.Jh)(this,(function(e){return(null===(n=this.integration)||void 0===n?void 0:n._assumesPageview)&&!this._initialized&&this.integration.initialize(),[2,this.onInitialize.then((function(){return i.send(t,o.Page,"page")}))]}))}))},t.prototype.identify=function(t){return(0,e.mG)(this,void 0,void 0,(function(){return(0,e.Jh)(this,(function(n){return[2,this.send(t,o.Identify,"identify")]}))}))},t.prototype.alias=function(t){return(0,e.mG)(this,void 0,void 0,(function(){return(0,e.Jh)(this,(function(n){return[2,this.send(t,o.Alias,"alias")]}))}))},t.prototype.group=function(t){return(0,e.mG)(this,void 0,void 0,(function(){return(0,e.Jh)(this,(function(n){return[2,this.send(t,o.Group,"group")]}))}))},t.prototype.scheduleFlush=function(){var t=this;this.flushing||setTimeout((function(){return(0,e.mG)(t,void 0,void 0,(function(){var t;return(0,e.Jh)(this,(function(n){switch(n.label){case 0:return this.flushing=!0,t=this,[4,G(this,this.buffer)];case 1:return t.buffer=n.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}}))}))}),5e3*Math.random())},t}();function I(t,n,i,o,r,s){var a,c;if(void 0===i&&(i={}),void 0===o&&(o={}),(0,u.s)())return[];n.plan&&((o=null!==o&&void 0!==o?o:{}).plan=n.plan);var d=null!==(c=null===(a=n.middlewareSettings)||void 0===a?void 0:a.routingRules)&&void 0!==c?c:[],h=n.integrations,v=o.integrations,f=(0,l.o)(n,null!==o&&void 0!==o?o:{}),p=null===s||void 0===s?void 0:s.reduce((function(t,n){var i;return(0,e.pi)((0,e.pi)({},t),((i={})[function(t){return("Integration"in t?t.Integration:t).prototype.name}(n)]=n,i))}),{}),g=new Set((0,e.ev)((0,e.ev)([],Object.keys(h).filter((function(t){return k(t,h[t])})),!0),Object.keys(p||{}).filter((function(t){return(0,_.PO)(h[t])||(0,_.PO)(null===v||void 0===v?void 0:v[t])})),!0));return Array.from(g).filter((function(t){return!z(t,i)})).map((function(n){var i=function(t){var n,i,e,o;return null!==(o=null!==(i=null===(n=null===t||void 0===t?void 0:t.versionSettings)||void 0===n?void 0:n.override)&&void 0!==i?i:null===(e=null===t||void 0===t?void 0:t.versionSettings)||void 0===e?void 0:e.version)&&void 0!==o?o:"latest"}(h[n]),e=new S(n,i,t,f[n],o,null===p||void 0===p?void 0:p[n]);return d.filter((function(t){return t.destinationName===n})).length>0&&r&&e.addMiddleware(r),e}))}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_imtbl_checkout_widgets_lib=self.webpackChunk_imtbl_checkout_widgets_lib||[]).push([[119],{91186:function(t,n,e){e.r(n),e.d(n,{form:function(){return o},link:function(){return i}});var r=e(34589);function i(t,n,e,i){var o=this;return t?((t instanceof Element?[t]:"toArray"in t?t.toArray():t).forEach((function(t){t.addEventListener("click",(function(u){var c,a,l=n instanceof Function?n(t):n,s=e instanceof Function?e(t):e,f=t.getAttribute("href")||t.getAttributeNS("http://www.w3.org/1999/xlink","href")||t.getAttribute("xlink:href")||(null===(c=t.getElementsByTagName("a")[0])||void 0===c?void 0:c.getAttribute("href")),h=(0,r.FJ)(o.track(l,s,null!==i&&void 0!==i?i:{}),null!==(a=o.settings.timeout)&&void 0!==a?a:500);(function(t,n){return!("_blank"!==t.target||!n)})(t,f)||function(t){var n=t;return!!(n.ctrlKey||n.shiftKey||n.metaKey||n.button&&1==n.button)}(u)||f&&(u.preventDefault?u.preventDefault():u.returnValue=!1,h.catch(console.error).then((function(){window.location.href=f})).catch(console.error))}),!1)})),this):this}function o(t,n,e,i){var o=this;return t?(t instanceof HTMLFormElement&&(t=[t]),t.forEach((function(t){if(!(t instanceof Element))throw new TypeError("Must pass HTMLElement to trackForm/trackSubmit.");var u=function(u){var c;u.preventDefault?u.preventDefault():u.returnValue=!1;var a=n instanceof Function?n(t):n,l=e instanceof Function?e(t):e;(0,r.FJ)(o.track(a,l,null!==i&&void 0!==i?i:{}),null!==(c=o.settings.timeout)&&void 0!==c?c:500).catch(console.error).then((function(){t.submit()})).catch(console.error)},c=window.jQuery||window.Zepto;c?c(t).submit(u):t.addEventListener("submit",u,!1)})),this):this}}}]);