@letscooee/web-sdk 10.0.4 → 10.0.5
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 +20 -20
- package/dist/widget.min.js +1 -1
- package/package.json +1 -1
package/dist/widget.min.js
CHANGED
|
@@ -7,7 +7,7 @@ import{$ as Yi,$a as Fs,A as Gi,Aa as z,B as Re,Ba as xn,C as Me,Ca as On,D as G
|
|
|
7
7
|
|
|
8
8
|
`+y.message+`
|
|
9
9
|
`+Array(y.message.length+1).join("=")+`
|
|
10
|
-
`+N(D,M)):y}}function _t(D,O){var L;return O.cache&&O.name&&O.storage.templates.get(O.name)?O.storage.templates.get(O.name):(L=typeof D=="function"?D:Ke(D,O),O.cache&&O.name&&O.storage.templates.define(O.name,L),L)}Le.l.bind(Le),t.compile=Ke,t.compileScope=te,t.compileScopeIntoFunction=G,t.compileToString=N,t.defaultConfig=Le,t.filters=Ne,t.getConfig=Ye,t.helpers=be,t.nativeHelpers=Ve,t.parse=w,t.render=function(D,O,L,M){var v=Ye(L||{});if(!v.async)return _t(D,v)(O,v);if(!M){if(typeof r=="function")return new r(function(y,U){try{y(_t(D,v)(O,v))}catch(K){U(K)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{_t(D,v)(O,v,M)}catch(y){return M(y)}},t.templates=fe,Object.defineProperty(t,"__esModule",{value:!0})})});var hh={schedule(t,e){let n=setTimeout(t,e);return()=>clearTimeout(n)}};function mh(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function gh(t){return!!t&&t.nodeType===Node.ELEMENT_NODE}var Vs;function _h(t,e){if(!Vs){let n=Element.prototype;Vs=n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}return t.nodeType===Node.ELEMENT_NODE?Vs.call(t,e):!1}function vh(t){let e={};return t.forEach(({propName:n,templateName:r,transform:i})=>{e[mh(r)]=[n,i]}),e}function yh(t,e){return e.get(As).resolveComponentFactory(t).inputs}function Eh(t,e){let n=t.childNodes,r=e.map(()=>[]),i=-1;e.some((o,s)=>o==="*"?(i=s,!0):!1);for(let o=0,s=n.length;o<s;++o){let l=n[o],u=bh(l,e,i);u!==-1&&r[u].push(l)}return r}function bh(t,e,n){let r=n;return gh(t)&&e.some((i,o)=>i!=="*"&&_h(t,i)?(r=o,!0):!1),r}var wh=10,ks=class{componentFactory;inputMap=new Map;constructor(e,n){this.componentFactory=n.get(As).resolveComponentFactory(e);for(let r of this.componentFactory.inputs)this.inputMap.set(r.propName,r.templateName)}create(e){return new Bs(this.componentFactory,e,this.inputMap)}},Bs=class{componentFactory;injector;inputMap;eventEmitters=new Os(1);events=this.eventEmitters.pipe(wl(e=>_l(...e)));componentRef=null;scheduledDestroyFn=null;initialInputValues=new Map;ngZone;elementZone;appRef;cdScheduler;constructor(e,n,r){this.componentFactory=e,this.injector=n,this.inputMap=r,this.ngZone=this.injector.get(Wt),this.appRef=this.injector.get(ri),this.cdScheduler=n.get(Cl),this.elementZone=typeof Zone>"u"?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(this.scheduledDestroyFn!==null){this.scheduledDestroyFn(),this.scheduledDestroyFn=null;return}this.componentRef===null&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{this.componentRef===null||this.scheduledDestroyFn!==null||(this.scheduledDestroyFn=hh.schedule(()=>{this.componentRef!==null&&(this.componentRef.destroy(),this.componentRef=null)},wh))})}getInputValue(e){return this.runInZone(()=>this.componentRef===null?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,n){if(this.componentRef===null){this.initialInputValues.set(e,n);return}this.runInZone(()=>{this.componentRef.setInput(this.inputMap.get(e)??e,n),Tl(this.componentRef.hostView)&&(Il(this.componentRef.changeDetectorRef),this.cdScheduler.notify(6))})}initializeComponent(e){let n=Ot.create({providers:[],parent:this.injector}),r=Eh(e,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(n,r,e),this.initializeInputs(),this.initializeOutputs(this.componentRef),this.appRef.attachView(this.componentRef.hostView),this.componentRef.hostView.detectChanges()}initializeInputs(){for(let[e,n]of this.initialInputValues)this.setInputValue(e,n);this.initialInputValues.clear()}initializeOutputs(e){let n=this.componentFactory.outputs.map(({propName:r,templateName:i})=>{let o=e.instance[r];return new ji(s=>{let l=o.subscribe(u=>s.next({name:i,value:u}));return()=>l.unsubscribe()})});this.eventEmitters.next(n)}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}},Us=class extends HTMLElement{ngElementEventsSubscription=null};function Yl(t,e){let n=yh(t,e.injector),r=e.strategyFactory||new ks(t,e.injector),i=vh(n);class o extends Us{injector;static observedAttributes=Object.keys(i);get ngElementStrategy(){if(!this._ngElementStrategy){let l=this._ngElementStrategy=r.create(this.injector||e.injector);n.forEach(({propName:u,transform:d})=>{if(!this.hasOwnProperty(u))return;let _=this[u];delete this[u],l.setInputValue(u,_,d)})}return this._ngElementStrategy}_ngElementStrategy;constructor(l){super(),this.injector=l}attributeChangedCallback(l,u,d,_){let[h,E]=i[l];this.ngElementStrategy.setInputValue(h,d,E)}connectedCallback(){let l=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),l=!0),this.ngElementStrategy.connect(this),l||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(l=>{let u=new CustomEvent(l.name,{detail:l.value});this.dispatchEvent(u)})}}return n.forEach(({propName:s,transform:l})=>{Object.defineProperty(o.prototype,s,{get(){return this.ngElementStrategy.getInputValue(s)},set(u){this.ngElementStrategy.setInputValue(s,u,l)},configurable:!0,enumerable:!0})}),o}var zl="10.0.4";var Q=class Q{};ne(Q,"SDK_VERSION",zl),ne(Q,"SDK_VERSION_CODE"),ne(Q,"SDK","WEB"),ne(Q,"LOG_PREFIX","CooeeSDK"),ne(Q,"COOEE","cooee"),ne(Q,"SESSION_STORAGE_SCROLL_ID","sleid"),ne(Q,"IDLE_TIME_IN_SECONDS",30*60),ne(Q,"IN_APP_WRAPPER_NAME","cooee-wrapper"),ne(Q,"IN_APP_CONTAINER_NAME","cooee-container"),ne(Q,"IN_APP_DEFAULT_PADDING",15),ne(Q,"EVENT_SCREEN_VIEW","CE Screen View"),ne(Q,"EVENT_APP_BACKGROUND","CE App Background"),ne(Q,"EVENT_TRIGGER_DISPLAYED","CE Trigger Displayed"),ne(Q,"EVENT_CAMPAIGN_HOLDOUT","CE Campaign Holdout"),ne(Q,"EVENT_CAMPAIGN_REJECTED","CE Campaign Rejected"),ne(Q,"EVENT_CAMPAIGN_FAILED","CE Campaign Failed"),ne(Q,"EVENT_TRIGGER_CLOSED","CE Trigger Closed"),ne(Q,"EVENT_SCROLL","CE Scroll"),ne(Q,"EVENT_TRIGGER_CLICKED","CE Trigger Clicked"),ne(Q,"EVENT_FORM_SUBMITTED","CE Form Submitted"),ne(Q,"EVENT_EXPERIMENT_START","CE Experiment Start"),ne(Q,"EVENT_VIDEO_DIALOG_CLOSED","CE Video Dialog Closed"),ne(Q,"EVENT_VIDEO_DIALOG_OPENED","CE Video Dialog Opened"),ne(Q,"EVENT_VIDEO_CHANGE","CE Video Changed"),ne(Q,"EVENT_LAST_VIDEO_ENDED","CE Last Video Ended"),ne(Q,"EVENT_VIDEO_MUTED","CE Video Muted"),ne(Q,"EVENT_VIDEO_UNMUTED","CE Video Unmuted"),ne(Q,"EVENT_ADD_TO_CART_CLICKED","CE Add To Cart Clicked"),ne(Q,"EVENT_VIEW_ITEM_CLICKED","CE View Item Clicked"),ne(Q,"EVENT_MORE_ITEM_INFO_CLICKED","CE More Item Info Clicked"),ne(Q,"EVENT_OPEN_CART_CLICKED","CE Open Cart Clicked"),ne(Q,"EVENT_ADD_TO_CART","Add To Cart"),ne(Q,"EVENT_REMOVE_FROM_CART","Remove From Cart"),ne(Q,"EVENT_VIEW_ITEM","View Item"),ne(Q,"EVENT_VIEW_CART","View Cart"),ne(Q,"EVENT_OPEN_CART","Open Cart"),ne(Q,"EVENT_VIEW_COLLECTION","View Collection"),ne(Q,"EVENT_BUY_NOW_CLICKED","Buy Now Clicked"),ne(Q,"EVENT_CHECKOUT_STARTED","Checkout Started"),ne(Q,"EVENT_REVIEW_CLICKED","Review Clicked"),ne(Q,"EVENT_ITEM_THUMBNAIL_CLICKED","Item Thumbnail Clicked"),ne(Q,"JS_LOAD_WHITELIST_EVENTS",[Q.EVENT_VIEW_ITEM,Q.EVENT_VIEW_CART,Q.EVENT_VIEW_COLLECTION]),ne(Q,"HASH_INITIATE_CHECKOUT","initiate-checkout"),ne(Q,"HASH_OPEN_CART_DRAWER","open-cart-drawer"),ne(Q,"ADD_BUNDLE_CTA_INBOUND_EVENT","letscooee:inbound:cta:add-bundle"),ne(Q,"CTA_OPEN_CART_EVENT","letscooee:outbound:open-cart"),ne(Q,"CTA_AFTER_REFRESH_UI","letscooee:outbound:refresh-ui"),ne(Q,"POPUP_ACTIVITY_EVENT","letscooee:outbound:popup-activities"),ne(Q,"THIRD_PARTY_CHECKOUT_EVENT","letscooee:outbound:third-party-initiate-checkout"),ne(Q,"CAMPAIGN_DISPLAYED_ACTIVITY","DISPLAYED"),ne(Q,"CAMPAIGN_CLICKED_ACTIVITY","CLICKED"),ne(Q,"CAMPAIGN_CLOSED_ACTIVITY","CLOSED"),ne(Q,"BLACKLISTED_PAGE_NAMES",["collection","product","cart"]),ne(Q,"PLACEHOLDER_IMAGE","https://cdn.global.letscooee.com/images/placeholders/product.png"),ne(Q,"SHADOW_SPLITTER",":shadow"),ne(Q,"CAMPAIGN_ATTRIBUTE","_letscooee_campaign"),ne(Q,"CONTENT_ATTRIBUTE","_letscooee_content"),ne(Q,"VIA","_via"),ne(Q,"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"}]),(()=>{let e=Q.SDK_VERSION.split(".").map(n=>n.padStart(2,"0")).join("");Q.SDK_VERSION_CODE=parseInt(e,10)})();var Ze=Q;var Rn={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Ze.SDK_VERSION}/dist/widget.min.css`,widgetURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Ze.SDK_VERSION}/dist/widget.min.js`};var Yt=Hi(Kl());var ze=class{static debuggerEl;static infoLogs=[];static log(...e){Yt.default.info(...e)}static verbose(...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),this.infoLogs.unshift({time:new Date,message:e.join(" ")}),this.addToDebugger()}static trace(...e){Yt.default.trace(...e)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function Xl(t=Ze.LOG_PREFIX){Yt.default.useDefaults({formatter:function(n){n.unshift(`${t} (v${Ze.SDK_VERSION}):`)}});let e=Sh();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Yt.default.setLevel(Yt.default[localStorage.cooeeLogLevel]):Yt.default.setLevel(Rn.debug?Yt.default.TRACE:Yt.default.OFF)}function Sh(){return new URL(location.href).searchParams?.get("cooee-debug")}var Jl={providers:[Nl()]};var xh={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},oE=Ee(x({},xh),{"[class.ng-submitted]":"isSubmitted"});var Oh=new cn("",{providedIn:"root",factory:()=>eu}),eu="always";var Dh=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=Qn({type:t});static \u0275inj=Jn({})}return t})();var tu=(()=>{class t{static withConfig(n){return{ngModule:t,providers:[{provide:Oh,useValue:n.callSetDisabledState??eu}]}}static \u0275fac=function(r){return new(r||t)};static \u0275mod=Qn({type:t});static \u0275inj=Jn({imports:[Dh]})}return t})();var Ut=class{static SWIPER_CSS="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css";static injectScriptURL(e,n){if(!e)return;let r=document.createElement("script");r.id=n??"",r.src=e,r.type="module",document.head.appendChild(r)}static injectRawScript(e){if(!e)return;let n=document.createElement("script");n.id="cooee-app-script",n.innerHTML=e,document.head.appendChild(n)}static injectRawCSS(e,n=document.head){if(!e)return;let r=document.createElement("style");r.textContent=e,n.appendChild(r)}static injectSwiperCSS(e=document.head){this.injectStylesheet(this.SWIPER_CSS,e)}static injectStylesheet(e,n=document.head){if(!e)return;let r=document.createElement("link");r.rel="stylesheet",r.href=e,e===this.SWIPER_CSS&&(r.crossOrigin="anonymous",r.onload=i=>{let s=i.currentTarget?.sheet?.cssRules;if(s){for(let l of s)if(l.type==CSSRule.FONT_FACE_RULE){let u=e.split("/"),d=u.slice(0,u.length-1).join("/"),_=l.cssText;_=_.replace(/url\s*\(\s*['"]?(?!((\/)|((?:https?:)?\/\/)|(?:data:?:)))([^'")]+)['"]?\s*\)/g,`url("${d}/$4")`);let h=document.createElement("style");h.appendChild(document.createTextNode(_)),document.head.appendChild(h)}}}),n.appendChild(r)}static async loadSwiperScript(){window.CooeeSDK.Swiper||(window.CooeeSDK.Swiper=(await import("https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.mjs")).Swiper)}};var Qt=class t{cooeeEvent=new et;cooeeCTA=new et;elementRef=J(Bt);_engagementTrigger=wt(null);_triggerContext=wt(null);constructor(){this.elementRef.nativeElement.update=this.update.bind(this)}get classes(){let e=["letscooee-widget"],n=this._engagementTrigger();return e.push(`widget-${n?.shortID}`),e}get triggerContext(){return this._triggerContext()}set triggerContext(e){this._triggerContext.set(e),this._engagementTrigger.set(e.triggerData),this.engagementTriggerReceived(e.triggerData)}get engagementTrigger(){return this._engagementTrigger()}ngOnInit(){ze.verbose("Init",this.constructor.name);let e=this.elementRef.nativeElement.shadowRoot;e&&(Ut.injectStylesheet(Rn.styleURL,e),Ut.injectRawCSS(window.CooeeSDK.config.website.commonCSS,e))}ngOnDestroy(){ze.verbose("Destroying",this.constructor.name)}sendEventToRenderer(e){this.cooeeEvent.emit(e)}executeCTAViaRenderer(e){this.cooeeCTA.emit(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Pe({type:t,selectors:[["ng-component"]],hostVars:2,hostBindings:function(n,r){n&2&&zi(r.classes)},inputs:{triggerContext:"triggerContext"},outputs:{cooeeEvent:"cooeeEvent",cooeeCTA:"cooeeCTA"},decls:1,vars:0,template:function(n,r){n&1&&xl(0)},encapsulation:2})};var en=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(e){return e??={},this.gaEnabled=e.gaEnabled,this.gaMeasurementID=e.gaMeasurementID,this.pixelPush=e.pixelPush,this.website=e.website??{},this.currencyCount=e.currencyCount??0,this.money=e.money,this.currency=e.currency,this.storefrontToken=e.storefrontToken,this.skipItemAttribute=e.skipItemAttribute,this}};var Ah=(t,e)=>({"--option-color":t,"background-color":e}),nu=(t,e)=>e.id;function Nh(t,e){if(t&1&&(X(0,"span",6),De(1),Z()),t&2){z();let n=Je(0);V(),fn(n)}}function Rh(t,e){if(t&1){let n=Xe();It(0),X(1,"button",5),je("click",function(){let i=Re(n).$implicit,o=z().$implicit,s=z();return Me(s.onOptionChange(o,i))}),Se(2,Nh,2,1,"span",6),Z()}if(t&2){let n=e.$implicit,r=z().$implicit,i=Je(1),o=n.name,s=Et(n.displayName||n.name),l=i?n.hexColor??o:"",u=z().selectedOptions()[r.name]===o;V(),Ps("color-type",i)("selected",u)("disabled",n.disabled),Oe("title",s)("ngStyle",Ki(14,Ah,l,l)),dn("aria-checked",u?"true":"false")("data-value",o)("aria-disabled",n.disabled?"true":null)("aria-label",s),V(),Te(i?-1:2)}}function Mh(t,e){if(t&1&&(X(0,"div"),It(1),X(2,"div",1),De(3),Z(),X(4,"div",2),De(5),Z(),X(6,"div",3),st(7,Rh,3,17,"button",4,nu),Z()()),t&2){let n=e.$implicit,r=z();zi(Ol("option-group ",n.name.toLowerCase())),V(),Et(r.hasHexColors(n)),V(2),At("",n.name,":"),V(2),fn(r.selectedOptions()[n.name]),V(),dn("aria-label",n.name),V(),at(n.optionValues)}}var ai=t=>t.trim().toLowerCase(),wr=class t extends Qt{selectedVariant=new et;item=tr.required();selectedOptions=wt({});options=er(()=>{let e=this.item();if(!e.options||e.vars.length===1)return[];if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(e,this.engagementTrigger)}catch(n){ze.error(n)}return e.options.forEach(n=>{n.optionValues.forEach(r=>{r.disabled=this.isOptionValueDisabledFast(n,r)})}),e.options});matchedVariant=er(()=>{let e=this.item(),n=this.selectedOptions();return e.vars.find(r=>e.options.every(i=>{let o=r.selectedOptions.find(s=>s.name===i.name)?.value;return n[i.name]===o}))});availabilityIndex=er(()=>{let e=this.item(),n=new Map;return e?.vars?.length&&e.vars.forEach((r,i)=>{if(r.isAvailable)for(let o of r.selectedOptions){let s=ai(o.name),l=o.value,u=n.get(s);u||n.set(s,u=new Map);let d=u.get(l);d||u.set(l,d=new Set),d.add(i)}}),n});constructor(){super(),Ls(()=>{let n=this.matchedVariant();n&&(this.item().setSelectedVariant(n),this.selectedVariant.emit(n))});let e=Ls(()=>{let n=this.item();if(!n?.options)return;let r=x({},this.selectedOptions()),i=n.vars.find(o=>o.isAvailable)??n.vars[0];n.options.forEach(o=>{let s=i?.selectedOptions.find(l=>l.name===o.name)?.value;s&&(r[o.name]=s)}),this.selectedOptions.set(r),e.destroy()})}ngOnInit(){super.ngOnInit();let e=this.elementRef.nativeElement.shadowRoot;if(!e)return;let n=en.get().website?.itemSwatchMapping;n&&Ut.injectRawCSS(n,e)}onOptionChange(e,n){let r=x({},this.selectedOptions());r[e.name]=n.name,this.selectedOptions.set(r)}engagementTriggerReceived(){}update(){}hasHexColors(e){return!!e.optionValues[0]?.name.match(/#[a-f0-9]{6}\b/i)}getCandidateVariantsExcluding(e){let n=this.item(),r=this.availabilityIndex(),i=new Set;n.vars.forEach((s,l)=>{s.isAvailable&&i.add(l)});let o=i;for(let[s,l]of Object.entries(this.selectedOptions())){if(ai(s)===ai(e))continue;let u=r.get(ai(s));if(!u)return new Set;let d=u.get(String(l));if(!d)return new Set;if(o=new Set([...o].filter(_=>d.has(_))),o.size===0)return o}return o}isOptionValueDisabledFast(e,n){let i=this.availabilityIndex().get(ai(e.name));if(!i)return!0;let o=n.name,s=i.get(o);if(!s||s.size===0)return!0;let l=this.getCandidateVariantsExcluding(e.name);if(l.size===0)return!0;for(let u of l)if(s.has(u))return!1;return!0}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Pe({type:t,selectors:[["cooee-item-options-picker"]],inputs:{item:[1,"item"]},outputs:{selectedVariant:"selectedVariant"},features:[St],decls:2,vars:0,consts:[[3,"class"],[1,"name"],[1,"selected-value"],["role","radiogroup",1,"option-values"],["type","button","role","radio",1,"option-value",3,"color-type","selected","disabled","title","ngStyle"],["type","button","role","radio",1,"option-value",3,"click","title","ngStyle"],[1,"title"]],template:function(n,r){n&1&&st(0,Mh,9,7,"div",0,nu),n&2&&at(r.options())},dependencies:[Vl,Ll,tu],styles:[`.option-group{display:flex;gap:4px;align-items:center}.option-group+.option-group{margin-top:8px}.option-values{display:flex;flex-wrap:nowrap;overflow-x:auto;padding:6px;gap:4px}.selected-value{display:none}.option-value{padding:5px 10px;border:1px solid #ccc;cursor:pointer;border-radius:4px;min-width:32px;min-height:32px;text-align:center;position:relative;--selected-color: var(--option-color, rgb(var(--lc-color-button, 0 0 0)))}.option-value.selected{box-shadow:#fff 0 0 0 2px,var(--selected-color) 0 0 0 4px}.option-value.disabled{opacity:.5;pointer-events:none}
|
|
10
|
+
`+N(D,M)):y}}function _t(D,O){var L;return O.cache&&O.name&&O.storage.templates.get(O.name)?O.storage.templates.get(O.name):(L=typeof D=="function"?D:Ke(D,O),O.cache&&O.name&&O.storage.templates.define(O.name,L),L)}Le.l.bind(Le),t.compile=Ke,t.compileScope=te,t.compileScopeIntoFunction=G,t.compileToString=N,t.defaultConfig=Le,t.filters=Ne,t.getConfig=Ye,t.helpers=be,t.nativeHelpers=Ve,t.parse=w,t.render=function(D,O,L,M){var v=Ye(L||{});if(!v.async)return _t(D,v)(O,v);if(!M){if(typeof r=="function")return new r(function(y,U){try{y(_t(D,v)(O,v))}catch(K){U(K)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{_t(D,v)(O,v,M)}catch(y){return M(y)}},t.templates=fe,Object.defineProperty(t,"__esModule",{value:!0})})});var hh={schedule(t,e){let n=setTimeout(t,e);return()=>clearTimeout(n)}};function mh(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function gh(t){return!!t&&t.nodeType===Node.ELEMENT_NODE}var Vs;function _h(t,e){if(!Vs){let n=Element.prototype;Vs=n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}return t.nodeType===Node.ELEMENT_NODE?Vs.call(t,e):!1}function vh(t){let e={};return t.forEach(({propName:n,templateName:r,transform:i})=>{e[mh(r)]=[n,i]}),e}function yh(t,e){return e.get(As).resolveComponentFactory(t).inputs}function Eh(t,e){let n=t.childNodes,r=e.map(()=>[]),i=-1;e.some((o,s)=>o==="*"?(i=s,!0):!1);for(let o=0,s=n.length;o<s;++o){let l=n[o],u=bh(l,e,i);u!==-1&&r[u].push(l)}return r}function bh(t,e,n){let r=n;return gh(t)&&e.some((i,o)=>i!=="*"&&_h(t,i)?(r=o,!0):!1),r}var wh=10,ks=class{componentFactory;inputMap=new Map;constructor(e,n){this.componentFactory=n.get(As).resolveComponentFactory(e);for(let r of this.componentFactory.inputs)this.inputMap.set(r.propName,r.templateName)}create(e){return new Bs(this.componentFactory,e,this.inputMap)}},Bs=class{componentFactory;injector;inputMap;eventEmitters=new Os(1);events=this.eventEmitters.pipe(wl(e=>_l(...e)));componentRef=null;scheduledDestroyFn=null;initialInputValues=new Map;ngZone;elementZone;appRef;cdScheduler;constructor(e,n,r){this.componentFactory=e,this.injector=n,this.inputMap=r,this.ngZone=this.injector.get(Wt),this.appRef=this.injector.get(ri),this.cdScheduler=n.get(Cl),this.elementZone=typeof Zone>"u"?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(this.scheduledDestroyFn!==null){this.scheduledDestroyFn(),this.scheduledDestroyFn=null;return}this.componentRef===null&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{this.componentRef===null||this.scheduledDestroyFn!==null||(this.scheduledDestroyFn=hh.schedule(()=>{this.componentRef!==null&&(this.componentRef.destroy(),this.componentRef=null)},wh))})}getInputValue(e){return this.runInZone(()=>this.componentRef===null?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,n){if(this.componentRef===null){this.initialInputValues.set(e,n);return}this.runInZone(()=>{this.componentRef.setInput(this.inputMap.get(e)??e,n),Tl(this.componentRef.hostView)&&(Il(this.componentRef.changeDetectorRef),this.cdScheduler.notify(6))})}initializeComponent(e){let n=Ot.create({providers:[],parent:this.injector}),r=Eh(e,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(n,r,e),this.initializeInputs(),this.initializeOutputs(this.componentRef),this.appRef.attachView(this.componentRef.hostView),this.componentRef.hostView.detectChanges()}initializeInputs(){for(let[e,n]of this.initialInputValues)this.setInputValue(e,n);this.initialInputValues.clear()}initializeOutputs(e){let n=this.componentFactory.outputs.map(({propName:r,templateName:i})=>{let o=e.instance[r];return new ji(s=>{let l=o.subscribe(u=>s.next({name:i,value:u}));return()=>l.unsubscribe()})});this.eventEmitters.next(n)}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}},Us=class extends HTMLElement{ngElementEventsSubscription=null};function Yl(t,e){let n=yh(t,e.injector),r=e.strategyFactory||new ks(t,e.injector),i=vh(n);class o extends Us{injector;static observedAttributes=Object.keys(i);get ngElementStrategy(){if(!this._ngElementStrategy){let l=this._ngElementStrategy=r.create(this.injector||e.injector);n.forEach(({propName:u,transform:d})=>{if(!this.hasOwnProperty(u))return;let _=this[u];delete this[u],l.setInputValue(u,_,d)})}return this._ngElementStrategy}_ngElementStrategy;constructor(l){super(),this.injector=l}attributeChangedCallback(l,u,d,_){let[h,E]=i[l];this.ngElementStrategy.setInputValue(h,d,E)}connectedCallback(){let l=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),l=!0),this.ngElementStrategy.connect(this),l||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(l=>{let u=new CustomEvent(l.name,{detail:l.value});this.dispatchEvent(u)})}}return n.forEach(({propName:s,transform:l})=>{Object.defineProperty(o.prototype,s,{get(){return this.ngElementStrategy.getInputValue(s)},set(u){this.ngElementStrategy.setInputValue(s,u,l)},configurable:!0,enumerable:!0})}),o}var zl="10.0.5";var Q=class Q{};ne(Q,"SDK_VERSION",zl),ne(Q,"SDK_VERSION_CODE"),ne(Q,"SDK","WEB"),ne(Q,"LOG_PREFIX","CooeeSDK"),ne(Q,"COOEE","cooee"),ne(Q,"SESSION_STORAGE_SCROLL_ID","sleid"),ne(Q,"IDLE_TIME_IN_SECONDS",30*60),ne(Q,"IN_APP_WRAPPER_NAME","cooee-wrapper"),ne(Q,"IN_APP_CONTAINER_NAME","cooee-container"),ne(Q,"IN_APP_DEFAULT_PADDING",15),ne(Q,"EVENT_SCREEN_VIEW","CE Screen View"),ne(Q,"EVENT_APP_BACKGROUND","CE App Background"),ne(Q,"EVENT_TRIGGER_DISPLAYED","CE Trigger Displayed"),ne(Q,"EVENT_CAMPAIGN_HOLDOUT","CE Campaign Holdout"),ne(Q,"EVENT_CAMPAIGN_REJECTED","CE Campaign Rejected"),ne(Q,"EVENT_CAMPAIGN_FAILED","CE Campaign Failed"),ne(Q,"EVENT_TRIGGER_CLOSED","CE Trigger Closed"),ne(Q,"EVENT_SCROLL","CE Scroll"),ne(Q,"EVENT_TRIGGER_CLICKED","CE Trigger Clicked"),ne(Q,"EVENT_FORM_SUBMITTED","CE Form Submitted"),ne(Q,"EVENT_EXPERIMENT_START","CE Experiment Start"),ne(Q,"EVENT_VIDEO_DIALOG_CLOSED","CE Video Dialog Closed"),ne(Q,"EVENT_VIDEO_DIALOG_OPENED","CE Video Dialog Opened"),ne(Q,"EVENT_VIDEO_CHANGE","CE Video Changed"),ne(Q,"EVENT_LAST_VIDEO_ENDED","CE Last Video Ended"),ne(Q,"EVENT_VIDEO_MUTED","CE Video Muted"),ne(Q,"EVENT_VIDEO_UNMUTED","CE Video Unmuted"),ne(Q,"EVENT_ADD_TO_CART_CLICKED","CE Add To Cart Clicked"),ne(Q,"EVENT_VIEW_ITEM_CLICKED","CE View Item Clicked"),ne(Q,"EVENT_MORE_ITEM_INFO_CLICKED","CE More Item Info Clicked"),ne(Q,"EVENT_OPEN_CART_CLICKED","CE Open Cart Clicked"),ne(Q,"EVENT_ADD_TO_CART","Add To Cart"),ne(Q,"EVENT_REMOVE_FROM_CART","Remove From Cart"),ne(Q,"EVENT_VIEW_ITEM","View Item"),ne(Q,"EVENT_VIEW_CART","View Cart"),ne(Q,"EVENT_OPEN_CART","Open Cart"),ne(Q,"EVENT_VIEW_COLLECTION","View Collection"),ne(Q,"EVENT_BUY_NOW_CLICKED","Buy Now Clicked"),ne(Q,"EVENT_CHECKOUT_STARTED","Checkout Started"),ne(Q,"EVENT_REVIEW_CLICKED","Review Clicked"),ne(Q,"EVENT_ITEM_THUMBNAIL_CLICKED","Item Thumbnail Clicked"),ne(Q,"JS_LOAD_WHITELIST_EVENTS",[Q.EVENT_VIEW_ITEM,Q.EVENT_VIEW_CART,Q.EVENT_VIEW_COLLECTION]),ne(Q,"HASH_INITIATE_CHECKOUT","initiate-checkout"),ne(Q,"HASH_OPEN_CART_DRAWER","open-cart-drawer"),ne(Q,"ADD_BUNDLE_CTA_INBOUND_EVENT","letscooee:inbound:cta:add-bundle"),ne(Q,"CTA_OPEN_CART_EVENT","letscooee:outbound:open-cart"),ne(Q,"CTA_AFTER_REFRESH_UI","letscooee:outbound:refresh-ui"),ne(Q,"POPUP_ACTIVITY_EVENT","letscooee:outbound:popup-activities"),ne(Q,"THIRD_PARTY_CHECKOUT_EVENT","letscooee:outbound:third-party-initiate-checkout"),ne(Q,"CAMPAIGN_DISPLAYED_ACTIVITY","DISPLAYED"),ne(Q,"CAMPAIGN_CLICKED_ACTIVITY","CLICKED"),ne(Q,"CAMPAIGN_CLOSED_ACTIVITY","CLOSED"),ne(Q,"BLACKLISTED_PAGE_NAMES",["collection","product","cart"]),ne(Q,"PLACEHOLDER_IMAGE","https://cdn.global.letscooee.com/images/placeholders/product.png"),ne(Q,"SHADOW_SPLITTER",":shadow"),ne(Q,"CAMPAIGN_ATTRIBUTE","_letscooee_campaign"),ne(Q,"CONTENT_ATTRIBUTE","_letscooee_content"),ne(Q,"VIA","_via"),ne(Q,"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"}]),(()=>{let e=Q.SDK_VERSION.split(".").map(n=>n.padStart(2,"0")).join("");Q.SDK_VERSION_CODE=parseInt(e,10)})();var Ze=Q;var Rn={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Ze.SDK_VERSION}/dist/widget.min.css`,widgetURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Ze.SDK_VERSION}/dist/widget.min.js`};var Yt=Hi(Kl());var ze=class{static debuggerEl;static infoLogs=[];static log(...e){Yt.default.info(...e)}static verbose(...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),this.infoLogs.unshift({time:new Date,message:e.join(" ")}),this.addToDebugger()}static trace(...e){Yt.default.trace(...e)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function Xl(t=Ze.LOG_PREFIX){Yt.default.useDefaults({formatter:function(n){n.unshift(`${t} (v${Ze.SDK_VERSION}):`)}});let e=Sh();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Yt.default.setLevel(Yt.default[localStorage.cooeeLogLevel]):Yt.default.setLevel(Rn.debug?Yt.default.TRACE:Yt.default.OFF)}function Sh(){return new URL(location.href).searchParams?.get("cooee-debug")}var Jl={providers:[Nl()]};var xh={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},oE=Ee(x({},xh),{"[class.ng-submitted]":"isSubmitted"});var Oh=new cn("",{providedIn:"root",factory:()=>eu}),eu="always";var Dh=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=Qn({type:t});static \u0275inj=Jn({})}return t})();var tu=(()=>{class t{static withConfig(n){return{ngModule:t,providers:[{provide:Oh,useValue:n.callSetDisabledState??eu}]}}static \u0275fac=function(r){return new(r||t)};static \u0275mod=Qn({type:t});static \u0275inj=Jn({imports:[Dh]})}return t})();var Ut=class{static SWIPER_CSS="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css";static injectScriptURL(e,n){if(!e)return;let r=document.createElement("script");r.id=n??"",r.src=e,r.type="module",document.head.appendChild(r)}static injectRawScript(e){if(!e)return;let n=document.createElement("script");n.id="cooee-app-script",n.innerHTML=e,document.head.appendChild(n)}static injectRawCSS(e,n=document.head){if(!e)return;let r=document.createElement("style");r.textContent=e,n.appendChild(r)}static injectSwiperCSS(e=document.head){this.injectStylesheet(this.SWIPER_CSS,e)}static injectStylesheet(e,n=document.head){if(!e)return;let r=document.createElement("link");r.rel="stylesheet",r.href=e,e===this.SWIPER_CSS&&(r.crossOrigin="anonymous",r.onload=i=>{let s=i.currentTarget?.sheet?.cssRules;if(s){for(let l of s)if(l.type==CSSRule.FONT_FACE_RULE){let u=e.split("/"),d=u.slice(0,u.length-1).join("/"),_=l.cssText;_=_.replace(/url\s*\(\s*['"]?(?!((\/)|((?:https?:)?\/\/)|(?:data:?:)))([^'")]+)['"]?\s*\)/g,`url("${d}/$4")`);let h=document.createElement("style");h.appendChild(document.createTextNode(_)),document.head.appendChild(h)}}}),n.appendChild(r)}static async loadSwiperScript(){window.CooeeSDK.Swiper||(window.CooeeSDK.Swiper=(await import("https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.mjs")).Swiper)}};var Qt=class t{cooeeEvent=new et;cooeeCTA=new et;elementRef=J(Bt);_engagementTrigger=wt(null);_triggerContext=wt(null);constructor(){this.elementRef.nativeElement.update=this.update.bind(this)}get classes(){let e=["letscooee-widget"],n=this._engagementTrigger();return e.push(`widget-${n?.shortID}`),e}get triggerContext(){return this._triggerContext()}set triggerContext(e){this._triggerContext.set(e),this._engagementTrigger.set(e.triggerData),this.engagementTriggerReceived(e.triggerData)}get engagementTrigger(){return this._engagementTrigger()}ngOnInit(){ze.verbose("Init",this.constructor.name);let e=this.elementRef.nativeElement.shadowRoot;e&&(Ut.injectStylesheet(Rn.styleURL,e),Ut.injectRawCSS(window.CooeeSDK.config.website.commonCSS,e))}ngOnDestroy(){ze.verbose("Destroying",this.constructor.name)}sendEventToRenderer(e){this.cooeeEvent.emit(e)}executeCTAViaRenderer(e){this.cooeeCTA.emit(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Pe({type:t,selectors:[["ng-component"]],hostVars:2,hostBindings:function(n,r){n&2&&zi(r.classes)},inputs:{triggerContext:"triggerContext"},outputs:{cooeeEvent:"cooeeEvent",cooeeCTA:"cooeeCTA"},decls:1,vars:0,template:function(n,r){n&1&&xl(0)},encapsulation:2})};var en=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(e){return e??={},this.gaEnabled=e.gaEnabled,this.gaMeasurementID=e.gaMeasurementID,this.pixelPush=e.pixelPush,this.website=e.website??{},this.currencyCount=e.currencyCount??0,this.money=e.money,this.currency=e.currency,this.storefrontToken=e.storefrontToken,this.skipItemAttribute=e.skipItemAttribute,this}};var Ah=(t,e)=>({"--option-color":t,"background-color":e}),nu=(t,e)=>e.id;function Nh(t,e){if(t&1&&(X(0,"span",6),De(1),Z()),t&2){z();let n=Je(0);V(),fn(n)}}function Rh(t,e){if(t&1){let n=Xe();It(0),X(1,"button",5),je("click",function(){let i=Re(n).$implicit,o=z().$implicit,s=z();return Me(s.onOptionChange(o,i))}),Se(2,Nh,2,1,"span",6),Z()}if(t&2){let n=e.$implicit,r=z().$implicit,i=Je(1),o=n.name,s=Et(n.displayName||n.name),l=i?n.hexColor??o:"",u=z().selectedOptions()[r.name]===o;V(),Ps("color-type",i)("selected",u)("disabled",n.disabled),Oe("title",s)("ngStyle",Ki(14,Ah,l,l)),dn("aria-checked",u?"true":"false")("data-value",o)("aria-disabled",n.disabled?"true":null)("aria-label",s),V(),Te(i?-1:2)}}function Mh(t,e){if(t&1&&(X(0,"div"),It(1),X(2,"div",1),De(3),Z(),X(4,"div",2),De(5),Z(),X(6,"div",3),st(7,Rh,3,17,"button",4,nu),Z()()),t&2){let n=e.$implicit,r=z();zi(Ol("option-group ",n.name.toLowerCase())),V(),Et(r.hasHexColors(n)),V(2),At("",n.name,":"),V(2),fn(r.selectedOptions()[n.name]),V(),dn("aria-label",n.name),V(),at(n.optionValues)}}var ai=t=>t.trim().toLowerCase(),wr=class t extends Qt{selectedVariant=new et;item=tr.required();selectedOptions=wt({});options=er(()=>{let e=this.item();if(!e.options||e.vars.length===1)return[];if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(e,this.engagementTrigger)}catch(n){ze.error(n)}return e.options.forEach(n=>{n.optionValues.forEach(r=>{r.disabled=this.isOptionValueDisabledFast(n,r)})}),e.options});matchedVariant=er(()=>{let e=this.item(),n=this.selectedOptions();return e.vars.find(r=>e.options.every(i=>{let o=r.selectedOptions.find(s=>s.name===i.name)?.value;return n[i.name]===o}))});availabilityIndex=er(()=>{let e=this.item(),n=new Map;return e?.vars?.length&&e.vars.forEach((r,i)=>{if(r.isAvailable)for(let o of r.selectedOptions){let s=ai(o.name),l=o.value,u=n.get(s);u||n.set(s,u=new Map);let d=u.get(l);d||u.set(l,d=new Set),d.add(i)}}),n});constructor(){super(),Ls(()=>{let n=this.matchedVariant();n&&(this.item().setSelectedVariant(n),this.selectedVariant.emit(n))});let e=Ls(()=>{let n=this.item();if(!n?.options)return;let r=x({},this.selectedOptions()),i=n.vars.find(o=>o.isAvailable)??n.vars[0];n.options.forEach(o=>{let s=i?.selectedOptions.find(l=>l.name===o.name)?.value;s&&(r[o.name]=s)}),this.selectedOptions.set(r),e.destroy()})}ngOnInit(){super.ngOnInit();let e=this.elementRef.nativeElement.shadowRoot;if(!e)return;let n=en.get().website?.itemSwatchMapping;n&&Ut.injectRawCSS(n,e)}onOptionChange(e,n){let r=x({},this.selectedOptions());r[e.name]=n.name,this.selectedOptions.set(r)}engagementTriggerReceived(){}update(){}hasHexColors(e){return!!e.optionValues[0]?.name.match(/#[a-f0-9]{6}\b/i)}getCandidateVariantsExcluding(e){let n=this.item(),r=this.availabilityIndex(),i=new Set;n.vars.forEach((s,l)=>{s.isAvailable&&i.add(l)});let o=i;for(let[s,l]of Object.entries(this.selectedOptions())){if(ai(s)===ai(e))continue;let u=r.get(ai(s));if(!u)return new Set;let d=u.get(String(l));if(!d)return new Set;if(o=new Set([...o].filter(_=>d.has(_))),o.size===0)return o}return o}isOptionValueDisabledFast(e,n){let i=this.availabilityIndex().get(ai(e.name));if(!i)return!0;let o=n.name,s=i.get(o);if(!s||s.size===0)return!0;let l=this.getCandidateVariantsExcluding(e.name);if(l.size===0)return!0;for(let u of l)if(s.has(u))return!1;return!0}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Pe({type:t,selectors:[["cooee-item-options-picker"]],inputs:{item:[1,"item"]},outputs:{selectedVariant:"selectedVariant"},features:[St],decls:2,vars:0,consts:[[3,"class"],[1,"name"],[1,"selected-value"],["role","radiogroup",1,"option-values"],["type","button","role","radio",1,"option-value",3,"color-type","selected","disabled","title","ngStyle"],["type","button","role","radio",1,"option-value",3,"click","title","ngStyle"],[1,"title"]],template:function(n,r){n&1&&st(0,Mh,9,7,"div",0,nu),n&2&&at(r.options())},dependencies:[Vl,Ll,tu],styles:[`.option-group{display:flex;gap:4px;align-items:center}.option-group+.option-group{margin-top:8px}.option-values{display:flex;flex-wrap:nowrap;overflow-x:auto;padding:6px;gap:4px}.selected-value{display:none}.option-value{padding:5px 10px;border:1px solid #ccc;cursor:pointer;border-radius:4px;min-width:32px;min-height:32px;text-align:center;position:relative;--selected-color: var(--option-color, rgb(var(--lc-color-button, 0 0 0)))}.option-value.selected{box-shadow:#fff 0 0 0 2px,var(--selected-color) 0 0 0 4px}.option-value.disabled{opacity:.5;pointer-events:none}
|
|
11
11
|
`],encapsulation:3})};var Hs=function(t){return t.SHOPIFY_CHECKOUT="shopify_checkout",t.THIRD_PARTY_CHECKOUT="third_party_checkout",t.CART_PAGE="cart_page",t.CART_DRAWER="cart_drawer",t}(Hs||{});var tn=function(t){return t[t.NONE=0]="NONE",t[t.REJECT_POPUP=1]="REJECT_POPUP",t[t.ACCEPT_POPUP=2]="ACCEPT_POPUP",t[t.GO_TO_URL=4]="GO_TO_URL",t[t.SHARE=5]="SHARE",t[t.KEY_VALUE=100]="KEY_VALUE",t[t.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",t[t.ADD_TO_CART=102]="ADD_TO_CART",t[t.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",t[t.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",t[t.OPEN_CART=105]="OPEN_CART",t[t.SUBMIT_FORM=106]="SUBMIT_FORM",t[t.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",t[t.ADD_BUNDLE=108]="ADD_BUNDLE",t[t.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",t}(tn||{});var ci=function(t){return t.FREE_SHIPPING="FREE_SHIPPING",t.DISCOUNT="DISCOUNT",t.FREE_AUTO_GIFT="FREE_AUTO_GIFT",t.FREE_GIFT_SELECT="FREE_GIFT_SELECT",t.UI_ONLY="UI_ONLY",t}(ci||{});var Cr=class{id;mID;vID;vName;imageURL;name;link;quantity;price;finalPrice;constructor(e){this.id=e.id,this.mID=e.mID,this.vID=e.vID,this.vName=e.vName,this.imageURL=e.imageURL,this.name=e.name,this.link=e.link,this.quantity=e.quantity,this.price=e.price,this.finalPrice=e.finalPrice??e.price}};var js=(n=>(n.CART_AMOUNT="CART_AMOUNT",n.ITEM_COUNT="ITEM_COUNT",n))(js||{});var Sr=class{static ID="id";static SESSION_LANDING_PAGE="landing";static SESSION_LAST_USED_TIME="lastUsedTime";static SESSION_SYNCED="synced";static APP_CONFIG="conf";static DEVICE_ID="did";static SDK_TOKEN="token";static FIRST_SEEN="firstSeen";static SESSION_NUMBER="sessionNumber";static GA_CLIENT_ID="gacid";static CURRENT_CART="cart";static MUTED="muted"};var Gs=Hi(iu());function eo(t){return Gs.default.createInstance({name:"lc",storeName:t,driver:Gs.default.LOCALSTORAGE})}var Tr=class{static storage;static async get(e,n){return await this.storage?.getItem(e)??n}static set(e,n){return this.storage?.setItem(e,n)}static remove(e){return this.storage?.removeItem(e)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var li=class li extends Tr{};ne(li,"storeName","ses"),li.storage=eo(li.storeName);var Ws=li;var ui=class ui extends Tr{};ne(ui,"storeName","usr"),ui.storage=eo(ui.storeName);var Ir=ui;var su=Hi(ou());var XE=(0,su.default)(fetch);var to=class extends Error{request;response;status;requestBody;responseText;constructor(e="Failed to fetch"){super(e),this.name="FetchError",Object.setPrototypeOf(this,new.target.prototype)}is40x(){return!!this.response&&this.response.status>=400&&this.response.status<500}};var pe=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Ce=globalThis;var hn="9.42.0";function rr(){return ir(Ce),Ce}function ir(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||hn,e[hn]=e[hn]||{}}function Mn(t,e,n=Ce){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[hn]=r[hn]||{};return i[t]||(i[t]=e())}var qs=["debug","info","warn","error","log","assert","trace"],Ph="Sentry Logger ",xr={};function Wn(t){if(!("console"in Ce))return t();let e=Ce.console,n={},r=Object.keys(xr);r.forEach(i=>{let o=xr[i];n[i]=e[i],e[i]=o});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function Lh(){Xs().enabled=!0}function Fh(){Xs().enabled=!1}function au(){return Xs().enabled}function Vh(...t){Ks("log",...t)}function kh(...t){Ks("warn",...t)}function Bh(...t){Ks("error",...t)}function Ks(t,...e){pe&&au()&&Wn(()=>{Ce.console[t](`${Ph}[${t}]:`,...e)})}function Xs(){return pe?Mn("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var ie={enable:Lh,disable:Fh,isEnabled:au,log:Vh,warn:kh,error:Bh};var mn="?",cu=/\(error: (.*)\)/,lu=/captureMessage|captureException/;function Zs(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{let o=[],s=n.split(`
|
|
12
12
|
`);for(let l=r;l<s.length;l++){let u=s[l];if(u.length>1024)continue;let d=cu.test(u)?u.replace(cu,"$1"):u;if(!d.match(/\S*Error: /)){for(let _ of e){let h=_(d);if(h){o.push(h);break}}if(o.length>=50+i)break}}return uu(o.slice(i))}}function uu(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(no(e).function||"")&&e.pop(),e.reverse(),lu.test(no(e).function||"")&&(e.pop(),lu.test(no(e).function||"")&&e.pop()),e.slice(0,50).map(n=>Ee(x({},n),{filename:n.filename||no(e).filename,function:n.function||mn}))}function no(t){return t[t.length-1]||{}}var Js="<anonymous>";function nn(t){try{return!t||typeof t!="function"?Js:t.name||Js}catch{return Js}}function ro(t){let e=t.exception;if(e){let n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}var io={},du={};function Nt(t,e){io[t]=io[t]||[],io[t].push(e)}function Rt(t,e){if(!du[t]){du[t]=!0;try{e()}catch(n){pe&&ie.error(`Error while instrumenting ${t}`,n)}}}function ft(t,e){let n=t&&io[t];if(n)for(let r of n)try{r(e)}catch(i){pe&&ie.error(`Error while triggering instrumentation handler.
|
|
13
13
|
Type: ${t}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letscooee/web-sdk",
|
|
3
3
|
"description": "Engage uniquely and boost conversions with AI-powered customer journeys driven by real-time intent",
|
|
4
|
-
"version": "10.0.
|
|
4
|
+
"version": "10.0.5",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "ng lint",
|
|
7
7
|
"integrity": "./scripts/validate-integrity.sh",
|