@letscooee/web-sdk 9.14.3 → 9.14.4
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/main.min.js +1 -1
- package/dist/widget.min.js +24 -24
- package/package.json +1 -2
package/dist/main.min.js
CHANGED
|
@@ -7,7 +7,7 @@ var zy=Object.create;var Ml=Object.defineProperty,qy=Object.defineProperties,Ky=
|
|
|
7
7
|
|
|
8
8
|
`+ie.message+`
|
|
9
9
|
`+Array(ie.message.length+1).join("=")+`
|
|
10
|
-
`+I(A,F)):ie}}function Ft(A,R){var W;return R.cache&&R.name&&R.storage.templates.get(R.name)?R.storage.templates.get(R.name):(W=typeof A=="function"?A:Ze(A,R),R.cache&&R.name&&R.storage.templates.define(R.name,W),W)}De.l.bind(De),t.compile=Ze,t.compileScope=L,t.compileScopeIntoFunction=z,t.compileToString=I,t.defaultConfig=De,t.filters=Ce,t.getConfig=Ke,t.helpers=me,t.nativeHelpers=Ue,t.parse=g,t.render=function(A,R,W,F){var V=Ke(W||{});if(!V.async)return Ft(A,V)(R,V);if(!F){if(typeof n=="function")return new n(function(ie,de){try{ie(Ft(A,V)(R,V))}catch(Xe){de(Xe)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{Ft(A,V)(R,V,F)}catch(ie){return F(ie)}},t.templates=ae,Object.defineProperty(t,"__esModule",{value:!0})})});var yf=Ro(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.URLBuilder=void 0;var CS=function(){function t(e){try{this.base=new URL(e),this.params=new URLSearchParams(this.base.search.slice(1))}catch(r){console.error("Un-parsable URL",r)}}return t.prototype.appendQueryParam=function(e,r){this.params.append(e,r?r.toString():"")},t.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},t.prototype.deleteQueryParam=function(e){this.params.delete(e)},t.prototype.getBase=function(){return this.base},t.prototype.getPath=function(){return this.base.pathname},t.prototype.getHostname=function(){return this.base.hostname},t.prototype.getParams=function(){return this.params},t.prototype.getQueryParam=function(e){if(!this.params)return"";var r=this.params.get(e);return!r||r==="undefined"||r==="null"?void 0:r},t.prototype.getQueryString=function(){return this.params.toString()},t.prototype.setPath=function(e){return this.base.pathname=e,this},t.prototype.setQueryParam=function(e,r){return this.params.set(e,r?r.toString():""),this},t.prototype.setQueryString=function(e){if(e)return e[0]==="?"&&(e=e.slice(1)),this.params=new URLSearchParams(e),this},t.prototype.toString=function(){var e=this.params.toString();return e===""?this.base.search="":this.base.search="?"+e,this.base.toString()},t}();kc.URLBuilder=CS});var ny=Ro((Nf,Of)=>{"use strict";(function(t,e){typeof Nf=="object"&&typeof Of<"u"?Of.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.fetchRetry=e())})(Nf,function(){"use strict";var t=function(n,i){if(i=i||{},typeof n!="function")throw new r("fetch must be a function");if(typeof i!="object")throw new r("defaults must be an object");if(i.retries!==void 0&&!e(i.retries))throw new r("retries must be a positive integer");if(i.retryDelay!==void 0&&!e(i.retryDelay)&&typeof i.retryDelay!="function")throw new r("retryDelay must be a positive integer or a function returning a positive integer");if(i.retryOn!==void 0&&!Array.isArray(i.retryOn)&&typeof i.retryOn!="function")throw new r("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return i=Object.assign(o,i),function(a,c){var p=i.retries,m=i.retryDelay,f=i.retryOn;if(c&&c.retries!==void 0)if(e(c.retries))p=c.retries;else throw new r("retries must be a positive integer");if(c&&c.retryDelay!==void 0)if(e(c.retryDelay)||typeof c.retryDelay=="function")m=c.retryDelay;else throw new r("retryDelay must be a positive integer or a function returning a positive integer");if(c&&c.retryOn)if(Array.isArray(c.retryOn)||typeof c.retryOn=="function")f=c.retryOn;else throw new r("retryOn property expects an array or function");return new Promise(function(E,g){var I=function(O){var k=typeof Request<"u"&&a instanceof Request?a.clone():a;n(k,c).then(function(z){if(Array.isArray(f)&&f.indexOf(z.status)===-1)E(z);else if(typeof f=="function")try{return Promise.resolve(f(O,null,z)).then(function(L){L?D(O,null,z):E(z)}).catch(g)}catch(L){g(L)}else O<p?D(O,null,z):E(z)}).catch(function(z){if(typeof f=="function")try{Promise.resolve(f(O,z,null)).then(function(L){L?D(O,z,null):g(z)}).catch(function(L){g(L)})}catch(L){g(L)}else O<p?D(O,z,null):g(z)})};function D(O,k,z){var L=typeof m=="function"?m(O,k,z):m;setTimeout(function(){I(++O)},L)}I(0)})}};function e(n){return Number.isInteger(n)&&n>=0}function r(n){this.name="ArgumentError",this.message=n}return t})});var Gf="9.14.
|
|
10
|
+
`+I(A,F)):ie}}function Ft(A,R){var W;return R.cache&&R.name&&R.storage.templates.get(R.name)?R.storage.templates.get(R.name):(W=typeof A=="function"?A:Ze(A,R),R.cache&&R.name&&R.storage.templates.define(R.name,W),W)}De.l.bind(De),t.compile=Ze,t.compileScope=L,t.compileScopeIntoFunction=z,t.compileToString=I,t.defaultConfig=De,t.filters=Ce,t.getConfig=Ke,t.helpers=me,t.nativeHelpers=Ue,t.parse=g,t.render=function(A,R,W,F){var V=Ke(W||{});if(!V.async)return Ft(A,V)(R,V);if(!F){if(typeof n=="function")return new n(function(ie,de){try{ie(Ft(A,V)(R,V))}catch(Xe){de(Xe)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{Ft(A,V)(R,V,F)}catch(ie){return F(ie)}},t.templates=ae,Object.defineProperty(t,"__esModule",{value:!0})})});var yf=Ro(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.URLBuilder=void 0;var CS=function(){function t(e){try{this.base=new URL(e),this.params=new URLSearchParams(this.base.search.slice(1))}catch(r){console.error("Un-parsable URL",r)}}return t.prototype.appendQueryParam=function(e,r){this.params.append(e,r?r.toString():"")},t.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},t.prototype.deleteQueryParam=function(e){this.params.delete(e)},t.prototype.getBase=function(){return this.base},t.prototype.getPath=function(){return this.base.pathname},t.prototype.getHostname=function(){return this.base.hostname},t.prototype.getParams=function(){return this.params},t.prototype.getQueryParam=function(e){if(!this.params)return"";var r=this.params.get(e);return!r||r==="undefined"||r==="null"?void 0:r},t.prototype.getQueryString=function(){return this.params.toString()},t.prototype.setPath=function(e){return this.base.pathname=e,this},t.prototype.setQueryParam=function(e,r){return this.params.set(e,r?r.toString():""),this},t.prototype.setQueryString=function(e){if(e)return e[0]==="?"&&(e=e.slice(1)),this.params=new URLSearchParams(e),this},t.prototype.toString=function(){var e=this.params.toString();return e===""?this.base.search="":this.base.search="?"+e,this.base.toString()},t}();kc.URLBuilder=CS});var ny=Ro((Nf,Of)=>{"use strict";(function(t,e){typeof Nf=="object"&&typeof Of<"u"?Of.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.fetchRetry=e())})(Nf,function(){"use strict";var t=function(n,i){if(i=i||{},typeof n!="function")throw new r("fetch must be a function");if(typeof i!="object")throw new r("defaults must be an object");if(i.retries!==void 0&&!e(i.retries))throw new r("retries must be a positive integer");if(i.retryDelay!==void 0&&!e(i.retryDelay)&&typeof i.retryDelay!="function")throw new r("retryDelay must be a positive integer or a function returning a positive integer");if(i.retryOn!==void 0&&!Array.isArray(i.retryOn)&&typeof i.retryOn!="function")throw new r("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return i=Object.assign(o,i),function(a,c){var p=i.retries,m=i.retryDelay,f=i.retryOn;if(c&&c.retries!==void 0)if(e(c.retries))p=c.retries;else throw new r("retries must be a positive integer");if(c&&c.retryDelay!==void 0)if(e(c.retryDelay)||typeof c.retryDelay=="function")m=c.retryDelay;else throw new r("retryDelay must be a positive integer or a function returning a positive integer");if(c&&c.retryOn)if(Array.isArray(c.retryOn)||typeof c.retryOn=="function")f=c.retryOn;else throw new r("retryOn property expects an array or function");return new Promise(function(E,g){var I=function(O){var k=typeof Request<"u"&&a instanceof Request?a.clone():a;n(k,c).then(function(z){if(Array.isArray(f)&&f.indexOf(z.status)===-1)E(z);else if(typeof f=="function")try{return Promise.resolve(f(O,null,z)).then(function(L){L?D(O,null,z):E(z)}).catch(g)}catch(L){g(L)}else O<p?D(O,null,z):E(z)}).catch(function(z){if(typeof f=="function")try{Promise.resolve(f(O,z,null)).then(function(L){L?D(O,z,null):g(z)}).catch(function(L){g(L)})}catch(L){g(L)}else O<p?D(O,z,null):g(z)})};function D(O,k,z){var L=typeof m=="function"?m(O,k,z):m;setTimeout(function(){I(++O)},L)}I(0)})}};function e(n){return Number.isInteger(n)&&n>=0}function r(n){this.name="ArgumentError",this.message=n}return t})});var Gf="9.14.4";var N=class t{static SDK_VERSION=Gf;static SDK_VERSION_CODE;static SDK="WEB";static LOG_PREFIX="CooeeSDK";static COOEE="cooee";static SESSION_STORAGE_SCROLL_ID="sleid";static IDLE_TIME_IN_SECONDS=30*60;static IN_APP_WRAPPER_NAME="cooee-wrapper";static IN_APP_CONTAINER_NAME="cooee-container";static IN_APP_DEFAULT_PADDING=15;static EVENT_SCREEN_VIEW="CE Screen View";static EVENT_APP_BACKGROUND="CE App Background";static EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed";static EVENT_CAMPAIGN_HOLDOUT="CE Campaign Holdout";static EVENT_CAMPAIGN_REJECTED="CE Campaign Rejected";static EVENT_CAMPAIGN_FAILED="CE Campaign Failed";static EVENT_TRIGGER_CLOSED="CE Trigger Closed";static EVENT_SCROLL="CE Scroll";static EVENT_TRIGGER_CLICKED="CE Trigger Clicked";static EVENT_FORM_SUBMITTED="CE Form Submitted";static EVENT_EXPERIMENT_START="CE Experiment Start";static EVENT_VIDEO_DIALOG_CLOSED="CE Video Dialog Closed";static EVENT_VIDEO_DIALOG_OPENED="CE Video Dialog Opened";static EVENT_VIDEO_CHANGE="CE Video Changed";static EVENT_LAST_VIDEO_ENDED="CE Last Video Ended";static EVENT_VIDEO_MUTED="CE Video Muted";static EVENT_VIDEO_UNMUTED="CE Video Unmuted";static EVENT_ADD_TO_CART_CLICKED="CE Add To Cart Clicked";static EVENT_VIEW_ITEM_CLICKED="CE View Item Clicked";static EVENT_MORE_ITEM_INFO_CLICKED="CE More Item Info Clicked";static EVENT_OPEN_CART_CLICKED="CE Open Cart Clicked";static EVENT_ADD_TO_CART="Add To Cart";static EVENT_REMOVE_FROM_CART="Remove From Cart";static EVENT_VIEW_ITEM="View Item";static EVENT_VIEW_CART="View Cart";static EVENT_OPEN_CART="Open Cart";static EVENT_VIEW_COLLECTION="View Collection";static EVENT_BUY_NOW_CLICKED="Buy Now Clicked";static EVENT_CHECKOUT_STARTED="Checkout Started";static EVENT_REVIEW_CLICKED="Review Clicked";static EVENT_ITEM_THUMBNAIL_CLICKED="Item Thumbnail Clicked";static JS_LOAD_WHITELIST_EVENTS=[this.EVENT_VIEW_ITEM,this.EVENT_VIEW_CART,this.EVENT_VIEW_COLLECTION];static HASH_INITIATE_CHECKOUT="initiate-checkout";static HASH_OPEN_CART_DRAWER="open-cart-drawer";static ADD_BUNDLE_CTA_INBOUND_EVENT="letscooee:inbound:cta:add-bundle";static CTA_OPEN_CART_EVENT="letscooee:outbound:open-cart";static CTA_AFTER_REFRESH_UI="letscooee:outbound:refresh-ui";static POPUP_ACTIVITY_EVENT="letscooee:outbound:popup-activities";static THIRD_PARTY_CHECKOUT_EVENT="letscooee:outbound:third-party-initiate-checkout";static CAMPAIGN_DISPLAYED_ACTIVITY="DISPLAYED";static CAMPAIGN_CLICKED_ACTIVITY="CLICKED";static CAMPAIGN_CLOSED_ACTIVITY="CLOSED";static BLACKLISTED_PAGE_NAMES=["collection","product","cart"];static API_CALL_MAX_ATTEMPTS=3;static API_CALL_RETRY_DELAY=1e3;static PLACEHOLDER_IMAGE="https://cdn.global.letscooee.com/images/placeholders/product.png";static CART_UPDATE_BROADCAST="CART_UPDATE";static GRAPHQL_VERSION="2024-10";static GRAPHQL_API_PATH=`/api/${this.GRAPHQL_VERSION}/graphql.json`;static SHADOW_SPLITTER=":shadow";static CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static CONTENT_ATTRIBUTE="_letscooee_content";static VIA="_via";static PAYMENT_MODAL_DETAILS=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}];static{let e=t.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");t.SDK_VERSION_CODE=parseInt(e,10)}};var Ht={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${N.SDK_VERSION}/dist/widget.min.css`,widgetURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${N.SDK_VERSION}/dist/widget.min.js`};var Yt=gr(Un());var S=class{static log(...e){Yt.default.info(...e)}static debug(...e){Yt.default.debug(...e)}static error(...e){Yt.default.error(...e)}static warn(...e){Yt.default.warn(...e)}static info(...e){Yt.default.info(...e)}static trace(...e){Yt.default.trace(...e)}};function zf(t=N.LOG_PREFIX){Yt.default.useDefaults({formatter:function(r){r.unshift(`${t} (v${N.SDK_VERSION}):`)}});let e=Ul();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Yt.default.setLevel(Yt.default[localStorage.cooeeLogLevel]):Yt.default.setLevel(Ht.debug?Yt.default.TRACE:Yt.default.OFF)}function Ul(){return new URL(location.href).searchParams?.get("cooee-debug")}function qf(){let t=`
|
|
11
11
|
display: inline-block;
|
|
12
12
|
font-size: 14px;
|
|
13
13
|
background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);
|