@letscooee/web-sdk 13.1.7 → 13.1.9
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/chunk-3FC4J3DE.js +1 -0
- package/dist/{chunk-X2XZU367.js → chunk-6BNGPIT6.js} +1 -1
- package/dist/{chunk-OZUXI3MA.js → chunk-EJH6GSNR.js} +4 -4
- package/dist/chunk-I2DJTZ62.js +8 -0
- package/dist/{chunk-RZJCCD7D.js → chunk-KJQW3WFK.js} +1 -1
- package/dist/{chunk-O67CQ4O5.js → chunk-ODA4FRXD.js} +1 -1
- package/dist/chunk-T263X3DM.js +1 -0
- package/dist/chunk-U4XWPFUW.js +1 -0
- package/dist/{chunk-XC2ODVUS.js → chunk-WTCNMWSD.js} +1 -1
- package/dist/debug-logs-J2VHCTDA.js +1 -0
- package/dist/{debugger.component-LDZURMEE.js → debugger.component-KKAN5FYA.js} +2 -2
- package/dist/esm-EYV26LOR.js +498 -0
- package/dist/main.min.js +20 -34
- package/dist/{resource-metrics-JTNGNTMI.js → resource-metrics-EW2N36H5.js} +1 -1
- package/dist/{share-dialog.component-NUCPQNQI.js → share-dialog.component-4S4XKPRU.js} +1 -1
- package/dist/{video-detail-dialog.component-TVBDNATF.js → video-detail-dialog.component-76UPZ4UM.js} +1 -1
- package/dist/widget.min.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-DUAIGBXY.js +0 -15
- package/dist/chunk-JFEYUN4Y.js +0 -8
- package/dist/chunk-V7UGKYBN.js +0 -1
- package/dist/chunk-Y6YLR2GG.js +0 -1
- package/dist/debug-logs-DXXIMKQQ.js +0 -1
- package/dist/swiper-bundle-WHJS64TU.js +0 -1
- package/dist/swiper-bundle.min.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"./chunk-ICI7BO4Q.js";import{
|
|
1
|
+
import{a as t}from"./chunk-ICI7BO4Q.js";import{d as n}from"./chunk-T263X3DM.js";import"./chunk-U4XWPFUW.js";var r="\xA0\xA0\xA0",T=["/v1/engagement/cart-widgets","/v1/engagement/page-widgets","/v1/event/validate-session"];function d(o){if(o===0)return"0 B";let e=1024,i=["B","KB","MB","GB"],c=Math.floor(Math.log(o)/Math.log(e));return`${(o/Math.pow(e,c)).toFixed(2)} ${i[c]}`}function E(o){let e=performance.getEntriesByType?.("resource");if(e)return e.filter(i=>i.name.includes(o)).pop()}function R(){let o=performance.getEntriesByType?.("resource");return o?o.filter(e=>T.some(i=>e.name.includes(i))):[]}function y(o){let e=E(o);if(!e){n.info(`\u{1F4E6} API Resource Metrics for ${o}: Not available`);return}n.info("\u{1F4E6} \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 API Resource Metrics \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550"),n.info(`URL: ${o}`),n.info(`Duration: ${t(e.duration)}`);let i=e.transferSize===0;if(n.info(`Served from: ${i?"\u{1F4BE} Cache (disk/memory)":"\u{1F310} Network"}`),!i){n.info(`Transfer size: ${d(e.transferSize)}`),n.info(`Encoded size: ${d(e.encodedBodySize)}`),n.info(`Decoded size: ${d(e.decodedBodySize)}`);let s=(1-e.encodedBodySize/e.decodedBodySize)*100;s>0&&n.info(`Compression ratio: ${s.toFixed(1)}%`)}let c=e.redirectEnd-e.redirectStart,a=e.fetchStart-e.startTime,f=e.domainLookupEnd-e.domainLookupStart,u=e.connectEnd-e.connectStart,m=e.secureConnectionStart>0?e.connectEnd-e.secureConnectionStart:0,$=e.connectEnd===e.connectStart?e.requestStart-e.fetchStart-f:e.requestStart-e.connectEnd,l=e.responseStart-e.requestStart,p=e.responseEnd-e.responseStart;n.info(`Timing breakdown (${t(e.duration)} total):`),c>0&&n.info(`${r}Redirect: ${t(c)}`),a>0&&n.info(`${r}Queued: ${t(a)}`),$>0&&n.info(`${r}Stalled: ${t($)}`),f>0&&n.info(`${r}DNS lookup: ${t(f)}`),u>0&&n.info(`${r}TCP connect: ${t(u)}`),m>0&&n.info(`${r}SSL handshake: ${t(m)}`),n.info(`${r}Server waiting (TTFB): ${t(l)}`),n.info(`${r}Content download: ${t(p)}`);let g=e.serverTiming;if(g?.length){n.info("Server-Timing:");for(let s of g){let S=s.description||s.name;s.duration>0?n.info(`${r}${S}: ${t(s.duration)}`):n.info(`${r}${S}: ${s.duration}`)}}n.info("\u{1F4E6} \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550")}function A(){let o=R();return o.length?JSON.stringify(o.map(e=>e.toJSON())):""}export{d as formatBytes,R as getAPIResourceEntries,A as getAPIResourceEntriesJSON,y as printAPIResourceMetrics};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C,b}from"./chunk-
|
|
1
|
+
import{a as C,b}from"./chunk-ODA4FRXD.js";import{a as g,b as h,d as u,g as f}from"./chunk-WTCNMWSD.js";import{Ba as l,Qa as c,X as m,pa as n,qa as i,ra as r,v as s}from"./chunk-6BNGPIT6.js";import"./chunk-T263X3DM.js";import"./chunk-U4XWPFUW.js";var _=class d{dialogRef=s(u);eventData=s(h);triggerData=s(g)().triggerData;onShareAndClose(p,o){p.stopPropagation();let{url:t,text:a}=b(this.triggerData,this.eventData.video,o!=="Clipboard");switch(o){case"Whatsapp":window.open(`https://wa.me/?text=${a}%20${t}`,"_blank","noopener,noreferrer");break;case"X(Twitter)":window.open(`https://x.com/intent/post?text=${a}&url=${t}`,"_blank","noopener,noreferrer");break;case"Clipboard":navigator.clipboard.writeText(t).catch(()=>{let e=document.createElement("textarea");e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)});break;default:}o&&C(this.triggerData,this.eventData.video,this.eventData.index,o),this.dialogRef.close()}static \u0275fac=function(o){return new(o||d)};static \u0275cmp=m({type:d,selectors:[["cooee-share-dialog"]],decls:19,vars:0,consts:[[1,"share-dialog"],[1,"share-dialog-header"],["type","button","aria-label","Close",1,"close-button",3,"click"],["name","close","aria-hidden","true"],[1,"share-options"],["type","button","aria-label","Share on WhatsApp",1,"share-option",3,"click"],["name","whatsapp","aria-hidden","true"],["type","button","aria-label","Share on X",1,"share-option",3,"click"],["name","x-twitter","aria-hidden","true"],["type","button","aria-label","Copy link",1,"share-option",3,"click"],["name","copy","aria-hidden","true"]],template:function(o,t){o&1&&(n(0,"div",0)(1,"div",1)(2,"h3"),c(3,"Share"),i(),n(4,"button",2),l("click",function(e){return t.onShareAndClose(e)}),r(5,"cooee-icon",3),i()(),n(6,"div",4)(7,"button",5),l("click",function(e){return t.onShareAndClose(e,"Whatsapp")}),r(8,"cooee-icon",6),n(9,"span"),c(10,"Whatsapp"),i()(),n(11,"button",7),l("click",function(e){return t.onShareAndClose(e,"X(Twitter)")}),r(12,"cooee-icon",8),n(13,"span"),c(14,"X"),i()(),n(15,"button",9),l("click",function(e){return t.onShareAndClose(e,"Clipboard")}),r(16,"cooee-icon",10),n(17,"span"),c(18,"Copy link"),i()()()())},dependencies:[f],styles:["@keyframes _ngcontent-%COMP%_slideInScale{0%{opacity:0;transform:scale(.9) translateY(8px)}to{opacity:1;transform:scale(1) translateY(0)}}.share-dialog[_ngcontent-%COMP%]{background:#fff;border-radius:12px;padding:20px;min-width:280px;box-shadow:0 8px 32px #00000026;color:#333;animation:_ngcontent-%COMP%_slideInScale .25s ease-out}.share-dialog-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.share-dialog-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-family:var(--lc-heading-family),serif;margin:0;font-size:18px;font-weight:600}.share-options[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;font-family:var(--lc-text-family),serif}.share-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 16px;background:#0002;border:1px solid #e9ecef;border-radius:8px;color:#333;font-size:16px;font-weight:500;cursor:pointer;transition:all .2s ease}.share-option[_ngcontent-%COMP%]:hover{background:#0004;border-color:#dee2e6;transform:translateY(-1px)}.share-option[_ngcontent-%COMP%]:active{transform:translateY(0)}.share-option[_ngcontent-%COMP%] cooee-icon[_ngcontent-%COMP%]{width:24px;height:24px}.share-option[_ngcontent-%COMP%] cooee-icon[name=whatsapp][_ngcontent-%COMP%]{color:#25d366}.share-option[_ngcontent-%COMP%] cooee-icon[name=x-twitter][_ngcontent-%COMP%], .share-option[_ngcontent-%COMP%] cooee-icon[name=copy][_ngcontent-%COMP%]{color:#000}.share-option[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1;text-align:left}button.close-button[_ngcontent-%COMP%]{background-color:transparent;border:none}button.close-button[_ngcontent-%COMP%] cooee-icon[name=close][_ngcontent-%COMP%]{border-radius:100%;color:#000}"]})};export{_ as ShareDialogComponent};
|
package/dist/{video-detail-dialog.component-TVBDNATF.js → video-detail-dialog.component-76UPZ4UM.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as ue,l as be,o as _e,p as Ce,q as ye,r as xe,s as De,t as Ve,u as Ie}from"./chunk-OZUXI3MA.js";import{a as Ee,b as Te}from"./chunk-O67CQ4O5.js";import{a as ge,b as P,c as j,d as he,e as ve,f as fe,g as M}from"./chunk-XC2ODVUS.js";import{b as U,h as k,i as we}from"./chunk-DUAIGBXY.js";import{Ba as h,Da as s,E as _,Ga as F,Ha as B,I as K,Ia as H,L as G,La as V,M as Q,Ma as S,O as d,Ta as ie,Ua as oe,V as q,Va as ne,X as y,Za as re,ba as E,fb as se,ha as T,ia as x,ib as ae,ja as D,jb as de,kb as le,la as Y,ma as $,na as L,oa as u,pa as l,qa as a,ra as w,sa as J,sb as ce,ta as X,ua as Z,ub as pe,v,va as ee,wa as te,x as p,xa as A,y as m,za as C}from"./chunk-X2XZU367.js";import"./chunk-ICI7BO4Q.js";import{c as me}from"./chunk-Y6YLR2GG.js";import"./chunk-V7UGKYBN.js";var I="a-f\\d",Me=`#?[${I}]{3}[${I}]?`,Oe=`#?[${I}]{6}([${I}]{2})?`,Ne=new RegExp(`[^#${I}]`,"gi"),Re=new RegExp(`^${Me}$|^${Oe}$`,"i");function W(i,e={}){if(typeof i!="string"||Ne.test(i)||!Re.test(i))throw new TypeError("Expected a valid hex string");i=i.replace(/^#/,"");let t=1;i.length===8&&(t=Number.parseInt(i.slice(6,8),16)/255,i=i.slice(0,6)),i.length===4&&(t=Number.parseInt(i.slice(3,4).repeat(2),16)/255,i=i.slice(0,3)),i.length===3&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]);let o=Number.parseInt(i,16),n=o>>16,r=o>>8&255,f=o&255,b=typeof e.alpha=="number"?e.alpha:t;if(e.format==="array")return[n,r,f,b];if(e.format==="css"){let g=b===1?"":` / ${Number((b*100).toFixed(2))}%`;return`rgb(${n} ${r} ${f}${g})`}return{red:n,green:r,blue:f,alpha:b}}var c=class{h;a=100;g;constructor(e){e??={},this.h=e.h,this.a=e.a,this.g=e.g}get hex(){return this.h}get grad(){return this.g}get rgba(){if(!this.hex)return"";try{return W(this.hex,{format:"css",alpha:this.getAlpha()})}catch(e){return console.error("Invalid hex",e),"#000000"}}getAlpha(){return(this.a??100)/100}};var O=class i{static DEFAULT_FALLBACK=new c({h:"#000000",a:50});r;c;fb;constructor(e){this.r=e.r,e.c&&(this.c=new c(e.c)),e.fb&&(this.fb=new c(e.fb))}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??i.DEFAULT_FALLBACK}};var N=class{size;enabled;color;constructor(e){e??={},this.enabled=e.enabled,this.size=e.size,this.color=new c(e.color)}};var R=class i{video=le.required();progress=_(0);constructor(){ae(e=>{let t=this.video(),o=()=>{this.progress.set(t.currentTime/t.duration*100)};t.addEventListener("timeupdate",o),e(()=>{t.removeEventListener("timeupdate",o)})})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=y({type:i,selectors:[["cooee-video-progress-bar"]],inputs:{video:[1,"video"]},decls:3,vars:3,consts:[[1,"video-untracked-path"],["role","progressbar",1,"video-tracked-path"]],template:function(t,o){t&1&&(J(0,"div",0)(1,"div",1),Z(2,"div"),X()()),t&2&&(d(),S("width",o.progress(),"%"),T("aria-valuenow",o.progress()))},styles:["[_nghost-%COMP%]{display:block;width:100%;position:absolute;z-index:10;top:4px;padding-inline:8px;box-sizing:border-box}.video-untracked-path[_ngcontent-%COMP%], .video-tracked-path[_ngcontent-%COMP%]{height:4px;border-radius:var(--lc-video-progress-bar-radius)}.video-untracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-bg-color));width:100%;margin-bottom:2px}.video-tracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-color));transition:width .5s ease-in-out}@media (prefers-reduced-motion: reduce){.video-tracked-path[_ngcontent-%COMP%]{transition:none}}"]})};var z=class i{dialogState=de();dialog=v(fe);triggerData=v(ge)().triggerData;eventData=v(P);containerRef=v(q);async share(e){e.stopPropagation(),e.preventDefault(),k()&&we()?await this.shareNative():await this.shareWithDialog()}async shareNative(){let e=Te(this.triggerData,this.eventData.video,!1);await navigator.share(e),Ee(this.triggerData,this.eventData.video,this.eventData.index,"Native")}async shareWithDialog(){let e=await import("./share-dialog.component-NUCPQNQI.js");this.dialogState.emit(!0),this.dialog.open(e.ShareDialogComponent,{viewContainerRef:this.containerRef}).closed.subscribe(()=>this.dialogState.emit(!1))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=y({type:i,selectors:[["cooee-share-button"]],outputs:{dialogState:"dialogState"},decls:2,vars:0,consts:[["type","button","aria-label","Share video",3,"click"],["name","share"]],template:function(t,o){t&1&&(l(0,"button",0),h("click",function(r){return o.share(r)}),w(1,"cooee-icon",1),a())},dependencies:[M],styles:["button[_ngcontent-%COMP%]{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}button[_ngcontent-%COMP%] cooee-icon[name=share][_ngcontent-%COMP%]{color:#fff}"]})};var ze=["swiperComp"],$e=["videoEl"],Le=(i,e)=>e.url;function Ae(i,e){i&1&&(l(0,"div",11),w(1,"div",15),a())}function Fe(i,e){if(i&1&&w(0,"source",13),i&2){let t=e.$implicit;u("type",re(t.mimeType))("src",t.url,G)}}function Be(i,e){i&1&&A(0)}function He(i,e){if(i&1){let t=C();l(0,"cooee-video-promoted-items",24),h("cardClick",function(n){p(t);let r=s(2).$implicit,f=s();return m(f.productCardClicked(n,r))}),a()}if(i&2){let t=s(2).$implicit;u("items",t.items)}}function je(i,e){if(i&1&&w(0,"cooee-video-card",23),i&2){let t=s(2).$implicit;u("card",t.card)}}function Ue(i,e){if(i&1){let t=C();w(0,"cooee-video-progress-bar",16),l(1,"div",17)(2,"cooee-mute-toggle",18),ne("mutedChange",function(n){p(t);let r=s(2);return oe(r.muted,n)||(r.muted=n),m(n)}),h("toggled",function(){p(t);let n=s(2);return m(n.muteToggled())}),a(),E(3,Be,1,0,"ng-container",8),a(),l(4,"div",19)(5,"cooee-share-button",20),h("dialogState",function(n){p(t);let r=s(2);return m(r.shareDialogOpen.set(n))}),a()(),l(6,"div",21),x(7,He,1,1,"cooee-video-promoted-items",22)(8,je,1,1,"cooee-video-card",23),a()}if(i&2){let t=s().$implicit,o=V(5),n=s(),r=V(9);u("video",o),d(2),ie("muted",n.muted),u("videoEl",o),d(),u("ngTemplateOutlet",r),d(4),D(t.items.length&&n.videoConfig.showItems()?7:t.card&&n.videoConfig.footerContent===n.VideoConfigFooterContent.CARD?8:-1)}}function We(i,e){if(i&1){let t=C();l(0,"cooee-item-detail",25),h("closeClick",function(){p(t);let n=s(2);return m(n.productModalClosed())}),a()}if(i&2){let t=s(2);u("item",t.selectedItem)("similarItems",t.selectedVideo.items)("template",t.videoConfig.itemDetailConfig.template)}}function Ke(i,e){if(i&1){let t=C();l(0,"div",6)(1,"div",9)(2,"div",10),x(3,Ae,2,0,"div",11),l(4,"video",12,2),h("click",function(){let n=p(t).$index,r=s();return m(r.currentIndex===n&&r.toggleMute())})("ended",function(){p(t);let n=V(5),r=s();return m(r.onVideoEnded(n))})("loadstart",function(){let n=p(t).$index,r=s();return m(r.onVideoLoadStart(n))})("canplay",function(){let n=p(t).$index,r=s();return m(r.onVideoCanPlay(n))}),$(6,Fe,1,3,"source",13,Le),a(),x(8,Ue,9,5),a(),x(9,We,1,3,"cooee-item-detail",14),a()()}if(i&2){let t=e.$implicit,o=e.$index,n=s();d(2),S("background-image",t.thumbnail?"url("+t.thumbnail+")":null),d(),D(n.shouldShowVideoSpinner(o)?3:-1),d(),u("ngClass",n.viewTemplateClassName)("muted",!0),T("preload",n.isVideoVisible(o)?"metadata":"none")("data-video-id",t.id)("autoplay",null),d(2),L(t.sources),d(2),D(n.currentIndex===o?8:-1),d(),D(n.selectedItem&&n.currentIndex===o?9:-1)}}function Ge(i,e){i&1&&A(0)}function Qe(i,e){if(i&1){let t=C();l(0,"button",26),h("click",function(){p(t);let n=s();return m(n.close())}),w(1,"cooee-icon",27),a()}}var ke=class i{swiperComponent;videoElements;VideoConfigFooterContent=_e;currentIndex=0;muted=_(!1);selectedItem=null;selectedVideo;detailPopupTemplate;viewTemplateClassName="lc-video-only-view";shareDialogOpen=_(!1);data=v(ve);elementRef=v(K);eventData=v(P);dialogRef=v(he);swiperInitialized=_(!1);swiperOptions=_(null);videos=[];videoConfig;triggerContext;engagementTrigger;isMobile=k();navigationConfig;cssLoadedPromise;resizeDebouncer=new be(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videos=this.data.videos,this.currentIndex=this.data.currentIndex,this.selectedItem=this.data.selectedItem??null,this.selectedVideo=this.videos[this.currentIndex],this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.videoConfig=this.engagementTrigger?.content?.videoConfig??new Ce,this.navigationConfig=new N({enabled:!0,size:50,color:new c({h:"#000000"})}),this.cssLoadedPromise=ue(this.elementRef.nativeElement.shadowRoot)}onKeyDown(e){e.preventDefault(),e.stopPropagation(),this.close()}async ngOnInit(){switch(this.muted.set(await U.get("muted",!1)),this.videoConfig.detailPopup.template){case"PRODUCT_DETAIL_VIEW":this.selectItemForDetailView(),this.viewTemplateClassName="lc-product-detail-view";break;case"VIDEO_ONLY_VIEW":this.viewTemplateClassName="lc-video-only-view";break}}ngAfterViewInit(){this.initializeSwiperWithVideoDimensions()}ngOnDestroy(){this.resizeDebouncer?.destroy()}initializeSwiperWithVideoDimensions(){this.applyOptimalVideoDimensions(),this.initSwiperOptions(),this.playActiveVideo(!1)}close(){let e=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:this.videos[this.currentIndex],lastVideoIndex:this.currentIndex,lastVideoDuration:e?.currentTime})}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperComponent.swiper.slideTo(this.currentIndex+1)}productModalClosed(){this.selectedItem=null}pauseAll(){this.videoElements.forEach(e=>e.nativeElement.pause())}toggleMute(){this.muted.update(e=>!e)}async muteToggled(){await U.set("muted",this.muted());let t=[this.muted()?"CE Video Muted":"CE Video Unmuted",{current:this.currentVideoProps()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(t)}playActiveVideo(e=!0){e&&this.pauseAll();let t=this.getCurrentVideoElement();t&&this.playVideo(t)}playVideo(e){e.currentTime=0,e.play().catch(t=>me.error(t))}onVideoEnded(e){if(this.currentIndex<this.videos.length-1)this.selectedItem||this.shareDialogOpen()?this.playVideo(e):this.moveToNextVideo();else{let t=this.getPreviousVideoDataForEvent(),o=["CE Last Video Ended",{previous:t},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(o),this.playVideo(e)}}onSlideChange(e){let t=this.getPreviousVideoDataForEvent();this.currentIndex=e.realIndex,this.selectedVideo=this.videos[this.currentIndex],this.eventData.video=this.selectedVideo,this.eventData.index=this.currentIndex,this.playActiveVideo(),this.isProductDetailView()?this.selectItemForDetailView():this.selectedItem=null;let o=this.currentVideoProps(),n={previous:t,current:o},r=new j("CE Video Changed",n,this.engagementTrigger);r.setVideos(this.videos[this.currentIndex]),window.CooeeSDK.sendEvent(r)}productCardClicked(e,t){let o={videoID:t.id,videoIndex:this.currentIndex},n=new j("CE More Item Info Clicked",{current:o},this.engagementTrigger);n.setVideos(t),window.CooeeSDK.sendEvent(n),this.selectedItem=e}onVideoLoadStart(e){this.videoLoadingStates.set(e,!0)}onVideoCanPlay(e){this.videoLoadingStates.set(e,!1)}shouldShowVideoSpinner(e){return this.swiperInitialized()?this.videoLoadingStates.get(e)===!0&&this.isVideoVisible(e):this.isVideoVisible(e)}isVideoVisible(e){let t=this.currentIndex-1,o=this.currentIndex+1;return e===this.currentIndex||e===t||e===o}async initSwiperOptions(){await this.cssLoadedPromise;let e=this.isMobile?1:"auto",t=0;this.isProductDetailView()&&(e="auto",t=10),this.swiperOptions.set({direction:this.isMobile?"vertical":"horizontal",effect:this.isMobile?"slide":"coverflow",slidesPerView:e,initialSlide:this.currentIndex,centeredSlides:!0,spaceBetween:t,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:!1},on:{init:o=>{this.swiperInitialized.set(!0),setTimeout(()=>{o.update()},100)}},mousewheel:{enabled:!this.isMobile,invert:!1,thresholdDelta:20}})}isProductDetailView(){return this.videoConfig.detailPopup.template==="PRODUCT_DETAIL_VIEW"}currentVideoProps(){return{videoID:this.videos[this.currentIndex].id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let e=this.currentVideoProps(),t=this.videoElements.find(n=>n.nativeElement.dataset.videoId===this.videos[this.currentIndex].id)?.nativeElement;e.playedTillMS=Math.ceil(t?.currentTime*1e3);let o=t?.duration*1e3;return e.playedTillPercent=+(e.playedTillMS/o).toFixed(4),e}selectItemForDetailView(){this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null}applyOptimalVideoDimensions(){if(this.isMobile||this.isProductDetailView())return;let e=this.calculateOptimalVideoDimensions();e&&this.setVideoContainerDimensions(e.width,e.height)}calculateOptimalVideoDimensions(){let e=this.videos.map(g=>g.sources?.[0]).filter(g=>g?.width&&g?.height).map(g=>({width:g.width,height:g.height,aspectRatio:g.width/g.height}));if(e.length===0)return null;let t=e[0],o=window.innerWidth*.9,n=window.innerHeight*.9,r=o/t.width,f=n/t.height,b=Math.min(r,f);return{width:Math.floor(t.width*b),height:Math.floor(t.height*b)}}setVideoContainerDimensions(e,t){let o=this.elementRef.nativeElement;o.style.setProperty("--video-container-width",`${e}px`),o.style.setProperty("--video-container-height",`${t}px`)}onResize(){this.applyOptimalVideoDimensions()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=y({type:i,selectors:[["cooee-video-detail-dialog"]],viewQuery:function(t,o){if(t&1&&(F(ze,7),F($e,5)),t&2){let n;B(n=H())&&(o.swiperComponent=n.first),B(n=H())&&(o.videoElements=n)}},hostAttrs:[1,"letscooee-widget"],hostBindings:function(t,o){t&1&&h("keydown.escape",function(r){return o.onKeyDown(r)},Q)},decls:10,vars:4,consts:[["swiperComp",""],["closeButtonTemplate",""],["videoEl",""],[1,"lc-shadow-inner",3,"ngClass"],[1,"video-swiper",3,"slideChange","options","navigationConfig"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-slide"],[1,"lc-desktop-controls"],[4,"ngTemplateOutlet"],[1,"lc-video-modal-row"],[1,"lc-video-container"],[1,"video-loading-overlay"],["playsinline","",1,"lc-video-el",3,"click","ended","loadstart","canplay","ngClass","muted"],[3,"src","type"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"item","similarItems","template"],[1,"loading-spinner"],[3,"video"],[1,"lc-video-controls"],[3,"mutedChange","toggled","muted","videoEl"],[1,"share-controls"],[3,"dialogState"],[1,"lc-card-container"],[3,"items"],[3,"card"],[3,"cardClick","items"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"closeClick","item","similarItems","template"],["type","button","aria-label","Close",1,"lc-close-button",3,"click"],["name","close","aria-hidden","true"]],template:function(t,o){if(t&1){let n=C();l(0,"div",3)(1,"cooee-swiper",4,0),h("slideChange",function(f){return p(n),m(o.onSlideChange(f))}),ee(3,5),$(4,Ke,10,10,"div",6,Y),te(),a(),l(6,"div",7),E(7,Ge,1,0,"ng-container",8),a()(),E(8,Qe,2,0,"ng-template",null,1,se)}if(t&2){let n=V(9);u("ngClass",o.viewTemplateClassName),d(),u("options",o.swiperOptions())("navigationConfig",o.navigationConfig),d(3),L(o.videos),d(3),u("ngTemplateOutlet",n)}},dependencies:[Ie,ye,Ve,z,R,pe,ce,De,xe,M],styles:[`:host{display:flex}.lc-shadow-inner{position:relative;width:100vw;height:100vh;display:flex}@media (min-width: 768px){.lc-shadow-inner{background-color:color-mix(in oklab,#000 70%,transparent);justify-content:center;align-items:center}}.video-swiper{--swiper-navigation-size: 50px;--swiper-navigation-color: white;width:100dvw;height:100dvh}.lc-product-detail-view .video-swiper{align-items:center}@media (min-width: 768px){.video-swiper{width:100%;height:100%;max-width:90vw;max-height:90vh}}.video-swiper>.swiper-wrapper{max-height:100%;pointer-events:none}.lc-product-detail-view .video-swiper>.swiper-wrapper{align-items:center}@media (max-width: 768px){.video-swiper>.swiper-button-prev{display:none!important}}@media (max-width: 768px){.video-swiper>.swiper-button-next{display:var(--lc-next-video-button-display)!important;width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent);color:#fff;inset:auto auto 12px 50%;transform:translate(-50%) rotate(90deg)}.video-swiper>.swiper-button-next:after{color:#fff;font-weight:900}}.video-swiper:has(cooee-item-detail)>.swiper-button-next{display:none!important}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden;pointer-events:auto}.lc-product-detail-view .video-slide{width:40vw!important;height:70vh!important}@media (min-width: 768px){.lc-product-detail-view .video-slide{min-width:650px!important}}@media (max-width: 768px){.lc-product-detail-view .video-slide{width:100%!important;height:100%!important}}@media (min-width: 768px){.lc-video-only-view .video-slide{width:fit-content!important}}@media (min-width: 768px){.video-slide{border-radius:var(--lc-media-radius);overflow:hidden}}.video-slide.swiper-slide-active,.video-slide.swiper-slide-prev,.video-slide.swiper-slide-next{visibility:visible}video{width:100%;height:100%;object-fit:cover;position:relative;z-index:3}.lc-desktop-controls{position:absolute;top:2rem;right:4rem;z-index:10;display:flex;gap:.5rem}@media (max-width: 768px){.lc-desktop-controls{display:none}}.lc-video-controls{position:absolute;top:1rem;z-index:10;right:.5rem;display:flex;gap:.25rem}@media (min-width: 768px){.lc-video-controls .lc-close-button{display:none}}.share-controls{position:absolute;bottom:30%;right:.5rem;z-index:10;display:flex;gap:.25rem;flex-direction:column;justify-content:center;align-items:center}.lc-close-button{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}.lc-video-container{position:relative;height:100%;width:100%;background:#000000b3 no-repeat center;background-size:cover}@media (min-width: 768px){.lc-product-detail-view .lc-video-container{width:50%}}@media (min-width: 768px){.lc-video-only-view .lc-video-container{width:var(--video-container-width, 100%);height:var(--video-container-height, 100%)}}.lc-card-container{position:absolute;bottom:12px;z-index:10;width:100%;padding-inline:12px;box-sizing:border-box}.lc-product-detail-view .lc-card-container{display:none}@media (max-width: 768px){.lc-product-detail-view .lc-card-container{display:block}}.lc-product-detail-view .lc-video-modal-row{display:flex;justify-content:center;height:100%;width:100%}.lc-video-only-view .lc-video-modal-row{display:block;height:100%}.lc-product-detail-view cooee-item-detail{--header-display: none;width:50%;flex:1}@media (max-width: 768px){.lc-product-detail-view cooee-item-detail{--header-display: flex;width:100%;height:70dvh;position:absolute;bottom:0;z-index:2147483646}}.lc-video-only-view cooee-item-detail{width:100%;height:70dvh;z-index:2147483646;bottom:0;position:absolute;border-radius:var(--lc-card-radius) var(--lc-card-radius) 0 0}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.video-loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#0000004d;z-index:2}.video-loading-overlay .loading-spinner{width:30px;height:30px;border:3px solid rgba(255,255,255,.3);border-top:3px solid #fff;border-radius:50%;animation:spin 1s linear infinite}
|
|
1
|
+
import{b as ue,l as be,o as _e,p as Ce,q as ye,r as xe,s as De,t as Ve,u as Ie}from"./chunk-EJH6GSNR.js";import{a as Ee,b as Te}from"./chunk-ODA4FRXD.js";import{a as ge,b as P,c as j,d as he,e as ve,f as fe,g as M}from"./chunk-WTCNMWSD.js";import{b as U,h as k,i as we}from"./chunk-3FC4J3DE.js";import{Ba as h,Da as s,E as _,Ga as F,Ha as B,I as K,Ia as H,L as G,La as V,M as Q,Ma as S,O as d,Ta as ie,Ua as oe,V as q,Va as ne,X as y,Za as re,ba as E,fb as se,ha as T,ia as x,ib as ae,ja as D,jb as de,kb as le,la as Y,ma as $,na as L,oa as u,pa as l,qa as a,ra as w,sa as J,sb as ce,ta as X,ua as Z,ub as pe,v,va as ee,wa as te,x as p,xa as A,y as m,za as C}from"./chunk-6BNGPIT6.js";import"./chunk-ICI7BO4Q.js";import{d as me}from"./chunk-T263X3DM.js";import"./chunk-U4XWPFUW.js";var I="a-f\\d",Me=`#?[${I}]{3}[${I}]?`,Oe=`#?[${I}]{6}([${I}]{2})?`,Ne=new RegExp(`[^#${I}]`,"gi"),Re=new RegExp(`^${Me}$|^${Oe}$`,"i");function W(i,e={}){if(typeof i!="string"||Ne.test(i)||!Re.test(i))throw new TypeError("Expected a valid hex string");i=i.replace(/^#/,"");let t=1;i.length===8&&(t=Number.parseInt(i.slice(6,8),16)/255,i=i.slice(0,6)),i.length===4&&(t=Number.parseInt(i.slice(3,4).repeat(2),16)/255,i=i.slice(0,3)),i.length===3&&(i=i[0]+i[0]+i[1]+i[1]+i[2]+i[2]);let o=Number.parseInt(i,16),n=o>>16,r=o>>8&255,f=o&255,b=typeof e.alpha=="number"?e.alpha:t;if(e.format==="array")return[n,r,f,b];if(e.format==="css"){let g=b===1?"":` / ${Number((b*100).toFixed(2))}%`;return`rgb(${n} ${r} ${f}${g})`}return{red:n,green:r,blue:f,alpha:b}}var c=class{h;a=100;g;constructor(e){e??={},this.h=e.h,this.a=e.a,this.g=e.g}get hex(){return this.h}get grad(){return this.g}get rgba(){if(!this.hex)return"";try{return W(this.hex,{format:"css",alpha:this.getAlpha()})}catch(e){return console.error("Invalid hex",e),"#000000"}}getAlpha(){return(this.a??100)/100}};var O=class i{static DEFAULT_FALLBACK=new c({h:"#000000",a:50});r;c;fb;constructor(e){this.r=e.r,e.c&&(this.c=new c(e.c)),e.fb&&(this.fb=new c(e.fb))}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??i.DEFAULT_FALLBACK}};var N=class{size;enabled;color;constructor(e){e??={},this.enabled=e.enabled,this.size=e.size,this.color=new c(e.color)}};var R=class i{video=le.required();progress=_(0);constructor(){ae(e=>{let t=this.video(),o=()=>{this.progress.set(t.currentTime/t.duration*100)};t.addEventListener("timeupdate",o),e(()=>{t.removeEventListener("timeupdate",o)})})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=y({type:i,selectors:[["cooee-video-progress-bar"]],inputs:{video:[1,"video"]},decls:3,vars:3,consts:[[1,"video-untracked-path"],["role","progressbar",1,"video-tracked-path"]],template:function(t,o){t&1&&(J(0,"div",0)(1,"div",1),Z(2,"div"),X()()),t&2&&(d(),S("width",o.progress(),"%"),T("aria-valuenow",o.progress()))},styles:["[_nghost-%COMP%]{display:block;width:100%;position:absolute;z-index:10;top:4px;padding-inline:8px;box-sizing:border-box}.video-untracked-path[_ngcontent-%COMP%], .video-tracked-path[_ngcontent-%COMP%]{height:4px;border-radius:var(--lc-video-progress-bar-radius)}.video-untracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-bg-color));width:100%;margin-bottom:2px}.video-tracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-color));transition:width .5s ease-in-out}@media (prefers-reduced-motion: reduce){.video-tracked-path[_ngcontent-%COMP%]{transition:none}}"]})};var z=class i{dialogState=de();dialog=v(fe);triggerData=v(ge)().triggerData;eventData=v(P);containerRef=v(q);async share(e){e.stopPropagation(),e.preventDefault(),k()&&we()?await this.shareNative():await this.shareWithDialog()}async shareNative(){let e=Te(this.triggerData,this.eventData.video,!1);await navigator.share(e),Ee(this.triggerData,this.eventData.video,this.eventData.index,"Native")}async shareWithDialog(){let e=await import("./share-dialog.component-4S4XKPRU.js");this.dialogState.emit(!0),this.dialog.open(e.ShareDialogComponent,{viewContainerRef:this.containerRef}).closed.subscribe(()=>this.dialogState.emit(!1))}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=y({type:i,selectors:[["cooee-share-button"]],outputs:{dialogState:"dialogState"},decls:2,vars:0,consts:[["type","button","aria-label","Share video",3,"click"],["name","share"]],template:function(t,o){t&1&&(l(0,"button",0),h("click",function(r){return o.share(r)}),w(1,"cooee-icon",1),a())},dependencies:[M],styles:["button[_ngcontent-%COMP%]{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}button[_ngcontent-%COMP%] cooee-icon[name=share][_ngcontent-%COMP%]{color:#fff}"]})};var ze=["swiperComp"],$e=["videoEl"],Le=(i,e)=>e.url;function Ae(i,e){i&1&&(l(0,"div",11),w(1,"div",15),a())}function Fe(i,e){if(i&1&&w(0,"source",13),i&2){let t=e.$implicit;u("type",re(t.mimeType))("src",t.url,G)}}function Be(i,e){i&1&&A(0)}function He(i,e){if(i&1){let t=C();l(0,"cooee-video-promoted-items",24),h("cardClick",function(n){p(t);let r=s(2).$implicit,f=s();return m(f.productCardClicked(n,r))}),a()}if(i&2){let t=s(2).$implicit;u("items",t.items)}}function je(i,e){if(i&1&&w(0,"cooee-video-card",23),i&2){let t=s(2).$implicit;u("card",t.card)}}function Ue(i,e){if(i&1){let t=C();w(0,"cooee-video-progress-bar",16),l(1,"div",17)(2,"cooee-mute-toggle",18),ne("mutedChange",function(n){p(t);let r=s(2);return oe(r.muted,n)||(r.muted=n),m(n)}),h("toggled",function(){p(t);let n=s(2);return m(n.muteToggled())}),a(),E(3,Be,1,0,"ng-container",8),a(),l(4,"div",19)(5,"cooee-share-button",20),h("dialogState",function(n){p(t);let r=s(2);return m(r.shareDialogOpen.set(n))}),a()(),l(6,"div",21),x(7,He,1,1,"cooee-video-promoted-items",22)(8,je,1,1,"cooee-video-card",23),a()}if(i&2){let t=s().$implicit,o=V(5),n=s(),r=V(9);u("video",o),d(2),ie("muted",n.muted),u("videoEl",o),d(),u("ngTemplateOutlet",r),d(4),D(t.items.length&&n.videoConfig.showItems()?7:t.card&&n.videoConfig.footerContent===n.VideoConfigFooterContent.CARD?8:-1)}}function We(i,e){if(i&1){let t=C();l(0,"cooee-item-detail",25),h("closeClick",function(){p(t);let n=s(2);return m(n.productModalClosed())}),a()}if(i&2){let t=s(2);u("item",t.selectedItem)("similarItems",t.selectedVideo.items)("template",t.videoConfig.itemDetailConfig.template)}}function Ke(i,e){if(i&1){let t=C();l(0,"div",6)(1,"div",9)(2,"div",10),x(3,Ae,2,0,"div",11),l(4,"video",12,2),h("click",function(){let n=p(t).$index,r=s();return m(r.currentIndex===n&&r.toggleMute())})("ended",function(){p(t);let n=V(5),r=s();return m(r.onVideoEnded(n))})("loadstart",function(){let n=p(t).$index,r=s();return m(r.onVideoLoadStart(n))})("canplay",function(){let n=p(t).$index,r=s();return m(r.onVideoCanPlay(n))}),$(6,Fe,1,3,"source",13,Le),a(),x(8,Ue,9,5),a(),x(9,We,1,3,"cooee-item-detail",14),a()()}if(i&2){let t=e.$implicit,o=e.$index,n=s();d(2),S("background-image",t.thumbnail?"url("+t.thumbnail+")":null),d(),D(n.shouldShowVideoSpinner(o)?3:-1),d(),u("ngClass",n.viewTemplateClassName)("muted",!0),T("preload",n.isVideoVisible(o)?"metadata":"none")("data-video-id",t.id)("autoplay",null),d(2),L(t.sources),d(2),D(n.currentIndex===o?8:-1),d(),D(n.selectedItem&&n.currentIndex===o?9:-1)}}function Ge(i,e){i&1&&A(0)}function Qe(i,e){if(i&1){let t=C();l(0,"button",26),h("click",function(){p(t);let n=s();return m(n.close())}),w(1,"cooee-icon",27),a()}}var ke=class i{swiperComponent;videoElements;VideoConfigFooterContent=_e;currentIndex=0;muted=_(!1);selectedItem=null;selectedVideo;detailPopupTemplate;viewTemplateClassName="lc-video-only-view";shareDialogOpen=_(!1);data=v(ve);elementRef=v(K);eventData=v(P);dialogRef=v(he);swiperInitialized=_(!1);swiperOptions=_(null);videos=[];videoConfig;triggerContext;engagementTrigger;isMobile=k();navigationConfig;cssLoadedPromise;resizeDebouncer=new be(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videos=this.data.videos,this.currentIndex=this.data.currentIndex,this.selectedItem=this.data.selectedItem??null,this.selectedVideo=this.videos[this.currentIndex],this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.videoConfig=this.engagementTrigger?.content?.videoConfig??new Ce,this.navigationConfig=new N({enabled:!0,size:50,color:new c({h:"#000000"})}),this.cssLoadedPromise=ue(this.elementRef.nativeElement.shadowRoot)}onKeyDown(e){e.preventDefault(),e.stopPropagation(),this.close()}async ngOnInit(){switch(this.muted.set(await U.get("muted",!1)),this.videoConfig.detailPopup.template){case"PRODUCT_DETAIL_VIEW":this.selectItemForDetailView(),this.viewTemplateClassName="lc-product-detail-view";break;case"VIDEO_ONLY_VIEW":this.viewTemplateClassName="lc-video-only-view";break}}ngAfterViewInit(){this.initializeSwiperWithVideoDimensions()}ngOnDestroy(){this.resizeDebouncer?.destroy()}initializeSwiperWithVideoDimensions(){this.applyOptimalVideoDimensions(),this.initSwiperOptions(),this.playActiveVideo(!1)}close(){let e=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:this.videos[this.currentIndex],lastVideoIndex:this.currentIndex,lastVideoDuration:e?.currentTime})}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperComponent.swiper.slideTo(this.currentIndex+1)}productModalClosed(){this.selectedItem=null}pauseAll(){this.videoElements.forEach(e=>e.nativeElement.pause())}toggleMute(){this.muted.update(e=>!e)}async muteToggled(){await U.set("muted",this.muted());let t=[this.muted()?"CE Video Muted":"CE Video Unmuted",{current:this.currentVideoProps()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(t)}playActiveVideo(e=!0){e&&this.pauseAll();let t=this.getCurrentVideoElement();t&&this.playVideo(t)}playVideo(e){e.currentTime=0,e.play().catch(t=>me.error(t))}onVideoEnded(e){if(this.currentIndex<this.videos.length-1)this.selectedItem||this.shareDialogOpen()?this.playVideo(e):this.moveToNextVideo();else{let t=this.getPreviousVideoDataForEvent(),o=["CE Last Video Ended",{previous:t},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(o),this.playVideo(e)}}onSlideChange(e){let t=this.getPreviousVideoDataForEvent();this.currentIndex=e.realIndex,this.selectedVideo=this.videos[this.currentIndex],this.eventData.video=this.selectedVideo,this.eventData.index=this.currentIndex,this.playActiveVideo(),this.isProductDetailView()?this.selectItemForDetailView():this.selectedItem=null;let o=this.currentVideoProps(),n={previous:t,current:o},r=new j("CE Video Changed",n,this.engagementTrigger);r.setVideos(this.videos[this.currentIndex]),window.CooeeSDK.sendEvent(r)}productCardClicked(e,t){let o={videoID:t.id,videoIndex:this.currentIndex},n=new j("CE More Item Info Clicked",{current:o},this.engagementTrigger);n.setVideos(t),window.CooeeSDK.sendEvent(n),this.selectedItem=e}onVideoLoadStart(e){this.videoLoadingStates.set(e,!0)}onVideoCanPlay(e){this.videoLoadingStates.set(e,!1)}shouldShowVideoSpinner(e){return this.swiperInitialized()?this.videoLoadingStates.get(e)===!0&&this.isVideoVisible(e):this.isVideoVisible(e)}isVideoVisible(e){let t=this.currentIndex-1,o=this.currentIndex+1;return e===this.currentIndex||e===t||e===o}async initSwiperOptions(){await this.cssLoadedPromise;let e=this.isMobile?1:"auto",t=0;this.isProductDetailView()&&(e="auto",t=10),this.swiperOptions.set({direction:this.isMobile?"vertical":"horizontal",effect:this.isMobile?"slide":"coverflow",slidesPerView:e,initialSlide:this.currentIndex,centeredSlides:!0,spaceBetween:t,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:!1},on:{init:o=>{this.swiperInitialized.set(!0),setTimeout(()=>{o.update()},100)}},mousewheel:{enabled:!this.isMobile,invert:!1,thresholdDelta:20}})}isProductDetailView(){return this.videoConfig.detailPopup.template==="PRODUCT_DETAIL_VIEW"}currentVideoProps(){return{videoID:this.videos[this.currentIndex].id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let e=this.currentVideoProps(),t=this.videoElements.find(n=>n.nativeElement.dataset.videoId===this.videos[this.currentIndex].id)?.nativeElement;e.playedTillMS=Math.ceil(t?.currentTime*1e3);let o=t?.duration*1e3;return e.playedTillPercent=+(e.playedTillMS/o).toFixed(4),e}selectItemForDetailView(){this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null}applyOptimalVideoDimensions(){if(this.isMobile||this.isProductDetailView())return;let e=this.calculateOptimalVideoDimensions();e&&this.setVideoContainerDimensions(e.width,e.height)}calculateOptimalVideoDimensions(){let e=this.videos.map(g=>g.sources?.[0]).filter(g=>g?.width&&g?.height).map(g=>({width:g.width,height:g.height,aspectRatio:g.width/g.height}));if(e.length===0)return null;let t=e[0],o=window.innerWidth*.9,n=window.innerHeight*.9,r=o/t.width,f=n/t.height,b=Math.min(r,f);return{width:Math.floor(t.width*b),height:Math.floor(t.height*b)}}setVideoContainerDimensions(e,t){let o=this.elementRef.nativeElement;o.style.setProperty("--video-container-width",`${e}px`),o.style.setProperty("--video-container-height",`${t}px`)}onResize(){this.applyOptimalVideoDimensions()}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=y({type:i,selectors:[["cooee-video-detail-dialog"]],viewQuery:function(t,o){if(t&1&&(F(ze,7),F($e,5)),t&2){let n;B(n=H())&&(o.swiperComponent=n.first),B(n=H())&&(o.videoElements=n)}},hostAttrs:[1,"letscooee-widget"],hostBindings:function(t,o){t&1&&h("keydown.escape",function(r){return o.onKeyDown(r)},Q)},decls:10,vars:4,consts:[["swiperComp",""],["closeButtonTemplate",""],["videoEl",""],[1,"lc-shadow-inner",3,"ngClass"],[1,"video-swiper",3,"slideChange","options","navigationConfig"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-slide"],[1,"lc-desktop-controls"],[4,"ngTemplateOutlet"],[1,"lc-video-modal-row"],[1,"lc-video-container"],[1,"video-loading-overlay"],["playsinline","",1,"lc-video-el",3,"click","ended","loadstart","canplay","ngClass","muted"],[3,"src","type"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"item","similarItems","template"],[1,"loading-spinner"],[3,"video"],[1,"lc-video-controls"],[3,"mutedChange","toggled","muted","videoEl"],[1,"share-controls"],[3,"dialogState"],[1,"lc-card-container"],[3,"items"],[3,"card"],[3,"cardClick","items"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"closeClick","item","similarItems","template"],["type","button","aria-label","Close",1,"lc-close-button",3,"click"],["name","close","aria-hidden","true"]],template:function(t,o){if(t&1){let n=C();l(0,"div",3)(1,"cooee-swiper",4,0),h("slideChange",function(f){return p(n),m(o.onSlideChange(f))}),ee(3,5),$(4,Ke,10,10,"div",6,Y),te(),a(),l(6,"div",7),E(7,Ge,1,0,"ng-container",8),a()(),E(8,Qe,2,0,"ng-template",null,1,se)}if(t&2){let n=V(9);u("ngClass",o.viewTemplateClassName),d(),u("options",o.swiperOptions())("navigationConfig",o.navigationConfig),d(3),L(o.videos),d(3),u("ngTemplateOutlet",n)}},dependencies:[Ie,ye,Ve,z,R,pe,ce,De,xe,M],styles:[`:host{display:flex}.lc-shadow-inner{position:relative;width:100vw;height:100vh;display:flex}@media (min-width: 768px){.lc-shadow-inner{background-color:color-mix(in oklab,#000 70%,transparent);justify-content:center;align-items:center}}.video-swiper{--swiper-navigation-size: 50px;--swiper-navigation-color: white;width:100dvw;height:100dvh}.lc-product-detail-view .video-swiper{align-items:center}@media (min-width: 768px){.video-swiper{width:100%;height:100%;max-width:90vw;max-height:90vh}}.video-swiper>.swiper-wrapper{max-height:100%;pointer-events:none}.lc-product-detail-view .video-swiper>.swiper-wrapper{align-items:center}@media (max-width: 768px){.video-swiper>.swiper-button-prev{display:none!important}}@media (max-width: 768px){.video-swiper>.swiper-button-next{display:var(--lc-next-video-button-display)!important;width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent);color:#fff;inset:auto auto 12px 50%;transform:translate(-50%) rotate(90deg)}.video-swiper>.swiper-button-next:after{color:#fff;font-weight:900}}.video-swiper:has(cooee-item-detail)>.swiper-button-next{display:none!important}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden;pointer-events:auto}.lc-product-detail-view .video-slide{width:40vw!important;height:70vh!important}@media (min-width: 768px){.lc-product-detail-view .video-slide{min-width:650px!important}}@media (max-width: 768px){.lc-product-detail-view .video-slide{width:100%!important;height:100%!important}}@media (min-width: 768px){.lc-video-only-view .video-slide{width:fit-content!important}}@media (min-width: 768px){.video-slide{border-radius:var(--lc-media-radius);overflow:hidden}}.video-slide.swiper-slide-active,.video-slide.swiper-slide-prev,.video-slide.swiper-slide-next{visibility:visible}video{width:100%;height:100%;object-fit:cover;position:relative;z-index:3}.lc-desktop-controls{position:absolute;top:2rem;right:4rem;z-index:10;display:flex;gap:.5rem}@media (max-width: 768px){.lc-desktop-controls{display:none}}.lc-video-controls{position:absolute;top:1rem;z-index:10;right:.5rem;display:flex;gap:.25rem}@media (min-width: 768px){.lc-video-controls .lc-close-button{display:none}}.share-controls{position:absolute;bottom:30%;right:.5rem;z-index:10;display:flex;gap:.25rem;flex-direction:column;justify-content:center;align-items:center}.lc-close-button{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}.lc-video-container{position:relative;height:100%;width:100%;background:#000000b3 no-repeat center;background-size:cover}@media (min-width: 768px){.lc-product-detail-view .lc-video-container{width:50%}}@media (min-width: 768px){.lc-video-only-view .lc-video-container{width:var(--video-container-width, 100%);height:var(--video-container-height, 100%)}}.lc-card-container{position:absolute;bottom:12px;z-index:10;width:100%;padding-inline:12px;box-sizing:border-box}.lc-product-detail-view .lc-card-container{display:none}@media (max-width: 768px){.lc-product-detail-view .lc-card-container{display:block}}.lc-product-detail-view .lc-video-modal-row{display:flex;justify-content:center;height:100%;width:100%}.lc-video-only-view .lc-video-modal-row{display:block;height:100%}.lc-product-detail-view cooee-item-detail{--header-display: none;width:50%;flex:1}@media (max-width: 768px){.lc-product-detail-view cooee-item-detail{--header-display: flex;width:100%;height:70dvh;position:absolute;bottom:0;z-index:2147483646}}.lc-video-only-view cooee-item-detail{width:100%;height:70dvh;z-index:2147483646;bottom:0;position:absolute;border-radius:var(--lc-card-radius) var(--lc-card-radius) 0 0}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.video-loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#0000004d;z-index:2}.video-loading-overlay .loading-spinner{width:30px;height:30px;border:3px solid rgba(255,255,255,.3);border-top:3px solid #fff;border-radius:50%;animation:spin 1s linear infinite}
|
|
2
2
|
`],encapsulation:3})};export{ke as VideoDetailDialogComponent};
|
package/dist/widget.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as yi,c as rt,d as ut,e as ie,f as Ci,g as se,h as xi,i as Vi,j as Si,k as Ii,m as ki,n as Fi,o as At,q as Di,r as Li,s as Ni,t as Bi,u as Hi}from"./chunk-
|
|
1
|
+
import{a as yi,c as rt,d as ut,e as ie,f as Ci,g as se,h as xi,i as Vi,j as Si,k as Ii,m as ki,n as Fi,o as At,q as Di,r as Li,s as Ni,t as Bi,u as Hi}from"./chunk-EJH6GSNR.js";import{c as ft,d as Ti,e as Ei,f as gt,g as Pi,h as Ai,i as Ri,l as Oi}from"./chunk-WTCNMWSD.js";import{a as ht}from"./chunk-KJQW3WFK.js";import{a as vi,b as _i,c as bi,d as wi,e as Qe,g as Ge,h as Mi}from"./chunk-3FC4J3DE.js";import{$ as z,$a as te,A as Kt,Aa as ve,B as Jt,Ba as j,Da as y,E as fe,F as Yt,Ga as Ue,Ha as ze,I as Xt,Ia as qe,K as ce,L as He,La as de,Ma as nt,N as ei,O as V,P as ti,Pa as di,Q as ii,Qa as Z,Ra as ot,S as Ft,Sa as we,Wa as Re,X as U,Xa as ye,Ya as q,Z as ni,_ as oi,aa as ri,ab as We,b as zt,bb as pi,cb as Ce,da as ai,db as Ve,e as qt,eb as mi,fa as si,gb as ui,ha as it,ia as N,ib as fi,ja as B,k as Wt,kb as Dt,la as mt,ma as ge,na as he,oa as H,p as Zt,pa as M,qa as P,ra as ne,s as Qt,sa as je,sb as Ze,ta as $e,ua as Se,v as le,va as li,wa as ci,x as A,xb as gi,y as R,z as Gt,za as J}from"./chunk-6BNGPIT6.js";import"./chunk-ICI7BO4Q.js";import{d as W,e as hi}from"./chunk-T263X3DM.js";import{a as be,b as Ut,e as Gi,g as Ki}from"./chunk-U4XWPFUW.js";var zi=Gi((vt,Ui)=>{"use strict";(function(n,e){typeof vt=="object"&&typeof Ui<"u"?e(vt):typeof define=="function"&&define.amd?define(["exports"],e):e((n=typeof globalThis<"u"?globalThis:n||self).Sqrl={})})(vt,function(n){"use strict";function e(s){var l,d,m=new Error(s);return l=m,d=e.prototype,Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d,m}function t(s,l,d){var m=l.slice(0,d).split(/\n/),r=m.length,i=m[r-1].length+1;throw e(s+=" at line "+r+" col "+i+`:
|
|
2
2
|
|
|
3
3
|
`+l.split(/\n/)[r-1]+`
|
|
4
4
|
`+Array(i).join(" ")+"^")}e.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var o=new Function("return this")().Promise,a=!1;try{a=new Function("return (async function(){}).constructor")()}catch(s){if(!(s instanceof SyntaxError))throw s}function c(s,l){return Object.prototype.hasOwnProperty.call(s,l)}function u(s,l,d){for(var m in l)c(l,m)&&(l[m]==null||typeof l[m]!="object"||m!=="storage"&&m!=="prefixes"||d?s[m]=l[m]:s[m]=u({},l[m]));return s}var f=/^async +/,b=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,D=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,Y=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,Te=/[.*+\-?^${}()|[\]\\]/g;function Ee(s){return Te.test(s)?s.replace(Te,"\\$&"):s}function at(s,l){l.rmWhitespace&&(s=s.replace(/[\r\n]+/g,`
|
|
@@ -13,8 +13,8 @@ import{a as yi,c as rt,d as ut,e as ie,f as Ci,g as se,h as xi,i as Vi,j as Si,k
|
|
|
13
13
|
`],encapsulation:3})};var bt=class n extends se{item;data=le(Ei);dialogRef=le(Ti);ItemDetailLayout=Si;constructor(){super(),this.triggerContext=this.data.triggerContext,this.item=this.data.item}close(){this.dialogRef.close()}engagementTriggerReceived(e){}update(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-item-quick-view"]],features:[te(ie()),z],decls:1,vars:2,consts:[[3,"closeClick","item","layout"]],template:function(t,o){t&1&&(M(0,"cooee-item-detail",0),j("closeClick",function(){return o.close()}),P()),t&2&&H("item",o.item)("layout",o.ItemDetailLayout.TWO_PANE)},dependencies:[Di],styles:[`:host{display:flex;align-items:center;justify-content:center;height:100%}@media (min-width: 768px){cooee-item-detail{max-width:900px;max-height:80vh;border-radius:var(--lc-card-radius)}}
|
|
14
14
|
`],encapsulation:3})};var wt=class n{dialog=le(gt);dialogRef;constructor(){}showItemQuickView(e,t){this.dialogRef=this.dialog.open(bt,{width:"100vw",height:"100dvh",backdropClass:["letscooee-backdrop"],data:{item:t,triggerContext:e}})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=Qt({token:n,factory:n.\u0275fac,providedIn:"root"})};var hn=(n,e)=>({enter:n,exit:e});function vn(n,e){if(n&1&&(M(0,"div",7),Z(1),P(),M(2,"div",8),Z(3),P()),n&2){let t=y(2);V(),we(" ",t.getCurrency(t.selectedVariant().price.cmp)," "),V(2),we(" ",t.getDiscountPercentage(t.selectedVariant().price),"% off ")}}function yn(n,e){if(n&1&&(M(0,"div",6),Z(1),P()),n&2){let t=y(2);V(),we(" ",t.stickyATCConfig.leftText," ")}}function Cn(n,e){if(n&1&&(M(0,"div",1)(1,"div",5),Z(2),P(),N(3,vn,4,2),N(4,yn,2,1,"div",6),P()),n&2){let t=y();V(2),we(" ",t.getCurrency(t.selectedVariant().price.d)," "),V(),B(t.selectedVariant().price.cmp?3:-1),V(),B(t.stickyATCConfig.leftText?4:-1)}}function xn(n,e){if(n&1&&(M(0,"div",9),Z(1),P()),n&2){let t=e.$implicit,o=e.$index;y(2);let a=q(5);H("ngClass",pi(2,hn,o===a.currentIndex,o===a.previousIndex)),V(),we(" ",t," ")}}function _n(n,e){if(n&1&&(M(0,"div",4),ge(1,xn,2,5,"div",9,mt),P()),n&2){y();let t=q(5);V(),he(t.features)}}var Vt=class n extends se{currentItem;stickyATCConfig;selectedVariant=fe(void 0);featureSlider=fe({features:[],currentIndex:0});constructor(){super()}onVariantChange(e){this.currentItem&&(this.currentItem.setSelectedVariantByID(e.detail.variantID),this.selectedVariant.set(this.currentItem.selectedOrFirstVariant.value))}engagementTriggerReceived(e){this.stickyATCConfig=e.stickyATCConfig??{},this.currentItem=e.items[0],this.selectedVariant.set(this.currentItem.vars[0]),this.stickyATCConfig.leftText=this.replaceVariables(this.stickyATCConfig.leftText),this.stickyATCConfig.rightText=this.replaceVariables(this.stickyATCConfig.rightText),this.startFeatureRotation()}update(){}getCurrency(e){return Qe(e)}getDiscountPercentage(e){return((e.cmp-e.d)/e.cmp*100).toFixed(0)}addToCart(){this.engagementService.executeCTA(rt.ADD_TO_CART,{item:this.currentItem})}startFeatureRotation(){if(!this.stickyATCConfig.rightText)return;let e=this.stickyATCConfig.rightText.split(`
|
|
15
15
|
`),t=e.length===1?null:setInterval(()=>{this.featureSlider.update(o=>Ut(be({},o),{previousIndex:o.currentIndex,currentIndex:(o.currentIndex+1)%o.features.length}))},3e3);this.featureSlider.set({intervalRef:t,currentIndex:0,features:e})}replaceVariables(e){return e?Ke(e,this.currentItem.getTemplateVariables(),this.triggerContext):""}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-sticky-atc"]],hostBindings:function(t,o){t&1&&j("letscooee:variant-change",function(c){return o.onVariantChange(c)},ei)},features:[te(ie()),z],decls:7,vars:3,consts:[[1,"lc-wrapper"],[1,"lc-prices"],[1,"lc-button-wrapper"],["type","button",1,"lc-button","lc-button-atc",3,"click"],[1,"lc-features"],[1,"lc-sale-price"],[1,"lc-additional-text"],[1,"lc-compare-price"],[1,"lc-discount-label"],[1,"lc-feature",3,"ngClass"]],template:function(t,o){if(t&1){let a=J();M(0,"div",0),N(1,Cn,5,3,"div",1),M(2,"div",2)(3,"button",3),j("click",function(){return A(a),R(o.addToCart())}),Z(4,"Add To Cart"),P(),Re(5),N(6,_n,3,0,"div",4),P()()}if(t&2){V(),B(o.selectedVariant()&&o.stickyATCConfig.showProductInfo?1:-1),V(4);let a=ye(o.featureSlider());V(),B(a.features.length?6:-1)}},dependencies:[Ze],styles:[`:host{display:flex;justify-content:center;padding:10px;background-color:#fff;width:100%;box-shadow:4px 0 10px #0006;line-height:normal}.lc-wrapper{display:flex;justify-content:space-between;align-items:center;gap:8px;max-width:1100px;width:100%}.lc-prices{flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}@media (min-width: 768px){.lc-prices{gap:8px}}.lc-sale-price{font-size:24px;font-weight:600}.lc-compare-price{font-size:18px;font-weight:600;color:red;text-decoration:line-through}.lc-discount-label{font-size:12px;font-weight:500;color:green}.lc-button-wrapper{flex:1 1 100%;display:flex;flex-direction:column;gap:4px;align-items:center}.lc-button{background-color:#000;color:#fff;opacity:1;pointer-events:auto;border-radius:4px;min-width:150px;width:100%;padding:8px}.lc-additional-text,.lc-feature{font-size:12px;color:#666}.lc-features{position:relative;overflow:hidden;height:16px;text-align:center;width:100%}.lc-features .lc-feature{position:absolute;width:100%;opacity:0;transform:translateY(100%);transition:transform .5s ease,opacity .5s ease}.lc-features .lc-feature.enter{opacity:1;transform:translateY(0);z-index:2}.lc-features .lc-feature.exit{opacity:0;transform:translateY(-100%);z-index:1}
|
|
16
|
-
`],encapsulation:3})};var bn=["videoEl"];async function Wi(){return(await import("./video-detail-dialog.component-TVBDNATF.js")).VideoDetailDialogComponent}var Me=class n extends se{videoElements;videos;videoConfig;dialogRef=null;dialog=le(gt);isMobile=Mi();pausedVideos=[];videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),Wi()}ngAfterViewInit(){this.checkAndOpenVideoFromUrl()}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect()}engagementTriggerReceived(e){this.videoConfig=e.content?.videoConfig,this.videos=this.videoConfig.videos}onMuteToggled(e,t){e||this.videoElements.forEach(o=>{o.nativeElement!==t&&(o.nativeElement.muted=!0,o.nativeElement.pause())})}sendTriggerClicked(e,t){this.sendEvent("CE Trigger Clicked",{},e,t)}async onVideoTap(e,t,o,a,c){e?.stopPropagation(),e?.preventDefault();let u=t.items?.[0];if(this.sendTriggerClicked(t,u),this.videoConfig.footerContent==="NONE"){a&&(a.muted=!1,a.play(),this.onMuteToggled(!1,a));return}await this.openDialog(t,o,c)}sendEvent(e,t,o,a){let c=new ft(e,t,this.engagementTrigger);c.setVideos(o),a&&(c.items=[a.toEmbed()]),window.CooeeSDK.sendEvent(c)}onDialogClosed(){this.resumePlaylistVideos()}isVideoLoading(e){return this.videoLoadingStates.get(e)??!0}onVideoLoadStart(e){this.videoLoadingStates.set(e,!0)}onVideoCanPlay(e){this.videoLoadingStates.set(e,!1)}playVideo(e){e.play().catch(t=>{W.error("Failed to play video:",t)})}setupIntersectionObserver(e=.5,t="50px"){this.intersectionObserver=new IntersectionObserver(o=>{o.forEach(a=>{let c=a.target,u=c.dataset.videoId;u&&(a.isIntersecting?(this.visibleVideos.add(u),this.handleVideoVisibilityChange(c,!0)):(this.visibleVideos.delete(u),this.handleVideoVisibilityChange(c,!1)))})},{threshold:e,rootMargin:t}),setTimeout(()=>{this.videoElements.forEach(o=>{this.intersectionObserver?.observe(o.nativeElement)})},100)}handleVideoVisibilityChange(e,t){t?this.onVideoBecameVisible(e):e.pause()}onVideoBecameVisible(e){this.playVideo(e)}pauseAllPlaylistVideos(){this.pausedVideos=[],this.videoElements.forEach(e=>{let t=e.nativeElement;t.paused||(this.pausedVideos.push(t),t.pause())})}resumePlaylistVideos(){this.pausedVideos.forEach(e=>{e.play().catch(()=>{})}),this.pausedVideos=[]}async checkAndOpenVideoFromUrl(){let e=Oi();if(!e||!this.videos)return;let t=Ri();if(t.utm_campaign?.toLowerCase()!=="shoppable_video"||t.utm_source?.toLowerCase()!==Ai)return;let o=this.videos.findIndex(a=>a.shortID===+e);if(o!==-1){let a=this.videos[o];await _i.set("muted",!0),await this.openDialog(a,o)}}async openDialog(e,t,o){await yi();let a={videos:this.videos,currentIndex:t,triggerContext:this.triggerContext,selectedItem:o};this.dialogRef&&this.dialogRef.close(),this.pauseAllPlaylistVideos();let c=await Wi();this.dialogRef=this.dialog.open(c,{width:"100vw",height:"100vh",data:a,providers:Ci(this.triggerContext,{video:e,index:t}),disableClose:!0});let u={videoID:e.id,videoIndex:t};this.sendEvent("CE Video Dialog Opened",{current:u},e),this.dialogRef.closed.subscribe(f=>{if(this.dialogRef=null,!f)return;let b=f.lastVideoDuration*1e3,D={videoID:f.lastVideo.id,videoIndex:f.lastVideoIndex,playedTillMS:b,playedTillPercent:b/f.lastVideo.durationMS};this.sendEvent("CE Video Dialog Closed",{current:D},f.lastVideo),this.onDialogClosed()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-abstract-video"]],viewQuery:function(t,o){if(t&1&&Ue(bn,5),t&2){let a;ze(a=qe())&&(o.videoElements=a)}},features:[z],decls:0,vars:0,template:function(t,o){},encapsulation:2})};var Pe=class n{video=Dt.required({alias:"cooeeVideoSources"});prioritySource=Dt("high");elementRef=le(Xt);constructor(){fi(()=>{this.updateSources()})}updateSources(){let e=this.elementRef.nativeElement,t=this.video(),o=this.prioritySource();e.querySelectorAll("source").forEach(c=>c.remove()),o==="best"?(this.addSource(t.bestSource),this.addSource(t.highSource),this.addSource(t.lowSource)):o==="low"?(this.addSource(t.lowSource),this.addSource(t.highSource),this.addSource(t.bestSource)):(this.addSource(t.highSource),this.addSource(t.bestSource),this.addSource(t.lowSource)),this.addSource(t.m3u8Source),e.load()}addSource(e){if(!e)return;let t=document.createElement("source");t.src=e.url,t.type=e.mimeType,this.elementRef.nativeElement.appendChild(t)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ni({type:n,selectors:[["video","cooeeVideoSources",""]],inputs:{video:[1,"cooeeVideoSources","video"],prioritySource:[1,"prioritySource"]}})};var wn=(n,e)=>e.id;function Vn(n,e){if(n&1&&(ne(0,"div",1),Ce(1,"safeHtml")),n&2){let t=y();H("innerHTML",Ve(1,1,t.videoConfig.heading),ce)}}function Tn(n,e){n&1&&(M(0,"div",6),ne(1,"div",12),P())}function En(n,e){if(n&1){let t=J();M(0,"cooee-mute-toggle",13),j("toggled",function(a){A(t),y();let c=de(6),u=y();return R(u.onMuteToggled(a,c))}),P()}if(n&2){y();let t=de(6);H("muted",t.muted)("videoEl",t)}}function Sn(n,e){if(n&1){let t=J();M(0,"cooee-video-promoted-items",16),j("cardClick",function(a){A(t);let c=y(2),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onItemCardClick(a,u,f,b))}),P()}if(n&2){let t=y(2).$implicit;H("items",t.items)("centeredSlides",!1)}}function In(n,e){if(n&1){let t=J();M(0,"cooee-item-card",17),j("buttonClick",function(){A(t);let a=y(2),c=a.$implicit,u=a.$index,f=de(6),b=y();return R(b.addToCartClicked(null,c,u,f))})("click",function(){A(t);let a=y(2),c=a.$implicit,u=a.$index,f=de(6),b=q(0),D=y();return R(D.onItemCardClick(b,c,u,f))}),P()}if(n&2){y(2);let t=q(0);H("item",t)}}function Mn(n,e){if(n&1&&N(0,Sn,1,2,"cooee-video-promoted-items",14)(1,In,1,1,"cooee-item-card",15),n&2){let t=y().$implicit,o=y(),c=q(2)===o.VideoConfigFooterContent.ITEM_SWIPER;B(c&&t.items.length>1?0:t.items.length?1:-1)}}function Pn(n,e){if(n&1){let t=J();M(0,"cooee-video-card",18),j("linkClicked",function(){A(t);let a=y().$implicit,c=y();return R(c.sendTriggerClicked(a))}),P()}if(n&2){y();let t=q(1);H("card",t)}}function kn(n,e){if(n&1){let t=J();Re(0)(1),M(2,"div",4)(3,"div",5),j("click",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onVideoTap(a,u,f,b))})("keydown.enter",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onVideoTap(a,u,f,b))})("keydown.space",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onVideoTap(a,u,f,b))}),N(4,Tn,2,0,"div",6),M(5,"video",7,0),j("mouseenter",function(){A(t);let a=de(6);y();let c=q(1);return R(c&&a.play())})("mouseleave",function(){A(t);let a=de(6);y();let c=q(1);return R(c&&a.pause())})("loadstart",function(){let a=A(t).$implicit,c=y();return R(c.onVideoLoadStart(a.id))})("canplay",function(){let a=A(t).$implicit,c=y();return R(c.onVideoCanPlay(a.id))}),P(),M(7,"div",8),N(8,En,1,2,"cooee-mute-toggle",9),P()(),M(9,"div",10),N(10,Mn,2,1)(11,Pn,1,1,"cooee-video-card",11),P()()}if(n&2){let t=e.$implicit,o=y(),a=q(0),c=q(2);ye(t.items[0]),V();let f=ye(t.card)&&c===o.VideoConfigFooterContent.CARD;V(2),nt("background-image",t.thumbnail?"url("+t.thumbnail+")":null),V(),B(o.isVideoLoading(t.id)?4:-1),V(),H("cooeeVideoSources",t)("muted",!0),it("preload",a?"metadata":"none")("autoplay",null)("data-video-id",t.id),V(3),B(o.videoConfig.showMuteButton?8:-1),V(2),B(o.videoConfig.showItems()?10:f?11:-1)}}var Tt=class n extends Me{VideoConfigFooterContent=At;VideoConfigAutoPlay=Fi;swiperOptions=null;constructor(){super(),this.hasSwiper=!0}ngAfterViewInit(){super.ngAfterViewInit();let e=this.videoConfig.playlistConfig.videoSwiper,t=e?(this.isMobile?e.gapSm:e.gap)+"px":window.cooeePlaylistGap??24,o=e?this.isMobile?e.maxInRowSm:e.maxInRow:"auto";this.swiperOptions={direction:"horizontal",effect:"slide",loop:e?.loop,freeMode:!0,spaceBetween:t,slidesPerView:o,mousewheel:{enabled:!0,forceToAxis:!0},autoplay:e?.autoplay?.enabled?{delay:e?.autoplay?.delay,disableOnInteraction:!1}:!1},this.setupIntersectionObserver(),this.playFirstVideo()}ngOnDestroy(){super.ngOnDestroy()}addToCartClicked(e,t,o,a){let c=t.items?.[0],u=vi.get().website?.canChangeVariantInCart;if(t.items?.length>1||c?.hasVariants()&&!u){this.onItemCardClick(c,t,o,a);return}this.engagementService.executeCTA(rt.ADD_TO_CART,{item:c,video:t})}goToPDP(e,t){e?.stopPropagation(),e?.preventDefault();let o=t.items?.[0];this.engagementService.executeCTA(rt.GO_TO_PRODUCT,{item:o,video:t})}onItemCardClick(e,t,o,a){this.videoConfig.playlistConfig.itemCardClickBehavior==="OPEN_ITEM_DETAIL"?this.onVideoTap(null,t,o,a,e):this.onVideoTap(null,t,o,a)}update(){}onVideoBecameVisible(e){this.shouldAutoPlay()&&(this.dialogRef?this.pausedVideos.push(e):this.playVideo(e))}shouldAutoPlay(){return this.videoConfig.autoPlay==="ON"||this.videoConfig.autoPlay==="ON_HOVER"&&this.isMobile}playFirstVideo(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-video-playlist"]],features:[te(ie()),z],decls:8,vars:7,consts:[["videoEl",""],[1,"heading-text",3,"innerHTML"],[3,"options","navigationConfig","paginationConfig"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-card"],["role","button","tabindex","0","aria-label","Play video","aria-haspopup","dialog",1,"video-wrapper",3,"click","keydown.enter","keydown.space"],[1,"video-loading-overlay"],["width","100%","playsinline","","loop","",3,"mouseenter","mouseleave","loadstart","canplay","cooeeVideoSources","muted"],[1,"video-controls"],[3,"muted","videoEl"],["role","region","aria-label","Video details",1,"video-footer"],[3,"card"],[1,"loading-spinner"],[3,"toggled","muted","videoEl"],[3,"items","centeredSlides"],["role","button","tabindex","0","aria-label","Product detail",3,"item"],[3,"cardClick","items","centeredSlides"],["role","button","tabindex","0","aria-label","Product detail",3,"buttonClick","click","item"],[3,"linkClicked","card"]],template:function(t,o){if(t&1&&(Re(0)(1)(2),N(3,Vn,2,3,"div",1),M(4,"cooee-swiper",2),li(5,3),ge(6,kn,12,12,"div",4,wn),ci(),P()),t&2){ye(!o.videoConfig.autoPlay||o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON),V(),ye(o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON_HOVER),V(),ye(o.videoConfig.footerContent),V(),B(o.videoConfig.heading?3:-1);let a=o.videoConfig.playlistConfig.videoSwiper;V(),H("options",o.swiperOptions)("navigationConfig",a==null?null:a.navigation)("paginationConfig",a==null?null:a.pagination),V(2),he(o.videos)}},dependencies:[Bi,Ni,Li,ki,Pe,Hi,Ge],styles:[`:host{display:block}cooee-swiper.swiper{margin:8px;padding-top:25px;padding-bottom:25px}.video-wrapper{position:relative;cursor:pointer;outline:none;border-radius:var(--lc-media-radius, 8px);background-size:cover;background-position:center;background-repeat:no-repeat}.video-wrapper video{width:100%;height:var(--lc-video-card-height);object-fit:cover;border-radius:var(--lc-media-radius, 8px);position:relative}.video-card.swiper-slide{width:var(--lc-video-card-width);transition:transform .3s ease}.video-card.swiper-slide:hover{transform:scale(1.05)}@media (max-width: 768px),(prefers-reduced-motion: reduce){.video-card.swiper-slide{transition:none}.video-card.swiper-slide:hover{transform:none}}.video-controls{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}.video-footer{overflow-x:hidden}cooee-item-card{cursor:pointer;padding-left:0!important;padding-right:0!important}cooee-item-card .item-image{width:50px;height:50px;display:none}cooee-item-card .item-detail-button{display:none!important}cooee-item-card .item-info{font-size:14px;line-height:normal;margin-right:unset!important}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
|
|
16
|
+
`],encapsulation:3})};var bn=["videoEl"];async function Wi(){return(await import("./video-detail-dialog.component-76UPZ4UM.js")).VideoDetailDialogComponent}var Me=class n extends se{videoElements;videos;videoConfig;dialogRef=null;dialog=le(gt);isMobile=Mi();pausedVideos=[];videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),Wi()}ngAfterViewInit(){this.checkAndOpenVideoFromUrl()}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect()}engagementTriggerReceived(e){this.videoConfig=e.content?.videoConfig,this.videos=this.videoConfig.videos}onMuteToggled(e,t){e||this.videoElements.forEach(o=>{o.nativeElement!==t&&(o.nativeElement.muted=!0,o.nativeElement.pause())})}sendTriggerClicked(e,t){this.sendEvent("CE Trigger Clicked",{},e,t)}async onVideoTap(e,t,o,a,c){e?.stopPropagation(),e?.preventDefault();let u=t.items?.[0];if(this.sendTriggerClicked(t,u),this.videoConfig.footerContent==="NONE"){a&&(a.muted=!1,a.play(),this.onMuteToggled(!1,a));return}await this.openDialog(t,o,c)}sendEvent(e,t,o,a){let c=new ft(e,t,this.engagementTrigger);c.setVideos(o),a&&(c.items=[a.toEmbed()]),window.CooeeSDK.sendEvent(c)}onDialogClosed(){this.resumePlaylistVideos()}isVideoLoading(e){return this.videoLoadingStates.get(e)??!0}onVideoLoadStart(e){this.videoLoadingStates.set(e,!0)}onVideoCanPlay(e){this.videoLoadingStates.set(e,!1)}playVideo(e){e.play().catch(t=>{W.error("Failed to play video:",t)})}setupIntersectionObserver(e=.5,t="50px"){this.intersectionObserver=new IntersectionObserver(o=>{o.forEach(a=>{let c=a.target,u=c.dataset.videoId;u&&(a.isIntersecting?(this.visibleVideos.add(u),this.handleVideoVisibilityChange(c,!0)):(this.visibleVideos.delete(u),this.handleVideoVisibilityChange(c,!1)))})},{threshold:e,rootMargin:t}),setTimeout(()=>{this.videoElements.forEach(o=>{this.intersectionObserver?.observe(o.nativeElement)})},100)}handleVideoVisibilityChange(e,t){t?this.onVideoBecameVisible(e):e.pause()}onVideoBecameVisible(e){this.playVideo(e)}pauseAllPlaylistVideos(){this.pausedVideos=[],this.videoElements.forEach(e=>{let t=e.nativeElement;t.paused||(this.pausedVideos.push(t),t.pause())})}resumePlaylistVideos(){this.pausedVideos.forEach(e=>{e.play().catch(()=>{})}),this.pausedVideos=[]}async checkAndOpenVideoFromUrl(){let e=Oi();if(!e||!this.videos)return;let t=Ri();if(t.utm_campaign?.toLowerCase()!=="shoppable_video"||t.utm_source?.toLowerCase()!==Ai)return;let o=this.videos.findIndex(a=>a.shortID===+e);if(o!==-1){let a=this.videos[o];await _i.set("muted",!0),await this.openDialog(a,o)}}async openDialog(e,t,o){await yi();let a={videos:this.videos,currentIndex:t,triggerContext:this.triggerContext,selectedItem:o};this.dialogRef&&this.dialogRef.close(),this.pauseAllPlaylistVideos();let c=await Wi();this.dialogRef=this.dialog.open(c,{width:"100vw",height:"100vh",data:a,providers:Ci(this.triggerContext,{video:e,index:t}),disableClose:!0});let u={videoID:e.id,videoIndex:t};this.sendEvent("CE Video Dialog Opened",{current:u},e),this.dialogRef.closed.subscribe(f=>{if(this.dialogRef=null,!f)return;let b=f.lastVideoDuration*1e3,D={videoID:f.lastVideo.id,videoIndex:f.lastVideoIndex,playedTillMS:b,playedTillPercent:b/f.lastVideo.durationMS};this.sendEvent("CE Video Dialog Closed",{current:D},f.lastVideo),this.onDialogClosed()})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-abstract-video"]],viewQuery:function(t,o){if(t&1&&Ue(bn,5),t&2){let a;ze(a=qe())&&(o.videoElements=a)}},features:[z],decls:0,vars:0,template:function(t,o){},encapsulation:2})};var Pe=class n{video=Dt.required({alias:"cooeeVideoSources"});prioritySource=Dt("high");elementRef=le(Xt);constructor(){fi(()=>{this.updateSources()})}updateSources(){let e=this.elementRef.nativeElement,t=this.video(),o=this.prioritySource();e.querySelectorAll("source").forEach(c=>c.remove()),o==="best"?(this.addSource(t.bestSource),this.addSource(t.highSource),this.addSource(t.lowSource)):o==="low"?(this.addSource(t.lowSource),this.addSource(t.highSource),this.addSource(t.bestSource)):(this.addSource(t.highSource),this.addSource(t.bestSource),this.addSource(t.lowSource)),this.addSource(t.m3u8Source),e.load()}addSource(e){if(!e)return;let t=document.createElement("source");t.src=e.url,t.type=e.mimeType,this.elementRef.nativeElement.appendChild(t)}static \u0275fac=function(t){return new(t||n)};static \u0275dir=ni({type:n,selectors:[["video","cooeeVideoSources",""]],inputs:{video:[1,"cooeeVideoSources","video"],prioritySource:[1,"prioritySource"]}})};var wn=(n,e)=>e.id;function Vn(n,e){if(n&1&&(ne(0,"div",1),Ce(1,"safeHtml")),n&2){let t=y();H("innerHTML",Ve(1,1,t.videoConfig.heading),ce)}}function Tn(n,e){n&1&&(M(0,"div",6),ne(1,"div",12),P())}function En(n,e){if(n&1){let t=J();M(0,"cooee-mute-toggle",13),j("toggled",function(a){A(t),y();let c=de(6),u=y();return R(u.onMuteToggled(a,c))}),P()}if(n&2){y();let t=de(6);H("muted",t.muted)("videoEl",t)}}function Sn(n,e){if(n&1){let t=J();M(0,"cooee-video-promoted-items",16),j("cardClick",function(a){A(t);let c=y(2),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onItemCardClick(a,u,f,b))}),P()}if(n&2){let t=y(2).$implicit;H("items",t.items)("centeredSlides",!1)}}function In(n,e){if(n&1){let t=J();M(0,"cooee-item-card",17),j("buttonClick",function(){A(t);let a=y(2),c=a.$implicit,u=a.$index,f=de(6),b=y();return R(b.addToCartClicked(null,c,u,f))})("click",function(){A(t);let a=y(2),c=a.$implicit,u=a.$index,f=de(6),b=q(0),D=y();return R(D.onItemCardClick(b,c,u,f))}),P()}if(n&2){y(2);let t=q(0);H("item",t)}}function Mn(n,e){if(n&1&&N(0,Sn,1,2,"cooee-video-promoted-items",14)(1,In,1,1,"cooee-item-card",15),n&2){let t=y().$implicit,o=y(),c=q(2)===o.VideoConfigFooterContent.ITEM_SWIPER;B(c&&t.items.length>1?0:t.items.length?1:-1)}}function Pn(n,e){if(n&1){let t=J();M(0,"cooee-video-card",18),j("linkClicked",function(){A(t);let a=y().$implicit,c=y();return R(c.sendTriggerClicked(a))}),P()}if(n&2){y();let t=q(1);H("card",t)}}function kn(n,e){if(n&1){let t=J();Re(0)(1),M(2,"div",4)(3,"div",5),j("click",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onVideoTap(a,u,f,b))})("keydown.enter",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onVideoTap(a,u,f,b))})("keydown.space",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=de(6),D=y();return R(D.onVideoTap(a,u,f,b))}),N(4,Tn,2,0,"div",6),M(5,"video",7,0),j("mouseenter",function(){A(t);let a=de(6);y();let c=q(1);return R(c&&a.play())})("mouseleave",function(){A(t);let a=de(6);y();let c=q(1);return R(c&&a.pause())})("loadstart",function(){let a=A(t).$implicit,c=y();return R(c.onVideoLoadStart(a.id))})("canplay",function(){let a=A(t).$implicit,c=y();return R(c.onVideoCanPlay(a.id))}),P(),M(7,"div",8),N(8,En,1,2,"cooee-mute-toggle",9),P()(),M(9,"div",10),N(10,Mn,2,1)(11,Pn,1,1,"cooee-video-card",11),P()()}if(n&2){let t=e.$implicit,o=y(),a=q(0),c=q(2);ye(t.items[0]),V();let f=ye(t.card)&&c===o.VideoConfigFooterContent.CARD;V(2),nt("background-image",t.thumbnail?"url("+t.thumbnail+")":null),V(),B(o.isVideoLoading(t.id)?4:-1),V(),H("cooeeVideoSources",t)("muted",!0),it("preload",a?"metadata":"none")("autoplay",null)("data-video-id",t.id),V(3),B(o.videoConfig.showMuteButton?8:-1),V(2),B(o.videoConfig.showItems()?10:f?11:-1)}}var Tt=class n extends Me{VideoConfigFooterContent=At;VideoConfigAutoPlay=Fi;swiperOptions=null;constructor(){super(),this.hasSwiper=!0}ngAfterViewInit(){super.ngAfterViewInit();let e=this.videoConfig.playlistConfig.videoSwiper,t=e?(this.isMobile?e.gapSm:e.gap)+"px":window.cooeePlaylistGap??24,o=e?this.isMobile?e.maxInRowSm:e.maxInRow:"auto";this.swiperOptions={direction:"horizontal",effect:"slide",loop:e?.loop,freeMode:!0,spaceBetween:t,slidesPerView:o,mousewheel:{enabled:!0,forceToAxis:!0},autoplay:e?.autoplay?.enabled?{delay:e?.autoplay?.delay,disableOnInteraction:!1}:!1},this.setupIntersectionObserver(),this.playFirstVideo()}ngOnDestroy(){super.ngOnDestroy()}addToCartClicked(e,t,o,a){let c=t.items?.[0],u=vi.get().website?.canChangeVariantInCart;if(t.items?.length>1||c?.hasVariants()&&!u){this.onItemCardClick(c,t,o,a);return}this.engagementService.executeCTA(rt.ADD_TO_CART,{item:c,video:t})}goToPDP(e,t){e?.stopPropagation(),e?.preventDefault();let o=t.items?.[0];this.engagementService.executeCTA(rt.GO_TO_PRODUCT,{item:o,video:t})}onItemCardClick(e,t,o,a){this.videoConfig.playlistConfig.itemCardClickBehavior==="OPEN_ITEM_DETAIL"?this.onVideoTap(null,t,o,a,e):this.onVideoTap(null,t,o,a)}update(){}onVideoBecameVisible(e){this.shouldAutoPlay()&&(this.dialogRef?this.pausedVideos.push(e):this.playVideo(e))}shouldAutoPlay(){return this.videoConfig.autoPlay==="ON"||this.videoConfig.autoPlay==="ON_HOVER"&&this.isMobile}playFirstVideo(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-video-playlist"]],features:[te(ie()),z],decls:8,vars:7,consts:[["videoEl",""],[1,"heading-text",3,"innerHTML"],[3,"options","navigationConfig","paginationConfig"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-card"],["role","button","tabindex","0","aria-label","Play video","aria-haspopup","dialog",1,"video-wrapper",3,"click","keydown.enter","keydown.space"],[1,"video-loading-overlay"],["width","100%","playsinline","","loop","",3,"mouseenter","mouseleave","loadstart","canplay","cooeeVideoSources","muted"],[1,"video-controls"],[3,"muted","videoEl"],["role","region","aria-label","Video details",1,"video-footer"],[3,"card"],[1,"loading-spinner"],[3,"toggled","muted","videoEl"],[3,"items","centeredSlides"],["role","button","tabindex","0","aria-label","Product detail",3,"item"],[3,"cardClick","items","centeredSlides"],["role","button","tabindex","0","aria-label","Product detail",3,"buttonClick","click","item"],[3,"linkClicked","card"]],template:function(t,o){if(t&1&&(Re(0)(1)(2),N(3,Vn,2,3,"div",1),M(4,"cooee-swiper",2),li(5,3),ge(6,kn,12,12,"div",4,wn),ci(),P()),t&2){ye(!o.videoConfig.autoPlay||o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON),V(),ye(o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON_HOVER),V(),ye(o.videoConfig.footerContent),V(),B(o.videoConfig.heading?3:-1);let a=o.videoConfig.playlistConfig.videoSwiper;V(),H("options",o.swiperOptions)("navigationConfig",a==null?null:a.navigation)("paginationConfig",a==null?null:a.pagination),V(2),he(o.videos)}},dependencies:[Bi,Ni,Li,ki,Pe,Hi,Ge],styles:[`:host{display:block}cooee-swiper.swiper{margin:8px;padding-top:25px;padding-bottom:25px}.video-wrapper{position:relative;cursor:pointer;outline:none;border-radius:var(--lc-media-radius, 8px);background-size:cover;background-position:center;background-repeat:no-repeat}.video-wrapper video{width:100%;height:var(--lc-video-card-height);object-fit:cover;border-radius:var(--lc-media-radius, 8px);position:relative}.video-card.swiper-slide{width:var(--lc-video-card-width);transition:transform .3s ease}.video-card.swiper-slide:hover{transform:scale(1.05)}@media (max-width: 768px),(prefers-reduced-motion: reduce){.video-card.swiper-slide{transition:none}.video-card.swiper-slide:hover{transform:none}}.video-controls{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}.video-footer{overflow-x:hidden}cooee-item-card{cursor:pointer;padding-left:0!important;padding-right:0!important}cooee-item-card .item-image{width:50px;height:50px;display:none}cooee-item-card .item-detail-button{display:none!important}cooee-item-card .item-info{font-size:14px;line-height:normal;margin-right:unset!important}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
|
|
17
17
|
`],encapsulation:3})};var Fn=["videoElement"],Dn=n=>({"cursor-grab":n}),Et=class n extends Me{videoElement;video;isDragging=!1;hidden=!1;cdkDrag=le(ht,{self:!0});untilDestroyed=Ii();constructor(){super()}get popupClasses(){return this.hidden?["hidden"]:["visible"]}onClick(e){e.stopPropagation(),e.preventDefault(),this.onVideoClick()}ngOnInit(){super.ngOnInit();let e=this.elementRef.nativeElement.closest(".letscooee-engagement");e&&(e.style.zIndex="10000"),this.cdkDrag.moved.pipe(this.untilDestroyed).subscribe(()=>this.isDragging=!0)}ngAfterViewInit(){super.ngAfterViewInit(),setTimeout(()=>{this.autoPlay()},100)}onVideoClick(){if(this.isDragging){this.isDragging=!1;return}this.hidden=!0,this.onVideoTap(null,this.video,0)}close(){this.hidden=!0;let e=(new Date().getTime()-this.triggerContext.startTime.getTime())/1e3;this.sendEvent("CE Trigger Closed",{duration:e})}engagementTriggerReceived(e){super.engagementTriggerReceived(e),this.video=this.videos[0]}update(){}onDialogClosed(){this.hidden=!1}autoPlay(){let e=this.videoElement.nativeElement;this.hidden||this.playVideo(e)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-video-popup"]],viewQuery:function(t,o){if(t&1&&Ue(Fn,5),t&2){let a;ze(a=qe())&&(o.videoElement=a.first)}},hostAttrs:["role","button","tabindex","0","aria-label","Open video popup "],hostVars:3,hostBindings:function(t,o){t&1&&j("keydown.enter",function(c){return o.onClick(c)})("keydown.space",function(c){return o.onClick(c)})("click",function(c){return o.onClick(c)}),t&2&&(ve("cdkDragBoundary","body"),di(o.popupClasses))},features:[te(ie()),ri([{directive:ht,inputs:["cdkDragBoundary","cdkDragBoundary"]}]),z],decls:9,vars:5,consts:[["videoElement",""],[1,"popup-inner",3,"ngClass"],["type","button","aria-label","Close video popup",1,"close-button",3,"click"],["name","close","aria-hidden","true"],[1,"play-button"],["name","unmute","aria-hidden","true"],[1,"text"],["loop","","preload","metadata","playsinline","",3,"muted","cooeeVideoSources"]],template:function(t,o){if(t&1){let a=J();M(0,"div",1)(1,"button",2),j("click",function(u){return A(a),u.stopPropagation(),R(o.close())}),ne(2,"cooee-icon",3),P(),M(3,"div",4),ne(4,"cooee-icon",5),M(5,"div",6),Z(6,"Tap to unmute"),P()(),ne(7,"video",7,0),P()}t&2&&(H("ngClass",We(3,Dn,o.isDragging)),V(7),H("muted",!0)("cooeeVideoSources",o.video))},dependencies:[Ze,Pi,Pe],styles:[`:host{position:fixed;display:block;right:24px;bottom:24px;min-height:150px;max-width:150px;box-shadow:0 25px 50px -12px #00000040}:host(.hidden){display:none}.popup-inner{display:flex;justify-content:center;align-items:center;position:relative}video{width:100%;border-radius:8px;background-color:#fff}.close-button{position:absolute;top:-14px;right:-14px;background-color:#00000080;border-radius:9999px;width:32px;height:32px;border:none;z-index:10;display:flex;justify-content:center;align-items:center}.play-button{display:flex;justify-content:center;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(1);transition:all .1s ease-in-out;z-index:999;flex-wrap:wrap;width:100%;max-width:130px;border-radius:5px;padding:5px 10px;background-color:#97979761;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.play-button cooee-icon{width:14px;height:14px}.play-button .text{font-size:11px;line-height:1;color:#fff;font-weight:400;margin-left:5px;text-align:center}
|
|
18
18
|
`],encapsulation:3})};var An=(n,e)=>e.id;function Rn(n,e){if(n&1&&(ne(0,"div",1),Ce(1,"safeHtml")),n&2){let t=y();H("innerHTML",Ve(1,1,t.videoConfig.heading),ce)}}function On(n,e){n&1&&(M(0,"div",9),ne(1,"div",11),P())}function Ln(n,e){if(n&1){let t=J();M(0,"div",4),j("click",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=y();return R(b.onVideoTap(a,u,f))})("keydown.enter",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=y();return R(b.onVideoTap(a,u,f))})("keydown.space",function(a){let c=A(t),u=c.$implicit,f=c.$index,b=y();return R(b.onVideoTap(a,u,f))}),Gt(),M(1,"svg",5),ne(2,"circle",6)(3,"circle",7),P(),Kt(),M(4,"div",8),N(5,On,2,0,"div",9),M(6,"video",10,0),j("loadstart",function(){let a=A(t).$implicit,c=y();return R(c.onVideoLoadStart(a.id))})("canplay",function(){let a=A(t).$implicit,c=y();return R(c.onVideoCanPlay(a.id))}),P()()()}if(n&2){let t=e.$implicit,o=e.$index,a=y();it("aria-label","Open video story "+(o+1)),V(5),B(a.isVideoLoading(t.id)?5:-1),V(),H("poster",t.thumbnail,He)("cooeeVideoSources",t)("prioritySource","low")("muted",!0),it("data-video-id",t.id)}}var St=class n extends Me{constructor(){super()}ngAfterViewInit(){super.ngAfterViewInit(),this.setupIntersectionObserver()}ngOnDestroy(){super.ngOnDestroy()}update(){}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-video-stories"]],features:[te(ie()),z],decls:4,vars:1,consts:[["videoEl",""],[1,"heading-text",3,"innerHTML"],[1,"video-stories"],["role","button","tabindex","0",1,"video-story"],["role","button","tabindex","0",1,"video-story",3,"click","keydown.enter","keydown.space"],["viewBox","0 0 100 100"],["cx","50","cy","50","r","48","fill","none","stroke-width","4"],["cx","50","cy","50","r","48","fill","none","stroke-width","4","stroke-linecap","round","stroke-dasharray","301.6","stroke-dashoffset","301.6",1,"video-story-circle"],[1,"video-wrapper"],[1,"video-loading-overlay"],["loop","","playsinline","","preload","metadata",3,"loadstart","canplay","poster","cooeeVideoSources","prioritySource","muted"],[1,"loading-spinner"]],template:function(t,o){t&1&&(N(0,Rn,2,3,"div",1),M(1,"div",2),ge(2,Ln,8,7,"div",3,An),P()),t&2&&(B(o.videoConfig.heading?0:-1),V(2),he(o.videos))},dependencies:[Pe,Ge],styles:[`:host{display:block}.video-stories{display:flex;overflow:auto;margin:.75rem;gap:.75rem;justify-content:center;align-items:center;scrollbar-width:none}.video-stories::-webkit-scrollbar{display:none}@media (max-width: 768px){.video-stories{justify-content:start!important}}.video-story{position:relative;width:5rem;height:5rem;cursor:pointer;flex-shrink:0}.video-story svg{position:absolute;top:0;left:0;width:100%;height:100%}.video-story svg circle:first-child{stroke:#d1d5db}.video-story svg circle:last-child{stroke:#3b82f6}.video-story .video-wrapper{position:relative;width:100%;height:100%;border-radius:9999px;overflow:hidden}.video-story .video-wrapper video{width:100%;height:100%;object-fit:cover;border-radius:9999px;position:relative;z-index:1}.video-story .video-wrapper .video-loading-overlay{border-radius:9999px}
|
|
19
19
|
`],encapsulation:3})};var jt=(t=>(t.IMAGE="IMAGE",t.BUTTON="BUTTON",t))(jt||{});var $t=n=>({active:n});function Nn(n,e){if(n&1&&(M(0,"span",4),Z(1),P()),n&2){let t=y(2);V(),ot(t.collectionFilterConfig.subtitle)}}function Bn(n,e){if(n&1&&(M(0,"div",1)(1,"span",3),Z(2),P(),N(3,Nn,2,1,"span",4),P()),n&2){let t=y();V(2),ot(t.collectionFilterConfig.title),V(),B(t.collectionFilterConfig.subtitle?3:-1)}}function Hn(n,e){if(n&1&&(M(0,"span",9),Z(1),P()),n&2){let t=y(2).$implicit,o=q(0);H("ngClass",We(2,$t,o)),V(),we("",t.label," ")}}function jn(n,e){if(n&1){let t=J();M(0,"div",7),j("mousedown",function(){A(t);let a=y().$implicit,c=q(0),u=y(2);return R(u.filterClick(a,c))}),ne(1,"img",8),N(2,Hn,2,4,"span",9),P()}if(n&2){let t=y().$implicit,o=q(0);V(),H("src",t.imageSrc,He)("ngClass",We(3,$t,o)),V(),B(t.label?2:-1)}}function $n(n,e){if(n&1){let t=J();M(0,"button",10),j("click",function(){A(t);let a=y().$implicit,c=q(0),u=y(2);return R(u.filterClick(a,c))}),Z(1),P()}if(n&2){let t=y().$implicit,o=q(0);H("ngClass",We(2,$t,o)),V(),we("",t.label," ")}}function Un(n,e){if(n&1&&(Re(0),N(1,jn,3,5,"div",5)(2,$n,2,4,"button",6)),n&2){let t=e.$implicit,o=y(2);ye(t.value===o.currentActiveParams()[t.key]),V(),B(o.collectionFilterConfig.template===o.CollectionFilterTemplate.IMAGE?1:o.collectionFilterConfig.template===o.CollectionFilterTemplate.BUTTON?2:-1)}}function zn(n,e){if(n&1&&ge(0,Un,3,2,null,null,mt),n&2){let t=y();he(t.collectionFilterConfig.options)}}var It=class n extends se{currentActiveParams=fe({});collectionFilterConfig;CollectionFilterTemplate=jt;originalPushState;constructor(){super(),this.attachedURLStateChecker()}engagementTriggerReceived(e){this.collectionFilterConfig=e.content.collectionFilterConfig}update(){}ngOnDestroy(){this.originalPushState&&(window.history.pushState=this.originalPushState)}filterClick(e,t=!1){let o=new URL(window.location.href),a=t?"removed":"applied";if(t?o.searchParams.delete(e.key):o.searchParams.set(e.key,e.value),this.collectionFilterConfig.refreshPage){this.sendEvent(e,a),window.location.href=o.href;return}window.history.replaceState({path:o.href},"",o),this.sendEvent(e,a),this.checkAndUpdateParams()}sendEvent(e,t){let o=new ft("CE Trigger Clicked",{filterApplication:t,filter:{key:e.key,value:e.value}},this.engagementTrigger);window.CooeeSDK.sendEvent(o)}attachedURLStateChecker(){this.checkAndUpdateParams(),this.originalPushState=window.history.pushState,window.history.pushState=new Proxy(window.history.pushState,{apply:(e,t,o)=>{e.apply(t,o),this.checkAndUpdateParams()}})}checkAndUpdateParams(){let e=new URL(window.location.href),t={};e.searchParams.forEach((o,a)=>{t[a]=o}),this.currentActiveParams.set(t)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["cooee-collection-filter"]],features:[te(ie()),z],decls:4,vars:2,consts:[[1,"wrapper"],[1,"filter-title-container"],[1,"options-container"],[1,"filter-title"],[1,"filter-subtitle"],[1,"image-filter-wrapper"],["type","button",1,"filter-button",3,"ngClass"],[1,"image-filter-wrapper",3,"mousedown"],["alt","collection filter image",1,"filter-image",3,"src","ngClass"],[1,"filter-label",3,"ngClass"],["type","button",1,"filter-button",3,"click","ngClass"]],template:function(t,o){t&1&&(M(0,"div",0),N(1,Bn,4,2,"div",1),M(2,"div",2),N(3,zn,2,0),P()()),t&2&&(V(),B(o.collectionFilterConfig.title?1:-1),V(2),B(o.collectionFilterConfig.options.length?3:-1))},dependencies:[Ze],styles:[`.wrapper{display:flex;flex-direction:column;gap:10px;padding:10px;justify-content:center;align-items:center}.filter-title-container{display:flex;flex-direction:column;gap:5px;align-items:center}.filter-title-container .filter-title{color:rgba(var(--lc-heading-color));font-family:var(--lc-heading-family),serif;font-weight:var(--lc-heading-weight);font-size:var(--lc-heading-size);transform:var(--lc-heading-transform);letter-spacing:var(--lc-heading-letter-spacing);text-align:var(--lc-heading-align)}.filter-title-container .filter-subtitle{color:rgba(var(--lc-subheading-color));font-weight:var(--lc-subheading-weight);font-size:var(--lc-subheading-size)}.options-container{display:flex;gap:35px;align-items:center;flex-wrap:wrap;justify-content:center}.options-container .image-filter-wrapper{display:flex;gap:10px;flex-direction:column;align-items:center;cursor:pointer}.options-container .image-filter-wrapper .filter-image{width:var(--lc-image-width, 80px);height:var(--lc-image-height, 80px);border-radius:40px}.options-container .image-filter-wrapper .filter-image.active{border:2px solid rgba(var(--lc-primary-color));padding:2px}.options-container .image-filter-wrapper .filter-label{font-size:var(--lc-text-size, 14px);color:rgba(var(--lc-text-color));font-weight:var(--lc-text-weight)}.options-container .image-filter-wrapper .filter-label.active{color:rgba(var(--lc-primary-color))}.options-container .filter-button{background-color:rgba(var(--lc-secondary-button-bg-color));font-size:var(--lc-button-size, 14px);color:rgba(var(--lc-secondary-button-color));border-color:rgba(var(--lc-secondary-button-border-color));font-weight:var(--lc-secondary-button-weight);border-radius:var(--lc-button-radius);font-family:var(--lc-button-family),serif;height:var(--lc-button-height, 36px);padding:0 16px}.options-container .filter-button:hover,.options-container .filter-button.active{background-color:rgba(var(--lc-primary-button-bg-color));color:rgba(var(--lc-primary-button-color));border-color:rgba(var(--lc-primary-button-border-color));font-weight:var(--lc-primary-button-weight)}
|
|
20
|
-
`],encapsulation:3})};hi("CooeeWidgetSDK");(async()=>{let n=await gi($i),e=(t,o)=>{let a=ji(t,{injector:n.injector});customElements.define(o,a)};e(Vt,"cooee-sticky-atc"),e(_t,"cooee-savings-bar"),e(xt,"cooee-progressbar"),e(Tt,"cooee-video-playlist"),e(Et,"cooee-video-popup"),e(St,"cooee-video-stories"),e(xi,"cooee-product-options-picker"),e(It,"cooee-collection-filter"),sessionStorage.cooeeDebug&&import("./debugger.component-
|
|
20
|
+
`],encapsulation:3})};hi("CooeeWidgetSDK");(async()=>{let n=await gi($i),e=(t,o)=>{let a=ji(t,{injector:n.injector});customElements.define(o,a)};e(Vt,"cooee-sticky-atc"),e(_t,"cooee-savings-bar"),e(xt,"cooee-progressbar"),e(Tt,"cooee-video-playlist"),e(Et,"cooee-video-popup"),e(St,"cooee-video-stories"),e(xi,"cooee-product-options-picker"),e(It,"cooee-collection-filter"),sessionStorage.cooeeDebug&&import("./debugger.component-KKAN5FYA.js").then(t=>{e(t.DebuggerComponent,"cooee-debugger")}),window.cooeeShowQuickItem=(t,o)=>{n.injector.get(wt).showItemQuickView(t,o)}})();
|
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": "13.1.
|
|
4
|
+
"version": "13.1.9",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "ng lint",
|
|
7
7
|
"integrity": "./scripts/validate-integrity.sh",
|
package/dist/chunk-DUAIGBXY.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{_ as Eo,v as _o,yb as yo,zb as vo}from"./chunk-X2XZU367.js";import{a as So,b as An,c as Nt}from"./chunk-Y6YLR2GG.js";import{a as g,b as P,c as st,d as ho,e as _a,f as Ea,g as At}from"./chunk-V7UGKYBN.js";var Io=_a((To,Nn)=>{"use strict";(function(e){if(typeof To=="object"&&typeof Nn<"u")Nn.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t=this,t.localforage=e()}})(function(){var e,t,n;return(function r(o,s,c){function f(I,x){if(!s[I]){if(!o[I]){var E=typeof st=="function"&&st;if(!x&&E)return E(I,!0);if(d)return d(I,!0);var S=new Error("Cannot find module '"+I+"'");throw S.code="MODULE_NOT_FOUND",S}var L=s[I]={exports:{}};o[I][0].call(L.exports,function(H){var k=o[I][1][H];return f(k||H)},L,L.exports,r,o,s,c)}return s[I].exports}for(var d=typeof st=="function"&&st,_=0;_<c.length;_++)f(c[_]);return f})({1:[function(r,o,s){(function(c){"use strict";var f=c.MutationObserver||c.WebKitMutationObserver,d;if(f){var _=0,I=new f(H),x=c.document.createTextNode("");I.observe(x,{characterData:!0}),d=function(){x.data=_=++_%2}}else if(!c.setImmediate&&typeof c.MessageChannel<"u"){var E=new c.MessageChannel;E.port1.onmessage=H,d=function(){E.port2.postMessage(0)}}else"document"in c&&"onreadystatechange"in c.document.createElement("script")?d=function(){var G=c.document.createElement("script");G.onreadystatechange=function(){H(),G.onreadystatechange=null,G.parentNode.removeChild(G),G=null},c.document.documentElement.appendChild(G)}:d=function(){setTimeout(H,0)};var S,L=[];function H(){S=!0;for(var G,ie,J=L.length;J;){for(ie=L,L=[],G=-1;++G<J;)ie[G]();J=L.length}S=!1}o.exports=k;function k(G){L.push(G)===1&&!S&&d()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,o,s){"use strict";var c=r(1);function f(){}var d={},_=["REJECTED"],I=["FULFILLED"],x=["PENDING"];o.exports=E;function E(R){if(typeof R!="function")throw new TypeError("resolver must be a function");this.state=x,this.queue=[],this.outcome=void 0,R!==f&&k(this,R)}E.prototype.catch=function(R){return this.then(null,R)},E.prototype.then=function(R,M){if(typeof R!="function"&&this.state===I||typeof M!="function"&&this.state===_)return this;var O=new this.constructor(f);if(this.state!==x){var B=this.state===I?R:M;L(O,B,this.outcome)}else this.queue.push(new S(O,R,M));return O};function S(R,M,O){this.promise=R,typeof M=="function"&&(this.onFulfilled=M,this.callFulfilled=this.otherCallFulfilled),typeof O=="function"&&(this.onRejected=O,this.callRejected=this.otherCallRejected)}S.prototype.callFulfilled=function(R){d.resolve(this.promise,R)},S.prototype.otherCallFulfilled=function(R){L(this.promise,this.onFulfilled,R)},S.prototype.callRejected=function(R){d.reject(this.promise,R)},S.prototype.otherCallRejected=function(R){L(this.promise,this.onRejected,R)};function L(R,M,O){c(function(){var B;try{B=M(O)}catch(X){return d.reject(R,X)}B===R?d.reject(R,new TypeError("Cannot resolve promise with itself")):d.resolve(R,B)})}d.resolve=function(R,M){var O=G(H,M);if(O.status==="error")return d.reject(R,O.value);var B=O.value;if(B)k(R,B);else{R.state=I,R.outcome=M;for(var X=-1,re=R.queue.length;++X<re;)R.queue[X].callFulfilled(M)}return R},d.reject=function(R,M){R.state=_,R.outcome=M;for(var O=-1,B=R.queue.length;++O<B;)R.queue[O].callRejected(M);return R};function H(R){var M=R&&R.then;if(R&&(typeof R=="object"||typeof R=="function")&&typeof M=="function")return function(){M.apply(R,arguments)}}function k(R,M){var O=!1;function B(ae){O||(O=!0,d.reject(R,ae))}function X(ae){O||(O=!0,d.resolve(R,ae))}function re(){M(X,B)}var se=G(re);se.status==="error"&&B(se.value)}function G(R,M){var O={};try{O.value=R(M),O.status="success"}catch(B){O.status="error",O.value=B}return O}E.resolve=ie;function ie(R){return R instanceof this?R:d.resolve(new this(f),R)}E.reject=J;function J(R){var M=new this(f);return d.reject(M,R)}E.all=hn;function hn(R){var M=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var X=new Array(O),re=0,se=-1,ae=new this(f);++se<O;)ve(R[se],se);return ae;function ve(rt,bt){M.resolve(rt).then(_n,function(Ye){B||(B=!0,d.reject(ae,Ye))});function _n(Ye){X[bt]=Ye,++re===O&&!B&&(B=!0,d.resolve(ae,X))}}}E.race=Fe;function Fe(R){var M=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var X=-1,re=new this(f);++X<O;)se(R[X]);return re;function se(ae){M.resolve(ae).then(function(ve){B||(B=!0,d.resolve(re,ve))},function(ve){B||(B=!0,d.reject(re,ve))})}}},{1:1}],3:[function(r,o,s){(function(c){"use strict";typeof c.Promise!="function"&&(c.Promise=r(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,o,s){"use strict";var c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i};function f(i,u){if(!(i instanceof u))throw new TypeError("Cannot call a class as a function")}function d(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var _=d();function I(){try{if(!_||!_.open)return!1;var i=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),u=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!i||u)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function x(i,u){i=i||[],u=u||{};try{return new Blob(i,u)}catch(p){if(p.name!=="TypeError")throw p;for(var a=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,l=new a,m=0;m<i.length;m+=1)l.append(i[m]);return l.getBlob(u.type)}}typeof Promise>"u"&&r(3);var E=Promise;function S(i,u){u&&i.then(function(a){u(null,a)},function(a){u(a)})}function L(i,u,a){typeof u=="function"&&i.then(u),typeof a=="function"&&i.catch(a)}function H(i){return typeof i!="string"&&(console.warn(i+" used as a key, but it is not a string."),i=String(i)),i}function k(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var G="local-forage-detect-blob-support",ie=void 0,J={},hn=Object.prototype.toString,Fe="readonly",R="readwrite";function M(i){for(var u=i.length,a=new ArrayBuffer(u),l=new Uint8Array(a),m=0;m<u;m++)l[m]=i.charCodeAt(m);return a}function O(i){return new E(function(u){var a=i.transaction(G,R),l=x([""]);a.objectStore(G).put(l,"key"),a.onabort=function(m){m.preventDefault(),m.stopPropagation(),u(!1)},a.oncomplete=function(){var m=navigator.userAgent.match(/Chrome\/(\d+)/),p=navigator.userAgent.match(/Edge\//);u(p||!m||parseInt(m[1],10)>=43)}}).catch(function(){return!1})}function B(i){return typeof ie=="boolean"?E.resolve(ie):O(i).then(function(u){return ie=u,ie})}function X(i){var u=J[i.name],a={};a.promise=new E(function(l,m){a.resolve=l,a.reject=m}),u.deferredOperations.push(a),u.dbReady?u.dbReady=u.dbReady.then(function(){return a.promise}):u.dbReady=a.promise}function re(i){var u=J[i.name],a=u.deferredOperations.pop();if(a)return a.resolve(),a.promise}function se(i,u){var a=J[i.name],l=a.deferredOperations.pop();if(l)return l.reject(u),l.promise}function ae(i,u){return new E(function(a,l){if(J[i.name]=J[i.name]||Kr(),i.db)if(u)X(i),i.db.close();else return a(i.db);var m=[i.name];u&&m.push(i.version);var p=_.open.apply(_,m);u&&(p.onupgradeneeded=function(h){var y=p.result;try{y.createObjectStore(i.storeName),h.oldVersion<=1&&y.createObjectStore(G)}catch(v){if(v.name==="ConstraintError")console.warn('The database "'+i.name+'" has been upgraded from version '+h.oldVersion+" to version "+h.newVersion+', but the storage "'+i.storeName+'" already exists.');else throw v}}),p.onerror=function(h){h.preventDefault(),l(p.error)},p.onsuccess=function(){var h=p.result;h.onversionchange=function(y){y.target.close()},a(h),re(i)}})}function ve(i){return ae(i,!1)}function rt(i){return ae(i,!0)}function bt(i,u){if(!i.db)return!0;var a=!i.db.objectStoreNames.contains(i.storeName),l=i.version<i.db.version,m=i.version>i.db.version;if(l&&(i.version!==u&&console.warn('The database "'+i.name+`" can't be downgraded from version `+i.db.version+" to version "+i.version+"."),i.version=i.db.version),m||a){if(a){var p=i.db.version+1;p>i.version&&(i.version=p)}return!0}return!1}function _n(i){return new E(function(u,a){var l=new FileReader;l.onerror=a,l.onloadend=function(m){var p=btoa(m.target.result||"");u({__local_forage_encoded_blob:!0,data:p,type:i.type})},l.readAsBinaryString(i)})}function Ye(i){var u=M(atob(i.data));return x([u],{type:i.type})}function qr(i){return i&&i.__local_forage_encoded_blob}function Es(i){var u=this,a=u._initReady().then(function(){var l=J[u._dbInfo.name];if(l&&l.dbReady)return l.dbReady});return L(a,i,i),a}function ys(i){X(i);for(var u=J[i.name],a=u.forages,l=0;l<a.length;l++){var m=a[l];m._dbInfo.db&&(m._dbInfo.db.close(),m._dbInfo.db=null)}return i.db=null,ve(i).then(function(p){return i.db=p,bt(i)?rt(i):p}).then(function(p){i.db=u.db=p;for(var h=0;h<a.length;h++)a[h]._dbInfo.db=p}).catch(function(p){throw se(i,p),p})}function Te(i,u,a,l){l===void 0&&(l=1);try{var m=i.db.transaction(i.storeName,u);a(null,m)}catch(p){if(l>0&&(!i.db||p.name==="InvalidStateError"||p.name==="NotFoundError"))return E.resolve().then(function(){if(!i.db||p.name==="NotFoundError"&&!i.db.objectStoreNames.contains(i.storeName)&&i.version<=i.db.version)return i.db&&(i.version=i.db.version+1),rt(i)}).then(function(){return ys(i).then(function(){Te(i,u,a,l-1)})}).catch(a);a(p)}}function Kr(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ss(i){var u=this,a={db:null};if(i)for(var l in i)a[l]=i[l];var m=J[a.name];m||(m=Kr(),J[a.name]=m),m.forages.push(u),u._initReady||(u._initReady=u.ready,u.ready=Es);var p=[];function h(){return E.resolve()}for(var y=0;y<m.forages.length;y++){var v=m.forages[y];v!==u&&p.push(v._initReady().catch(h))}var T=m.forages.slice(0);return E.all(p).then(function(){return a.db=m.db,ve(a)}).then(function(b){return a.db=b,bt(a,u._defaultConfig.version)?rt(a):b}).then(function(b){a.db=m.db=b,u._dbInfo=a;for(var N=0;N<T.length;N++){var D=T[N];D!==u&&(D._dbInfo.db=a.db,D._dbInfo.version=a.version)}})}function vs(i,u){var a=this;i=H(i);var l=new E(function(m,p){a.ready().then(function(){Te(a._dbInfo,Fe,function(h,y){if(h)return p(h);try{var v=y.objectStore(a._dbInfo.storeName),T=v.get(i);T.onsuccess=function(){var b=T.result;b===void 0&&(b=null),qr(b)&&(b=Ye(b)),m(b)},T.onerror=function(){p(T.error)}}catch(b){p(b)}})}).catch(p)});return S(l,u),l}function Ts(i,u){var a=this,l=new E(function(m,p){a.ready().then(function(){Te(a._dbInfo,Fe,function(h,y){if(h)return p(h);try{var v=y.objectStore(a._dbInfo.storeName),T=v.openCursor(),b=1;T.onsuccess=function(){var N=T.result;if(N){var D=N.value;qr(D)&&(D=Ye(D));var F=i(D,N.key,b++);F!==void 0?m(F):N.continue()}else m()},T.onerror=function(){p(T.error)}}catch(N){p(N)}})}).catch(p)});return S(l,u),l}function Is(i,u,a){var l=this;i=H(i);var m=new E(function(p,h){var y;l.ready().then(function(){return y=l._dbInfo,hn.call(u)==="[object Blob]"?B(y.db).then(function(v){return v?u:_n(u)}):u}).then(function(v){Te(l._dbInfo,R,function(T,b){if(T)return h(T);try{var N=b.objectStore(l._dbInfo.storeName);v===null&&(v=void 0);var D=N.put(v,i);b.oncomplete=function(){v===void 0&&(v=null),p(v)},b.onabort=b.onerror=function(){var F=D.error?D.error:D.transaction.error;h(F)}}catch(F){h(F)}})}).catch(h)});return S(m,a),m}function bs(i,u){var a=this;i=H(i);var l=new E(function(m,p){a.ready().then(function(){Te(a._dbInfo,R,function(h,y){if(h)return p(h);try{var v=y.objectStore(a._dbInfo.storeName),T=v.delete(i);y.oncomplete=function(){m()},y.onerror=function(){p(T.error)},y.onabort=function(){var b=T.error?T.error:T.transaction.error;p(b)}}catch(b){p(b)}})}).catch(p)});return S(l,u),l}function xs(i){var u=this,a=new E(function(l,m){u.ready().then(function(){Te(u._dbInfo,R,function(p,h){if(p)return m(p);try{var y=h.objectStore(u._dbInfo.storeName),v=y.clear();h.oncomplete=function(){l()},h.onabort=h.onerror=function(){var T=v.error?v.error:v.transaction.error;m(T)}}catch(T){m(T)}})}).catch(m)});return S(a,i),a}function Rs(i){var u=this,a=new E(function(l,m){u.ready().then(function(){Te(u._dbInfo,Fe,function(p,h){if(p)return m(p);try{var y=h.objectStore(u._dbInfo.storeName),v=y.count();v.onsuccess=function(){l(v.result)},v.onerror=function(){m(v.error)}}catch(T){m(T)}})}).catch(m)});return S(a,i),a}function As(i,u){var a=this,l=new E(function(m,p){if(i<0){m(null);return}a.ready().then(function(){Te(a._dbInfo,Fe,function(h,y){if(h)return p(h);try{var v=y.objectStore(a._dbInfo.storeName),T=!1,b=v.openKeyCursor();b.onsuccess=function(){var N=b.result;if(!N){m(null);return}i===0||T?m(N.key):(T=!0,N.advance(i))},b.onerror=function(){p(b.error)}}catch(N){p(N)}})}).catch(p)});return S(l,u),l}function Ns(i){var u=this,a=new E(function(l,m){u.ready().then(function(){Te(u._dbInfo,Fe,function(p,h){if(p)return m(p);try{var y=h.objectStore(u._dbInfo.storeName),v=y.openKeyCursor(),T=[];v.onsuccess=function(){var b=v.result;if(!b){l(T);return}T.push(b.key),b.continue()},v.onerror=function(){m(v.error)}}catch(b){m(b)}})}).catch(m)});return S(a,i),a}function Cs(i,u){u=k.apply(this,arguments);var a=this.config();i=typeof i!="function"&&i||{},i.name||(i.name=i.name||a.name,i.storeName=i.storeName||a.storeName);var l=this,m;if(!i.name)m=E.reject("Invalid arguments");else{var p=i.name===a.name&&l._dbInfo.db,h=p?E.resolve(l._dbInfo.db):ve(i).then(function(y){var v=J[i.name],T=v.forages;v.db=y;for(var b=0;b<T.length;b++)T[b]._dbInfo.db=y;return y});i.storeName?m=h.then(function(y){if(y.objectStoreNames.contains(i.storeName)){var v=y.version+1;X(i);var T=J[i.name],b=T.forages;y.close();for(var N=0;N<b.length;N++){var D=b[N];D._dbInfo.db=null,D._dbInfo.version=v}var F=new E(function(U,Y){var W=_.open(i.name,v);W.onerror=function(ce){var it=W.result;it.close(),Y(ce)},W.onupgradeneeded=function(){var ce=W.result;ce.deleteObjectStore(i.storeName)},W.onsuccess=function(){var ce=W.result;ce.close(),U(ce)}});return F.then(function(U){T.db=U;for(var Y=0;Y<b.length;Y++){var W=b[Y];W._dbInfo.db=U,re(W._dbInfo)}}).catch(function(U){throw(se(i,U)||E.resolve()).catch(function(){}),U})}}):m=h.then(function(y){X(i);var v=J[i.name],T=v.forages;y.close();for(var b=0;b<T.length;b++){var N=T[b];N._dbInfo.db=null}var D=new E(function(F,U){var Y=_.deleteDatabase(i.name);Y.onerror=function(){var W=Y.result;W&&W.close(),U(Y.error)},Y.onblocked=function(){console.warn('dropInstance blocked for database "'+i.name+'" until all open connections are closed')},Y.onsuccess=function(){var W=Y.result;W&&W.close(),F(W)}});return D.then(function(F){v.db=F;for(var U=0;U<T.length;U++){var Y=T[U];re(Y._dbInfo)}}).catch(function(F){throw(se(i,F)||E.resolve()).catch(function(){}),F})})}return S(m,u),m}var ws={_driver:"asyncStorage",_initStorage:Ss,_support:I(),iterate:Ts,getItem:vs,setItem:Is,removeItem:bs,clear:xs,length:Rs,key:As,keys:Ns,dropInstance:Cs};function Ds(){return typeof openDatabase=="function"}var Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ls="~~local_forage_type~",Jr=/^~~local_forage_type~([^~]+)~/,xt="__lfsc__:",En=xt.length,yn="arbf",Sn="blob",Xr="si08",Zr="ui08",Qr="uic8",eo="si16",to="si32",no="ur16",ro="ui32",oo="fl32",io="fl64",so=En+yn.length,ao=Object.prototype.toString;function co(i){var u=i.length*.75,a=i.length,l,m=0,p,h,y,v;i[i.length-1]==="="&&(u--,i[i.length-2]==="="&&u--);var T=new ArrayBuffer(u),b=new Uint8Array(T);for(l=0;l<a;l+=4)p=Ne.indexOf(i[l]),h=Ne.indexOf(i[l+1]),y=Ne.indexOf(i[l+2]),v=Ne.indexOf(i[l+3]),b[m++]=p<<2|h>>4,b[m++]=(h&15)<<4|y>>2,b[m++]=(y&3)<<6|v&63;return T}function vn(i){var u=new Uint8Array(i),a="",l;for(l=0;l<u.length;l+=3)a+=Ne[u[l]>>2],a+=Ne[(u[l]&3)<<4|u[l+1]>>4],a+=Ne[(u[l+1]&15)<<2|u[l+2]>>6],a+=Ne[u[l+2]&63];return u.length%3===2?a=a.substring(0,a.length-1)+"=":u.length%3===1&&(a=a.substring(0,a.length-2)+"=="),a}function Os(i,u){var a="";if(i&&(a=ao.call(i)),i&&(a==="[object ArrayBuffer]"||i.buffer&&ao.call(i.buffer)==="[object ArrayBuffer]")){var l,m=xt;i instanceof ArrayBuffer?(l=i,m+=yn):(l=i.buffer,a==="[object Int8Array]"?m+=Xr:a==="[object Uint8Array]"?m+=Zr:a==="[object Uint8ClampedArray]"?m+=Qr:a==="[object Int16Array]"?m+=eo:a==="[object Uint16Array]"?m+=no:a==="[object Int32Array]"?m+=to:a==="[object Uint32Array]"?m+=ro:a==="[object Float32Array]"?m+=oo:a==="[object Float64Array]"?m+=io:u(new Error("Failed to get type for BinaryArray"))),u(m+vn(l))}else if(a==="[object Blob]"){var p=new FileReader;p.onload=function(){var h=Ls+i.type+"~"+vn(this.result);u(xt+Sn+h)},p.readAsArrayBuffer(i)}else try{u(JSON.stringify(i))}catch(h){console.error("Couldn't convert value into a JSON string: ",i),u(null,h)}}function Ps(i){if(i.substring(0,En)!==xt)return JSON.parse(i);var u=i.substring(so),a=i.substring(En,so),l;if(a===Sn&&Jr.test(u)){var m=u.match(Jr);l=m[1],u=u.substring(m[0].length)}var p=co(u);switch(a){case yn:return p;case Sn:return x([p],{type:l});case Xr:return new Int8Array(p);case Zr:return new Uint8Array(p);case Qr:return new Uint8ClampedArray(p);case eo:return new Int16Array(p);case no:return new Uint16Array(p);case to:return new Int32Array(p);case ro:return new Uint32Array(p);case oo:return new Float32Array(p);case io:return new Float64Array(p);default:throw new Error("Unkown type: "+a)}}var Tn={serialize:Os,deserialize:Ps,stringToBuffer:co,bufferToString:vn};function uo(i,u,a,l){i.executeSql("CREATE TABLE IF NOT EXISTS "+u.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],a,l)}function Ms(i){var u=this,a={db:null};if(i)for(var l in i)a[l]=typeof i[l]!="string"?i[l].toString():i[l];var m=new E(function(p,h){try{a.db=openDatabase(a.name,String(a.version),a.description,a.size)}catch(y){return h(y)}a.db.transaction(function(y){uo(y,a,function(){u._dbInfo=a,p()},function(v,T){h(T)})},h)});return a.serializer=Tn,m}function Ce(i,u,a,l,m,p){i.executeSql(a,l,m,function(h,y){y.code===y.SYNTAX_ERR?h.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[u.storeName],function(v,T){T.rows.length?p(v,y):uo(v,u,function(){v.executeSql(a,l,m,p)},p)},p):p(h,y)},p)}function Fs(i,u){var a=this;i=H(i);var l=new E(function(m,p){a.ready().then(function(){var h=a._dbInfo;h.db.transaction(function(y){Ce(y,h,"SELECT * FROM "+h.storeName+" WHERE key = ? LIMIT 1",[i],function(v,T){var b=T.rows.length?T.rows.item(0).value:null;b&&(b=h.serializer.deserialize(b)),m(b)},function(v,T){p(T)})})}).catch(p)});return S(l,u),l}function Us(i,u){var a=this,l=new E(function(m,p){a.ready().then(function(){var h=a._dbInfo;h.db.transaction(function(y){Ce(y,h,"SELECT * FROM "+h.storeName,[],function(v,T){for(var b=T.rows,N=b.length,D=0;D<N;D++){var F=b.item(D),U=F.value;if(U&&(U=h.serializer.deserialize(U)),U=i(U,F.key,D+1),U!==void 0){m(U);return}}m()},function(v,T){p(T)})})}).catch(p)});return S(l,u),l}function fo(i,u,a,l){var m=this;i=H(i);var p=new E(function(h,y){m.ready().then(function(){u===void 0&&(u=null);var v=u,T=m._dbInfo;T.serializer.serialize(u,function(b,N){N?y(N):T.db.transaction(function(D){Ce(D,T,"INSERT OR REPLACE INTO "+T.storeName+" (key, value) VALUES (?, ?)",[i,b],function(){h(v)},function(F,U){y(U)})},function(D){if(D.code===D.QUOTA_ERR){if(l>0){h(fo.apply(m,[i,v,a,l-1]));return}y(D)}})})}).catch(y)});return S(p,a),p}function ks(i,u,a){return fo.apply(this,[i,u,a,1])}function Bs(i,u){var a=this;i=H(i);var l=new E(function(m,p){a.ready().then(function(){var h=a._dbInfo;h.db.transaction(function(y){Ce(y,h,"DELETE FROM "+h.storeName+" WHERE key = ?",[i],function(){m()},function(v,T){p(T)})})}).catch(p)});return S(l,u),l}function Hs(i){var u=this,a=new E(function(l,m){u.ready().then(function(){var p=u._dbInfo;p.db.transaction(function(h){Ce(h,p,"DELETE FROM "+p.storeName,[],function(){l()},function(y,v){m(v)})})}).catch(m)});return S(a,i),a}function $s(i){var u=this,a=new E(function(l,m){u.ready().then(function(){var p=u._dbInfo;p.db.transaction(function(h){Ce(h,p,"SELECT COUNT(key) as c FROM "+p.storeName,[],function(y,v){var T=v.rows.item(0).c;l(T)},function(y,v){m(v)})})}).catch(m)});return S(a,i),a}function Gs(i,u){var a=this,l=new E(function(m,p){a.ready().then(function(){var h=a._dbInfo;h.db.transaction(function(y){Ce(y,h,"SELECT key FROM "+h.storeName+" WHERE id = ? LIMIT 1",[i+1],function(v,T){var b=T.rows.length?T.rows.item(0).key:null;m(b)},function(v,T){p(T)})})}).catch(p)});return S(l,u),l}function js(i){var u=this,a=new E(function(l,m){u.ready().then(function(){var p=u._dbInfo;p.db.transaction(function(h){Ce(h,p,"SELECT key FROM "+p.storeName,[],function(y,v){for(var T=[],b=0;b<v.rows.length;b++)T.push(v.rows.item(b).key);l(T)},function(y,v){m(v)})})}).catch(m)});return S(a,i),a}function Ws(i){return new E(function(u,a){i.transaction(function(l){l.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(m,p){for(var h=[],y=0;y<p.rows.length;y++)h.push(p.rows.item(y).name);u({db:i,storeNames:h})},function(m,p){a(p)})},function(l){a(l)})})}function Ys(i,u){u=k.apply(this,arguments);var a=this.config();i=typeof i!="function"&&i||{},i.name||(i.name=i.name||a.name,i.storeName=i.storeName||a.storeName);var l=this,m;return i.name?m=new E(function(p){var h;i.name===a.name?h=l._dbInfo.db:h=openDatabase(i.name,"","",0),i.storeName?p({db:h,storeNames:[i.storeName]}):p(Ws(h))}).then(function(p){return new E(function(h,y){p.db.transaction(function(v){function T(F){return new E(function(U,Y){v.executeSql("DROP TABLE IF EXISTS "+F,[],function(){U()},function(W,ce){Y(ce)})})}for(var b=[],N=0,D=p.storeNames.length;N<D;N++)b.push(T(p.storeNames[N]));E.all(b).then(function(){h()}).catch(function(F){y(F)})},function(v){y(v)})})}):m=E.reject("Invalid arguments"),S(m,u),m}var zs={_driver:"webSQLStorage",_initStorage:Ms,_support:Ds(),iterate:Us,getItem:Fs,setItem:ks,removeItem:Bs,clear:Hs,length:$s,key:Gs,keys:js,dropInstance:Ys};function Vs(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function po(i,u){var a=i.name+"/";return i.storeName!==u.storeName&&(a+=i.storeName+"/"),a}function qs(){var i="_localforage_support_test";try{return localStorage.setItem(i,!0),localStorage.removeItem(i),!1}catch{return!0}}function Ks(){return!qs()||localStorage.length>0}function Js(i){var u=this,a={};if(i)for(var l in i)a[l]=i[l];return a.keyPrefix=po(i,u._defaultConfig),Ks()?(u._dbInfo=a,a.serializer=Tn,E.resolve()):E.reject()}function Xs(i){var u=this,a=u.ready().then(function(){for(var l=u._dbInfo.keyPrefix,m=localStorage.length-1;m>=0;m--){var p=localStorage.key(m);p.indexOf(l)===0&&localStorage.removeItem(p)}});return S(a,i),a}function Zs(i,u){var a=this;i=H(i);var l=a.ready().then(function(){var m=a._dbInfo,p=localStorage.getItem(m.keyPrefix+i);return p&&(p=m.serializer.deserialize(p)),p});return S(l,u),l}function Qs(i,u){var a=this,l=a.ready().then(function(){for(var m=a._dbInfo,p=m.keyPrefix,h=p.length,y=localStorage.length,v=1,T=0;T<y;T++){var b=localStorage.key(T);if(b.indexOf(p)===0){var N=localStorage.getItem(b);if(N&&(N=m.serializer.deserialize(N)),N=i(N,b.substring(h),v++),N!==void 0)return N}}});return S(l,u),l}function ea(i,u){var a=this,l=a.ready().then(function(){var m=a._dbInfo,p;try{p=localStorage.key(i)}catch{p=null}return p&&(p=p.substring(m.keyPrefix.length)),p});return S(l,u),l}function ta(i){var u=this,a=u.ready().then(function(){for(var l=u._dbInfo,m=localStorage.length,p=[],h=0;h<m;h++){var y=localStorage.key(h);y.indexOf(l.keyPrefix)===0&&p.push(y.substring(l.keyPrefix.length))}return p});return S(a,i),a}function na(i){var u=this,a=u.keys().then(function(l){return l.length});return S(a,i),a}function ra(i,u){var a=this;i=H(i);var l=a.ready().then(function(){var m=a._dbInfo;localStorage.removeItem(m.keyPrefix+i)});return S(l,u),l}function oa(i,u,a){var l=this;i=H(i);var m=l.ready().then(function(){u===void 0&&(u=null);var p=u;return new E(function(h,y){var v=l._dbInfo;v.serializer.serialize(u,function(T,b){if(b)y(b);else try{localStorage.setItem(v.keyPrefix+i,T),h(p)}catch(N){(N.name==="QuotaExceededError"||N.name==="NS_ERROR_DOM_QUOTA_REACHED")&&y(N),y(N)}})})});return S(m,a),m}function ia(i,u){if(u=k.apply(this,arguments),i=typeof i!="function"&&i||{},!i.name){var a=this.config();i.name=i.name||a.name,i.storeName=i.storeName||a.storeName}var l=this,m;return i.name?m=new E(function(p){i.storeName?p(po(i,l._defaultConfig)):p(i.name+"/")}).then(function(p){for(var h=localStorage.length-1;h>=0;h--){var y=localStorage.key(h);y.indexOf(p)===0&&localStorage.removeItem(y)}}):m=E.reject("Invalid arguments"),S(m,u),m}var sa={_driver:"localStorageWrapper",_initStorage:Js,_support:Vs(),iterate:Qs,getItem:Zs,setItem:oa,removeItem:ra,clear:Xs,length:na,key:ea,keys:ta,dropInstance:ia},aa=function(u,a){return u===a||typeof u=="number"&&typeof a=="number"&&isNaN(u)&&isNaN(a)},ca=function(u,a){for(var l=u.length,m=0;m<l;){if(aa(u[m],a))return!0;m++}return!1},lo=Array.isArray||function(i){return Object.prototype.toString.call(i)==="[object Array]"},ot={},mo={},ze={INDEXEDDB:ws,WEBSQL:zs,LOCALSTORAGE:sa},ua=[ze.INDEXEDDB._driver,ze.WEBSQL._driver,ze.LOCALSTORAGE._driver],Rt=["dropInstance"],In=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Rt),fa={description:"",driver:ua.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function pa(i,u){i[u]=function(){var a=arguments;return i.ready().then(function(){return i[u].apply(i,a)})}}function bn(){for(var i=1;i<arguments.length;i++){var u=arguments[i];if(u)for(var a in u)u.hasOwnProperty(a)&&(lo(u[a])?arguments[0][a]=u[a].slice():arguments[0][a]=u[a])}return arguments[0]}var la=(function(){function i(u){f(this,i);for(var a in ze)if(ze.hasOwnProperty(a)){var l=ze[a],m=l._driver;this[a]=m,ot[m]||this.defineDriver(l)}this._defaultConfig=bn({},fa),this._config=bn({},this._defaultConfig,u),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return i.prototype.config=function(a){if((typeof a>"u"?"undefined":c(a))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var l in a){if(l==="storeName"&&(a[l]=a[l].replace(/\W/g,"_")),l==="version"&&typeof a[l]!="number")return new Error("Database version must be a number.");this._config[l]=a[l]}return"driver"in a&&a.driver?this.setDriver(this._config.driver):!0}else return typeof a=="string"?this._config[a]:this._config},i.prototype.defineDriver=function(a,l,m){var p=new E(function(h,y){try{var v=a._driver,T=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!a._driver){y(T);return}for(var b=In.concat("_initStorage"),N=0,D=b.length;N<D;N++){var F=b[N],U=!ca(Rt,F);if((U||a[F])&&typeof a[F]!="function"){y(T);return}}var Y=function(){for(var it=function(ga){return function(){var ha=new Error("Method "+ga+" is not implemented by the current driver"),go=E.reject(ha);return S(go,arguments[arguments.length-1]),go}},xn=0,ma=Rt.length;xn<ma;xn++){var Rn=Rt[xn];a[Rn]||(a[Rn]=it(Rn))}};Y();var W=function(it){ot[v]&&console.info("Redefining LocalForage driver: "+v),ot[v]=a,mo[v]=it,h()};"_support"in a?a._support&&typeof a._support=="function"?a._support().then(W,y):W(!!a._support):W(!0)}catch(ce){y(ce)}});return L(p,l,m),p},i.prototype.driver=function(){return this._driver||null},i.prototype.getDriver=function(a,l,m){var p=ot[a]?E.resolve(ot[a]):E.reject(new Error("Driver not found."));return L(p,l,m),p},i.prototype.getSerializer=function(a){var l=E.resolve(Tn);return L(l,a),l},i.prototype.ready=function(a){var l=this,m=l._driverSet.then(function(){return l._ready===null&&(l._ready=l._initDriver()),l._ready});return L(m,a,a),m},i.prototype.setDriver=function(a,l,m){var p=this;lo(a)||(a=[a]);var h=this._getSupportedDrivers(a);function y(){p._config.driver=p.driver()}function v(N){return p._extend(N),y(),p._ready=p._initStorage(p._config),p._ready}function T(N){return function(){var D=0;function F(){for(;D<N.length;){var U=N[D];return D++,p._dbInfo=null,p._ready=null,p.getDriver(U).then(v).catch(F)}y();var Y=new Error("No available storage method found.");return p._driverSet=E.reject(Y),p._driverSet}return F()}}var b=this._driverSet!==null?this._driverSet.catch(function(){return E.resolve()}):E.resolve();return this._driverSet=b.then(function(){var N=h[0];return p._dbInfo=null,p._ready=null,p.getDriver(N).then(function(D){p._driver=D._driver,y(),p._wrapLibraryMethodsWithReady(),p._initDriver=T(h)})}).catch(function(){y();var N=new Error("No available storage method found.");return p._driverSet=E.reject(N),p._driverSet}),L(this._driverSet,l,m),this._driverSet},i.prototype.supports=function(a){return!!mo[a]},i.prototype._extend=function(a){bn(this,a)},i.prototype._getSupportedDrivers=function(a){for(var l=[],m=0,p=a.length;m<p;m++){var h=a[m];this.supports(h)&&l.push(h)}return l},i.prototype._wrapLibraryMethodsWithReady=function(){for(var a=0,l=In.length;a<l;a++)pa(this,In[a])},i.prototype.createInstance=function(a){return new i(a)},i})(),da=new la;o.exports=da},{3:3}]},{},[4])(4)})});var Cn=Ea(Io());function Ct(e){return Cn.default.createInstance({name:"lc",storeName:e,driver:Cn.default.LOCALSTORAGE})}var Ve=class{static storage;static async get(t,n){return await this.storage?.getItem(t)??n}static set(t,n){return this.storage?.setItem(t,n)}static remove(t){return this.storage?.removeItem(t)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var at=class at extends Ve{};At(at,"storeName","usr"),at.storage=Ct(at.storeName);var wn=at;var wt=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;widgetCustomisation;currency;static get(){return window.CooeeSDK.config}update(t){return t??={},this.gaEnabled=t.gaEnabled,this.gaMeasurementID=t.gaMeasurementID,this.pixelPush=t.pixelPush,this.website=t.website??{},this.currencyCount=t.currencyCount??0,this.money=t.money,this.currency=t.currency,this.storefrontToken=t.storefrontToken,this.skipItemAttribute=t.skipItemAttribute,this.widgetCustomisation=t.widgetCustomisation,this}};var ct=class ct extends Ve{};At(ct,"storeName","ses"),ct.storage=Ct(ct.storeName);var Dn=ct;var C=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var w=globalThis;var me="9.42.0";function Ue(){return ke(w),w}function ke(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||me,t[me]=t[me]||{}}function Ie(e,t,n=w){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[me]=r[me]||{};return o[e]||(o[e]=t())}var Ln=["debug","info","warn","error","log","assert","trace"],ya="Sentry Logger ",qe={};function we(e){if(!("console"in w))return e();let t=w.console,n={},r=Object.keys(qe);r.forEach(o=>{let s=qe[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function Sa(){Pn().enabled=!0}function va(){Pn().enabled=!1}function bo(){return Pn().enabled}function Ta(...e){On("log",...e)}function Ia(...e){On("warn",...e)}function ba(...e){On("error",...e)}function On(e,...t){C&&bo()&&we(()=>{w.console[e](`${ya}[${e}]:`,...t)})}function Pn(){return C?Ie("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var A={enable:Sa,disable:va,isEnabled:bo,log:Ta,warn:Ia,error:ba};var xo=/\(error: (.*)\)/,Ro=/captureMessage|captureException/;function Fn(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let s=[],c=n.split(`
|
|
2
|
-
`);for(let f=r;f<c.length;f++){let d=c[f];if(d.length>1024)continue;let _=xo.test(d)?d.replace(xo,"$1"):d;if(!_.match(/\S*Error: /)){for(let I of t){let x=I(_);if(x){s.push(x);break}}if(s.length>=50+o)break}}return Ao(s.slice(o))}}function Ao(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(Dt(t).function||"")&&t.pop(),t.reverse(),Ro.test(Dt(t).function||"")&&(t.pop(),Ro.test(Dt(t).function||"")&&t.pop()),t.slice(0,50).map(n=>P(g({},n),{filename:n.filename||Dt(t).filename,function:n.function||"?"}))}function Dt(e){return e[e.length-1]||{}}var Mn="<anonymous>";function ue(e){try{return!e||typeof e!="function"?Mn:e.name||Mn}catch{return Mn}}function Lt(e){let t=e.exception;if(t){let n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}var Ot={},No={};function Q(e,t){Ot[e]=Ot[e]||[],Ot[e].push(t)}function ee(e,t){if(!No[e]){No[e]=!0;try{t()}catch(n){C&&A.error(`Error while instrumenting ${e}`,n)}}}function z(e,t){let n=e&&Ot[e];if(n)for(let r of n)try{r(t)}catch(o){C&&A.error(`Error while triggering instrumentation handler.
|
|
3
|
-
Type: ${e}
|
|
4
|
-
Name: ${ue(r)}
|
|
5
|
-
Error:`,o)}}var Un=null;function kn(e){let t="error";Q(t,e),ee(t,xa)}function xa(){Un=w.onerror,w.onerror=function(e,t,n,r,o){return z("error",{column:r,error:o,line:n,msg:e,url:t}),Un?Un.apply(this,arguments):!1},w.onerror.__SENTRY_INSTRUMENTED__=!0}var Bn=null;function Hn(e){let t="unhandledrejection";Q(t,e),ee(t,Ra)}function Ra(){Bn=w.onunhandledrejection,w.onunhandledrejection=function(e){return z("unhandledrejection",e),Bn?Bn.apply(this,arguments):!0},w.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var Co=Object.prototype.toString;function Be(e){switch(Co.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return le(e,Error)}}function Ke(e,t){return Co.call(e)===`[object ${t}]`}function Pt(e){return Ke(e,"ErrorEvent")}function Mt(e){return Ke(e,"DOMError")}function $n(e){return Ke(e,"DOMException")}function te(e){return Ke(e,"String")}function Je(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function He(e){return e===null||Je(e)||typeof e!="object"&&typeof e!="function"}function be(e){return Ke(e,"Object")}function $e(e){return typeof Event<"u"&&le(e,Event)}function Gn(e){return typeof Element<"u"&&le(e,Element)}function jn(e){return Ke(e,"RegExp")}function xe(e){return!!(e?.then&&typeof e.then=="function")}function Wn(e){return be(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function le(e,t){try{return e instanceof t}catch{return!1}}function ut(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function wo(e){return typeof Request<"u"&&le(e,Request)}var Yn=w,Aa=80;function ft(e,t={}){if(!e)return"<unknown>";try{let n=e,r=5,o=[],s=0,c=0,f=" > ",d=f.length,_,I=Array.isArray(t)?t:t.keyAttrs,x=!Array.isArray(t)&&t.maxStringLength||Aa;for(;n&&s++<r&&(_=Na(n,I),!(_==="html"||s>1&&c+o.length*d+_.length>=x));)o.push(_),c+=_.length,n=n.parentNode;return o.reverse().join(f)}catch{return"<unknown>"}}function Na(e,t){let n=e,r=[];if(!n?.tagName)return"";if(Yn.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let o=t?.length?t.filter(c=>n.getAttribute(c)).map(c=>[c,n.getAttribute(c)]):null;if(o?.length)o.forEach(c=>{r.push(`[${c[0]}="${c[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let c=n.className;if(c&&te(c)){let f=c.split(/\s+/);for(let d of f)r.push(`.${d}`)}}let s=["aria-label","type","name","title","alt"];for(let c of s){let f=n.getAttribute(c);f&&r.push(`[${c}="${f}"]`)}return r.join("")}function pt(){try{return Yn.document.location.href}catch{return""}}function zn(e){if(!Yn.HTMLElement)return null;let t=e,n=5;for(let r=0;r<n;r++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function De(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Ft(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];try{ut(o)?n.push("[VueViewModel]"):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Do(e,t,n=!1){return te(e)?jn(t)?t.test(e):te(t)?n?e===t:e.includes(t):!1:!1}function Xe(e,t=[],n=!1){return t.some(r=>Do(e,r,n))}function V(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&Ut(o,r);try{e[t]=o}catch{C&&A.log(`Failed to replace method "${t}" in object`,e)}}function oe(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{C&&A.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Ut(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,oe(e,"__sentry_original__",t)}catch{}}function Ge(e){return e.__sentry_original__}function kt(e){if(Be(e))return g({message:e.message,name:e.name,stack:e.stack},Oo(e));if($e(e)){let t=g({type:e.type,target:Lo(e.target),currentTarget:Lo(e.currentTarget)},Oo(e));return typeof CustomEvent<"u"&&le(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Lo(e){try{return Gn(e)?ft(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Oo(e){if(typeof e=="object"&&e!==null){let t={};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function Vn(e,t=40){let n=Object.keys(kt(e));n.sort();let r=n[0];if(!r)return"[object has no keys]";if(r.length>=t)return De(r,t);for(let o=n.length;o>0;o--){let s=n.slice(0,o).join(", ");if(!(s.length>t))return o===n.length?s:De(s,t)}return""}function Ca(){let e=w;return e.crypto||e.msCrypto}function q(e=Ca()){let t=()=>Math.random()*16;try{if(e?.randomUUID)return e.randomUUID().replace(/-/g,"");e?.getRandomValues&&(t=()=>{let n=new Uint8Array(1);return e.getRandomValues(n),n[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,n=>(n^(t()&15)>>n/4).toString(16))}function Po(e){return e.exception?.values?.[0]}function ge(e){let{message:t,event_id:n}=e;if(t)return t;let r=Po(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Ze(e,t,n){let r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type=n||"Error")}function he(e,t){let n=Po(e);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism=g(g(g({},r),o),t),t&&"data"in t){let s=g(g({},o?.data),t.data);n.mechanism.data=s}}function Bt(e){if(wa(e))return!0;try{oe(e,"__sentry_captured__",!0)}catch{}return!1}function wa(e){try{return e.__sentry_captured__}catch{}}var Fo=1e3;function _e(){return Date.now()/Fo}function Da(){let{performance:e}=w;if(!e?.now||!e.timeOrigin)return _e;let t=e.timeOrigin;return()=>(t+e.now())/Fo}var Mo;function ne(){return(Mo??(Mo=Da()))()}function Uo(e){let t=ne(),n={sid:q(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>La(n)};return e&&Re(n,e),n}function Re(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||ne(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:q()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function ko(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),Re(e,n)}function La(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Le(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r=g({},e);for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=Le(r[o],t[o],n-1));return r}function qn(){return q()}function Ht(){return q().substring(16)}var Kn="_sentrySpan";function Jn(e,t){t?oe(e,Kn,t):delete e[Kn]}function Xn(e){return e[Kn]}var Oa=100,Z=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:qn(),sampleRand:Math.random()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags=g({},this._tags),t._extra=g({},this._extra),t._contexts=g({},this._contexts),this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata=g({},this._sdkProcessingMetadata),t._propagationContext=g({},this._propagationContext),t._client=this._client,t._lastEventId=this._lastEventId,Jn(t,Xn(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Re(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(t){return this._tags=g(g({},this._tags),t),this._notifyScopeListeners(),this}setTag(t,n){return this._tags=P(g({},this._tags),{[t]:n}),this._notifyScopeListeners(),this}setExtras(t){return this._extra=g(g({},this._extra),t),this._notifyScopeListeners(),this}setExtra(t,n){return this._extra=P(g({},this._extra),{[t]:n}),this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t=="function"?t(this):t,r=n instanceof e?n.getScopeData():be(n)?t:void 0,{tags:o,extra:s,user:c,contexts:f,level:d,fingerprint:_=[],propagationContext:I}=r||{};return this._tags=g(g({},this._tags),o),this._extra=g(g({},this._extra),s),this._contexts=g(g({},this._contexts),f),c&&Object.keys(c).length&&(this._user=c),d&&(this._level=d),_.length&&(this._fingerprint=_),I&&(this._propagationContext=I),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,Jn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:qn(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:Oa;if(r<=0)return this;let o=P(g({timestamp:_e()},t),{message:t.message?De(t.message,2048):t.message});return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Xn(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Le(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||q();if(!this._client)return C&&A.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(t,P(g({originalException:t,syntheticException:o},n),{event_id:r}),this),r}captureMessage(t,n,r){let o=r?.event_id||q();if(!this._client)return C&&A.warn("No client configured on scope - will not capture message!"),o;let s=new Error(t);return this._client.captureMessage(t,n,P(g({originalException:t,syntheticException:s},r),{event_id:o}),this),o}captureEvent(t,n){let r=n?.event_id||q();return this._client?(this._client.captureEvent(t,P(g({},n),{event_id:r}),this),r):(C&&A.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function Bo(){return Ie("defaultCurrentScope",()=>new Z)}function Ho(){return Ie("defaultIsolationScope",()=>new Z)}var Zn=class{constructor(t,n){let r;t?r=t:r=new Z;let o;n?o=n:o=new Z,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){let n=this._pushScope(),r;try{r=t(n)}catch(o){throw this._popScope(),o}return xe(r)?r.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Qe(){let e=Ue(),t=ke(e);return t.stack=t.stack||new Zn(Bo(),Ho())}function Pa(e){return Qe().withScope(e)}function Ma(e,t){let n=Qe();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function $o(e){return Qe().withScope(()=>e(Qe().getIsolationScope()))}function Go(){return{withIsolationScope:$o,withScope:Pa,withSetScope:Ma,withSetIsolationScope:(e,t)=>$o(t),getCurrentScope:()=>Qe().getScope(),getIsolationScope:()=>Qe().getIsolationScope()}}function $t(e){let t=ke(e);return t.acs?t.acs:Go()}function Ee(){let e=Ue();return $t(e).getCurrentScope()}function ye(){let e=Ue();return $t(e).getIsolationScope()}function Gt(){return Ie("globalScope",()=>new Z)}function lt(...e){let t=Ue(),n=$t(t);if(e.length===2){let[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function $(){return Ee().getClient()}function Qn(e){let t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=t,s={trace_id:n,span_id:o||Ht()};return r&&(s.parent_span_id=r),s}var jt="sentry.source",er="sentry.sample_rate",jo="sentry.previous_trace_sample_rate",tr="sentry.op",nr="sentry.origin";var rr="sentry.profile_id",or="sentry.exclusive_time";var Fa="_sentryScope",Ua="_sentryIsolationScope";function Wt(e){return{scope:e[Fa],isolationScope:e[Ua]}}var ka="sentry-",Ba=/^sentry-/;function Yo(e){let t=Ha(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,s])=>{if(o.match(Ba)){let c=o.slice(ka.length);r[c]=s}return r},{});if(Object.keys(n).length>0)return n}function Ha(e){if(!(!e||!te(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=Wo(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):Wo(e)}function Wo(e){return e.split(",").map(t=>t.split("=").map(n=>{try{return decodeURIComponent(n.trim())}catch{return}})).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function zo(e){if(typeof e=="boolean")return Number(e);let t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}var Jo=1,Vo=!1;function ir(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:et(e).parent_span_id,s=Wt(e).scope,c=r?s?.getPropagationContext().propagationSpanId||Ht():t;return{parent_span_id:o,span_id:c,trace_id:n}}function $a(e){if(e&&e.length>0)return e.map(c=>{var f=c,{context:d}=f,_=d,{spanId:t,traceId:n,traceFlags:r}=_,o=ho(_,["spanId","traceId","traceFlags"]),{attributes:s}=f;return g({span_id:t,trace_id:n,sampled:r===Jo,attributes:s},o)})}function qo(e){return typeof e=="number"?Ko(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Ko(e.getTime()):ne()}function Ko(e){return e>9999999999?e/1e3:e}function et(e){if(ja(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Ga(e)){let{attributes:r,startTime:o,name:s,endTime:c,status:f,links:d}=e,_="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:_,start_timestamp:qo(o),timestamp:qo(c)||void 0,status:Wa(f),op:r[tr],origin:r[nr],links:$a(d)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Ga(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function ja(e){return typeof e.getSpanJSON=="function"}function Xo(e){let{traceFlags:t}=e.spanContext();return t===Jo}function Wa(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"unknown_error"}var Ya="_sentryRootSpan";function dt(e){return e[Ya]||e}function sr(){Vo||(we(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),Vo=!0)}function Zo(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||$()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}var tt="production";var za=/^o(\d+)\./,Va=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function qa(e){return e==="http"||e==="https"}function Oe(e,t=!1){let{host:n,path:r,pass:o,port:s,projectId:c,protocol:f,publicKey:d}=e;return`${f}://${d}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${c}`}function Ka(e){let t=Va.exec(e);if(!t){we(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,o="",s="",c="",f=""]=t.slice(1),d="",_=f,I=_.split("/");if(I.length>1&&(d=I.slice(0,-1).join("/"),_=I.pop()),_){let x=_.match(/^\d+/);x&&(_=x[0])}return Qo({host:s,pass:o,path:d,projectId:_,port:c,protocol:n,publicKey:r})}function Qo(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Ja(e){if(!C)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(c=>e[c]?!1:(A.error(`Invalid Sentry Dsn: ${c} missing`),!0))?!1:n.match(/^\d+$/)?qa(r)?t&&isNaN(parseInt(t,10))?(A.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(A.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(A.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function ei(e){return e.match(za)?.[1]}function ti(e){let t=typeof e=="string"?Ka(e):Qo(e);if(!(!t||!Ja(t)))return t}var Xa="_frozenDsc";function ni(e,t){let n=t.getOptions(),{publicKey:r,host:o}=t.getDsn()||{},s;n.orgId?s=String(n.orgId):o&&(s=ei(o));let c={environment:n.environment||tt,release:n.release,public_key:r,trace_id:e,org_id:s};return t.emit("createDsc",c),c}function ri(e,t){let n=t.getPropagationContext();return n.dsc||ni(n.traceId,e)}function ar(e){let t=$();if(!t)return{};let n=dt(e),r=et(n),o=r.data,s=n.spanContext().traceState,c=s?.get("sentry.sample_rate")??o[er]??o[jo];function f(L){return(typeof c=="number"||typeof c=="string")&&(L.sample_rate=`${c}`),L}let d=n[Xa];if(d)return f(d);let _=s?.get("sentry.dsc"),I=_&&Yo(_);if(I)return f(I);let x=ni(e.spanContext().traceId,t),E=o[jt],S=r.description;return E!=="url"&&S&&(x.transaction=S),Zo()&&(x.sampled=String(Xo(n)),x.sample_rand=s?.get("sentry.sample_rand")??Wt(n).scope?.getPropagationContext().sampleRand.toString()),f(x),t.emit("createDsc",x,n),x}function fe(e,t=100,n=1/0){try{return cr("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Yt(e,t=3,n=100*1024){let r=fe(e,t);return tc(r)>n?Yt(e,t-1,n):r}function cr(e,t,n=1/0,r=1/0,o=nc()){let[s,c]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let f=Za(e,t);if(!f.startsWith("[object "))return f;if(t.__sentry_skip_normalization__)return t;let d=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(d===0)return f.replace("object ","");if(s(t))return"[Circular ~]";let _=t;if(_&&typeof _.toJSON=="function")try{let S=_.toJSON();return cr("",S,d-1,r,o)}catch{}let I=Array.isArray(t)?[]:{},x=0,E=kt(t);for(let S in E){if(!Object.prototype.hasOwnProperty.call(E,S))continue;if(x>=r){I[S]="[MaxProperties ~]";break}let L=E[S];I[S]=cr(S,L,d-1,r,o),x++}return c(t),I}function Za(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(ut(t))return"[VueViewModel]";if(Wn(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${ue(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let n=Qa(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Qa(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function ec(e){return~-encodeURI(e).split(/%..|./).length}function tc(e){return ec(JSON.stringify(e))}function nc(){let e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function Ae(e,t=[]){return[e,t]}function oi(e,t){let[n,r]=e;return[n,[...r,t]]}function fr(e,t){let n=e[1];for(let r of n){let o=r[0].type;if(t(r,o))return!0}return!1}function ur(e){let t=ke(w);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function ii(e){let[t,n]=e,r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[ur(r),s]:r.push(typeof s=="string"?ur(s):s)}for(let s of n){let[c,f]=s;if(o(`
|
|
6
|
-
${JSON.stringify(c)}
|
|
7
|
-
`),typeof f=="string"||f instanceof Uint8Array)o(f);else{let d;try{d=JSON.stringify(f)}catch{d=JSON.stringify(fe(f))}o(d)}}return typeof r=="string"?r:rc(r)}function rc(e){let t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function si(e){let t=typeof e.data=="string"?ur(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var oc={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item"};function pr(e){return oc[e]}function lr(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function ai(e,t,n,r){let o=e.sdkProcessingMetadata?.dynamicSamplingContext;return g(g(g({event_id:e.event_id,sent_at:new Date().toISOString()},t&&{sdk:t}),!!n&&r&&{dsn:Oe(r)}),o&&{trace:o})}function ic(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]]),e}function ci(e,t,n,r){let o=lr(n),s=g(g({sent_at:new Date().toISOString()},o&&{sdk:o}),!!r&&t&&{dsn:Oe(t)}),c="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Ae(s,[c])}function ui(e,t,n,r){let o=lr(n),s=e.type&&e.type!=="replay_event"?e.type:"event";ic(e,n?.sdk);let c=ai(e,o,r,t);return delete e.sdkProcessingMetadata,Ae(c,[[{type:s},e]])}var dr=0,fi=1,pi=2;function pe(e){return new de(t=>{t(e)})}function Pe(e){return new de((t,n)=>{n(e)})}var de=class e{constructor(t){this._state=dr,this._handlers=[],this._runExecutor(t)}then(t,n){return new e((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(c){o(c)}},s=>{if(!n)o(s);else try{r(n(s))}catch(c){o(c)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new e((n,r)=>{let o,s;return this.then(c=>{s=!1,o=c,t&&t()},c=>{s=!0,o=c,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===dr)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===fi&&n[1](this._value),this._state===pi&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(s,c)=>{if(this._state===dr){if(xe(c)){c.then(r,o);return}this._state=s,this._value=c,this._executeHandlers()}},r=s=>{n(fi,s)},o=s=>{n(pi,s)};try{t(r,o)}catch(s){o(s)}}};function zt(e,t,n,r=0){return new de((o,s)=>{let c=e[r];if(t===null||typeof c!="function")o(t);else{let f=c(g({},t),n);C&&c.id&&f===null&&A.log(`Event processor "${c.id}" dropped event`),xe(f)?f.then(d=>zt(e,d,n,r+1).then(o)).then(null,s):zt(e,f,n,r+1).then(o).then(null,s)}})}function li(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;sc(e,t),r&&uc(e,r),fc(e,n),ac(e,o),cc(e,s)}function mr(e,t){let{extra:n,tags:r,user:o,contexts:s,level:c,sdkProcessingMetadata:f,breadcrumbs:d,fingerprint:_,eventProcessors:I,attachments:x,propagationContext:E,transactionName:S,span:L}=t;Vt(e,"extra",n),Vt(e,"tags",r),Vt(e,"user",o),Vt(e,"contexts",s),e.sdkProcessingMetadata=Le(e.sdkProcessingMetadata,f,2),c&&(e.level=c),S&&(e.transactionName=S),L&&(e.span=L),d.length&&(e.breadcrumbs=[...e.breadcrumbs,...d]),_.length&&(e.fingerprint=[...e.fingerprint,..._]),I.length&&(e.eventProcessors=[...e.eventProcessors,...I]),x.length&&(e.attachments=[...e.attachments,...x]),e.propagationContext=g(g({},e.propagationContext),E)}function Vt(e,t,n){e[t]=Le(e[t],n,1)}function sc(e,t){let{extra:n,tags:r,user:o,contexts:s,level:c,transactionName:f}=t;Object.keys(n).length&&(e.extra=g(g({},n),e.extra)),Object.keys(r).length&&(e.tags=g(g({},r),e.tags)),Object.keys(o).length&&(e.user=g(g({},o),e.user)),Object.keys(s).length&&(e.contexts=g(g({},s),e.contexts)),c&&(e.level=c),f&&e.type!=="transaction"&&(e.transaction=f)}function ac(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function cc(e,t){e.sdkProcessingMetadata=g(g({},e.sdkProcessingMetadata),t)}function uc(e,t){e.contexts=g({trace:ir(t)},e.contexts),e.sdkProcessingMetadata=g({dynamicSamplingContext:ar(t)},e.sdkProcessingMetadata);let n=dt(t),r=et(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function fc(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}var qt,di,Kt;function mi(e){let t=w._sentryDebugIds;if(!t)return{};let n=Object.keys(t);return Kt&&n.length===di||(di=n.length,Kt=n.reduce((r,o)=>{qt||(qt={});let s=qt[o];if(s)r[s[0]]=s[1];else{let c=e(o);for(let f=c.length-1;f>=0;f--){let _=c[f]?.filename,I=t[o];if(_&&I){r[_]=I,qt[o]=[_,I];break}}}return r},{})),Kt}function gi(e,t,n,r,o,s){let{normalizeDepth:c=3,normalizeMaxBreadth:f=1e3}=e,d=P(g({},t),{event_id:t.event_id||n.event_id||q(),timestamp:t.timestamp||_e()}),_=n.integrations||e.integrations.map(k=>k.name);pc(d,e),mc(d,_),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&lc(d,e.stackParser);let I=hc(r,n.captureContext);n.mechanism&&he(d,n.mechanism);let x=o?o.getEventProcessors():[],E=Gt().getScopeData();if(s){let k=s.getScopeData();mr(E,k)}if(I){let k=I.getScopeData();mr(E,k)}let S=[...n.attachments||[],...E.attachments];S.length&&(n.attachments=S),li(d,E);let L=[...x,...E.eventProcessors];return zt(L,d,n).then(k=>(k&&dc(k),typeof c=="number"&&c>0?gc(k,c,f):k))}function pc(e,t){let{environment:n,release:r,dist:o,maxValueLength:s=250}=t;e.environment=e.environment||n||tt,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let c=e.request;c?.url&&(c.url=De(c.url,s))}function lc(e,t){let n=mi(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function dc(e){let t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function mc(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function gc(e,t,n){if(!e)return null;let r=g(g(g(g(g({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>g(g({},o),o.data&&{data:fe(o.data,t,n)}))}),e.user&&{user:fe(e.user,t,n)}),e.contexts&&{contexts:fe(e.contexts,t,n)}),e.extra&&{extra:fe(e.extra,t,n)});return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=fe(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>g(g({},o),o.data&&{data:fe(o.data,t,n)}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=fe(e.contexts.flags,3,n)),r}function hc(e,t){if(!t)return e;let n=e?e.clone():new Z;return n.update(t),n}function hi(e){if(e)return _c(e)?{captureContext:e}:yc(e)?{captureContext:e}:e}function _c(e){return e instanceof Z||typeof e=="function"}var Ec=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function yc(e){return Object.keys(e).some(t=>Ec.includes(t))}function Jt(e,t){return Ee().captureException(e,hi(t))}function mt(e,t){return Ee().captureEvent(e,t)}function gt(e){let t=ye(),n=Ee(),{userAgent:r}=w.navigator||{},o=Uo(g(g({user:n.getUser()||t.getUser()},r&&{userAgent:r}),e)),s=t.getSession();return s?.status==="ok"&&Re(s,{status:"exited"}),Xt(),t.setSession(o),o}function Xt(){let e=ye(),n=Ee().getSession()||e.getSession();n&&ko(n),Ei(),e.setSession()}function Ei(){let e=ye(),t=$(),n=e.getSession();n&&t&&t.captureSession(n)}function ht(e=!1){if(e){Xt();return}Ei()}var Sc="7";function vc(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Tc(e){return`${vc(e)}${e.projectId}/envelope/`}function Ic(e,t){let n={sentry_version:Sc};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function yi(e,t,n){return t||`${Tc(e)}?${Ic(e,n)}`}var Si=[];function vi(e,t){let n={};return t.forEach(r=>{r&&hr(e,r,n)}),n}function gr(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function hr(e,t,n){if(n[t.name]){C&&A.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,Si.indexOf(t.name)===-1&&typeof t.setupOnce=="function"&&(t.setupOnce(),Si.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){let r=t.processEvent.bind(t),o=Object.assign((s,c)=>r(s,c,e),{id:t.name});e.addEventProcessor(o)}C&&A.log(`Integration installed: ${t.name}`)}function Ti(e,t,n){let r=[{type:"client_report"},{timestamp:n||_e(),discarded_events:e}];return Ae(t?{dsn:t}:{},[r])}function Zt(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Ii(e){let{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:c,op:f}=e.contexts?.trace??{};return{data:c??{},description:e.transaction,op:f,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:c?.[rr],exclusive_time:c?.[or],measurements:e.measurements,is_segment:!0}}function bi(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:g(g(g({},e.data),e.profile_id&&{[rr]:e.profile_id}),e.exclusive_time&&{[or]:e.exclusive_time})}},measurements:e.measurements}}var xi="Not capturing exception because it's already been captured.",Ri="Discarded session because of missing or non-string release",Ci=Symbol.for("SentryInternalError"),wi=Symbol.for("SentryDoNotSendEventError");function Qt(e){return{message:e,[Ci]:!0}}function _r(e){return{message:e,[wi]:!0}}function Ai(e){return!!e&&typeof e=="object"&&Ci in e}function Ni(e){return!!e&&typeof e=="object"&&wi in e}var _t=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=ti(t.dsn):C&&A.warn("No DSN provided, client will not send events."),this._dsn){let n=yi(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport(P(g({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},t.transportOptions),{url:n}))}}captureException(t,n,r){let o=q();if(Bt(t))return C&&A.log(xi),o;let s=g({event_id:o},n);return this._process(this.eventFromException(t,s).then(c=>this._captureEvent(c,s,r))),s.event_id}captureMessage(t,n,r,o){let s=g({event_id:q()},r),c=Je(t)?t:String(t),f=He(t)?this.eventFromMessage(c,n,s):this.eventFromException(t,s);return this._process(f.then(d=>this._captureEvent(d,s,o))),s.event_id}captureEvent(t,n,r){let o=q();if(n?.originalException&&Bt(n.originalException))return C&&A.log(xi),o;let s=g({event_id:o},n),c=t.sdkProcessingMetadata||{},f=c.capturedSpanScope,d=c.capturedSpanIsolationScope;return this._process(this._captureEvent(t,s,f||r,d)),s.event_id}captureSession(t){this.sendSession(t),Re(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){let n=this._transport;return n?(this.emit("flush"),this._isClientDoneProcessing(t).then(r=>n.flush(t).then(o=>r&&o))):pe(!0)}close(t){return this.flush(t).then(n=>(this.getOptions().enabled=!1,this.emit("close"),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){let n=this._integrations[t.name];hr(this,t,this._integrations),n||gr(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=ui(t,this._dsn,this._options._metadata,this._options.tunnel);for(let s of n.attachments||[])r=oi(r,si(s));let o=this.sendEnvelope(r);o&&o.then(s=>this.emit("afterSendEvent",t,s),null)}sendSession(t){let{release:n,environment:r=tt}=this._options;if("aggregates"in t){let s=t.attrs||{};if(!s.release&&!n){C&&A.warn(Ri);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){C&&A.warn(Ri);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=ci(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){let o=`${t}:${n}`;C&&A.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){let r=this._hooks[t]=this._hooks[t]||[];return r.push(n),()=>{let o=r.indexOf(n);o>-1&&r.splice(o,1)}}emit(t,...n){let r=this._hooks[t];r&&r.forEach(o=>o(...n))}sendEnvelope(t){return this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport?this._transport.send(t).then(null,n=>(C&&A.error("Error while sending envelope:",n),n)):(C&&A.error("Transport disabled"),pe({}))}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=vi(this,t),gr(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1,s=n.exception?.values;if(s){o=!0;for(let d of s)if(d.mechanism?.handled===!1){r=!0;break}}let c=t.status==="ok";(c&&t.errors===0||c&&r)&&(Re(t,P(g({},r&&{status:"crashed"}),{errors:t.errors||Number(o||r)})),this.captureSession(t))}_isClientDoneProcessing(t){return new de(n=>{let r=0,o=1,s=setInterval(()=>{this._numProcessing==0?(clearInterval(s),n(!0)):(r+=o,t&&r>=t&&(clearInterval(s),n(!1)))},o)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){let s=this.getOptions(),c=Object.keys(this._integrations);return!n.integrations&&c?.length&&(n.integrations=c),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),gi(s,t,n,r,this,o).then(f=>{if(f===null)return f;this.emit("postprocessEvent",f,n),f.contexts=g({trace:Qn(r)},f.contexts);let d=ri(this,r);return f.sdkProcessingMetadata=g({dynamicSamplingContext:d},f.sdkProcessingMetadata),f})}_captureEvent(t,n={},r=Ee(),o=ye()){return C&&Er(t)&&A.log(`Captured error event \`${Zt(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{C&&(Ni(s)?A.log(s.message):Ai(s)?A.warn(s.message):A.warn(s))})}_processEvent(t,n,r,o){let s=this.getOptions(),{sampleRate:c}=s,f=Di(t),d=Er(t),_=t.type||"error",I=`before send for type \`${_}\``,x=typeof c>"u"?void 0:zo(c);if(d&&typeof x=="number"&&Math.random()>x)return this.recordDroppedEvent("sample_rate","error"),Pe(_r(`Discarding event because it's not included in the random sample (sampling rate = ${c})`));let E=_==="replay_event"?"replay":_;return this._prepareEvent(t,n,r,o).then(S=>{if(S===null)throw this.recordDroppedEvent("event_processor",E),_r("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return S;let H=Rc(this,s,S,n);return xc(H,I)}).then(S=>{if(S===null){if(this.recordDroppedEvent("before_send",E),f){let G=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",G)}throw _r(`${I} returned \`null\`, will not send event.`)}let L=r.getSession()||o.getSession();if(d&&L&&this._updateSessionFromEvent(L,S),f){let k=S.sdkProcessingMetadata?.spanCountBeforeProcessing||0,G=S.spans?S.spans.length:0,ie=k-G;ie>0&&this.recordDroppedEvent("before_send","span",ie)}let H=S.transaction_info;if(f&&H&&S.transaction!==t.transaction){let k="custom";S.transaction_info=P(g({},H),{source:k})}return this.sendEvent(S,n),S}).then(null,S=>{throw Ni(S)||Ai(S)?S:(this.captureException(S,{data:{__sentry__:!0},originalException:S}),Qt(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
8
|
-
Reason: ${S}`))})}_process(t){this._numProcessing++,t.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{let[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){C&&A.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){C&&A.log("No outcomes to send");return}if(!this._dsn){C&&A.log("No dsn provided, will not send outcomes");return}C&&A.log("Sending outcomes:",t);let n=Ti(t,this._options.tunnel&&Oe(this._dsn));this.sendEnvelope(n)}};function xc(e,t){let n=`${t} must return \`null\` or a valid event.`;if(xe(e))return e.then(r=>{if(!be(r)&&r!==null)throw Qt(n);return r},r=>{throw Qt(`${t} rejected with ${r}`)});if(!be(e)&&e!==null)throw Qt(n);return e}function Rc(e,t,n,r){let{beforeSend:o,beforeSendTransaction:s,beforeSendSpan:c}=t,f=n;if(Er(f)&&o)return o(f,r);if(Di(f)){if(c){let d=c(Ii(f));if(d?f=Le(n,bi(d)):sr(),f.spans){let _=[];for(let I of f.spans){let x=c(I);x?_.push(x):(sr(),_.push(I))}f.spans=_}}if(s){if(f.spans){let d=f.spans.length;f.sdkProcessingMetadata=P(g({},n.sdkProcessingMetadata),{spanCountBeforeProcessing:d})}return s(f,r)}}return f}function Er(e){return e.type===void 0}function Di(e){return e.type==="transaction"}function Ac(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Li(e,t,n,r){let o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=Oe(r)),Ae(o,[Ac(e)])}function Et(e,t){let n=t??Nc(e)??[];if(n.length===0)return;let r=e.getOptions(),o=Li(n,r._metadata,r.tunnel,e.getDsn());Oi().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function Nc(e){return Oi().get(e)}function Oi(){return Ie("clientToLogBufferMap",()=>new WeakMap)}var yr=Symbol.for("SentryBufferFullError");function Pi(e){let t=[];function n(){return e===void 0||t.length<e}function r(c){return t.splice(t.indexOf(c),1)[0]||Promise.resolve(void 0)}function o(c){if(!n())return Pe(yr);let f=c();return t.indexOf(f)===-1&&t.push(f),f.then(()=>r(f)).then(null,()=>r(f).then(null,()=>{})),f}function s(c){return new de((f,d)=>{let _=t.length;if(!_)return f(!0);let I=setTimeout(()=>{c&&c>0&&f(!1)},c);t.forEach(x=>{pe(x).then(()=>{--_||(clearTimeout(I),f(!0))},d)})})}return{$:t,add:o,drain:s}}function Cc(e,t=Date.now()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}function wc(e,t){return e[t]||e.all||0}function Mi(e,t,n=Date.now()){return wc(e,t)>n}function Fi(e,{statusCode:t,headers:n},r=Date.now()){let o=g({},e),s=n?.["x-sentry-rate-limits"],c=n?.["retry-after"];if(s)for(let f of s.trim().split(",")){let[d,_,,,I]=f.split(":",5),x=parseInt(d,10),E=(isNaN(x)?60:x)*1e3;if(!_)o.all=r+E;else for(let S of _.split(";"))S==="metric_bucket"?(!I||I.split(";").includes("custom"))&&(o[S]=r+E):o[S]=r+E}else c?o.all=r+Cc(c,r):t===429&&(o.all=r+60*1e3);return o}var Dc=64;function en(e,t,n=Pi(e.bufferSize||Dc)){let r={},o=c=>n.drain(c);function s(c){let f=[];if(fr(c,(x,E)=>{let S=pr(E);Mi(r,S)?e.recordDroppedEvent("ratelimit_backoff",S):f.push(x)}),f.length===0)return pe({});let d=Ae(c[0],f),_=x=>{fr(d,(E,S)=>{e.recordDroppedEvent(x,pr(S))})},I=()=>t({body:ii(d)}).then(x=>(x.statusCode!==void 0&&(x.statusCode<200||x.statusCode>=300)&&C&&A.warn(`Sentry responded with status code ${x.statusCode} to sent event.`),r=Fi(r,x),x),x=>{throw _("network_error"),C&&A.error("Encountered error running transport request:",x),x});return n.add(I).then(x=>x,x=>{if(x===yr)return C&&A.error("Skipped sending event because buffer is full."),_("queue_overflow"),pe({});throw x})}return{send:s,flush:o}}function Sr(e){e.user?.ip_address===void 0&&(e.user=P(g({},e.user),{ip_address:"{{auto}}"}))}function vr(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs=P(g({},e.attrs),{ip_address:"{{auto}}"})):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function Tr(e,t,n=[t],r="npm"){let o=e._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${t}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:me})),version:me}),e._metadata=o}var Lc=100;function Se(e,t){let n=$(),r=ye();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:s=Lc}=n.getOptions();if(s<=0)return;let c=_e(),f=g({timestamp:c},e),d=o?we(()=>o(f,t)):f;d!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",d,t),r.addBreadcrumb(d,s))}var Ui,Oc="FunctionToString",ki=new WeakMap,Pc=()=>({name:Oc,setupOnce(){Ui=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=Ge(this),n=ki.has($())&&t!==void 0?t:this;return Ui.apply(n,e)}}catch{}},setup(e){ki.set(e,!0)}}),tn=Pc;var Mc=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],Fc="EventFilters",Ir=(e={})=>{let t;return{name:Fc,setup(n){let r=n.getOptions();t=Bi(e,r)},processEvent(n,r,o){if(!t){let s=o.getOptions();t=Bi(e,s)}return Uc(n,t)?null:n}}},rn=(e={})=>P(g({},Ir(e)),{name:"InboundFilters"});function Bi(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Mc],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Uc(e,t){if(e.type){if(e.type==="transaction"&&Bc(e,t.ignoreTransactions))return C&&A.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
9
|
-
Event: ${ge(e)}`),!0}else{if(kc(e,t.ignoreErrors))return C&&A.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
10
|
-
Event: ${ge(e)}`),!0;if(jc(e))return C&&A.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
11
|
-
Event: ${ge(e)}`),!0;if(Hc(e,t.denyUrls))return C&&A.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
12
|
-
Event: ${ge(e)}.
|
|
13
|
-
Url: ${nn(e)}`),!0;if(!$c(e,t.allowUrls))return C&&A.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
14
|
-
Event: ${ge(e)}.
|
|
15
|
-
Url: ${nn(e)}`),!0}return!1}function kc(e,t){return t?.length?Zt(e).some(n=>Xe(n,t)):!1}function Bc(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Xe(n,t):!1}function Hc(e,t){if(!t?.length)return!1;let n=nn(e);return n?Xe(n,t):!1}function $c(e,t){if(!t?.length)return!0;let n=nn(e);return n?Xe(n,t):!0}function Gc(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function nn(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?Gc(n):null}catch{return C&&A.error(`Cannot extract url for event ${ge(e)}`),null}}function jc(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function xr(e,t,n,r,o,s){if(!o.exception?.values||!s||!le(s.originalException,Error))return;let c=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;c&&(o.exception.values=br(e,t,r,s.originalException,n,o.exception.values,c,0))}function br(e,t,n,r,o,s,c,f){if(s.length>=n+1)return s;let d=[...s];if(le(r[o],Error)){Hi(c,f);let _=e(t,r[o]),I=d.length;$i(_,o,I,f),d=br(e,t,n,r[o],o,[_,...d],_,I)}return Array.isArray(r.errors)&&r.errors.forEach((_,I)=>{if(le(_,Error)){Hi(c,f);let x=e(t,_),E=d.length;$i(x,`errors[${I}]`,E,f),d=br(e,t,n,_,o,[x,...d],x,E)}}),d}function Hi(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=P(g(g({},e.mechanism),e.type==="AggregateError"&&{is_exception_group:!0}),{exception_id:t})}function $i(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism=P(g({},e.mechanism),{type:"chained",source:t,exception_id:n,parent_id:r})}function Rr(e){let t="console";Q(t,e),ee(t,Wc)}function Wc(){"console"in w&&Ln.forEach(function(e){e in w.console&&V(w.console,e,function(t){return qe[e]=t,function(...n){z("console",{args:n,level:e}),qe[e]?.apply(w.console,n)}})})}function Ar(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var Yc="Dedupe",zc=()=>{let e;return{name:Yc,processEvent(t){if(t.type)return t;try{if(Vc(t,e))return C&&A.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},on=zc;function Vc(e,t){return t?!!(qc(e,t)||Kc(e,t)):!1}function qc(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Wi(e,t)||!ji(e,t))}function Kc(e,t){let n=Gi(t),r=Gi(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Wi(e,t)||!ji(e,t))}function ji(e,t){let n=Lt(e),r=Lt(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){let s=r[o],c=n[o];if(s.filename!==c.filename||s.lineno!==c.lineno||s.colno!==c.colno||s.function!==c.function)return!1}return!0}function Wi(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function Gi(e){return e.exception?.values?.[0]}function yt(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function sn(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}var St=w;function Nr(){return"history"in St&&!!St.history}function Jc(){if(!("fetch"in St))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function vt(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Cr(){if(typeof EdgeRuntime=="string")return!0;if(!Jc())return!1;if(vt(St.fetch))return!0;let e=!1,t=St.document;if(t&&typeof t.createElement=="function")try{let n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=vt(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){C&&A.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function Dr(e,t){let n="fetch";Q(n,e),ee(n,()=>Xc(void 0,t))}function Xc(e,t=!1){t&&!Cr()||V(w,"fetch",function(n){return function(...r){let o=new Error,{method:s,url:c}=Zc(r),f={args:r,fetchData:{method:s,url:c},startTimestamp:ne()*1e3,virtualError:o,headers:Qc(r)};return e||z("fetch",g({},f)),n.apply(w,r).then(async d=>(e?e(d):z("fetch",P(g({},f),{endTimestamp:ne()*1e3,response:d})),d),d=>{if(z("fetch",P(g({},f),{endTimestamp:ne()*1e3,error:d})),Be(d)&&d.stack===void 0&&(d.stack=o.stack,oe(d,"framesToPop",1)),d instanceof TypeError&&(d.message==="Failed to fetch"||d.message==="Load failed"||d.message==="NetworkError when attempting to fetch resource."))try{let _=new URL(f.fetchData.url);d.message=`${d.message} (${_.host})`}catch{}throw d})}})}function wr(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Yi(e){return typeof e=="string"?e:e?wr(e,"url")?e.url:e.toString?e.toString():"":""}function Zc(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[n,r]=e;return{url:Yi(n),method:wr(r,"method")?String(r.method).toUpperCase():"GET"}}let t=e[0];return{url:Yi(t),method:wr(t,"method")?String(t.method).toUpperCase():"GET"}}function Qc(e){let[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(wo(t))return new Headers(t.headers)}catch{}}function Lr(){return"npm"}var j=w,Or=0;function Pr(){return Or>0}function mu(){Or++,setTimeout(()=>{Or--})}function je(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{let o=e.__sentry_wrapped__;if(o)return typeof o=="function"?o:e;if(Ge(e))return e}catch{return e}let r=function(...o){try{let s=o.map(c=>je(c,t));return e.apply(this,s)}catch(s){throw mu(),lt(c=>{c.addEventProcessor(f=>(t.mechanism&&(Ze(f,void 0,void 0),he(f,t.mechanism)),f.extra=P(g({},f.extra),{arguments:o}),f)),Jt(s)}),s}};try{for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}catch{}Ut(r,e),oe(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function zi(){let e=pt(),{referrer:t}=j.document||{},{userAgent:n}=j.navigator||{},r=g(g({},t&&{Referer:t}),n&&{"User-Agent":n});return{url:e,headers:r}}function an(e,t){let n=Ur(e,t),r={type:yu(t),value:Su(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function gu(e,t,n,r){let s=$()?.getOptions().normalizeDepth,c=Iu(t),f={__serialized__:Yt(t,s)};if(c)return{exception:{values:[an(e,c)]},extra:f};let d={exception:{values:[{type:$e(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:vu(t,{isUnhandledRejection:r})}]},extra:f};if(n){let _=Ur(e,n);_.length&&(d.exception.values[0].stacktrace={frames:_})}return d}function Mr(e,t){return{exception:{values:[an(e,t)]}}}function Ur(e,t){let n=t.stacktrace||t.stack||"",r=_u(t),o=Eu(t);try{return e(n,r,o)}catch{}return[]}var hu=/Minified React error #\d+;/i;function _u(e){return e&&hu.test(e.message)?1:0}function Eu(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Vi(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function yu(e){let t=e?.name;return!t&&Vi(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function Su(e){let t=e?.message;return Vi(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function qi(e,t,n,r){let o=n?.syntheticException||void 0,s=cn(e,t,o,r);return he(s),s.level="error",n?.event_id&&(s.event_id=n.event_id),pe(s)}function Ki(e,t,n="info",r,o){let s=r?.syntheticException||void 0,c=Fr(e,t,s,o);return c.level=n,r?.event_id&&(c.event_id=r.event_id),pe(c)}function cn(e,t,n,r,o){let s;if(Pt(t)&&t.error)return Mr(e,t.error);if(Mt(t)||$n(t)){let c=t;if("stack"in t)s=Mr(e,t);else{let f=c.name||(Mt(c)?"DOMError":"DOMException"),d=c.message?`${f}: ${c.message}`:f;s=Fr(e,d,n,r),Ze(s,d)}return"code"in c&&(s.tags=P(g({},s.tags),{"DOMException.code":`${c.code}`})),s}return Be(t)?Mr(e,t):be(t)||$e(t)?(s=gu(e,t,n,o),he(s,{synthetic:!0}),s):(s=Fr(e,t,n,r),Ze(s,`${t}`,void 0),he(s,{synthetic:!0}),s)}function Fr(e,t,n,r){let o={};if(r&&n){let s=Ur(e,n);s.length&&(o.exception={values:[{value:t,stacktrace:{frames:s}}]}),he(o,{synthetic:!0})}if(Je(t)){let{__sentry_template_string__:s,__sentry_template_values__:c}=t;return o.logentry={message:s,params:c},o}return o.message=t,o}function vu(e,{isUnhandledRejection:t}){let n=Vn(e),r=t?"promise rejection":"exception";return Pt(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:$e(e)?`Event \`${Tu(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Tu(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Iu(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}var bu=5e3,Tt=class extends _t{constructor(t){let n=xu(t),r=j.SENTRY_SDK_SOURCE||Lr();Tr(n,"browser",["browser"],r),super(n);let{sendDefaultPii:o,sendClientReports:s,enableLogs:c,_experiments:f}=this._options,d=c??f?.enableLogs;j.document&&(s||d)&&j.document.addEventListener("visibilitychange",()=>{j.document.visibilityState==="hidden"&&(s&&this._flushOutcomes(),d&&Et(this))}),d&&(this.on("flush",()=>{Et(this)}),this.on("afterCaptureLog",()=>{this._logFlushIdleTimeout&&clearTimeout(this._logFlushIdleTimeout),this._logFlushIdleTimeout=setTimeout(()=>{Et(this)},bu)})),o&&(this.on("postprocessEvent",Sr),this.on("beforeSendSession",vr))}eventFromException(t,n){return qi(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Ki(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,o)}};function xu(e){return g({release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:j.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0},e)}var Ji=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var K=w;var Ru=1e3,Xi,kr,Br;function Hr(e){Q("dom",e),ee("dom",Au)}function Au(){if(!K.document)return;let e=z.bind(null,"dom"),t=Zi(e,!0);K.document.addEventListener("click",t,!1),K.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{let o=K[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(V(o,"addEventListener",function(s){return function(c,f,d){if(c==="click"||c=="keypress")try{let _=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},I=_[c]=_[c]||{refCount:0};if(!I.handler){let x=Zi(e);I.handler=x,s.call(this,c,x,d)}I.refCount++}catch{}return s.call(this,c,f,d)}}),V(o,"removeEventListener",function(s){return function(c,f,d){if(c==="click"||c=="keypress")try{let _=this.__sentry_instrumentation_handlers__||{},I=_[c];I&&(I.refCount--,I.refCount<=0&&(s.call(this,c,I.handler,d),I.handler=void 0,delete _[c]),Object.keys(_).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return s.call(this,c,f,d)}}))})}function Nu(e){if(e.type!==kr)return!1;try{if(!e.target||e.target._sentryId!==Br)return!1}catch{}return!0}function Cu(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Zi(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=wu(n);if(Cu(n.type,r))return;oe(n,"_sentryCaptured",!0),r&&!r._sentryId&&oe(r,"_sentryId",q());let o=n.type==="keypress"?"input":n.type;Nu(n)||(e({event:n,name:o,global:t}),kr=n.type,Br=r?r._sentryId:void 0),clearTimeout(Xi),Xi=K.setTimeout(()=>{Br=void 0,kr=void 0},Ru)}}function wu(e){try{return e.target}catch{return null}}var un;function It(e){let t="history";Q(t,e),ee(t,Du)}function Du(){if(K.addEventListener("popstate",()=>{let t=K.location.href,n=un;if(un=t,n===t)return;z("history",{from:n,to:t})}),!Nr())return;function e(t){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let o=un,s=Lu(String(r));if(un=s,o===s)return t.apply(this,n);z("history",{from:o,to:s})}return t.apply(this,n)}}V(K.history,"pushState",e),V(K.history,"replaceState",e)}function Lu(e){try{return new URL(e,K.location.origin).toString()}catch{return e}}var fn={};function $r(e){let t=fn[e];if(t)return t;let n=K[e];if(vt(n))return fn[e]=n.bind(K);let r=K.document;if(r&&typeof r.createElement=="function")try{let o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);let s=o.contentWindow;s?.[e]&&(n=s[e]),r.head.removeChild(o)}catch(o){Ji&&A.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(fn[e]=n.bind(K))}function pn(e){fn[e]=void 0}var We="__sentry_xhr_v3__";function Gr(e){Q("xhr",e),ee("xhr",Ou)}function Ou(){if(!K.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){let o=new Error,s=ne()*1e3,c=te(r[0])?r[0].toUpperCase():void 0,f=Pu(r[1]);if(!c||!f)return t.apply(n,r);n[We]={method:c,url:f,request_headers:{}},c==="POST"&&f.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let d=()=>{let _=n[We];if(_&&n.readyState===4){try{_.status_code=n.status}catch{}let I={endTimestamp:ne()*1e3,startTimestamp:s,xhr:n,virtualError:o};z("xhr",I)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(_,I,x){return d(),_.apply(I,x)}}):n.addEventListener("readystatechange",d),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(_,I,x){let[E,S]=x,L=I[We];return L&&te(E)&&te(S)&&(L.request_headers[E.toLowerCase()]=S),_.apply(I,x)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){let o=n[We];if(!o)return t.apply(n,r);r[0]!==void 0&&(o.body=r[0]);let s={startTimestamp:ne()*1e3,xhr:n};return z("xhr",s),t.apply(n,r)}})}function Pu(e){if(te(e))return e;try{return e.toString()}catch{}}function jr(e,t=$r("fetch")){let n=0,r=0;function o(s){let c=s.body.length;n+=c,r++;let f=g({body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15},e.fetchOptions);if(!t)return pn("fetch"),Pe("No fetch implementation available");try{return t(e.url,f).then(d=>(n-=c,r--,{statusCode:d.status,headers:{"x-sentry-rate-limits":d.headers.get("X-Sentry-Rate-Limits"),"retry-after":d.headers.get("Retry-After")}}))}catch(d){return pn("fetch"),n-=c,r--,Pe(d)}}return en(e,o)}var Mu=30;var Fu=50;function Wr(e,t,n,r){let o={filename:e,function:t==="<anonymous>"?"?":t,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}var Uu=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ku=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Bu=/\((\S*)(?::(\d+))(?::(\d+))\)/,Hu=e=>{let t=Uu.exec(e);if(t){let[,r,o,s]=t;return Wr(r,"?",+o,+s)}let n=ku.exec(e);if(n){if(n[2]&&n[2].indexOf("eval")===0){let c=Bu.exec(n[2]);c&&(n[2]=c[1],n[3]=c[2],n[4]=c[3])}let[o,s]=ns(n[1]||"?",n[2]);return Wr(s,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},Qi=[Mu,Hu],$u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Gu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ju=e=>{let t=$u.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){let s=Gu.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}let r=t[3],o=t[1]||"?";return[o,r]=ns(o,r),Wr(r,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},es=[Fu,ju];var ts=[Qi,es],Yr=Fn(...ts),ns=(e,t)=>{let n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};var nt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var ln=1024,Wu="Breadcrumbs",Yu=(e={})=>{let t=g({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e);return{name:Wu,setup(n){t.console&&Rr(qu(n)),t.dom&&Hr(Vu(n,t.dom)),t.xhr&&Gr(Ku(n)),t.fetch&&Dr(Ju(n)),t.history&&It(Xu(n)),t.sentry&&n.on("beforeSendEvent",zu(n))}}},rs=Yu;function zu(e){return function(n){$()===e&&Se({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:ge(n)},{event:n})}}function Vu(e,t){return function(r){if($()!==e)return;let o,s,c=typeof t=="object"?t.serializeAttribute:void 0,f=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;f&&f>ln&&(nt&&A.warn(`\`dom.maxStringLength\` cannot exceed ${ln}, but a value of ${f} was configured. Sentry will use ${ln} instead.`),f=ln),typeof c=="string"&&(c=[c]);try{let _=r.event,I=Zu(_)?_.target:_;o=ft(I,{keyAttrs:c,maxStringLength:f}),s=zn(I)}catch{o="<unknown>"}if(o.length===0)return;let d={category:`ui.${r.name}`,message:o};s&&(d.data={"ui.component_name":s}),Se(d,{event:r.event,name:r.name,global:r.global})}}function qu(e){return function(n){if($()!==e)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:Ar(n.level),message:Ft(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Ft(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;Se(r,{input:n.args,level:n.level})}}function Ku(e){return function(n){if($()!==e)return;let{startTimestamp:r,endTimestamp:o}=n,s=n.xhr[We];if(!r||!o||!s)return;let{method:c,url:f,status_code:d,body:_}=s,I={method:c,url:f,status_code:d},x={xhr:n.xhr,input:_,startTimestamp:r,endTimestamp:o},E={category:"xhr",data:I,type:"http",level:sn(d)};e.emit("beforeOutgoingRequestBreadcrumb",E,x),Se(E,x)}}function Ju(e){return function(n){if($()!==e)return;let{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){let s=n.fetchData,c={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o},f={category:"fetch",data:s,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",f,c),Se(f,c)}else{let s=n.response,c=P(g({},n.fetchData),{status_code:s?.status});n.fetchData.request_body_size,n.fetchData.response_body_size,s?.status;let f={input:n.args,response:s,startTimestamp:r,endTimestamp:o},d={category:"fetch",data:c,type:"http",level:sn(c.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",d,f),Se(d,f)}}}function Xu(e){return function(n){if($()!==e)return;let r=n.from,o=n.to,s=yt(j.location.href),c=r?yt(r):void 0,f=yt(o);c?.path||(c=s),s.protocol===f.protocol&&s.host===f.host&&(o=f.relative),s.protocol===c.protocol&&s.host===c.host&&(r=c.relative),Se({category:"navigation",data:{from:r,to:o}})}}function Zu(e){return!!e&&!!e.target}var Qu=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],ef="BrowserApiErrors",tf=(e={})=>{let t=g({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1},e);return{name:ef,setupOnce(){t.setTimeout&&V(j,"setTimeout",os),t.setInterval&&V(j,"setInterval",os),t.requestAnimationFrame&&V(j,"requestAnimationFrame",nf),t.XMLHttpRequest&&"XMLHttpRequest"in j&&V(XMLHttpRequest.prototype,"send",rf);let n=t.eventTarget;n&&(Array.isArray(n)?n:Qu).forEach(o=>of(o,t))}}},is=tf;function os(e){return function(...t){let n=t[0];return t[0]=je(n,{mechanism:{data:{function:ue(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function nf(e){return function(t){return e.apply(this,[je(t,{mechanism:{data:{function:"requestAnimationFrame",handler:ue(e)},handled:!1,type:"instrument"}})])}}function rf(e){return function(...t){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&V(n,o,function(s){let c={mechanism:{data:{function:o,handler:ue(s)},handled:!1,type:"instrument"}},f=Ge(s);return f&&(c.mechanism.data.handler=ue(f)),je(s,c)})}),e.apply(this,t)}}function of(e,t){let r=j[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(V(r,"addEventListener",function(o){return function(s,c,f){try{sf(c)&&(c.handleEvent=je(c.handleEvent,{mechanism:{data:{function:"handleEvent",handler:ue(c),target:e},handled:!1,type:"instrument"}}))}catch{}return t.unregisterOriginalCallbacks&&af(this,s,c),o.apply(this,[s,je(c,{mechanism:{data:{function:"addEventListener",handler:ue(c),target:e},handled:!1,type:"instrument"}}),f])}}),V(r,"removeEventListener",function(o){return function(s,c,f){try{let d=c.__sentry_wrapped__;d&&o.call(this,s,d,f)}catch{}return o.call(this,s,c,f)}}))}function sf(e){return typeof e.handleEvent=="function"}function af(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}var ss=()=>({name:"BrowserSession",setupOnce(){if(typeof j.document>"u"){nt&&A.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}gt({ignoreDuration:!0}),ht(),It(({from:e,to:t})=>{e!==void 0&&e!==t&&(gt({ignoreDuration:!0}),ht())})}});var cf="GlobalHandlers",uf=(e={})=>{let t=g({onerror:!0,onunhandledrejection:!0},e);return{name:cf,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(ff(n),as("onerror")),t.onunhandledrejection&&(pf(n),as("onunhandledrejection"))}}},cs=uf;function ff(e){kn(t=>{let{stackParser:n,attachStacktrace:r}=us();if($()!==e||Pr())return;let{msg:o,url:s,line:c,column:f,error:d}=t,_=mf(cn(n,d||o,void 0,r,!1),s,c,f);_.level="error",mt(_,{originalException:d,mechanism:{handled:!1,type:"onerror"}})})}function pf(e){Hn(t=>{let{stackParser:n,attachStacktrace:r}=us();if($()!==e||Pr())return;let o=lf(t),s=He(o)?df(o):cn(n,o,void 0,r,!0);s.level="error",mt(s,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function lf(e){if(He(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function df(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function mf(e,t,n,r){let o=e.exception=e.exception||{},s=o.values=o.values||[],c=s[0]=s[0]||{},f=c.stacktrace=c.stacktrace||{},d=f.frames=f.frames||[],_=r,I=n,x=te(t)&&t.length>0?t:pt();return d.length===0&&d.push({colno:_,filename:x,function:"?",in_app:!0,lineno:I}),e}function as(e){nt&&A.log(`Global Handler attached: ${e}`)}function us(){return $()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var fs=()=>({name:"HttpContext",preprocessEvent(e){if(!j.navigator&&!j.location&&!j.document)return;let t=zi(),n=g(g({},t.headers),e.request?.headers);e.request=P(g(g({},t),e.request),{headers:n})}});var gf="cause",hf=5,_f="LinkedErrors",Ef=(e={})=>{let t=e.limit||hf,n=e.key||gf;return{name:_f,preprocessEvent(r,o,s){let c=s.getOptions();xr(an,c.stackParser,n,t,r,o)}}},ps=Ef;function zr(e){return[rn(),tn(),is(),rs(),cs(),ps(),on(),fs(),ss()]}var ls={},ds,Vr,yf;(()=>{let e=zr({}).filter(t=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(t.name));Vr=new Tt({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:jr,stackParser:Yr,integrations:e,environment:An.mode,release:`web-sdk@${So}`,debug:An.debug,sampleRate:.5}),Vr.init()})();function ms(e,t,n){Nt.error(`${t}:`,e);let r=Tf(n);if(r.setTag("operation",t),e instanceof vo){Sf(r,e,t);return}r.captureException(e)}function Sf(e,t,n){if(vf(e,t),t.response){let r=t.response,o=t.responseText;e.setTag("error.message",t.message),r.status!=null&&e.setTag("http.status_code",r.status),r.statusText&&e.setTag("http.status_text",r.statusText),o&&typeof o=="object"&&"error"in o&&(e.setTag("http.error_code",o.error.code),e.setTag("http.error_message",o.error.message)),e.setExtras({responseText:t.responseText,statusText:r.statusText,responseType:r.type,redirected:r.redirected,responseUrl:r.url,originalError:t.message}),e.captureMessage(`${n} failed with ${r.status}`,"error");return}if(t.request){e.captureMessage(`No response was received for ${n}`,"error");return}}function vf(e,t){let n=t.request;if(!n)return;e.setExtras({body:t.requestBody,headers:n.headers,method:n.method,url:n.url});let r=n.headers?.get("Cooee-Retry-Attempt");r!==null&&e.setTag("retry.attempt",r)}function Tf(e){e??={};let{extra:t,tags:n}=e,r=new Z;if(r.setClient(Vr),r.setUser(yf),e.triggerContext&&!e.engagementTrigger&&(e.engagementTrigger=e.triggerContext.triggerData),e.engagementTrigger){let o=e.engagementTrigger;r.setTags({"engagement.id":o.engagementID,"engagement.short_id":o.shortID,"engagement.objective":o.objective,"engagement.delivery_type":o.onsiteDeliveryType,"engagement.content_id":o.contentID,"engagement.variation":o.variation,"engagement.currency":o.currency})}return t&&r.setExtras(t),n&&r.setTags(n),ds&&r.setTags(ds),Object.keys(ls).forEach(o=>{r.setContext(o,ls[o])}),r.setTag("language",navigator.language),r.setTag("timezone",gs()),If(r),r}function If(e){window.Shopify&&(e.setTag("shopify.shop",window.Shopify.shop),e.setTag("shopify.currency",window.Shopify.currency?.active),e.setTag("shopify.locale",window.Shopify.locale),e.setTag("theme.schema_name",window.Shopify.theme?.schema_name),e.setTag("theme.schema_version",window.Shopify.theme?.schema_version))}var mn=class{static format(t,n){let r=/{{\s*(\w+)\s*}}/;return n.replace(r,(o,s)=>{switch(s){case"amount":return this.formatWithDelimiters(t,2);case"amount_no_decimals":return this.formatWithDelimiters(t,0);case"amount_with_comma_separator":return this.formatWithDelimiters(t,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(t,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(t,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(t,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(t,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(t,2," ",".");default:return o}})}static formatWithDelimiters(t,n=2,r=",",o="."){if(isNaN(t)||t==null)return"0";let c=(t/100).toFixed(n).split("."),f=c[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+r),d=c[1]?o+c[1]:"";return f+d}};function hs(){return window.CooeeSDK.runtimeData}function gy(e,t,n){return{[e]:bf(t,n),[e+"_wo_currency"]:t}}function bf(e,t){if(e==0&&t)return"Free";let n=hs(),r=wt.get(),o=n.shopCurrencyCode||r.currency,s=n.currencyCode;s||Nt.warn("Currency code is not set in RuntimeData");let c=r.money?.format??n.moneyFormat,f;if(c&&o===s)f=mn.format(e*100,c);else{let d;try{d=new Intl.NumberFormat(xf(),{style:"currency",currency:s||o,minimumFractionDigits:0,maximumFractionDigits:2})}catch(_){return ms(_,"format-currency",{extra:{currentCurrency:s,shopCurrency:o}}),""}f=d.format(e),f=f.replace("\u20B9","Rs. "),r.money?.showCurrency&&s!=="INR"&&(f=f.concat(` ${s}`))}return f}function xf(){let e="en";return typeof navigator<"u"&&(navigator.languages!==void 0&&navigator.languages.length>0?e=navigator.languages[0]:navigator.language&&(e=navigator.language)),e=e.split(";")[0],e=e.split("-")[0],e||"en"}var gn;function gs(){if(gn)return gn;try{return gn=Intl.DateTimeFormat().resolvedOptions().timeZone,gn}catch{return""}}function hy(e){let t=document.createElement("span");t.id="snackbar",t.innerText=e,document.body.appendChild(t),t.className="show",setTimeout(()=>{t.classList.remove("show"),document.body.removeChild(t)},5e3)}var _s=class e{sanitizer=_o(yo);transform(t){return t?this.sanitizer.bypassSecurityTrustHtml(t):""}static \u0275fac=function(n){return new(n||e)};static \u0275pipe=Eo({name:"safeHtml",type:e,pure:!0})};function xy(){return window.CooeeSDK?.uaParser.getDevice().type==="mobile"}var Ry=()=>typeof navigator<"u"&&"share"in navigator;export{wt as a,wn as b,ms as c,gy as d,bf as e,hy as f,_s as g,xy as h,Ry as i};
|