@clickview/streamable-learning 0.12.1-rc.1 → 0.12.1-rc.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.
- package/dist/bundles.json +1 -1
- package/dist/scripts/{2676-9799905e4b-streamable-learning.chunk.js → 2676-7762258774-streamable-learning.chunk.js} +2 -2
- package/dist/scripts/{3093-9218f2dd9a-streamable-learning.chunk.js → 3093-d8fb8b151c-streamable-learning.chunk.js} +1 -1
- package/dist/scripts/{4797-15f87e7824-streamable-learning.chunk.js → 4797-bdeea198ad-streamable-learning.chunk.js} +2 -2
- package/dist/scripts/{7303-5265ba8daa-streamable-learning.chunk.js → 7303-921f46556a-streamable-learning.chunk.js} +2 -2
- package/dist/scripts/8069-9a651a68fc-streamable-learning.chunk.js +1 -0
- package/dist/scripts/{bundle-101a80372c.min.js → bundle-db6ddc253a.min.js} +2 -2
- package/package.json +1 -1
- package/dist/scripts/8069-598c1883bc-streamable-learning.chunk.js +0 -1
- /package/dist/scripts/{2676-9799905e4b-streamable-learning.chunk.js.LICENSE.txt → 2676-7762258774-streamable-learning.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{4797-15f87e7824-streamable-learning.chunk.js.LICENSE.txt → 4797-bdeea198ad-streamable-learning.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{7303-5265ba8daa-streamable-learning.chunk.js.LICENSE.txt → 7303-921f46556a-streamable-learning.chunk.js.LICENSE.txt} +0 -0
- /package/dist/scripts/{bundle-101a80372c.min.js.LICENSE.txt → bundle-db6ddc253a.min.js.LICENSE.txt} +0 -0
package/dist/bundles.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! For license information please see 2676-
|
|
2
|
-
"use strict";(self.webpackChunk_clickview_streamable_learning=self.webpackChunk_clickview_streamable_learning||[]).push([[2676],{92676:(t,e,r)=>{r.r(e),r.d(e,{BrazeClientService:()=>m,BrazeNewIamEvent:()=>g});var n=r(63093),i=r(81886),o=r(72688),a=r(99504),u=r(52003),c=r(60735);function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function l(){l=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),u=new A(n||[]);return i(a,"_invoke",{value:j(t,r,u)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var v="suspendedStart",y="suspendedYield",d="executing",g="completed",m={};function b(){}function w(){}function k(){}var O={};f(O,a,(function(){return this}));var C=Object.getPrototypeOf,E=C&&C(C(D([])));E&&E!==r&&n.call(E,a)&&(O=E);var L=k.prototype=b.prototype=Object.create(O);function _(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,a,u){var c=p(t[i],t,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==s(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function j(e,r,n){var i=v;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===g){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var u=n.delegate;if(u){var c=z(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===v)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var s=p(e,r,n);if("normal"===s.type){if(i=n.done?g:y,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(i=g,n.method="throw",n.arg=s.arg)}}}function z(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,z(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=p(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(s(e)+" is not iterable")}return w.prototype=k,i(L,"constructor",{value:k,configurable:!0}),i(k,"constructor",{value:w,configurable:!0}),w.displayName=f(k,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,k):(t.__proto__=k,f(t,c,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},_(x.prototype),f(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new x(h(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(L),f(L,c,"Generator"),f(L,a,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return u.type="throw",u.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,h(n.key),n)}}function h(t){var e=function(t,e){if("object"!=s(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==s(e)?e:e+""}function p(t,e,r){return e=y(e),function(t,e){if(e&&("object"==s(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,v()?Reflect.construct(e,r||[],y(t).constructor):e.apply(t,r))}function v(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(v=function(){return!!t})()}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}var g="braze:new:iam",m=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),p(this,e,[t])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(e,t),r=e,(i=[{key:"name",get:function(){return c.D.BrazeClient}},{key:"channelName",get:function(){return u.Q4.BRAZE}},{key:"clientInstance",get:function(){if(this.ready)return this.brazeClient}},{key:"initialize",value:function(){var t,e;(null===(t=this.options.eventOptions)||void 0===t?void 0:t.logUtmParameters)&&(this.utmParameters=a.F.getUtmParameters()),(null===(e=this.options.eventOptions)||void 0===e?void 0:e.logAttributionData)&&(this.attributionData=o.N.getDecodedAttributionData()),this.setup()}},{key:"isReady",get:function(){return this.ready}},{key:"setup",value:function(){var t,e=this,r=this.options.context;if(this.iamQueue=[],this.brazeClient=new n.BrazeClient({apiOptions:this.getInstanceOptions(),allowAnonymous:!1,shouldInitialize:this.options.client.shouldInitialize,subscriptions:{subscribeToInAppMessage:function(t){return e.subscribeToInAppMessage(t)}}}),r.user.isAuthenticated&&this.options.client.shouldInitialize){var i=this.getBrazeUser(r.user);(null===(t=this.options.geoLocation)||void 0===t?void 0:t.countryCode)&&(i.country=this.options.geoLocation.countryCode),this.setUser(i)}this.ready=!0}},{key:"setUser",value:function(t){this.brazeClient.setUser(t)}},{key:"setUserInit",value:function(t){this.brazeClient.setUserInit(t)}},{key:"getBrazeUser",value:function(t){return{email:t.email,firstName:t.givenName,lastName:t.familyName,custom:{masterId:t.id}}}},{key:"getInstanceOptions",value:function(){return{productName:this.options.client.productName,productVersion:this.options.client.version,apiKey:this.options.client.apiKey,baseUrl:this.options.client.baseUrl,enableLogging:!1,automaticallyShowInAppMessages:!1,allowUserSuppliedJavascript:!0}}},{key:"subscribeToInAppMessage",value:function(t){var e,r;if((null===(r=null===(e=this.options)||void 0===e?void 0:e.subscriptions)||void 0===r?void 0:r.inAppMessage)&&!t.isControl){var n=this.getChannel();this.iamQueue.push(t),n.trigger(g)}}},{key:"getContentCards",value:function(){var t,e,r,n,i;return e=this,r=void 0,n=void 0,i=l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(t=this.brazeClient.card)||void 0===t?void 0:t.getContentCards();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})),new(n||(n=Promise))((function(t,o){function a(t){try{c(i.next(t))}catch(t){o(t)}}function u(t){try{c(i.throw(t))}catch(t){o(t)}}function c(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(t){t(r)}))).then(a,u)}c((i=i.apply(e,r||[])).next())}))}},{key:"logContentCardDismissal",value:function(t){var e;return null===(e=this.brazeClient.card)||void 0===e?void 0:e.logDismissal(t)}},{key:"logContentCardClick",value:function(t){var e;return null===(e=this.brazeClient.card)||void 0===e?void 0:e.logClick(t)}},{key:"logContentCardImpressions",value:function(t){var e;return null===(e=this.brazeClient.card)||void 0===e?void 0:e.logImpressions(t)}},{key:"logFormEvent",value:function(t){var e=this.hydrateAdditionalData(t);this.brazeClient.event.logForm(e)}},{key:"logAnalyticsEvent",value:function(t){var e=this.hydrateAdditionalData(t);this.brazeClient.event.logAnalytics(e)}},{key:"logEvent",value:function(t){var e=this.hydrateAdditionalData(t);return this.brazeClient.event.log(e)}},{key:"showInAppMessage",value:function(t,e,r){return this.brazeClient.bam.show(t,e,r)}},{key:"handleInAppMessages",value:function(t){if(this.iamQueue.length)for(;this.iamQueue.length;){var e=this.iamQueue.pop();if(!e)return;t(e)}}},{key:"hydrateAdditionalData",value:function(t){var e,r,n=t.additionalData||{};return this.utmParameters&&(n.utms=this.utmParameters),(null===(e=this.attributionData)||void 0===e?void 0:e.originalReferrer)&&(n.original_referrer=this.attributionData.originalReferrer),(null===(r=this.attributionData)||void 0===r?void 0:r.internalReferrer)&&(n.internal_referrer=this.attributionData.internalReferrer),Object.assign(Object.assign({},t),{additionalData:n})}}])&&f(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i}(i.Q.t6)}}]);
|
|
1
|
+
/*! For license information please see 2676-7762258774-streamable-learning.chunk.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunk_clickview_streamable_learning=self.webpackChunk_clickview_streamable_learning||[]).push([[2676],{92676:(t,e,r)=>{r.r(e),r.d(e,{BrazeClientService:()=>m,BrazeNewIamEvent:()=>g});var n=r(63093),i=r(81886),o=r(72688),a=r(99504),u=r(52003),s=r(60735);function c(t){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c(t)}function l(){l=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,a=Object.create(o.prototype),u=new A(n||[]);return i(a,"_invoke",{value:j(t,r,u)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var v="suspendedStart",y="suspendedYield",d="executing",g="completed",m={};function b(){}function w(){}function k(){}var O={};f(O,a,(function(){return this}));var C=Object.getPrototypeOf,E=C&&C(C(D([])));E&&E!==r&&n.call(E,a)&&(O=E);var L=k.prototype=b.prototype=Object.create(O);function _(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,a,u){var s=p(t[i],t,o);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==c(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function j(e,r,n){var i=v;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===g){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var u=n.delegate;if(u){var s=z(u,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===v)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var c=p(e,r,n);if("normal"===c.type){if(i=n.done?g:y,c.arg===m)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=g,n.method="throw",n.arg=c.arg)}}}function z(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,z(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var o=p(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(c(e)+" is not iterable")}return w.prototype=k,i(L,"constructor",{value:k,configurable:!0}),i(k,"constructor",{value:w,configurable:!0}),w.displayName=f(k,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,k):(t.__proto__=k,f(t,s,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},_(x.prototype),f(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new x(h(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(L),f(L,s,"Generator"),f(L,a,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return u.type="throw",u.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function f(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,h(n.key),n)}}function h(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}function p(t,e,r){return e=y(e),function(t,e){if(e&&("object"==c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,v()?Reflect.construct(e,r||[],y(t).constructor):e.apply(t,r))}function v(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(v=function(){return!!t})()}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}var g="braze:new:iam",m=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),p(this,e,[t])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}(e,t),r=e,(i=[{key:"name",get:function(){return s.D.BrazeClient}},{key:"channelName",get:function(){return u.Q4.BRAZE}},{key:"clientInstance",get:function(){if(this.ready)return this.brazeClient}},{key:"initialize",value:function(){var t,e;(null===(t=this.options.eventOptions)||void 0===t?void 0:t.logUtmParameters)&&(this.utmParameters=a.F.getUtmParameters()),(null===(e=this.options.eventOptions)||void 0===e?void 0:e.logAttributionData)&&(this.attributionData=o.N.getDecodedAttributionData()),this.setup()}},{key:"isReady",get:function(){return this.ready&&this.options.client.shouldInitialize}},{key:"setup",value:function(){var t,e=this,r=this.options.context;if(this.iamQueue=[],this.brazeClient=new n.BrazeClient({apiOptions:this.getInstanceOptions(),allowAnonymous:!1,shouldInitialize:this.options.client.shouldInitialize,subscriptions:{subscribeToInAppMessage:function(t){return e.subscribeToInAppMessage(t)}}}),r.user.isAuthenticated&&this.options.client.shouldInitialize){var i=this.getBrazeUser(r.user);(null===(t=this.options.geoLocation)||void 0===t?void 0:t.countryCode)&&(i.country=this.options.geoLocation.countryCode),this.setUser(i)}this.ready=!0}},{key:"setUser",value:function(t){this.brazeClient.setUser(t)}},{key:"setUserInit",value:function(t){this.brazeClient.setUserInit(t)}},{key:"getBrazeUser",value:function(t){return{email:t.email,firstName:t.givenName,lastName:t.familyName,custom:{masterId:t.id}}}},{key:"getInstanceOptions",value:function(){return{productName:this.options.client.productName,productVersion:this.options.client.version,apiKey:this.options.client.apiKey,baseUrl:this.options.client.baseUrl,enableLogging:!1,automaticallyShowInAppMessages:!1,allowUserSuppliedJavascript:!0}}},{key:"subscribeToInAppMessage",value:function(t){var e,r;if((null===(r=null===(e=this.options)||void 0===e?void 0:e.subscriptions)||void 0===r?void 0:r.inAppMessage)&&!t.isControl){var n=this.getChannel();this.iamQueue.push(t),n.trigger(g)}}},{key:"getContentCards",value:function(){var t,e,r,n,i;return e=this,r=void 0,n=void 0,i=l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(t=this.brazeClient.card)||void 0===t?void 0:t.getContentCards();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})),new(n||(n=Promise))((function(t,o){function a(t){try{s(i.next(t))}catch(t){o(t)}}function u(t){try{s(i.throw(t))}catch(t){o(t)}}function s(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(t){t(r)}))).then(a,u)}s((i=i.apply(e,r||[])).next())}))}},{key:"logContentCardDismissal",value:function(t){var e;return null===(e=this.brazeClient.card)||void 0===e?void 0:e.logDismissal(t)}},{key:"logContentCardClick",value:function(t){var e;return null===(e=this.brazeClient.card)||void 0===e?void 0:e.logClick(t)}},{key:"logContentCardImpressions",value:function(t){var e;return null===(e=this.brazeClient.card)||void 0===e?void 0:e.logImpressions(t)}},{key:"logFormEvent",value:function(t){var e=this.hydrateAdditionalData(t);this.brazeClient.event.logForm(e)}},{key:"logAnalyticsEvent",value:function(t){var e=this.hydrateAdditionalData(t);this.brazeClient.event.logAnalytics(e)}},{key:"logEvent",value:function(t){var e=this.hydrateAdditionalData(t);return this.brazeClient.event.log(e)}},{key:"showInAppMessage",value:function(t,e,r){return this.brazeClient.bam.show(t,e,r)}},{key:"handleInAppMessages",value:function(t){if(this.iamQueue.length)for(;this.iamQueue.length;){var e=this.iamQueue.pop();if(!e)return;t(e)}}},{key:"hydrateAdditionalData",value:function(t){var e,r,n=t.additionalData||{};return this.utmParameters&&(n.utms=this.utmParameters),(null===(e=this.attributionData)||void 0===e?void 0:e.originalReferrer)&&(n.original_referrer=this.attributionData.originalReferrer),(null===(r=this.attributionData)||void 0===r?void 0:r.internalReferrer)&&(n.internal_referrer=this.attributionData.internalReferrer),Object.assign(Object.assign({},t),{additionalData:n})}}])&&f(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,i}(i.Q.t6)}}]);
|