wineater-bot 4.2.0 → 4.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wineater-chatbot.mjs +2310 -2221
- package/dist/wineater-chatbot.umd.js +25 -32
- package/package.json +1 -1
- package/src/App.svelte +6 -3
- package/src/components/Footer.svelte +2 -2
- package/src/components/Header.svelte +22 -31
- package/src/components/Loader.svelte +1 -1
- package/src/components/Search.svelte +2 -2
- package/src/components/WineTile.svelte +1 -0
- package/src/components/icons/Budget.svelte +35 -0
- package/src/components/icons/Diamond.svelte +35 -0
- package/src/components/icons/Fish.svelte +56 -0
- package/src/components/icons/Heart.svelte +28 -0
- package/src/components/icons/Meat.svelte +32 -0
- package/src/components/ui/Action.svelte +4 -4
- package/src/services/ui-config/get-config.ts +3 -0
- package/src/services/ui-config/projects-config.ts +7 -13
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(function(te,$){typeof exports=="object"&&typeof module<"u"?module.exports=$():typeof define=="function"&&define.amd?define($):(te=typeof globalThis<"u"?globalThis:te||self,te.WineaterChatbot=$())})(this,function(){"use strict";var Hd=Object.defineProperty;var qd=(te,$,ce)=>$ in te?Hd(te,$,{enumerable:!0,configurable:!0,writable:!0,value:ce}):te[$]=ce;var ut=(te,$,ce)=>(qd(te,typeof $!="symbol"?$+"":$,ce),ce),Tr=(te,$,ce)=>{if(!$.has(te))throw TypeError("Cannot "+ce)};var b=(te,$,ce)=>(Tr(te,$,"read from private field"),ce?ce.call(te):$.get(te)),j=(te,$,ce)=>{if($.has(te))throw TypeError("Cannot add the same private member more than once");$ instanceof WeakSet?$.add(te):$.set(te,ce)},W=(te,$,ce,Mn)=>(Tr(te,$,"write to private field"),Mn?Mn.call(te,ce):$.set(te,ce),ce);var ae=(te,$,ce)=>(Tr(te,$,"access private method"),ce);var Ja,Cn,Nn,Jt,Qt,ts,Rn,Dn,ns,xr,yt,on,ss,Er,Ys,nl,Js,sl,Ue,He,wr,ot,$t,at,qe,De,lt,St,At,Zt,Pt,en,Mt,$s,yr,Vd,Sr,Gd,is,Ir,On,ni,An,si,rs,Cr,Je,ct,Pe,tn,os,as,Zs,Qa,Pn,nn,$a;const te="5";typeof window<"u"&&((Ja=window.__svelte??(window.__svelte={})).v??(Ja.v=new Set)).add(te);const $=1,ce=2,Mn=4,il=8,rl=16,ol=1,al=2,ll=4,cl=8,ul=16,hl=1,fl=2,ye=Symbol(),dl="http://www.w3.org/1999/xhtml",ii=!1;var ri=Array.isArray,pl=Array.prototype.indexOf,oi=Array.from,gl=Object.defineProperty,an=Object.getOwnPropertyDescriptor,ml=Object.getOwnPropertyDescriptors,vl=Object.prototype,bl=Array.prototype,Nr=Object.getPrototypeOf,Rr=Object.isExtensible;function wl(t){for(var e=0;e<t.length;e++)t[e]()}function Dr(){var t,e,n=new Promise((s,i)=>{t=s,e=i});return{promise:n,resolve:t,reject:e}}const be=2,ai=4,li=8,yl=1<<24,ht=16,ft=32,Ft=64,us=128,Ge=512,we=1024,Te=2048,Qe=4096,Oe=8192,dt=16384,ci=32768,ln=65536,Or=1<<17,Ar=1<<18,cn=1<<19,Sl=1<<20,Wt=32768,ui=1<<21,hi=1<<22,kt=1<<23,jt=Symbol("$state"),_l=Symbol("legacy props"),kl=Symbol(""),un=new class extends Error{constructor(){super(...arguments);ut(this,"name","StaleReactionError");ut(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Tl(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function xl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function El(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Il(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Cl(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Nl(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Rl(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Dl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ol(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Al(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Pl(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Ml(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Ll(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Pr(t){return t===this.v}function Bl(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Mr(t){return!Bl(t,this.v)}let Fl=!1,hn=!1,Wl=!1;function jl(){hn=!0}let fe=null;function fn(t){fe=t}function Tt(t,e=!1,n){fe={p:fe,i:!1,c:null,e:null,s:t,x:null,l:hn&&!e?{s:null,u:null,$:[]}:null}}function xt(t){var e=fe,n=e.e;if(n!==null){e.e=null;for(var s of n)Zr(s)}return t!==void 0&&(e.x=t),e.i=!0,fe=e.p,t??{}}function Ln(){return!hn||fe!==null&&fe.l===null}let zt=[];function Lr(){var t=zt;zt=[],wl(t)}function dn(t){if(zt.length===0&&!Bn){var e=zt;queueMicrotask(()=>{e===zt&&Lr()})}zt.push(t)}function zl(){for(;zt.length>0;)Lr()}function Br(t){var e=Q;if(e===null)return G.f|=kt,t;if(e.f&ci)pn(t,e);else{if(!(e.f&us))throw t;e.b.error(t)}}function pn(t,e){for(;e!==null;){if(e.f&us)try{e.b.error(t);return}catch(n){t=n}e=e.parent}throw t}const hs=new Set;let q=null,fs=null,de=null,Le=[],ds=null,fi=!1,Bn=!1;const Qs=class Qs{constructor(){j(this,ns);j(this,yt);j(this,ss);j(this,Ys);j(this,Js);ut(this,"committed",!1);ut(this,"current",new Map);ut(this,"previous",new Map);j(this,Cn,new Set);j(this,Nn,new Set);j(this,Jt,0);j(this,Qt,0);j(this,ts,null);j(this,Rn,[]);j(this,Dn,[]);ut(this,"skipped_effects",new Set);ut(this,"is_fork",!1)}is_deferred(){return this.is_fork||b(this,Qt)>0}process(e){var s;Le=[],fs=null,this.apply();var n={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const i of e)ae(this,ns,xr).call(this,i,n);this.is_fork||ae(this,Ys,nl).call(this),this.is_deferred()?(ae(this,yt,on).call(this,n.effects),ae(this,yt,on).call(this,n.render_effects),ae(this,yt,on).call(this,n.block_effects)):(fs=this,q=null,Fr(n.render_effects),Fr(n.effects),fs=null,(s=b(this,ts))==null||s.resolve()),de=null}capture(e,n){this.previous.has(e)||this.previous.set(e,n),e.f&kt||(this.current.set(e,e.v),de==null||de.set(e,e.v))}activate(){q=this,this.apply()}deactivate(){q===this&&(q=null,de=null)}flush(){if(this.activate(),Le.length>0){if(di(),q!==null&&q!==this)return}else b(this,Jt)===0&&this.process([]);this.deactivate()}discard(){for(const e of b(this,Nn))e(this);b(this,Nn).clear()}increment(e){W(this,Jt,b(this,Jt)+1),e&&W(this,Qt,b(this,Qt)+1)}decrement(e){W(this,Jt,b(this,Jt)-1),e&&W(this,Qt,b(this,Qt)-1),this.revive()}revive(){for(const e of b(this,Rn))Se(e,Te),Ut(e);for(const e of b(this,Dn))Se(e,Qe),Ut(e);W(this,Rn,[]),W(this,Dn,[]),this.flush()}oncommit(e){b(this,Cn).add(e)}ondiscard(e){b(this,Nn).add(e)}settled(){return(b(this,ts)??W(this,ts,Dr())).promise}static ensure(){if(q===null){const e=q=new Qs;hs.add(q),Bn||Qs.enqueue(()=>{q===e&&e.flush()})}return q}static enqueue(e){dn(e)}apply(){}};Cn=new WeakMap,Nn=new WeakMap,Jt=new WeakMap,Qt=new WeakMap,ts=new WeakMap,Rn=new WeakMap,Dn=new WeakMap,ns=new WeakSet,xr=function(e,n){var c;e.f^=we;for(var s=e.first;s!==null;){var i=s.f,r=(i&(ft|Ft))!==0,a=r&&(i&we)!==0,l=a||(i&Oe)!==0||this.skipped_effects.has(s);if(s.f&us&&((c=s.b)!=null&&c.is_pending())&&(n={parent:n,effect:s,effects:[],render_effects:[],block_effects:[]}),!l&&s.fn!==null){r?s.f^=we:i&ai?n.effects.push(s):Vn(s)&&(s.f&ht&&n.block_effects.push(s),Gn(s));var o=s.first;if(o!==null){s=o;continue}}var u=s.parent;for(s=s.next;s===null&&u!==null;)u===n.effect&&(ae(this,yt,on).call(this,n.effects),ae(this,yt,on).call(this,n.render_effects),ae(this,yt,on).call(this,n.block_effects),n=n.parent),s=u.next,u=u.parent}},yt=new WeakSet,on=function(e){for(const n of e)(n.f&Te?b(this,Rn):b(this,Dn)).push(n),ae(this,ss,Er).call(this,n.deps),Se(n,we)},ss=new WeakSet,Er=function(e){if(e!==null)for(const n of e)!(n.f&be)||!(n.f&Wt)||(n.f^=Wt,ae(this,ss,Er).call(this,n.deps))},Ys=new WeakSet,nl=function(){if(b(this,Qt)===0){for(const e of b(this,Cn))e();b(this,Cn).clear()}b(this,Jt)===0&&ae(this,Js,sl).call(this)},Js=new WeakSet,sl=function(){var r;if(hs.size>1){this.previous.clear();var e=de,n=!0,s={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const a of hs){if(a===this){n=!1;continue}const l=[];for(const[u,c]of this.current){if(a.current.has(u))if(n&&c!==a.current.get(u))a.current.set(u,c);else continue;l.push(u)}if(l.length===0)continue;const o=[...a.current.keys()].filter(u=>!this.current.has(u));if(o.length>0){var i=Le;Le=[];const u=new Set,c=new Map;for(const h of l)Wr(h,o,u,c);if(Le.length>0){q=a,a.apply();for(const h of Le)ae(r=a,ns,xr).call(r,h,s);a.deactivate()}Le=i}}q=null,de=e}this.committed=!0,hs.delete(this)};let pt=Qs;function Ul(t){var e=Bn;Bn=!0;try{var n;for(t&&(q!==null&&di(),n=t());;){if(zl(),Le.length===0&&(q==null||q.flush(),Le.length===0))return ds=null,n;di()}}finally{Bn=e}}function di(){var t=It;fi=!0;var e=null;try{var n=0;for(bs(!0);Le.length>0;){var s=pt.ensure();if(n++>1e3){var i,r;Hl()}s.process(Le),Et.clear()}}finally{fi=!1,bs(t),ds=null}}function Hl(){try{Nl()}catch(t){pn(t,ds)}}let Ke=null;function Fr(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var s=t[n++];if(!(s.f&(dt|Oe))&&Vn(s)&&(Ke=new Set,Gn(s),s.deps===null&&s.first===null&&s.nodes_start===null&&(s.teardown===null&&s.ac===null?so(s):s.fn=null),(Ke==null?void 0:Ke.size)>0)){Et.clear();for(const i of Ke){if(i.f&(dt|Oe))continue;const r=[i];let a=i.parent;for(;a!==null;)Ke.has(a)&&(Ke.delete(a),r.push(a)),a=a.parent;for(let l=r.length-1;l>=0;l--){const o=r[l];o.f&(dt|Oe)||Gn(o)}}Ke.clear()}}Ke=null}}function Wr(t,e,n,s){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const i of t.reactions){const r=i.f;r&be?Wr(i,e,n,s):r&(hi|ht)&&!(r&Te)&&jr(i,e,s)&&(Se(i,Te),Ut(i))}}function jr(t,e,n){const s=n.get(t);if(s!==void 0)return s;if(t.deps!==null)for(const i of t.deps){if(e.includes(i))return!0;if(i.f&be&&jr(i,e,n))return n.set(i,!0),!0}return n.set(t,!1),!1}function Ut(t){for(var e=ds=t;e.parent!==null;){e=e.parent;var n=e.f;if(fi&&e===Q&&n&ht&&!(n&Ar))return;if(n&(Ft|ft)){if(!(n&we))return;e.f^=we}}Le.push(e)}function ql(t){let e=0,n=Ht(0),s;return()=>{Un()&&(w(n),wi(()=>(e===0&&(s=Kn(()=>t(()=>jn(n)))),e+=1,()=>{dn(()=>{e-=1,e===0&&(s==null||s(),s=void 0,jn(n))})})))}}var Vl=ln|cn|us;function Gl(t,e,n){new Kl(t,e,n)}class Kl{constructor(e,n,s){j(this,yr);j(this,Sr);j(this,is);j(this,On);j(this,An);j(this,rs);ut(this,"parent");j(this,Ue,!1);j(this,He,void 0);j(this,wr,null);j(this,ot,void 0);j(this,$t,void 0);j(this,at,void 0);j(this,qe,null);j(this,De,null);j(this,lt,null);j(this,St,null);j(this,At,null);j(this,Zt,0);j(this,Pt,0);j(this,en,!1);j(this,Mt,null);j(this,$s,ql(()=>(W(this,Mt,Ht(b(this,Zt))),()=>{W(this,Mt,null)})));W(this,He,e),W(this,ot,n),W(this,$t,s),this.parent=Q.b,W(this,Ue,!!b(this,ot).pending),W(this,at,yi(()=>{Q.b=this;{var i=ae(this,is,Ir).call(this);try{W(this,qe,Be(()=>s(i)))}catch(r){this.error(r)}b(this,Pt)>0?ae(this,An,si).call(this):W(this,Ue,!1)}return()=>{var r;(r=b(this,At))==null||r.remove()}},Vl))}is_pending(){return b(this,Ue)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!b(this,ot).pending}update_pending_count(e){ae(this,rs,Cr).call(this,e),W(this,Zt,b(this,Zt)+e),b(this,Mt)&&gn(b(this,Mt),b(this,Zt))}get_effect_pending(){return b(this,$s).call(this),w(b(this,Mt))}error(e){var n=b(this,ot).onerror;let s=b(this,ot).failed;if(b(this,en)||!n&&!s)throw e;b(this,qe)&&(Ce(b(this,qe)),W(this,qe,null)),b(this,De)&&(Ce(b(this,De)),W(this,De,null)),b(this,lt)&&(Ce(b(this,lt)),W(this,lt,null));var i=!1,r=!1;const a=()=>{if(i){Ll();return}i=!0,r&&Pl(),pt.ensure(),W(this,Zt,0),b(this,lt)!==null&&mn(b(this,lt),()=>{W(this,lt,null)}),W(this,Ue,this.has_pending_snippet()),W(this,qe,ae(this,On,ni).call(this,()=>(W(this,en,!1),Be(()=>b(this,$t).call(this,b(this,He)))))),b(this,Pt)>0?ae(this,An,si).call(this):W(this,Ue,!1)};var l=G;try{Ne(null),r=!0,n==null||n(e,a),r=!1}catch(o){pn(o,b(this,at)&&b(this,at).parent)}finally{Ne(l)}s&&dn(()=>{W(this,lt,ae(this,On,ni).call(this,()=>{pt.ensure(),W(this,en,!0);try{return Be(()=>{s(b(this,He),()=>e,()=>a)})}catch(o){return pn(o,b(this,at).parent),null}finally{W(this,en,!1)}}))})}}Ue=new WeakMap,He=new WeakMap,wr=new WeakMap,ot=new WeakMap,$t=new WeakMap,at=new WeakMap,qe=new WeakMap,De=new WeakMap,lt=new WeakMap,St=new WeakMap,At=new WeakMap,Zt=new WeakMap,Pt=new WeakMap,en=new WeakMap,Mt=new WeakMap,$s=new WeakMap,yr=new WeakSet,Vd=function(){try{W(this,qe,Be(()=>b(this,$t).call(this,b(this,He))))}catch(e){this.error(e)}W(this,Ue,!1)},Sr=new WeakSet,Gd=function(){const e=b(this,ot).pending;e&&(W(this,De,Be(()=>e(b(this,He)))),pt.enqueue(()=>{var n=ae(this,is,Ir).call(this);W(this,qe,ae(this,On,ni).call(this,()=>(pt.ensure(),Be(()=>b(this,$t).call(this,n))))),b(this,Pt)>0?ae(this,An,si).call(this):(mn(b(this,De),()=>{W(this,De,null)}),W(this,Ue,!1))}))},is=new WeakSet,Ir=function(){var e=b(this,He);return b(this,Ue)&&(W(this,At,mt()),b(this,He).before(b(this,At)),e=b(this,At)),e},On=new WeakSet,ni=function(e){var n=Q,s=G,i=fe;Ze(b(this,at)),Ne(b(this,at)),fn(b(this,at).ctx);try{return e()}catch(r){return Br(r),null}finally{Ze(n),Ne(s),fn(i)}},An=new WeakSet,si=function(){const e=b(this,ot).pending;b(this,qe)!==null&&(W(this,St,document.createDocumentFragment()),b(this,St).append(b(this,At)),oo(b(this,qe),b(this,St))),b(this,De)===null&&W(this,De,Be(()=>e(b(this,He))))},rs=new WeakSet,Cr=function(e){var n;if(!this.has_pending_snippet()){this.parent&&ae(n=this.parent,rs,Cr).call(n,e);return}W(this,Pt,b(this,Pt)+e),b(this,Pt)===0&&(W(this,Ue,!1),b(this,De)&&mn(b(this,De),()=>{W(this,De,null)}),b(this,St)&&(b(this,He).before(b(this,St)),W(this,St,null)))};function Fn(t,e){return e}function Xl(t,e,n){for(var s=[],i=e.length,r=0;r<i;r++)Si(e[r].e,s,!0);io(s,()=>{var a=s.length===0&&n!==null;if(a){var l=n,o=l.parentNode;rc(o),o.append(l),t.items.clear(),Xe(t,e[0].prev,e[i-1].next)}for(var u=0;u<i;u++){var c=e[u];a||(t.items.delete(c.k),Xe(t,c.prev,c.next)),Ce(c.e,!a)}t.first===e[0]&&(t.first=e[0].prev)})}function Wn(t,e,n,s,i,r=null){var a=t,l=new Map,o=null,u=(e&Mn)!==0,c=(e&$)!==0,h=(e&ce)!==0;if(u){var f=t;a=f.appendChild(mt())}var d=null,p=gi(()=>{var m=n();return ri(m)?m:m==null?[]:oi(m)}),g,v=!0;function _(){Yl(E,g,a,e,s),d!==null&&(g.length===0?(d.fragment?(a.before(d.fragment),d.fragment=null):_i(d.effect),C.first=d.effect):mn(d.effect,()=>{d=null}))}var C=yi(()=>{g=w(p);for(var m=g.length,y=new Set,T=q,x=null,S=Qr(),k=0;k<m;k+=1){var M=g[k],F=s(M,k),O=v?null:l.get(F);O?(c&&gn(O.v,M),h?gn(O.i,k):O.i=k,S&&T.skipped_effects.delete(O.e)):(O=Jl(v?a:null,x,M,F,k,i,e,n),v&&(O.o=!0,x===null?o=O:x.next=O,x=O),l.set(F,O)),y.add(F)}if(m===0&&r&&!d)if(v)d={fragment:null,effect:Be(()=>r(a))};else{var U=document.createDocumentFragment(),R=mt();U.append(R),d={fragment:U,effect:Be(()=>r(R))}}if(!v)if(S){for(const[A,I]of l)y.has(A)||T.skipped_effects.add(I.e);T.oncommit(_),T.ondiscard(()=>{})}else _();w(p)}),E={effect:C,flags:e,items:l,first:o};v=!1}function Yl(t,e,n,s,i){var F,O,U,R;var r=(s&il)!==0,a=e.length,l=t.items,o=t.first,u,c=null,h,f=[],d=[],p,g,v,_;if(r)for(_=0;_<a;_+=1)p=e[_],g=i(p,_),v=l.get(g),v.o&&((F=v.a)==null||F.measure(),(h??(h=new Set)).add(v));for(_=0;_<a;_+=1){if(p=e[_],g=i(p,_),v=l.get(g),t.first??(t.first=v),!v.o){v.o=!0;var C=c?c.next:o;Xe(t,c,v),Xe(t,v,C),pi(v,C,n),c=v,f=[],d=[],o=c.next;continue}if(v.e.f&Oe&&(_i(v.e),r&&((O=v.a)==null||O.unfix(),(h??(h=new Set)).delete(v))),v!==o){if(u!==void 0&&u.has(v)){if(f.length<d.length){var E=d[0],m;c=E.prev;var y=f[0],T=f[f.length-1];for(m=0;m<f.length;m+=1)pi(f[m],E,n);for(m=0;m<d.length;m+=1)u.delete(d[m]);Xe(t,y.prev,T.next),Xe(t,c,y),Xe(t,T,E),o=E,c=T,_-=1,f=[],d=[]}else u.delete(v),pi(v,o,n),Xe(t,v.prev,v.next),Xe(t,v,c===null?t.first:c.next),Xe(t,c,v),c=v;continue}for(f=[],d=[];o!==null&&o.k!==g;)o.e.f&Oe||(u??(u=new Set)).add(o),d.push(o),o=o.next;if(o===null)continue;v=o}f.push(v),c=v,o=v.next}let x=l.size>a;if(o!==null||u!==void 0){for(var S=u===void 0?[]:oi(u);o!==null;)o.e.f&Oe||S.push(o),o=o.next;var k=S.length;if(x=l.size-k>a,k>0){var M=s&Mn&&a===0?n:null;if(r){for(_=0;_<k;_+=1)(U=S[_].a)==null||U.measure();for(_=0;_<k;_+=1)(R=S[_].a)==null||R.fix()}Xl(t,S,M)}}if(x)for(const A of l.values())A.o||(Xe(t,c,A),c=A);t.effect.last=c&&c.e,r&&dn(()=>{var A;if(h!==void 0)for(v of h)(A=v.a)==null||A.apply()})}function Jl(t,e,n,s,i,r,a,l){var o=(a&$)!==0,u=(a&rl)===0,c=o?u?tc(n,!1,!1):Ht(n):n,h=a&ce?Ht(i):i,f={i:h,v:c,k:s,a:null,e:null,o:!1,prev:e,next:null};try{if(t===null){var d=document.createDocumentFragment();d.append(t=mt())}return f.e=Be(()=>r(t,c,h,l)),e!==null&&(e.next=f),f}finally{}}function pi(t,e,n){for(var s=t.next?t.next.e.nodes_start:n,i=e?e.e.nodes_start:n,r=t.e.nodes_start;r!==null&&r!==s;){var a=zn(r);i.before(r),r=a}}function Xe(t,e,n){e===null?(t.first=n,t.effect.first=n&&n.e):(e.e.next&&(e.e.next.prev=null),e.next=n,e.e.next=n&&n.e),n!==null&&(n.e.prev&&(n.e.prev.next=null),n.prev=e,n.e.prev=e&&e.e)}function Ql(t,e,n,s){const i=Ln()?gs:gi;if(n.length===0&&t.length===0){s(e.map(i));return}var r=q,a=Q,l=$l();function o(){Promise.all(n.map(u=>Zl(u))).then(u=>{l();try{s([...e.map(i),...u])}catch(c){a.f&dt||pn(c,a)}r==null||r.deactivate(),ps()}).catch(u=>{pn(u,a)})}t.length>0?Promise.all(t).then(()=>{l();try{return o()}finally{r==null||r.deactivate(),ps()}}):o()}function $l(){var t=Q,e=G,n=fe,s=q;return function(r=!0){Ze(t),Ne(e),fn(n),r&&(s==null||s.activate())}}function ps(){Ze(null),Ne(null),fn(null)}function gs(t){var e=be|Te,n=G!==null&&G.f&be?G:null;return Q!==null&&(Q.f|=cn),{ctx:fe,deps:null,effects:null,equals:Pr,f:e,fn:t,reactions:null,rv:0,v:ye,wv:0,parent:n??Q,ac:null}}function Zl(t,e){let n=Q;n===null&&xl();var s=n.b,i=void 0,r=Ht(ye),a=!G,l=new Map;return hc(()=>{var f;var o=Dr();i=o.promise;try{Promise.resolve(t()).then(o.resolve,o.reject).then(()=>{u===q&&u.committed&&u.deactivate(),ps()})}catch(d){o.reject(d),ps()}var u=q;if(a){var c=!s.is_pending();s.update_pending_count(1),u.increment(c),(f=l.get(u))==null||f.reject(un),l.delete(u),l.set(u,o)}const h=(d,p=void 0)=>{if(u.activate(),p)p!==un&&(r.f|=kt,gn(r,p));else{r.f&kt&&(r.f^=kt),gn(r,d);for(const[g,v]of l){if(l.delete(g),g===u)break;v.reject(un)}}a&&(s.update_pending_count(-1),u.decrement(c))};o.promise.then(h,d=>h(null,d||"unknown"))}),bi(()=>{for(const o of l.values())o.reject(un)}),new Promise(o=>{function u(c){function h(){c===i?o(r):u(i)}c.then(h,h)}u(i)})}function pe(t){const e=gs(t);return lo(e),e}function gi(t){const e=gs(t);return e.equals=Mr,e}function zr(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)Ce(e[n])}}function ec(t){for(var e=t.parent;e!==null;){if(!(e.f&be))return e.f&dt?null:e;e=e.parent}return null}function mi(t){var e,n=Q;Ze(ec(t));try{t.f&=~Wt,zr(t),e=po(t)}finally{Ze(n)}return e}function Ur(t){var e=mi(t);if(t.equals(e)||(q!=null&&q.is_fork||(t.v=e),t.wv=ho()),!Vt)if(de!==null)(Un()||q!=null&&q.is_fork)&&de.set(t,e);else{var n=t.f&Ge?we:Qe;Se(t,n)}}let vi=new Set;const Et=new Map;let Hr=!1;function Ht(t,e){var n={f:0,v:t,reactions:null,equals:Pr,rv:0,wv:0};return n}function ie(t,e){const n=Ht(t);return lo(n),n}function tc(t,e=!1,n=!0){var i;const s=Ht(t);return e||(s.equals=Mr),hn&&n&&fe!==null&&fe.l!==null&&((i=fe.l).s??(i.s=[])).push(s),s}function L(t,e,n=!1){G!==null&&(!$e||G.f&Or)&&Ln()&&G.f&(be|ht|hi|Or)&&!(xe!=null&&xe.includes(t))&&Al();let s=n?gt(e):e;return gn(t,s)}function gn(t,e){if(!t.equals(e)){var n=t.v;Vt?Et.set(t,e):Et.set(t,n),t.v=e;var s=pt.ensure();s.capture(t,n),t.f&be&&(t.f&Te&&mi(t),Se(t,t.f&Ge?we:Qe)),t.wv=ho(),Vr(t,Te),Ln()&&Q!==null&&Q.f&we&&!(Q.f&(ft|Ft))&&(Fe===null?pc([t]):Fe.push(t)),!s.is_fork&&vi.size>0&&!Hr&&nc()}return e}function nc(){Hr=!1;var t=It;bs(!0);const e=Array.from(vi);try{for(const n of e)n.f&we&&Se(n,Qe),Vn(n)&&Gn(n)}finally{bs(t)}vi.clear()}function qr(t,e=1){var n=w(t),s=e===1?n++:n--;return L(t,n),s}function jn(t){L(t,t.v+1)}function Vr(t,e){var n=t.reactions;if(n!==null)for(var s=Ln(),i=n.length,r=0;r<i;r++){var a=n[r],l=a.f;if(!(!s&&a===Q)){var o=(l&Te)===0;if(o&&Se(a,e),l&be){var u=a;de==null||de.delete(u),l&Wt||(l&Ge&&(a.f|=Wt),Vr(u,Qe))}else o&&(l&ht&&Ke!==null&&Ke.add(a),Ut(a))}}}function gt(t){if(typeof t!="object"||t===null||jt in t)return t;const e=Nr(t);if(e!==vl&&e!==bl)return t;var n=new Map,s=ri(t),i=ie(0),r=Gt,a=l=>{if(Gt===r)return l();var o=G,u=Gt;Ne(null),uo(r);var c=l();return Ne(o),uo(u),c};return s&&n.set("length",ie(t.length)),new Proxy(t,{defineProperty(l,o,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Dl();var c=n.get(o);return c===void 0?c=a(()=>{var h=ie(u.value);return n.set(o,h),h}):L(c,u.value,!0),!0},deleteProperty(l,o){var u=n.get(o);if(u===void 0){if(o in l){const c=a(()=>ie(ye));n.set(o,c),jn(i)}}else L(u,ye),jn(i);return!0},get(l,o,u){var d;if(o===jt)return t;var c=n.get(o),h=o in l;if(c===void 0&&(!h||(d=an(l,o))!=null&&d.writable)&&(c=a(()=>{var p=gt(h?l[o]:ye),g=ie(p);return g}),n.set(o,c)),c!==void 0){var f=w(c);return f===ye?void 0:f}return Reflect.get(l,o,u)},getOwnPropertyDescriptor(l,o){var u=Reflect.getOwnPropertyDescriptor(l,o);if(u&&"value"in u){var c=n.get(o);c&&(u.value=w(c))}else if(u===void 0){var h=n.get(o),f=h==null?void 0:h.v;if(h!==void 0&&f!==ye)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return u},has(l,o){var f;if(o===jt)return!0;var u=n.get(o),c=u!==void 0&&u.v!==ye||Reflect.has(l,o);if(u!==void 0||Q!==null&&(!c||(f=an(l,o))!=null&&f.writable)){u===void 0&&(u=a(()=>{var d=c?gt(l[o]):ye,p=ie(d);return p}),n.set(o,u));var h=w(u);if(h===ye)return!1}return c},set(l,o,u,c){var E;var h=n.get(o),f=o in l;if(s&&o==="length")for(var d=u;d<h.v;d+=1){var p=n.get(d+"");p!==void 0?L(p,ye):d in l&&(p=a(()=>ie(ye)),n.set(d+"",p))}if(h===void 0)(!f||(E=an(l,o))!=null&&E.writable)&&(h=a(()=>ie(void 0)),L(h,gt(u)),n.set(o,h));else{f=h.v!==ye;var g=a(()=>gt(u));L(h,g)}var v=Reflect.getOwnPropertyDescriptor(l,o);if(v!=null&&v.set&&v.set.call(c,u),!f){if(s&&typeof o=="string"){var _=n.get("length"),C=Number(o);Number.isInteger(C)&&C>=_.v&&L(_,C+1)}jn(i)}return!0},ownKeys(l){w(i);var o=Reflect.ownKeys(l).filter(h=>{var f=n.get(h);return f===void 0||f.v!==ye});for(var[u,c]of n)c.v!==ye&&!(u in l)&&o.push(u);return o},setPrototypeOf(){Ol()}})}function Gr(t){try{if(t!==null&&typeof t=="object"&&jt in t)return t[jt]}catch{}return t}function sc(t,e){return Object.is(Gr(t),Gr(e))}var Kr,Xr,Yr,Jr;function ic(){if(Kr===void 0){Kr=window,Xr=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Yr=an(e,"firstChild").get,Jr=an(e,"nextSibling").get,Rr(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Rr(n)&&(n.__t=void 0)}}function mt(t=""){return document.createTextNode(t)}function ms(t){return Yr.call(t)}function zn(t){return Jr.call(t)}function B(t,e){return ms(t)}function qt(t,e=!1){{var n=ms(t);return n instanceof Comment&&n.data===""?zn(n):n}}function Y(t,e=1,n=!1){let s=t;for(;e--;)s=zn(s);return s}function rc(t){t.textContent=""}function Qr(){return!1}let $r=!1;function oc(){$r||($r=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n.__on_r)==null||e.call(n)})},{capture:!0}))}function vs(t){var e=G,n=Q;Ne(null),Ze(null);try{return t()}finally{Ne(e),Ze(n)}}function ac(t,e,n,s=n){t.addEventListener(e,()=>vs(n));const i=t.__on_r;i?t.__on_r=()=>{i(),s(!0)}:t.__on_r=()=>s(!0),oc()}function lc(t){Q===null&&(G===null&&Cl(),Il()),Vt&&El()}function cc(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function vt(t,e,n){var s=Q;s!==null&&s.f&Oe&&(t|=Oe);var i={ctx:fe,deps:null,nodes_start:null,nodes_end:null,f:t|Te|Ge,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(n)try{Gn(i),i.f|=ci}catch(l){throw Ce(i),l}else e!==null&&Ut(i);var r=i;if(n&&r.deps===null&&r.teardown===null&&r.nodes_start===null&&r.first===r.last&&!(r.f&cn)&&(r=r.first,t&ht&&t&ln&&r!==null&&(r.f|=ln)),r!==null&&(r.parent=s,s!==null&&cc(r,s),G!==null&&G.f&be&&!(t&Ft))){var a=G;(a.effects??(a.effects=[])).push(r)}return i}function Un(){return G!==null&&!$e}function bi(t){const e=vt(li,null,!1);return Se(e,we),e.teardown=t,e}function Hn(t){lc();var e=Q.f,n=!G&&(e&ft)!==0&&(e&ci)===0;if(n){var s=fe;(s.e??(s.e=[])).push(t)}else return Zr(t)}function Zr(t){return vt(ai|Sl,t,!1)}function uc(t){pt.ensure();const e=vt(Ft|cn,t,!0);return(n={})=>new Promise(s=>{n.outro?mn(e,()=>{Ce(e),s(void 0)}):(Ce(e),s(void 0))})}function eo(t){return vt(ai,t,!1)}function hc(t){return vt(hi|cn,t,!0)}function wi(t,e=0){return vt(li|e,t,!0)}function Z(t,e=[],n=[],s=[]){Ql(s,e,n,i=>{vt(li,()=>t(...i.map(w)),!0)})}function yi(t,e=0){var n=vt(ht|e,t,!0);return n}function Be(t){return vt(ft|cn,t,!0)}function to(t){var e=t.teardown;if(e!==null){const n=Vt,s=G;ao(!0),Ne(null);try{e.call(null)}finally{ao(n),Ne(s)}}}function no(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&vs(()=>{i.abort(un)});var s=n.next;n.f&Ft?n.parent=null:Ce(n,e),n=s}}function fc(t){for(var e=t.first;e!==null;){var n=e.next;e.f&ft||Ce(e),e=n}}function Ce(t,e=!0){var n=!1;(e||t.f&Ar)&&t.nodes_start!==null&&t.nodes_end!==null&&(dc(t.nodes_start,t.nodes_end),n=!0),no(t,e&&!n),ws(t,0),Se(t,dt);var s=t.transitions;if(s!==null)for(const r of s)r.stop();to(t);var i=t.parent;i!==null&&i.first!==null&&so(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function dc(t,e){for(;t!==null;){var n=t===e?null:zn(t);t.remove(),t=n}}function so(t){var e=t.parent,n=t.prev,s=t.next;n!==null&&(n.next=s),s!==null&&(s.prev=n),e!==null&&(e.first===t&&(e.first=s),e.last===t&&(e.last=n))}function mn(t,e,n=!0){var s=[];Si(t,s,!0),io(s,()=>{n&&Ce(t),e&&e()})}function io(t,e){var n=t.length;if(n>0){var s=()=>--n||e();for(var i of t)i.out(s)}else e()}function Si(t,e,n){if(!(t.f&Oe)){if(t.f^=Oe,t.transitions!==null)for(const a of t.transitions)(a.is_global||n)&&e.push(a);for(var s=t.first;s!==null;){var i=s.next,r=(s.f&ln)!==0||(s.f&ft)!==0&&(t.f&ht)!==0;Si(s,e,r?n:!1),s=i}}}function _i(t){ro(t,!0)}function ro(t,e){if(t.f&Oe){t.f^=Oe,t.f&we||(Se(t,Te),Ut(t));for(var n=t.first;n!==null;){var s=n.next,i=(n.f&ln)!==0||(n.f&ft)!==0;ro(n,i?e:!1),n=s}if(t.transitions!==null)for(const r of t.transitions)(r.is_global||e)&&r.in()}}function oo(t,e){for(var n=t.nodes_start,s=t.nodes_end;n!==null;){var i=n===s?null:zn(n);e.append(n),n=i}}let It=!1;function bs(t){It=t}let Vt=!1;function ao(t){Vt=t}let G=null,$e=!1;function Ne(t){G=t}let Q=null;function Ze(t){Q=t}let xe=null;function lo(t){G!==null&&!Fl&&(xe===null?xe=[t]:xe.push(t))}let Ee=null,Ae=0,Fe=null;function pc(t){Fe=t}let co=1,qn=0,Gt=qn;function uo(t){Gt=t}function ho(){return++co}function Vn(t){var e=t.f;if(e&Te)return!0;if(e&be&&(t.f&=~Wt),e&Qe){var n=t.deps;if(n!==null)for(var s=n.length,i=0;i<s;i++){var r=n[i];if(Vn(r)&&Ur(r),r.wv>t.wv)return!0}e&Ge&&de===null&&Se(t,we)}return!1}function fo(t,e,n=!0){var s=t.reactions;if(s!==null&&!(xe!=null&&xe.includes(t)))for(var i=0;i<s.length;i++){var r=s[i];r.f&be?fo(r,e,!1):e===r&&(n?Se(r,Te):r.f&we&&Se(r,Qe),Ut(r))}}function po(t){var p;var e=Ee,n=Ae,s=Fe,i=G,r=xe,a=fe,l=$e,o=Gt,u=t.f;Ee=null,Ae=0,Fe=null,G=u&(ft|Ft)?null:t,xe=null,fn(t.ctx),$e=!1,Gt=++qn,t.ac!==null&&(vs(()=>{t.ac.abort(un)}),t.ac=null);try{t.f|=ui;var c=t.fn,h=c(),f=t.deps;if(Ee!==null){var d;if(ws(t,Ae),f!==null&&Ae>0)for(f.length=Ae+Ee.length,d=0;d<Ee.length;d++)f[Ae+d]=Ee[d];else t.deps=f=Ee;if(It&&Un()&&t.f&Ge)for(d=Ae;d<f.length;d++)((p=f[d]).reactions??(p.reactions=[])).push(t)}else f!==null&&Ae<f.length&&(ws(t,Ae),f.length=Ae);if(Ln()&&Fe!==null&&!$e&&f!==null&&!(t.f&(be|Qe|Te)))for(d=0;d<Fe.length;d++)fo(Fe[d],t);return i!==null&&i!==t&&(qn++,Fe!==null&&(s===null?s=Fe:s.push(...Fe))),t.f&kt&&(t.f^=kt),h}catch(g){return Br(g)}finally{t.f^=ui,Ee=e,Ae=n,Fe=s,G=i,xe=r,fn(a),$e=l,Gt=o}}function gc(t,e){let n=e.reactions;if(n!==null){var s=pl.call(n,t);if(s!==-1){var i=n.length-1;i===0?n=e.reactions=null:(n[s]=n[i],n.pop())}}n===null&&e.f&be&&(Ee===null||!Ee.includes(e))&&(Se(e,Qe),e.f&Ge&&(e.f^=Ge,e.f&=~Wt),zr(e),ws(e,0))}function ws(t,e){var n=t.deps;if(n!==null)for(var s=e;s<n.length;s++)gc(t,n[s])}function Gn(t){var e=t.f;if(!(e&dt)){Se(t,we);var n=Q,s=It;Q=t,It=!0;try{e&(ht|yl)?fc(t):no(t),to(t);var i=po(t);t.teardown=typeof i=="function"?i:null,t.wv=co;var r;ii&&Wl&&t.f&Te&&t.deps}finally{It=s,Q=n}}}async function mc(){await Promise.resolve(),Ul()}function w(t){var e=t.f,n=(e&be)!==0;if(G!==null&&!$e){var s=Q!==null&&(Q.f&dt)!==0;if(!s&&!(xe!=null&&xe.includes(t))){var i=G.deps;if(G.f&ui)t.rv<qn&&(t.rv=qn,Ee===null&&i!==null&&i[Ae]===t?Ae++:Ee===null?Ee=[t]:Ee.includes(t)||Ee.push(t));else{(G.deps??(G.deps=[])).push(t);var r=t.reactions;r===null?t.reactions=[G]:r.includes(G)||r.push(G)}}}if(Vt){if(Et.has(t))return Et.get(t);if(n){var a=t,l=a.v;return(!(a.f&we)&&a.reactions!==null||mo(a))&&(l=mi(a)),Et.set(a,l),l}}else n&&(!(de!=null&&de.has(t))||q!=null&&q.is_fork&&!Un())&&(a=t,Vn(a)&&Ur(a),It&&Un()&&!(a.f&Ge)&&go(a));if(de!=null&&de.has(t))return de.get(t);if(t.f&kt)throw t.v;return t.v}function go(t){if(t.deps!==null){t.f^=Ge;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&be&&!(e.f&Ge)&&go(e)}}function mo(t){if(t.v===ye)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Et.has(e)||e.f&be&&mo(e))return!0;return!1}function Kn(t){var e=$e;try{return $e=!0,t()}finally{$e=e}}const vc=~(Te|Qe|we);function Se(t,e){t.f=t.f&vc|e}const vo=new Set,ki=new Set;function bc(t,e,n,s={}){function i(r){if(s.capture||Yn.call(e,r),!r.cancelBubble)return vs(()=>n==null?void 0:n.call(this,r))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?dn(()=>{e.addEventListener(t,i,s)}):e.addEventListener(t,i,s),i}function Xn(t,e,n,s,i){var r={capture:s,passive:i},a=bc(t,e,n,r);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&bi(()=>{e.removeEventListener(t,a,r)})}function ys(t){for(var e=0;e<t.length;e++)vo.add(t[e]);for(var n of ki)n(t)}let bo=null;function Yn(t){var v;var e=this,n=e.ownerDocument,s=t.type,i=((v=t.composedPath)==null?void 0:v.call(t))||[],r=i[0]||t.target;bo=t;var a=0,l=bo===t&&t.__root;if(l){var o=i.indexOf(l);if(o!==-1&&(e===document||e===window)){t.__root=e;return}var u=i.indexOf(e);if(u===-1)return;o<=u&&(a=o)}if(r=i[a]||t.target,r!==e){gl(t,"currentTarget",{configurable:!0,get(){return r||n}});var c=G,h=Q;Ne(null),Ze(null);try{for(var f,d=[];r!==null;){var p=r.assignedSlot||r.parentNode||r.host||null;try{var g=r["__"+s];g!=null&&(!r.disabled||t.target===r)&&g.call(r,t)}catch(_){f?d.push(_):f=_}if(t.cancelBubble||p===e||p===null)break;r=p}if(f){for(let _ of d)queueMicrotask(()=>{throw _});throw f}}finally{t.__root=e,delete t.currentTarget,Ne(c),Ze(h)}}}function wc(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Ss(t,e){var n=Q;n.nodes_start===null&&(n.nodes_start=t,n.nodes_end=e)}function X(t,e){var n=(e&hl)!==0,s=(e&fl)!==0,i,r=!t.startsWith("<!>");return()=>{i===void 0&&(i=wc(r?t:"<!>"+t),n||(i=ms(i)));var a=s||Xr?document.importNode(i,!0):i.cloneNode(!0);if(n){var l=ms(a),o=a.lastChild;Ss(l,o)}else Ss(a,a);return a}}function Ti(t=""){{var e=mt(t+"");return Ss(e,e),e}}function vn(){var t=document.createDocumentFragment(),e=document.createComment(""),n=mt();return t.append(e,n),Ss(e,n),t}function z(t,e){t!==null&&t.before(e)}const yc=["touchstart","touchmove"];function Sc(t){return yc.includes(t)}function ee(t,e){var n=e==null?"":typeof e=="object"?e+"":e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=n+"")}function _c(t,e){return kc(t,e)}const bn=new Map;function kc(t,{target:e,anchor:n,props:s={},events:i,context:r,intro:a=!0}){ic();var l=new Set,o=h=>{for(var f=0;f<h.length;f++){var d=h[f];if(!l.has(d)){l.add(d);var p=Sc(d);e.addEventListener(d,Yn,{passive:p});var g=bn.get(d);g===void 0?(document.addEventListener(d,Yn,{passive:p}),bn.set(d,1)):bn.set(d,g+1)}}};o(oi(vo)),ki.add(o);var u=void 0,c=uc(()=>{var h=n??e.appendChild(mt());return Gl(h,{pending:()=>{}},f=>{if(r){Tt({});var d=fe;d.c=r}i&&(s.$$events=i),u=t(f,s)||{},r&&xt()}),()=>{var p;for(var f of l){e.removeEventListener(f,Yn);var d=bn.get(f);--d===0?(document.removeEventListener(f,Yn),bn.delete(f)):bn.set(f,d)}ki.delete(o),h!==n&&((p=h.parentNode)==null||p.removeChild(h))}});return Tc.set(u,c),u}let Tc=new WeakMap;class xc{constructor(e,n=!0){ut(this,"anchor");j(this,Je,new Map);j(this,ct,new Map);j(this,Pe,new Map);j(this,tn,new Set);j(this,os,!0);j(this,as,()=>{var e=q;if(b(this,Je).has(e)){var n=b(this,Je).get(e),s=b(this,ct).get(n);if(s)_i(s),b(this,tn).delete(n);else{var i=b(this,Pe).get(n);i&&(b(this,ct).set(n,i.effect),b(this,Pe).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),s=i.effect)}for(const[r,a]of b(this,Je)){if(b(this,Je).delete(r),r===e)break;const l=b(this,Pe).get(a);l&&(Ce(l.effect),b(this,Pe).delete(a))}for(const[r,a]of b(this,ct)){if(r===n||b(this,tn).has(r))continue;const l=()=>{if(Array.from(b(this,Je).values()).includes(r)){var u=document.createDocumentFragment();oo(a,u),u.append(mt()),b(this,Pe).set(r,{effect:a,fragment:u})}else Ce(a);b(this,tn).delete(r),b(this,ct).delete(r)};b(this,os)||!s?(b(this,tn).add(r),mn(a,l,!1)):l()}}});j(this,Zs,e=>{b(this,Je).delete(e);const n=Array.from(b(this,Je).values());for(const[s,i]of b(this,Pe))n.includes(s)||(Ce(i.effect),b(this,Pe).delete(s))});this.anchor=e,W(this,os,n)}ensure(e,n){var s=q,i=Qr();if(n&&!b(this,ct).has(e)&&!b(this,Pe).has(e))if(i){var r=document.createDocumentFragment(),a=mt();r.append(a),b(this,Pe).set(e,{effect:Be(()=>n(a)),fragment:r})}else b(this,ct).set(e,Be(()=>n(this.anchor)));if(b(this,Je).set(s,e),i){for(const[l,o]of b(this,ct))l===e?s.skipped_effects.delete(o):s.skipped_effects.add(o);for(const[l,o]of b(this,Pe))l===e?s.skipped_effects.delete(o.effect):s.skipped_effects.add(o.effect);s.oncommit(b(this,as)),s.ondiscard(b(this,Zs))}else b(this,as).call(this)}}Je=new WeakMap,ct=new WeakMap,Pe=new WeakMap,tn=new WeakMap,os=new WeakMap,as=new WeakMap,Zs=new WeakMap;function xi(t){fe===null&&Tl(),hn&&fe.l!==null?Ec(fe).m.push(t):Hn(()=>{const e=Kn(t);if(typeof e=="function")return e})}function Ec(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function ne(t,e,n=!1){var s=new xc(t),i=n?ln:0;function r(a,l){s.ensure(a,l)}yi(()=>{var a=!1;e((l,o=!0)=>{a=!0,r(o,l)}),a||r(!1,null)},i)}function wo(t,e,n,s,i){var l;var r=(l=e.$$slots)==null?void 0:l[n],a=!1;r===!0&&(r=e[n==="default"?"children":n],a=!0),r===void 0?i!==null&&i(t):r(t,a?()=>s:s)}function Ct(t,e){eo(()=>{var n=t.getRootNode(),s=n.host?n:n.head??n.ownerDocument.head;if(!s.querySelector("#"+e.hash)){const i=document.createElement("style");i.id=e.hash,i.textContent=e.code,s.appendChild(i)}})}function yo(t){var e,n,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=yo(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function Ic(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=yo(t))&&(s&&(s+=" "),s+=e);return s}function So(t){return typeof t=="object"?Ic(t):t??""}const _o=[...`
|
|
2
|
-
\r\f \v\uFEFF`];function Cc(t,e,n){var s=t==null?"":""+t;if(e&&(s=s?s+" "+e:e),n){for(var i in n)if(n[i])s=s?s+" "+i:i;else if(s.length)for(var r=i.length,a=0;(a=s.indexOf(i,a))>=0;){var l=a+r;(a===0||_o.includes(s[a-1]))&&(l===s.length||_o.includes(s[l]))?s=(a===0?"":s.substring(0,a))+s.substring(l+1):a=l}}return s===""?null:s}function _s(t,e,n,s,i,r){var a=t.__className;if(a!==n||a===void 0){var l=Cc(n,s,r);l==null?t.removeAttribute("class"):e?t.className=l:t.setAttribute("class",l),t.__className=n}else if(r&&i!==r)for(var o in r){var u=!!r[o];(i==null||u!==!!i[o])&&t.classList.toggle(o,u)}return r}function ko(t,e,n=!1){if(t.multiple){if(e==null)return;if(!ri(e))return Ml();for(var s of t.options)s.selected=e.includes(To(s));return}for(s of t.options){var i=To(s);if(sc(i,e)){s.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function Nc(t){var e=new MutationObserver(()=>{ko(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),bi(()=>{e.disconnect()})}function To(t){return"__value"in t?t.__value:t.value}const Rc=Symbol("is custom element"),Dc=Symbol("is html");function Oc(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function bt(t,e,n,s){var i=Ac(t);i[e]!==(i[e]=n)&&(e==="loading"&&(t[kl]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Pc(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function Ac(t){return t.__attributes??(t.__attributes={[Rc]:t.nodeName.includes("-"),[Dc]:t.namespaceURI===dl})}var xo=new Map;function Pc(t){var e=t.getAttribute("is")||t.nodeName,n=xo.get(e);if(n)return n;xo.set(e,n=[]);for(var s,i=t,r=Element.prototype;r!==i;){s=ml(i);for(var a in s)s[a].set&&n.push(a);i=Nr(i)}return n}function Mc(t,e,n=e){var s=new WeakSet;ac(t,"input",async i=>{var r=i?t.defaultValue:t.value;if(r=Ei(t)?Ii(r):r,n(r),q!==null&&s.add(q),await mc(),r!==(r=e())){var a=t.selectionStart,l=t.selectionEnd,o=t.value.length;if(t.value=r??"",l!==null){var u=t.value.length;a===l&&l===o&&u>o?(t.selectionStart=u,t.selectionEnd=u):(t.selectionStart=a,t.selectionEnd=Math.min(l,u))}}}),Kn(e)==null&&t.value&&(n(Ei(t)?Ii(t.value):t.value),q!==null&&s.add(q)),wi(()=>{var i=e();if(t===document.activeElement){var r=fs??q;if(s.has(r))return}Ei(t)&&i===Ii(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function Ei(t){var e=t.type;return e==="number"||e==="range"}function Ii(t){return t===""?null:+t}function Eo(t,e){return t===e||(t==null?void 0:t[jt])===e}function Lc(t={},e,n,s){return eo(()=>{var i,r;return wi(()=>{i=r,r=(s==null?void 0:s())||[],Kn(()=>{t!==n(...r)&&(e(t,...r),i&&Eo(n(...i),t)&&e(null,...i))})}),()=>{dn(()=>{r&&Eo(n(...r),t)&&e(null,...r)})}}),t}let ks=!1;function Bc(t){var e=ks;try{return ks=!1,[t(),ks]}finally{ks=e}}function Jn(t,e,n,s){var E;var i=!hn||(n&al)!==0,r=(n&cl)!==0,a=(n&ul)!==0,l=s,o=!0,u=()=>(o&&(o=!1,l=a?Kn(s):s),l),c;if(r){var h=jt in t||_l in t;c=((E=an(t,e))==null?void 0:E.set)??(h&&e in t?m=>t[e]=m:void 0)}var f,d=!1;r?[f,d]=Bc(()=>t[e]):f=t[e],f===void 0&&s!==void 0&&(f=u(),c&&(i&&Rl(),c(f)));var p;if(i?p=()=>{var m=t[e];return m===void 0?u():(o=!0,m)}:p=()=>{var m=t[e];return m!==void 0&&(l=void 0),m===void 0?l:m},i&&!(n&ll))return p;if(c){var g=t.$$legacy;return function(m,y){return arguments.length>0?((!i||!y||g||d)&&c(y?p():m),m):p()}}var v=!1,_=(n&ol?gs:gi)(()=>(v=!1,p()));r&&w(_);var C=Q;return function(m,y){if(arguments.length>0){const T=y?w(_):i&&r?gt(m):m;return L(_,T),v=!0,l!==void 0&&(l=T),m}return Vt&&v||C.f&dt?_.v:w(_)}}function Io(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Ci(t,e,n){let s="";if(n){const i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3),s="; expires="+i.toUTCString()}document.cookie=t+"="+(e||"")+s+"; path=/; secure; samesite=strict"}function Ni(t){const e=t+"=",n=document.cookie.split(";");for(let s=0;s<n.length;s++){let i=n[s];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null}function Co(){const t="uniqueUserID";let e=Ni(t);return e||(e=Io(),Ci(t,e,365)),e}function et(t,e,n={},s={}){const i="https://admin-api.wineater.com/api/widget-events";let r=Ni("uniqueUserID");r||(r=Co());const a={user_agent:navigator.userAgent,screen_width:window.screen.width,screen_height:window.screen.height,language:navigator.language,platform:navigator.platform},l=new Date().toISOString();let o=Ni("sessionID");o||(o=Io(),Ci("sessionID",o,1));const u={event_type:t,store_id:e,session_id:o,event_time:l,data:n,meta:{...s,user_id:r},device_info:a,region:navigator.language.split("-")[1]||null,language:navigator.language.split("-")[0]||"en"};return fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)}).then(c=>c.ok?c.json():c.json().then(h=>{throw new Error(h.message||"Failed to track widget event")})).catch(c=>{throw console.error("Widget event tracking error:",c),c})}var No={},Fc=function(t,e,n,s,i){var r=new Worker(No[e]||(No[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return r.onmessage=function(a){var l=a.data,o=l.$e$;if(o){var u=new Error(o[0]);u.code=o[1],u.stack=o[2],i(u,null)}else i(null,l)},r.postMessage(n,s),r},We=Uint8Array,Re=Uint16Array,Ts=Int32Array,xs=new We([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Es=new We([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ri=new We([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ro=function(t,e){for(var n=new Re(31),s=0;s<31;++s)n[s]=e+=1<<t[s-1];for(var i=new Ts(n[30]),s=1;s<30;++s)for(var r=n[s];r<n[s+1];++r)i[r]=r-n[s]<<5|s;return{b:n,r:i}},Do=Ro(xs,2),Wc=Do.b,Is=Do.r;Wc[28]=258,Is[258]=28;for(var jc=Ro(Es,0),Di=jc.r,Cs=new Re(32768),se=0;se<32768;++se){var Nt=(se&43690)>>1|(se&21845)<<1;Nt=(Nt&52428)>>2|(Nt&13107)<<2,Nt=(Nt&61680)>>4|(Nt&3855)<<4,Cs[se]=((Nt&65280)>>8|(Nt&255)<<8)>>1}for(var wn=function(t,e,n){for(var s=t.length,i=0,r=new Re(e);i<s;++i)t[i]&&++r[t[i]-1];var a=new Re(e);for(i=1;i<e;++i)a[i]=a[i-1]+r[i-1]<<1;var l;if(n){l=new Re(1<<e);var o=15-e;for(i=0;i<s;++i)if(t[i])for(var u=i<<4|t[i],c=e-t[i],h=a[t[i]-1]++<<c,f=h|(1<<c)-1;h<=f;++h)l[Cs[h]>>o]=u}else for(l=new Re(s),i=0;i<s;++i)t[i]&&(l[i]=Cs[a[t[i]-1]++]>>15-t[i]);return l},Rt=new We(288),se=0;se<144;++se)Rt[se]=8;for(var se=144;se<256;++se)Rt[se]=9;for(var se=256;se<280;++se)Rt[se]=7;for(var se=280;se<288;++se)Rt[se]=8;for(var Qn=new We(32),se=0;se<32;++se)Qn[se]=5;var Oo=wn(Rt,9,0),Ao=wn(Qn,5,0),Oi=function(t){return(t+7)/8|0},Po=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new We(t.subarray(e,n))},zc=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Mo=function(t,e,n){var s=new Error(e||zc[t]);if(s.code=t,Error.captureStackTrace&&Error.captureStackTrace(s,Mo),!n)throw s;return s},tt=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8},yn=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8,t[s+2]|=n>>16},Ns=function(t,e){for(var n=[],s=0;s<t.length;++s)t[s]&&n.push({s,f:t[s]});var i=n.length,r=n.slice();if(!i)return{t:Li,l:0};if(i==1){var a=new We(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(y,T){return y.f-T.f}),n.push({s:-1,f:25001});var l=n[0],o=n[1],u=0,c=1,h=2;for(n[0]={s:-1,f:l.f+o.f,l,r:o};c!=i-1;)l=n[n[u].f<n[h].f?u++:h++],o=n[u!=c&&n[u].f<n[h].f?u++:h++],n[c++]={s:-1,f:l.f+o.f,l,r:o};for(var f=r[0].s,s=1;s<i;++s)r[s].s>f&&(f=r[s].s);var d=new Re(f+1),p=Rs(n[c-1],d,0);if(p>e){var s=0,g=0,v=p-e,_=1<<v;for(r.sort(function(T,x){return d[x.s]-d[T.s]||T.f-x.f});s<i;++s){var C=r[s].s;if(d[C]>e)g+=_-(1<<p-d[C]),d[C]=e;else break}for(g>>=v;g>0;){var E=r[s].s;d[E]<e?g-=1<<e-d[E]++-1:++s}for(;s>=0&&g;--s){var m=r[s].s;d[m]==e&&(--d[m],++g)}p=e}return{t:new We(d),l:p}},Rs=function(t,e,n){return t.s==-1?Math.max(Rs(t.l,e,n+1),Rs(t.r,e,n+1)):e[t.s]=n},Ai=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Re(++e),s=0,i=t[0],r=1,a=function(o){n[s++]=o},l=1;l<=e;++l)if(t[l]==i&&l!=e)++r;else{if(!i&&r>2){for(;r>138;r-=138)a(32754);r>2&&(a(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(a(i),--r;r>6;r-=6)a(8304);r>2&&(a(r-3<<5|8208),r=0)}for(;r--;)a(i);r=1,i=t[l]}return{c:n.subarray(0,s),n:e}},Sn=function(t,e){for(var n=0,s=0;s<e.length;++s)n+=t[s]*e[s];return n},Pi=function(t,e,n){var s=n.length,i=Oi(e+2);t[i]=s&255,t[i+1]=s>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var r=0;r<s;++r)t[i+r+4]=n[r];return(i+4+s)*8},Mi=function(t,e,n,s,i,r,a,l,o,u,c){tt(e,c++,n),++i[256];for(var h=Ns(i,15),f=h.t,d=h.l,p=Ns(r,15),g=p.t,v=p.l,_=Ai(f),C=_.c,E=_.n,m=Ai(g),y=m.c,T=m.n,x=new Re(19),S=0;S<C.length;++S)++x[C[S]&31];for(var S=0;S<y.length;++S)++x[y[S]&31];for(var k=Ns(x,7),M=k.t,F=k.l,O=19;O>4&&!M[Ri[O-1]];--O);var U=u+5<<3,R=Sn(i,Rt)+Sn(r,Qn)+a,A=Sn(i,f)+Sn(r,g)+a+14+3*O+Sn(x,M)+2*x[16]+3*x[17]+7*x[18];if(o>=0&&U<=R&&U<=A)return Pi(e,c,t.subarray(o,o+u));var I,D,P,H;if(tt(e,c,1+(A<R)),c+=2,A<R){I=wn(f,d,0),D=f,P=wn(g,v,0),H=g;var Ie=wn(M,F,0);tt(e,c,E-257),tt(e,c+5,T-1),tt(e,c+10,O-4),c+=14;for(var S=0;S<O;++S)tt(e,c+3*S,M[Ri[S]]);c+=3*O;for(var J=[C,y],ke=0;ke<2;++ke)for(var ue=J[ke],S=0;S<ue.length;++S){var re=ue[S]&31;tt(e,c,Ie[re]),c+=M[re],re>15&&(tt(e,c,ue[S]>>5&127),c+=ue[S]>>12)}}else I=Oo,D=Rt,P=Ao,H=Qn;for(var S=0;S<l;++S){var N=s[S];if(N>255){var re=N>>18&31;yn(e,c,I[re+257]),c+=D[re+257],re>7&&(tt(e,c,N>>23&31),c+=xs[re]);var K=N&31;yn(e,c,P[K]),c+=H[K],K>3&&(yn(e,c,N>>5&8191),c+=Es[K])}else yn(e,c,I[N]),c+=D[N]}return yn(e,c,I[256]),c+D[256]},Lo=new Ts([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Li=new We(0),Bo=function(t,e,n,s,i,r){var a=r.z||t.length,l=new We(s+a+5*(1+Math.ceil(a/7e3))+i),o=l.subarray(s,l.length-i),u=r.l,c=(r.r||0)&7;if(e){c&&(o[0]=r.r>>3);for(var h=Lo[e-1],f=h>>13,d=h&8191,p=(1<<n)-1,g=r.p||new Re(32768),v=r.h||new Re(p+1),_=Math.ceil(n/3),C=2*_,E=function(rn){return(t[rn]^t[rn+1]<<_^t[rn+2]<<C)&p},m=new Ts(25e3),y=new Re(288),T=new Re(32),x=0,S=0,k=r.i||0,M=0,F=r.w||0,O=0;k+2<a;++k){var U=E(k),R=k&32767,A=v[U];if(g[R]=A,v[U]=R,F<=k){var I=a-k;if((x>7e3||M>24576)&&(I>423||!u)){c=Mi(t,o,0,m,y,T,S,M,O,k-O,c),M=x=S=0,O=k;for(var D=0;D<286;++D)y[D]=0;for(var D=0;D<30;++D)T[D]=0}var P=2,H=0,Ie=d,J=R-A&32767;if(I>2&&U==E(k-J))for(var ke=Math.min(f,I)-1,ue=Math.min(32767,k),re=Math.min(258,I);J<=ue&&--Ie&&R!=A;){if(t[k+P]==t[k+P-J]){for(var N=0;N<re&&t[k+N]==t[k+N-J];++N);if(N>P){if(P=N,H=J,N>ke)break;for(var K=Math.min(J,N-2),he=0,D=0;D<K;++D){var _t=k-J+D&32767,sn=g[_t],Lt=_t-sn&32767;Lt>he&&(he=Lt,A=_t)}}}R=A,A=g[R],J+=R-A&32767}if(H){m[M++]=268435456|Is[P]<<18|Di[H];var Ve=Is[P]&31,ls=Di[H]&31;S+=xs[Ve]+Es[ls],++y[257+Ve],++T[ls],F=k+P,++x}else m[M++]=t[k],++y[t[k]]}}for(k=Math.max(k,F);k<a;++k)m[M++]=t[k],++y[t[k]];c=Mi(t,o,u,m,y,T,S,M,O,k-O,c),u||(r.r=c&7|o[c/8|0]<<3,c-=7,r.h=v,r.p=g,r.i=k,r.w=F)}else{for(var k=r.w||0;k<a+u;k+=65535){var Bt=k+65535;Bt>=a&&(o[c/8|0]=u,Bt=a),c=Pi(o,c+1,t.subarray(k,Bt))}r.i=a}return Po(l,0,s+Oi(c)+i)},Fo=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,s=9;--s;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t}(),Wo=function(){var t=-1;return{p:function(e){for(var n=t,s=0;s<e.length;++s)n=Fo[n&255^e[s]]^n>>>8;t=n},d:function(){return~t}}},Bi=function(t,e,n,s,i){if(!i&&(i={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),a=new We(r.length+t.length);a.set(r),a.set(t,r.length),t=a,i.w=r.length}return Bo(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,s,i)},Uc=function(t,e){var n={};for(var s in t)n[s]=t[s];for(var s in e)n[s]=e[s];return n},jo=function(t,e,n){for(var s=t(),i=t.toString(),r=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<s.length;++a){var l=s[a],o=r[a];if(typeof l=="function"){e+=";"+o+"=";var u=l.toString();if(l.prototype)if(u.indexOf("[native code]")!=-1){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else{e+=u;for(var h in l.prototype)e+=";"+o+".prototype."+h+"="+l.prototype[h].toString()}else e+=u}else n[o]=l}return e},Ds=[],Hc=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},qc=function(t,e,n,s){if(!Ds[n]){for(var i="",r={},a=t.length-1,l=0;l<a;++l)i=jo(t[l],i,r);Ds[n]={c:jo(t[a],i,r),e:r}}var o=Uc({},Ds[n].e);return Fc(Ds[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,o,Hc(o),s)},Vc=function(){return[We,Re,Ts,xs,Es,Ri,Is,Di,Oo,Rt,Ao,Qn,Cs,Lo,Li,wn,tt,yn,Ns,Rs,Ai,Sn,Pi,Mi,Oi,Po,Bo,Bi,Xc,zo]},Gc=function(){return[Uo,Ho,Os,Wo,Fo]},zo=function(t){return postMessage(t,[t.buffer])},Kc=function(t,e,n,s,i,r){var a=qc(n,s,i,function(l,o){a.terminate(),r(l,o)});return a.postMessage([t,e],e.consume?[t.buffer]:[]),function(){a.terminate()}},Os=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},Uo=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&Os(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var s=0;s<=n.length;++s)t[s+10]=n.charCodeAt(s)}},Ho=function(t){return 10+(t.filename?t.filename.length+1:0)};function Xc(t,e){return Bi(t,e||{},0,0)}function Yc(t,e,n){return n||(n=e,e={}),typeof n!="function"&&Mo(7),Kc(t,e,[Vc,Gc,function(){return[qo]}],function(s){return zo(qo(s.data[0],s.data[1]))},2,n)}function qo(t,e){e||(e={});var n=Wo(),s=t.length;n.p(t);var i=Bi(t,e,Ho(e),8),r=i.length;return Uo(i,e),Os(i,r-8,n.d()),Os(i,r-4,s),i}var Jc=typeof TextDecoder<"u"&&new TextDecoder,Qc=0;try{Jc.decode(Li,{stream:!0}),Qc=1}catch{}class Vo{constructor(){this.idx=1,this.backDict={}}getKey(e){let n=!1;return this.backDict[e]||(n=!0,this.backDict[e]=this.idx++),[this.backDict[e],n]}}class $c{constructor(e,n){this.app=e,this.isDictDisabled=n,this.dict=new Vo}sendSetAttribute(e,n,s){if(this.isDictDisabled){const i=[12,e,n,s];return this.app.send(i)}else{const i=[51,e,this.applyDict(n),this.applyDict(s)];return this.app.send(i)}}applyDict(e){const[n,s]=this.dict.getKey(e);return s&&this.app.send([50,n,e]),n}clear(){this.dict=new Vo}}class Zc{constructor(e,n){this.app=e,this.startParams=n,this.conditions=[],this.hasStarted=!1,this.createConditionFromFilter=s=>{if(s.value.length){const i=eu(s);if(i.type)return i}},this.durationInt=null}setConditions(e){this.conditions=e}async fetchConditions(e,n){try{const s=await fetch(`${this.app.options.ingestPoint}/v1/web/conditions/${e}`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}),{conditions:i}=await s.json(),r=[];i.forEach(a=>{a.filters.forEach(o=>{let u;o.type==="fetch"?(u={type:"network_request",subConditions:[],name:a.name},o.filters.forEach(c=>{const h=this.createConditionFromFilter(c);h&&u.subConditions.push(h)})):u=this.createConditionFromFilter(o),u&&(u.type==="session_duration"&&this.processDuration(u.value[0],a.name),r.push({...u,name:a.name}))})}),this.conditions=r}catch{this.app.debug.error("Critical: cannot fetch start conditions")}}trigger(e){if(!this.hasStarted)try{this.hasStarted=!0,this.app.start(this.startParams,void 0,e)}catch(n){this.app.debug.error(n)}}processMessage(e){if(!this.hasStarted)switch(e[0]){case 78:this.jsExceptionEvent(e);break;case 27:this.customEvent(e);break;case 68:this.clickEvent(e);break;case 122:this.pageLocationEvent(e);break;case 83:this.networkRequest(e);break}}processFlags(e){const n=this.conditions.filter(s=>s.type==="feature_flag");n.length&&n.forEach(s=>{const i=_n[s.operator];i&&e.find(r=>i(r.key,s.value))&&this.trigger(s.name)})}processDuration(e,n){this.durationInt=setInterval(()=>{performance.now()>e&&this.trigger(n)},1e3),this.app.attachStopCallback(()=>{this.durationInt&&clearInterval(this.durationInt)})}networkRequest(e){const n=this.conditions.filter(s=>s.type==="network_request");n.length&&n.forEach(s=>{const i=s.subConditions.filter(r=>r.operator!=="isAny");i.length?i.every(a=>{let l;switch(a.key){case"url":l=e[3];break;case"status":l=e[6];break;case"method":l=e[2];break;case"duration":l=e[8];break}const o=_n[a.operator];if(o&&o(l,a.value))return!0})&&this.trigger(s.name):i.length===0&&s.subConditions.length&&this.trigger(s.name)})}customEvent(e){const n=this.conditions.filter(s=>s.type==="custom_event");n.length&&n.forEach(s=>{const i=_n[s.operator];i&&(i(e[1],s.value)||i(e[2],s.value))&&this.trigger(s.name)})}clickEvent(e){const n=this.conditions.filter(s=>s.type==="click");n.length&&n.forEach(s=>{const i=_n[s.operator];i&&(i(e[3],s.value)||i(e[4],s.value))&&this.trigger(s.name)})}pageLocationEvent(e){const n=this.conditions.filter(s=>s.type==="visited_url");n&&n.forEach(s=>{const i=_n[s.operator];i&&i(e[1],s.value)&&this.trigger(s.name)})}jsExceptionEvent(e){const n=[e[1],e[2],e[3]],s=this.conditions.filter(i=>i.type==="exception");s&&s.forEach(i=>{const r=_n[i.operator];r&&n.some(a=>r(a,i.value))&&this.trigger(i.name)})}}const _n={is:(t,e)=>e.some(n=>t.includes(n)),isAny:()=>!0,isNot:(t,e)=>!e.some(n=>t.includes(n)),contains:(t,e)=>e.some(n=>t.includes(n)),notContains:(t,e)=>!e.some(n=>t.includes(n)),startsWith:(t,e)=>e.some(n=>t.startsWith(n)),endsWith:(t,e)=>e.some(n=>t.endsWith(n)),greaterThan:(t,e)=>t>e,greaterOrEqual:(t,e)=>t>=e,lessOrEqual:(t,e)=>t<=e,lessThan:(t,e)=>t<e},eu=t=>{const e={on:"is",notOn:"isNot",">":"greaterThan","<":"lessThan","=":"is","<=":"lessOrEqual",">=":"greaterOrEqual"},n=i=>{if(Object.keys(e).includes(i))return e[i]};let s={type:"",operator:"",value:t.value,key:""};switch(t.type){case"click":s={type:"click",operator:n(t.operator),value:t.value,key:""};break;case"location":s={type:"visited_url",operator:t.operator,value:t.value,key:""};break;case"custom":s={type:"custom_event",operator:t.operator,value:t.value,key:""};break;case"metadata":s={type:t.source==="featureFlag"?"feature_flag":t.type,operator:t.operator,value:t.value,key:""};break;case"error":s={type:"exception",operator:t.operator,value:t.value,key:""};break;case"duration":s={type:"session_duration",value:t.value[0],key:""};break;case"fetchUrl":s={type:"network_request",key:"url",operator:t.operator,value:t.value};break;case"fetchStatusCode":s={type:"network_request",key:"status",operator:n(t.operator),value:t.value};break;case"fetchMethod":s={type:"network_request",key:"method",operator:n(t.operator),value:t.value};break;case"fetchDuration":s={type:"network_request",key:"duration",operator:n(t.operator),value:t.value};break}return s};class tu{constructor(e){this.app=e,this.flags=[],this.storageKey="__openreplay_flags";const n=this.app.sessionStorage.getItem(this.storageKey);if(n){const s=n.split(";").filter(Boolean);this.flags=s.map(i=>JSON.parse(i))}}getFeatureFlag(e){return this.flags.find(n=>n.key===e)}isFlagEnabled(e){return this.flags.findIndex(n=>n.key===e)!==-1}onFlagsLoad(e){this.onFlagsCb=e}async reloadFlags(e){const n=this.app.sessionStorage.getItem(this.storageKey),s={};n&&n.split(";").filter(Boolean).forEach(c=>{const h=JSON.parse(c);s[h.key]={key:h.key,value:h.value}});const i=this.app.session.getInfo(),r=this.app.session.userInfo,a={projectID:i.projectID,userID:i.userID,metadata:i.metadata,referrer:document.referrer,os:r.userOS,device:r.userDevice,country:r.userCountry,state:r.userState,city:r.userCity,browser:r.userBrowser,persistFlags:s},l=e??this.app.session.getSessionToken(),o=await fetch(this.app.options.ingestPoint+"/v1/web/feature-flags",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l}`},body:JSON.stringify(a)});if(o.status===200){const u=await o.json();return this.handleFlags(u.flags)}}handleFlags(e){var r;const n=[];e.forEach(a=>{a.is_persist&&n.push(a)});let s="";return this.diffPersist(n).forEach(a=>{s+=`${JSON.stringify(a)};`}),this.app.sessionStorage.setItem(this.storageKey,s),this.flags=e,(r=this.onFlagsCb)==null?void 0:r.call(this,e)}clearPersistFlags(){this.app.sessionStorage.removeItem(this.storageKey)}diffPersist(e){const n=this.app.sessionStorage.getItem(this.storageKey);if(!n)return e;const i=n.split(";").filter(Boolean).map(r=>JSON.parse(r));return e.filter(r=>i.findIndex(a=>a.key===r.key)===-1)}}const Go={htmlmasked:"hidden",masked:"obscured"},nt=!(typeof window>"u"),nu=nt&&navigator.userAgent.match(/firefox|fxios/i),su=1e5;let Fi=nt?Date.now()-performance.now():0;function Wi(){Fi=Date.now()-performance.now()}function kn(){return Fi}const Ye=nt&&performance.now?()=>Math.round(performance.now()+Fi):()=>Date.now(),ji="repeat"in String.prototype?t=>"*".repeat(t.length):t=>t.replace(/./g,"*");function Ko(t){return t.trim().replace(/\s+/g," ")}function Xo(t){return t.startsWith("https://")||t.startsWith("http://")}const As="https://docs.openreplay.com",Yo={};function Dt(t,e,n="/"){Yo[t]||(console.warn(`OpenReplay: ${t} is deprecated. ${e?`Please, use ${e} instead.`:""} Visit ${As}${n} for more information.`),Yo[t]=!0)}function zi(t){let e=t.getAttribute("data-openreplay-label");return e!==null||(e=t.getAttribute("data-asayer-label"),e!==null&&Dt('"data-asayer-label" attribute','"data-openreplay-label" attribute',"/")),e}function Kt(t,e){const n=`data-openreplay-${e}`;return t.hasAttribute(n)?(Go[e]&&Dt(`"${n}" attribute`,`"${Go[e]}" attribute`,"/installation/sanitize-data"),!0):!1}function iu(t){try{return!!t.contentDocument}catch{return!1}}function Jo(t){return t.toString(16).padStart(2,"0")}function ru(t){const e=new Uint8Array((t||40)/2),n=window.crypto||window.msCrypto;return n?(n.getRandomValues(e),Array.from(e,Jo).join("")):Array.from({length:t||40},()=>Jo(Math.floor(Math.random()*16))).join("")}function ou(){try{return window.self&&window.top&&window.self!==window.top}catch{return!0}}function Ui(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}function Qo(t){const e=Ui("MutationObserver");return new window[e](t)}function $o(t,e,n,s){const i=Ui("addEventListener");try{t[i](e,n,s)}catch(r){const a=r.message;console.debug(`Openreplay: ${a}; if this error is caused by an IframeObserver, ignore it`)}}function Zo(t,e,n,s){const i=Ui("removeEventListener");try{t[i](e,n,s)}catch(r){const a=r.message;console.debug(`Openreplay: ${a}; if this error is caused by an IframeObserver, ignore it`)}}class au{constructor(){this.taskQueue=[],this.isRunning=!1}addTask(e){this.taskQueue.push(e),this.runTasks()}runTasks(){if(this.isRunning||this.taskQueue.length===0)return;this.isRunning=!0;const e=()=>{if(this.taskQueue.length===0){this.isRunning=!1;return}const n=this.taskQueue.shift();Promise.resolve(n()).then(()=>{requestAnimationFrame(()=>e())})};e()}}const lu=new au;function cu(t){lu.addTask(t)}function ea(t,e){const n={...t};for(const s in e)if(e.hasOwnProperty(s)){const i=e[s],r=t[s];typeof i=="object"&&!Array.isArray(i)&&i!==null?n[s]=ea(r||{},i):n[s]=i}return n}function Xt(t){return[0,t]}function uu(t,e){return[5,t,e]}function hu(t,e){return[6,t,e]}function fu(){return[7]}function du(t,e,n,s,i){return[8,t,e,n,s,i]}function pu(t,e,n){return[9,t,e,n]}function gu(t,e,n){return[10,t,e,n]}function mu(t){return[11,t]}function ta(t,e){return[13,t,e]}function vu(t,e){return[14,t,e]}function bu(t,e,n){return[16,t,e,n]}function wu(t,e,n){return[18,t,e,n]}function yu(t,e){return[19,t,e]}function Su(t,e){return[20,t,e]}function _u(t,e){return[22,t,e]}function ku(t,e,n,s,i,r,a,l,o){return[23,t,e,n,s,i,r,a,l,o]}function Tu(t,e,n){return[24,t,e,n]}function xu(t,e){return[27,t,e]}function Eu(t){return[28,t]}function Iu(t){return[29,t]}function na(t,e){return[30,t,e]}function Cu(t,e,n,s){return[49,t,e,n,s]}function Nu(t,e){return[54,t,e]}function Ru(t){return[55,t]}function sa(t,e,n,s){return[57,t,e,n,s]}function ia(t){return[58,t]}function Hi(t,e,n,s){return[60,t,e,n,s]}function Du(t,e,n){return[61,t,e,n]}function Ou(t,e){return[63,t,e]}function Au(t,e){return[64,t,e]}function Pu(t,e,n,s,i,r){return[68,t,e,n,s,i,r]}function qi(t,e){return[70,t,e]}function ra(t,e,n){return[71,t,e,n]}function Vi(t,e,n,s){return[73,t,e,n,s]}function oa(t,e){return[75,t,e]}function aa(t,e){return[76,t,e]}function Mu(t,e){return[77,t,e]}function Gi(t,e,n,s){return[78,t,e,n,s]}function Ps(t,e,n,s,i,r,a,l,o){return[83,t,e,n,s,i,r,a,l,o]}function Lu(t,e,n,s,i,r){return[84,t,e,n,s,i,r]}function Bu(t,e,n,s,i,r){return[112,t,e,n,s,i,r]}function la(t,e,n){return[113,t,e,n]}function Fu(t){return[114,t]}function Wu(t){return[115,t]}function ca(t,e,n,s,i,r,a,l,o,u){return[116,t,e,n,s,i,r,a,l,o,u]}function Ms(t){return[117,t]}function Yt(t){return[118,t]}function ju(t,e){return[119,t,e]}function zu(t){return[120,t]}function Uu(t,e,n,s){return[122,t,e,n,s]}const Ki=nt&&"performance"in window&&"memory"in performance?performance:{memory:{}},Xi=nt?(navigator.deviceMemory||0)*1024:0,Yi=Ki.memory.jsHeapSizeLimit||0;function Hu(t,e){if(!Object.assign({capturePerformance:!0},e).capturePerformance)return;let s,i;const r=()=>{s===void 0||s===-1||(s++,requestAnimationFrame(r))};t.ticker.attach(()=>{i===void 0||i===-1||i++},0,!1);const a=()=>{s===void 0||i===void 0||(t.send(Cu(s,i,Ki.memory.totalJSHeapSize||0,Ki.memory.usedJSHeapSize||0)),i=s=document.hidden?-1:0)};t.attachStartCallback(()=>{i=s=-1,a(),r()}),t.attachStopCallback(()=>{i=s=void 0}),t.ticker.attach(a,40,!1),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",a,!1,!1)}const ua="__or__watched_tags__";class qu{constructor(e,n,s){this.sessionStorage=e,this.errLog=n,this.onTag=s,this.intervals={},this.tags=[];const i=JSON.parse(e.getItem(ua)??"[]");this.setTags(i),this.observer=new IntersectionObserver(r=>{r.forEach(a=>{if(a.isIntersecting&&a.target){const l=a.target.__or_watcher_tagname;l&&this.onTagRendered(l),this.observer.unobserve(a.target)}})})}async fetchTags(e,n){return fetch(`${e}/v1/web/tags`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}).then(s=>s.json()).then(({tags:s})=>{if(s&&s.length){this.setTags(s);const i=JSON.stringify(s);this.sessionStorage.setItem(ua,i||"")}}).catch(s=>this.errLog(s))}setTags(e){this.tags=e,this.intervals={},e.forEach(n=>{this.intervals[n.id]=setInterval(()=>{const s=document.querySelectorAll(n.selector);if(s.length>0){const i=s[0];i.__or_watcher_tagname=n.id,this.observer.observe(i)}},500)})}onTagRendered(e){this.intervals[e]&&clearInterval(this.intervals[e]),this.onTag(e)}clear(){this.tags.forEach(e=>{clearInterval(this.intervals[e.id])}),this.tags=[],this.intervals={},this.observer.disconnect()}}const Vu={position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.40)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:999999,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'},Gu={display:"flex",flexDirection:"column",gap:"2rem",alignItems:"center",padding:"1.5rem",borderRadius:"2px",border:"1px solid #D9D9D9",background:"#FFF",width:"22rem"},Ls={display:"flex","flex-direction":"column",gap:"unset","align-items":"center",padding:"unset",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',"border-radius":"2px",border:"1px solid #D9D9D9",background:"rgba(255, 255, 255, 0.75)",width:"22rem"},Ku={fontFamily:"Verdana, sans-serif",fontSize:"1.25rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.75rem",color:"rgba(0, 0, 0, 0.85)"},Xu={borderTop:"1px solid rgba(0, 0, 0, 0.06)",borderBottom:"1px solid rgba(0, 0, 0, 0.06)",padding:"1.25rem 0rem",color:"rgba(0, 0, 0, 0.85)",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"400",lineHeight:"auto",whiteSpace:"pre-wrap"},Yu={display:"flex",padding:"0.4rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.625rem",borderRadius:"0.25rem",border:"1px solid #394EFF",background:"#394EFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",color:"#FFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"1rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.5rem",cursor:"pointer"},ha={fontFamily:"Verdana, sans-serif",fontSize:"13px",fontWeight:"500",lineHeight:"auto",display:"flex",justifyContent:"space-between",width:"100%",cursor:"pointer"},Tn={display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.625rem",fontSize:"13px",lineHeight:"auto"},Ju={padding:"0.5rem",gap:"0.5rem",fontFamily:"Verdana, sans-serif",fontSize:"16px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto",color:"white",display:"flex",alignItems:"center",width:"100%",borderRadius:"2px",background:"rgba(0, 0, 0, 0.75)",boxSizing:"border-box"},xn={boxSizing:"border-box",display:"block",width:"100%",borderBottom:"1px solid #D9D9D9",background:"#FFF",padding:"0.65rem",alignSelf:"stretch",color:"#000",fontFamily:"Verdana, sans-serif",fontStyle:"normal",fontWeight:"400"},Qu={...xn,display:"flex",flexDirection:"column",alignItems:"center",gap:"0.625rem"},fa={fontSize:"1.25rem",fontWeight:"500",cursor:"pointer",color:"#394EFF"},da={display:"flex",padding:"0.4rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.625rem",borderRadius:"0.25rem",border:"1px solid #394EFF",background:"#394EFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",color:"#FFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"1rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.5rem",width:"100%",boxSizing:"border-box",cursor:"pointer"},pa={marginTop:"1rem",marginBottom:"1rem",cursor:"pointer",display:"block",fontWeight:"500",fontSize:"13px!important",lineHeight:"auto"},$u={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"1rem",padding:"0.5rem",width:"100%",boxSizing:"border-box"},ga={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #394EFF",fontSize:"13px",height:"24px",width:"24px"},Zu={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #D2DFFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",background:"#D2DFFF",fontSize:"13px",height:"24px",width:"24px"},ma={borderRadius:"0.375rem",border:"1px solid rgba(0, 0, 0, 0.06)",background:"#F5F7FF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",padding:"0.625rem 0.9375rem",gap:"0.5rem",alignSelf:"stretch"},va={fontWeight:"bold"},eh={fontSize:"13px",lineHeight:"auto"},ba={marginRight:"0.5rem",cursor:"pointer",color:"#394EFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto"},th={...ba,display:"flex",padding:"0.25rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.5rem",borderRadius:"0.25rem",border:"1px solid #394EFF"},nh={display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",boxSizing:"border-box"},sh={border:"4px solid rgba(255, 255, 255, 0.4)",width:"16px",height:"16px",borderRadius:"50%",borderLeftColor:"#fff",animation:"spin 0.5s linear infinite"},wa={Standard:{width:1280,height:720},High:{width:1920,height:1080}};class ih{constructor(e){this.app=e,this.mediaRecorder=null,this.recordedChunks=[],this.stream=null,this.recStartTs=null}async startRecording(e,n,s,i){this.recStartTs=this.app.timestamp();const r=n;try{this.stream=await navigator.mediaDevices.getUserMedia({video:i?{...r,frameRate:{ideal:e}}:!1,audio:s}),this.mediaRecorder=new MediaRecorder(this.stream,{mimeType:"video/webm;codecs=vp9"}),this.recordedChunks=[],this.mediaRecorder.ondataavailable=a=>{a.data.size>0&&this.recordedChunks.push(a.data)},this.mediaRecorder.start()}catch(a){console.error(a)}}async stopRecording(){return new Promise(e=>{this.mediaRecorder&&(this.mediaRecorder.onstop=()=>{const n=new Blob(this.recordedChunks,{type:"video/webm"});e(n)},this.mediaRecorder.stop())})}async sendToAPI(){const e=await this.stopRecording();return fetch(`${this.app.options.ingestPoint}/v1/web/uxt/upload-url`,{headers:{Authorization:`Bearer ${this.app.session.getSessionToken()}`}}).then(n=>{if(n.ok)return n.json();throw new Error("Failed to get upload url")}).then(({url:n})=>fetch(n,{method:"PUT",headers:{"Content-Type":"video/webm"},body:e})).catch(console.error).finally(()=>{this.discard()})}async saveToFile(e="recorded-video.webm"){const n=await this.stopRecording(),s=URL.createObjectURL(n),i=document.createElement("a");i.style.display="none",i.href=s,i.download=e,document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(s),document.body.removeChild(i)}discard(){var e,n;(e=this.mediaRecorder)==null||e.stop(),(n=this.stream)==null||n.getTracks().forEach(s=>s.stop())}}function rh(t,e){e.onmousedown=function(n){const s=t.getBoundingClientRect(),i=n.clientX-s.left,r=n.clientY-s.top;t.style.position="fixed",t.style.zIndex=99999999999999,a(n.pageX,n.pageY);function a(u,c){let h=u-i,f=c-r;h<=5&&(h=5),f<=5&&(f=5),h>=window.innerWidth-s.width&&(h=window.innerWidth-s.width),f>=window.innerHeight-s.height&&(f=window.innerHeight-s.height),t.style.left=`${h}px`,t.style.top=`${f}px`}function l(u){a(u.pageX,u.pageY)}document.addEventListener("mousemove",l);const o=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",o)};document.addEventListener("mouseup",o)},e.ondragstart=function(){return!1}}function oh(){const t=document.createElement("div");t.className="grid";for(let e=0;e<16;e++){const n=document.createElement("div");Object.assign(n.style,{width:"2px",height:"2px",borderRadius:"10px",background:"white"}),n.className="cell",t.appendChild(n)}return Object.assign(t.style,{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gridTemplateRows:"repeat(4, 1fr)",gap:"2px",cursor:"grab"}),t}function ah(){const t=document.createElement("div");Object.assign(t.style,{width:"0",height:"0",borderLeft:"7px solid transparent",borderRight:"7px solid transparent",borderBottom:"7px solid white"});const e=document.createElement("div");return e.appendChild(t),Object.assign(e.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",cursor:"pointer",marginLeft:"auto",transform:"rotate(180deg)"}),e}function lh(){const t=document.createElement("style");t.type="text/css",t.innerText=`@keyframes spin {
|
|
1
|
+
(function(te,$){typeof exports=="object"&&typeof module<"u"?module.exports=$():typeof define=="function"&&define.amd?define($):(te=typeof globalThis<"u"?globalThis:te||self,te.WineaterChatbot=$())})(this,function(){"use strict";var ep=Object.defineProperty;var tp=(te,$,ce)=>$ in te?ep(te,$,{enumerable:!0,configurable:!0,writable:!0,value:ce}):te[$]=ce;var dt=(te,$,ce)=>(tp(te,typeof $!="symbol"?$+"":$,ce),ce),Er=(te,$,ce)=>{if(!$.has(te))throw TypeError("Cannot "+ce)};var b=(te,$,ce)=>(Er(te,$,"read from private field"),ce?ce.call(te):$.get(te)),z=(te,$,ce)=>{if($.has(te))throw TypeError("Cannot add the same private member more than once");$ instanceof WeakSet?$.add(te):$.set(te,ce)},j=(te,$,ce,zn)=>(Er(te,$,"write to private field"),zn?zn.call(te,ce):$.set(te,ce),ce);var ae=(te,$,ce)=>(Er(te,$,"access private method"),ce);var tl,Pn,Mn,tn,nn,rs,Ln,Bn,os,Ir,_t,hn,as,Cr,Zs,al,$s,ll,qe,Ve,Sr,ct,sn,ut,Ge,Oe,ht,kt,Lt,rn,Bt,on,Ft,ti,_r,np,kr,sp,ls,Nr,Fn,ri,Wn,oi,cs,Rr,Ze,ft,Le,an,us,hs,ni,nl,jn,ln,sl;const te="5";typeof window<"u"&&((tl=window.__svelte??(window.__svelte={})).v??(tl.v=new Set)).add(te);const $=1,ce=2,zn=4,cl=8,ul=16,hl=1,fl=2,dl=4,pl=8,gl=16,Dr=1,ml=2,Se=Symbol(),vl="http://www.w3.org/1999/xhtml",ai=!1;var li=Array.isArray,bl=Array.prototype.indexOf,ci=Array.from,wl=Object.defineProperty,fn=Object.getOwnPropertyDescriptor,yl=Object.getOwnPropertyDescriptors,Sl=Object.prototype,_l=Array.prototype,Or=Object.getPrototypeOf,Ar=Object.isExtensible;function kl(t){for(var e=0;e<t.length;e++)t[e]()}function Pr(){var t,e,n=new Promise((s,i)=>{t=s,e=i});return{promise:n,resolve:t,reject:e}}const be=2,ui=4,hi=8,Tl=1<<24,pt=16,gt=32,zt=64,ps=128,Xe=512,we=1024,xe=2048,$e=4096,Ae=8192,mt=16384,fi=32768,Ut=65536,Mr=1<<17,Lr=1<<18,dn=1<<19,xl=1<<20,Ht=32768,di=1<<21,pi=1<<22,xt=1<<23,qt=Symbol("$state"),El=Symbol("legacy props"),Il=Symbol(""),pn=new class extends Error{constructor(){super(...arguments);dt(this,"name","StaleReactionError");dt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};function Cl(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Nl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Rl(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Dl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ol(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Al(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Pl(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Ml(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ll(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Bl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Fl(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Wl(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function jl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Br(t){return t===this.v}function zl(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Fr(t){return!zl(t,this.v)}let Ul=!1,gn=!1,Hl=!1;function ql(){gn=!0}let fe=null;function mn(t){fe=t}function Et(t,e=!1,n){fe={p:fe,i:!1,c:null,e:null,s:t,x:null,l:gn&&!e?{s:null,u:null,$:[]}:null}}function It(t){var e=fe,n=e.e;if(n!==null){e.e=null;for(var s of n)no(s)}return t!==void 0&&(e.x=t),e.i=!0,fe=e.p,t??{}}function Un(){return!gn||fe!==null&&fe.l===null}let Vt=[];function Wr(){var t=Vt;Vt=[],kl(t)}function vn(t){if(Vt.length===0&&!Hn){var e=Vt;queueMicrotask(()=>{e===Vt&&Wr()})}Vt.push(t)}function Vl(){for(;Vt.length>0;)Wr()}function jr(t){var e=Z;if(e===null)return X.f|=xt,t;if(e.f&fi)bn(t,e);else{if(!(e.f&ps))throw t;e.b.error(t)}}function bn(t,e){for(;e!==null;){if(e.f&ps)try{e.b.error(t);return}catch(n){t=n}e=e.parent}throw t}const gs=new Set;let q=null,ms=null,de=null,Fe=[],vs=null,gi=!1,Hn=!1;const ei=class ei{constructor(){z(this,os);z(this,_t);z(this,as);z(this,Zs);z(this,$s);dt(this,"committed",!1);dt(this,"current",new Map);dt(this,"previous",new Map);z(this,Pn,new Set);z(this,Mn,new Set);z(this,tn,0);z(this,nn,0);z(this,rs,null);z(this,Ln,[]);z(this,Bn,[]);dt(this,"skipped_effects",new Set);dt(this,"is_fork",!1)}is_deferred(){return this.is_fork||b(this,nn)>0}process(e){var s;Fe=[],ms=null,this.apply();var n={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const i of e)ae(this,os,Ir).call(this,i,n);this.is_fork||ae(this,Zs,al).call(this),this.is_deferred()?(ae(this,_t,hn).call(this,n.effects),ae(this,_t,hn).call(this,n.render_effects),ae(this,_t,hn).call(this,n.block_effects)):(ms=this,q=null,zr(n.render_effects),zr(n.effects),ms=null,(s=b(this,rs))==null||s.resolve()),de=null}capture(e,n){this.previous.has(e)||this.previous.set(e,n),e.f&xt||(this.current.set(e,e.v),de==null||de.set(e,e.v))}activate(){q=this,this.apply()}deactivate(){q===this&&(q=null,de=null)}flush(){if(this.activate(),Fe.length>0){if(mi(),q!==null&&q!==this)return}else b(this,tn)===0&&this.process([]);this.deactivate()}discard(){for(const e of b(this,Mn))e(this);b(this,Mn).clear()}increment(e){j(this,tn,b(this,tn)+1),e&&j(this,nn,b(this,nn)+1)}decrement(e){j(this,tn,b(this,tn)-1),e&&j(this,nn,b(this,nn)-1),this.revive()}revive(){for(const e of b(this,Ln))_e(e,xe),Gt(e);for(const e of b(this,Bn))_e(e,$e),Gt(e);j(this,Ln,[]),j(this,Bn,[]),this.flush()}oncommit(e){b(this,Pn).add(e)}ondiscard(e){b(this,Mn).add(e)}settled(){return(b(this,rs)??j(this,rs,Pr())).promise}static ensure(){if(q===null){const e=q=new ei;gs.add(q),Hn||ei.enqueue(()=>{q===e&&e.flush()})}return q}static enqueue(e){vn(e)}apply(){}};Pn=new WeakMap,Mn=new WeakMap,tn=new WeakMap,nn=new WeakMap,rs=new WeakMap,Ln=new WeakMap,Bn=new WeakMap,os=new WeakSet,Ir=function(e,n){var c;e.f^=we;for(var s=e.first;s!==null;){var i=s.f,r=(i&(gt|zt))!==0,a=r&&(i&we)!==0,l=a||(i&Ae)!==0||this.skipped_effects.has(s);if(s.f&ps&&((c=s.b)!=null&&c.is_pending())&&(n={parent:n,effect:s,effects:[],render_effects:[],block_effects:[]}),!l&&s.fn!==null){r?s.f^=we:i&ui?n.effects.push(s):Qn(s)&&(s.f&pt&&n.block_effects.push(s),Zn(s));var o=s.first;if(o!==null){s=o;continue}}var u=s.parent;for(s=s.next;s===null&&u!==null;)u===n.effect&&(ae(this,_t,hn).call(this,n.effects),ae(this,_t,hn).call(this,n.render_effects),ae(this,_t,hn).call(this,n.block_effects),n=n.parent),s=u.next,u=u.parent}},_t=new WeakSet,hn=function(e){for(const n of e)(n.f&xe?b(this,Ln):b(this,Bn)).push(n),ae(this,as,Cr).call(this,n.deps),_e(n,we)},as=new WeakSet,Cr=function(e){if(e!==null)for(const n of e)!(n.f&be)||!(n.f&Ht)||(n.f^=Ht,ae(this,as,Cr).call(this,n.deps))},Zs=new WeakSet,al=function(){if(b(this,nn)===0){for(const e of b(this,Pn))e();b(this,Pn).clear()}b(this,tn)===0&&ae(this,$s,ll).call(this)},$s=new WeakSet,ll=function(){var r;if(gs.size>1){this.previous.clear();var e=de,n=!0,s={parent:null,effect:null,effects:[],render_effects:[],block_effects:[]};for(const a of gs){if(a===this){n=!1;continue}const l=[];for(const[u,c]of this.current){if(a.current.has(u))if(n&&c!==a.current.get(u))a.current.set(u,c);else continue;l.push(u)}if(l.length===0)continue;const o=[...a.current.keys()].filter(u=>!this.current.has(u));if(o.length>0){var i=Fe;Fe=[];const u=new Set,c=new Map;for(const h of l)Ur(h,o,u,c);if(Fe.length>0){q=a,a.apply();for(const h of Fe)ae(r=a,os,Ir).call(r,h,s);a.deactivate()}Fe=i}}q=null,de=e}this.committed=!0,gs.delete(this)};let vt=ei;function Gl(t){var e=Hn;Hn=!0;try{var n;for(t&&(q!==null&&mi(),n=t());;){if(Vl(),Fe.length===0&&(q==null||q.flush(),Fe.length===0))return vs=null,n;mi()}}finally{Hn=e}}function mi(){var t=Nt;gi=!0;var e=null;try{var n=0;for(_s(!0);Fe.length>0;){var s=vt.ensure();if(n++>1e3){var i,r;Kl()}s.process(Fe),Ct.clear()}}finally{gi=!1,_s(t),vs=null}}function Kl(){try{Al()}catch(t){bn(t,vs)}}let Ye=null;function zr(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var s=t[n++];if(!(s.f&(mt|Ae))&&Qn(s)&&(Ye=new Set,Zn(s),s.deps===null&&s.first===null&&s.nodes_start===null&&(s.teardown===null&&s.ac===null?oo(s):s.fn=null),(Ye==null?void 0:Ye.size)>0)){Ct.clear();for(const i of Ye){if(i.f&(mt|Ae))continue;const r=[i];let a=i.parent;for(;a!==null;)Ye.has(a)&&(Ye.delete(a),r.push(a)),a=a.parent;for(let l=r.length-1;l>=0;l--){const o=r[l];o.f&(mt|Ae)||Zn(o)}}Ye.clear()}}Ye=null}}function Ur(t,e,n,s){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const i of t.reactions){const r=i.f;r&be?Ur(i,e,n,s):r&(pi|pt)&&!(r&xe)&&Hr(i,e,s)&&(_e(i,xe),Gt(i))}}function Hr(t,e,n){const s=n.get(t);if(s!==void 0)return s;if(t.deps!==null)for(const i of t.deps){if(e.includes(i))return!0;if(i.f&be&&Hr(i,e,n))return n.set(i,!0),!0}return n.set(t,!1),!1}function Gt(t){for(var e=vs=t;e.parent!==null;){e=e.parent;var n=e.f;if(gi&&e===Z&&n&pt&&!(n&Lr))return;if(n&(zt|gt)){if(!(n&we))return;e.f^=we}}Fe.push(e)}function Xl(t){let e=0,n=Kt(0),s;return()=>{Xn()&&(w(n),_i(()=>(e===0&&(s=$n(()=>t(()=>Gn(n)))),e+=1,()=>{vn(()=>{e-=1,e===0&&(s==null||s(),s=void 0,Gn(n))})})))}}var Yl=Ut|dn|ps;function Jl(t,e,n){new Ql(t,e,n)}class Ql{constructor(e,n,s){z(this,_r);z(this,kr);z(this,ls);z(this,Fn);z(this,Wn);z(this,cs);dt(this,"parent");z(this,qe,!1);z(this,Ve,void 0);z(this,Sr,null);z(this,ct,void 0);z(this,sn,void 0);z(this,ut,void 0);z(this,Ge,null);z(this,Oe,null);z(this,ht,null);z(this,kt,null);z(this,Lt,null);z(this,rn,0);z(this,Bt,0);z(this,on,!1);z(this,Ft,null);z(this,ti,Xl(()=>(j(this,Ft,Kt(b(this,rn))),()=>{j(this,Ft,null)})));j(this,Ve,e),j(this,ct,n),j(this,sn,s),this.parent=Z.b,j(this,qe,!!b(this,ct).pending),j(this,ut,Ss(()=>{Z.b=this;{var i=ae(this,ls,Nr).call(this);try{j(this,Ge,We(()=>s(i)))}catch(r){this.error(r)}b(this,Bt)>0?ae(this,Wn,oi).call(this):j(this,qe,!1)}return()=>{var r;(r=b(this,Lt))==null||r.remove()}},Yl))}is_pending(){return b(this,qe)||!!this.parent&&this.parent.is_pending()}has_pending_snippet(){return!!b(this,ct).pending}update_pending_count(e){ae(this,cs,Rr).call(this,e),j(this,rn,b(this,rn)+e),b(this,Ft)&&wn(b(this,Ft),b(this,rn))}get_effect_pending(){return b(this,ti).call(this),w(b(this,Ft))}error(e){var n=b(this,ct).onerror;let s=b(this,ct).failed;if(b(this,on)||!n&&!s)throw e;b(this,Ge)&&(Ne(b(this,Ge)),j(this,Ge,null)),b(this,Oe)&&(Ne(b(this,Oe)),j(this,Oe,null)),b(this,ht)&&(Ne(b(this,ht)),j(this,ht,null));var i=!1,r=!1;const a=()=>{if(i){jl();return}i=!0,r&&Fl(),vt.ensure(),j(this,rn,0),b(this,ht)!==null&&yn(b(this,ht),()=>{j(this,ht,null)}),j(this,qe,this.has_pending_snippet()),j(this,Ge,ae(this,Fn,ri).call(this,()=>(j(this,on,!1),We(()=>b(this,sn).call(this,b(this,Ve)))))),b(this,Bt)>0?ae(this,Wn,oi).call(this):j(this,qe,!1)};var l=X;try{Re(null),r=!0,n==null||n(e,a),r=!1}catch(o){bn(o,b(this,ut)&&b(this,ut).parent)}finally{Re(l)}s&&vn(()=>{j(this,ht,ae(this,Fn,ri).call(this,()=>{vt.ensure(),j(this,on,!0);try{return We(()=>{s(b(this,Ve),()=>e,()=>a)})}catch(o){return bn(o,b(this,ut).parent),null}finally{j(this,on,!1)}}))})}}qe=new WeakMap,Ve=new WeakMap,Sr=new WeakMap,ct=new WeakMap,sn=new WeakMap,ut=new WeakMap,Ge=new WeakMap,Oe=new WeakMap,ht=new WeakMap,kt=new WeakMap,Lt=new WeakMap,rn=new WeakMap,Bt=new WeakMap,on=new WeakMap,Ft=new WeakMap,ti=new WeakMap,_r=new WeakSet,np=function(){try{j(this,Ge,We(()=>b(this,sn).call(this,b(this,Ve))))}catch(e){this.error(e)}j(this,qe,!1)},kr=new WeakSet,sp=function(){const e=b(this,ct).pending;e&&(j(this,Oe,We(()=>e(b(this,Ve)))),vt.enqueue(()=>{var n=ae(this,ls,Nr).call(this);j(this,Ge,ae(this,Fn,ri).call(this,()=>(vt.ensure(),We(()=>b(this,sn).call(this,n))))),b(this,Bt)>0?ae(this,Wn,oi).call(this):(yn(b(this,Oe),()=>{j(this,Oe,null)}),j(this,qe,!1))}))},ls=new WeakSet,Nr=function(){var e=b(this,Ve);return b(this,qe)&&(j(this,Lt,bt()),b(this,Ve).before(b(this,Lt)),e=b(this,Lt)),e},Fn=new WeakSet,ri=function(e){var n=Z,s=X,i=fe;nt(b(this,ut)),Re(b(this,ut)),mn(b(this,ut).ctx);try{return e()}catch(r){return jr(r),null}finally{nt(n),Re(s),mn(i)}},Wn=new WeakSet,oi=function(){const e=b(this,ct).pending;b(this,Ge)!==null&&(j(this,kt,document.createDocumentFragment()),b(this,kt).append(b(this,Lt)),co(b(this,Ge),b(this,kt))),b(this,Oe)===null&&j(this,Oe,We(()=>e(b(this,Ve))))},cs=new WeakSet,Rr=function(e){var n;if(!this.has_pending_snippet()){this.parent&&ae(n=this.parent,cs,Rr).call(n,e);return}j(this,Bt,b(this,Bt)+e),b(this,Bt)===0&&(j(this,qe,!1),b(this,Oe)&&yn(b(this,Oe),()=>{j(this,Oe,null)}),b(this,kt)&&(b(this,Ve).before(b(this,kt)),j(this,kt,null)))};function qn(t,e){return e}function Zl(t,e,n){for(var s=[],i=e.length,r=0;r<i;r++)ki(e[r].e,s,!0);ao(s,()=>{var a=s.length===0&&n!==null;if(a){var l=n,o=l.parentNode;cc(o),o.append(l),t.items.clear(),Je(t,e[0].prev,e[i-1].next)}for(var u=0;u<i;u++){var c=e[u];a||(t.items.delete(c.k),Je(t,c.prev,c.next)),Ne(c.e,!a)}t.first===e[0]&&(t.first=e[0].prev)})}function Vn(t,e,n,s,i,r=null){var a=t,l=new Map,o=null,u=(e&zn)!==0,c=(e&$)!==0,h=(e&ce)!==0;if(u){var f=t;a=f.appendChild(bt())}var d=null,p=bi(()=>{var m=n();return li(m)?m:m==null?[]:ci(m)}),g,v=!0;function k(){$l(E,g,a,e,s),d!==null&&(g.length===0?(d.fragment?(a.before(d.fragment),d.fragment=null):Ti(d.effect),C.first=d.effect):yn(d.effect,()=>{d=null}))}var C=Ss(()=>{g=w(p);for(var m=g.length,y=new Set,T=q,x=null,S=eo(),_=0;_<m;_+=1){var A=g[_],W=s(A,_),D=v?null:l.get(W);D?(c&&wn(D.v,A),h?wn(D.i,_):D.i=_,S&&T.skipped_effects.delete(D.e)):(D=ec(v?a:null,x,A,W,_,i,e,n),v&&(D.o=!0,x===null?o=D:x.next=D,x=D),l.set(W,D)),y.add(W)}if(m===0&&r&&!d)if(v)d={fragment:null,effect:We(()=>r(a))};else{var U=document.createDocumentFragment(),R=bt();U.append(R),d={fragment:U,effect:We(()=>r(R))}}if(!v)if(S){for(const[P,I]of l)y.has(P)||T.skipped_effects.add(I.e);T.oncommit(k),T.ondiscard(()=>{})}else k();w(p)}),E={effect:C,flags:e,items:l,first:o};v=!1}function $l(t,e,n,s,i){var W,D,U,R;var r=(s&cl)!==0,a=e.length,l=t.items,o=t.first,u,c=null,h,f=[],d=[],p,g,v,k;if(r)for(k=0;k<a;k+=1)p=e[k],g=i(p,k),v=l.get(g),v.o&&((W=v.a)==null||W.measure(),(h??(h=new Set)).add(v));for(k=0;k<a;k+=1){if(p=e[k],g=i(p,k),v=l.get(g),t.first??(t.first=v),!v.o){v.o=!0;var C=c?c.next:o;Je(t,c,v),Je(t,v,C),vi(v,C,n),c=v,f=[],d=[],o=c.next;continue}if(v.e.f&Ae&&(Ti(v.e),r&&((D=v.a)==null||D.unfix(),(h??(h=new Set)).delete(v))),v!==o){if(u!==void 0&&u.has(v)){if(f.length<d.length){var E=d[0],m;c=E.prev;var y=f[0],T=f[f.length-1];for(m=0;m<f.length;m+=1)vi(f[m],E,n);for(m=0;m<d.length;m+=1)u.delete(d[m]);Je(t,y.prev,T.next),Je(t,c,y),Je(t,T,E),o=E,c=T,k-=1,f=[],d=[]}else u.delete(v),vi(v,o,n),Je(t,v.prev,v.next),Je(t,v,c===null?t.first:c.next),Je(t,c,v),c=v;continue}for(f=[],d=[];o!==null&&o.k!==g;)o.e.f&Ae||(u??(u=new Set)).add(o),d.push(o),o=o.next;if(o===null)continue;v=o}f.push(v),c=v,o=v.next}let x=l.size>a;if(o!==null||u!==void 0){for(var S=u===void 0?[]:ci(u);o!==null;)o.e.f&Ae||S.push(o),o=o.next;var _=S.length;if(x=l.size-_>a,_>0){var A=s&zn&&a===0?n:null;if(r){for(k=0;k<_;k+=1)(U=S[k].a)==null||U.measure();for(k=0;k<_;k+=1)(R=S[k].a)==null||R.fix()}Zl(t,S,A)}}if(x)for(const P of l.values())P.o||(Je(t,c,P),c=P);t.effect.last=c&&c.e,r&&vn(()=>{var P;if(h!==void 0)for(v of h)(P=v.a)==null||P.apply()})}function ec(t,e,n,s,i,r,a,l){var o=(a&$)!==0,u=(a&ul)===0,c=o?u?rc(n,!1,!1):Kt(n):n,h=a&ce?Kt(i):i,f={i:h,v:c,k:s,a:null,e:null,o:!1,prev:e,next:null};try{if(t===null){var d=document.createDocumentFragment();d.append(t=bt())}return f.e=We(()=>r(t,c,h,l)),e!==null&&(e.next=f),f}finally{}}function vi(t,e,n){for(var s=t.next?t.next.e.nodes_start:n,i=e?e.e.nodes_start:n,r=t.e.nodes_start;r!==null&&r!==s;){var a=Kn(r);i.before(r),r=a}}function Je(t,e,n){e===null?(t.first=n,t.effect.first=n&&n.e):(e.e.next&&(e.e.next.prev=null),e.next=n,e.e.next=n&&n.e),n!==null&&(n.e.prev&&(n.e.prev.next=null),n.prev=e,n.e.prev=e&&e.e)}function tc(t,e,n,s){const i=Un()?ws:bi;if(n.length===0&&t.length===0){s(e.map(i));return}var r=q,a=Z,l=nc();function o(){Promise.all(n.map(u=>sc(u))).then(u=>{l();try{s([...e.map(i),...u])}catch(c){a.f&mt||bn(c,a)}r==null||r.deactivate(),bs()}).catch(u=>{bn(u,a)})}t.length>0?Promise.all(t).then(()=>{l();try{return o()}finally{r==null||r.deactivate(),bs()}}):o()}function nc(){var t=Z,e=X,n=fe,s=q;return function(r=!0){nt(t),Re(e),mn(n),r&&(s==null||s.activate())}}function bs(){nt(null),Re(null),mn(null)}function ws(t){var e=be|xe,n=X!==null&&X.f&be?X:null;return Z!==null&&(Z.f|=dn),{ctx:fe,deps:null,effects:null,equals:Br,f:e,fn:t,reactions:null,rv:0,v:Se,wv:0,parent:n??Z,ac:null}}function sc(t,e){let n=Z;n===null&&Nl();var s=n.b,i=void 0,r=Kt(Se),a=!X,l=new Map;return gc(()=>{var f;var o=Pr();i=o.promise;try{Promise.resolve(t()).then(o.resolve,o.reject).then(()=>{u===q&&u.committed&&u.deactivate(),bs()})}catch(d){o.reject(d),bs()}var u=q;if(a){var c=!s.is_pending();s.update_pending_count(1),u.increment(c),(f=l.get(u))==null||f.reject(pn),l.delete(u),l.set(u,o)}const h=(d,p=void 0)=>{if(u.activate(),p)p!==pn&&(r.f|=xt,wn(r,p));else{r.f&xt&&(r.f^=xt),wn(r,d);for(const[g,v]of l){if(l.delete(g),g===u)break;v.reject(pn)}}a&&(s.update_pending_count(-1),u.decrement(c))};o.promise.then(h,d=>h(null,d||"unknown"))}),Si(()=>{for(const o of l.values())o.reject(pn)}),new Promise(o=>{function u(c){function h(){c===i?o(r):u(i)}c.then(h,h)}u(i)})}function pe(t){const e=ws(t);return ho(e),e}function bi(t){const e=ws(t);return e.equals=Fr,e}function qr(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)Ne(e[n])}}function ic(t){for(var e=t.parent;e!==null;){if(!(e.f&be))return e.f&mt?null:e;e=e.parent}return null}function wi(t){var e,n=Z;nt(ic(t));try{t.f&=~Ht,qr(t),e=vo(t)}finally{nt(n)}return e}function Vr(t){var e=wi(t);if(t.equals(e)||(q!=null&&q.is_fork||(t.v=e),t.wv=go()),!Yt)if(de!==null)(Xn()||q!=null&&q.is_fork)&&de.set(t,e);else{var n=t.f&Xe?we:$e;_e(t,n)}}let yi=new Set;const Ct=new Map;let Gr=!1;function Kt(t,e){var n={f:0,v:t,reactions:null,equals:Br,rv:0,wv:0};return n}function ie(t,e){const n=Kt(t);return ho(n),n}function rc(t,e=!1,n=!0){var i;const s=Kt(t);return e||(s.equals=Fr),gn&&n&&fe!==null&&fe.l!==null&&((i=fe.l).s??(i.s=[])).push(s),s}function L(t,e,n=!1){X!==null&&(!tt||X.f&Mr)&&Un()&&X.f&(be|pt|pi|Mr)&&!(Ee!=null&&Ee.includes(t))&&Bl();let s=n?et(e):e;return wn(t,s)}function wn(t,e){if(!t.equals(e)){var n=t.v;Yt?Ct.set(t,e):Ct.set(t,n),t.v=e;var s=vt.ensure();s.capture(t,n),t.f&be&&(t.f&xe&&wi(t),_e(t,t.f&Xe?we:$e)),t.wv=go(),Xr(t,xe),Un()&&Z!==null&&Z.f&we&&!(Z.f&(gt|zt))&&(je===null?bc([t]):je.push(t)),!s.is_fork&&yi.size>0&&!Gr&&oc()}return e}function oc(){Gr=!1;var t=Nt;_s(!0);const e=Array.from(yi);try{for(const n of e)n.f&we&&_e(n,$e),Qn(n)&&Zn(n)}finally{_s(t)}yi.clear()}function Kr(t,e=1){var n=w(t),s=e===1?n++:n--;return L(t,n),s}function Gn(t){L(t,t.v+1)}function Xr(t,e){var n=t.reactions;if(n!==null)for(var s=Un(),i=n.length,r=0;r<i;r++){var a=n[r],l=a.f;if(!(!s&&a===Z)){var o=(l&xe)===0;if(o&&_e(a,e),l&be){var u=a;de==null||de.delete(u),l&Ht||(l&Xe&&(a.f|=Ht),Xr(u,$e))}else o&&(l&pt&&Ye!==null&&Ye.add(a),Gt(a))}}}function et(t){if(typeof t!="object"||t===null||qt in t)return t;const e=Or(t);if(e!==Sl&&e!==_l)return t;var n=new Map,s=li(t),i=ie(0),r=Jt,a=l=>{if(Jt===r)return l();var o=X,u=Jt;Re(null),po(r);var c=l();return Re(o),po(u),c};return s&&n.set("length",ie(t.length)),new Proxy(t,{defineProperty(l,o,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&Ml();var c=n.get(o);return c===void 0?c=a(()=>{var h=ie(u.value);return n.set(o,h),h}):L(c,u.value,!0),!0},deleteProperty(l,o){var u=n.get(o);if(u===void 0){if(o in l){const c=a(()=>ie(Se));n.set(o,c),Gn(i)}}else L(u,Se),Gn(i);return!0},get(l,o,u){var d;if(o===qt)return t;var c=n.get(o),h=o in l;if(c===void 0&&(!h||(d=fn(l,o))!=null&&d.writable)&&(c=a(()=>{var p=et(h?l[o]:Se),g=ie(p);return g}),n.set(o,c)),c!==void 0){var f=w(c);return f===Se?void 0:f}return Reflect.get(l,o,u)},getOwnPropertyDescriptor(l,o){var u=Reflect.getOwnPropertyDescriptor(l,o);if(u&&"value"in u){var c=n.get(o);c&&(u.value=w(c))}else if(u===void 0){var h=n.get(o),f=h==null?void 0:h.v;if(h!==void 0&&f!==Se)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return u},has(l,o){var f;if(o===qt)return!0;var u=n.get(o),c=u!==void 0&&u.v!==Se||Reflect.has(l,o);if(u!==void 0||Z!==null&&(!c||(f=fn(l,o))!=null&&f.writable)){u===void 0&&(u=a(()=>{var d=c?et(l[o]):Se,p=ie(d);return p}),n.set(o,u));var h=w(u);if(h===Se)return!1}return c},set(l,o,u,c){var E;var h=n.get(o),f=o in l;if(s&&o==="length")for(var d=u;d<h.v;d+=1){var p=n.get(d+"");p!==void 0?L(p,Se):d in l&&(p=a(()=>ie(Se)),n.set(d+"",p))}if(h===void 0)(!f||(E=fn(l,o))!=null&&E.writable)&&(h=a(()=>ie(void 0)),L(h,et(u)),n.set(o,h));else{f=h.v!==Se;var g=a(()=>et(u));L(h,g)}var v=Reflect.getOwnPropertyDescriptor(l,o);if(v!=null&&v.set&&v.set.call(c,u),!f){if(s&&typeof o=="string"){var k=n.get("length"),C=Number(o);Number.isInteger(C)&&C>=k.v&&L(k,C+1)}Gn(i)}return!0},ownKeys(l){w(i);var o=Reflect.ownKeys(l).filter(h=>{var f=n.get(h);return f===void 0||f.v!==Se});for(var[u,c]of n)c.v!==Se&&!(u in l)&&o.push(u);return o},setPrototypeOf(){Ll()}})}function Yr(t){try{if(t!==null&&typeof t=="object"&&qt in t)return t[qt]}catch{}return t}function ac(t,e){return Object.is(Yr(t),Yr(e))}var Jr,Qr,Zr,$r;function lc(){if(Jr===void 0){Jr=window,Qr=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Zr=fn(e,"firstChild").get,$r=fn(e,"nextSibling").get,Ar(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Ar(n)&&(n.__t=void 0)}}function bt(t=""){return document.createTextNode(t)}function wt(t){return Zr.call(t)}function Kn(t){return $r.call(t)}function B(t,e){return wt(t)}function Xt(t,e=!1){{var n=wt(t);return n instanceof Comment&&n.data===""?Kn(n):n}}function K(t,e=1,n=!1){let s=t;for(;e--;)s=Kn(s);return s}function cc(t){t.textContent=""}function eo(){return!1}let to=!1;function uc(){to||(to=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n.__on_r)==null||e.call(n)})},{capture:!0}))}function ys(t){var e=X,n=Z;Re(null),nt(null);try{return t()}finally{Re(e),nt(n)}}function hc(t,e,n,s=n){t.addEventListener(e,()=>ys(n));const i=t.__on_r;i?t.__on_r=()=>{i(),s(!0)}:t.__on_r=()=>s(!0),uc()}function fc(t){Z===null&&(X===null&&Ol(),Dl()),Yt&&Rl()}function dc(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function yt(t,e,n){var s=Z;s!==null&&s.f&Ae&&(t|=Ae);var i={ctx:fe,deps:null,nodes_start:null,nodes_end:null,f:t|xe|Xe,first:null,fn:e,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(n)try{Zn(i),i.f|=fi}catch(l){throw Ne(i),l}else e!==null&&Gt(i);var r=i;if(n&&r.deps===null&&r.teardown===null&&r.nodes_start===null&&r.first===r.last&&!(r.f&dn)&&(r=r.first,t&pt&&t&Ut&&r!==null&&(r.f|=Ut)),r!==null&&(r.parent=s,s!==null&&dc(r,s),X!==null&&X.f&be&&!(t&zt))){var a=X;(a.effects??(a.effects=[])).push(r)}return i}function Xn(){return X!==null&&!tt}function Si(t){const e=yt(hi,null,!1);return _e(e,we),e.teardown=t,e}function Yn(t){fc();var e=Z.f,n=!X&&(e>)!==0&&(e&fi)===0;if(n){var s=fe;(s.e??(s.e=[])).push(t)}else return no(t)}function no(t){return yt(ui|xl,t,!1)}function pc(t){vt.ensure();const e=yt(zt|dn,t,!0);return(n={})=>new Promise(s=>{n.outro?yn(e,()=>{Ne(e),s(void 0)}):(Ne(e),s(void 0))})}function so(t){return yt(ui,t,!1)}function gc(t){return yt(pi|dn,t,!0)}function _i(t,e=0){return yt(hi|e,t,!0)}function J(t,e=[],n=[],s=[]){tc(s,e,n,i=>{yt(hi,()=>t(...i.map(w)),!0)})}function Ss(t,e=0){var n=yt(pt|e,t,!0);return n}function We(t){return yt(gt|dn,t,!0)}function io(t){var e=t.teardown;if(e!==null){const n=Yt,s=X;uo(!0),Re(null);try{e.call(null)}finally{uo(n),Re(s)}}}function ro(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const i=n.ac;i!==null&&ys(()=>{i.abort(pn)});var s=n.next;n.f&zt?n.parent=null:Ne(n,e),n=s}}function mc(t){for(var e=t.first;e!==null;){var n=e.next;e.f>||Ne(e),e=n}}function Ne(t,e=!0){var n=!1;(e||t.f&Lr)&&t.nodes_start!==null&&t.nodes_end!==null&&(vc(t.nodes_start,t.nodes_end),n=!0),ro(t,e&&!n),ks(t,0),_e(t,mt);var s=t.transitions;if(s!==null)for(const r of s)r.stop();io(t);var i=t.parent;i!==null&&i.first!==null&&oo(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function vc(t,e){for(;t!==null;){var n=t===e?null:Kn(t);t.remove(),t=n}}function oo(t){var e=t.parent,n=t.prev,s=t.next;n!==null&&(n.next=s),s!==null&&(s.prev=n),e!==null&&(e.first===t&&(e.first=s),e.last===t&&(e.last=n))}function yn(t,e,n=!0){var s=[];ki(t,s,!0),ao(s,()=>{n&&Ne(t),e&&e()})}function ao(t,e){var n=t.length;if(n>0){var s=()=>--n||e();for(var i of t)i.out(s)}else e()}function ki(t,e,n){if(!(t.f&Ae)){if(t.f^=Ae,t.transitions!==null)for(const a of t.transitions)(a.is_global||n)&&e.push(a);for(var s=t.first;s!==null;){var i=s.next,r=(s.f&Ut)!==0||(s.f>)!==0&&(t.f&pt)!==0;ki(s,e,r?n:!1),s=i}}}function Ti(t){lo(t,!0)}function lo(t,e){if(t.f&Ae){t.f^=Ae,t.f&we||(_e(t,xe),Gt(t));for(var n=t.first;n!==null;){var s=n.next,i=(n.f&Ut)!==0||(n.f>)!==0;lo(n,i?e:!1),n=s}if(t.transitions!==null)for(const r of t.transitions)(r.is_global||e)&&r.in()}}function co(t,e){for(var n=t.nodes_start,s=t.nodes_end;n!==null;){var i=n===s?null:Kn(n);e.append(n),n=i}}let Nt=!1;function _s(t){Nt=t}let Yt=!1;function uo(t){Yt=t}let X=null,tt=!1;function Re(t){X=t}let Z=null;function nt(t){Z=t}let Ee=null;function ho(t){X!==null&&!Ul&&(Ee===null?Ee=[t]:Ee.push(t))}let Ie=null,Pe=0,je=null;function bc(t){je=t}let fo=1,Jn=0,Jt=Jn;function po(t){Jt=t}function go(){return++fo}function Qn(t){var e=t.f;if(e&xe)return!0;if(e&be&&(t.f&=~Ht),e&$e){var n=t.deps;if(n!==null)for(var s=n.length,i=0;i<s;i++){var r=n[i];if(Qn(r)&&Vr(r),r.wv>t.wv)return!0}e&Xe&&de===null&&_e(t,we)}return!1}function mo(t,e,n=!0){var s=t.reactions;if(s!==null&&!(Ee!=null&&Ee.includes(t)))for(var i=0;i<s.length;i++){var r=s[i];r.f&be?mo(r,e,!1):e===r&&(n?_e(r,xe):r.f&we&&_e(r,$e),Gt(r))}}function vo(t){var p;var e=Ie,n=Pe,s=je,i=X,r=Ee,a=fe,l=tt,o=Jt,u=t.f;Ie=null,Pe=0,je=null,X=u&(gt|zt)?null:t,Ee=null,mn(t.ctx),tt=!1,Jt=++Jn,t.ac!==null&&(ys(()=>{t.ac.abort(pn)}),t.ac=null);try{t.f|=di;var c=t.fn,h=c(),f=t.deps;if(Ie!==null){var d;if(ks(t,Pe),f!==null&&Pe>0)for(f.length=Pe+Ie.length,d=0;d<Ie.length;d++)f[Pe+d]=Ie[d];else t.deps=f=Ie;if(Nt&&Xn()&&t.f&Xe)for(d=Pe;d<f.length;d++)((p=f[d]).reactions??(p.reactions=[])).push(t)}else f!==null&&Pe<f.length&&(ks(t,Pe),f.length=Pe);if(Un()&&je!==null&&!tt&&f!==null&&!(t.f&(be|$e|xe)))for(d=0;d<je.length;d++)mo(je[d],t);return i!==null&&i!==t&&(Jn++,je!==null&&(s===null?s=je:s.push(...je))),t.f&xt&&(t.f^=xt),h}catch(g){return jr(g)}finally{t.f^=di,Ie=e,Pe=n,je=s,X=i,Ee=r,mn(a),tt=l,Jt=o}}function wc(t,e){let n=e.reactions;if(n!==null){var s=bl.call(n,t);if(s!==-1){var i=n.length-1;i===0?n=e.reactions=null:(n[s]=n[i],n.pop())}}n===null&&e.f&be&&(Ie===null||!Ie.includes(e))&&(_e(e,$e),e.f&Xe&&(e.f^=Xe,e.f&=~Ht),qr(e),ks(e,0))}function ks(t,e){var n=t.deps;if(n!==null)for(var s=e;s<n.length;s++)wc(t,n[s])}function Zn(t){var e=t.f;if(!(e&mt)){_e(t,we);var n=Z,s=Nt;Z=t,Nt=!0;try{e&(pt|Tl)?mc(t):ro(t),io(t);var i=vo(t);t.teardown=typeof i=="function"?i:null,t.wv=fo;var r;ai&&Hl&&t.f&xe&&t.deps}finally{Nt=s,Z=n}}}async function yc(){await Promise.resolve(),Gl()}function w(t){var e=t.f,n=(e&be)!==0;if(X!==null&&!tt){var s=Z!==null&&(Z.f&mt)!==0;if(!s&&!(Ee!=null&&Ee.includes(t))){var i=X.deps;if(X.f&di)t.rv<Jn&&(t.rv=Jn,Ie===null&&i!==null&&i[Pe]===t?Pe++:Ie===null?Ie=[t]:Ie.includes(t)||Ie.push(t));else{(X.deps??(X.deps=[])).push(t);var r=t.reactions;r===null?t.reactions=[X]:r.includes(X)||r.push(X)}}}if(Yt){if(Ct.has(t))return Ct.get(t);if(n){var a=t,l=a.v;return(!(a.f&we)&&a.reactions!==null||wo(a))&&(l=wi(a)),Ct.set(a,l),l}}else n&&(!(de!=null&&de.has(t))||q!=null&&q.is_fork&&!Xn())&&(a=t,Qn(a)&&Vr(a),Nt&&Xn()&&!(a.f&Xe)&&bo(a));if(de!=null&&de.has(t))return de.get(t);if(t.f&xt)throw t.v;return t.v}function bo(t){if(t.deps!==null){t.f^=Xe;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),e.f&be&&!(e.f&Xe)&&bo(e)}}function wo(t){if(t.v===Se)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(Ct.has(e)||e.f&be&&wo(e))return!0;return!1}function $n(t){var e=tt;try{return tt=!0,t()}finally{tt=e}}const Sc=~(xe|$e|we);function _e(t,e){t.f=t.f&Sc|e}const yo=new Set,xi=new Set;function _c(t,e,n,s={}){function i(r){if(s.capture||es.call(e,r),!r.cancelBubble)return ys(()=>n==null?void 0:n.call(this,r))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?vn(()=>{e.addEventListener(t,i,s)}):e.addEventListener(t,i,s),i}function Qt(t,e,n,s,i){var r={capture:s,passive:i},a=_c(t,e,n,r);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Si(()=>{e.removeEventListener(t,a,r)})}function Ts(t){for(var e=0;e<t.length;e++)yo.add(t[e]);for(var n of xi)n(t)}let So=null;function es(t){var v;var e=this,n=e.ownerDocument,s=t.type,i=((v=t.composedPath)==null?void 0:v.call(t))||[],r=i[0]||t.target;So=t;var a=0,l=So===t&&t.__root;if(l){var o=i.indexOf(l);if(o!==-1&&(e===document||e===window)){t.__root=e;return}var u=i.indexOf(e);if(u===-1)return;o<=u&&(a=o)}if(r=i[a]||t.target,r!==e){wl(t,"currentTarget",{configurable:!0,get(){return r||n}});var c=X,h=Z;Re(null),nt(null);try{for(var f,d=[];r!==null;){var p=r.assignedSlot||r.parentNode||r.host||null;try{var g=r["__"+s];g!=null&&(!r.disabled||t.target===r)&&g.call(r,t)}catch(k){f?d.push(k):f=k}if(t.cancelBubble||p===e||p===null)break;r=p}if(f){for(let k of d)queueMicrotask(()=>{throw k});throw f}}finally{t.__root=e,delete t.currentTarget,Re(c),nt(h)}}}function _o(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function Sn(t,e){var n=Z;n.nodes_start===null&&(n.nodes_start=t,n.nodes_end=e)}function Y(t,e){var n=(e&Dr)!==0,s=(e&ml)!==0,i,r=!t.startsWith("<!>");return()=>{i===void 0&&(i=_o(r?t:"<!>"+t),n||(i=wt(i)));var a=s||Qr?document.importNode(i,!0):i.cloneNode(!0);if(n){var l=wt(a),o=a.lastChild;Sn(l,o)}else Sn(a,a);return a}}function kc(t,e,n="svg"){var s=!t.startsWith("<!>"),i=(e&Dr)!==0,r=`<${n}>${s?t:"<!>"+t}</${n}>`,a;return()=>{if(!a){var l=_o(r),o=wt(l);if(i)for(a=document.createDocumentFragment();wt(o);)a.appendChild(wt(o));else a=wt(o)}var u=a.cloneNode(!0);if(i){var c=wt(u),h=u.lastChild;Sn(c,h)}else Sn(u,u);return u}}function xs(t,e){return kc(t,e,"svg")}function Ei(t=""){{var e=bt(t+"");return Sn(e,e),e}}function _n(){var t=document.createDocumentFragment(),e=document.createComment(""),n=bt();return t.append(e,n),Sn(e,n),t}function F(t,e){t!==null&&t.before(e)}const Tc=["touchstart","touchmove"];function xc(t){return Tc.includes(t)}function ee(t,e){var n=e==null?"":typeof e=="object"?e+"":e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=n+"")}function Ec(t,e){return Ic(t,e)}const kn=new Map;function Ic(t,{target:e,anchor:n,props:s={},events:i,context:r,intro:a=!0}){lc();var l=new Set,o=h=>{for(var f=0;f<h.length;f++){var d=h[f];if(!l.has(d)){l.add(d);var p=xc(d);e.addEventListener(d,es,{passive:p});var g=kn.get(d);g===void 0?(document.addEventListener(d,es,{passive:p}),kn.set(d,1)):kn.set(d,g+1)}}};o(ci(yo)),xi.add(o);var u=void 0,c=pc(()=>{var h=n??e.appendChild(bt());return Jl(h,{pending:()=>{}},f=>{if(r){Et({});var d=fe;d.c=r}i&&(s.$$events=i),u=t(f,s)||{},r&&It()}),()=>{var p;for(var f of l){e.removeEventListener(f,es);var d=kn.get(f);--d===0?(document.removeEventListener(f,es),kn.delete(f)):kn.set(f,d)}xi.delete(o),h!==n&&((p=h.parentNode)==null||p.removeChild(h))}});return Cc.set(u,c),u}let Cc=new WeakMap;class ko{constructor(e,n=!0){dt(this,"anchor");z(this,Ze,new Map);z(this,ft,new Map);z(this,Le,new Map);z(this,an,new Set);z(this,us,!0);z(this,hs,()=>{var e=q;if(b(this,Ze).has(e)){var n=b(this,Ze).get(e),s=b(this,ft).get(n);if(s)Ti(s),b(this,an).delete(n);else{var i=b(this,Le).get(n);i&&(b(this,ft).set(n,i.effect),b(this,Le).delete(n),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),s=i.effect)}for(const[r,a]of b(this,Ze)){if(b(this,Ze).delete(r),r===e)break;const l=b(this,Le).get(a);l&&(Ne(l.effect),b(this,Le).delete(a))}for(const[r,a]of b(this,ft)){if(r===n||b(this,an).has(r))continue;const l=()=>{if(Array.from(b(this,Ze).values()).includes(r)){var u=document.createDocumentFragment();co(a,u),u.append(bt()),b(this,Le).set(r,{effect:a,fragment:u})}else Ne(a);b(this,an).delete(r),b(this,ft).delete(r)};b(this,us)||!s?(b(this,an).add(r),yn(a,l,!1)):l()}}});z(this,ni,e=>{b(this,Ze).delete(e);const n=Array.from(b(this,Ze).values());for(const[s,i]of b(this,Le))n.includes(s)||(Ne(i.effect),b(this,Le).delete(s))});this.anchor=e,j(this,us,n)}ensure(e,n){var s=q,i=eo();if(n&&!b(this,ft).has(e)&&!b(this,Le).has(e))if(i){var r=document.createDocumentFragment(),a=bt();r.append(a),b(this,Le).set(e,{effect:We(()=>n(a)),fragment:r})}else b(this,ft).set(e,We(()=>n(this.anchor)));if(b(this,Ze).set(s,e),i){for(const[l,o]of b(this,ft))l===e?s.skipped_effects.delete(o):s.skipped_effects.add(o);for(const[l,o]of b(this,Le))l===e?s.skipped_effects.delete(o.effect):s.skipped_effects.add(o.effect);s.oncommit(b(this,hs)),s.ondiscard(b(this,ni))}else b(this,hs).call(this)}}Ze=new WeakMap,ft=new WeakMap,Le=new WeakMap,an=new WeakMap,us=new WeakMap,hs=new WeakMap,ni=new WeakMap;function Ii(t){fe===null&&Cl(),gn&&fe.l!==null?Nc(fe).m.push(t):Yn(()=>{const e=$n(t);if(typeof e=="function")return e})}function Nc(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}function ne(t,e,n=!1){var s=new ko(t),i=n?Ut:0;function r(a,l){s.ensure(a,l)}Ss(()=>{var a=!1;e((l,o=!0)=>{a=!0,r(o,l)}),a||r(!1,null)},i)}function To(t,e,n,s,i){var l;var r=(l=e.$$slots)==null?void 0:l[n],a=!1;r===!0&&(r=e[n==="default"?"children":n],a=!0),r===void 0?i!==null&&i(t):r(t,a?()=>s:s)}function Rc(t,e,n){var s=new ko(t);Ss(()=>{var i=e()??null;s.ensure(i,i&&(r=>n(r,i)))},Ut)}function Rt(t,e){so(()=>{var n=t.getRootNode(),s=n.host?n:n.head??n.ownerDocument.head;if(!s.querySelector("#"+e.hash)){const i=document.createElement("style");i.id=e.hash,i.textContent=e.code,s.appendChild(i)}})}function xo(t){var e,n,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=xo(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function Dc(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=xo(t))&&(s&&(s+=" "),s+=e);return s}function Tn(t){return typeof t=="object"?Dc(t):t??""}const Eo=[...`
|
|
2
|
+
\r\f \v\uFEFF`];function Oc(t,e,n){var s=t==null?"":""+t;if(e&&(s=s?s+" "+e:e),n){for(var i in n)if(n[i])s=s?s+" "+i:i;else if(s.length)for(var r=i.length,a=0;(a=s.indexOf(i,a))>=0;){var l=a+r;(a===0||Eo.includes(s[a-1]))&&(l===s.length||Eo.includes(s[l]))?s=(a===0?"":s.substring(0,a))+s.substring(l+1):a=l}}return s===""?null:s}function Dt(t,e,n,s,i,r){var a=t.__className;if(a!==n||a===void 0){var l=Oc(n,s,r);l==null?t.removeAttribute("class"):e?t.className=l:t.setAttribute("class",l),t.__className=n}else if(r&&i!==r)for(var o in r){var u=!!r[o];(i==null||u!==!!i[o])&&t.classList.toggle(o,u)}return r}function Io(t,e,n=!1){if(t.multiple){if(e==null)return;if(!li(e))return Wl();for(var s of t.options)s.selected=e.includes(Co(s));return}for(s of t.options){var i=Co(s);if(ac(i,e)){s.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function Ac(t){var e=new MutationObserver(()=>{Io(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Si(()=>{e.disconnect()})}function Co(t){return"__value"in t?t.__value:t.value}const Pc=Symbol("is custom element"),Mc=Symbol("is html");function Lc(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function ye(t,e,n,s){var i=Bc(t);i[e]!==(i[e]=n)&&(e==="loading"&&(t[Il]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Fc(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function Bc(t){return t.__attributes??(t.__attributes={[Pc]:t.nodeName.includes("-"),[Mc]:t.namespaceURI===vl})}var No=new Map;function Fc(t){var e=t.getAttribute("is")||t.nodeName,n=No.get(e);if(n)return n;No.set(e,n=[]);for(var s,i=t,r=Element.prototype;r!==i;){s=yl(i);for(var a in s)s[a].set&&n.push(a);i=Or(i)}return n}function Wc(t,e,n=e){var s=new WeakSet;hc(t,"input",async i=>{var r=i?t.defaultValue:t.value;if(r=Ci(t)?Ni(r):r,n(r),q!==null&&s.add(q),await yc(),r!==(r=e())){var a=t.selectionStart,l=t.selectionEnd,o=t.value.length;if(t.value=r??"",l!==null){var u=t.value.length;a===l&&l===o&&u>o?(t.selectionStart=u,t.selectionEnd=u):(t.selectionStart=a,t.selectionEnd=Math.min(l,u))}}}),$n(e)==null&&t.value&&(n(Ci(t)?Ni(t.value):t.value),q!==null&&s.add(q)),_i(()=>{var i=e();if(t===document.activeElement){var r=ms??q;if(s.has(r))return}Ci(t)&&i===Ni(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function Ci(t){var e=t.type;return e==="number"||e==="range"}function Ni(t){return t===""?null:+t}function Ro(t,e){return t===e||(t==null?void 0:t[qt])===e}function jc(t={},e,n,s){return so(()=>{var i,r;return _i(()=>{i=r,r=(s==null?void 0:s())||[],$n(()=>{t!==n(...r)&&(e(t,...r),i&&Ro(n(...i),t)&&e(null,...i))})}),()=>{vn(()=>{r&&Ro(n(...r),t)&&e(null,...r)})}}),t}let Es=!1;function zc(t){var e=Es;try{return Es=!1,[t(),Es]}finally{Es=e}}function Me(t,e,n,s){var E;var i=!gn||(n&fl)!==0,r=(n&pl)!==0,a=(n&gl)!==0,l=s,o=!0,u=()=>(o&&(o=!1,l=a?$n(s):s),l),c;if(r){var h=qt in t||El in t;c=((E=fn(t,e))==null?void 0:E.set)??(h&&e in t?m=>t[e]=m:void 0)}var f,d=!1;r?[f,d]=zc(()=>t[e]):f=t[e],f===void 0&&s!==void 0&&(f=u(),c&&(i&&Pl(),c(f)));var p;if(i?p=()=>{var m=t[e];return m===void 0?u():(o=!0,m)}:p=()=>{var m=t[e];return m!==void 0&&(l=void 0),m===void 0?l:m},i&&!(n&dl))return p;if(c){var g=t.$$legacy;return function(m,y){return arguments.length>0?((!i||!y||g||d)&&c(y?p():m),m):p()}}var v=!1,k=(n&hl?ws:bi)(()=>(v=!1,p()));r&&w(k);var C=Z;return function(m,y){if(arguments.length>0){const T=y?w(k):i&&r?et(m):m;return L(k,T),v=!0,l!==void 0&&(l=T),m}return Yt&&v||C.f&mt?k.v:w(k)}}function Do(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Ri(t,e,n){let s="";if(n){const i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3),s="; expires="+i.toUTCString()}document.cookie=t+"="+(e||"")+s+"; path=/; secure; samesite=strict"}function Di(t){const e=t+"=",n=document.cookie.split(";");for(let s=0;s<n.length;s++){let i=n[s];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null}function Oo(){const t="uniqueUserID";let e=Di(t);return e||(e=Do(),Ri(t,e,365)),e}function st(t,e,n={},s={}){const i="https://admin-api.wineater.com/api/widget-events";let r=Di("uniqueUserID");r||(r=Oo());const a={user_agent:navigator.userAgent,screen_width:window.screen.width,screen_height:window.screen.height,language:navigator.language,platform:navigator.platform},l=new Date().toISOString();let o=Di("sessionID");o||(o=Do(),Ri("sessionID",o,1));const u={event_type:t,store_id:e,session_id:o,event_time:l,data:n,meta:{...s,user_id:r},device_info:a,region:navigator.language.split("-")[1]||null,language:navigator.language.split("-")[0]||"en"};return fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)}).then(c=>c.ok?c.json():c.json().then(h=>{throw new Error(h.message||"Failed to track widget event")})).catch(c=>{throw console.error("Widget event tracking error:",c),c})}var Ao={},Uc=function(t,e,n,s,i){var r=new Worker(Ao[e]||(Ao[e]=URL.createObjectURL(new Blob([t+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return r.onmessage=function(a){var l=a.data,o=l.$e$;if(o){var u=new Error(o[0]);u.code=o[1],u.stack=o[2],i(u,null)}else i(null,l)},r.postMessage(n,s),r},ze=Uint8Array,De=Uint16Array,Is=Int32Array,Cs=new ze([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ns=new ze([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Oi=new ze([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Po=function(t,e){for(var n=new De(31),s=0;s<31;++s)n[s]=e+=1<<t[s-1];for(var i=new Is(n[30]),s=1;s<30;++s)for(var r=n[s];r<n[s+1];++r)i[r]=r-n[s]<<5|s;return{b:n,r:i}},Mo=Po(Cs,2),Hc=Mo.b,Rs=Mo.r;Hc[28]=258,Rs[258]=28;for(var qc=Po(Ns,0),Ai=qc.r,Ds=new De(32768),se=0;se<32768;++se){var Ot=(se&43690)>>1|(se&21845)<<1;Ot=(Ot&52428)>>2|(Ot&13107)<<2,Ot=(Ot&61680)>>4|(Ot&3855)<<4,Ds[se]=((Ot&65280)>>8|(Ot&255)<<8)>>1}for(var xn=function(t,e,n){for(var s=t.length,i=0,r=new De(e);i<s;++i)t[i]&&++r[t[i]-1];var a=new De(e);for(i=1;i<e;++i)a[i]=a[i-1]+r[i-1]<<1;var l;if(n){l=new De(1<<e);var o=15-e;for(i=0;i<s;++i)if(t[i])for(var u=i<<4|t[i],c=e-t[i],h=a[t[i]-1]++<<c,f=h|(1<<c)-1;h<=f;++h)l[Ds[h]>>o]=u}else for(l=new De(s),i=0;i<s;++i)t[i]&&(l[i]=Ds[a[t[i]-1]++]>>15-t[i]);return l},At=new ze(288),se=0;se<144;++se)At[se]=8;for(var se=144;se<256;++se)At[se]=9;for(var se=256;se<280;++se)At[se]=7;for(var se=280;se<288;++se)At[se]=8;for(var ts=new ze(32),se=0;se<32;++se)ts[se]=5;var Lo=xn(At,9,0),Bo=xn(ts,5,0),Pi=function(t){return(t+7)/8|0},Fo=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new ze(t.subarray(e,n))},Vc=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Wo=function(t,e,n){var s=new Error(e||Vc[t]);if(s.code=t,Error.captureStackTrace&&Error.captureStackTrace(s,Wo),!n)throw s;return s},it=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8},En=function(t,e,n){n<<=e&7;var s=e/8|0;t[s]|=n,t[s+1]|=n>>8,t[s+2]|=n>>16},Os=function(t,e){for(var n=[],s=0;s<t.length;++s)t[s]&&n.push({s,f:t[s]});var i=n.length,r=n.slice();if(!i)return{t:Fi,l:0};if(i==1){var a=new ze(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(y,T){return y.f-T.f}),n.push({s:-1,f:25001});var l=n[0],o=n[1],u=0,c=1,h=2;for(n[0]={s:-1,f:l.f+o.f,l,r:o};c!=i-1;)l=n[n[u].f<n[h].f?u++:h++],o=n[u!=c&&n[u].f<n[h].f?u++:h++],n[c++]={s:-1,f:l.f+o.f,l,r:o};for(var f=r[0].s,s=1;s<i;++s)r[s].s>f&&(f=r[s].s);var d=new De(f+1),p=As(n[c-1],d,0);if(p>e){var s=0,g=0,v=p-e,k=1<<v;for(r.sort(function(T,x){return d[x.s]-d[T.s]||T.f-x.f});s<i;++s){var C=r[s].s;if(d[C]>e)g+=k-(1<<p-d[C]),d[C]=e;else break}for(g>>=v;g>0;){var E=r[s].s;d[E]<e?g-=1<<e-d[E]++-1:++s}for(;s>=0&&g;--s){var m=r[s].s;d[m]==e&&(--d[m],++g)}p=e}return{t:new ze(d),l:p}},As=function(t,e,n){return t.s==-1?Math.max(As(t.l,e,n+1),As(t.r,e,n+1)):e[t.s]=n},Mi=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new De(++e),s=0,i=t[0],r=1,a=function(o){n[s++]=o},l=1;l<=e;++l)if(t[l]==i&&l!=e)++r;else{if(!i&&r>2){for(;r>138;r-=138)a(32754);r>2&&(a(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(a(i),--r;r>6;r-=6)a(8304);r>2&&(a(r-3<<5|8208),r=0)}for(;r--;)a(i);r=1,i=t[l]}return{c:n.subarray(0,s),n:e}},In=function(t,e){for(var n=0,s=0;s<e.length;++s)n+=t[s]*e[s];return n},Li=function(t,e,n){var s=n.length,i=Pi(e+2);t[i]=s&255,t[i+1]=s>>8,t[i+2]=t[i]^255,t[i+3]=t[i+1]^255;for(var r=0;r<s;++r)t[i+r+4]=n[r];return(i+4+s)*8},Bi=function(t,e,n,s,i,r,a,l,o,u,c){it(e,c++,n),++i[256];for(var h=Os(i,15),f=h.t,d=h.l,p=Os(r,15),g=p.t,v=p.l,k=Mi(f),C=k.c,E=k.n,m=Mi(g),y=m.c,T=m.n,x=new De(19),S=0;S<C.length;++S)++x[C[S]&31];for(var S=0;S<y.length;++S)++x[y[S]&31];for(var _=Os(x,7),A=_.t,W=_.l,D=19;D>4&&!A[Oi[D-1]];--D);var U=u+5<<3,R=In(i,At)+In(r,ts)+a,P=In(i,f)+In(r,g)+a+14+3*D+In(x,A)+2*x[16]+3*x[17]+7*x[18];if(o>=0&&U<=R&&U<=P)return Li(e,c,t.subarray(o,o+u));var I,O,M,H;if(it(e,c,1+(P<R)),c+=2,P<R){I=xn(f,d,0),O=f,M=xn(g,v,0),H=g;var Ce=xn(A,W,0);it(e,c,E-257),it(e,c+5,T-1),it(e,c+10,D-4),c+=14;for(var S=0;S<D;++S)it(e,c+3*S,A[Oi[S]]);c+=3*D;for(var Q=[C,y],Te=0;Te<2;++Te)for(var ue=Q[Te],S=0;S<ue.length;++S){var re=ue[S]&31;it(e,c,Ce[re]),c+=A[re],re>15&&(it(e,c,ue[S]>>5&127),c+=ue[S]>>12)}}else I=Lo,O=At,M=Bo,H=ts;for(var S=0;S<l;++S){var N=s[S];if(N>255){var re=N>>18&31;En(e,c,I[re+257]),c+=O[re+257],re>7&&(it(e,c,N>>23&31),c+=Cs[re]);var V=N&31;En(e,c,M[V]),c+=H[V],V>3&&(En(e,c,N>>5&8191),c+=Ns[V])}else En(e,c,I[N]),c+=O[N]}return En(e,c,I[256]),c+O[256]},jo=new Is([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Fi=new ze(0),zo=function(t,e,n,s,i,r){var a=r.z||t.length,l=new ze(s+a+5*(1+Math.ceil(a/7e3))+i),o=l.subarray(s,l.length-i),u=r.l,c=(r.r||0)&7;if(e){c&&(o[0]=r.r>>3);for(var h=jo[e-1],f=h>>13,d=h&8191,p=(1<<n)-1,g=r.p||new De(32768),v=r.h||new De(p+1),k=Math.ceil(n/3),C=2*k,E=function(un){return(t[un]^t[un+1]<<k^t[un+2]<<C)&p},m=new Is(25e3),y=new De(288),T=new De(32),x=0,S=0,_=r.i||0,A=0,W=r.w||0,D=0;_+2<a;++_){var U=E(_),R=_&32767,P=v[U];if(g[R]=P,v[U]=R,W<=_){var I=a-_;if((x>7e3||A>24576)&&(I>423||!u)){c=Bi(t,o,0,m,y,T,S,A,D,_-D,c),A=x=S=0,D=_;for(var O=0;O<286;++O)y[O]=0;for(var O=0;O<30;++O)T[O]=0}var M=2,H=0,Ce=d,Q=R-P&32767;if(I>2&&U==E(_-Q))for(var Te=Math.min(f,I)-1,ue=Math.min(32767,_),re=Math.min(258,I);Q<=ue&&--Ce&&R!=P;){if(t[_+M]==t[_+M-Q]){for(var N=0;N<re&&t[_+N]==t[_+N-Q];++N);if(N>M){if(M=N,H=Q,N>Te)break;for(var V=Math.min(Q,N-2),he=0,O=0;O<V;++O){var Tt=_-Q+O&32767,cn=g[Tt],Wt=Tt-cn&32767;Wt>he&&(he=Wt,P=Tt)}}}R=P,P=g[R],Q+=R-P&32767}if(H){m[A++]=268435456|Rs[M]<<18|Ai[H];var Ke=Rs[M]&31,fs=Ai[H]&31;S+=Cs[Ke]+Ns[fs],++y[257+Ke],++T[fs],W=_+M,++x}else m[A++]=t[_],++y[t[_]]}}for(_=Math.max(_,W);_<a;++_)m[A++]=t[_],++y[t[_]];c=Bi(t,o,u,m,y,T,S,A,D,_-D,c),u||(r.r=c&7|o[c/8|0]<<3,c-=7,r.h=v,r.p=g,r.i=_,r.w=W)}else{for(var _=r.w||0;_<a+u;_+=65535){var jt=_+65535;jt>=a&&(o[c/8|0]=u,jt=a),c=Li(o,c+1,t.subarray(_,jt))}r.i=a}return Fo(l,0,s+Pi(c)+i)},Uo=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,s=9;--s;)n=(n&1&&-306674912)^n>>>1;t[e]=n}return t}(),Ho=function(){var t=-1;return{p:function(e){for(var n=t,s=0;s<e.length;++s)n=Uo[n&255^e[s]]^n>>>8;t=n},d:function(){return~t}}},Wi=function(t,e,n,s,i){if(!i&&(i={l:1},e.dictionary)){var r=e.dictionary.subarray(-32768),a=new ze(r.length+t.length);a.set(r),a.set(t,r.length),t=a,i.w=r.length}return zo(t,e.level==null?6:e.level,e.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,s,i)},Gc=function(t,e){var n={};for(var s in t)n[s]=t[s];for(var s in e)n[s]=e[s];return n},qo=function(t,e,n){for(var s=t(),i=t.toString(),r=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),a=0;a<s.length;++a){var l=s[a],o=r[a];if(typeof l=="function"){e+=";"+o+"=";var u=l.toString();if(l.prototype)if(u.indexOf("[native code]")!=-1){var c=u.indexOf(" ",8)+1;e+=u.slice(c,u.indexOf("(",c))}else{e+=u;for(var h in l.prototype)e+=";"+o+".prototype."+h+"="+l.prototype[h].toString()}else e+=u}else n[o]=l}return e},Ps=[],Kc=function(t){var e=[];for(var n in t)t[n].buffer&&e.push((t[n]=new t[n].constructor(t[n])).buffer);return e},Xc=function(t,e,n,s){if(!Ps[n]){for(var i="",r={},a=t.length-1,l=0;l<a;++l)i=qo(t[l],i,r);Ps[n]={c:qo(t[a],i,r),e:r}}var o=Gc({},Ps[n].e);return Uc(Ps[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,o,Kc(o),s)},Yc=function(){return[ze,De,Is,Cs,Ns,Oi,Rs,Ai,Lo,At,Bo,ts,Ds,jo,Fi,xn,it,En,Os,As,Mi,In,Li,Bi,Pi,Fo,zo,Wi,Zc,Vo]},Jc=function(){return[Go,Ko,Ms,Ho,Uo]},Vo=function(t){return postMessage(t,[t.buffer])},Qc=function(t,e,n,s,i,r){var a=Xc(n,s,i,function(l,o){a.terminate(),r(l,o)});return a.postMessage([t,e],e.consume?[t.buffer]:[]),function(){a.terminate()}},Ms=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},Go=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&Ms(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var s=0;s<=n.length;++s)t[s+10]=n.charCodeAt(s)}},Ko=function(t){return 10+(t.filename?t.filename.length+1:0)};function Zc(t,e){return Wi(t,e||{},0,0)}function $c(t,e,n){return n||(n=e,e={}),typeof n!="function"&&Wo(7),Qc(t,e,[Yc,Jc,function(){return[Xo]}],function(s){return Vo(Xo(s.data[0],s.data[1]))},2,n)}function Xo(t,e){e||(e={});var n=Ho(),s=t.length;n.p(t);var i=Wi(t,e,Ko(e),8),r=i.length;return Go(i,e),Ms(i,r-8,n.d()),Ms(i,r-4,s),i}var eu=typeof TextDecoder<"u"&&new TextDecoder,tu=0;try{eu.decode(Fi,{stream:!0}),tu=1}catch{}class Yo{constructor(){this.idx=1,this.backDict={}}getKey(e){let n=!1;return this.backDict[e]||(n=!0,this.backDict[e]=this.idx++),[this.backDict[e],n]}}class nu{constructor(e,n){this.app=e,this.isDictDisabled=n,this.dict=new Yo}sendSetAttribute(e,n,s){if(this.isDictDisabled){const i=[12,e,n,s];return this.app.send(i)}else{const i=[51,e,this.applyDict(n),this.applyDict(s)];return this.app.send(i)}}applyDict(e){const[n,s]=this.dict.getKey(e);return s&&this.app.send([50,n,e]),n}clear(){this.dict=new Yo}}class su{constructor(e,n){this.app=e,this.startParams=n,this.conditions=[],this.hasStarted=!1,this.createConditionFromFilter=s=>{if(s.value.length){const i=iu(s);if(i.type)return i}},this.durationInt=null}setConditions(e){this.conditions=e}async fetchConditions(e,n){try{const s=await fetch(`${this.app.options.ingestPoint}/v1/web/conditions/${e}`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}),{conditions:i}=await s.json(),r=[];i.forEach(a=>{a.filters.forEach(o=>{let u;o.type==="fetch"?(u={type:"network_request",subConditions:[],name:a.name},o.filters.forEach(c=>{const h=this.createConditionFromFilter(c);h&&u.subConditions.push(h)})):u=this.createConditionFromFilter(o),u&&(u.type==="session_duration"&&this.processDuration(u.value[0],a.name),r.push({...u,name:a.name}))})}),this.conditions=r}catch{this.app.debug.error("Critical: cannot fetch start conditions")}}trigger(e){if(!this.hasStarted)try{this.hasStarted=!0,this.app.start(this.startParams,void 0,e)}catch(n){this.app.debug.error(n)}}processMessage(e){if(!this.hasStarted)switch(e[0]){case 78:this.jsExceptionEvent(e);break;case 27:this.customEvent(e);break;case 68:this.clickEvent(e);break;case 122:this.pageLocationEvent(e);break;case 83:this.networkRequest(e);break}}processFlags(e){const n=this.conditions.filter(s=>s.type==="feature_flag");n.length&&n.forEach(s=>{const i=Cn[s.operator];i&&e.find(r=>i(r.key,s.value))&&this.trigger(s.name)})}processDuration(e,n){this.durationInt=setInterval(()=>{performance.now()>e&&this.trigger(n)},1e3),this.app.attachStopCallback(()=>{this.durationInt&&clearInterval(this.durationInt)})}networkRequest(e){const n=this.conditions.filter(s=>s.type==="network_request");n.length&&n.forEach(s=>{const i=s.subConditions.filter(r=>r.operator!=="isAny");i.length?i.every(a=>{let l;switch(a.key){case"url":l=e[3];break;case"status":l=e[6];break;case"method":l=e[2];break;case"duration":l=e[8];break}const o=Cn[a.operator];if(o&&o(l,a.value))return!0})&&this.trigger(s.name):i.length===0&&s.subConditions.length&&this.trigger(s.name)})}customEvent(e){const n=this.conditions.filter(s=>s.type==="custom_event");n.length&&n.forEach(s=>{const i=Cn[s.operator];i&&(i(e[1],s.value)||i(e[2],s.value))&&this.trigger(s.name)})}clickEvent(e){const n=this.conditions.filter(s=>s.type==="click");n.length&&n.forEach(s=>{const i=Cn[s.operator];i&&(i(e[3],s.value)||i(e[4],s.value))&&this.trigger(s.name)})}pageLocationEvent(e){const n=this.conditions.filter(s=>s.type==="visited_url");n&&n.forEach(s=>{const i=Cn[s.operator];i&&i(e[1],s.value)&&this.trigger(s.name)})}jsExceptionEvent(e){const n=[e[1],e[2],e[3]],s=this.conditions.filter(i=>i.type==="exception");s&&s.forEach(i=>{const r=Cn[i.operator];r&&n.some(a=>r(a,i.value))&&this.trigger(i.name)})}}const Cn={is:(t,e)=>e.some(n=>t.includes(n)),isAny:()=>!0,isNot:(t,e)=>!e.some(n=>t.includes(n)),contains:(t,e)=>e.some(n=>t.includes(n)),notContains:(t,e)=>!e.some(n=>t.includes(n)),startsWith:(t,e)=>e.some(n=>t.startsWith(n)),endsWith:(t,e)=>e.some(n=>t.endsWith(n)),greaterThan:(t,e)=>t>e,greaterOrEqual:(t,e)=>t>=e,lessOrEqual:(t,e)=>t<=e,lessThan:(t,e)=>t<e},iu=t=>{const e={on:"is",notOn:"isNot",">":"greaterThan","<":"lessThan","=":"is","<=":"lessOrEqual",">=":"greaterOrEqual"},n=i=>{if(Object.keys(e).includes(i))return e[i]};let s={type:"",operator:"",value:t.value,key:""};switch(t.type){case"click":s={type:"click",operator:n(t.operator),value:t.value,key:""};break;case"location":s={type:"visited_url",operator:t.operator,value:t.value,key:""};break;case"custom":s={type:"custom_event",operator:t.operator,value:t.value,key:""};break;case"metadata":s={type:t.source==="featureFlag"?"feature_flag":t.type,operator:t.operator,value:t.value,key:""};break;case"error":s={type:"exception",operator:t.operator,value:t.value,key:""};break;case"duration":s={type:"session_duration",value:t.value[0],key:""};break;case"fetchUrl":s={type:"network_request",key:"url",operator:t.operator,value:t.value};break;case"fetchStatusCode":s={type:"network_request",key:"status",operator:n(t.operator),value:t.value};break;case"fetchMethod":s={type:"network_request",key:"method",operator:n(t.operator),value:t.value};break;case"fetchDuration":s={type:"network_request",key:"duration",operator:n(t.operator),value:t.value};break}return s};class ru{constructor(e){this.app=e,this.flags=[],this.storageKey="__openreplay_flags";const n=this.app.sessionStorage.getItem(this.storageKey);if(n){const s=n.split(";").filter(Boolean);this.flags=s.map(i=>JSON.parse(i))}}getFeatureFlag(e){return this.flags.find(n=>n.key===e)}isFlagEnabled(e){return this.flags.findIndex(n=>n.key===e)!==-1}onFlagsLoad(e){this.onFlagsCb=e}async reloadFlags(e){const n=this.app.sessionStorage.getItem(this.storageKey),s={};n&&n.split(";").filter(Boolean).forEach(c=>{const h=JSON.parse(c);s[h.key]={key:h.key,value:h.value}});const i=this.app.session.getInfo(),r=this.app.session.userInfo,a={projectID:i.projectID,userID:i.userID,metadata:i.metadata,referrer:document.referrer,os:r.userOS,device:r.userDevice,country:r.userCountry,state:r.userState,city:r.userCity,browser:r.userBrowser,persistFlags:s},l=e??this.app.session.getSessionToken(),o=await fetch(this.app.options.ingestPoint+"/v1/web/feature-flags",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l}`},body:JSON.stringify(a)});if(o.status===200){const u=await o.json();return this.handleFlags(u.flags)}}handleFlags(e){var r;const n=[];e.forEach(a=>{a.is_persist&&n.push(a)});let s="";return this.diffPersist(n).forEach(a=>{s+=`${JSON.stringify(a)};`}),this.app.sessionStorage.setItem(this.storageKey,s),this.flags=e,(r=this.onFlagsCb)==null?void 0:r.call(this,e)}clearPersistFlags(){this.app.sessionStorage.removeItem(this.storageKey)}diffPersist(e){const n=this.app.sessionStorage.getItem(this.storageKey);if(!n)return e;const i=n.split(";").filter(Boolean).map(r=>JSON.parse(r));return e.filter(r=>i.findIndex(a=>a.key===r.key)===-1)}}const Jo={htmlmasked:"hidden",masked:"obscured"},rt=!(typeof window>"u"),ou=rt&&navigator.userAgent.match(/firefox|fxios/i),au=1e5;let ji=rt?Date.now()-performance.now():0;function zi(){ji=Date.now()-performance.now()}function Nn(){return ji}const Qe=rt&&performance.now?()=>Math.round(performance.now()+ji):()=>Date.now(),Ui="repeat"in String.prototype?t=>"*".repeat(t.length):t=>t.replace(/./g,"*");function Qo(t){return t.trim().replace(/\s+/g," ")}function Zo(t){return t.startsWith("https://")||t.startsWith("http://")}const Ls="https://docs.openreplay.com",$o={};function Pt(t,e,n="/"){$o[t]||(console.warn(`OpenReplay: ${t} is deprecated. ${e?`Please, use ${e} instead.`:""} Visit ${Ls}${n} for more information.`),$o[t]=!0)}function Hi(t){let e=t.getAttribute("data-openreplay-label");return e!==null||(e=t.getAttribute("data-asayer-label"),e!==null&&Pt('"data-asayer-label" attribute','"data-openreplay-label" attribute',"/")),e}function Zt(t,e){const n=`data-openreplay-${e}`;return t.hasAttribute(n)?(Jo[e]&&Pt(`"${n}" attribute`,`"${Jo[e]}" attribute`,"/installation/sanitize-data"),!0):!1}function lu(t){try{return!!t.contentDocument}catch{return!1}}function ea(t){return t.toString(16).padStart(2,"0")}function cu(t){const e=new Uint8Array((t||40)/2),n=window.crypto||window.msCrypto;return n?(n.getRandomValues(e),Array.from(e,ea).join("")):Array.from({length:t||40},()=>ea(Math.floor(Math.random()*16))).join("")}function uu(){try{return window.self&&window.top&&window.self!==window.top}catch{return!0}}function qi(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}function ta(t){const e=qi("MutationObserver");return new window[e](t)}function na(t,e,n,s){const i=qi("addEventListener");try{t[i](e,n,s)}catch(r){const a=r.message;console.debug(`Openreplay: ${a}; if this error is caused by an IframeObserver, ignore it`)}}function sa(t,e,n,s){const i=qi("removeEventListener");try{t[i](e,n,s)}catch(r){const a=r.message;console.debug(`Openreplay: ${a}; if this error is caused by an IframeObserver, ignore it`)}}class hu{constructor(){this.taskQueue=[],this.isRunning=!1}addTask(e){this.taskQueue.push(e),this.runTasks()}runTasks(){if(this.isRunning||this.taskQueue.length===0)return;this.isRunning=!0;const e=()=>{if(this.taskQueue.length===0){this.isRunning=!1;return}const n=this.taskQueue.shift();Promise.resolve(n()).then(()=>{requestAnimationFrame(()=>e())})};e()}}const fu=new hu;function du(t){fu.addTask(t)}function ia(t,e){const n={...t};for(const s in e)if(e.hasOwnProperty(s)){const i=e[s],r=t[s];typeof i=="object"&&!Array.isArray(i)&&i!==null?n[s]=ia(r||{},i):n[s]=i}return n}function $t(t){return[0,t]}function pu(t,e){return[5,t,e]}function gu(t,e){return[6,t,e]}function mu(){return[7]}function vu(t,e,n,s,i){return[8,t,e,n,s,i]}function bu(t,e,n){return[9,t,e,n]}function wu(t,e,n){return[10,t,e,n]}function yu(t){return[11,t]}function ra(t,e){return[13,t,e]}function Su(t,e){return[14,t,e]}function _u(t,e,n){return[16,t,e,n]}function ku(t,e,n){return[18,t,e,n]}function Tu(t,e){return[19,t,e]}function xu(t,e){return[20,t,e]}function Eu(t,e){return[22,t,e]}function Iu(t,e,n,s,i,r,a,l,o){return[23,t,e,n,s,i,r,a,l,o]}function Cu(t,e,n){return[24,t,e,n]}function Nu(t,e){return[27,t,e]}function Ru(t){return[28,t]}function Du(t){return[29,t]}function oa(t,e){return[30,t,e]}function Ou(t,e,n,s){return[49,t,e,n,s]}function Au(t,e){return[54,t,e]}function Pu(t){return[55,t]}function aa(t,e,n,s){return[57,t,e,n,s]}function la(t){return[58,t]}function Vi(t,e,n,s){return[60,t,e,n,s]}function Mu(t,e,n){return[61,t,e,n]}function Lu(t,e){return[63,t,e]}function Bu(t,e){return[64,t,e]}function Fu(t,e,n,s,i,r){return[68,t,e,n,s,i,r]}function Gi(t,e){return[70,t,e]}function ca(t,e,n){return[71,t,e,n]}function Ki(t,e,n,s){return[73,t,e,n,s]}function ua(t,e){return[75,t,e]}function ha(t,e){return[76,t,e]}function Wu(t,e){return[77,t,e]}function Xi(t,e,n,s){return[78,t,e,n,s]}function Bs(t,e,n,s,i,r,a,l,o){return[83,t,e,n,s,i,r,a,l,o]}function ju(t,e,n,s,i,r){return[84,t,e,n,s,i,r]}function zu(t,e,n,s,i,r){return[112,t,e,n,s,i,r]}function fa(t,e,n){return[113,t,e,n]}function Uu(t){return[114,t]}function Hu(t){return[115,t]}function da(t,e,n,s,i,r,a,l,o,u){return[116,t,e,n,s,i,r,a,l,o,u]}function Fs(t){return[117,t]}function en(t){return[118,t]}function qu(t,e){return[119,t,e]}function Vu(t){return[120,t]}function Gu(t,e,n,s){return[122,t,e,n,s]}const Yi=rt&&"performance"in window&&"memory"in performance?performance:{memory:{}},Ji=rt?(navigator.deviceMemory||0)*1024:0,Qi=Yi.memory.jsHeapSizeLimit||0;function Ku(t,e){if(!Object.assign({capturePerformance:!0},e).capturePerformance)return;let s,i;const r=()=>{s===void 0||s===-1||(s++,requestAnimationFrame(r))};t.ticker.attach(()=>{i===void 0||i===-1||i++},0,!1);const a=()=>{s===void 0||i===void 0||(t.send(Ou(s,i,Yi.memory.totalJSHeapSize||0,Yi.memory.usedJSHeapSize||0)),i=s=document.hidden?-1:0)};t.attachStartCallback(()=>{i=s=-1,a(),r()}),t.attachStopCallback(()=>{i=s=void 0}),t.ticker.attach(a,40,!1),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",a,!1,!1)}const pa="__or__watched_tags__";class Xu{constructor(e,n,s){this.sessionStorage=e,this.errLog=n,this.onTag=s,this.intervals={},this.tags=[];const i=JSON.parse(e.getItem(pa)??"[]");this.setTags(i),this.observer=new IntersectionObserver(r=>{r.forEach(a=>{if(a.isIntersecting&&a.target){const l=a.target.__or_watcher_tagname;l&&this.onTagRendered(l),this.observer.unobserve(a.target)}})})}async fetchTags(e,n){return fetch(`${e}/v1/web/tags`,{method:"GET",headers:{Authorization:`Bearer ${n}`}}).then(s=>s.json()).then(({tags:s})=>{if(s&&s.length){this.setTags(s);const i=JSON.stringify(s);this.sessionStorage.setItem(pa,i||"")}}).catch(s=>this.errLog(s))}setTags(e){this.tags=e,this.intervals={},e.forEach(n=>{this.intervals[n.id]=setInterval(()=>{const s=document.querySelectorAll(n.selector);if(s.length>0){const i=s[0];i.__or_watcher_tagname=n.id,this.observer.observe(i)}},500)})}onTagRendered(e){this.intervals[e]&&clearInterval(this.intervals[e]),this.onTag(e)}clear(){this.tags.forEach(e=>{clearInterval(this.intervals[e.id])}),this.tags=[],this.intervals={},this.observer.disconnect()}}const Yu={position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.40)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:999999,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'},Ju={display:"flex",flexDirection:"column",gap:"2rem",alignItems:"center",padding:"1.5rem",borderRadius:"2px",border:"1px solid #D9D9D9",background:"#FFF",width:"22rem"},Ws={display:"flex","flex-direction":"column",gap:"unset","align-items":"center",padding:"unset",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',"border-radius":"2px",border:"1px solid #D9D9D9",background:"rgba(255, 255, 255, 0.75)",width:"22rem"},Qu={fontFamily:"Verdana, sans-serif",fontSize:"1.25rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.75rem",color:"rgba(0, 0, 0, 0.85)"},Zu={borderTop:"1px solid rgba(0, 0, 0, 0.06)",borderBottom:"1px solid rgba(0, 0, 0, 0.06)",padding:"1.25rem 0rem",color:"rgba(0, 0, 0, 0.85)",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"400",lineHeight:"auto",whiteSpace:"pre-wrap"},$u={display:"flex",padding:"0.4rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.625rem",borderRadius:"0.25rem",border:"1px solid #394EFF",background:"#394EFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",color:"#FFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"1rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.5rem",cursor:"pointer"},ga={fontFamily:"Verdana, sans-serif",fontSize:"13px",fontWeight:"500",lineHeight:"auto",display:"flex",justifyContent:"space-between",width:"100%",cursor:"pointer"},Rn={display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"0.625rem",fontSize:"13px",lineHeight:"auto"},eh={padding:"0.5rem",gap:"0.5rem",fontFamily:"Verdana, sans-serif",fontSize:"16px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto",color:"white",display:"flex",alignItems:"center",width:"100%",borderRadius:"2px",background:"rgba(0, 0, 0, 0.75)",boxSizing:"border-box"},Dn={boxSizing:"border-box",display:"block",width:"100%",borderBottom:"1px solid #D9D9D9",background:"#FFF",padding:"0.65rem",alignSelf:"stretch",color:"#000",fontFamily:"Verdana, sans-serif",fontStyle:"normal",fontWeight:"400"},th={...Dn,display:"flex",flexDirection:"column",alignItems:"center",gap:"0.625rem"},ma={fontSize:"1.25rem",fontWeight:"500",cursor:"pointer",color:"#394EFF"},va={display:"flex",padding:"0.4rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.625rem",borderRadius:"0.25rem",border:"1px solid #394EFF",background:"#394EFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",color:"#FFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"1rem",fontStyle:"normal",fontWeight:"500",lineHeight:"1.5rem",width:"100%",boxSizing:"border-box",cursor:"pointer"},ba={marginTop:"1rem",marginBottom:"1rem",cursor:"pointer",display:"block",fontWeight:"500",fontSize:"13px!important",lineHeight:"auto"},nh={display:"flex",justifyContent:"space-between",alignItems:"center",gap:"1rem",padding:"0.5rem",width:"100%",boxSizing:"border-box"},wa={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #394EFF",fontSize:"13px",height:"24px",width:"24px"},sh={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em",outline:"1px solid #D2DFFF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",background:"#D2DFFF",fontSize:"13px",height:"24px",width:"24px"},ya={borderRadius:"0.375rem",border:"1px solid rgba(0, 0, 0, 0.06)",background:"#F5F7FF",boxShadow:"0px 2px 0px 0px rgba(0, 0, 0, 0.04)",display:"flex",flexDirection:"column",padding:"0.625rem 0.9375rem",gap:"0.5rem",alignSelf:"stretch"},Sa={fontWeight:"bold"},ih={fontSize:"13px",lineHeight:"auto"},_a={marginRight:"0.5rem",cursor:"pointer",color:"#394EFF",textAlign:"center",fontFamily:"Verdana, sans-serif",fontSize:"13px",fontStyle:"normal",fontWeight:"500",lineHeight:"auto"},rh={..._a,display:"flex",padding:"0.25rem 0.9375rem",justifyContent:"center",alignItems:"center",gap:"0.5rem",borderRadius:"0.25rem",border:"1px solid #394EFF"},oh={display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",boxSizing:"border-box"},ah={border:"4px solid rgba(255, 255, 255, 0.4)",width:"16px",height:"16px",borderRadius:"50%",borderLeftColor:"#fff",animation:"spin 0.5s linear infinite"},ka={Standard:{width:1280,height:720},High:{width:1920,height:1080}};class lh{constructor(e){this.app=e,this.mediaRecorder=null,this.recordedChunks=[],this.stream=null,this.recStartTs=null}async startRecording(e,n,s,i){this.recStartTs=this.app.timestamp();const r=n;try{this.stream=await navigator.mediaDevices.getUserMedia({video:i?{...r,frameRate:{ideal:e}}:!1,audio:s}),this.mediaRecorder=new MediaRecorder(this.stream,{mimeType:"video/webm;codecs=vp9"}),this.recordedChunks=[],this.mediaRecorder.ondataavailable=a=>{a.data.size>0&&this.recordedChunks.push(a.data)},this.mediaRecorder.start()}catch(a){console.error(a)}}async stopRecording(){return new Promise(e=>{this.mediaRecorder&&(this.mediaRecorder.onstop=()=>{const n=new Blob(this.recordedChunks,{type:"video/webm"});e(n)},this.mediaRecorder.stop())})}async sendToAPI(){const e=await this.stopRecording();return fetch(`${this.app.options.ingestPoint}/v1/web/uxt/upload-url`,{headers:{Authorization:`Bearer ${this.app.session.getSessionToken()}`}}).then(n=>{if(n.ok)return n.json();throw new Error("Failed to get upload url")}).then(({url:n})=>fetch(n,{method:"PUT",headers:{"Content-Type":"video/webm"},body:e})).catch(console.error).finally(()=>{this.discard()})}async saveToFile(e="recorded-video.webm"){const n=await this.stopRecording(),s=URL.createObjectURL(n),i=document.createElement("a");i.style.display="none",i.href=s,i.download=e,document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(s),document.body.removeChild(i)}discard(){var e,n;(e=this.mediaRecorder)==null||e.stop(),(n=this.stream)==null||n.getTracks().forEach(s=>s.stop())}}function ch(t,e){e.onmousedown=function(n){const s=t.getBoundingClientRect(),i=n.clientX-s.left,r=n.clientY-s.top;t.style.position="fixed",t.style.zIndex=99999999999999,a(n.pageX,n.pageY);function a(u,c){let h=u-i,f=c-r;h<=5&&(h=5),f<=5&&(f=5),h>=window.innerWidth-s.width&&(h=window.innerWidth-s.width),f>=window.innerHeight-s.height&&(f=window.innerHeight-s.height),t.style.left=`${h}px`,t.style.top=`${f}px`}function l(u){a(u.pageX,u.pageY)}document.addEventListener("mousemove",l);const o=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",o)};document.addEventListener("mouseup",o)},e.ondragstart=function(){return!1}}function uh(){const t=document.createElement("div");t.className="grid";for(let e=0;e<16;e++){const n=document.createElement("div");Object.assign(n.style,{width:"2px",height:"2px",borderRadius:"10px",background:"white"}),n.className="cell",t.appendChild(n)}return Object.assign(t.style,{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gridTemplateRows:"repeat(4, 1fr)",gap:"2px",cursor:"grab"}),t}function hh(){const t=document.createElement("div");Object.assign(t.style,{width:"0",height:"0",borderLeft:"7px solid transparent",borderRight:"7px solid transparent",borderBottom:"7px solid white"});const e=document.createElement("div");return e.appendChild(t),Object.assign(e.style,{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",cursor:"pointer",marginLeft:"auto",transform:"rotate(180deg)"}),e}function fh(){const t=document.createElement("style");t.type="text/css",t.innerText=`@keyframes spin {
|
|
3
3
|
0% { transform: rotate(0deg); }
|
|
4
4
|
100% { transform: rotate(360deg); }
|
|
5
|
-
}`,document.head.appendChild(t)}function
|
|
5
|
+
}`,document.head.appendChild(t)}function dh(){fh();const t=document.createElement("div");return t.classList.add("spinner"),Object.assign(t.style,ah),t}function G(t,e,n,s,i){const r=document.createElement(t);return r.className=e,Object.assign(r.style,n),s&&(r.textContent=s),i&&(r.id=i),r}const js="or_uxt_test_start",Zi="or_uxt_task_index",$i="or_uxt_session_id",ph="or_uxt_test_id";class gh{constructor(e,n,s,i,r,a,l,o,u){this.ingestPoint=e,this.getTimestamp=n,this.token=s,this.testId=i,this.storageKey=r,this.setStorageKey=a,this.removeStorageKey=l,this.getStorageKey=o,this.getSessionId=u,this.durations={testStart:0,tasks:[]},this.getDurations=()=>this.durations,this.setDurations=h=>{this.durations.testStart=h.testStart,this.durations.tasks=h.tasks},this.signalTask=(h,f,d)=>{if(!h)return console.error("User Testing: No Task ID Given");const p=this.durations.tasks.find(k=>k.taskId===h),g=this.getTimestamp(),v=p?g-p.started:0;return fetch(`${this.ingestPoint}/v1/web/uxt/signals/task`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`},body:JSON.stringify({testId:this.testId,taskId:h,status:f,duration:v,timestamp:g,taskAnswer:d})})},this.signalTest=h=>{const f=this.getTimestamp();if(h==="begin"&&this.testId){const g=this.getSessionId();this.setStorageKey($i,g),this.setStorageKey(this.storageKey,this.testId.toString()),this.setStorageKey(js,f.toString())}else this.removeStorageKey(this.storageKey),this.removeStorageKey(Zi),this.removeStorageKey(js);const d=this.durations.testStart||f,p=f-d;return fetch(`${this.ingestPoint}/v1/web/uxt/signals/test`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`},body:JSON.stringify({testId:this.testId,status:h,duration:p,timestamp:f})})};const c=this.getStorageKey(js);c&&(this.durations.testStart=parseInt(c,10))}}class mh{constructor(e,n){this.app=e,this.storageKey=n,this.bg=G("div","bg",Yu,void 0,"__or_ut_bg"),this.container=G("div","container",Ju,void 0,"__or_ut_ct"),this.widgetGuidelinesVisible=!0,this.widgetTasksVisible=!1,this.widgetVisible=!0,this.isActive=!1,this.descriptionSection=null,this.taskSection=null,this.endSection=null,this.stopButton=null,this.stopButtonContainer=null,this.test=null,this.testId=null,this.signalManager=null,this.getTest=(a,l,o)=>{this.testId=a;const u=this.app.options.ingestPoint;return fetch(`${u}/v1/web/uxt/test/${a}`,{headers:{Authorization:`Bearer ${l}`}}).then(c=>c.json()).then(({test:c})=>{this.isActive=!0,this.test=c,this.signalManager=new gh(this.app.options.ingestPoint,()=>this.app.timestamp(),l,a,this.storageKey,(h,f)=>this.app.localStorage.setItem(h,f),h=>this.app.localStorage.removeItem(h),h=>this.app.localStorage.getItem(h),()=>this.app.getSessionID()),this.createGreeting(c.title,c.reqMic,c.reqCamera),o&&((c.reqMic||c.reqCamera)&&this.userRecorder.startRecording(30,ka.Standard,c.reqMic,c.reqCamera),this.showWidget(c.description,c.tasks,!0),this.showTaskSection())}).then(()=>a).catch(c=>{console.log("OR: Error fetching test",c)})},this.hideTaskSection=()=>!1,this.showTaskSection=()=>!0,this.collapseWidget=()=>!1,this.removeGreeting=()=>!1,this.toggleDescriptionVisibility=()=>{},this.currentTaskIndex=0,this.userRecorder=new lh(e);const s=this.app.getSessionID(),i=this.app.localStorage.getItem($i);s!==i&&(this.app.localStorage.removeItem(this.storageKey),this.app.localStorage.removeItem($i),this.app.localStorage.removeItem(ph),this.app.localStorage.removeItem(Zi),this.app.localStorage.removeItem(js));const r=this.app.localStorage.getItem(Zi);r&&(this.currentTaskIndex=parseInt(r,10))}getTestId(){return this.testId}createGreeting(e,n,s){const i=G("div","title",Qu,e),r=G("div","description",Zu,`Welcome, you're here to help us improve, not to be judged. Your insights matter!
|
|
6
6
|
|
|
7
7
|
📹 We're recording this browser tab to learn from your experience.
|
|
8
|
-
🎤 Please enable mic and camera if asked, to give us a complete picture.`),a=
|
|
8
|
+
🎤 Please enable mic and camera if asked, to give us a complete picture.`),a=G("div","button",$u,"Read guidelines to begin");this.removeGreeting=()=>((n||s)&&this.userRecorder.startRecording(30,ka.Standard,n,s),this.container.removeChild(a),this.container.removeChild(r),this.container.removeChild(i),!1),a.onclick=()=>{var o,u,c,h;this.removeGreeting();const l=(o=this.signalManager)==null?void 0:o.getDurations();l&&this.signalManager&&(l.testStart=this.app.timestamp(),this.signalManager.setDurations(l)),(u=this.signalManager)==null||u.signalTest("begin"),this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,Ws),this.showWidget(((c=this.test)==null?void 0:c.guidelines)||"",((h=this.test)==null?void 0:h.tasks)||[])},this.container.append(i,r,a),this.bg.appendChild(this.container),document.body.appendChild(this.bg)}showWidget(e,n,s){this.container.innerHTML="",Object.assign(this.bg.style,{position:"fixed",zIndex:99999999999999,right:"8px",left:"unset",width:"fit-content",top:"8px",height:"fit-content",background:"unset",display:"unset",alignItems:"unset",justifyContent:"unset"});const i=this.createTitleSection();this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,Ws);const r=this.createDescriptionSection(e),a=this.createTasksSection(n),l=G("div","stop_bn_or",ba,"Abort Session"),o=G("div","stop_ct_or",{fontSize:"13px!important"});o.style.fontSize="13px",o.append(l),this.container.append(i,r,a,o),this.taskSection=a,this.descriptionSection=r,this.stopButton=l,this.stopButtonContainer=o,l.onclick=()=>{var u;this.userRecorder.discard(),(u=this.signalManager)==null||u.signalTest("skipped"),document.body.removeChild(this.bg),window.close()},s?this.toggleDescriptionVisibility():this.hideTaskSection()}createTitleSection(){var l;const e=G("div","title",eh),n=uh(),s=G("div","title_text",{maxWidth:"19rem",overflow:"hidden",textOverflow:"ellipsis",width:"100%",fontSize:16,lineHeight:"auto",cursor:"pointer"},(l=this.test)==null?void 0:l.title),i=hh();e.append(n,s,i);const r=o=>(this.widgetVisible=o,this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,this.widgetVisible?Ws:{border:"none",background:"none",padding:0}),this.taskSection&&Object.assign(this.taskSection.style,this.widgetVisible?Dn:{display:"none"}),this.descriptionSection&&Object.assign(this.descriptionSection.style,this.widgetVisible?Dn:{display:"none"}),this.endSection&&Object.assign(this.endSection.style,this.widgetVisible?Dn:{display:"none"}),this.stopButton&&Object.assign(this.stopButton.style,this.widgetVisible?ba:{display:"none"}),o),a=()=>{Object.assign(i.style,{transform:this.widgetVisible?"rotate(0deg)":"rotate(180deg)"}),r(!this.widgetVisible)};return s.onclick=a,i.onclick=a,ch(this.bg,n),this.collapseWidget=()=>r(!1),e}createDescriptionSection(e){const n=G("div","description_section_or",Dn),s=G("div","description_s_title_or",ga),i=G("div","title",{fontSize:13,fontWeight:500,lineHeight:"auto"},"Introduction & Guidelines"),r=G("div","icon",ma,"-"),a=G("div","content",Rn),l=G("div","text_description",{maxHeight:"250px",overflowY:"auto",whiteSpace:"pre-wrap",fontSize:13,color:"#454545",lineHeight:"auto"});l.innerHTML=e;const o=G("div","button_begin_or",va,"Begin Test");s.append(i,r),a.append(l,o),n.append(s,a);const u=()=>{this.widgetGuidelinesVisible=!this.widgetGuidelinesVisible,r.textContent=this.widgetGuidelinesVisible?"-":"+",Object.assign(a.style,this.widgetGuidelinesVisible?Rn:{display:"none"})};return s.onclick=u,this.toggleDescriptionVisibility=()=>{this.widgetGuidelinesVisible=!1,r.textContent=this.widgetGuidelinesVisible?"-":"+",Object.assign(a.style,this.widgetGuidelinesVisible?Rn:{display:"none"}),a.removeChild(o)},o.onclick=()=>{var c,h,f;if(u(),this.test){const d=(c=this.signalManager)==null?void 0:c.getDurations(),p=d?d.tasks.findIndex(g=>this.test&&g.taskId===this.test.tasks[0].task_id):null;d&&p===-1&&(d.tasks.push({taskId:this.test.tasks[0].task_id,started:this.app.timestamp()}),(h=this.signalManager)==null||h.setDurations(d)),(f=this.signalManager)==null||f.signalTask(this.test.tasks[0].task_id,"begin")}this.showTaskSection(),a.removeChild(o)},n}createTasksSection(e){this.container.style.fontFamily='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',Object.assign(this.container.style,Ws);const n=G("div","task_section_or",Dn),s=G("div","description_t_title_or",ga),i=G("div","title",{fontSize:"13px",fontWeight:"500",lineHeight:"auto"},"Tasks"),r=G("div","icon",ma,"-"),a=G("div","content",Rn),l=G("div","pagination",nh),o=G("div","taskCard",ya),u=G("div","taskText",Sa),c=G("div","taskDescription",ih),h=G("div","taskButtons",oh),f=G("div","taskText",Sa);f.textContent="Your answer";const d=G("textarea","taskDescription",{resize:"vertical"}),p=G("div","inputArea",ya);p.append(f,d);const g=G("div","closePanelButton",_a,"Collapse Panel"),v=G("div","nextButton",rh,"Done, Next");s.append(i,r),o.append(u,c),h.append(g,v),a.append(l,o,p,h),n.append(s,a);const k=()=>{const m=e[this.currentTaskIndex];u.textContent=m.title,c.textContent=m.description,m.allow_typing?p.style.display="flex":p.style.display="none"};e.forEach((m,y)=>{const T=G("span",`or_task_${y}`,{outline:"1px solid #efefef",fontSize:"13px",height:"24px",width:"24px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRadius:"6.25em"},(y+1).toString());T.id=`or_task_${y}`,l.append(T)});const C=()=>{this.widgetTasksVisible=!this.widgetTasksVisible,r.textContent=this.widgetTasksVisible?"-":"+",Object.assign(a.style,this.widgetTasksVisible?Rn:{display:"none"})};this.hideTaskSection=()=>(r.textContent="+",Object.assign(a.style,{display:"none"}),this.widgetTasksVisible=!1,!1),this.showTaskSection=()=>(r.textContent="-",Object.assign(a.style,Rn),this.widgetTasksVisible=!0,!0);const E=()=>{const m=document.getElementById(`or_task_${this.currentTaskIndex}`);m&&Object.assign(m.style,wa);for(let y=0;y<this.currentTaskIndex;y++){const T=document.getElementById(`or_task_${y}`);T&&Object.assign(T.style,sh)}};return s.onclick=C,g.onclick=this.collapseWidget,v.onclick=()=>{var y,T,x,S;const m=e[this.currentTaskIndex].allow_typing?d.value:void 0;if(d.value="",(y=this.signalManager)==null||y.signalTask(e[this.currentTaskIndex].task_id,"done",m),this.currentTaskIndex<e.length-1){this.currentTaskIndex++,k();const _=(T=this.signalManager)==null?void 0:T.getDurations();_&&_.tasks.findIndex(A=>A.taskId===e[this.currentTaskIndex].task_id)===-1&&(_.tasks.push({taskId:e[this.currentTaskIndex].task_id,started:this.app.timestamp()}),(x=this.signalManager)==null||x.setDurations(_)),(S=this.signalManager)==null||S.signalTask(e[this.currentTaskIndex].task_id,"begin"),E()}else this.showEndSection();this.app.localStorage.setItem("or_uxt_task_index",this.currentTaskIndex.toString())},setTimeout(()=>{const m=document.getElementById("or_task_0");m&&Object.assign(m.style,wa),k(),E()},1),n}showEndSection(){var l,o,u,c;let e=!0;(l=this.signalManager)==null||l.signalTest("done");const n=G("div","end_section_or",th),s=G("div","end_title_or",{fontSize:"1.25rem",fontWeight:"500"},"Thank you! 👍"),i=G("div","end_description_or",{},((o=this.test)==null?void 0:o.conclusion)??`Thank you for participating in our usability test. Your feedback has been captured and will be used to enhance our website.
|
|
9
9
|
|
|
10
|
-
We appreciate your time and valuable input.`),r=V("div","end_button_or",da,"Submitting Feedback"),a=ch();r.appendChild(a),(u=this.test)!=null&&u.reqMic||(c=this.test)!=null&&c.reqCamera?this.userRecorder.sendToAPI().then(()=>{r.removeChild(a),r.textContent="End Session",e=!1}).catch(h=>{console.error(h),r.removeChild(a),r.textContent="End Session",e=!1}):(r.removeChild(a),r.textContent="End Session",e=!1),this.taskSection&&this.container.removeChild(this.taskSection),this.descriptionSection&&this.container.removeChild(this.descriptionSection),this.stopButton&&this.stopButtonContainer&&this.container.removeChild(this.stopButtonContainer),r.onclick=()=>{e||(window.close(),document.body.removeChild(this.bg))},n.append(s,i,r),this.endSection=n,this.container.append(n)}}function ya(t){return!!t&&t.nodeType!=null}function $i(t){return t.namespaceURI==="http://www.w3.org/2000/svg"}function wt(t){return t.nodeType===Node.ELEMENT_NODE}function dh(t){return t.nodeType===Node.COMMENT_NODE}function Zi(t){return t.nodeType===Node.TEXT_NODE}function Fs(t){return t.nodeType===Node.DOCUMENT_NODE}function Ws(t){return t.nodeType===Node.DOCUMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function ge(t,e){return t.localName===e}class ph{constructor(e,n){this.app=e,this.options=n,this.snapshots={},this.intervals=[],this.restartTracking=()=>{this.clear(),this.app.nodes.scanTree(this.captureCanvas)},this.captureCanvas=s=>{const i=this.app.nodes.getID(s);if(!i||!ge(s,"canvas")||this.app.sanitizer.isObscured(i)||this.app.sanitizer.isHidden(i)||!ge(s,"canvas")||this.snapshots[i])return;new IntersectionObserver(l=>{l.forEach(o=>{o.isIntersecting&&(o.target?this.snapshots[i]&&this.snapshots[i].createdAt?this.snapshots[i].paused=!1:this.recordCanvas(o.target,i):this.snapshots[i]&&(this.snapshots[i].paused=!0))})}).observe(s)},this.recordCanvas=(s,i)=>{const r=this.app.timestamp();this.snapshots[i]={images:[],createdAt:r,paused:!1,dummy:document.createElement("canvas")};const a=ju(i.toString(),r);this.app.send(a);const l=u=>{gh(u,this.options.quality,this.snapshots[i].dummy,this.options.fixedScaling,this.fileExt,c=>{c&&(this.snapshots[i].images.push({id:this.app.timestamp(),data:c}),this.snapshots[i].images.length>9&&(this.sendSnaps(this.snapshots[i].images,i,this.snapshots[i].createdAt),this.snapshots[i].images=[]))})},o=setInterval(()=>{const u=this.app.nodes.getID(s),c=u?this.app.nodes.getNode(u):void 0;!c||!ge(c,"canvas")||c!==s?(this.app.debug.log("Canvas element not in sync"),clearInterval(o)):this.snapshots[i].paused||(this.options.useAnimationFrame?requestAnimationFrame(()=>{l(c)}):l(c))},this.interval);this.intervals.push(o)},this.fileExt=n.fileExt??"webp",this.interval=1e3/n.fps}startTracking(){setTimeout(()=>{this.app.nodes.scanTree(this.captureCanvas),this.app.nodes.attachNodeCallback(e=>{this.captureCanvas(e)})},500)}sendSnaps(e,n,s){if(Object.keys(this.snapshots).length===0)return;const i=new FormData;e.forEach(r=>{const a=r.data;a&&(i.append("snapshot",a,`${s}_${n}_${r.id}.${this.fileExt}`),this.options.isDebug&&mh(a,`${s}_${n}_${r.id}.${this.fileExt}`))}),fetch(this.app.options.ingestPoint+"/v1/web/images",{method:"POST",headers:{Authorization:`Bearer ${this.app.session.getSessionToken()??""}`},body:i}).then(()=>!0).catch(r=>{this.app.debug.error("error saving canvas",r)})}clear(){this.intervals.forEach(e=>clearInterval(e)),this.snapshots={}}}const Sa={low:.35,medium:.55,high:.8};function gh(t,e="medium",n,s=!1,i,r){const a=`image/${i}`;if(s){const l=window.devicePixelRatio||1;n.width=t.width/l,n.height=t.height/l;const o=n.getContext("2d");if(!o)return"";o.clearRect(0,0,n.width,n.height),o.drawImage(t,0,0,n.width,n.height),n.toBlob(r,a,Sa[e])}else t.toBlob(r,a,Sa[e])}function mh(t,e){const n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)}const $n={Verbose:5,Log:4,Warnings:3,Errors:2,Silent:0};class vh{constructor(e=$n.Silent){this.shouldLog=n=>this.level>=n,this.log=(...n)=>{this.shouldLog($n.Log)&&console.log(...n)},this.warn=(...n)=>{this.shouldLog($n.Warnings)&&console.warn(...n)},this.error=(...n)=>{this.shouldLog($n.Errors)&&console.error(...n)},this.level=e}}class bh{constructor(e){this.node_id=e,this.nodes=[],this.totalNodeAmount=0,this.nodeCallbacks=[],this.elementListeners=new Map,this.nextNodeId=0,this.scanTree=n=>{this.nodes.forEach(s=>n(s))}}syntheticMode(e){const i=99999999*e;if(i>9007199254740900)throw new Error("Placeholder id overflow");this.nextNodeId=i}attachNodeCallback(e){this.nodeCallbacks.push(e)}attachNodeListener(e,n,s,i=!0){const r=this.getID(e);if(r===void 0)return;$o(e,n,s,i);let a=this.elementListeners.get(r);a===void 0&&(a=[],this.elementListeners.set(r,a)),a.push([n,s,i])}registerNode(e){let n=e[this.node_id];const s=n===void 0;return s&&(n=this.nextNodeId,this.totalNodeAmount++,this.nextNodeId++,this.nodes[n]=e,e[this.node_id]=n),[n,s]}unregisterNode(e){const n=e[this.node_id];if(n!==void 0){e[this.node_id]=void 0,delete e[this.node_id],delete this.nodes[n];const s=this.elementListeners.get(n);s!==void 0&&(this.elementListeners.delete(n),s.forEach(i=>Zo(e,i[0],i[1],i[2]))),this.totalNodeAmount--}return n}cleanTree(){for(let e=0;e<this.nodes.length;e++){const n=this.nodes[e];n&&!document.contains(n)&&this.unregisterNode(n)}}callNodeCallbacks(e,n){this.nodeCallbacks.forEach(s=>s(e,n))}getID(e){if(e)return e[this.node_id]}getNode(e){return this.nodes[e]}getNodeCount(){return this.totalNodeAmount}clear(){for(let e=0;e<this.nodes.length;e++){const n=this.nodes[e];n&&this.unregisterNode(n)}this.nextNodeId=0,this.nodes.length=0}}function er(t){if(dh(t))return!0;if(Zi(t))return!1;if(!wt(t))return!0;const e=t.tagName.toUpperCase();if(e==="LINK"){const n=t.getAttribute("rel"),s=t.getAttribute("as");return!(n!=null&&n.includes("stylesheet")||s==="style"||s==="font")}return e==="SCRIPT"||e==="NOSCRIPT"||e==="META"||e==="TITLE"||e==="BASE"}function tr(t){return Ws(t)?!0:!er(t)}var st;(function(t){t[t.New=0]="New",t[t.Removed=1]="Removed",t[t.Changed=2]="Changed"})(st||(st={}));class nr{constructor(e,n=!1){this.app=e,this.isTopContext=n,this.commited=[],this.recents=new Map,this.indexes=[],this.attributesMap=new Map,this.textSet=new Set,this.observer=Qo(this.app.safe(s=>{for(const i of s){const r=i.target,a=i.type;if(!tr(r))continue;if(a==="childList"){for(let o=0;o<i.removedNodes.length;o++)tr(i.removedNodes[o])&&this.bindNode(i.removedNodes[o]);for(let o=0;o<i.addedNodes.length;o++)this.bindTree(i.addedNodes[o]);continue}const l=this.app.nodes.getID(r);if(l!==void 0){if(this.recents.has(l)||this.recents.set(l,st.Changed),a==="attributes"){const o=i.attributeName;if(o===null)continue;let u=this.attributesMap.get(l);u===void 0&&this.attributesMap.set(l,u=new Set),u.add(o);continue}if(a==="characterData"){this.textSet.add(l);continue}}}this.commitNodes()}))}clear(){this.commited.length=0,this.recents.clear(),this.indexes.length=1,this.attributesMap.clear(),this.textSet.clear()}sendNodeAttribute(e,n,s,i){if($i(n)){s.substr(0,6)==="xlink:"&&(s=s.substr(6)),i===null?this.app.send(ta(e,s)):s==="href"?(i.length>1e5&&(i=""),this.app.send(Hi(e,s,i,this.app.getBaseHref()))):this.app.attributeSender.sendSetAttribute(e,s,i);return}if(!(s==="src"||s==="srcset"||s==="integrity"||s==="crossorigin"||s==="autocomplete"||s.substr(0,2)==="on")&&!(s==="value"&&ge(n,"input")&&n.type!=="button"&&n.type!=="reset"&&n.type!=="submit")){if(i===null){this.app.send(ta(e,s));return}if(s==="style"||s==="href"&&ge(n,"link")){this.app.send(Hi(e,s,i,this.app.getBaseHref()));return}(s==="href"||i.length>1e5)&&(i=""),this.app.attributeSender.sendSetAttribute(e,s,i)}}sendNodeData(e,n,s){if(ge(n,"style")){this.app.send(Du(e,s,this.app.getBaseHref()));return}s=this.app.sanitizer.sanitize(e,s),this.app.send(vu(e,s))}bindNode(e){const[n,s]=this.app.nodes.registerNode(e);s?this.recents.set(n,st.New):this.recents.get(n)!==st.New&&this.recents.set(n,st.Removed)}bindTree(e){if(!tr(e))return;this.bindNode(e);const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:s=>(this.app.nodes.getID(s)!==void 0&&this.app.debug.error("! Node is already bound",s),er(s)||this.app.nodes.getID(s)!==void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT)},!1);for(;n.nextNode();)this.bindNode(n.currentNode)}unbindTree(e){const n=this.app.nodes.unregisterNode(e);if(n!==void 0&&this.recents.get(n)===st.Removed){this.app.send(mu(n));const s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:l=>er(l)||this.app.nodes.getID(l)===void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let i=0;const r=this.app.nodes.getNodeCount();for(;s.nextNode();)i+=1,this.app.nodes.unregisterNode(s.currentNode);const a=Math.floor(i/r*100);a>30&&this.app.send(Wu(a))}}_commitNode(e,n){if(Ws(n))return!0;const s=n.parentNode;let i;if(!ge(n,"html")||!this.isTopContext){if(s===null)return this.unbindTree(n),!1;if(i=this.app.nodes.getID(s),i===void 0)return this.unbindTree(n),!1;if(!this.commitNode(i))return this.unbindTree(n),!1;if(this.app.sanitizer.handleNode(e,i,n),this.app.sanitizer.isHidden(i))return!1}let r=n.previousSibling;for(;r!==null;){const c=this.app.nodes.getID(r);if(c!==void 0){this.commitNode(c),this.indexes[e]=this.indexes[c]+1;break}r=r.previousSibling}r===null&&(this.indexes[e]=0);const a=this.recents.get(e),l=a===st.New,o=this.indexes[e];if(o===void 0)throw"commitNode: missing node index";if(l){if(wt(n)){let c=n;if(i!==void 0){if(this.app.sanitizer.isHidden(e)){const h=c.clientWidth,f=c.clientHeight;c=n.cloneNode(),c.style.width=`${h}px`,c.style.height=`${f}px`}this.app.send(du(e,i,o,c.tagName,$i(n)))}for(let h=0;h<c.attributes.length;h++){const f=c.attributes[h];this.sendNodeAttribute(e,c,f.nodeName,f.value)}}else Zi(n)&&(this.app.send(pu(e,i,o)),this.sendNodeData(e,s,n.data));return!0}a===st.Removed&&i!==void 0&&this.app.send(gu(e,i,o));const u=this.attributesMap.get(e);if(u!==void 0){if(!wt(n))throw"commitNode: node is not an element";for(const c of u)this.sendNodeAttribute(e,n,c,n.getAttribute(c))}if(this.textSet.has(e)){if(!Zi(n))throw"commitNode: node is not a text";this.sendNodeData(e,s,n.data)}return!0}commitNode(e){const n=this.app.nodes.getNode(e);if(n===void 0)return!1;const s=this.commited[e];return s!==void 0?s:this.commited[e]=this._commitNode(e,n)}commitNodes(e=!1){let n;this.recents.forEach((s,i)=>{this.commitNode(i),s===st.New&&(n=this.app.nodes.getNode(i))&&this.app.nodes.callNodeCallbacks(n,e)}),this.clear()}observeRoot(e,n,s=e){this.observer.observe(e,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1}),this.bindTree(s),n(this.app.nodes.getID(e)),this.commitNodes(!0)}disconnect(){this.observer.disconnect(),this.clear()}}class _a extends nr{observe(e){const n=e.contentDocument,s=this.app.nodes.getID(e);!n||s===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.app.send(qi(s,i))})}syntheticObserve(e,n){this.observeRoot(n,s=>{if(s===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.app.send(qi(e,s))})}}class wh extends nr{observe(e){const n=e.shadowRoot,s=this.app.nodes.getID(e);!n||s===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.error("OpenReplay: Shadow Root was not bound");return}this.app.send(qi(s,i))})}}class yh{constructor(){this.states=new Map}calcOffset(e){let n=0,s=0;if(e.parent&&([n,s]=this.calcOffset(e.parent)),!e.offset){const{left:a,top:l}=e.iFrame.getBoundingClientRect();e.offset=[a,l]}const[i,r]=e.offset;return[n+i,s+r]}getDocumentOffset(e){const n=this.states.get(e);return n?this.calcOffset(n):[0,0]}observe(e){var l;const n=e.contentDocument;if(!n)return;const s=e.ownerDocument,i=this.states.get(s),r={offset:null,iFrame:e,parent:i||null,clear:()=>{var o;s.removeEventListener("scroll",a),(o=s.defaultView)==null||o.removeEventListener("resize",a)}},a=()=>{r.offset=null};s.addEventListener("scroll",a),(l=s.defaultView)==null||l.addEventListener("resize",a),this.states.set(n,r)}clear(){this.states.forEach(e=>e.clear()),this.states.clear()}}const sr=nt?Element.prototype.attachShadow:()=>new ShadowRoot;class Sh extends nr{constructor(e,n){super(e,!0),this.iframeOffsets=new yh,this.contextCallbacks=[],this.contextsSet=new Set,this.iframeObservers=[],this.shadowRootObservers=[],this.options=Object.assign({captureIFrames:!0},n),this.app.nodes.attachNodeCallback(s=>{ge(s,"iframe")&&(this.options.captureIFrames&&!Kt(s,"obscured")||Kt(s,"capture"))&&this.handleIframe(s)}),this.app.nodes.attachNodeCallback(s=>{wt(s)&&s.shadowRoot!==null&&this.handleShadowRoot(s.shadowRoot)})}attachContextCallback(e){this.contextCallbacks.push(e)}getDocumentOffset(e){return this.iframeOffsets.getDocumentOffset(e)}handleIframe(e){let n=null;const s=this.app.safe(()=>setTimeout(()=>{if(this.app.nodes.getID(e)===void 0||!iu(e))return;const r=e.contentWindow,a=e.contentDocument;if(a&&a!==n){const l=new _a(this.app);this.iframeObservers.push(l),l.observe(e),n=a,this.iframeOffsets.observe(e)}r&&r===r.window&&!this.contextsSet.has(r)&&(this.contextsSet.add(r),this.contextCallbacks.forEach(l=>l(r)))},100));e.addEventListener("load",s),s()}handleShadowRoot(e){const n=new wh(this.app);this.shadowRootObservers.push(n),n.observe(e.host)}observe(){const e=this;Element.prototype.attachShadow=function(){const n=sr.apply(this,arguments);return e.handleShadowRoot(n),n},this.app.nodes.clear(),this.observeRoot(window.document,()=>{this.app.send(fu()),this.app.nodes.callNodeCallbacks(document,!0)},window.document.documentElement)}crossdomainObserve(e,n){const s=this;Element.prototype.attachShadow=function(){const r=sr.apply(this,arguments);return s.handleShadowRoot(r),r},this.app.nodes.clear(),this.app.nodes.syntheticMode(n);const i=new _a(this.app);this.iframeObservers.push(i),i.syntheticObserve(e,window.document)}disconnect(){this.iframeOffsets.clear(),Element.prototype.attachShadow=sr,this.iframeObservers.forEach(e=>e.disconnect()),this.iframeObservers=[],this.shadowRootObservers.forEach(e=>e.disconnect()),this.shadowRootObservers=[],super.disconnect()}}var js;(function(t){t[t.Plain=0]="Plain",t[t.Obscured=1]="Obscured",t[t.Hidden=2]="Hidden"})(js||(js={}));const _h=t=>t.trim().replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g,"█");class kh{constructor(e,n){this.app=e,this.obscured=new Set,this.hidden=new Set,this.options=Object.assign({obscureTextEmails:!0,obscureTextNumbers:!1},n)}handleNode(e,n,s){if((this.obscured.has(n)||wt(s)&&(Kt(s,"masked")||Kt(s,"obscured")))&&this.obscured.add(e),(this.hidden.has(n)||wt(s)&&(Kt(s,"htmlmasked")||Kt(s,"hidden")))&&this.hidden.add(e),this.options.domSanitizer!==void 0&&wt(s)){const i=this.options.domSanitizer(s);i===js.Obscured&&this.obscured.add(e),i===js.Hidden&&this.hidden.add(e)}}sanitize(e,n){return this.obscured.has(e)?_h(n):(this.options.obscureTextNumbers&&(n=n.replace(/\d/g,"0")),this.options.obscureTextEmails&&(n=n.replace(/^\w+([+.-]\w+)*@\w+([.-]\w+)*\.\w{2,3}$/g,s=>{const[i,r]=s.split("@"),[a,l]=r.split(".");return`${ji(i)}@${ji(a)}.${ji(l)}`})),n)}isObscured(e){return this.obscured.has(e)}isHidden(e){return this.hidden.has(e)}getInnerTextSecure(e){const n=this.app.nodes.getID(e);return n?this.sanitize(n,e.innerText):""}clear(){this.obscured.clear(),this.hidden.clear()}}class Th{constructor(e,n){this.app=e,this.options=n,this.metadata={},this.userID=null,this.callbacks=[],this.timestamp=0,this.createTabId()}attachUpdateCallback(e){this.callbacks.push(e)}handleUpdate(e){e.userID==null&&delete e.userID,e.sessionID==null&&delete e.sessionID,this.callbacks.forEach(n=>n(e))}assign(e){e.userID!==void 0&&(this.userID=e.userID),e.metadata!==void 0&&Object.entries(e.metadata).forEach(([n,s])=>this.metadata[n]=s),e.sessionID!==void 0&&(this.sessionID=e.sessionID),e.timestamp!==void 0&&(this.timestamp=e.timestamp),e.projectID!==void 0&&(this.projectID=e.projectID),this.handleUpdate(e)}setMetadata(e,n){this.metadata[e]=n,this.handleUpdate({metadata:{[e]:n}})}setUserID(e){this.userID=e,this.handleUpdate({userID:e})}setUserInfo(e){this.userInfo=e}getPageNumber(){const e=this.app.sessionStorage.getItem(this.options.session_pageno_key);if(e!=null)return parseInt(e)}incPageNo(){let e=this.getPageNumber();return e===void 0?e=0:e++,this.app.sessionStorage.setItem(this.options.session_pageno_key,e.toString()),e}getSessionToken(){return this.app.sessionStorage.getItem(this.options.session_token_key)||void 0}setSessionToken(e){this.app.sessionStorage.setItem(this.options.session_token_key,e)}applySessionHash(e){const n=decodeURI(e).split("&");let s=e,i="100500";n.length==2&&([i,s]=n),!(!i||!s)&&(this.app.sessionStorage.setItem(this.options.session_token_key,s),this.app.sessionStorage.setItem(this.options.session_pageno_key,i))}getSessionHash(){const e=this.getPageNumber(),n=this.getSessionToken();if(!(e===void 0||n===void 0))return encodeURI(String(e)+"&"+n)}getTabId(){return this.tabId||this.createTabId(),this.tabId}regenerateTabId(){const e=ru(12);this.app.sessionStorage.setItem(this.options.session_tabid_key,e),this.tabId=e}createTabId(){const e=this.app.sessionStorage.getItem(this.options.session_tabid_key);e?this.tabId=e:this.regenerateTabId()}getInfo(){return{sessionID:this.sessionID,metadata:this.metadata,userID:this.userID,timestamp:this.timestamp,projectID:this.projectID}}reset(){this.app.sessionStorage.removeItem(this.options.session_token_key),this.metadata={},this.userID=null,this.sessionID=void 0,this.timestamp=0}}function xh(t,e){let n=0;return()=>{n++>=e&&(n=0,t())}}class Eh{constructor(e){this.app=e,this.timer=null,this.callbacks=[]}attach(e,n=0,s=!0,i){i&&(e=e.bind(i)),s&&(e=this.app.safe(e)),this.callbacks.unshift(n?xh(e,n):e)-1}start(){this.timer===null&&(this.timer=setInterval(()=>this.callbacks.forEach(e=>{e&&e()}),30))}stop(){this.timer!==null&&(clearInterval(this.timer),this.timer=null)}}const Zn="canceled",ka="or_uxt_active",ir="or_buffer_1",Ot=t=>({reason:t,success:!1}),Ih=t=>({...t,success:!0});var me;(function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Active=2]="Active",t[t.ColdStart=3]="ColdStart"})(me||(me={}));const Ta="https://api.openreplay.com/ingest";function rr(){const t=new Date().getTimezoneOffset()*-1,e=t>=0?"+":"-",n=Math.floor(Math.abs(t)/60),s=Math.abs(t)%60;return`UTC${e}${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`}const Ch=t=>new Promise(e=>setTimeout(e,t)),je={ask:"never-gonna-give-you-up",resp:"never-gonna-let-you-down",reg:"never-gonna-run-around-and-desert-you",iframeSignal:"never-gonna-make-you-cry",iframeId:"never-gonna-say-goodbye",iframeBatch:"never-gonna-tell-a-lie-and-hurt-you"};let Nh=class{constructor(e,n,s,i,r){this.signalError=i,this.insideIframe=r,this.messages=[],this.bufferedMessages1=[],this.bufferedMessages2=[],this.startCallbacks=[],this.stopCallbacks=[],this.commitCallbacks=[],this.activityState=me.NotActive,this.version="14.0.4",this.socketMode=!1,this.compressionThreshold=24*1e3,this.bc=null,this.canvasRecorder=null,this.conditionsManager=null,this.canStart=!1,this.rootId=null,this.pageFrames=[],this.frameOderNumber=0,this.initialHostName=location.hostname,this.startTimeout=null,this.coldStartCommitN=0,this.delay=0,this.coldInterval=null,this.orderNumber=0,this.coldStartTs=0,this.singleBuffer=!1,this.onSessionSent=()=>{},this.restartCanvasTracking=()=>{var o;(o=this.canvasRecorder)==null||o.restartTracking()},this.flushBuffer=async o=>new Promise(u=>{let c=!1;const h=[o.shift()];for(;!c;){const f=o[0];!f||f[0]===0?c=!0:h.push(o.shift())}this.postToWorker(h),u(null)}),this.onUxtCb=[],this.contextId=Math.random().toString(36).slice(2),this.projectKey=e,Object.keys(s).findIndex(o=>["fixedCanvasScaling","disableCanvas"].includes(o))!==-1&&(console.warn('Openreplay: canvas options are moving to separate key "canvas" in next update. Please update your configuration.'),s={...s,canvas:{__save_canvas_locally:s.__save_canvas_locally,fixedCanvasScaling:s.fixedCanvasScaling,disableCanvas:s.disableCanvas}}),this.networkOptions=s.network;const a={revID:"",node_id:"__openreplay_id",session_token_key:"__openreplay_token",session_pageno_key:"__openreplay_pageno",session_reset_key:"__openreplay_reset",session_tabid_key:"__openreplay_tabid",local_uuid_key:"__openreplay_uuid",ingestPoint:Ta,resourceBaseHref:null,__is_snippet:!1,__debug_report_edp:null,__debug__:$n.Silent,__save_canvas_locally:!1,localStorage:null,sessionStorage:null,disableStringDict:!1,forceSingleTab:!1,assistSocketHost:"",fixedCanvasScaling:!1,disableCanvas:!1,captureIFrames:!0,obscureTextEmails:!0,obscureTextNumbers:!1,crossdomain:{parentDomain:"*"},canvas:{disableCanvas:!1,fixedCanvasScaling:!1,__save_canvas_locally:!1,useAnimationFrame:!1}};if(this.options=ea(a,s),!this.insideIframe&&!this.options.forceSingleTab&&globalThis&&"BroadcastChannel"in globalThis){const o=location.hostname.split(".").slice(-2).join("_");this.bc=new BroadcastChannel(`rick_${o}`)}this.revID=this.options.revID,this.localStorage=this.options.localStorage??window.localStorage,this.sessionStorage=this.options.sessionStorage??window.sessionStorage,this.sanitizer=new kh(this,s),this.nodes=new bh(this.options.node_id),this.observer=new Sh(this,s),this.ticker=new Eh(this),this.ticker.attach(()=>this.commit()),this.debug=new vh(this.options.__debug__),this.session=new Th(this,this.options),this.attributeSender=new $c(this,!!this.options.disableStringDict),this.featureFlags=new tu(this),this.tagWatcher=new qu(this.sessionStorage,this.debug.error,o=>{this.send(zu(o))}),this.session.attachUpdateCallback(({userID:o,metadata:u})=>{o!=null&&this.send(Eu(o)),u!=null&&Object.entries(u).forEach(([c,h])=>this.send(na(c,h)))}),n!=null&&this.session.applySessionHash(n),this.initWorker();const l=this.session.getTabId();if(this.insideIframe){const o=c=>{const{data:h}=c;h.line===je.iframeId&&(this.rootId=h.id,this.session.setSessionToken(h.token),this.frameOderNumber=h.frameOrderNumber,this.debug.log("starting iframe tracking",h),this.allowAppStart())};window.addEventListener("message",o),this.attachStopCallback(()=>{window.removeEventListener("message",o)});const u=this.initialHostName;window.parent.postMessage({line:je.iframeSignal,source:l,context:this.contextId,domain:u},"*")}else{let o=0;const u=c=>{const{data:h}=c;if(h.line===je.iframeSignal){const f=h.domain,d=Array.from(document.querySelectorAll("iframe"));this.pageFrames=d,(async()=>{let g=0;for(;g<10;){const v=this.checkNodeId(d,f);if(v){this.waitStarted().then(()=>{var E;o++;const _=this.session.getSessionToken(),C={line:je.iframeId,context:this.contextId,domain:f,id:v,token:_,frameOrderNumber:o};this.debug.log("iframe_data",C),(E=c.source)==null||E.postMessage(C,"*")}).catch(console.error),g=10;break}g++,await Ch(100)}})()}if(h.line===je.iframeBatch){const d=h.messages.map(p=>{if(p[0]===20){let g=p;return this.pageFrames.forEach(v=>{if(v.dataset.domain===c.data.domain){const[_,C,E]=p,{left:m,top:y}=v.getBoundingClientRect();g=[_,C+m,E+y]}}),g}if(p[0]===68){let g=p;return this.pageFrames.forEach(v=>{if(v.dataset.domain===c.data.domain){const[_,C,E,m,y,T,x]=p,{left:S,top:k,width:M,height:F}=v.getBoundingClientRect(),O=document.documentElement.scrollWidth,U=document.documentElement.scrollHeight,R=T/100*M+S,A=x/100*F+k,I=R/O,D=A/U;g=[_,C,E,m,y,Math.round(I*1e3)/10,Math.round(D*1e3)/10]}}),g}return p});this.messages.push(...d)}};window.addEventListener("message",u),this.attachStopCallback(()=>{window.removeEventListener("message",u)})}this.bc!==null&&(this.bc.postMessage({line:je.ask,source:l,context:this.contextId}),this.startTimeout=setTimeout(()=>{this.allowAppStart()},500),this.bc.onmessage=o=>{if(o.data.context!==this.contextId){if(o.data.line===je.resp){const u=o.data.token;this.session.setSessionToken(u),this.allowAppStart()}if(o.data.line===je.reg){const u=o.data.token;this.session.regenerateTabId(),this.session.setSessionToken(u),this.allowAppStart()}if(o.data.line===je.ask){const u=this.session.getSessionToken();u&&this.bc&&this.bc.postMessage({line:o.data.source===l?je.reg:je.resp,token:u,source:l,context:this.contextId})}}})}allowAppStart(){this.canStart=!0,this.startTimeout&&(clearTimeout(this.startTimeout),this.startTimeout=null)}checkNodeId(e,n){for(const s of e)if(s.dataset.domain===n)return s[this.options.node_id];return null}initWorker(){try{this.worker=new Worker(URL.createObjectURL(new Blob(['"use strict";class t{constructor(t,s,i,e=10,n=250,h,r){this.onUnauthorised=s,this.onFailure=i,this.MAX_ATTEMPTS_COUNT=e,this.ATTEMPT_TIMEOUT=n,this.onCompress=h,this.pageNo=r,this.attemptsCount=0,this.busy=!1,this.queue=[],this.token=null,this.lastBatchNum=0,this.ingestURL=t+"/v1/web/i",this.isCompressing=void 0!==h}getQueueStatus(){return 0===this.queue.length&&!this.busy}authorise(t){this.token=t,this.busy||this.sendNext()}push(t){if(this.busy||!this.token)this.queue.push(t);else if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t);else{const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}}sendNext(){const t=this.queue.shift();if(t)if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t);else{const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}else this.busy=!1}retry(t,s,i){this.attemptsCount>=this.MAX_ATTEMPTS_COUNT?this.onFailure(`Failed to send batch after ${this.attemptsCount} attempts.`):(this.attemptsCount++,setTimeout((()=>this.sendBatch(t,s,i)),this.ATTEMPT_TIMEOUT*this.attemptsCount))}sendBatch(t,s,i){const e=i?.toString().replace(/^([^_]+)_([^_]+).*/,"$1_$2_$3");this.busy=!0;const n={Authorization:`Bearer ${this.token}`};s&&(n["Content-Encoding"]="gzip"),null!==this.token?fetch(`${this.ingestURL}?batch=${this.pageNo??"noPageNum"}_${e??"noBatchNum"}`,{body:t,method:"POST",headers:n,keepalive:t.length<65536}).then((e=>{if(401===e.status)return this.busy=!1,void this.onUnauthorised();e.status>=400?this.retry(t,s,`${i??"noBatchNum"}_network:${e.status}`):(this.attemptsCount=0,this.sendNext())})).catch((e=>{console.warn("OpenReplay:",e),this.retry(t,s,`${i??"noBatchNum"}_reject:${e.message}`)})):setTimeout((()=>{this.sendBatch(t,s,`${i??"noBatchNum"}_newToken`)}),500)}sendCompressed(t){const s=++this.lastBatchNum;this.sendBatch(t,!0,s)}sendUncompressed(t){const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}clean(){this.sendNext(),setTimeout((()=>{this.token=null,this.queue.length=0}),10)}}const s="function"==typeof TextEncoder?new TextEncoder:{encode(t){const s=t.length,i=new Uint8Array(3*s);let e=-1;for(let n=0,h=0,r=0;r!==s;){if(n=t.charCodeAt(r),r+=1,n>=55296&&n<=56319){if(r===s){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;break}if(h=t.charCodeAt(r),!(h>=56320&&h<=57343)){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;continue}if(n=1024*(n-55296)+h-56320+65536,r+=1,n>65535){i[e+=1]=240|n>>>18,i[e+=1]=128|n>>>12&63,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n;continue}}n<=127?i[e+=1]=0|n:n<=2047?(i[e+=1]=192|n>>>6,i[e+=1]=128|63&n):(i[e+=1]=224|n>>>12,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n)}return i.subarray(0,e+1)}};class i{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}getCurrentOffset(){return this.offset}checkpoint(){this.checkpointOffset=this.offset}get isEmpty(){return 0===this.offset}skip(t){return this.offset+=t,this.offset<=this.size}set(t,s){this.data.set(t,s)}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for((t<0||t>Number.MAX_SAFE_INTEGER)&&(t=0);t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const i=s.encode(t),e=i.byteLength;return!(!this.uint(e)||this.offset+e>this.size)&&(this.data.set(i,this.offset),this.offset+=e,!0)}reset(){this.offset=0,this.checkpointOffset=0}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}class e extends i{encode(t){switch(t[0]){case 0:case 11:case 114:case 115:return this.uint(t[1]);case 4:case 44:case 47:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 5:case 20:case 38:case 70:case 75:case 76:case 77:case 82:return this.uint(t[1])&&this.uint(t[2]);case 6:return this.int(t[1])&&this.int(t[2]);case 7:return!0;case 8:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.string(t[4])&&this.boolean(t[5]);case 9:case 10:case 24:case 51:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 12:case 61:case 71:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 13:case 14:case 17:case 50:case 54:return this.uint(t[1])&&this.string(t[2]);case 16:return this.uint(t[1])&&this.int(t[2])&&this.int(t[3]);case 18:return this.uint(t[1])&&this.string(t[2])&&this.int(t[3]);case 19:return this.uint(t[1])&&this.boolean(t[2]);case 21:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8]);case 22:case 27:case 30:case 41:case 45:case 46:case 63:case 64:case 79:return this.string(t[1])&&this.string(t[2]);case 23:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 28:case 29:case 42:case 117:case 118:return this.string(t[1]);case 37:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3]);case 39:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7]);case 40:return this.string(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 48:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.int(t[5]);case 49:return this.int(t[1])&&this.int(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 53:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8]);case 55:return this.boolean(t[1]);case 57:case 60:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 58:case 120:return this.int(t[1]);case 59:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6])&&this.string(t[7]);case 67:case 73:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 68:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6]);case 69:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 78:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 81:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.int(t[4])&&this.string(t[5]);case 83:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 84:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6]);case 112:return this.uint(t[1])&&this.string(t[2])&&this.boolean(t[3])&&this.string(t[4])&&this.int(t[5])&&this.int(t[6]);case 113:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3]);case 116:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8])&&this.uint(t[9])&&this.boolean(t[10]);case 119:return this.string(t[1])&&this.uint(t[2]);case 121:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 122:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 123:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])}}}class n{constructor(t,s,i,n,h,r){this.pageNo=t,this.timestamp=s,this.url=i,this.onBatch=n,this.tabId=h,this.onOfflineEnd=r,this.nextIndex=0,this.beaconSize=2e5,this.encoder=new e(this.beaconSize),this.sizeBuffer=new Uint8Array(3),this.isEmpty=!0,this.beaconSizeLimit=1e6,this.prepare()}writeType(t){return this.encoder.uint(t[0])}writeFields(t){return this.encoder.encode(t)}writeSizeAt(t,s){for(let s=0;s<3;s++)this.sizeBuffer[s]=t>>8*s;this.encoder.set(this.sizeBuffer,s)}prepare(){if(!this.encoder.isEmpty)return;const t=[81,1,this.pageNo,this.nextIndex,this.timestamp,this.url],s=[118,this.tabId];this.writeType(t),this.writeFields(t),this.writeWithSize(s),this.isEmpty=!0}writeWithSize(t){const s=this.encoder;if(!this.writeType(t)||!s.skip(3))return!1;const i=s.getCurrentOffset(),e=this.writeFields(t);if(e){const e=s.getCurrentOffset()-i;if(e>16777215)return console.warn("OpenReplay: max message size overflow."),!1;this.writeSizeAt(e,i-3),s.checkpoint(),this.isEmpty=this.isEmpty&&0===t[0],this.nextIndex++}return e}setBeaconSizeLimit(t){this.beaconSizeLimit=t}writeMessage(t){if("q_end"===t[0])return this.finaliseBatch(),this.onOfflineEnd();0===t[0]&&(this.timestamp=t[1]),122===t[0]&&(this.url=t[1]),this.writeWithSize(t)||(this.finaliseBatch(),this.writeWithSize(t)||(this.encoder=new e(this.beaconSizeLimit),this.prepare(),this.writeWithSize(t)?this.finaliseBatch():console.warn("OpenReplay: beacon size overflow. Skipping large message.",t,this),this.encoder=new e(this.beaconSize),this.prepare()))}finaliseBatch(){if(this.isEmpty)return;const t=this.encoder.flush();this.onBatch(t),this.prepare()}clean(){this.encoder.reset()}}var h;!function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Stopping=2]="Stopping",t[t.Active=3]="Active",t[t.Stopped=4]="Stopped"}(h||(h={}));let r=null,a=null,u=h.NotActive;function o(){a&&a.finaliseBatch()}function c(){return new Promise((t=>{u=h.Stopping,null!==l&&(clearInterval(l),l=null),a&&(a.clean(),a=null),r&&(r.clean(),setTimeout((()=>{r=null}),20)),setTimeout((()=>{u=h.NotActive,t(null)}),100)}))}function g(){u!==h.Stopped&&(postMessage("a_stop"),c().then((()=>{postMessage("a_start")})))}let p,l=null;self.onmessage=({data:s})=>{if(null!=s){if("stop"===s)return o(),void c().then((()=>{u=h.Stopped}));if("forceFlushBatch"!==s){if(!Array.isArray(s)){if("compressed"===s.type){if(!r)return console.debug("OR WebWorker: sender not initialised. Compressed batch."),void g();s.batch&&r.sendCompressed(s.batch)}if("uncompressed"===s.type){if(!r)return console.debug("OR WebWorker: sender not initialised. Uncompressed batch."),void g();s.batch&&r.sendUncompressed(s.batch)}return"start"===s.type?(u=h.Starting,r=new t(s.ingestPoint,(()=>{g()}),(t=>{!function(t){postMessage({type:"failure",reason:t}),c()}(t)}),s.connAttemptCount,s.connAttemptGap,(t=>{postMessage({type:"compress",batch:t},[t.buffer])}),s.pageNo),a=new n(s.pageNo,s.timestamp,s.url,(t=>{r&&r.push(t)}),s.tabId,(()=>postMessage({type:"queue_empty"}))),null===l&&(l=setInterval(o,1e4)),u=h.Active):"auth"===s.type?r?a?(r.authorise(s.token),void(s.beaconSizeLimit&&a.setBeaconSizeLimit(s.beaconSizeLimit))):(console.debug("OR WebWorker: writer not initialised. Received auth."),void g()):(console.debug("OR WebWorker: sender not initialised. Received auth."),void g()):void 0}if(a){const t=a;s.forEach((s=>{55===s[0]&&(s[1]?p=setTimeout((()=>g()),18e5):clearTimeout(p)),t.writeMessage(s)}))}else postMessage("not_init"),g()}else o()}else o()};'],{type:"text/javascript"}))),this.worker.onerror=n=>{this._debug("webworker_error",n)},this.worker.onmessage=({data:n})=>{this.handleWorkerMsg(n)};const e=()=>{this.worker&&this.worker.postMessage(null)};this.attachEventListener(window,"beforeunload",e,!1),this.attachEventListener(document.body,"mouseleave",e,!1,!1),this.attachEventListener(document,"visibilitychange",e,!1)}catch(e){this._debug("worker_start",e)}}handleWorkerMsg(e){var n;if(e==="a_stop")this.stop(!1);else if(e==="a_start")this.start({},!0);else if(e==="not_init")this.debug.warn("OR WebWorker: writer not initialised. Restarting tracker");else if(e.type==="failure")this.stop(!1),this.debug.error("worker_failed",e.reason),this._debug("worker_failed",e.reason);else if(e.type==="compress"){const s=e.batch;s.byteLength>this.compressionThreshold?Yc(e.batch,{mtime:0},(r,a)=>{var l,o;r?(this.debug.error("Openreplay compression error:",r),(l=this.worker)==null||l.postMessage({type:"uncompressed",batch:s})):(o=this.worker)==null||o.postMessage({type:"compressed",batch:a})}):(n=this.worker)==null||n.postMessage({type:"uncompressed",batch:s})}else e.type==="queue_empty"&&this.onSessionSent()}_debug(e,n){this.options.__debug_report_edp!==null&&fetch(this.options.__debug_report_edp,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e,error:`${n}`})}),this.debug.error("OpenReplay error: ",e,n)}send(e,n=!1){var s;this.activityState!==me.NotActive&&(this.activityState===me.ColdStart?(this.bufferedMessages1.push(e),this.singleBuffer||this.bufferedMessages2.push(e),(s=this.conditionsManager)==null||s.processMessage(e)):this.messages.push(e),this.activityState===me.Active&&n&&this.commit())}_nCommit(){if(this.socketMode){this.messages.unshift(Yt(this.session.getTabId())),this.messages.unshift(Xt(this.timestamp())),this.commitCallbacks.forEach(e=>e(this.messages)),this.messages.length=0;return}if(!(this.worker===void 0||!this.messages.length)){if(this.insideIframe){window.parent.postMessage({line:je.iframeBatch,messages:this.messages,domain:this.initialHostName},"*"),this.commitCallbacks.forEach(e=>e(this.messages)),this.messages.length=0;return}try{cu(()=>{var e;this.messages.unshift(Yt(this.session.getTabId())),this.messages.unshift(Xt(this.timestamp())),(e=this.worker)==null||e.postMessage(this.messages),this.commitCallbacks.forEach(n=>n(this.messages)),this.messages.length=0})}catch(e){this._debug("worker_commit",e),this.stop(!0),setTimeout(()=>{this.start()},500)}}}_cStartCommit(){this.coldStartCommitN+=1,this.coldStartCommitN===2&&(this.bufferedMessages1.push(Xt(this.timestamp())),this.bufferedMessages1.push(Yt(this.session.getTabId())),this.bufferedMessages2.push(Xt(this.timestamp())),this.bufferedMessages2.push(Yt(this.session.getTabId())),this.coldStartCommitN=0)}commit(){this.activityState===me.ColdStart?this._cStartCommit():this._nCommit()}postToWorker(e){var n;(n=this.worker)==null||n.postMessage(e),this.commitCallbacks.forEach(s=>s(e)),e.length=0}timestamp(){return Ye()+this.delay}safe(e){const n=this;return function(...s){try{e.apply(this,s)}catch(i){n._debug("safe_fn_call",i)}}}attachCommitCallback(e){this.commitCallbacks.push(e)}attachStartCallback(e,n=!1){n&&(e=this.safe(e)),this.startCallbacks.push(e)}attachStopCallback(e,n=!1){n&&(e=this.safe(e)),this.stopCallbacks.push(e)}attachEventListener(e,n,s,i=!0,r=!0){i&&(s=this.safe(s));const a=()=>e?$o(e,n,s,r):null,l=()=>e?Zo(e,n,s,r):null;this.attachStartCallback(a,i),this.attachStopCallback(l,i)}checkRequiredVersion(e){const n=e.split(/[.-]/),s=this.version.split(/[.-]/);for(let i=0;i<3;i++){if(isNaN(Number(s[i]))||isNaN(Number(n[i])))return!1;if(Number(s[i])>Number(n[i]))return!0;if(Number(s[i])<Number(n[i]))return!1}return!0}getTrackerInfo(){return{userUUID:this.localStorage.getItem(this.options.local_uuid_key),projectKey:this.projectKey,revID:this.revID,trackerVersion:this.version,isSnippet:this.options.__is_snippet}}getSessionInfo(){return{...this.session.getInfo(),...this.getTrackerInfo()}}getSessionToken(){return this.session.getSessionToken()}getSessionID(){return this.session.getInfo().sessionID||void 0}getSessionURL(e){const{projectID:n,sessionID:s,timestamp:i}=this.session.getInfo();if(!n||!s){this.debug.error("OpenReplay error: Unable to build session URL");return}const r=this.options.ingestPoint,o=(/api\.openreplay\.com/.test(r)?"https://app.openreplay.com/ingest":r).replace(/ingest$/,`${n}/session/${s}`);if(e!=null&&e.withCurrentTime){const u=Ye()-i;return`${o}?jumpto=${u}`}return o}getHost(){return new URL(this.options.ingestPoint).host}getProjectKey(){return this.projectKey}getBaseHref(){var e,n;return typeof this.options.resourceBaseHref=="string"?this.options.resourceBaseHref:(this.options.resourceBaseHref,document.baseURI?document.baseURI:((n=(e=document.head)==null?void 0:e.getElementsByTagName("base")[0])==null?void 0:n.getAttribute("href"))||location.origin+location.pathname)}resolveResourceURL(e){const n=new URL(this.getBaseHref());return n.pathname+="/"+new URL(e).pathname,n.pathname.replace(/\/+/g,"/"),n.toString()}isServiceURL(e){return e.startsWith(this.options.ingestPoint)}active(){return this.activityState===me.Active}resetNextPageSession(e){e?this.sessionStorage.setItem(this.options.session_reset_key,"t"):this.sessionStorage.removeItem(this.options.session_reset_key)}checkSessionToken(e){const n=this.sessionStorage.getItem(this.options.session_reset_key)!==null,s=e||n,i=this.session.getSessionToken();return s||!i}async coldStart(e={},n){this.singleBuffer=!1;const s=1e3,i=this.checkSessionToken(e.forceNew);n&&await this.setupConditionalStart(e);const r=()=>{this.orderNumber+=1,Wi(),this.coldStartTs=Ye(),this.orderNumber%2===0?(this.bufferedMessages1.length=0,this.bufferedMessages1.push(Xt(this.timestamp())),this.bufferedMessages1.push(Yt(this.session.getTabId()))):(this.bufferedMessages2.length=0,this.bufferedMessages2.push(Xt(this.timestamp())),this.bufferedMessages2.push(Yt(this.session.getTabId()))),this.stop(!1),this.activityState=me.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata}),i||(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(Ms(this.session.getTabId()))),this.observer.observe(),this.ticker.start()};this.coldInterval=setInterval(()=>{r()},30*s),r()}async setupConditionalStart(e){var f,d;this.conditionsManager=new Zc(this,e);const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:Ye(),doNotRecord:!0,bufferDiff:0,userID:this.session.getInfo().userID,token:void 0,deviceMemory:Xi,jsHeapSizeLimit:Yi,timezone:rr(),width:window.screen.width,height:window.screen.height})}),{token:s,userBrowser:i,userCity:r,userCountry:a,userDevice:l,userOS:o,userState:u,projectID:c}=await n.json();this.session.assign({projectID:c}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:a,userDevice:l,userOS:o,userState:u});const h={sessionToken:s,userUUID:"",sessionID:""};this.startCallbacks.forEach(p=>p(h)),await((f=this.conditionsManager)==null?void 0:f.fetchConditions(c,s)),await this.featureFlags.reloadFlags(s),await this.tagWatcher.fetchTags(this.options.ingestPoint,s),(d=this.conditionsManager)==null||d.processFlags(this.featureFlags.flags)}offlineRecording(e={},n){this.onSessionSent=n,this.singleBuffer=!0;const s=this.checkSessionToken(e.forceNew);Wi(),this.coldStartTs=Ye();const i=this.localStorage.getItem(ir);if(i){const a=JSON.parse(i);this.bufferedMessages1=Array.isArray(a)?a:this.bufferedMessages1,this.localStorage.removeItem(ir)}this.bufferedMessages1.push(Xt(this.timestamp())),this.bufferedMessages1.push(Yt(this.session.getTabId())),this.activityState=me.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r={sessionToken:"",userUUID:"",sessionID:""};return this.startCallbacks.forEach(a=>a(r)),s||this.send(Ms(this.session.getTabId())),this.observer.observe(),this.ticker.start(),{saveBuffer:this.saveBuffer,getBuffer:this.getBuffer,setBuffer:this.setBuffer}}saveBuffer(){this.localStorage.setItem(ir,JSON.stringify(this.bufferedMessages1))}getBuffer(){return this.bufferedMessages1}setBuffer(e){this.bufferedMessages1=e}async uploadOfflineRecording(){var f,d;this.stop(!1);const e=Ye();(f=this.worker)==null||f.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:this.coldStartTs,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId()});const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:e,doNotRecord:!1,bufferDiff:e-this.coldStartTs,userID:this.session.getInfo().userID,token:void 0,deviceMemory:Xi,jsHeapSizeLimit:Yi,timezone:rr()})}),{token:s,userBrowser:i,userCity:r,userCountry:a,userDevice:l,userOS:o,userState:u,beaconSizeLimit:c,projectID:h}=await n.json();for((d=this.worker)==null||d.postMessage({type:"auth",token:s,beaconSizeLimit:c}),this.session.assign({projectID:h}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:a,userDevice:l,userOS:o,userState:u});this.bufferedMessages1.length>0;)await this.flushBuffer(this.bufferedMessages1);this.postToWorker([["q_end"]]),this.clearBuffers()}async _start(e={},n=!1,s){const i=this.activityState===me.ColdStart;if(i&&this.coldInterval&&clearInterval(this.coldInterval),!this.worker){const o="No worker found: perhaps, CSP is not set.";return this.signalError(o,[]),Promise.resolve(Ot(o))}if(this.activityState===me.Active||this.activityState===me.Starting)return Promise.resolve(Ot("OpenReplay: trying to call `start()` on the instance that has been started already."));this.activityState=me.Starting,i||Wi(),e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r=Ye();this.worker.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:i?this.coldStartTs:r,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId()});const a=this.session.getSessionToken(),l=this.checkSessionToken(e.forceNew);this.sessionStorage.removeItem(this.options.session_reset_key),this.debug.log("OpenReplay: starting session; need new session id?",l,"session token: ",a);try{const o=await window.fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:r,doNotRecord:!1,bufferDiff:r-this.coldStartTs,userID:this.session.getInfo().userID,token:l?void 0:a,deviceMemory:Xi,jsHeapSizeLimit:Yi,timezone:rr(),condition:s,assistOnly:e.assistOnly??this.socketMode,width:window.screen.width,height:window.screen.height})});if(o.status!==200){const R=await o.text(),A=R===Zn?Zn:`Server error: ${o.status}. ${R}`;return Ot(A)}if(!this.worker){const R="no worker found after start request (this should not happen in real world)";return this.signalError(R,[]),Ot(R)}const{token:u,userUUID:c,projectID:h,beaconSizeLimit:f,compressionThreshold:d,delay:p,sessionID:g,startTimestamp:v,userBrowser:_,userCity:C,userCountry:E,userDevice:m,userOS:y,userState:T,canvasEnabled:x,canvasQuality:S,canvasFPS:k,assistOnly:M}=await o.json();if(typeof u!="string"||typeof c!="string"||typeof v!="number"&&typeof v<"u"||typeof g!="string"||typeof p!="number"||typeof f!="number"&&typeof f<"u"){const R=`Incorrect server response: ${JSON.stringify(o)}`;return this.signalError(R,[]),Ot(R)}this.delay=p,this.session.setSessionToken(u),this.session.setUserInfo({userBrowser:_,userCity:C,userCountry:E,userDevice:m,userOS:y,userState:T}),this.session.assign({sessionID:g,timestamp:v||r,projectID:h}),M?(this.socketMode=!0,this.worker.postMessage("stop")):this.worker.postMessage({type:"auth",token:u,beaconSizeLimit:f}),!l&&u===a&&(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(Ms(this.session.getTabId()))),Object.entries(this.session.getInfo().metadata).forEach(([R,A])=>this.send(na(R,A))),this.localStorage.setItem(this.options.local_uuid_key,c),this.compressionThreshold=d;const F={sessionToken:u,userUUID:c,sessionID:g};if(this.startCallbacks.forEach(R=>R(F)),this.featureFlags.reloadFlags(),await this.tagWatcher.fetchTags(this.options.ingestPoint,u),this.activityState=me.Active,x&&!this.options.canvas.disableCanvas&&(this.canvasRecorder=this.canvasRecorder??new ph(this,{fps:k,quality:S,isDebug:this.options.canvas.__save_canvas_locally,fixedScaling:this.options.canvas.fixedCanvasScaling,useAnimationFrame:this.options.canvas.useAnimationFrame}),this.canvasRecorder.startTracking()),i){const R=this.bufferedMessages1.length>this.bufferedMessages2.length?this.bufferedMessages1:this.bufferedMessages2;for(;R.length>0;)await this.flushBuffer(R);this.clearBuffers(),this.commit()}else this.insideIframe&&this.rootId?this.observer.crossdomainObserve(this.rootId,this.frameOderNumber):this.observer.observe(),this.ticker.start();this.uxtManager=this.uxtManager?this.uxtManager:new fh(this,ka);let O;const U=this.localStorage.getItem(ka);if(U&&(O=parseInt(U,10)),location!=null&&location.search){const R=new URLSearchParams(location.search);if(R.has("oruxt")){const A=R.get("oruxt");O=A?parseInt(A,10):void 0}}return O&&(this.uxtManager.isActive?this.onUxtCb.forEach(R=>R(O)):this.uxtManager.getTest(O,u,!!U).then(R=>{R&&this.onUxtCb.forEach(A=>A(R))})),Ih(F)}catch(o){if(this.stop(),this.session.reset(),o===Zn)return this.signalError(Zn,[]),Ot(Zn);this._debug("session_start",o);const u=o instanceof Error?o.message:o.toString();return this.signalError(u,[]),Ot(u)}}addOnUxtCb(e){this.onUxtCb.push(e)}getUxtId(){var e;return(e=this.uxtManager)==null?void 0:e.getTestId()}async waitStart(){return new Promise(e=>{const n=()=>{this.canStart?e(!0):setTimeout(n,25)};n()})}async waitStarted(){return new Promise(e=>{const n=()=>{this.activityState===me.Active?e(!0):setTimeout(n,25)};n()})}async start(...e){return this.activityState===me.Active||this.activityState===me.Starting?Promise.resolve(Ot("OpenReplay: trying to call `start()` on the instance that has been started already.")):document.hidden?new Promise(n=>{const s=async()=>{document.hidden||(await this.waitStart(),document.removeEventListener("visibilitychange",s),n(this._start(...e)))};document.addEventListener("visibilitychange",s)}):(await this.waitStart(),this._start(...e))}forceFlushBatch(){var e;(e=this.worker)==null||e.postMessage("forceFlushBatch")}getTabId(){return this.session.getTabId()}clearBuffers(){this.bufferedMessages1.length=0,this.bufferedMessages2.length=0}trackWs(e){const n=e;return(s,i,r="down")=>{typeof s!="string"||typeof i!="string"||i.length>5*1024*1024||s.length>255||this.send(Lu("websocket",n,i,this.timestamp(),r,s))}}stop(e=!0){var n;if(this.activityState!==me.NotActive)try{this.attributeSender.clear(),this.sanitizer.clear(),this.observer.disconnect(),this.nodes.clear(),this.ticker.stop(),this.stopCallbacks.forEach(s=>s()),this.debug.log("OpenReplay tracking stopped."),this.tagWatcher.clear(),this.worker&&e&&this.worker.postMessage("stop"),(n=this.canvasRecorder)==null||n.clear()}finally{this.activityState=me.NotActive}}};function Rh(t){const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e===void 0)return;const n=()=>t.send(Nu(Math.round(e.downlink*1e3),e.type||"unknown"));n(),e.addEventListener("change",n)}const xa=nt&&"InstallTrigger"in window?t=>t.message+`
|
|
11
|
-
`+t.stack:t=>t.stack||t.message;function
|
|
10
|
+
We appreciate your time and valuable input.`),r=G("div","end_button_or",va,"Submitting Feedback"),a=dh();r.appendChild(a),(u=this.test)!=null&&u.reqMic||(c=this.test)!=null&&c.reqCamera?this.userRecorder.sendToAPI().then(()=>{r.removeChild(a),r.textContent="End Session",e=!1}).catch(h=>{console.error(h),r.removeChild(a),r.textContent="End Session",e=!1}):(r.removeChild(a),r.textContent="End Session",e=!1),this.taskSection&&this.container.removeChild(this.taskSection),this.descriptionSection&&this.container.removeChild(this.descriptionSection),this.stopButton&&this.stopButtonContainer&&this.container.removeChild(this.stopButtonContainer),r.onclick=()=>{e||(window.close(),document.body.removeChild(this.bg))},n.append(s,i,r),this.endSection=n,this.container.append(n)}}function Ta(t){return!!t&&t.nodeType!=null}function er(t){return t.namespaceURI==="http://www.w3.org/2000/svg"}function St(t){return t.nodeType===Node.ELEMENT_NODE}function vh(t){return t.nodeType===Node.COMMENT_NODE}function tr(t){return t.nodeType===Node.TEXT_NODE}function zs(t){return t.nodeType===Node.DOCUMENT_NODE}function Us(t){return t.nodeType===Node.DOCUMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function ge(t,e){return t.localName===e}class bh{constructor(e,n){this.app=e,this.options=n,this.snapshots={},this.intervals=[],this.restartTracking=()=>{this.clear(),this.app.nodes.scanTree(this.captureCanvas)},this.captureCanvas=s=>{const i=this.app.nodes.getID(s);if(!i||!ge(s,"canvas")||this.app.sanitizer.isObscured(i)||this.app.sanitizer.isHidden(i)||!ge(s,"canvas")||this.snapshots[i])return;new IntersectionObserver(l=>{l.forEach(o=>{o.isIntersecting&&(o.target?this.snapshots[i]&&this.snapshots[i].createdAt?this.snapshots[i].paused=!1:this.recordCanvas(o.target,i):this.snapshots[i]&&(this.snapshots[i].paused=!0))})}).observe(s)},this.recordCanvas=(s,i)=>{const r=this.app.timestamp();this.snapshots[i]={images:[],createdAt:r,paused:!1,dummy:document.createElement("canvas")};const a=qu(i.toString(),r);this.app.send(a);const l=u=>{wh(u,this.options.quality,this.snapshots[i].dummy,this.options.fixedScaling,this.fileExt,c=>{c&&(this.snapshots[i].images.push({id:this.app.timestamp(),data:c}),this.snapshots[i].images.length>9&&(this.sendSnaps(this.snapshots[i].images,i,this.snapshots[i].createdAt),this.snapshots[i].images=[]))})},o=setInterval(()=>{const u=this.app.nodes.getID(s),c=u?this.app.nodes.getNode(u):void 0;!c||!ge(c,"canvas")||c!==s?(this.app.debug.log("Canvas element not in sync"),clearInterval(o)):this.snapshots[i].paused||(this.options.useAnimationFrame?requestAnimationFrame(()=>{l(c)}):l(c))},this.interval);this.intervals.push(o)},this.fileExt=n.fileExt??"webp",this.interval=1e3/n.fps}startTracking(){setTimeout(()=>{this.app.nodes.scanTree(this.captureCanvas),this.app.nodes.attachNodeCallback(e=>{this.captureCanvas(e)})},500)}sendSnaps(e,n,s){if(Object.keys(this.snapshots).length===0)return;const i=new FormData;e.forEach(r=>{const a=r.data;a&&(i.append("snapshot",a,`${s}_${n}_${r.id}.${this.fileExt}`),this.options.isDebug&&yh(a,`${s}_${n}_${r.id}.${this.fileExt}`))}),fetch(this.app.options.ingestPoint+"/v1/web/images",{method:"POST",headers:{Authorization:`Bearer ${this.app.session.getSessionToken()??""}`},body:i}).then(()=>!0).catch(r=>{this.app.debug.error("error saving canvas",r)})}clear(){this.intervals.forEach(e=>clearInterval(e)),this.snapshots={}}}const xa={low:.35,medium:.55,high:.8};function wh(t,e="medium",n,s=!1,i,r){const a=`image/${i}`;if(s){const l=window.devicePixelRatio||1;n.width=t.width/l,n.height=t.height/l;const o=n.getContext("2d");if(!o)return"";o.clearRect(0,0,n.width,n.height),o.drawImage(t,0,0,n.width,n.height),n.toBlob(r,a,xa[e])}else t.toBlob(r,a,xa[e])}function yh(t,e){const n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download=e,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)}const ns={Verbose:5,Log:4,Warnings:3,Errors:2,Silent:0};class Sh{constructor(e=ns.Silent){this.shouldLog=n=>this.level>=n,this.log=(...n)=>{this.shouldLog(ns.Log)&&console.log(...n)},this.warn=(...n)=>{this.shouldLog(ns.Warnings)&&console.warn(...n)},this.error=(...n)=>{this.shouldLog(ns.Errors)&&console.error(...n)},this.level=e}}class _h{constructor(e){this.node_id=e,this.nodes=[],this.totalNodeAmount=0,this.nodeCallbacks=[],this.elementListeners=new Map,this.nextNodeId=0,this.scanTree=n=>{this.nodes.forEach(s=>n(s))}}syntheticMode(e){const i=99999999*e;if(i>9007199254740900)throw new Error("Placeholder id overflow");this.nextNodeId=i}attachNodeCallback(e){this.nodeCallbacks.push(e)}attachNodeListener(e,n,s,i=!0){const r=this.getID(e);if(r===void 0)return;na(e,n,s,i);let a=this.elementListeners.get(r);a===void 0&&(a=[],this.elementListeners.set(r,a)),a.push([n,s,i])}registerNode(e){let n=e[this.node_id];const s=n===void 0;return s&&(n=this.nextNodeId,this.totalNodeAmount++,this.nextNodeId++,this.nodes[n]=e,e[this.node_id]=n),[n,s]}unregisterNode(e){const n=e[this.node_id];if(n!==void 0){e[this.node_id]=void 0,delete e[this.node_id],delete this.nodes[n];const s=this.elementListeners.get(n);s!==void 0&&(this.elementListeners.delete(n),s.forEach(i=>sa(e,i[0],i[1],i[2]))),this.totalNodeAmount--}return n}cleanTree(){for(let e=0;e<this.nodes.length;e++){const n=this.nodes[e];n&&!document.contains(n)&&this.unregisterNode(n)}}callNodeCallbacks(e,n){this.nodeCallbacks.forEach(s=>s(e,n))}getID(e){if(e)return e[this.node_id]}getNode(e){return this.nodes[e]}getNodeCount(){return this.totalNodeAmount}clear(){for(let e=0;e<this.nodes.length;e++){const n=this.nodes[e];n&&this.unregisterNode(n)}this.nextNodeId=0,this.nodes.length=0}}function nr(t){if(vh(t))return!0;if(tr(t))return!1;if(!St(t))return!0;const e=t.tagName.toUpperCase();if(e==="LINK"){const n=t.getAttribute("rel"),s=t.getAttribute("as");return!(n!=null&&n.includes("stylesheet")||s==="style"||s==="font")}return e==="SCRIPT"||e==="NOSCRIPT"||e==="META"||e==="TITLE"||e==="BASE"}function sr(t){return Us(t)?!0:!nr(t)}var ot;(function(t){t[t.New=0]="New",t[t.Removed=1]="Removed",t[t.Changed=2]="Changed"})(ot||(ot={}));class ir{constructor(e,n=!1){this.app=e,this.isTopContext=n,this.commited=[],this.recents=new Map,this.indexes=[],this.attributesMap=new Map,this.textSet=new Set,this.observer=ta(this.app.safe(s=>{for(const i of s){const r=i.target,a=i.type;if(!sr(r))continue;if(a==="childList"){for(let o=0;o<i.removedNodes.length;o++)sr(i.removedNodes[o])&&this.bindNode(i.removedNodes[o]);for(let o=0;o<i.addedNodes.length;o++)this.bindTree(i.addedNodes[o]);continue}const l=this.app.nodes.getID(r);if(l!==void 0){if(this.recents.has(l)||this.recents.set(l,ot.Changed),a==="attributes"){const o=i.attributeName;if(o===null)continue;let u=this.attributesMap.get(l);u===void 0&&this.attributesMap.set(l,u=new Set),u.add(o);continue}if(a==="characterData"){this.textSet.add(l);continue}}}this.commitNodes()}))}clear(){this.commited.length=0,this.recents.clear(),this.indexes.length=1,this.attributesMap.clear(),this.textSet.clear()}sendNodeAttribute(e,n,s,i){if(er(n)){s.substr(0,6)==="xlink:"&&(s=s.substr(6)),i===null?this.app.send(ra(e,s)):s==="href"?(i.length>1e5&&(i=""),this.app.send(Vi(e,s,i,this.app.getBaseHref()))):this.app.attributeSender.sendSetAttribute(e,s,i);return}if(!(s==="src"||s==="srcset"||s==="integrity"||s==="crossorigin"||s==="autocomplete"||s.substr(0,2)==="on")&&!(s==="value"&&ge(n,"input")&&n.type!=="button"&&n.type!=="reset"&&n.type!=="submit")){if(i===null){this.app.send(ra(e,s));return}if(s==="style"||s==="href"&&ge(n,"link")){this.app.send(Vi(e,s,i,this.app.getBaseHref()));return}(s==="href"||i.length>1e5)&&(i=""),this.app.attributeSender.sendSetAttribute(e,s,i)}}sendNodeData(e,n,s){if(ge(n,"style")){this.app.send(Mu(e,s,this.app.getBaseHref()));return}s=this.app.sanitizer.sanitize(e,s),this.app.send(Su(e,s))}bindNode(e){const[n,s]=this.app.nodes.registerNode(e);s?this.recents.set(n,ot.New):this.recents.get(n)!==ot.New&&this.recents.set(n,ot.Removed)}bindTree(e){if(!sr(e))return;this.bindNode(e);const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:s=>(this.app.nodes.getID(s)!==void 0&&this.app.debug.error("! Node is already bound",s),nr(s)||this.app.nodes.getID(s)!==void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT)},!1);for(;n.nextNode();)this.bindNode(n.currentNode)}unbindTree(e){const n=this.app.nodes.unregisterNode(e);if(n!==void 0&&this.recents.get(n)===ot.Removed){this.app.send(yu(n));const s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:l=>nr(l)||this.app.nodes.getID(l)===void 0?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let i=0;const r=this.app.nodes.getNodeCount();for(;s.nextNode();)i+=1,this.app.nodes.unregisterNode(s.currentNode);const a=Math.floor(i/r*100);a>30&&this.app.send(Hu(a))}}_commitNode(e,n){if(Us(n))return!0;const s=n.parentNode;let i;if(!ge(n,"html")||!this.isTopContext){if(s===null)return this.unbindTree(n),!1;if(i=this.app.nodes.getID(s),i===void 0)return this.unbindTree(n),!1;if(!this.commitNode(i))return this.unbindTree(n),!1;if(this.app.sanitizer.handleNode(e,i,n),this.app.sanitizer.isHidden(i))return!1}let r=n.previousSibling;for(;r!==null;){const c=this.app.nodes.getID(r);if(c!==void 0){this.commitNode(c),this.indexes[e]=this.indexes[c]+1;break}r=r.previousSibling}r===null&&(this.indexes[e]=0);const a=this.recents.get(e),l=a===ot.New,o=this.indexes[e];if(o===void 0)throw"commitNode: missing node index";if(l){if(St(n)){let c=n;if(i!==void 0){if(this.app.sanitizer.isHidden(e)){const h=c.clientWidth,f=c.clientHeight;c=n.cloneNode(),c.style.width=`${h}px`,c.style.height=`${f}px`}this.app.send(vu(e,i,o,c.tagName,er(n)))}for(let h=0;h<c.attributes.length;h++){const f=c.attributes[h];this.sendNodeAttribute(e,c,f.nodeName,f.value)}}else tr(n)&&(this.app.send(bu(e,i,o)),this.sendNodeData(e,s,n.data));return!0}a===ot.Removed&&i!==void 0&&this.app.send(wu(e,i,o));const u=this.attributesMap.get(e);if(u!==void 0){if(!St(n))throw"commitNode: node is not an element";for(const c of u)this.sendNodeAttribute(e,n,c,n.getAttribute(c))}if(this.textSet.has(e)){if(!tr(n))throw"commitNode: node is not a text";this.sendNodeData(e,s,n.data)}return!0}commitNode(e){const n=this.app.nodes.getNode(e);if(n===void 0)return!1;const s=this.commited[e];return s!==void 0?s:this.commited[e]=this._commitNode(e,n)}commitNodes(e=!1){let n;this.recents.forEach((s,i)=>{this.commitNode(i),s===ot.New&&(n=this.app.nodes.getNode(i))&&this.app.nodes.callNodeCallbacks(n,e)}),this.clear()}observeRoot(e,n,s=e){this.observer.observe(e,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1}),this.bindTree(s),n(this.app.nodes.getID(e)),this.commitNodes(!0)}disconnect(){this.observer.disconnect(),this.clear()}}class Ea extends ir{observe(e){const n=e.contentDocument,s=this.app.nodes.getID(e);!n||s===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.app.send(Gi(s,i))})}syntheticObserve(e,n){this.observeRoot(n,s=>{if(s===void 0){this.app.debug.log("OpenReplay: Iframe document not bound");return}this.app.send(Gi(e,s))})}}class kh extends ir{observe(e){const n=e.shadowRoot,s=this.app.nodes.getID(e);!n||s===void 0||this.observeRoot(n,i=>{if(i===void 0){this.app.debug.error("OpenReplay: Shadow Root was not bound");return}this.app.send(Gi(s,i))})}}class Th{constructor(){this.states=new Map}calcOffset(e){let n=0,s=0;if(e.parent&&([n,s]=this.calcOffset(e.parent)),!e.offset){const{left:a,top:l}=e.iFrame.getBoundingClientRect();e.offset=[a,l]}const[i,r]=e.offset;return[n+i,s+r]}getDocumentOffset(e){const n=this.states.get(e);return n?this.calcOffset(n):[0,0]}observe(e){var l;const n=e.contentDocument;if(!n)return;const s=e.ownerDocument,i=this.states.get(s),r={offset:null,iFrame:e,parent:i||null,clear:()=>{var o;s.removeEventListener("scroll",a),(o=s.defaultView)==null||o.removeEventListener("resize",a)}},a=()=>{r.offset=null};s.addEventListener("scroll",a),(l=s.defaultView)==null||l.addEventListener("resize",a),this.states.set(n,r)}clear(){this.states.forEach(e=>e.clear()),this.states.clear()}}const rr=rt?Element.prototype.attachShadow:()=>new ShadowRoot;class xh extends ir{constructor(e,n){super(e,!0),this.iframeOffsets=new Th,this.contextCallbacks=[],this.contextsSet=new Set,this.iframeObservers=[],this.shadowRootObservers=[],this.options=Object.assign({captureIFrames:!0},n),this.app.nodes.attachNodeCallback(s=>{ge(s,"iframe")&&(this.options.captureIFrames&&!Zt(s,"obscured")||Zt(s,"capture"))&&this.handleIframe(s)}),this.app.nodes.attachNodeCallback(s=>{St(s)&&s.shadowRoot!==null&&this.handleShadowRoot(s.shadowRoot)})}attachContextCallback(e){this.contextCallbacks.push(e)}getDocumentOffset(e){return this.iframeOffsets.getDocumentOffset(e)}handleIframe(e){let n=null;const s=this.app.safe(()=>setTimeout(()=>{if(this.app.nodes.getID(e)===void 0||!lu(e))return;const r=e.contentWindow,a=e.contentDocument;if(a&&a!==n){const l=new Ea(this.app);this.iframeObservers.push(l),l.observe(e),n=a,this.iframeOffsets.observe(e)}r&&r===r.window&&!this.contextsSet.has(r)&&(this.contextsSet.add(r),this.contextCallbacks.forEach(l=>l(r)))},100));e.addEventListener("load",s),s()}handleShadowRoot(e){const n=new kh(this.app);this.shadowRootObservers.push(n),n.observe(e.host)}observe(){const e=this;Element.prototype.attachShadow=function(){const n=rr.apply(this,arguments);return e.handleShadowRoot(n),n},this.app.nodes.clear(),this.observeRoot(window.document,()=>{this.app.send(mu()),this.app.nodes.callNodeCallbacks(document,!0)},window.document.documentElement)}crossdomainObserve(e,n){const s=this;Element.prototype.attachShadow=function(){const r=rr.apply(this,arguments);return s.handleShadowRoot(r),r},this.app.nodes.clear(),this.app.nodes.syntheticMode(n);const i=new Ea(this.app);this.iframeObservers.push(i),i.syntheticObserve(e,window.document)}disconnect(){this.iframeOffsets.clear(),Element.prototype.attachShadow=rr,this.iframeObservers.forEach(e=>e.disconnect()),this.iframeObservers=[],this.shadowRootObservers.forEach(e=>e.disconnect()),this.shadowRootObservers=[],super.disconnect()}}var Hs;(function(t){t[t.Plain=0]="Plain",t[t.Obscured=1]="Obscured",t[t.Hidden=2]="Hidden"})(Hs||(Hs={}));const Eh=t=>t.trim().replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g,"█");class Ih{constructor(e,n){this.app=e,this.obscured=new Set,this.hidden=new Set,this.options=Object.assign({obscureTextEmails:!0,obscureTextNumbers:!1},n)}handleNode(e,n,s){if((this.obscured.has(n)||St(s)&&(Zt(s,"masked")||Zt(s,"obscured")))&&this.obscured.add(e),(this.hidden.has(n)||St(s)&&(Zt(s,"htmlmasked")||Zt(s,"hidden")))&&this.hidden.add(e),this.options.domSanitizer!==void 0&&St(s)){const i=this.options.domSanitizer(s);i===Hs.Obscured&&this.obscured.add(e),i===Hs.Hidden&&this.hidden.add(e)}}sanitize(e,n){return this.obscured.has(e)?Eh(n):(this.options.obscureTextNumbers&&(n=n.replace(/\d/g,"0")),this.options.obscureTextEmails&&(n=n.replace(/^\w+([+.-]\w+)*@\w+([.-]\w+)*\.\w{2,3}$/g,s=>{const[i,r]=s.split("@"),[a,l]=r.split(".");return`${Ui(i)}@${Ui(a)}.${Ui(l)}`})),n)}isObscured(e){return this.obscured.has(e)}isHidden(e){return this.hidden.has(e)}getInnerTextSecure(e){const n=this.app.nodes.getID(e);return n?this.sanitize(n,e.innerText):""}clear(){this.obscured.clear(),this.hidden.clear()}}class Ch{constructor(e,n){this.app=e,this.options=n,this.metadata={},this.userID=null,this.callbacks=[],this.timestamp=0,this.createTabId()}attachUpdateCallback(e){this.callbacks.push(e)}handleUpdate(e){e.userID==null&&delete e.userID,e.sessionID==null&&delete e.sessionID,this.callbacks.forEach(n=>n(e))}assign(e){e.userID!==void 0&&(this.userID=e.userID),e.metadata!==void 0&&Object.entries(e.metadata).forEach(([n,s])=>this.metadata[n]=s),e.sessionID!==void 0&&(this.sessionID=e.sessionID),e.timestamp!==void 0&&(this.timestamp=e.timestamp),e.projectID!==void 0&&(this.projectID=e.projectID),this.handleUpdate(e)}setMetadata(e,n){this.metadata[e]=n,this.handleUpdate({metadata:{[e]:n}})}setUserID(e){this.userID=e,this.handleUpdate({userID:e})}setUserInfo(e){this.userInfo=e}getPageNumber(){const e=this.app.sessionStorage.getItem(this.options.session_pageno_key);if(e!=null)return parseInt(e)}incPageNo(){let e=this.getPageNumber();return e===void 0?e=0:e++,this.app.sessionStorage.setItem(this.options.session_pageno_key,e.toString()),e}getSessionToken(){return this.app.sessionStorage.getItem(this.options.session_token_key)||void 0}setSessionToken(e){this.app.sessionStorage.setItem(this.options.session_token_key,e)}applySessionHash(e){const n=decodeURI(e).split("&");let s=e,i="100500";n.length==2&&([i,s]=n),!(!i||!s)&&(this.app.sessionStorage.setItem(this.options.session_token_key,s),this.app.sessionStorage.setItem(this.options.session_pageno_key,i))}getSessionHash(){const e=this.getPageNumber(),n=this.getSessionToken();if(!(e===void 0||n===void 0))return encodeURI(String(e)+"&"+n)}getTabId(){return this.tabId||this.createTabId(),this.tabId}regenerateTabId(){const e=cu(12);this.app.sessionStorage.setItem(this.options.session_tabid_key,e),this.tabId=e}createTabId(){const e=this.app.sessionStorage.getItem(this.options.session_tabid_key);e?this.tabId=e:this.regenerateTabId()}getInfo(){return{sessionID:this.sessionID,metadata:this.metadata,userID:this.userID,timestamp:this.timestamp,projectID:this.projectID}}reset(){this.app.sessionStorage.removeItem(this.options.session_token_key),this.metadata={},this.userID=null,this.sessionID=void 0,this.timestamp=0}}function Nh(t,e){let n=0;return()=>{n++>=e&&(n=0,t())}}class Rh{constructor(e){this.app=e,this.timer=null,this.callbacks=[]}attach(e,n=0,s=!0,i){i&&(e=e.bind(i)),s&&(e=this.app.safe(e)),this.callbacks.unshift(n?Nh(e,n):e)-1}start(){this.timer===null&&(this.timer=setInterval(()=>this.callbacks.forEach(e=>{e&&e()}),30))}stop(){this.timer!==null&&(clearInterval(this.timer),this.timer=null)}}const ss="canceled",Ia="or_uxt_active",or="or_buffer_1",Mt=t=>({reason:t,success:!1}),Dh=t=>({...t,success:!0});var me;(function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Active=2]="Active",t[t.ColdStart=3]="ColdStart"})(me||(me={}));const Ca="https://api.openreplay.com/ingest";function ar(){const t=new Date().getTimezoneOffset()*-1,e=t>=0?"+":"-",n=Math.floor(Math.abs(t)/60),s=Math.abs(t)%60;return`UTC${e}${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`}const Oh=t=>new Promise(e=>setTimeout(e,t)),Ue={ask:"never-gonna-give-you-up",resp:"never-gonna-let-you-down",reg:"never-gonna-run-around-and-desert-you",iframeSignal:"never-gonna-make-you-cry",iframeId:"never-gonna-say-goodbye",iframeBatch:"never-gonna-tell-a-lie-and-hurt-you"};let Ah=class{constructor(e,n,s,i,r){this.signalError=i,this.insideIframe=r,this.messages=[],this.bufferedMessages1=[],this.bufferedMessages2=[],this.startCallbacks=[],this.stopCallbacks=[],this.commitCallbacks=[],this.activityState=me.NotActive,this.version="14.0.4",this.socketMode=!1,this.compressionThreshold=24*1e3,this.bc=null,this.canvasRecorder=null,this.conditionsManager=null,this.canStart=!1,this.rootId=null,this.pageFrames=[],this.frameOderNumber=0,this.initialHostName=location.hostname,this.startTimeout=null,this.coldStartCommitN=0,this.delay=0,this.coldInterval=null,this.orderNumber=0,this.coldStartTs=0,this.singleBuffer=!1,this.onSessionSent=()=>{},this.restartCanvasTracking=()=>{var o;(o=this.canvasRecorder)==null||o.restartTracking()},this.flushBuffer=async o=>new Promise(u=>{let c=!1;const h=[o.shift()];for(;!c;){const f=o[0];!f||f[0]===0?c=!0:h.push(o.shift())}this.postToWorker(h),u(null)}),this.onUxtCb=[],this.contextId=Math.random().toString(36).slice(2),this.projectKey=e,Object.keys(s).findIndex(o=>["fixedCanvasScaling","disableCanvas"].includes(o))!==-1&&(console.warn('Openreplay: canvas options are moving to separate key "canvas" in next update. Please update your configuration.'),s={...s,canvas:{__save_canvas_locally:s.__save_canvas_locally,fixedCanvasScaling:s.fixedCanvasScaling,disableCanvas:s.disableCanvas}}),this.networkOptions=s.network;const a={revID:"",node_id:"__openreplay_id",session_token_key:"__openreplay_token",session_pageno_key:"__openreplay_pageno",session_reset_key:"__openreplay_reset",session_tabid_key:"__openreplay_tabid",local_uuid_key:"__openreplay_uuid",ingestPoint:Ca,resourceBaseHref:null,__is_snippet:!1,__debug_report_edp:null,__debug__:ns.Silent,__save_canvas_locally:!1,localStorage:null,sessionStorage:null,disableStringDict:!1,forceSingleTab:!1,assistSocketHost:"",fixedCanvasScaling:!1,disableCanvas:!1,captureIFrames:!0,obscureTextEmails:!0,obscureTextNumbers:!1,crossdomain:{parentDomain:"*"},canvas:{disableCanvas:!1,fixedCanvasScaling:!1,__save_canvas_locally:!1,useAnimationFrame:!1}};if(this.options=ia(a,s),!this.insideIframe&&!this.options.forceSingleTab&&globalThis&&"BroadcastChannel"in globalThis){const o=location.hostname.split(".").slice(-2).join("_");this.bc=new BroadcastChannel(`rick_${o}`)}this.revID=this.options.revID,this.localStorage=this.options.localStorage??window.localStorage,this.sessionStorage=this.options.sessionStorage??window.sessionStorage,this.sanitizer=new Ih(this,s),this.nodes=new _h(this.options.node_id),this.observer=new xh(this,s),this.ticker=new Rh(this),this.ticker.attach(()=>this.commit()),this.debug=new Sh(this.options.__debug__),this.session=new Ch(this,this.options),this.attributeSender=new nu(this,!!this.options.disableStringDict),this.featureFlags=new ru(this),this.tagWatcher=new Xu(this.sessionStorage,this.debug.error,o=>{this.send(Vu(o))}),this.session.attachUpdateCallback(({userID:o,metadata:u})=>{o!=null&&this.send(Ru(o)),u!=null&&Object.entries(u).forEach(([c,h])=>this.send(oa(c,h)))}),n!=null&&this.session.applySessionHash(n),this.initWorker();const l=this.session.getTabId();if(this.insideIframe){const o=c=>{const{data:h}=c;h.line===Ue.iframeId&&(this.rootId=h.id,this.session.setSessionToken(h.token),this.frameOderNumber=h.frameOrderNumber,this.debug.log("starting iframe tracking",h),this.allowAppStart())};window.addEventListener("message",o),this.attachStopCallback(()=>{window.removeEventListener("message",o)});const u=this.initialHostName;window.parent.postMessage({line:Ue.iframeSignal,source:l,context:this.contextId,domain:u},"*")}else{let o=0;const u=c=>{const{data:h}=c;if(h.line===Ue.iframeSignal){const f=h.domain,d=Array.from(document.querySelectorAll("iframe"));this.pageFrames=d,(async()=>{let g=0;for(;g<10;){const v=this.checkNodeId(d,f);if(v){this.waitStarted().then(()=>{var E;o++;const k=this.session.getSessionToken(),C={line:Ue.iframeId,context:this.contextId,domain:f,id:v,token:k,frameOrderNumber:o};this.debug.log("iframe_data",C),(E=c.source)==null||E.postMessage(C,"*")}).catch(console.error),g=10;break}g++,await Oh(100)}})()}if(h.line===Ue.iframeBatch){const d=h.messages.map(p=>{if(p[0]===20){let g=p;return this.pageFrames.forEach(v=>{if(v.dataset.domain===c.data.domain){const[k,C,E]=p,{left:m,top:y}=v.getBoundingClientRect();g=[k,C+m,E+y]}}),g}if(p[0]===68){let g=p;return this.pageFrames.forEach(v=>{if(v.dataset.domain===c.data.domain){const[k,C,E,m,y,T,x]=p,{left:S,top:_,width:A,height:W}=v.getBoundingClientRect(),D=document.documentElement.scrollWidth,U=document.documentElement.scrollHeight,R=T/100*A+S,P=x/100*W+_,I=R/D,O=P/U;g=[k,C,E,m,y,Math.round(I*1e3)/10,Math.round(O*1e3)/10]}}),g}return p});this.messages.push(...d)}};window.addEventListener("message",u),this.attachStopCallback(()=>{window.removeEventListener("message",u)})}this.bc!==null&&(this.bc.postMessage({line:Ue.ask,source:l,context:this.contextId}),this.startTimeout=setTimeout(()=>{this.allowAppStart()},500),this.bc.onmessage=o=>{if(o.data.context!==this.contextId){if(o.data.line===Ue.resp){const u=o.data.token;this.session.setSessionToken(u),this.allowAppStart()}if(o.data.line===Ue.reg){const u=o.data.token;this.session.regenerateTabId(),this.session.setSessionToken(u),this.allowAppStart()}if(o.data.line===Ue.ask){const u=this.session.getSessionToken();u&&this.bc&&this.bc.postMessage({line:o.data.source===l?Ue.reg:Ue.resp,token:u,source:l,context:this.contextId})}}})}allowAppStart(){this.canStart=!0,this.startTimeout&&(clearTimeout(this.startTimeout),this.startTimeout=null)}checkNodeId(e,n){for(const s of e)if(s.dataset.domain===n)return s[this.options.node_id];return null}initWorker(){try{this.worker=new Worker(URL.createObjectURL(new Blob(['"use strict";class t{constructor(t,s,i,e=10,n=250,h,r){this.onUnauthorised=s,this.onFailure=i,this.MAX_ATTEMPTS_COUNT=e,this.ATTEMPT_TIMEOUT=n,this.onCompress=h,this.pageNo=r,this.attemptsCount=0,this.busy=!1,this.queue=[],this.token=null,this.lastBatchNum=0,this.ingestURL=t+"/v1/web/i",this.isCompressing=void 0!==h}getQueueStatus(){return 0===this.queue.length&&!this.busy}authorise(t){this.token=t,this.busy||this.sendNext()}push(t){if(this.busy||!this.token)this.queue.push(t);else if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t);else{const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}}sendNext(){const t=this.queue.shift();if(t)if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t);else{const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}else this.busy=!1}retry(t,s,i){this.attemptsCount>=this.MAX_ATTEMPTS_COUNT?this.onFailure(`Failed to send batch after ${this.attemptsCount} attempts.`):(this.attemptsCount++,setTimeout((()=>this.sendBatch(t,s,i)),this.ATTEMPT_TIMEOUT*this.attemptsCount))}sendBatch(t,s,i){const e=i?.toString().replace(/^([^_]+)_([^_]+).*/,"$1_$2_$3");this.busy=!0;const n={Authorization:`Bearer ${this.token}`};s&&(n["Content-Encoding"]="gzip"),null!==this.token?fetch(`${this.ingestURL}?batch=${this.pageNo??"noPageNum"}_${e??"noBatchNum"}`,{body:t,method:"POST",headers:n,keepalive:t.length<65536}).then((e=>{if(401===e.status)return this.busy=!1,void this.onUnauthorised();e.status>=400?this.retry(t,s,`${i??"noBatchNum"}_network:${e.status}`):(this.attemptsCount=0,this.sendNext())})).catch((e=>{console.warn("OpenReplay:",e),this.retry(t,s,`${i??"noBatchNum"}_reject:${e.message}`)})):setTimeout((()=>{this.sendBatch(t,s,`${i??"noBatchNum"}_newToken`)}),500)}sendCompressed(t){const s=++this.lastBatchNum;this.sendBatch(t,!0,s)}sendUncompressed(t){const s=++this.lastBatchNum;this.sendBatch(t,!1,s)}clean(){this.sendNext(),setTimeout((()=>{this.token=null,this.queue.length=0}),10)}}const s="function"==typeof TextEncoder?new TextEncoder:{encode(t){const s=t.length,i=new Uint8Array(3*s);let e=-1;for(let n=0,h=0,r=0;r!==s;){if(n=t.charCodeAt(r),r+=1,n>=55296&&n<=56319){if(r===s){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;break}if(h=t.charCodeAt(r),!(h>=56320&&h<=57343)){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;continue}if(n=1024*(n-55296)+h-56320+65536,r+=1,n>65535){i[e+=1]=240|n>>>18,i[e+=1]=128|n>>>12&63,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n;continue}}n<=127?i[e+=1]=0|n:n<=2047?(i[e+=1]=192|n>>>6,i[e+=1]=128|63&n):(i[e+=1]=224|n>>>12,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n)}return i.subarray(0,e+1)}};class i{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}getCurrentOffset(){return this.offset}checkpoint(){this.checkpointOffset=this.offset}get isEmpty(){return 0===this.offset}skip(t){return this.offset+=t,this.offset<=this.size}set(t,s){this.data.set(t,s)}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for((t<0||t>Number.MAX_SAFE_INTEGER)&&(t=0);t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const i=s.encode(t),e=i.byteLength;return!(!this.uint(e)||this.offset+e>this.size)&&(this.data.set(i,this.offset),this.offset+=e,!0)}reset(){this.offset=0,this.checkpointOffset=0}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}class e extends i{encode(t){switch(t[0]){case 0:case 11:case 114:case 115:return this.uint(t[1]);case 4:case 44:case 47:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 5:case 20:case 38:case 70:case 75:case 76:case 77:case 82:return this.uint(t[1])&&this.uint(t[2]);case 6:return this.int(t[1])&&this.int(t[2]);case 7:return!0;case 8:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.string(t[4])&&this.boolean(t[5]);case 9:case 10:case 24:case 51:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 12:case 61:case 71:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 13:case 14:case 17:case 50:case 54:return this.uint(t[1])&&this.string(t[2]);case 16:return this.uint(t[1])&&this.int(t[2])&&this.int(t[3]);case 18:return this.uint(t[1])&&this.string(t[2])&&this.int(t[3]);case 19:return this.uint(t[1])&&this.boolean(t[2]);case 21:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8]);case 22:case 27:case 30:case 41:case 45:case 46:case 63:case 64:case 79:return this.string(t[1])&&this.string(t[2]);case 23:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 28:case 29:case 42:case 117:case 118:return this.string(t[1]);case 37:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3]);case 39:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7]);case 40:return this.string(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 48:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.int(t[5]);case 49:return this.int(t[1])&&this.int(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 53:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8]);case 55:return this.boolean(t[1]);case 57:case 60:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 58:case 120:return this.int(t[1]);case 59:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6])&&this.string(t[7]);case 67:case 73:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 68:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6]);case 69:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 78:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 81:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.int(t[4])&&this.string(t[5]);case 83:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 84:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6]);case 112:return this.uint(t[1])&&this.string(t[2])&&this.boolean(t[3])&&this.string(t[4])&&this.int(t[5])&&this.int(t[6]);case 113:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3]);case 116:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8])&&this.uint(t[9])&&this.boolean(t[10]);case 119:return this.string(t[1])&&this.uint(t[2]);case 121:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 122:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 123:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])}}}class n{constructor(t,s,i,n,h,r){this.pageNo=t,this.timestamp=s,this.url=i,this.onBatch=n,this.tabId=h,this.onOfflineEnd=r,this.nextIndex=0,this.beaconSize=2e5,this.encoder=new e(this.beaconSize),this.sizeBuffer=new Uint8Array(3),this.isEmpty=!0,this.beaconSizeLimit=1e6,this.prepare()}writeType(t){return this.encoder.uint(t[0])}writeFields(t){return this.encoder.encode(t)}writeSizeAt(t,s){for(let s=0;s<3;s++)this.sizeBuffer[s]=t>>8*s;this.encoder.set(this.sizeBuffer,s)}prepare(){if(!this.encoder.isEmpty)return;const t=[81,1,this.pageNo,this.nextIndex,this.timestamp,this.url],s=[118,this.tabId];this.writeType(t),this.writeFields(t),this.writeWithSize(s),this.isEmpty=!0}writeWithSize(t){const s=this.encoder;if(!this.writeType(t)||!s.skip(3))return!1;const i=s.getCurrentOffset(),e=this.writeFields(t);if(e){const e=s.getCurrentOffset()-i;if(e>16777215)return console.warn("OpenReplay: max message size overflow."),!1;this.writeSizeAt(e,i-3),s.checkpoint(),this.isEmpty=this.isEmpty&&0===t[0],this.nextIndex++}return e}setBeaconSizeLimit(t){this.beaconSizeLimit=t}writeMessage(t){if("q_end"===t[0])return this.finaliseBatch(),this.onOfflineEnd();0===t[0]&&(this.timestamp=t[1]),122===t[0]&&(this.url=t[1]),this.writeWithSize(t)||(this.finaliseBatch(),this.writeWithSize(t)||(this.encoder=new e(this.beaconSizeLimit),this.prepare(),this.writeWithSize(t)?this.finaliseBatch():console.warn("OpenReplay: beacon size overflow. Skipping large message.",t,this),this.encoder=new e(this.beaconSize),this.prepare()))}finaliseBatch(){if(this.isEmpty)return;const t=this.encoder.flush();this.onBatch(t),this.prepare()}clean(){this.encoder.reset()}}var h;!function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Stopping=2]="Stopping",t[t.Active=3]="Active",t[t.Stopped=4]="Stopped"}(h||(h={}));let r=null,a=null,u=h.NotActive;function o(){a&&a.finaliseBatch()}function c(){return new Promise((t=>{u=h.Stopping,null!==l&&(clearInterval(l),l=null),a&&(a.clean(),a=null),r&&(r.clean(),setTimeout((()=>{r=null}),20)),setTimeout((()=>{u=h.NotActive,t(null)}),100)}))}function g(){u!==h.Stopped&&(postMessage("a_stop"),c().then((()=>{postMessage("a_start")})))}let p,l=null;self.onmessage=({data:s})=>{if(null!=s){if("stop"===s)return o(),void c().then((()=>{u=h.Stopped}));if("forceFlushBatch"!==s){if(!Array.isArray(s)){if("compressed"===s.type){if(!r)return console.debug("OR WebWorker: sender not initialised. Compressed batch."),void g();s.batch&&r.sendCompressed(s.batch)}if("uncompressed"===s.type){if(!r)return console.debug("OR WebWorker: sender not initialised. Uncompressed batch."),void g();s.batch&&r.sendUncompressed(s.batch)}return"start"===s.type?(u=h.Starting,r=new t(s.ingestPoint,(()=>{g()}),(t=>{!function(t){postMessage({type:"failure",reason:t}),c()}(t)}),s.connAttemptCount,s.connAttemptGap,(t=>{postMessage({type:"compress",batch:t},[t.buffer])}),s.pageNo),a=new n(s.pageNo,s.timestamp,s.url,(t=>{r&&r.push(t)}),s.tabId,(()=>postMessage({type:"queue_empty"}))),null===l&&(l=setInterval(o,1e4)),u=h.Active):"auth"===s.type?r?a?(r.authorise(s.token),void(s.beaconSizeLimit&&a.setBeaconSizeLimit(s.beaconSizeLimit))):(console.debug("OR WebWorker: writer not initialised. Received auth."),void g()):(console.debug("OR WebWorker: sender not initialised. Received auth."),void g()):void 0}if(a){const t=a;s.forEach((s=>{55===s[0]&&(s[1]?p=setTimeout((()=>g()),18e5):clearTimeout(p)),t.writeMessage(s)}))}else postMessage("not_init"),g()}else o()}else o()};'],{type:"text/javascript"}))),this.worker.onerror=n=>{this._debug("webworker_error",n)},this.worker.onmessage=({data:n})=>{this.handleWorkerMsg(n)};const e=()=>{this.worker&&this.worker.postMessage(null)};this.attachEventListener(window,"beforeunload",e,!1),this.attachEventListener(document.body,"mouseleave",e,!1,!1),this.attachEventListener(document,"visibilitychange",e,!1)}catch(e){this._debug("worker_start",e)}}handleWorkerMsg(e){var n;if(e==="a_stop")this.stop(!1);else if(e==="a_start")this.start({},!0);else if(e==="not_init")this.debug.warn("OR WebWorker: writer not initialised. Restarting tracker");else if(e.type==="failure")this.stop(!1),this.debug.error("worker_failed",e.reason),this._debug("worker_failed",e.reason);else if(e.type==="compress"){const s=e.batch;s.byteLength>this.compressionThreshold?$c(e.batch,{mtime:0},(r,a)=>{var l,o;r?(this.debug.error("Openreplay compression error:",r),(l=this.worker)==null||l.postMessage({type:"uncompressed",batch:s})):(o=this.worker)==null||o.postMessage({type:"compressed",batch:a})}):(n=this.worker)==null||n.postMessage({type:"uncompressed",batch:s})}else e.type==="queue_empty"&&this.onSessionSent()}_debug(e,n){this.options.__debug_report_edp!==null&&fetch(this.options.__debug_report_edp,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e,error:`${n}`})}),this.debug.error("OpenReplay error: ",e,n)}send(e,n=!1){var s;this.activityState!==me.NotActive&&(this.activityState===me.ColdStart?(this.bufferedMessages1.push(e),this.singleBuffer||this.bufferedMessages2.push(e),(s=this.conditionsManager)==null||s.processMessage(e)):this.messages.push(e),this.activityState===me.Active&&n&&this.commit())}_nCommit(){if(this.socketMode){this.messages.unshift(en(this.session.getTabId())),this.messages.unshift($t(this.timestamp())),this.commitCallbacks.forEach(e=>e(this.messages)),this.messages.length=0;return}if(!(this.worker===void 0||!this.messages.length)){if(this.insideIframe){window.parent.postMessage({line:Ue.iframeBatch,messages:this.messages,domain:this.initialHostName},"*"),this.commitCallbacks.forEach(e=>e(this.messages)),this.messages.length=0;return}try{du(()=>{var e;this.messages.unshift(en(this.session.getTabId())),this.messages.unshift($t(this.timestamp())),(e=this.worker)==null||e.postMessage(this.messages),this.commitCallbacks.forEach(n=>n(this.messages)),this.messages.length=0})}catch(e){this._debug("worker_commit",e),this.stop(!0),setTimeout(()=>{this.start()},500)}}}_cStartCommit(){this.coldStartCommitN+=1,this.coldStartCommitN===2&&(this.bufferedMessages1.push($t(this.timestamp())),this.bufferedMessages1.push(en(this.session.getTabId())),this.bufferedMessages2.push($t(this.timestamp())),this.bufferedMessages2.push(en(this.session.getTabId())),this.coldStartCommitN=0)}commit(){this.activityState===me.ColdStart?this._cStartCommit():this._nCommit()}postToWorker(e){var n;(n=this.worker)==null||n.postMessage(e),this.commitCallbacks.forEach(s=>s(e)),e.length=0}timestamp(){return Qe()+this.delay}safe(e){const n=this;return function(...s){try{e.apply(this,s)}catch(i){n._debug("safe_fn_call",i)}}}attachCommitCallback(e){this.commitCallbacks.push(e)}attachStartCallback(e,n=!1){n&&(e=this.safe(e)),this.startCallbacks.push(e)}attachStopCallback(e,n=!1){n&&(e=this.safe(e)),this.stopCallbacks.push(e)}attachEventListener(e,n,s,i=!0,r=!0){i&&(s=this.safe(s));const a=()=>e?na(e,n,s,r):null,l=()=>e?sa(e,n,s,r):null;this.attachStartCallback(a,i),this.attachStopCallback(l,i)}checkRequiredVersion(e){const n=e.split(/[.-]/),s=this.version.split(/[.-]/);for(let i=0;i<3;i++){if(isNaN(Number(s[i]))||isNaN(Number(n[i])))return!1;if(Number(s[i])>Number(n[i]))return!0;if(Number(s[i])<Number(n[i]))return!1}return!0}getTrackerInfo(){return{userUUID:this.localStorage.getItem(this.options.local_uuid_key),projectKey:this.projectKey,revID:this.revID,trackerVersion:this.version,isSnippet:this.options.__is_snippet}}getSessionInfo(){return{...this.session.getInfo(),...this.getTrackerInfo()}}getSessionToken(){return this.session.getSessionToken()}getSessionID(){return this.session.getInfo().sessionID||void 0}getSessionURL(e){const{projectID:n,sessionID:s,timestamp:i}=this.session.getInfo();if(!n||!s){this.debug.error("OpenReplay error: Unable to build session URL");return}const r=this.options.ingestPoint,o=(/api\.openreplay\.com/.test(r)?"https://app.openreplay.com/ingest":r).replace(/ingest$/,`${n}/session/${s}`);if(e!=null&&e.withCurrentTime){const u=Qe()-i;return`${o}?jumpto=${u}`}return o}getHost(){return new URL(this.options.ingestPoint).host}getProjectKey(){return this.projectKey}getBaseHref(){var e,n;return typeof this.options.resourceBaseHref=="string"?this.options.resourceBaseHref:(this.options.resourceBaseHref,document.baseURI?document.baseURI:((n=(e=document.head)==null?void 0:e.getElementsByTagName("base")[0])==null?void 0:n.getAttribute("href"))||location.origin+location.pathname)}resolveResourceURL(e){const n=new URL(this.getBaseHref());return n.pathname+="/"+new URL(e).pathname,n.pathname.replace(/\/+/g,"/"),n.toString()}isServiceURL(e){return e.startsWith(this.options.ingestPoint)}active(){return this.activityState===me.Active}resetNextPageSession(e){e?this.sessionStorage.setItem(this.options.session_reset_key,"t"):this.sessionStorage.removeItem(this.options.session_reset_key)}checkSessionToken(e){const n=this.sessionStorage.getItem(this.options.session_reset_key)!==null,s=e||n,i=this.session.getSessionToken();return s||!i}async coldStart(e={},n){this.singleBuffer=!1;const s=1e3,i=this.checkSessionToken(e.forceNew);n&&await this.setupConditionalStart(e);const r=()=>{this.orderNumber+=1,zi(),this.coldStartTs=Qe(),this.orderNumber%2===0?(this.bufferedMessages1.length=0,this.bufferedMessages1.push($t(this.timestamp())),this.bufferedMessages1.push(en(this.session.getTabId()))):(this.bufferedMessages2.length=0,this.bufferedMessages2.push($t(this.timestamp())),this.bufferedMessages2.push(en(this.session.getTabId()))),this.stop(!1),this.activityState=me.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata}),i||(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(Fs(this.session.getTabId()))),this.observer.observe(),this.ticker.start()};this.coldInterval=setInterval(()=>{r()},30*s),r()}async setupConditionalStart(e){var f,d;this.conditionsManager=new su(this,e);const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:Qe(),doNotRecord:!0,bufferDiff:0,userID:this.session.getInfo().userID,token:void 0,deviceMemory:Ji,jsHeapSizeLimit:Qi,timezone:ar(),width:window.screen.width,height:window.screen.height})}),{token:s,userBrowser:i,userCity:r,userCountry:a,userDevice:l,userOS:o,userState:u,projectID:c}=await n.json();this.session.assign({projectID:c}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:a,userDevice:l,userOS:o,userState:u});const h={sessionToken:s,userUUID:"",sessionID:""};this.startCallbacks.forEach(p=>p(h)),await((f=this.conditionsManager)==null?void 0:f.fetchConditions(c,s)),await this.featureFlags.reloadFlags(s),await this.tagWatcher.fetchTags(this.options.ingestPoint,s),(d=this.conditionsManager)==null||d.processFlags(this.featureFlags.flags)}offlineRecording(e={},n){this.onSessionSent=n,this.singleBuffer=!0;const s=this.checkSessionToken(e.forceNew);zi(),this.coldStartTs=Qe();const i=this.localStorage.getItem(or);if(i){const a=JSON.parse(i);this.bufferedMessages1=Array.isArray(a)?a:this.bufferedMessages1,this.localStorage.removeItem(or)}this.bufferedMessages1.push($t(this.timestamp())),this.bufferedMessages1.push(en(this.session.getTabId())),this.activityState=me.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r={sessionToken:"",userUUID:"",sessionID:""};return this.startCallbacks.forEach(a=>a(r)),s||this.send(Fs(this.session.getTabId())),this.observer.observe(),this.ticker.start(),{saveBuffer:this.saveBuffer,getBuffer:this.getBuffer,setBuffer:this.setBuffer}}saveBuffer(){this.localStorage.setItem(or,JSON.stringify(this.bufferedMessages1))}getBuffer(){return this.bufferedMessages1}setBuffer(e){this.bufferedMessages1=e}async uploadOfflineRecording(){var f,d;this.stop(!1);const e=Qe();(f=this.worker)==null||f.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:this.coldStartTs,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId()});const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:e,doNotRecord:!1,bufferDiff:e-this.coldStartTs,userID:this.session.getInfo().userID,token:void 0,deviceMemory:Ji,jsHeapSizeLimit:Qi,timezone:ar()})}),{token:s,userBrowser:i,userCity:r,userCountry:a,userDevice:l,userOS:o,userState:u,beaconSizeLimit:c,projectID:h}=await n.json();for((d=this.worker)==null||d.postMessage({type:"auth",token:s,beaconSizeLimit:c}),this.session.assign({projectID:h}),this.session.setUserInfo({userBrowser:i,userCity:r,userCountry:a,userDevice:l,userOS:o,userState:u});this.bufferedMessages1.length>0;)await this.flushBuffer(this.bufferedMessages1);this.postToWorker([["q_end"]]),this.clearBuffers()}async _start(e={},n=!1,s){const i=this.activityState===me.ColdStart;if(i&&this.coldInterval&&clearInterval(this.coldInterval),!this.worker){const o="No worker found: perhaps, CSP is not set.";return this.signalError(o,[]),Promise.resolve(Mt(o))}if(this.activityState===me.Active||this.activityState===me.Starting)return Promise.resolve(Mt("OpenReplay: trying to call `start()` on the instance that has been started already."));this.activityState=me.Starting,i||zi(),e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const r=Qe();this.worker.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:i?this.coldStartTs:r,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId()});const a=this.session.getSessionToken(),l=this.checkSessionToken(e.forceNew);this.sessionStorage.removeItem(this.options.session_reset_key),this.debug.log("OpenReplay: starting session; need new session id?",l,"session token: ",a);try{const o=await window.fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:r,doNotRecord:!1,bufferDiff:r-this.coldStartTs,userID:this.session.getInfo().userID,token:l?void 0:a,deviceMemory:Ji,jsHeapSizeLimit:Qi,timezone:ar(),condition:s,assistOnly:e.assistOnly??this.socketMode,width:window.screen.width,height:window.screen.height})});if(o.status!==200){const R=await o.text(),P=R===ss?ss:`Server error: ${o.status}. ${R}`;return Mt(P)}if(!this.worker){const R="no worker found after start request (this should not happen in real world)";return this.signalError(R,[]),Mt(R)}const{token:u,userUUID:c,projectID:h,beaconSizeLimit:f,compressionThreshold:d,delay:p,sessionID:g,startTimestamp:v,userBrowser:k,userCity:C,userCountry:E,userDevice:m,userOS:y,userState:T,canvasEnabled:x,canvasQuality:S,canvasFPS:_,assistOnly:A}=await o.json();if(typeof u!="string"||typeof c!="string"||typeof v!="number"&&typeof v<"u"||typeof g!="string"||typeof p!="number"||typeof f!="number"&&typeof f<"u"){const R=`Incorrect server response: ${JSON.stringify(o)}`;return this.signalError(R,[]),Mt(R)}this.delay=p,this.session.setSessionToken(u),this.session.setUserInfo({userBrowser:k,userCity:C,userCountry:E,userDevice:m,userOS:y,userState:T}),this.session.assign({sessionID:g,timestamp:v||r,projectID:h}),A?(this.socketMode=!0,this.worker.postMessage("stop")):this.worker.postMessage({type:"auth",token:u,beaconSizeLimit:f}),!l&&u===a&&(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(Fs(this.session.getTabId()))),Object.entries(this.session.getInfo().metadata).forEach(([R,P])=>this.send(oa(R,P))),this.localStorage.setItem(this.options.local_uuid_key,c),this.compressionThreshold=d;const W={sessionToken:u,userUUID:c,sessionID:g};if(this.startCallbacks.forEach(R=>R(W)),this.featureFlags.reloadFlags(),await this.tagWatcher.fetchTags(this.options.ingestPoint,u),this.activityState=me.Active,x&&!this.options.canvas.disableCanvas&&(this.canvasRecorder=this.canvasRecorder??new bh(this,{fps:_,quality:S,isDebug:this.options.canvas.__save_canvas_locally,fixedScaling:this.options.canvas.fixedCanvasScaling,useAnimationFrame:this.options.canvas.useAnimationFrame}),this.canvasRecorder.startTracking()),i){const R=this.bufferedMessages1.length>this.bufferedMessages2.length?this.bufferedMessages1:this.bufferedMessages2;for(;R.length>0;)await this.flushBuffer(R);this.clearBuffers(),this.commit()}else this.insideIframe&&this.rootId?this.observer.crossdomainObserve(this.rootId,this.frameOderNumber):this.observer.observe(),this.ticker.start();this.uxtManager=this.uxtManager?this.uxtManager:new mh(this,Ia);let D;const U=this.localStorage.getItem(Ia);if(U&&(D=parseInt(U,10)),location!=null&&location.search){const R=new URLSearchParams(location.search);if(R.has("oruxt")){const P=R.get("oruxt");D=P?parseInt(P,10):void 0}}return D&&(this.uxtManager.isActive?this.onUxtCb.forEach(R=>R(D)):this.uxtManager.getTest(D,u,!!U).then(R=>{R&&this.onUxtCb.forEach(P=>P(R))})),Dh(W)}catch(o){if(this.stop(),this.session.reset(),o===ss)return this.signalError(ss,[]),Mt(ss);this._debug("session_start",o);const u=o instanceof Error?o.message:o.toString();return this.signalError(u,[]),Mt(u)}}addOnUxtCb(e){this.onUxtCb.push(e)}getUxtId(){var e;return(e=this.uxtManager)==null?void 0:e.getTestId()}async waitStart(){return new Promise(e=>{const n=()=>{this.canStart?e(!0):setTimeout(n,25)};n()})}async waitStarted(){return new Promise(e=>{const n=()=>{this.activityState===me.Active?e(!0):setTimeout(n,25)};n()})}async start(...e){return this.activityState===me.Active||this.activityState===me.Starting?Promise.resolve(Mt("OpenReplay: trying to call `start()` on the instance that has been started already.")):document.hidden?new Promise(n=>{const s=async()=>{document.hidden||(await this.waitStart(),document.removeEventListener("visibilitychange",s),n(this._start(...e)))};document.addEventListener("visibilitychange",s)}):(await this.waitStart(),this._start(...e))}forceFlushBatch(){var e;(e=this.worker)==null||e.postMessage("forceFlushBatch")}getTabId(){return this.session.getTabId()}clearBuffers(){this.bufferedMessages1.length=0,this.bufferedMessages2.length=0}trackWs(e){const n=e;return(s,i,r="down")=>{typeof s!="string"||typeof i!="string"||i.length>5*1024*1024||s.length>255||this.send(ju("websocket",n,i,this.timestamp(),r,s))}}stop(e=!0){var n;if(this.activityState!==me.NotActive)try{this.attributeSender.clear(),this.sanitizer.clear(),this.observer.disconnect(),this.nodes.clear(),this.ticker.stop(),this.stopCallbacks.forEach(s=>s()),this.debug.log("OpenReplay tracking stopped."),this.tagWatcher.clear(),this.worker&&e&&this.worker.postMessage("stop"),(n=this.canvasRecorder)==null||n.clear()}finally{this.activityState=me.NotActive}}};function Ph(t){const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e===void 0)return;const n=()=>t.send(Au(Math.round(e.downlink*1e3),e.type||"unknown"));n(),e.addEventListener("change",n)}const Na=rt&&"InstallTrigger"in window?t=>t.message+`
|
|
11
|
+
`+t.stack:t=>t.stack||t.message;function lr(t){return t===void 0?"undefined":t===null?"null":t instanceof Error?Na(t):Array.isArray(t)?`Array(${t.length})`:String(t)}function Mh(t){return typeof t!="number"?"NaN":t.toString()}function Lh(t){return typeof t!="number"?"NaN":Math.floor(t).toString()}function Ra(t){if(t===void 0)return"undefined";if(t===null)return"null";if(t instanceof Error)return Na(t);if(Array.isArray(t)){const e=t.length,n=t.slice(0,10).map(lr).join(", ");return`Array(${e})[${n}]`}if(typeof t=="object"){const e=[];let n=0;for(const s in t){if(++n===10)break;const i=t[s];e.push(s+": "+lr(i))}return"{"+e.join(", ")+"}"}return t.toString()}function Bh(t){return typeof t[0]=="string"&&t.unshift(t.shift().replace(/%(o|s|f|d|i)/g,(e,n)=>{const s=t.shift();if(s===void 0)return e;switch(n){case"o":return Ra(s);case"s":return lr(s);case"f":return Mh(s);case"d":case"i":return Lh(s);default:return e}})),t.map(Ra).join(" ")}const Da=["log","info","warn","error","debug","assert"];function Fh(t,e){const n=Object.assign({consoleMethods:Da,consoleThrottling:30},e);if(!Array.isArray(n.consoleMethods)||n.consoleMethods.length===0)return;const s=t.safe((o,u)=>t.send(Eu(o,Bh(u))));let i=0;const r=()=>{i=0};t.attachStartCallback(r),t.ticker.attach(r,33,!1);const a=(o,u)=>{const c={apply:function(h,f,d){Reflect.apply(h,u,d),i=i+1,!(i>n.consoleThrottling)&&s(h.name,d)}};n.consoleMethods.forEach(h=>{if(Da.indexOf(h)===-1){t.debug.error(`OpenReplay: unsupported console method "${h}"`);return}const f=u.console[h];o[h]=new Proxy(f,c)})},l=t.safe(o=>a(o.console,o));l(window),t.observer.attachContextCallback(l)}var Oa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Aa={exports:{}},cr={exports:{}},Pa;function jh(){return Pa||(Pa=1,function(t,e){(function(n,s){t.exports=s()})(Oa,function(){function n(g){return!isNaN(parseFloat(g))&&isFinite(g)}function s(g){return g.charAt(0).toUpperCase()+g.substring(1)}function i(g){return function(){return this[g]}}var r=["isConstructor","isEval","isNative","isToplevel"],a=["columnNumber","lineNumber"],l=["fileName","functionName","source"],o=["args"],u=["evalOrigin"],c=r.concat(a,l,o,u);function h(g){if(g)for(var v=0;v<c.length;v++)g[c[v]]!==void 0&&this["set"+s(c[v])](g[c[v]])}h.prototype={getArgs:function(){return this.args},setArgs:function(g){if(Object.prototype.toString.call(g)!=="[object Array]")throw new TypeError("Args must be an Array");this.args=g},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(g){if(g instanceof h)this.evalOrigin=g;else if(g instanceof Object)this.evalOrigin=new h(g);else throw new TypeError("Eval Origin must be an Object or StackFrame")},toString:function(){var g=this.getFileName()||"",v=this.getLineNumber()||"",k=this.getColumnNumber()||"",C=this.getFunctionName()||"";return this.getIsEval()?g?"[eval] ("+g+":"+v+":"+k+")":"[eval]:"+v+":"+k:C?C+" ("+g+":"+v+":"+k+")":g+":"+v+":"+k}},h.fromString=function(v){var k=v.indexOf("("),C=v.lastIndexOf(")"),E=v.substring(0,k),m=v.substring(k+1,C).split(","),y=v.substring(C+1);if(y.indexOf("@")===0)var T=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(y,""),x=T[1],S=T[2],_=T[3];return new h({functionName:E,args:m||void 0,fileName:x,lineNumber:S||void 0,columnNumber:_||void 0})};for(var f=0;f<r.length;f++)h.prototype["get"+s(r[f])]=i(r[f]),h.prototype["set"+s(r[f])]=function(g){return function(v){this[g]=!!v}}(r[f]);for(var d=0;d<a.length;d++)h.prototype["get"+s(a[d])]=i(a[d]),h.prototype["set"+s(a[d])]=function(g){return function(v){if(!n(v))throw new TypeError(g+" must be a Number");this[g]=Number(v)}}(a[d]);for(var p=0;p<l.length;p++)h.prototype["get"+s(l[p])]=i(l[p]),h.prototype["set"+s(l[p])]=function(g){return function(v){this[g]=String(v)}}(l[p]);return h})}(cr)),cr.exports}(function(t,e){(function(n,s){t.exports=s(jh())})(Oa,function(s){var i=/(^|@)\S+:\d+/,r=/^\s*at .*(\S+:\d+|\(native\))/m,a=/^(eval@)?(\[native code])?$/;return{parse:function(o){if(typeof o.stacktrace<"u"||typeof o["opera#sourceloc"]<"u")return this.parseOpera(o);if(o.stack&&o.stack.match(r))return this.parseV8OrIE(o);if(o.stack)return this.parseFFOrSafari(o);throw new Error("Cannot parse given Error object")},extractLocation:function(o){if(o.indexOf(":")===-1)return[o];var u=/(.+?)(?::(\d+))?(?::(\d+))?$/,c=u.exec(o.replace(/[()]/g,""));return[c[1],c[2]||void 0,c[3]||void 0]},parseV8OrIE:function(o){var u=o.stack.split(`
|
|
12
12
|
`).filter(function(c){return!!c.match(r)},this);return u.map(function(c){c.indexOf("(eval ")>-1&&(c=c.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var h=c.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),f=h.match(/ (\(.+\)$)/);h=f?h.replace(f[0],""):h;var d=this.extractLocation(f?f[1]:h),p=f&&h||void 0,g=["eval","<anonymous>"].indexOf(d[0])>-1?void 0:d[0];return new s({functionName:p,fileName:g,lineNumber:d[1],columnNumber:d[2],source:c})},this)},parseFFOrSafari:function(o){var u=o.stack.split(`
|
|
13
13
|
`).filter(function(c){return!c.match(a)},this);return u.map(function(c){if(c.indexOf(" > eval")>-1&&(c=c.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),c.indexOf("@")===-1&&c.indexOf(":")===-1)return new s({functionName:c});var h=/((.*".+"[^@]*)?[^@]*)(?:@)/,f=c.match(h),d=f&&f[1]?f[1]:void 0,p=this.extractLocation(c.replace(h,""));return new s({functionName:d,fileName:p[0],lineNumber:p[1],columnNumber:p[2],source:c})},this)},parseOpera:function(o){return!o.stacktrace||o.message.indexOf(`
|
|
14
14
|
`)>-1&&o.message.split(`
|
|
@@ -16,20 +16,16 @@ We appreciate your time and valuable input.`),r=V("div","end_button_or",da,"Subm
|
|
|
16
16
|
`).length?this.parseOpera9(o):o.stack?this.parseOpera11(o):this.parseOpera10(o)},parseOpera9:function(o){for(var u=/Line (\d+).*script (?:in )?(\S+)/i,c=o.message.split(`
|
|
17
17
|
`),h=[],f=2,d=c.length;f<d;f+=2){var p=u.exec(c[f]);p&&h.push(new s({fileName:p[2],lineNumber:p[1],source:c[f]}))}return h},parseOpera10:function(o){for(var u=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,c=o.stacktrace.split(`
|
|
18
18
|
`),h=[],f=0,d=c.length;f<d;f+=2){var p=u.exec(c[f]);p&&h.push(new s({functionName:p[3]||void 0,fileName:p[2],lineNumber:p[1],source:c[f]}))}return h},parseOpera11:function(o){var u=o.stack.split(`
|
|
19
|
-
`).filter(function(c){return!!c.match(i)&&!c.match(/^Error created at/)},this);return u.map(function(c){var h=c.split("@"),f=this.extractLocation(h.pop()),d=h.shift()||"",p=d.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,g;d.match(/\(([^)]*)\)/)&&(g=d.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var v=g===void 0||g==="[arguments not available]"?void 0:g.split(",");return new s({functionName:p,args:v,fileName:f[0],lineNumber:f[1],columnNumber:f[2],source:c})},this)}}})})(Na);var Bh=Na.exports;const Fh=Mh(Bh);function Da(t){return[{columnNumber:t.colno,lineNumber:t.lineno,fileName:t.filename,functionName:"",source:""}]}function zs(t,e,n={}){let s=e;try{s=Fh.parse(t)}catch{}return Gi(t.name,t.message,JSON.stringify(s),JSON.stringify(n))}function Oa(t,e=window,n={}){if(t instanceof ErrorEvent){if(t.error instanceof Error)return zs(t.error,Da(t),n);{let[s,i]=t.message.split(":");return i||(s="Error",i=t.message),Gi(s,i,JSON.stringify(Da(t)),JSON.stringify(n))}}else if("PromiseRejectionEvent"in e&&t instanceof e.PromiseRejectionEvent){if(t.reason instanceof Error)return zs(t.reason,[],n);{let s;try{s=JSON.stringify(t.reason)}catch{s=String(t.reason)}return Gi("Unhandled Promise Rejection",s,"[]",JSON.stringify(n))}}return null}function Wh(t,e){const n=Object.assign({captureExceptions:!0},e);function s(i){function r(a){const l=Oa(a,i);l!=null&&t.send(l)}t.attachEventListener(i,"unhandledrejection",r),t.attachEventListener(i,"error",r)}n.captureExceptions&&(t.observer.attachContextCallback(s),s(window))}function Aa(t,e=document.location){return t=t.trim(),t.startsWith("//")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")?t:t.startsWith("/")?e.origin+t:e.origin+e.pathname+t}function jh(t){return nu&&(t.startsWith("data:image/svg+xml")||t.match(/.svg$|/i))}const zh="https://static.openreplay.com/tracker/placeholder.jpeg";function Uh(t){function e(l,o){t.attributeSender.sendSetAttribute(l,"src",zh);const{width:u,height:c}=o.getBoundingClientRect();o.hasAttribute("width")||t.attributeSender.sendSetAttribute(l,"width",String(u)),o.hasAttribute("height")||t.attributeSender.sendSetAttribute(l,"height",String(c))}const n=function(l,o){const{srcset:u}=o;if(!u)return;const c=u.split(u.match(/,\s+/)?/,\s+/:",").map(h=>Aa(h)).join(", ");t.attributeSender.sendSetAttribute(l,"srcset",c)},s=function(l,o){o.src.length>su&&e(l,o),t.send(Hi(l,"src",o.src,t.getBaseHref()))},i=t.safe(function(l){const o=Aa(l.src||"");Xo(o)&&t.send(ca(t.timestamp(),0,0,0,0,0,o,"img",0,!1))}),r=t.safe(function(l){const o=t.nodes.getID(l);o!==void 0&&l.complete&&(l.naturalHeight===0&&l.naturalWidth===0&&!jh(l.src)?i(l):t.sanitizer.isHidden(o)||t.sanitizer.isObscured(o)?e(o,l):(s(o,l),n(o,l)))}),a=Qo(t.safe(l=>{for(const o of l)if(o.type==="attributes"){const u=o.target,c=t.nodes.getID(u);if(c===void 0)return;o.attributeName==="src"&&s(c,u),o.attributeName==="srcset"&&n(c,u)}}));t.attachStopCallback(()=>{a.disconnect()}),t.nodes.attachNodeCallback(l=>{ge(l,"img")&&(t.nodes.attachNodeListener(l,"error",()=>i(l)),t.nodes.attachNodeListener(l,"load",()=>r(l)),r(l),a.observe(l,{attributes:!0,attributeFilter:["src","srcset"]}))})}const Hh=["text","password","email","search","number","range","date","tel","time"];function qh(t){return ge(t,"textarea")?!0:ge(t,"input")?Hh.includes(t.type):!1}function Vh(t){if(!ge(t,"input"))return!1;const e=t.type;return e==="checkbox"||e==="radio"}const Gh=nt&&"labels"in HTMLInputElement.prototype?t=>{let e=t;for(;(e=e.parentNode)!==null;)if(ge(e,"label"))return e;const n=t.labels;if(n!==null&&n.length===1)return n[0]}:t=>{let e=t;for(;(e=e.parentNode)!==null;)if(ge(e,"label"))return e;const n=t.id;if(n){const s=t.ownerDocument.querySelectorAll('label[for="'+n+'"]');if(s!==null&&s.length===1)return s[0]}};function Pa(t){let e=zi(t);if(e===null){const n=Gh(t);e=n&&n.innerText||t.placeholder||t.name||t.id||t.className||t.type}return Ko(e).slice(0,100)}const En={Plain:0,Obscured:1,Hidden:2};function Kh(t,e){const n=Object.assign({obscureInputNumbers:!0,obscureInputEmails:!0,defaultInputMode:En.Obscured,obscureInputDates:!1},e);function s(c,h){let f=h.value,d=n.defaultInputMode;h.type==="password"||t.sanitizer.isHidden(c)?d=En.Hidden:(t.sanitizer.isObscured(c)||d===En.Plain&&(n.obscureInputNumbers&&h.type!=="date"&&/\d\d\d\d/.test(f)||n.obscureInputDates&&h.type==="date"||n.obscureInputEmails&&(h.type==="email"||~f.indexOf("@"))))&&(d=En.Obscured);let p=0;switch(d){case En.Hidden:p=-1,f="";break;case En.Obscured:p=f.length,f="";break}return{value:f,mask:p}}function i(c,h){const{value:f,mask:d}=s(c,h);t.send(wu(c,f,d))}const r=new Map,a=new Map;t.attachStopCallback(()=>{r.clear(),a.clear()});function l(c,h){r.get(c)!==h.value&&(r.set(c,h.value),i(c,h))}function o(c,h){a.get(c)!==h&&(a.set(c,h),t.send(yu(c,h)))}t.ticker.attach(()=>{r.forEach((c,h)=>{const f=t.nodes.getNode(h);if(!f)return r.delete(h);l(h,f)}),a.forEach((c,h)=>{const f=t.nodes.getNode(h);if(!f)return a.delete(h);o(h,f.checked)})},3);function u(c,h,f,d){const{value:p,mask:g}=s(c,h),v=Pa(h);t.send(Bu(c,p,g!==0,v,f,d))}t.nodes.attachNodeCallback(t.safe(c=>{const h=t.nodes.getID(c);if(h!==void 0){if(ge(c,"select")&&(i(h,c),t.nodes.attachNodeListener(c,"change",()=>i(h,c))),qh(c)){l(h,c);let f=0,d=0,p=0;const g=()=>{f=Ye()},v=()=>{d===0&&f!==0&&(d=Ye()-f)},_=()=>{f!==0&&(p=Ye()-f),u(h,c,d,p),d=0,p=0,f=0};t.nodes.attachNodeListener(c,"focus",g),t.nodes.attachNodeListener(c,"input",v),t.nodes.attachNodeListener(c,"change",_);return}if(Vh(c)){o(h,c.checked),t.nodes.attachNodeListener(c,"change",()=>o(h,c.checked));return}}}))}let ze,lr,Ma;function Xh(t,e){if(Ma=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(t.tagName.toLowerCase()==="html")return"html";const n={root:document.body,idName:i=>!0,className:i=>!0,tagName:i=>!0,attr:(i,r)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};ze={...n,...e},lr=Yh(ze.root,n);let s=Us(t,"all",()=>Us(t,"two",()=>Us(t,"one",()=>Us(t,"none"))));if(s){const i=za(Ua(s,t));return i.length>0&&(s=i[0]),Hs(s)}else throw new Error("Selector was not found.")}function Yh(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function Us(t,e,n){let s=null,i=[],r=t,a=0;for(;r;){const l=new Date().getTime()-Ma.getTime();if(ze.timeoutMs!==void 0&&l>ze.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${l}ms`);let o=Vs(Jh(r))||Vs(...Qh(r))||Vs(...$h(r))||Vs(Zh(r))||[Wa()];const u=ef(r);if(e=="all")u&&(o=o.concat(o.filter(cr).map(c=>qs(c,u))));else if(e=="two")o=o.slice(0,1),u&&(o=o.concat(o.filter(cr).map(c=>qs(c,u))));else if(e=="one"){const[c]=o=o.slice(0,1);u&&cr(c)&&(o=[qs(c,u)])}else e=="none"&&(o=[Wa()],u&&(o=[qs(o[0],u)]));for(let c of o)c.level=a;if(i.push(o),i.length>=ze.seedMinLength&&(s=La(i,n),s))break;r=r.parentElement,a++}return s||(s=La(i,n)),!s&&n?n():s}function La(t,e){const n=za(ja(t));if(n.length>ze.threshold)return e?e():null;for(let s of n)if(Fa(s))return s;return null}function Hs(t){let e=t[0],n=e.name;for(let s=1;s<t.length;s++){const i=t[s].level||0;e.level===i-1?n=`${t[s].name} > ${n}`:n=`${t[s].name} ${n}`,e=t[s]}return n}function Ba(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function Fa(t){const e=Hs(t);switch(lr.querySelectorAll(e).length){case 0:throw new Error(`Can't select any node with this selector: ${e}`);case 1:return!0;default:return!1}}function Jh(t){const e=t.getAttribute("id");return e&&ze.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function Qh(t){return Array.from(t.attributes).filter(n=>ze.attr(n.name,n.value)).map(n=>({name:`[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,penalty:.5}))}function $h(t){return Array.from(t.classList).filter(ze.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function Zh(t){const e=t.tagName.toLowerCase();return ze.tagName(e)?{name:e,penalty:2}:null}function Wa(){return{name:"*",penalty:3}}function ef(t){const e=t.parentNode;if(!e)return null;let n=e.firstChild;if(!n)return null;let s=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&s++,n!==t);)n=n.nextSibling;return s}function qs(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function cr(t){return t.name!=="html"&&!t.name.startsWith("#")}function Vs(...t){const e=t.filter(tf);return e.length>0?e:null}function tf(t){return t!=null}function*ja(t,e=[]){if(t.length>0)for(let n of t[0])yield*ja(t.slice(1,t.length),e.concat(n));else yield e}function za(t){return[...t].sort((e,n)=>Ba(e)-Ba(n))}function*Ua(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>ze.optimizedMinLength)for(let s=1;s<t.length-1;s++){if(n.counter>ze.maxNumberOfTries)return;n.counter+=1;const i=[...t];i.splice(s,1);const r=Hs(i);if(n.visited.has(r))return;Fa(i)&&nf(i,e)&&(yield i,n.visited.set(r,!0),yield*Ua(i,e,n))}}function nf(t,e){return lr.querySelector(Hs(t))===e}function sf(t,e,n){return Xh(t,{root:e.body,seedMinLength:3,optimizedMinLength:(n==null?void 0:n.minSelectorDepth)||2,threshold:(n==null?void 0:n.nthThreshold)||1e3,maxNumberOfTries:(n==null?void 0:n.maxOptimiseTries)||1e4})}function ur(t){const e=t.tagName.toUpperCase();return e==="BUTTON"||e==="A"||e==="LI"||e==="SELECT"||e==="TR"||e==="TH"||t.onclick!=null||t.getAttribute("role")==="button"}function Ha(t,e){return t instanceof Element?rf(t,e):null}function rf(t,e){let n=t;for(;n!==null&&n!==e.documentElement;){if(Kt(n,"masked"))return null;n=n.parentElement}if($i(t)){let s=t.ownerSVGElement;for(;s!==null;)t=s,s=s.ownerSVGElement}for(n=t;n!==null&&n!==e.documentElement;){const s=n.tagName.toUpperCase();if(s==="LABEL")return null;if(s==="INPUT"||ur(n)||zi(n)!==null)return n;n=n.parentElement}return t===e.documentElement?null:t}function of(t,e){const{disableClickmaps:n=!1}=e||{};function s(m){const y=zi(m);if(y!==null)return y;if(ge(m,"input"))return Pa(m);if(ur(m)){let T="";return m instanceof HTMLElement&&(T=t.sanitizer.getInnerTextSecure(m)),T=T||m.id||m.className,Ko(T).slice(0,100)}return""}let i=-1,r=-1,a=!1,l=null,o=0,u={},c=0,h=0,f=0,d=0,p;const g=.008,v=225;function _(){const m=d/v;if(!c){c=m;return}const y=(m-c)/v;f>4&&y>g&&t.send(Fu(Ye())),d=0,f=0,c=m}t.attachStartCallback(()=>{p=setInterval(()=>_(),v)}),t.attachStopCallback(()=>{i=-1,r=-1,a=!1,l=null,u={},p&&clearInterval(p)});const C=()=>{a&&(t.send(Su(i,r)),a=!1)},E=(m,y=!1)=>{function T(S,k,M){return u[S]=u[S]||sf(k,m,M)}const x=y?t.attachEventListener.bind(t):t.nodes.attachNodeListener.bind(t.nodes);x(m.documentElement,"mouseover",S=>{const k=Ha(S.target,m);k!==l&&(l=k,o=performance.now())}),x(m,"mousemove",S=>{const[k,M]=t.observer.getDocumentOffset(m);i=S.clientX+k,r=S.clientY+M,a=!0;const F=Math.sign(S.movementX);d+=Math.abs(S.movementX)+Math.abs(S.movementY),F!==h&&(h=F,f++)},!1),x(m,"click",S=>{const k=Ha(S.target,m);if(!S.clientX&&!S.clientY||k===null)return;const M=t.nodes.getID(k);if(M!==void 0){const F=S.pageX,O=S.pageY,U=m.documentElement.scrollWidth,R=m.documentElement.scrollHeight,A=qa(F/U),I=qa(O/R);C(),t.send(Pu(M,l===k?Math.round(performance.now()-o):0,s(k),ur(k)&&!n?T(M,k,e):"",A,I),!0)}l=null})};t.nodes.attachNodeCallback(m=>{Fs(m)&&E(m)}),E(document,!0),t.ticker.attach(C,(e==null?void 0:e.trackingOffset)||7)}function qa(t){return Math.round(t*1e4)}function af(t){const e=[],n=document.getElementsByTagName("*"),s=/url\(("[^"]*"|'[^']*'|[^)]*)\)/i;for(let i=0;i<n.length;i++){const r=n[i];let a="";if(ge(r,"img")&&(a=r.currentSrc||r.src),!a){const p=getComputedStyle(r).getPropertyValue("background-image");if(p){const g=s.exec(p);g!==null&&(a=g[1],(a.startsWith('"')||a.startsWith("'"))&&(a=a.substr(1,a.length-2)))}}if(!a)continue;const l=a.substr(0,10)==="data:image"?0:t[a];if(l===void 0)continue;const o=r.getBoundingClientRect(),u=Math.max(o.top,0),c=Math.max(o.left,0),h=Math.min(o.bottom,window.innerHeight||document.documentElement&&document.documentElement.clientHeight||0),f=Math.min(o.right,window.innerWidth||document.documentElement&&document.documentElement.clientWidth||0);if(h<=u||f<=c)continue;const d=(h-u)*(f-c);e.push({time:l,area:d})}return e}function lf(t,e){let n=Math.max(document.documentElement&&document.documentElement.clientWidth||0,window.innerWidth||0)*Math.max(document.documentElement&&document.documentElement.clientHeight||0,window.innerHeight||0)/10,s=n*t;for(let i=0;i<e.length;i++){const{time:r,area:a}=e[i];n+=a,s+=a*(r>t?r:t)}return n===0?0:s/n}function cf(t,e){const n=Object.assign({captureResourceTimings:!0,capturePageLoadTimings:!0,capturePageRenderTimings:!0,excludedResourceUrls:[]},e);if("PerformanceObserver"in window||(n.captureResourceTimings=!1),!n.captureResourceTimings)return;let s={};function i(u){var h;if(u.duration<0||!Xo(u.name)||t.isServiceURL(u.name))return;s!==null&&(s[u.name]=u.startTime+u.duration);let c=!1;(h=n.excludedResourceUrls)==null||h.forEach(f=>{if(u.name.startsWith(f)){c=!0;return}}),!c&&t.send(ca(u.startTime+kn(),u.duration,u.responseStart&&u.startTime?u.responseStart-u.startTime:0,u.transferSize>u.encodedBodySize?u.transferSize-u.encodedBodySize:0,u.encodedBodySize||0,u.decodedBodySize||0,u.name,u.initiatorType,u.transferSize,u.responseStatus&&u.responseStatus===304||u.transferSize===0))}const r=new PerformanceObserver(u=>u.getEntries().forEach(i));let a;t.attachStartCallback(function({sessionID:u}){u!==a&&(performance.getEntriesByType("resource").forEach(i),a=u),r.observe({entryTypes:["resource"]})}),t.attachStopCallback(function(){r.disconnect()});let l=0,o=0;if(n.capturePageLoadTimings){let u=!1;t.ticker.attach(()=>{if(!u&&((l===0||o===0)&&performance.getEntriesByType("paint").forEach(c=>{const{name:h,startTime:f}=c;switch(h){case"first-paint":l=f;break;case"first-contentful-paint":o=f;break}}),performance.timing.loadEventEnd||performance.now()>3e4)){u=!0;const{navigationStart:c,requestStart:h,responseStart:f,responseEnd:d,domContentLoadedEventStart:p,domContentLoadedEventEnd:g,loadEventStart:v,loadEventEnd:_}=performance.timing;t.send(ku(h-c||0,f-c||0,d-c||0,p-c||0,g-c||0,v-c||0,_-c||0,l,o))}},30)}if(n.capturePageRenderTimings){let u=0,c=0,h=0,f=null,d=!1;t.ticker.attach(()=>{if(d)return;const p=performance.now();if(s!==null&&(u=Math.max.apply(null,Object.keys(s).map(g=>s[g])),p-u>1e3&&(f=af(s),s=null)),h!==null&&(p-h>50&&(c=p),h=p-c>5e3?null:p),f!==null&&h===null||p>3e4){d=!0,s=null;const g=f===null?0:lf(o||l,f),{domContentLoadedEventEnd:v,navigationStart:_}=performance.timing,C=h===null?Math.max(c,o,v-_||0):0;t.send(Tu(g,o>u?o:u,C))}})}}function hr(t){const e=t.defaultView;return[e&&e.scrollX||t.documentElement&&t.documentElement.scrollLeft||t.body&&t.body.scrollLeft||0,e&&e.scrollY||t.documentElement&&t.documentElement.scrollTop||t.body&&t.body.scrollTop||0]}function uf(t,e){let n=!1;const s=new Map;function i(l){ya(l)&&(wt(l)&&s.set(l,[l.scrollLeft,l.scrollTop]),Fs(l)&&s.set(l,hr(l)))}const r=t.safe(()=>{e||t.send(hu(...hr(document)))}),a=t.safe((l,o)=>{const u=t.nodes.getID(o);u!==void 0&&t.send(bu(u,l[0],l[1]))});t.attachStartCallback(r),t.attachStopCallback(()=>{n=!1,s.clear()}),t.nodes.attachNodeCallback((l,o)=>{o&&(wt(l)&&l.scrollLeft+l.scrollTop>0?s.set(l,[l.scrollLeft,l.scrollTop]):Fs(l)&&s.set(l,hr(l))),Ws(l)&&t.nodes.attachNodeListener(l,"scroll",u=>{i(u.target)})}),t.attachEventListener(document,"scroll",l=>{const o=l.target;if(o===document){n=!0;return}i(o)}),t.ticker.attach(()=>{n&&(r(),n=!1),s.forEach(a),s.clear()},5,!1)}function hf(t){let e,n,s,i,r=document.referrer;const a=t.safe(()=>{const{URL:u}=document;u!==e&&(e=u,t.send(Uu(e,r,i,document.title)),i=0,r=e)}),l=t.safe(()=>{const{innerWidth:u,innerHeight:c}=window;(u!==n||c!==s)&&(n=u,s=c,t.send(uu(n,s)))}),o=document.hidden===void 0?Function.prototype:t.safe(()=>t.send(Ru(document.hidden)));t.attachStartCallback(()=>{e=null,i=kn(),n=s=-1,a(),l(),o()}),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",o,!1,!1),t.ticker.attach(a,1,!1),t.ticker.attach(l,5,!1)}function Va(t){return Ws(t)&&!!t.adoptedStyleSheets}let ff=15;function Ga(){return ff++}const Gs=new Map;function df(t){if(t===null||!Va(document))return;const e=new Map,n=new Map,s=a=>setTimeout(()=>{let l=t.nodes.getID(a);if(a===document&&(l=0),l===void 0)return;let o=n.get(l);o||(o=[]);const u=[],c=a.adoptedStyleSheets;if(c&&Symbol.iterator in c)for(const h of c){let f=e.get(h);const d=!f;if(f||(f=Ga(),e.set(h,f)),o.includes(f)||t.send(aa(f,l)),d){const p=h.cssRules;for(let g=0;g<p.length;g++)t.send(Vi(f,p[g].cssText,g,t.getBaseHref()))}u.push(f)}if(Symbol.iterator in o)for(const h of o)u.includes(h)||t.send(Mu(h,l));n.set(l,u)},20);function i(a){const l=Object.getOwnPropertyDescriptor(a,"adoptedStyleSheets");l&&Object.defineProperty(a,"adoptedStyleSheets",{...l,set:function(o){const u=l.set.call(this,o);return s(this),u}})}const r=a=>{if(a.__openreplay_adpss_patched__)return;a.__openreplay_adpss_patched__=!0,i(a.Document.prototype),i(a.ShadowRoot.prototype);const{replace:l,replaceSync:o}=a.CSSStyleSheet.prototype;a.CSSStyleSheet.prototype.replace=function(u){return l.call(this,u).then(c=>{const h=e.get(this);return h&&t.send(ra(h,u,t.getBaseHref())),c})},a.CSSStyleSheet.prototype.replaceSync=function(u){const c=e.get(this);return c&&t.send(ra(c,u,t.getBaseHref())),o.call(this,u)}};r(window),t.observer.attachContextCallback(t.safe(r)),t.attachStopCallback(()=>{e.clear(),n.clear()}),t.attachStartCallback(()=>{s(document)}),t.nodes.attachNodeCallback(a=>{Va(a)&&s(a)})}function pf(t){if(t===null)return;if(!window.CSSStyleSheet){t.send(Ou("no_stylesheet_prototype_in_window",""));return}const e=t.safe((i,r,a)=>{const l=Gs.get(i);l&&(typeof a=="string"?t.send(Vi(l,a,r,t.getBaseHref())):t.send(oa(l,r)))}),n=t.safe(i=>{let r=i;for(;r.parentRule;)r=r.parentRule;const a=r.parentStyleSheet;if(!a){t.debug.warn("No parent StyleSheet found for",r,i);return}const l=Gs.get(a);if(!l){t.debug.warn("No sheedID found for",a,Gs);return}const o=r.cssText,u=a.cssRules,c=Array.from(u).indexOf(r);c>=0?(t.send(Vi(l,o,c,t.getBaseHref())),t.send(oa(l,c+1))):t.debug.warn("Rule index not found in",a,r)}),s=t.safe(i=>{const{insertRule:r,deleteRule:a}=i.CSSStyleSheet.prototype,{insertRule:l,deleteRule:o}=i.CSSGroupingRule.prototype;i.CSSStyleSheet.prototype.insertRule=function(u,c=0){return e(this,c,u),r.call(this,u,c)},i.CSSStyleSheet.prototype.deleteRule=function(u){return e(this,u),a.call(this,u)},i.CSSGroupingRule.prototype.insertRule=function(u,c=0){const h=l.call(this,u,c);return n(this),h},i.CSSGroupingRule.prototype.deleteRule=function(u=0){const c=o.call(this,u);return n(this),c}});s(window),t.observer.attachContextCallback(s),t.nodes.attachNodeCallback(i=>{if(!ge(i,"style")||!i.sheet||i.textContent!==null&&i.textContent.trim().length>0)return;const r=t.nodes.getID(i);if(!r)return;const a=i.sheet,l=Ga();Gs.set(a,l),t.send(aa(l,r));const o=a.cssRules;for(let u=0;u<o.length;u++)e(a,u,o[u].cssText)})}function gf(t){function e(s){const i=t.nodes.getID(s);i!==void 0&&t.send(ia(i))}let n=!1;t.nodes.attachNodeCallback(s=>{ge(s,"body")&&(t.nodes.attachNodeListener(s,"focus",i=>{ya(i.target)&&(e(i.target),n=!1)}),t.nodes.attachNodeListener(s,"blur",i=>{i.relatedTarget===null&&(n=!0,setTimeout(()=>{n&&t.send(ia(-1))},0))}))}),t.attachStartCallback(()=>{let s=document.activeElement;for(;s&&ge(s,"iframe")&&s.contentDocument;)s=s.contentDocument.activeElement;s&&s!==s.ownerDocument.body&&e(s)},!0)}function mf(t){if(!window.FontFace)return;const e=new Map,n=s=>{class i extends s.FontFace{constructor(...a){if(typeof a[1]=="string"){let l="";a[2]&&t.safe(()=>{l=JSON.stringify(a[2])});const o=[a[0],a[1],l],u=e.get(s.document)||[];u.push(o),e.set(s.document,u);const c=s===window?0:t.nodes.getID(s.document);if(c===void 0)return;t.active()&&t.send(sa(c,...o))}super(...a)}}s.FontFace=i};t.observer.attachContextCallback(n),n(window),t.nodes.attachNodeCallback(t.safe(s=>{if(!Fs(s))return;const i=e.get(s);if(!i)return;const r=s.defaultView===window?0:t.nodes.getID(s);r!==void 0&&i.forEach(a=>{t.send(sa(r,...a))})}))}function vf(t,e,n,s,i){t.debug.log("Openreplay: attaching axios spy to instance",e);function r(f){t.debug.log("Openreplay: capturing axios response data",f);const{headers:d,data:p,method:g,url:v,baseURL:_}=f.config,{data:C,headers:E,status:m,response:y}=f,{data:T,headers:x,status:S}=y||{},k=n.ignoreHeaders,M=Array.isArray(k)?P=>k.includes(P):()=>k;function F(P,H){M(H[0])||(P[H[0]]=H[1])}let O={},U={};d.toJSON?O=d.toJSON():d instanceof Headers?d.forEach((P,H)=>F(O,[H,P])):Array.isArray(d)?d.forEach(P=>F(O,P)):typeof d=="object"&&Object.entries(d).forEach(P=>F(O,P));const R=x||E;R.toJSON?U=R.toJSON():R instanceof Headers?R.forEach((P,H)=>F(U,[H,P])):Array.isArray(R)?R.forEach(P=>F(U,P)):typeof R=="object"&&Object.entries(R).forEach(([P,H])=>{M(P)||(U[P]=H)});const A=s({url:v,method:g||"",status:m||S||0,request:{headers:O,body:p},response:{headers:U,body:T||C}});if(!A){t.debug.log("Openreplay: empty request/response info, skipping");return}const I=f.config.__openreplay_timing,D=performance.now()-I;t.debug.log("Openreplay: final req object",A),t.send(Ps("xhr",String(g),String(A.url),i(A.request),i(A.response),A.status,I+kn(),D,0))}function a(f){if(t.debug.log("Openreplay: capturing API request",f),f.__openreplay_timing=performance.now(),n.sessionTokenHeader){const d=typeof n.sessionTokenHeader=="string"?n.sessionTokenHeader:"X-OpenReplay-Session-Token",p=t.getSessionToken();p&&f.headers.set(d,p)}return f}function l(f){return n.failuresOnly||r(f),f}function o(f){return t.debug.log("Openreplay: capturing API request error",f),bf(f)&&f.response?r(f.response):f instanceof Error&&t.send(zs(f,[])),Promise.reject(f)}function u(f){t.debug.log("Openreplay: failed API request, skipping",f)}const c=e.interceptors.request.use(a,u,{synchronous:!0}),h=e.interceptors.response.use(l,o,{synchronous:!0});t.attachStopCallback(()=>{var f,d,p,g;(d=(f=e.interceptors.request).eject)==null||d.call(f,c),(g=(p=e.interceptors.response).eject)==null||g.call(p,h)})}function bf(t){return wf(t)&&t.isAxiosError===!0}function wf(t){return t!==null&&typeof t=="object"}var it;(function(t){t[t.UNSENT=0]="UNSENT",t[t.OPENED=1]="OPENED",t[t.HEADERS_RECEIVED=2]="HEADERS_RECEIVED",t[t.LOADING=3]="LOADING",t[t.DONE=4]="DONE"})(it||(it={}));class fr{constructor(e=[],n,s){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.id="",this.name="",this.method="",this.url="",this.status=0,this.statusText="",this.cancelState=0,this.readyState=0,this.header={},this.responseType="",this.requestHeader={},this.responseSize=0,this.responseSizeText="",this.startTime=0,this.endTime=0,this.duration=0,this.getData={},this.requestData=null}getMessage(){const{reqHs:e,resHs:n}=this.writeHeaders(),s={headers:e,body:this.method==="GET"?JSON.stringify(this.getData):this.requestData},i={headers:n,body:this.response},r=this.sanitize({url:this.url,method:this.method,status:this.status,request:s,response:i});if(r)return Ps(this.requestType,r.method,r.url,JSON.stringify(r.request),JSON.stringify(r.response),r.status,this.startTime+kn(),this.duration,this.responseSize)}writeHeaders(){const e={};Object.entries(this.requestHeader).forEach(([s,i])=>{this.isHeaderIgnored(s)||(e[s]=i)}),this.setSessionTokenHeader((s,i)=>{e[s]=i});const n={};return Object.entries(this.header).forEach(([s,i])=>{this.isHeaderIgnored(s)||(n[s]=i)}),{reqHs:e,resHs:n}}isHeaderIgnored(e){return Array.isArray(this.ignoredHeaders)?this.ignoredHeaders.map(n=>n.toLowerCase()).includes(e.toLowerCase()):this.ignoredHeaders}}const es=(t,e)=>{let n="";switch(t){case"":case"text":case"json":typeof e=="string"?n=e:pr(e)||Array.isArray(e)?n=JSON.stringify(e):typeof e<"u"&&(n=Object.prototype.toString.call(e));break;case"blob":case"document":case"arraybuffer":default:typeof e<"u"&&(n=Object.prototype.toString.call(e));break}return n},dr=t=>{if(!t)return null;let e;if(typeof t=="string"){(t[0]==="{"||t[0]==="[")&&(e=t);const n=t.split("&");n.length===1?e=t:e=n.join(",")}else if(Sf(t)){const n=[];for(const[s,i]of t)n.push(`${s}=${typeof i=="string"?i:"[object Object]"}`);e=n.join(",")}else t instanceof Blob||t instanceof ReadableStream||t instanceof ArrayBuffer?e="byte data":pr(t)?e=t:e=`can't parse body ${typeof t}`;return e},yf=(t,e={})=>{pr(e)||(e={});let n=t?t.split("?"):[];if(n.shift(),n.length>0){n=n.join("?").split("&");for(const s of n){const i=s.split("=");try{e[i[0]]=decodeURIComponent(i[1])}catch{e[i[0]]=i[1]}}}return e};function pr(t){return t!==null&&typeof t=="object"}function Sf(t){return t==null||ArrayBuffer.isView(t)?!1:typeof Symbol<"u"&&typeof t[Symbol.iterator]=="function"}function Ks(t){return t<=0?"":t>=1e3*1e3?(t/1e3/1e3).toFixed(1)+" MB":t>=1e3?(t/1e3).toFixed(1)+" KB":`${t}B`}const gr=t=>(t.startsWith("//")&&(t=`${new URL(window.location.href).protocol}${t}`),t.startsWith("http")?new URL(t):new URL(t,window.location.href));class _f{constructor(e,n){this.resp=e,this.item=n,this.mockReader()}set(e,n,s){return Reflect.set(e,n,s)}get(e,n){const s=Reflect.get(e,n);switch(n){case"arrayBuffer":case"blob":case"formData":case"json":case"text":return()=>(this.item.responseType=n.toLowerCase(),s.apply(e).then(i=>(this.item.response=es(this.item.responseType,i),i)))}return typeof s=="function"?s.bind(e):s}mockReader(){let e;if(!this.resp.body||typeof this.resp.body.getReader!="function")return;const n=this.resp.body.getReader;this.resp.body.getReader=()=>{const s=n.apply(this.resp.body);if(this.item.readyState===it.DONE)return s;const i=s.read,r=s.cancel;return this.item.responseType="arraybuffer",s.read=()=>i.apply(s).then(a=>{if(!e)e=new Uint8Array(a.value);else{const l=new Uint8Array(e.length+a.value.length);l.set(e),l.set(a.value,e.length),e=l}return this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.readyState=a.done?4:3,this.item.statusText=a.done?String(this.item.status):"Loading",this.item.responseSize=e.length,this.item.responseSizeText=Ks(this.item.responseSize),a.done&&(this.item.response=es(this.item.responseType,e)),a}),s.cancel=(...a)=>(this.item.cancelState=2,this.item.statusText="Cancel",this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=es(this.item.responseType,e),r.apply(s,a)),s}}}class kf{constructor(e,n,s,i,r,a){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.sendMessage=i,this.isServiceUrl=r,this.tokenUrlMatcher=a}apply(e,n,s){const i=s[0],r=s[1];if(!i||typeof i!="string"&&!(i!=null&&i.url)||(i instanceof URL||typeof i=="string"?this.isServiceUrl(String(i)):this.isServiceUrl(String(i.url))))return e.apply(window,s);const l=new fr(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);return this.beforeFetch(l,i,r),this.setSessionTokenHeader((o,u)=>{if(!(this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(l.url))){if(s[1]===void 0&&s[0]instanceof Request)return s[0].headers.append(o,u);s[1]||(s[1]={}),s[1].headers===void 0&&(s[1]={...s[1],headers:{}}),s[1].headers instanceof Headers?s[1].headers.append(o,u):Array.isArray(s[1].headers)?s[1].headers.push([o,u]):s[1].headers[o]=u}}),e.apply(window,s).then(this.afterFetch(l)).catch(o=>{throw l.endTime=performance.now(),l.duration=l.endTime-(l.startTime||l.endTime),o})}beforeFetch(e,n,s){let i,r="GET",a={};if(typeof n=="string"?(r=(s==null?void 0:s.method)||"GET",i=gr(n),a=(s==null?void 0:s.headers)||{}):(r=n.method||"GET",i=gr(n.url),a=n.headers),e.method=r,e.requestType="fetch",e.requestHeader=a,e.url=i.toString(),e.name=(i.pathname.split("/").pop()||"")+i.search,e.status=0,e.statusText="Pending",e.readyState=1,e.startTime||(e.startTime=performance.now()),Object.prototype.toString.call(a)==="[object Headers]"){e.requestHeader={};for(const[l,o]of a)e.requestHeader[l]=o}else e.requestHeader=a;if(i.search&&i.searchParams){e.getData={};for(const[l,o]of i.searchParams)e.getData[l]=o}s!=null&&s.body&&(e.requestData=dr(s.body))}afterFetch(e){return n=>{e.endTime=performance.now(),e.duration=e.endTime-(e.startTime||e.endTime),e.status=n.status,e.statusText=String(n.status);let s=!1;e.header={};for(const[i,r]of n.headers)e.header[i]=r,s=r.toLowerCase().indexOf("chunked")>-1?!0:s;return s?e.readyState=3:(e.readyState=4,this.handleResponseBody(n.clone(),e).then(i=>{e.responseSize=typeof i=="string"?i.length:i.byteLength,e.responseSizeText=Ks(e.responseSize),e.response=es(e.responseType,i);const r=e.getMessage();r&&this.sendMessage(r)}).catch(i=>{if(i.name!=="AbortError")throw i})),new Proxy(n,new _f(n,e))}}handleResponseBody(e,n){const s=e.headers.get("content-type");return s&&s.includes("application/json")?(n.responseType="json",e.text()):s&&(s.includes("text/html")||s.includes("text/plain"))?(n.responseType="text",e.text()):(n.responseType="arraybuffer",e.arrayBuffer())}}class Tf{static create(e,n,s,i,r,a){return new Proxy(fetch,new kf(e,n,s,i,r,a))}}class xf{constructor(e,n,s,i,r,a,l){this.ignoredHeaders=n,this.setSessionTokenHeader=s,this.sanitize=i,this.sendMessage=r,this.isServiceUrl=a,this.tokenUrlMatcher=l,this.XMLReq=e,this.XMLReq.onreadystatechange=()=>{this.onReadyStateChange()},this.XMLReq.onabort=()=>{this.onAbort()},this.XMLReq.ontimeout=()=>{this.onTimeout()},this.item=new fr(n,s,i),this.item.requestType="xhr"}get(e,n){switch(n){case"open":return this.getOpen(e);case"send":return this.setSessionTokenHeader((i,r)=>{this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(this.item.url)||e.setRequestHeader(i,r)}),this.getSend(e);case"setRequestHeader":return this.getSetRequestHeader(e);default:const s=Reflect.get(e,n);return typeof s=="function"?s.bind(e):s}}set(e,n,s){switch(n){case"onreadystatechange":return this.setOnReadyStateChange(e,n,s);case"onabort":return this.setOnAbort(e,n,s);case"ontimeout":return this.setOnTimeout(e,n,s)}return Reflect.set(e,n,s)}onReadyStateChange(){if(!(this.item.url&&this.isServiceUrl(this.item.url))&&(this.item.readyState=this.XMLReq.readyState,this.item.responseType=this.XMLReq.responseType,this.item.endTime=performance.now(),this.item.duration=this.item.endTime-this.item.startTime,this.updateItemByReadyState(),setTimeout(()=>{this.item.response=es(this.item.responseType,this.item.response)},0),this.XMLReq.readyState===it.DONE)){const e=this.item.getMessage();e&&this.sendMessage(e)}}onAbort(){this.item.cancelState=1,this.item.statusText="Abort";const e=this.item.getMessage();e&&this.sendMessage(e)}onTimeout(){this.item.cancelState=3,this.item.statusText="Timeout";const e=this.item.getMessage();e&&this.sendMessage(e)}getOpen(e){const n=Reflect.get(e,"open");return(...s)=>{var a,l;const i=s[0],r=s[1];return this.item.method=i?i.toUpperCase():"GET",this.item.url=((a=r.toString)==null?void 0:a.call(r))||"",this.item.name=((l=this.item.url)==null?void 0:l.replace(new RegExp("/*$"),"").split("/").pop())??"",this.item.getData=yf(this.item.url,{}),n.apply(e,s)}}getSend(e){const n=Reflect.get(e,"send");return(...s)=>{const i=s[0];return this.item.requestData=dr(i),n.apply(e,s)}}getSetRequestHeader(e){const n=Reflect.get(e,"setRequestHeader");return(...s)=>(this.item.requestHeader||(this.item.requestHeader={}),this.item.requestHeader[s[0]]=s[1],n.apply(e,s))}setOnReadyStateChange(e,n,s){return Reflect.set(e,n,(...i)=>{this.onReadyStateChange(),s==null||s.apply(e,i)})}setOnAbort(e,n,s){return Reflect.set(e,n,(...i)=>{this.onAbort(),s.apply(e,i)})}setOnTimeout(e,n,s){return Reflect.set(e,n,(...i)=>{this.onTimeout(),s.apply(e,i)})}updateItemByReadyState(){switch(this.XMLReq.readyState){case it.UNSENT:case it.OPENED:this.item.status=it.UNSENT,this.item.statusText="Pending",this.item.startTime||(this.item.startTime=performance.now());break;case it.HEADERS_RECEIVED:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.item.header={};const e=this.XMLReq.getAllResponseHeaders()||"",n=e.split(`
|
|
20
|
-
`);for(let s=0;s<n.length;s++){const i=n[s];if(!i)continue;const r=i.split(": "),a=r[0];this.item.header[a]=r.slice(1).join(": ")}break;case
|
|
21
|
-
If you're using serverside rendering in your app, make sure that tracker is loaded dynamically, otherwise ${t} won't be tracked.`);function Nf(t,e,n,s,i,r,a){var l;t.XMLHttpRequest?t.XMLHttpRequest=Ef.create(e,n,s,i,r,a):Ka("XMLHttpRequest"),t.fetch?t.fetch=Tf.create(e,n,s,i,r,a):Ka("fetch"),(l=t==null?void 0:t.navigator)!=null&&l.sendBeacon&&(t.navigator.sendBeacon=In.create(e,n,s,i,r))}function mr(t){return t.__or_req_data__||(t.__or_req_data__={body:void 0,headers:{}}),t.__or_req_data__}function Xa(t){return typeof t=="string"?t.toUpperCase():"GET"}function Rf(t,e={}){const n=Object.assign({failuresOnly:!1,ignoreHeaders:["cookie","set-cookie","authorization"],capturePayload:!1,sessionTokenHeader:!1,captureInIframes:!0,axiosInstances:void 0,useProxy:!0},e);n.useProxy===!1&&t.debug.warn("Network module is migrating to proxy api, to gradually migrate and test it set useProxy to true");const s=n.ignoreHeaders,i=Array.isArray(s)?c=>s.includes(c):()=>s,r=n.sessionTokenHeader===!0?"X-OpenReplay-SessionToken":n.sessionTokenHeader;function a(c){if(r){const h=t.getSessionToken();h&&t.safe(c)(r,h)}}function l(c){if(n.capturePayload||(delete c.request.body,delete c.response.body),n.sanitizer){const h=c.response.body;if(typeof h=="string")try{c.response.body=JSON.parse(h)}catch{}return n.sanitizer(c)}return c}function o(c){if(c&&typeof c.body!="string")try{c.body=JSON.stringify(c.body)}catch{c.body="<unable to stringify>",t.notify.warn("Openreplay fetch couldn't stringify body:",c.body)}return JSON.stringify(c)}const u=c=>{if(n.useProxy)return Nf(c,n.ignoreHeaders,a,l,E=>t.send(E),E=>t.isServiceURL(E),n.tokenUrlMatcher);const h=c.fetch.bind(c),f=(E,m={})=>{if(!(typeof E=="string"||E instanceof URL)||t.isServiceURL(String(E)))return h(E,m);a(function(T,x){m.headers===void 0&&(m.headers={}),m.headers instanceof Headers?m.headers.append(T,x):Array.isArray(m.headers)?m.headers.push([T,x]):m.headers[T]=x});const y=performance.now();return h(E,m).then(T=>{const x=performance.now()-y;if(n.failuresOnly&&T.status<400)return T;const S=T.clone();return S.text().then(k=>{const M={},F={};if(s!==!0){const R=([A,I])=>{i(A)||(M[A]=I)};m.headers instanceof Headers?m.headers.forEach((A,I)=>R([I,A])):Array.isArray(m.headers)?m.headers.forEach(R):typeof m.headers=="object"&&Object.entries(m.headers).forEach(R),S.headers.forEach((A,I)=>{i(I)||(F[I]=A)})}const O=Xa(m.method),U=l({url:String(E),method:O,status:S.status,request:{headers:M,body:m.body||null},response:{headers:F,body:k}});U&&t.send(Ps("fetch",O,String(U.url),o(U.request),o(U.response),S.status,y+kn(),x,0))}).catch(k=>t.debug.error("Could not process Fetch response:",k)),T})};c.fetch=f;const d=c.XMLHttpRequest.prototype.open,p=c.XMLHttpRequest.prototype.setRequestHeader,g=c.XMLHttpRequest.prototype.send;function v(E,m){const y=this;a((x,S)=>y.setRequestHeader(x,S));let T=0;return y.addEventListener("loadstart",x=>{T=x.timeStamp}),y.addEventListener("load",t.safe(x=>{const{headers:S,body:k}=mr(y),M=T>0?x.timeStamp-T:0,O=(y.getAllResponseHeaders()||"").trim().split(/[\r\n]+/),U={};O.forEach(function(I){const D=I.split(": "),P=D.shift();i(P)||(U[P]=D.join(": "))});const R=Xa(E),A=l({url:String(m),method:R,status:y.status,request:{headers:S,body:k||null},response:{headers:U,body:y.response}});A&&t.send(Ps("xhr",R,String(A.url),o(A.request),o(A.response),y.status,T+kn(),M,0))})),d.apply(this,arguments)}function _(E){const m=mr(this);return m.body=E,g.apply(this,arguments)}function C(E,m){if(!i(E)){const y=mr(this);y.headers[E]=m}return p.apply(this,arguments)}n.axiosInstances||(c.XMLHttpRequest.prototype.open=v,c.XMLHttpRequest.prototype.send=_,c.XMLHttpRequest.prototype.setRequestHeader=C)};u(window),n.axiosInstances&&n.axiosInstances.forEach(c=>{vf(t,c,n,l,o)}),n.captureInIframes&&t.observer.attachContextCallback(t.safe(u))}function Df(t){t.attachEventListener(document,"selectionchange",()=>{const e=document.getSelection();if(e!==null&&!e.isCollapsed){const n=t.nodes.getID(e.anchorNode),s=t.nodes.getID(e.focusNode),i=e.toString().replace(/\s+/g," ");n&&s&&t.send(la(n,s,i))}else t.send(la(-1,-1,""))})}function Of(t){function e(){document.hidden||(t.debug.log("Openreplay: tab change to"+t.session.getTabId()),t.send(Ms(t.session.getTabId())))}t.attachEventListener(window,"focus",e,!1,!1)}const Xs="/installation/javascript-sdk";function Af(t){if(t==null)return console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${As}${Xs}`),!1;if(typeof t.projectKey!="string")if(typeof t.projectKey!="number"){if(typeof t.projectID!="number")return console.error(`OpenReplay: projectKey is missing or wrong type (string is expected). Please, check ${As}${Xs} for more information.`),!1;t.projectKey=t.projectID.toString(),Dt("`projectID` option","`projectKey` option",Xs)}else console.warn("OpenReplay: projectKey is expected to have a string type."),t.projectKey=t.projectKey.toString();return t.sessionToken!=null&&Dt("`sessionToken` option","`sessionHash` start() option","/"),!0}class Pf{constructor(e){var l;if(this.options=e,this.app=null,this.crossdomainMode=!1,this.checkDoNotTrack=()=>this.options.respectDoNotTrack&&(navigator.doNotTrack=="1"||window.doNotTrack=="1"),this.signalStartIssue=(o,u)=>{const c=this.checkDoNotTrack(),h=new XMLHttpRequest,f=this.options.ingestPoint||Ta;h.open("POST",f+"/v1/web/not-started"),h.send(JSON.stringify({trackerVersion:"14.0.4",projectKey:this.options.projectKey,doNotTrack:c,reason:u.length?`missing api: ${u.join(",")}`:o}))},this.restartCanvasTracking=()=>{this.app!==null&&this.app.restartCanvasTracking()},this.handleError=(o,u={})=>{if(this.app!==null){if(o instanceof Error){const c=zs(o,[],u);this.app.send(c)}else if(o instanceof ErrorEvent||"PromiseRejectionEvent"in window&&o instanceof PromiseRejectionEvent){const c=Oa(o,void 0,u);c!=null&&this.app.send(c)}}},this.crossdomainMode=!!(ou()&&((l=e.crossdomain)!=null&&l.enabled)),!nt||!Af(e))return;if(window.__OPENREPLAY__){console.error("OpenReplay: one tracker instance has been initialised already");return}if(!e.__DISABLE_SECURE_MODE&&location.protocol!=="https:"){console.error("OpenReplay: Your website must be publicly accessible and running on SSL in order for OpenReplay to properly capture and replay the user session. You can disable this check by setting `__DISABLE_SECURE_MODE` option to `true` if you are testing in localhost. Keep in mind, that asset files on a local machine are not available to the outside world. This might affect tracking if you use css files.");return}const n=this.checkDoNotTrack(),s=[],i=["Map","Set","MutationObserver","performance","timing","startsWith","Blob","Worker"];if(n)s.push("doNotTrack");else for(const o of i)if(o==="timing"){if("performance"in window&&!(o in performance)){s.push(o);break}}else if(o==="startsWith"){if(!(o in String.prototype)){s.push(o);break}}else if(!(o in window)){s.push(o);break}if(s.length>0){const o=s.join(",");console.error(`OpenReplay: browser doesn't support API required for tracking or doNotTrack is set to 1. Reason: ${o}`),this.signalStartIssue("missing_api",s);return}const r=new Nh(e.projectKey,e.sessionToken,e,this.signalStartIssue,this.crossdomainMode);this.app=r,this.crossdomainMode||(hf(r),Rh(r),Hu(r,e),Of(r)),of(r,e.mouse),uf(r,this.crossdomainMode),pf(r),df(r),Ph(r,e),Wh(r,e),Uh(r),Kh(r,e),cf(r,e),gf(r),mf(r),Rf(r,e.network),Df(r),window.__OPENREPLAY__=this,e.flags&&e.flags.onFlagsLoad&&this.onFlagsLoad(e.flags.onFlagsLoad);const a=window.open;(e.autoResetOnWindowOpen||e.resetTabOnWindowOpen)&&(r.attachStartCallback(()=>{const o=r.getTabId(),u=r.sessionStorage??window.sessionStorage;window.open=function(...c){return e.autoResetOnWindowOpen&&r.resetNextPageSession(!0),e.resetTabOnWindowOpen&&u.removeItem(e.session_tabid_key||"__openreplay_tabid"),r.resetNextPageSession(!1),u.setItem(e.session_tabid_key||"__openreplay_tabid",o),a.call(window,...c)}}),r.attachStopCallback(()=>{window.open=a}))}isFlagEnabled(e){return this.featureFlags.isFlagEnabled(e)}onFlagsLoad(e){var n;(n=this.app)==null||n.featureFlags.onFlagsLoad(e)}clearPersistFlags(){var e;(e=this.app)==null||e.featureFlags.clearPersistFlags()}reloadFlags(){var e;return(e=this.app)==null?void 0:e.featureFlags.reloadFlags()}getFeatureFlag(e){var n;return(n=this.app)==null?void 0:n.featureFlags.getFeatureFlag(e)}getAllFeatureFlags(){var e;return(e=this.app)==null?void 0:e.featureFlags.flags}use(e){return e(this.app,this.options)}isActive(){return this.app===null?!1:this.app.active()}trackWs(e){if(this.app!==null)return this.app.trackWs(e)}start(e){return this.browserEnvCheck()?this.app===null?Promise.reject("Browser doesn't support required api, or doNotTrack is active."):this.app.start(e):Promise.reject("Trying to start not in browser.")}browserEnvCheck(){return nt?!0:(console.error(`OpenReplay: you are trying to start Tracker on a node.js environment. If you want to use OpenReplay with SSR, please, use componentDidMount or useEffect API for placing the \`tracker.start()\` line. Check documentation on ${As}${Xs}`),!1)}coldStart(e,n){if(this.browserEnvCheck()){if(this.app===null)return Promise.reject("Tracker not initialized");this.app.coldStart(e,n)}else return Promise.reject("Trying to start not in browser.")}startOfflineRecording(e,n){return this.browserEnvCheck()?this.app===null?Promise.reject("Tracker not initialized"):this.app.offlineRecording(e,n):Promise.reject("Trying to start not in browser.")}uploadOfflineRecording(){if(this.app!==null)return this.app.uploadOfflineRecording()}stop(){if(this.app!==null)return this.app.stop(),this.app.session.getSessionHash()}forceFlushBatch(){this.app!==null&&this.app.forceFlushBatch()}getSessionToken(){return this.app===null?null:this.app.getSessionToken()}getSessionInfo(){return this.app===null?null:this.app.session.getInfo()}getSessionID(){return this.app===null?null:this.app.getSessionID()}getTabId(){return this.app===null?null:this.app.getTabId()}getUxId(){return this.app===null?null:this.app.getUxtId()}sessionID(){return Dt("'sessionID' method","'getSessionID' method","/"),this.getSessionID()}getSessionURL(e){if(this.app!==null)return this.app.getSessionURL(e)}setUserID(e){typeof e=="string"&&this.app!==null&&this.app.session.setUserID(e)}userID(e){Dt("'userID' method","'setUserID' method","/"),this.setUserID(e)}setUserAnonymousID(e){typeof e=="string"&&this.app!==null&&this.app.send(Iu(e))}userAnonymousID(e){Dt("'userAnonymousID' method","'setUserAnonymousID' method","/"),this.setUserAnonymousID(e)}setMetadata(e,n){typeof e=="string"&&typeof n=="string"&&this.app!==null&&this.app.session.setMetadata(e,n)}metadata(e,n){Dt("'metadata' method","'setMetadata' method","/"),this.setMetadata(e,n)}event(e,n=null,s=!1){if(typeof e=="string"&&this.app!==null){if(s)return this.issue(e,n);try{n=JSON.stringify(n)}catch{return}this.app.send(xu(e,n))}}issue(e,n=null){if(typeof e=="string"&&this.app!==null){try{n=JSON.stringify(n)}catch{return}this.app.send(Au(e,n))}}}function Mf(t){return{id:String(t.ID),appellation:t.Appellation||null,country:t.Country||null,grape:t.Grape,image:t.Image,price:Number(t.Price),producer:t.Producer||null,region:t.Region,score:t.Score?Number(t.Score):null,shortDescription:t["Short Description"]||null,store:t.Store,storeId:t.Store_id||null,tags:Array.isArray(t.Tags)?t.Tags.map(String):[],title:t.Title,type:t.Type,url:t.Url||null,vintage:t.Vintage?Number(t.Vintage):null,pairingRecommendation:t.pairing_recommendation||null,total:t.Total?Number(t.Total):null,itemId:t.item_id||null,isPromote:t.is_promote?!!t.is_promote:null,stock:t.stock?Number(t.stock):null}}function Lf(t){return{id:String(t.id),title:String(t.title),description:String(t.description),region:String(t.region),price:Number(t.price),grape:String(t.grape),appellation:t.appellation?String(t.appellation):null,url:t.url?String(t.url):null,store:String(t.store),storeId:t.storeId?String(t.storeId):null,image:String(t.image),country:t.country?String(t.country):null,vintage:t.vintage?Number(t.vintage):null,tags:Array.isArray(t.tags)?t.tags.map(String):[],score:t.score?Number(t.score):null,total:t.total?Number(t.total):null,isPromote:t.is_promote?!!t.is_promote:null,stock:t.stock?Number(t.stock):null,distance:Number(t.distance),reason:String(t.reason),type:String(t.type)}}class Bf{constructor(e){j(this,Pn,"https://wineater-backend.vercel.app/");j(this,nn,void 0);W(this,nn,e)}async getInstantRecommendations(){try{const e=await fetch(`${b(this,Pn)}dish/recommendations/instant`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b(this,nn)}`}}),n=await e.json();if(!e.ok)throw new Error(`API call failed with status ${e.status}: ${n.message||"No additional error information"}`);return n.map(Mf)}catch(e){throw new Error(`Error in getInstantRecommendations: ${e.message}`)}}async getWineRecommendationsSearch(e){try{const n=await fetch(`${b(this,Pn)}dish/recommendations/search`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b(this,nn)}`},body:JSON.stringify({text:e})}),s=await n.json();if(!n.ok)throw new Error(`API call failed with status ${n.status}: ${s.message||"No additional error information"}`);return s.map(Lf)}catch(n){throw new Error(`Error in getWineRecommendations: ${n.message}`)}}async getStoreConfig(){try{const e=await fetch(`${b(this,Pn)}stores/store`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b(this,nn)}`}});if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return await e.json()}catch(e){throw console.error("Error fetching store configuration:",e),e}}}Pn=new WeakMap,nn=new WeakMap;const Ff=(($a=window==null?void 0:window.wineaterData)==null?void 0:$a.CLIENT_TOKEN)||"HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG",vr=new Bf(Ff),rt={WIDGET_INITIALIZED:"widget_initialized",WIDGET_LOADED:"widget_loaded",SEARCH_PERFORMED:"search_performed",SEARCH_RESULTS_DISPLAYED:"search_results_displayed",NO_RESULTS_FOUND:"no_results_found",WINE_CARD_HOVER:"wine_card_hover",WINE_CARD_CLICK:"wine_card_click",WINE_DETAILS_VIEWED:"wine_details_viewed",WINE_DETAILS_CLOSED:"wine_details_closed",BUY_BUTTON_CLICKED:"buy_button_clicked",FILTER_APPLIED:"filter_applied",LANGUAGE_CHANGED:"language_changed",ERROR_OCCURRED:"error_occurred",MOBILE_VIEW_ACTIVATED:"mobile_view_activated"},Wf={fr:{lang:"fr",welcomeMessage:"Quel plat allez-vous déguster ? Décrivez-le-moi et je vous proposerai le vin qui l'accompagnera parfaitement.",noResultsFound:"Aucun résultat trouvé.",somethingWentWrong:"Désolé, quelque chose a mal tourné.",chatButton1:"Trouvez l'accord parfait",chatButton2:"Associez le vin",chatButton3:"Obtenez des conseils",chatTitle:"Accord Mets & Vins 🍷",chatSubtitle:"Décrivez votre plat et obtenez une recommandation en 30 secondes",inputPlaceholder:"ex., Salade de thon",sendButton:"Accorder",poweredBy:"Propulsé par",price:"Prix",region:"Région",type:"Type",reason:"Suggestion",moreInfo:"Plus d'infos",winePairingIntro:"Pour ce vin, voici quelques suggestions de plats :",askForDinner:"Que voulez-vous manger ce soir?",clearChatButton:"Effacer le chat",widgetTitle:"TROUVEZ VOTRE VIN PARFAIT",widgetSubtitle:"Partagez tout ce que vous avez en tête—votre repas, humeur, budget ou occasion—et notre sommelier IA vous recommandera le vin parfait en quelques secondes",searchPlaceholder:"Entrez un mot-clé ou une description","wineDetails.reason":"Raison","wineDetails.price":"Prix","wineDetails.region":"Région","wineDetails.type":"Type","wineDetails.moreInfo":"Plus d'infos","wineDetails.code":"Code","wineDetails.buy":"Acheter",searchButton:"Rechercher",priceRange:"Gamme de prix",wineColor:"Couleur du vin",intensity:"Intensité",red:"Rouge",white:"Blanc",rose:"Rosé",light:"Léger",medium:"Moyen",full:"Puissant",barTitle:"Sélection du bar",barSubtitle:"Choisissez vos plats ci-dessous et cliquez sur «Envoyer»",barSendButton:"Envoyer",barResetButton:"Réinitialiser",barName:"Nom du bar",barNotesPlaceholder:"Entrez vos souhaits ici...",placeholderSuggestions:["Vin pour les pâtes","Parfait avec du poisson","Recommandé pour une soirée"],headerLine1:"Partagez tout ce qui vous passe par la tête —",headerLine2:"— et obtenez des recommandations de vin parfait en quelques secondes",headerMeal:"repas",headerMood:"humeur",headerBudget:"budget",headerOccasion:"occasion",headerOr:"ou",errorMessage:"Une erreur est survenue. Veuillez réessayer plus tard.",noResultsMessage:"Aucun résultat trouvé pour votre recherche. Veuillez essayer une autre requête.",ai_sommelier:"AI sommelier"},es:{lang:"es",welcomeMessage:"¿Qué vas a comer? Cuéntame tu plato y te recomendaré el maridaje perfecto.",noResultsFound:"No se encontraron resultados.",somethingWentWrong:"Lo sentimos, algo salió mal.",chatButton1:"Encuentra tu maridaje",chatButton2:"Combina vino ya",chatButton3:"Recibe asesoría ahora",chatTitle:"Maridaje de Vinos 🍷",chatSubtitle:"Describe tu comida y obtén una recomendación en 30 segundos",inputPlaceholder:"ej., Ensalada de atún",sendButton:"Combinar",poweredBy:"Desarrollado por",price:"Precio",region:"Región",type:"Tipo",reason:"Sugerencia",moreInfo:"Más info",winePairingIntro:"Para este vino, aquí tienes algunas sugerencias de platos:",askForDinner:"¿Qué te gustaría cenar?",clearChatButton:"Limpiar el chat",widgetTitle:"ENCUENTRA TU VINO PERFECTO",widgetSubtitle:"Comparte cualquier cosa que tengas en mente—tu comida, estado de ánimo, presupuesto o evento—y nuestro sommelier de IA te recomendará el vino perfecto en segundos",searchPlaceholder:"Escribe una palabra clave o descripción","wineDetails.reason":"Razón","wineDetails.price":"Precio","wineDetails.region":"Región","wineDetails.type":"Tipo","wineDetails.code":"Código","wineDetails.moreInfo":"Más información","wineDetails.buy":"Comprar",searchButton:"Buscar",priceRange:"Rango de precios",wineColor:"Color del vino",intensity:"Intensidad",red:"Tinto",white:"Blanco",rose:"Rosado",light:"Ligero",medium:"Medio",full:"Intenso",barTitle:"Platos de Bar",barSubtitle:"Selecciona de la lista y presiona «Enviar»",barSendButton:"Enviar",barResetButton:"Reiniciar",barName:"Nombre del bar",barNotesPlaceholder:"Agrega tus comentarios aquí...",placeholderSuggestions:["Vino para pasta","Perfecto con pescado","Recomendado para una fiesta"],headerLine1:"Comparte cualquier cosa que tengas en mente —",headerLine2:"— y obtén recomendaciones del vino perfecto en cuestión de segundos",headerMeal:"comida",headerMood:"estado de ánimo",headerBudget:"presupuesto",headerOccasion:"ocasión",headerOr:"o",errorMessage:"Algo salió mal. Por favor, inténtalo de nuevo más tarde.",noResultsMessage:"No se encontraron resultados para tu búsqueda. Por favor, intenta con otra consulta.",ai_sommelier:"AI sommelier"},en:{lang:"en",welcomeMessage:"What are you planning to eat? Share your dish and I'll recommend the perfect wine pairing for your meal.",noResultsFound:"No results found.",somethingWentWrong:"Sorry, something went wrong.",chatButton1:"Find Your Pairing",chatButton2:"Pair Wine Now",chatButton3:"Get Wine Advice",chatTitle:"Wine Pairing Assistant 🍷",chatSubtitle:"Describe your meal and get a recommendation in 30 seconds",inputPlaceholder:"e.g., Tuna salad",sendButton:"Match",poweredBy:"Powered by",price:"Price",region:"Region",type:"Type",reason:"Suggestion",moreInfo:"More info",winePairingIntro:"For this wine, here are some suggested dishes:",askForDinner:"What would you like to have for dinner?",clearChatButton:"Clear Chat",widgetTitle:"FIND YOUR PERFECT WINE",widgetSubtitle:"Share anything on your mind—your meal, mood, budget, or occasion—and our AI sommelier will recommend the perfect wine in seconds",searchPlaceholder:"Enter a keyword or description","wineDetails.price":"Price","wineDetails.region":"Region","wineDetails.type":"Type","wineDetails.moreInfo":"More info","wineDetails.reason":"Reason","wineDetails.code":"Code","wineDetails.buy":"Buy",searchButton:"Search",priceRange:"Price Range",wineColor:"Wine Color",intensity:"Intensity",red:"Red",white:"White",rose:"Rosé",light:"Light",medium:"Medium",full:"Full",barTitle:"Bar Dishes",barSubtitle:"Select dishes below and click 'Send'",barSendButton:"Send",barResetButton:"Reset",barName:"Bar Name",barNotesPlaceholder:"Add your wishes here...",placeholderSuggestions:["Wine for pasta","Perfect with fish","Recommended for a party"],headerLine1:"Share anything on your mind —",headerLine2:"— and get recommendations of the perfect wine in seconds",headerMeal:"meal",headerMood:"mood",headerBudget:"budget",headerOccasion:"occasion",headerOr:"or",errorMessage:"Something went wrong. Please try again later.",noResultsMessage:"No results found for your search. Please try a different query.",ai_sommelier:"AI sommelier"},sr:{lang:"sr",welcomeMessage:"Šta planirate da jedete? Podelite svoje jelo i preporučiću vam savršeno vino uz obrok.",noResultsFound:"Nema rezultata.",somethingWentWrong:"Izvinite, nešto je pošlo po zlu.",chatButton1:"Pronađi vino",chatButton2:"Upari vino sada",chatButton3:"Zatraži preporuku",chatTitle:"Asistent za uparivanje vina 🍷",chatSubtitle:"Opišite svoj obrok i dobijte preporuku za 30 sekundi",inputPlaceholder:"npr. Tuna salata",sendButton:"Upari",poweredBy:"Pokreće",price:"Cena",region:"Regija",type:"Tip",reason:"Preporuka",moreInfo:"Više informacija",winePairingIntro:"Za ovo vino, preporučuju se sledeća jela:",askForDinner:"Šta biste želeli za večeru?",clearChatButton:"Obriši razgovor",widgetTitle:"PRONAĐITE SAVRŠENO VINO",widgetSubtitle:"Podelite bilo šta — obrok, raspoloženje, budžet ili priliku — i naš AI somelijer će vam za par sekundi preporučiti vino",searchPlaceholder:"Unesite ključnu reč ili opis","wineDetails.price":"Cena","wineDetails.region":"Regija","wineDetails.type":"Tip","wineDetails.moreInfo":"Više informacija","wineDetails.reason":"Razlog","wineDetails.code":"Šifra","wineDetails.buy":"Kupi",searchButton:"Pretraga",priceRange:"Cenovni raspon",wineColor:"Boja vina",intensity:"Intenzitet",red:"Crveno",white:"Belo",rose:"Roze",light:"Lako",medium:"Srednje",full:"Puno",barTitle:"Jela iz bara",barSubtitle:"Izaberite jela ispod i kliknite 'Pošalji'",barSendButton:"Pošalji",barResetButton:"Resetuj",barName:"Naziv bara",barNotesPlaceholder:"Dodajte svoje želje ovde...",placeholderSuggestions:["Vino uz pastu","Savršeno uz ribu","Preporuka za žurku"],headerLine1:"Podelite bilo šta što vam je na umu —",headerLine2:"— i dobijte preporuke za savršeno vino za par sekundi",headerMeal:"obrok",headerMood:"raspoloženje",headerBudget:"budžet",headerOccasion:"prilika",headerOr:"ili",errorMessage:"Nešto je pošlo po zlu. Molimo pokušajte ponovo kasnije.",noResultsMessage:"Nema rezultata za vašu pretragu. Molimo pokušajte sa drugačijim upitom.",ai_sommelier:"AI sommelier"},de:{lang:"de",welcomeMessage:"Was möchten Sie essen? Beschreiben Sie Ihr Gericht und ich empfehle Ihnen den perfekten Wein dazu.",noResultsFound:"Keine Ergebnisse gefunden.",somethingWentWrong:"Entschuldigung, etwas ist schief gelaufen.",chatButton1:"Finde Dein Pairing",chatButton2:"Wein jetzt wählen",chatButton3:"Erhalte Weinberatung",chatTitle:"Wein & Speisen 🍷",chatSubtitle:"Beschreiben Sie Ihr Gericht und erhalten Sie in 30 Sekunden eine Empfehlung",inputPlaceholder:"z.B., Thunfischsalat",sendButton:"Kombinieren",poweredBy:"Unterstützt von",price:"Preis",region:"Region",type:"Typ",reason:"Anregung",moreInfo:"Mehr Info",winePairingIntro:"Für diesen Wein gibt es folgende Essensvorschläge:",askForDinner:"Was möchten Sie zum Abendessen essen?",clearChatButton:"Chat löschen",widgetTitle:"FINDEN SIE IHREN PERFEKTEN WEIN",widgetSubtitle:"Teilen Sie alles, was Ihnen in den Sinn kommt—Ihre Mahlzeit, Stimmung, Ihr Budget oder Anlass—und unser KI-Sommelier empfiehlt Ihnen in Sekunden den perfekten Wein",placeholderSuggestions:["Wein für Pasta","Perfekt zu Fisch","Empfohlen für eine Party"],searchPlaceholder:"Geben Sie ein Stichwort oder eine Beschreibung ein","wineDetails.price":"Preis","wineDetails.region":"Region","wineDetails.type":"Typ","wineDetails.moreInfo":"Mehr Info","wineDetails.reason":"Grund","wineDetails.code":"Code","wineDetails.buy":"Kaufen",searchButton:"Suche",priceRange:"Preisspanne",wineColor:"Weinfarbe",intensity:"Intensität",red:"Rot",white:"Weiß",rose:"Rosé",light:"Leicht",medium:"Mittel",full:"Voll",barTitle:"Bar-Auswahl",barSubtitle:"Wählen Sie Ihre Gerichte und klicken Sie auf 'Senden'",barSendButton:"Senden",barResetButton:"Zurücksetzen",barName:"Name der Bar",headerLine1:"Teilen Sie alles, was Ihnen durch den Kopf geht —",headerLine2:"— und erhalten Sie in Sekundenschnelle Empfehlungen für den perfekten Wein",headerMeal:"Mahlzeit",headerMood:"Stimmung",headerBudget:"Budget",headerOccasion:"Anlass",headerOr:"oder",errorMessage:"Etwas ist schief gelaufen. Bitte versuchen Sie es später erneut.",noResultsMessage:"Keine Ergebnisse für Ihre Suche gefunden. Bitte versuchen Sie es mit einer anderen Anfrage.",ai_sommelier:"AI sommelier"},ukr:{lang:"ukr",welcomeMessage:"Що ви збираєтесь їсти? Опишіть свою страву, і я порекомендую вам ідеальне вино.",noResultsFound:"Результатів не знайдено.",somethingWentWrong:"Вибачте, щось пішло не так.",chatButton1:"Знайти ідеальне поєднання",chatButton2:"Підібрати вино",chatButton3:"Отримати пораду",chatTitle:"Сомельє-помічник 🍷",chatSubtitle:"Опишіть свою страву і отримайте рекомендацію за 30 секунд",inputPlaceholder:"наприклад, Тунець із салатом",sendButton:"Підібрати",poweredBy:"Розроблено на основі",price:"Ціна",region:"Регіон",type:"Тип",reason:"Рекомендація",moreInfo:"Докладніше",winePairingIntro:"До цього вина підходять такі страви:",askForDinner:"Що ви хочете на вечерю?",clearChatButton:"Очистити чат",widgetTitle:"ЗНАЙДІТЬ ІДЕАЛЬНЕ ВИНО",widgetSubtitle:"Поділіться тим, що у вас на думці—їжа, настрій, бюджет чи подія—і наш AI-сомельє порекомендує вам ідеальне вино за секунди",searchPlaceholder:"Введіть ключове слово або опис","wineDetails.reason":"Причина","wineDetails.price":"Ціна","wineDetails.region":"Регіон","wineDetails.type":"Тип","wineDetails.moreInfo":"Докладніше","wineDetails.code":"Код","wineDetails.buy":"Купити",searchButton:"Пошук",priceRange:"Діапазон цін",wineColor:"Колір вина",intensity:"Інтенсивність",red:"Червоне",white:"Біле",rose:"Рожеве",light:"Легке",medium:"Середнє",full:"Повне",barTitle:"Закуски до вина",barSubtitle:"Виберіть страви нижче та натисніть «Надіслати»",barSendButton:"Надіслати",barResetButton:"Скинути",barName:"Назва бару",barNotesPlaceholder:"Додайте ваші побажання тут...",placeholderSuggestions:["Вино до пасти","Ідеально до риби","Рекомендуємо для вечірки"],headerLine1:"Поділіться будь-якими вашими думками —",headerLine2:"— і отримайте рекомендації щодо ідеального вина за секунди",headerMeal:"страва",headerMood:"настрій",headerBudget:"бюджет",headerOccasion:"подія",headerOr:"або",errorMessage:"Щось пішло не так. Будь ласка, спробуйте пізніше.",noResultsMessage:"За вашим запитом не знайдено результатів. Спробуйте інший запит.",ai_sommelier:"AI sommelier"},ru:{lang:"ru",welcomeMessage:"Что вы планируете поесть? Напишите ваше блюдо, и я подберу идеальное вино к нему.",noResultsFound:"Результаты не найдены.",somethingWentWrong:"Извините, что-то пошло не так.",chatButton1:"Найти сочетание",chatButton2:"Подобрать вино",chatButton3:"Получить совет",chatTitle:"Ассистент по подбору вина 🍷",chatSubtitle:"Опишите ваше блюдо и получите рекомендацию за 30 секунд",inputPlaceholder:"например, Тунец с салатом",sendButton:"Подобрать",poweredBy:"Powered by",price:"Цена",region:"Регион",type:"Тип",reason:"Рекомендация",moreInfo:"Подробнее",winePairingIntro:"К этому вину подходят следующие блюда:",askForDinner:"Что бы вы хотели на ужин?",clearChatButton:"Очистить чат",widgetTitle:"НАЙДИТЬ ИДЕАЛЬНОЕ ВИНО",widgetSubtitle:"Поделитесь вашими предпочтениями — блюдом, настроением, бюджетом или случаем — и наш AI-сомелье подберёт идеальное вино за секунды",searchPlaceholder:"Введите ключевое слово или описание","wineDetails.price":"Цена","wineDetails.region":"Регион","wineDetails.type":"Тип","wineDetails.moreInfo":"Подробнее","wineDetails.reason":"Причина","wineDetails.code":"Код","wineDetails.buy":"Купить",searchButton:"Поиск",priceRange:"Диапазон цен",wineColor:"Цвет вина",intensity:"Интенсивность",red:"Красное",white:"Белое",rose:"Розовое",light:"Лёгкое",medium:"Среднее",full:"Полное",barTitle:"Закуски к вину",barSubtitle:"Выберите блюда ниже и нажмите 'Отправить'",barSendButton:"Отправить",barResetButton:"Сбросить",barName:"Название бара",barNotesPlaceholder:"Добавьте ваши пожелания здесь...",placeholderSuggestions:["Вино для пасты","Идеально к рыбе","Рекомендуем для вечеринки"],headerLine1:"Поделитесь любыми вашими мыслями —",headerLine2:"— и получите рекомендации по идеальному вину за считанные секунды",headerMeal:"блюдо",headerMood:"настроение",headerBudget:"бюджет",headerOccasion:"случай",headerOr:"или",errorMessage:"Что-то пошло не так. Пожалуйста, попробуйте позже.",noResultsMessage:"По вашему запросу не найдено результатов. Попробуйте другой запрос.",ai_sommelier:"AI sommelier"},kk:{lang:"kk",welcomeMessage:"Сіз не жегіңіз келеді? Тағамыңызды сипаттаңыз, мен оған керемет шарап ұсынамын.",noResultsFound:"Нәтижелер табылмады.",somethingWentWrong:"Кешіріңіз, бірдеңе дұрыс болмады.",chatButton1:"Сәйкестік табу",chatButton2:"Шарап таңдау",chatButton3:"Кеңес алу",chatTitle:"Шарап таңдаушы көмекші 🍷",chatSubtitle:"Тағамыңызды сипаттаңыз — 30 секундта ұсыныс алыңыз",inputPlaceholder:"мысалы, тунец салатымен",sendButton:"Таңдау",poweredBy:"Powered by",price:"Бағасы",region:"Өңір",type:"Түрі",reason:"Ұсыныс",moreInfo:"Толығырақ",winePairingIntro:"Бұл шарапқа келесі тағамдар сәйкес келеді:",askForDinner:"Кешкі асқа не қалайсыз?",clearChatButton:"Чатты тазалау",widgetTitle:"КЕРЕМЕТ ШАРАПТЫ ТАБЫҢЫЗ",widgetSubtitle:"Таңдауларыңызды бөлісіңіз — тағам, көңіл-күй, бюджет немесе жағдай — және біздің AI-сомелье сізге бірнеше секундта шарап ұсынады",searchPlaceholder:"Кілт сөзді немесе сипаттаманы енгізіңіз","wineDetails.price":"Бағасы","wineDetails.region":"Өңір","wineDetails.type":"Түрі","wineDetails.moreInfo":"Толығырақ","wineDetails.reason":"Себебі","wineDetails.code":"Код","wineDetails.buy":"Сатып алу",searchButton:"Іздеу",priceRange:"Баға диапазоны",wineColor:"Шарап түсі",intensity:"Қанықтылық",red:"Қызыл",white:"Ақ",rose:"Розалық",light:"Жеңіл",medium:"Орташа",full:"Толық",barTitle:"Шарапқа арналған тіскебасарлар",barSubtitle:"Төмендегі тағамдарды таңдаңыз және 'Жіберу' батырмасын басыңыз",barSendButton:"Жіберу",barResetButton:"Қалпына келтіру",barName:"Бар атауы",barNotesPlaceholder:"Мұнда өз тілектеріңізді жазыңыз...",placeholderSuggestions:["Пастаға арналған шарап","Балыққа тамаша үйлеседі","Кешке ұсынуға болады"],headerLine1:"Ойларыңызбен бөлісіңіз —",headerLine2:"— және бірнеше секундта мінсіз шарап ұсынысын алыңыз",headerMeal:"тағам",headerMood:"көңіл-күй",headerBudget:"бюджет",headerOccasion:"жағдай",headerOr:"немесе",errorMessage:"Бірдеңе дұрыс болмады. Кейінірек қайта көріңіз.",noResultsMessage:"Іздеуіңізге сәйкес нәтиже табылмады. Басқа сұрау қолданып көріңіз.",ai_sommelier:"AI sommelier"}};function jf(t){return{id:String(t.id),lang:t.lang,available_languages:t.available_languages?t.available_languages:[t.lang],open_ai_key:t.open_ai_key??null,currency:t.currency,title:t.title}}const zf={0:{logoUrl:null,brandColor:"#7B2BEB"},25:{logoUrl:null,brandColor:"#7B2BEB",buttonUppercase:!0,customCss:`
|
|
22
|
-
@import url('https://
|
|
23
|
-
:root { --wineater-font-primary: '
|
|
19
|
+
`).filter(function(c){return!!c.match(i)&&!c.match(/^Error created at/)},this);return u.map(function(c){var h=c.split("@"),f=this.extractLocation(h.pop()),d=h.shift()||"",p=d.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0,g;d.match(/\(([^)]*)\)/)&&(g=d.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var v=g===void 0||g==="[arguments not available]"?void 0:g.split(",");return new s({functionName:p,args:v,fileName:f[0],lineNumber:f[1],columnNumber:f[2],source:c})},this)}}})})(Aa);var zh=Aa.exports;const Uh=Wh(zh);function Ma(t){return[{columnNumber:t.colno,lineNumber:t.lineno,fileName:t.filename,functionName:"",source:""}]}function qs(t,e,n={}){let s=e;try{s=Uh.parse(t)}catch{}return Xi(t.name,t.message,JSON.stringify(s),JSON.stringify(n))}function La(t,e=window,n={}){if(t instanceof ErrorEvent){if(t.error instanceof Error)return qs(t.error,Ma(t),n);{let[s,i]=t.message.split(":");return i||(s="Error",i=t.message),Xi(s,i,JSON.stringify(Ma(t)),JSON.stringify(n))}}else if("PromiseRejectionEvent"in e&&t instanceof e.PromiseRejectionEvent){if(t.reason instanceof Error)return qs(t.reason,[],n);{let s;try{s=JSON.stringify(t.reason)}catch{s=String(t.reason)}return Xi("Unhandled Promise Rejection",s,"[]",JSON.stringify(n))}}return null}function Hh(t,e){const n=Object.assign({captureExceptions:!0},e);function s(i){function r(a){const l=La(a,i);l!=null&&t.send(l)}t.attachEventListener(i,"unhandledrejection",r),t.attachEventListener(i,"error",r)}n.captureExceptions&&(t.observer.attachContextCallback(s),s(window))}function Ba(t,e=document.location){return t=t.trim(),t.startsWith("//")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:")?t:t.startsWith("/")?e.origin+t:e.origin+e.pathname+t}function qh(t){return ou&&(t.startsWith("data:image/svg+xml")||t.match(/.svg$|/i))}const Vh="https://static.openreplay.com/tracker/placeholder.jpeg";function Gh(t){function e(l,o){t.attributeSender.sendSetAttribute(l,"src",Vh);const{width:u,height:c}=o.getBoundingClientRect();o.hasAttribute("width")||t.attributeSender.sendSetAttribute(l,"width",String(u)),o.hasAttribute("height")||t.attributeSender.sendSetAttribute(l,"height",String(c))}const n=function(l,o){const{srcset:u}=o;if(!u)return;const c=u.split(u.match(/,\s+/)?/,\s+/:",").map(h=>Ba(h)).join(", ");t.attributeSender.sendSetAttribute(l,"srcset",c)},s=function(l,o){o.src.length>au&&e(l,o),t.send(Vi(l,"src",o.src,t.getBaseHref()))},i=t.safe(function(l){const o=Ba(l.src||"");Zo(o)&&t.send(da(t.timestamp(),0,0,0,0,0,o,"img",0,!1))}),r=t.safe(function(l){const o=t.nodes.getID(l);o!==void 0&&l.complete&&(l.naturalHeight===0&&l.naturalWidth===0&&!qh(l.src)?i(l):t.sanitizer.isHidden(o)||t.sanitizer.isObscured(o)?e(o,l):(s(o,l),n(o,l)))}),a=ta(t.safe(l=>{for(const o of l)if(o.type==="attributes"){const u=o.target,c=t.nodes.getID(u);if(c===void 0)return;o.attributeName==="src"&&s(c,u),o.attributeName==="srcset"&&n(c,u)}}));t.attachStopCallback(()=>{a.disconnect()}),t.nodes.attachNodeCallback(l=>{ge(l,"img")&&(t.nodes.attachNodeListener(l,"error",()=>i(l)),t.nodes.attachNodeListener(l,"load",()=>r(l)),r(l),a.observe(l,{attributes:!0,attributeFilter:["src","srcset"]}))})}const Kh=["text","password","email","search","number","range","date","tel","time"];function Xh(t){return ge(t,"textarea")?!0:ge(t,"input")?Kh.includes(t.type):!1}function Yh(t){if(!ge(t,"input"))return!1;const e=t.type;return e==="checkbox"||e==="radio"}const Jh=rt&&"labels"in HTMLInputElement.prototype?t=>{let e=t;for(;(e=e.parentNode)!==null;)if(ge(e,"label"))return e;const n=t.labels;if(n!==null&&n.length===1)return n[0]}:t=>{let e=t;for(;(e=e.parentNode)!==null;)if(ge(e,"label"))return e;const n=t.id;if(n){const s=t.ownerDocument.querySelectorAll('label[for="'+n+'"]');if(s!==null&&s.length===1)return s[0]}};function Fa(t){let e=Hi(t);if(e===null){const n=Jh(t);e=n&&n.innerText||t.placeholder||t.name||t.id||t.className||t.type}return Qo(e).slice(0,100)}const On={Plain:0,Obscured:1,Hidden:2};function Qh(t,e){const n=Object.assign({obscureInputNumbers:!0,obscureInputEmails:!0,defaultInputMode:On.Obscured,obscureInputDates:!1},e);function s(c,h){let f=h.value,d=n.defaultInputMode;h.type==="password"||t.sanitizer.isHidden(c)?d=On.Hidden:(t.sanitizer.isObscured(c)||d===On.Plain&&(n.obscureInputNumbers&&h.type!=="date"&&/\d\d\d\d/.test(f)||n.obscureInputDates&&h.type==="date"||n.obscureInputEmails&&(h.type==="email"||~f.indexOf("@"))))&&(d=On.Obscured);let p=0;switch(d){case On.Hidden:p=-1,f="";break;case On.Obscured:p=f.length,f="";break}return{value:f,mask:p}}function i(c,h){const{value:f,mask:d}=s(c,h);t.send(ku(c,f,d))}const r=new Map,a=new Map;t.attachStopCallback(()=>{r.clear(),a.clear()});function l(c,h){r.get(c)!==h.value&&(r.set(c,h.value),i(c,h))}function o(c,h){a.get(c)!==h&&(a.set(c,h),t.send(Tu(c,h)))}t.ticker.attach(()=>{r.forEach((c,h)=>{const f=t.nodes.getNode(h);if(!f)return r.delete(h);l(h,f)}),a.forEach((c,h)=>{const f=t.nodes.getNode(h);if(!f)return a.delete(h);o(h,f.checked)})},3);function u(c,h,f,d){const{value:p,mask:g}=s(c,h),v=Fa(h);t.send(zu(c,p,g!==0,v,f,d))}t.nodes.attachNodeCallback(t.safe(c=>{const h=t.nodes.getID(c);if(h!==void 0){if(ge(c,"select")&&(i(h,c),t.nodes.attachNodeListener(c,"change",()=>i(h,c))),Xh(c)){l(h,c);let f=0,d=0,p=0;const g=()=>{f=Qe()},v=()=>{d===0&&f!==0&&(d=Qe()-f)},k=()=>{f!==0&&(p=Qe()-f),u(h,c,d,p),d=0,p=0,f=0};t.nodes.attachNodeListener(c,"focus",g),t.nodes.attachNodeListener(c,"input",v),t.nodes.attachNodeListener(c,"change",k);return}if(Yh(c)){o(h,c.checked),t.nodes.attachNodeListener(c,"change",()=>o(h,c.checked));return}}}))}let He,ur,Wa;function Zh(t,e){if(Wa=new Date,t.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(t.tagName.toLowerCase()==="html")return"html";const n={root:document.body,idName:i=>!0,className:i=>!0,tagName:i=>!0,attr:(i,r)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};He={...n,...e},ur=$h(He.root,n);let s=Vs(t,"all",()=>Vs(t,"two",()=>Vs(t,"one",()=>Vs(t,"none"))));if(s){const i=Va(Ga(s,t));return i.length>0&&(s=i[0]),Gs(s)}else throw new Error("Selector was not found.")}function $h(t,e){return t.nodeType===Node.DOCUMENT_NODE?t:t===e.root?t.ownerDocument:t}function Vs(t,e,n){let s=null,i=[],r=t,a=0;for(;r;){const l=new Date().getTime()-Wa.getTime();if(He.timeoutMs!==void 0&&l>He.timeoutMs)throw new Error(`Timeout: Can't find a unique selector after ${l}ms`);let o=Xs(ef(r))||Xs(...tf(r))||Xs(...nf(r))||Xs(sf(r))||[Ha()];const u=rf(r);if(e=="all")u&&(o=o.concat(o.filter(hr).map(c=>Ks(c,u))));else if(e=="two")o=o.slice(0,1),u&&(o=o.concat(o.filter(hr).map(c=>Ks(c,u))));else if(e=="one"){const[c]=o=o.slice(0,1);u&&hr(c)&&(o=[Ks(c,u)])}else e=="none"&&(o=[Ha()],u&&(o=[Ks(o[0],u)]));for(let c of o)c.level=a;if(i.push(o),i.length>=He.seedMinLength&&(s=ja(i,n),s))break;r=r.parentElement,a++}return s||(s=ja(i,n)),!s&&n?n():s}function ja(t,e){const n=Va(qa(t));if(n.length>He.threshold)return e?e():null;for(let s of n)if(Ua(s))return s;return null}function Gs(t){let e=t[0],n=e.name;for(let s=1;s<t.length;s++){const i=t[s].level||0;e.level===i-1?n=`${t[s].name} > ${n}`:n=`${t[s].name} ${n}`,e=t[s]}return n}function za(t){return t.map(e=>e.penalty).reduce((e,n)=>e+n,0)}function Ua(t){const e=Gs(t);switch(ur.querySelectorAll(e).length){case 0:throw new Error(`Can't select any node with this selector: ${e}`);case 1:return!0;default:return!1}}function ef(t){const e=t.getAttribute("id");return e&&He.idName(e)?{name:"#"+CSS.escape(e),penalty:0}:null}function tf(t){return Array.from(t.attributes).filter(n=>He.attr(n.name,n.value)).map(n=>({name:`[${CSS.escape(n.name)}="${CSS.escape(n.value)}"]`,penalty:.5}))}function nf(t){return Array.from(t.classList).filter(He.className).map(n=>({name:"."+CSS.escape(n),penalty:1}))}function sf(t){const e=t.tagName.toLowerCase();return He.tagName(e)?{name:e,penalty:2}:null}function Ha(){return{name:"*",penalty:3}}function rf(t){const e=t.parentNode;if(!e)return null;let n=e.firstChild;if(!n)return null;let s=0;for(;n&&(n.nodeType===Node.ELEMENT_NODE&&s++,n!==t);)n=n.nextSibling;return s}function Ks(t,e){return{name:t.name+`:nth-child(${e})`,penalty:t.penalty+1}}function hr(t){return t.name!=="html"&&!t.name.startsWith("#")}function Xs(...t){const e=t.filter(of);return e.length>0?e:null}function of(t){return t!=null}function*qa(t,e=[]){if(t.length>0)for(let n of t[0])yield*qa(t.slice(1,t.length),e.concat(n));else yield e}function Va(t){return[...t].sort((e,n)=>za(e)-za(n))}function*Ga(t,e,n={counter:0,visited:new Map}){if(t.length>2&&t.length>He.optimizedMinLength)for(let s=1;s<t.length-1;s++){if(n.counter>He.maxNumberOfTries)return;n.counter+=1;const i=[...t];i.splice(s,1);const r=Gs(i);if(n.visited.has(r))return;Ua(i)&&af(i,e)&&(yield i,n.visited.set(r,!0),yield*Ga(i,e,n))}}function af(t,e){return ur.querySelector(Gs(t))===e}function lf(t,e,n){return Zh(t,{root:e.body,seedMinLength:3,optimizedMinLength:(n==null?void 0:n.minSelectorDepth)||2,threshold:(n==null?void 0:n.nthThreshold)||1e3,maxNumberOfTries:(n==null?void 0:n.maxOptimiseTries)||1e4})}function fr(t){const e=t.tagName.toUpperCase();return e==="BUTTON"||e==="A"||e==="LI"||e==="SELECT"||e==="TR"||e==="TH"||t.onclick!=null||t.getAttribute("role")==="button"}function Ka(t,e){return t instanceof Element?cf(t,e):null}function cf(t,e){let n=t;for(;n!==null&&n!==e.documentElement;){if(Zt(n,"masked"))return null;n=n.parentElement}if(er(t)){let s=t.ownerSVGElement;for(;s!==null;)t=s,s=s.ownerSVGElement}for(n=t;n!==null&&n!==e.documentElement;){const s=n.tagName.toUpperCase();if(s==="LABEL")return null;if(s==="INPUT"||fr(n)||Hi(n)!==null)return n;n=n.parentElement}return t===e.documentElement?null:t}function uf(t,e){const{disableClickmaps:n=!1}=e||{};function s(m){const y=Hi(m);if(y!==null)return y;if(ge(m,"input"))return Fa(m);if(fr(m)){let T="";return m instanceof HTMLElement&&(T=t.sanitizer.getInnerTextSecure(m)),T=T||m.id||m.className,Qo(T).slice(0,100)}return""}let i=-1,r=-1,a=!1,l=null,o=0,u={},c=0,h=0,f=0,d=0,p;const g=.008,v=225;function k(){const m=d/v;if(!c){c=m;return}const y=(m-c)/v;f>4&&y>g&&t.send(Uu(Qe())),d=0,f=0,c=m}t.attachStartCallback(()=>{p=setInterval(()=>k(),v)}),t.attachStopCallback(()=>{i=-1,r=-1,a=!1,l=null,u={},p&&clearInterval(p)});const C=()=>{a&&(t.send(xu(i,r)),a=!1)},E=(m,y=!1)=>{function T(S,_,A){return u[S]=u[S]||lf(_,m,A)}const x=y?t.attachEventListener.bind(t):t.nodes.attachNodeListener.bind(t.nodes);x(m.documentElement,"mouseover",S=>{const _=Ka(S.target,m);_!==l&&(l=_,o=performance.now())}),x(m,"mousemove",S=>{const[_,A]=t.observer.getDocumentOffset(m);i=S.clientX+_,r=S.clientY+A,a=!0;const W=Math.sign(S.movementX);d+=Math.abs(S.movementX)+Math.abs(S.movementY),W!==h&&(h=W,f++)},!1),x(m,"click",S=>{const _=Ka(S.target,m);if(!S.clientX&&!S.clientY||_===null)return;const A=t.nodes.getID(_);if(A!==void 0){const W=S.pageX,D=S.pageY,U=m.documentElement.scrollWidth,R=m.documentElement.scrollHeight,P=Xa(W/U),I=Xa(D/R);C(),t.send(Fu(A,l===_?Math.round(performance.now()-o):0,s(_),fr(_)&&!n?T(A,_,e):"",P,I),!0)}l=null})};t.nodes.attachNodeCallback(m=>{zs(m)&&E(m)}),E(document,!0),t.ticker.attach(C,(e==null?void 0:e.trackingOffset)||7)}function Xa(t){return Math.round(t*1e4)}function hf(t){const e=[],n=document.getElementsByTagName("*"),s=/url\(("[^"]*"|'[^']*'|[^)]*)\)/i;for(let i=0;i<n.length;i++){const r=n[i];let a="";if(ge(r,"img")&&(a=r.currentSrc||r.src),!a){const p=getComputedStyle(r).getPropertyValue("background-image");if(p){const g=s.exec(p);g!==null&&(a=g[1],(a.startsWith('"')||a.startsWith("'"))&&(a=a.substr(1,a.length-2)))}}if(!a)continue;const l=a.substr(0,10)==="data:image"?0:t[a];if(l===void 0)continue;const o=r.getBoundingClientRect(),u=Math.max(o.top,0),c=Math.max(o.left,0),h=Math.min(o.bottom,window.innerHeight||document.documentElement&&document.documentElement.clientHeight||0),f=Math.min(o.right,window.innerWidth||document.documentElement&&document.documentElement.clientWidth||0);if(h<=u||f<=c)continue;const d=(h-u)*(f-c);e.push({time:l,area:d})}return e}function ff(t,e){let n=Math.max(document.documentElement&&document.documentElement.clientWidth||0,window.innerWidth||0)*Math.max(document.documentElement&&document.documentElement.clientHeight||0,window.innerHeight||0)/10,s=n*t;for(let i=0;i<e.length;i++){const{time:r,area:a}=e[i];n+=a,s+=a*(r>t?r:t)}return n===0?0:s/n}function df(t,e){const n=Object.assign({captureResourceTimings:!0,capturePageLoadTimings:!0,capturePageRenderTimings:!0,excludedResourceUrls:[]},e);if("PerformanceObserver"in window||(n.captureResourceTimings=!1),!n.captureResourceTimings)return;let s={};function i(u){var h;if(u.duration<0||!Zo(u.name)||t.isServiceURL(u.name))return;s!==null&&(s[u.name]=u.startTime+u.duration);let c=!1;(h=n.excludedResourceUrls)==null||h.forEach(f=>{if(u.name.startsWith(f)){c=!0;return}}),!c&&t.send(da(u.startTime+Nn(),u.duration,u.responseStart&&u.startTime?u.responseStart-u.startTime:0,u.transferSize>u.encodedBodySize?u.transferSize-u.encodedBodySize:0,u.encodedBodySize||0,u.decodedBodySize||0,u.name,u.initiatorType,u.transferSize,u.responseStatus&&u.responseStatus===304||u.transferSize===0))}const r=new PerformanceObserver(u=>u.getEntries().forEach(i));let a;t.attachStartCallback(function({sessionID:u}){u!==a&&(performance.getEntriesByType("resource").forEach(i),a=u),r.observe({entryTypes:["resource"]})}),t.attachStopCallback(function(){r.disconnect()});let l=0,o=0;if(n.capturePageLoadTimings){let u=!1;t.ticker.attach(()=>{if(!u&&((l===0||o===0)&&performance.getEntriesByType("paint").forEach(c=>{const{name:h,startTime:f}=c;switch(h){case"first-paint":l=f;break;case"first-contentful-paint":o=f;break}}),performance.timing.loadEventEnd||performance.now()>3e4)){u=!0;const{navigationStart:c,requestStart:h,responseStart:f,responseEnd:d,domContentLoadedEventStart:p,domContentLoadedEventEnd:g,loadEventStart:v,loadEventEnd:k}=performance.timing;t.send(Iu(h-c||0,f-c||0,d-c||0,p-c||0,g-c||0,v-c||0,k-c||0,l,o))}},30)}if(n.capturePageRenderTimings){let u=0,c=0,h=0,f=null,d=!1;t.ticker.attach(()=>{if(d)return;const p=performance.now();if(s!==null&&(u=Math.max.apply(null,Object.keys(s).map(g=>s[g])),p-u>1e3&&(f=hf(s),s=null)),h!==null&&(p-h>50&&(c=p),h=p-c>5e3?null:p),f!==null&&h===null||p>3e4){d=!0,s=null;const g=f===null?0:ff(o||l,f),{domContentLoadedEventEnd:v,navigationStart:k}=performance.timing,C=h===null?Math.max(c,o,v-k||0):0;t.send(Cu(g,o>u?o:u,C))}})}}function dr(t){const e=t.defaultView;return[e&&e.scrollX||t.documentElement&&t.documentElement.scrollLeft||t.body&&t.body.scrollLeft||0,e&&e.scrollY||t.documentElement&&t.documentElement.scrollTop||t.body&&t.body.scrollTop||0]}function pf(t,e){let n=!1;const s=new Map;function i(l){Ta(l)&&(St(l)&&s.set(l,[l.scrollLeft,l.scrollTop]),zs(l)&&s.set(l,dr(l)))}const r=t.safe(()=>{e||t.send(gu(...dr(document)))}),a=t.safe((l,o)=>{const u=t.nodes.getID(o);u!==void 0&&t.send(_u(u,l[0],l[1]))});t.attachStartCallback(r),t.attachStopCallback(()=>{n=!1,s.clear()}),t.nodes.attachNodeCallback((l,o)=>{o&&(St(l)&&l.scrollLeft+l.scrollTop>0?s.set(l,[l.scrollLeft,l.scrollTop]):zs(l)&&s.set(l,dr(l))),Us(l)&&t.nodes.attachNodeListener(l,"scroll",u=>{i(u.target)})}),t.attachEventListener(document,"scroll",l=>{const o=l.target;if(o===document){n=!0;return}i(o)}),t.ticker.attach(()=>{n&&(r(),n=!1),s.forEach(a),s.clear()},5,!1)}function gf(t){let e,n,s,i,r=document.referrer;const a=t.safe(()=>{const{URL:u}=document;u!==e&&(e=u,t.send(Gu(e,r,i,document.title)),i=0,r=e)}),l=t.safe(()=>{const{innerWidth:u,innerHeight:c}=window;(u!==n||c!==s)&&(n=u,s=c,t.send(pu(n,s)))}),o=document.hidden===void 0?Function.prototype:t.safe(()=>t.send(Pu(document.hidden)));t.attachStartCallback(()=>{e=null,i=Nn(),n=s=-1,a(),l(),o()}),document.hidden!==void 0&&t.attachEventListener(document,"visibilitychange",o,!1,!1),t.ticker.attach(a,1,!1),t.ticker.attach(l,5,!1)}function Ya(t){return Us(t)&&!!t.adoptedStyleSheets}let mf=15;function Ja(){return mf++}const Ys=new Map;function vf(t){if(t===null||!Ya(document))return;const e=new Map,n=new Map,s=a=>setTimeout(()=>{let l=t.nodes.getID(a);if(a===document&&(l=0),l===void 0)return;let o=n.get(l);o||(o=[]);const u=[],c=a.adoptedStyleSheets;if(c&&Symbol.iterator in c)for(const h of c){let f=e.get(h);const d=!f;if(f||(f=Ja(),e.set(h,f)),o.includes(f)||t.send(ha(f,l)),d){const p=h.cssRules;for(let g=0;g<p.length;g++)t.send(Ki(f,p[g].cssText,g,t.getBaseHref()))}u.push(f)}if(Symbol.iterator in o)for(const h of o)u.includes(h)||t.send(Wu(h,l));n.set(l,u)},20);function i(a){const l=Object.getOwnPropertyDescriptor(a,"adoptedStyleSheets");l&&Object.defineProperty(a,"adoptedStyleSheets",{...l,set:function(o){const u=l.set.call(this,o);return s(this),u}})}const r=a=>{if(a.__openreplay_adpss_patched__)return;a.__openreplay_adpss_patched__=!0,i(a.Document.prototype),i(a.ShadowRoot.prototype);const{replace:l,replaceSync:o}=a.CSSStyleSheet.prototype;a.CSSStyleSheet.prototype.replace=function(u){return l.call(this,u).then(c=>{const h=e.get(this);return h&&t.send(ca(h,u,t.getBaseHref())),c})},a.CSSStyleSheet.prototype.replaceSync=function(u){const c=e.get(this);return c&&t.send(ca(c,u,t.getBaseHref())),o.call(this,u)}};r(window),t.observer.attachContextCallback(t.safe(r)),t.attachStopCallback(()=>{e.clear(),n.clear()}),t.attachStartCallback(()=>{s(document)}),t.nodes.attachNodeCallback(a=>{Ya(a)&&s(a)})}function bf(t){if(t===null)return;if(!window.CSSStyleSheet){t.send(Lu("no_stylesheet_prototype_in_window",""));return}const e=t.safe((i,r,a)=>{const l=Ys.get(i);l&&(typeof a=="string"?t.send(Ki(l,a,r,t.getBaseHref())):t.send(ua(l,r)))}),n=t.safe(i=>{let r=i;for(;r.parentRule;)r=r.parentRule;const a=r.parentStyleSheet;if(!a){t.debug.warn("No parent StyleSheet found for",r,i);return}const l=Ys.get(a);if(!l){t.debug.warn("No sheedID found for",a,Ys);return}const o=r.cssText,u=a.cssRules,c=Array.from(u).indexOf(r);c>=0?(t.send(Ki(l,o,c,t.getBaseHref())),t.send(ua(l,c+1))):t.debug.warn("Rule index not found in",a,r)}),s=t.safe(i=>{const{insertRule:r,deleteRule:a}=i.CSSStyleSheet.prototype,{insertRule:l,deleteRule:o}=i.CSSGroupingRule.prototype;i.CSSStyleSheet.prototype.insertRule=function(u,c=0){return e(this,c,u),r.call(this,u,c)},i.CSSStyleSheet.prototype.deleteRule=function(u){return e(this,u),a.call(this,u)},i.CSSGroupingRule.prototype.insertRule=function(u,c=0){const h=l.call(this,u,c);return n(this),h},i.CSSGroupingRule.prototype.deleteRule=function(u=0){const c=o.call(this,u);return n(this),c}});s(window),t.observer.attachContextCallback(s),t.nodes.attachNodeCallback(i=>{if(!ge(i,"style")||!i.sheet||i.textContent!==null&&i.textContent.trim().length>0)return;const r=t.nodes.getID(i);if(!r)return;const a=i.sheet,l=Ja();Ys.set(a,l),t.send(ha(l,r));const o=a.cssRules;for(let u=0;u<o.length;u++)e(a,u,o[u].cssText)})}function wf(t){function e(s){const i=t.nodes.getID(s);i!==void 0&&t.send(la(i))}let n=!1;t.nodes.attachNodeCallback(s=>{ge(s,"body")&&(t.nodes.attachNodeListener(s,"focus",i=>{Ta(i.target)&&(e(i.target),n=!1)}),t.nodes.attachNodeListener(s,"blur",i=>{i.relatedTarget===null&&(n=!0,setTimeout(()=>{n&&t.send(la(-1))},0))}))}),t.attachStartCallback(()=>{let s=document.activeElement;for(;s&&ge(s,"iframe")&&s.contentDocument;)s=s.contentDocument.activeElement;s&&s!==s.ownerDocument.body&&e(s)},!0)}function yf(t){if(!window.FontFace)return;const e=new Map,n=s=>{class i extends s.FontFace{constructor(...a){if(typeof a[1]=="string"){let l="";a[2]&&t.safe(()=>{l=JSON.stringify(a[2])});const o=[a[0],a[1],l],u=e.get(s.document)||[];u.push(o),e.set(s.document,u);const c=s===window?0:t.nodes.getID(s.document);if(c===void 0)return;t.active()&&t.send(aa(c,...o))}super(...a)}}s.FontFace=i};t.observer.attachContextCallback(n),n(window),t.nodes.attachNodeCallback(t.safe(s=>{if(!zs(s))return;const i=e.get(s);if(!i)return;const r=s.defaultView===window?0:t.nodes.getID(s);r!==void 0&&i.forEach(a=>{t.send(aa(r,...a))})}))}function Sf(t,e,n,s,i){t.debug.log("Openreplay: attaching axios spy to instance",e);function r(f){t.debug.log("Openreplay: capturing axios response data",f);const{headers:d,data:p,method:g,url:v,baseURL:k}=f.config,{data:C,headers:E,status:m,response:y}=f,{data:T,headers:x,status:S}=y||{},_=n.ignoreHeaders,A=Array.isArray(_)?M=>_.includes(M):()=>_;function W(M,H){A(H[0])||(M[H[0]]=H[1])}let D={},U={};d.toJSON?D=d.toJSON():d instanceof Headers?d.forEach((M,H)=>W(D,[H,M])):Array.isArray(d)?d.forEach(M=>W(D,M)):typeof d=="object"&&Object.entries(d).forEach(M=>W(D,M));const R=x||E;R.toJSON?U=R.toJSON():R instanceof Headers?R.forEach((M,H)=>W(U,[H,M])):Array.isArray(R)?R.forEach(M=>W(U,M)):typeof R=="object"&&Object.entries(R).forEach(([M,H])=>{A(M)||(U[M]=H)});const P=s({url:v,method:g||"",status:m||S||0,request:{headers:D,body:p},response:{headers:U,body:T||C}});if(!P){t.debug.log("Openreplay: empty request/response info, skipping");return}const I=f.config.__openreplay_timing,O=performance.now()-I;t.debug.log("Openreplay: final req object",P),t.send(Bs("xhr",String(g),String(P.url),i(P.request),i(P.response),P.status,I+Nn(),O,0))}function a(f){if(t.debug.log("Openreplay: capturing API request",f),f.__openreplay_timing=performance.now(),n.sessionTokenHeader){const d=typeof n.sessionTokenHeader=="string"?n.sessionTokenHeader:"X-OpenReplay-Session-Token",p=t.getSessionToken();p&&f.headers.set(d,p)}return f}function l(f){return n.failuresOnly||r(f),f}function o(f){return t.debug.log("Openreplay: capturing API request error",f),_f(f)&&f.response?r(f.response):f instanceof Error&&t.send(qs(f,[])),Promise.reject(f)}function u(f){t.debug.log("Openreplay: failed API request, skipping",f)}const c=e.interceptors.request.use(a,u,{synchronous:!0}),h=e.interceptors.response.use(l,o,{synchronous:!0});t.attachStopCallback(()=>{var f,d,p,g;(d=(f=e.interceptors.request).eject)==null||d.call(f,c),(g=(p=e.interceptors.response).eject)==null||g.call(p,h)})}function _f(t){return kf(t)&&t.isAxiosError===!0}function kf(t){return t!==null&&typeof t=="object"}var at;(function(t){t[t.UNSENT=0]="UNSENT",t[t.OPENED=1]="OPENED",t[t.HEADERS_RECEIVED=2]="HEADERS_RECEIVED",t[t.LOADING=3]="LOADING",t[t.DONE=4]="DONE"})(at||(at={}));class pr{constructor(e=[],n,s){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.id="",this.name="",this.method="",this.url="",this.status=0,this.statusText="",this.cancelState=0,this.readyState=0,this.header={},this.responseType="",this.requestHeader={},this.responseSize=0,this.responseSizeText="",this.startTime=0,this.endTime=0,this.duration=0,this.getData={},this.requestData=null}getMessage(){const{reqHs:e,resHs:n}=this.writeHeaders(),s={headers:e,body:this.method==="GET"?JSON.stringify(this.getData):this.requestData},i={headers:n,body:this.response},r=this.sanitize({url:this.url,method:this.method,status:this.status,request:s,response:i});if(r)return Bs(this.requestType,r.method,r.url,JSON.stringify(r.request),JSON.stringify(r.response),r.status,this.startTime+Nn(),this.duration,this.responseSize)}writeHeaders(){const e={};Object.entries(this.requestHeader).forEach(([s,i])=>{this.isHeaderIgnored(s)||(e[s]=i)}),this.setSessionTokenHeader((s,i)=>{e[s]=i});const n={};return Object.entries(this.header).forEach(([s,i])=>{this.isHeaderIgnored(s)||(n[s]=i)}),{reqHs:e,resHs:n}}isHeaderIgnored(e){return Array.isArray(this.ignoredHeaders)?this.ignoredHeaders.map(n=>n.toLowerCase()).includes(e.toLowerCase()):this.ignoredHeaders}}const is=(t,e)=>{let n="";switch(t){case"":case"text":case"json":typeof e=="string"?n=e:mr(e)||Array.isArray(e)?n=JSON.stringify(e):typeof e<"u"&&(n=Object.prototype.toString.call(e));break;case"blob":case"document":case"arraybuffer":default:typeof e<"u"&&(n=Object.prototype.toString.call(e));break}return n},gr=t=>{if(!t)return null;let e;if(typeof t=="string"){(t[0]==="{"||t[0]==="[")&&(e=t);const n=t.split("&");n.length===1?e=t:e=n.join(",")}else if(xf(t)){const n=[];for(const[s,i]of t)n.push(`${s}=${typeof i=="string"?i:"[object Object]"}`);e=n.join(",")}else t instanceof Blob||t instanceof ReadableStream||t instanceof ArrayBuffer?e="byte data":mr(t)?e=t:e=`can't parse body ${typeof t}`;return e},Tf=(t,e={})=>{mr(e)||(e={});let n=t?t.split("?"):[];if(n.shift(),n.length>0){n=n.join("?").split("&");for(const s of n){const i=s.split("=");try{e[i[0]]=decodeURIComponent(i[1])}catch{e[i[0]]=i[1]}}}return e};function mr(t){return t!==null&&typeof t=="object"}function xf(t){return t==null||ArrayBuffer.isView(t)?!1:typeof Symbol<"u"&&typeof t[Symbol.iterator]=="function"}function Js(t){return t<=0?"":t>=1e3*1e3?(t/1e3/1e3).toFixed(1)+" MB":t>=1e3?(t/1e3).toFixed(1)+" KB":`${t}B`}const vr=t=>(t.startsWith("//")&&(t=`${new URL(window.location.href).protocol}${t}`),t.startsWith("http")?new URL(t):new URL(t,window.location.href));class Ef{constructor(e,n){this.resp=e,this.item=n,this.mockReader()}set(e,n,s){return Reflect.set(e,n,s)}get(e,n){const s=Reflect.get(e,n);switch(n){case"arrayBuffer":case"blob":case"formData":case"json":case"text":return()=>(this.item.responseType=n.toLowerCase(),s.apply(e).then(i=>(this.item.response=is(this.item.responseType,i),i)))}return typeof s=="function"?s.bind(e):s}mockReader(){let e;if(!this.resp.body||typeof this.resp.body.getReader!="function")return;const n=this.resp.body.getReader;this.resp.body.getReader=()=>{const s=n.apply(this.resp.body);if(this.item.readyState===at.DONE)return s;const i=s.read,r=s.cancel;return this.item.responseType="arraybuffer",s.read=()=>i.apply(s).then(a=>{if(!e)e=new Uint8Array(a.value);else{const l=new Uint8Array(e.length+a.value.length);l.set(e),l.set(a.value,e.length),e=l}return this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.readyState=a.done?4:3,this.item.statusText=a.done?String(this.item.status):"Loading",this.item.responseSize=e.length,this.item.responseSizeText=Js(this.item.responseSize),a.done&&(this.item.response=is(this.item.responseType,e)),a}),s.cancel=(...a)=>(this.item.cancelState=2,this.item.statusText="Cancel",this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=is(this.item.responseType,e),r.apply(s,a)),s}}}class If{constructor(e,n,s,i,r,a){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.sendMessage=i,this.isServiceUrl=r,this.tokenUrlMatcher=a}apply(e,n,s){const i=s[0],r=s[1];if(!i||typeof i!="string"&&!(i!=null&&i.url)||(i instanceof URL||typeof i=="string"?this.isServiceUrl(String(i)):this.isServiceUrl(String(i.url))))return e.apply(window,s);const l=new pr(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);return this.beforeFetch(l,i,r),this.setSessionTokenHeader((o,u)=>{if(!(this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(l.url))){if(s[1]===void 0&&s[0]instanceof Request)return s[0].headers.append(o,u);s[1]||(s[1]={}),s[1].headers===void 0&&(s[1]={...s[1],headers:{}}),s[1].headers instanceof Headers?s[1].headers.append(o,u):Array.isArray(s[1].headers)?s[1].headers.push([o,u]):s[1].headers[o]=u}}),e.apply(window,s).then(this.afterFetch(l)).catch(o=>{throw l.endTime=performance.now(),l.duration=l.endTime-(l.startTime||l.endTime),o})}beforeFetch(e,n,s){let i,r="GET",a={};if(typeof n=="string"?(r=(s==null?void 0:s.method)||"GET",i=vr(n),a=(s==null?void 0:s.headers)||{}):(r=n.method||"GET",i=vr(n.url),a=n.headers),e.method=r,e.requestType="fetch",e.requestHeader=a,e.url=i.toString(),e.name=(i.pathname.split("/").pop()||"")+i.search,e.status=0,e.statusText="Pending",e.readyState=1,e.startTime||(e.startTime=performance.now()),Object.prototype.toString.call(a)==="[object Headers]"){e.requestHeader={};for(const[l,o]of a)e.requestHeader[l]=o}else e.requestHeader=a;if(i.search&&i.searchParams){e.getData={};for(const[l,o]of i.searchParams)e.getData[l]=o}s!=null&&s.body&&(e.requestData=gr(s.body))}afterFetch(e){return n=>{e.endTime=performance.now(),e.duration=e.endTime-(e.startTime||e.endTime),e.status=n.status,e.statusText=String(n.status);let s=!1;e.header={};for(const[i,r]of n.headers)e.header[i]=r,s=r.toLowerCase().indexOf("chunked")>-1?!0:s;return s?e.readyState=3:(e.readyState=4,this.handleResponseBody(n.clone(),e).then(i=>{e.responseSize=typeof i=="string"?i.length:i.byteLength,e.responseSizeText=Js(e.responseSize),e.response=is(e.responseType,i);const r=e.getMessage();r&&this.sendMessage(r)}).catch(i=>{if(i.name!=="AbortError")throw i})),new Proxy(n,new Ef(n,e))}}handleResponseBody(e,n){const s=e.headers.get("content-type");return s&&s.includes("application/json")?(n.responseType="json",e.text()):s&&(s.includes("text/html")||s.includes("text/plain"))?(n.responseType="text",e.text()):(n.responseType="arraybuffer",e.arrayBuffer())}}class Cf{static create(e,n,s,i,r,a){return new Proxy(fetch,new If(e,n,s,i,r,a))}}class Nf{constructor(e,n,s,i,r,a,l){this.ignoredHeaders=n,this.setSessionTokenHeader=s,this.sanitize=i,this.sendMessage=r,this.isServiceUrl=a,this.tokenUrlMatcher=l,this.XMLReq=e,this.XMLReq.onreadystatechange=()=>{this.onReadyStateChange()},this.XMLReq.onabort=()=>{this.onAbort()},this.XMLReq.ontimeout=()=>{this.onTimeout()},this.item=new pr(n,s,i),this.item.requestType="xhr"}get(e,n){switch(n){case"open":return this.getOpen(e);case"send":return this.setSessionTokenHeader((i,r)=>{this.tokenUrlMatcher!==void 0&&!this.tokenUrlMatcher(this.item.url)||e.setRequestHeader(i,r)}),this.getSend(e);case"setRequestHeader":return this.getSetRequestHeader(e);default:const s=Reflect.get(e,n);return typeof s=="function"?s.bind(e):s}}set(e,n,s){switch(n){case"onreadystatechange":return this.setOnReadyStateChange(e,n,s);case"onabort":return this.setOnAbort(e,n,s);case"ontimeout":return this.setOnTimeout(e,n,s)}return Reflect.set(e,n,s)}onReadyStateChange(){if(!(this.item.url&&this.isServiceUrl(this.item.url))&&(this.item.readyState=this.XMLReq.readyState,this.item.responseType=this.XMLReq.responseType,this.item.endTime=performance.now(),this.item.duration=this.item.endTime-this.item.startTime,this.updateItemByReadyState(),setTimeout(()=>{this.item.response=is(this.item.responseType,this.item.response)},0),this.XMLReq.readyState===at.DONE)){const e=this.item.getMessage();e&&this.sendMessage(e)}}onAbort(){this.item.cancelState=1,this.item.statusText="Abort";const e=this.item.getMessage();e&&this.sendMessage(e)}onTimeout(){this.item.cancelState=3,this.item.statusText="Timeout";const e=this.item.getMessage();e&&this.sendMessage(e)}getOpen(e){const n=Reflect.get(e,"open");return(...s)=>{var a,l;const i=s[0],r=s[1];return this.item.method=i?i.toUpperCase():"GET",this.item.url=((a=r.toString)==null?void 0:a.call(r))||"",this.item.name=((l=this.item.url)==null?void 0:l.replace(new RegExp("/*$"),"").split("/").pop())??"",this.item.getData=Tf(this.item.url,{}),n.apply(e,s)}}getSend(e){const n=Reflect.get(e,"send");return(...s)=>{const i=s[0];return this.item.requestData=gr(i),n.apply(e,s)}}getSetRequestHeader(e){const n=Reflect.get(e,"setRequestHeader");return(...s)=>(this.item.requestHeader||(this.item.requestHeader={}),this.item.requestHeader[s[0]]=s[1],n.apply(e,s))}setOnReadyStateChange(e,n,s){return Reflect.set(e,n,(...i)=>{this.onReadyStateChange(),s==null||s.apply(e,i)})}setOnAbort(e,n,s){return Reflect.set(e,n,(...i)=>{this.onAbort(),s.apply(e,i)})}setOnTimeout(e,n,s){return Reflect.set(e,n,(...i)=>{this.onTimeout(),s.apply(e,i)})}updateItemByReadyState(){switch(this.XMLReq.readyState){case at.UNSENT:case at.OPENED:this.item.status=at.UNSENT,this.item.statusText="Pending",this.item.startTime||(this.item.startTime=performance.now());break;case at.HEADERS_RECEIVED:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.item.header={};const e=this.XMLReq.getAllResponseHeaders()||"",n=e.split(`
|
|
20
|
+
`);for(let s=0;s<n.length;s++){const i=n[s];if(!i)continue;const r=i.split(": "),a=r[0];this.item.header[a]=r.slice(1).join(": ")}break;case at.LOADING:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=Js(this.item.responseSize));break;case at.DONE:this.item.status=this.XMLReq.status||this.item.status||0,this.item.statusText=String(this.item.status),this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime),this.item.response=this.XMLReq.response,this.XMLReq.response&&this.XMLReq.response.length&&(this.item.responseSize=this.XMLReq.response.length,this.item.responseSizeText=Js(this.item.responseSize));break;default:this.item.status=this.XMLReq.status,this.item.statusText="Unknown";break}}}class Rf{static create(e,n,s,i,r,a){return new Proxy(XMLHttpRequest,{construct(l){const o=new l;return new Proxy(o,new Nf(o,e,n,s,i,r,a))}})}}const Df=t=>t instanceof Blob?t.type:t instanceof FormData?"multipart/form-data":t instanceof URLSearchParams?"application/x-www-form-urlencoded;charset=UTF-8":"text/plain;charset=UTF-8";class Of{constructor(e,n,s,i,r){this.ignoredHeaders=e,this.setSessionTokenHeader=n,this.sanitize=s,this.sendMessage=i,this.isServiceUrl=r}apply(e,n,s){const i=s[0],r=s[1],a=new pr(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);if(this.isServiceUrl(i))return e.apply(n,s);const l=vr(i);if(a.method="POST",a.url=i,a.name=(l.pathname.split("/").pop()||"")+l.search,a.requestType="beacon",a.requestHeader={"Content-Type":Df(r)},a.status=0,a.statusText="Pending",l.search&&l.searchParams){a.getData={};for(const[c,h]of l.searchParams)a.getData[c]=h}a.requestData=gr(r),a.startTime||(a.startTime=performance.now());const o=e.apply(n,s);o?(a.endTime=performance.now(),a.duration=a.endTime-(a.startTime||a.endTime),a.status=0,a.statusText="Sent",a.readyState=4):(a.status=500,a.statusText="Unknown");const u=a.getMessage();return u&&this.sendMessage(u),o}}class An{static hasSendBeacon(){return!!An.origSendBeacon}static create(e,n,s,i,r){if(An.hasSendBeacon())return new Proxy(An.origSendBeacon,new Of(e,n,s,i,r))}}An.origSendBeacon=(nl=window==null?void 0:window.navigator)==null?void 0:nl.sendBeacon;const Qa=t=>console.warn(`Openreplay: Can't find ${t} in global context.
|
|
21
|
+
If you're using serverside rendering in your app, make sure that tracker is loaded dynamically, otherwise ${t} won't be tracked.`);function Af(t,e,n,s,i,r,a){var l;t.XMLHttpRequest?t.XMLHttpRequest=Rf.create(e,n,s,i,r,a):Qa("XMLHttpRequest"),t.fetch?t.fetch=Cf.create(e,n,s,i,r,a):Qa("fetch"),(l=t==null?void 0:t.navigator)!=null&&l.sendBeacon&&(t.navigator.sendBeacon=An.create(e,n,s,i,r))}function br(t){return t.__or_req_data__||(t.__or_req_data__={body:void 0,headers:{}}),t.__or_req_data__}function Za(t){return typeof t=="string"?t.toUpperCase():"GET"}function Pf(t,e={}){const n=Object.assign({failuresOnly:!1,ignoreHeaders:["cookie","set-cookie","authorization"],capturePayload:!1,sessionTokenHeader:!1,captureInIframes:!0,axiosInstances:void 0,useProxy:!0},e);n.useProxy===!1&&t.debug.warn("Network module is migrating to proxy api, to gradually migrate and test it set useProxy to true");const s=n.ignoreHeaders,i=Array.isArray(s)?c=>s.includes(c):()=>s,r=n.sessionTokenHeader===!0?"X-OpenReplay-SessionToken":n.sessionTokenHeader;function a(c){if(r){const h=t.getSessionToken();h&&t.safe(c)(r,h)}}function l(c){if(n.capturePayload||(delete c.request.body,delete c.response.body),n.sanitizer){const h=c.response.body;if(typeof h=="string")try{c.response.body=JSON.parse(h)}catch{}return n.sanitizer(c)}return c}function o(c){if(c&&typeof c.body!="string")try{c.body=JSON.stringify(c.body)}catch{c.body="<unable to stringify>",t.notify.warn("Openreplay fetch couldn't stringify body:",c.body)}return JSON.stringify(c)}const u=c=>{if(n.useProxy)return Af(c,n.ignoreHeaders,a,l,E=>t.send(E),E=>t.isServiceURL(E),n.tokenUrlMatcher);const h=c.fetch.bind(c),f=(E,m={})=>{if(!(typeof E=="string"||E instanceof URL)||t.isServiceURL(String(E)))return h(E,m);a(function(T,x){m.headers===void 0&&(m.headers={}),m.headers instanceof Headers?m.headers.append(T,x):Array.isArray(m.headers)?m.headers.push([T,x]):m.headers[T]=x});const y=performance.now();return h(E,m).then(T=>{const x=performance.now()-y;if(n.failuresOnly&&T.status<400)return T;const S=T.clone();return S.text().then(_=>{const A={},W={};if(s!==!0){const R=([P,I])=>{i(P)||(A[P]=I)};m.headers instanceof Headers?m.headers.forEach((P,I)=>R([I,P])):Array.isArray(m.headers)?m.headers.forEach(R):typeof m.headers=="object"&&Object.entries(m.headers).forEach(R),S.headers.forEach((P,I)=>{i(I)||(W[I]=P)})}const D=Za(m.method),U=l({url:String(E),method:D,status:S.status,request:{headers:A,body:m.body||null},response:{headers:W,body:_}});U&&t.send(Bs("fetch",D,String(U.url),o(U.request),o(U.response),S.status,y+Nn(),x,0))}).catch(_=>t.debug.error("Could not process Fetch response:",_)),T})};c.fetch=f;const d=c.XMLHttpRequest.prototype.open,p=c.XMLHttpRequest.prototype.setRequestHeader,g=c.XMLHttpRequest.prototype.send;function v(E,m){const y=this;a((x,S)=>y.setRequestHeader(x,S));let T=0;return y.addEventListener("loadstart",x=>{T=x.timeStamp}),y.addEventListener("load",t.safe(x=>{const{headers:S,body:_}=br(y),A=T>0?x.timeStamp-T:0,D=(y.getAllResponseHeaders()||"").trim().split(/[\r\n]+/),U={};D.forEach(function(I){const O=I.split(": "),M=O.shift();i(M)||(U[M]=O.join(": "))});const R=Za(E),P=l({url:String(m),method:R,status:y.status,request:{headers:S,body:_||null},response:{headers:U,body:y.response}});P&&t.send(Bs("xhr",R,String(P.url),o(P.request),o(P.response),y.status,T+Nn(),A,0))})),d.apply(this,arguments)}function k(E){const m=br(this);return m.body=E,g.apply(this,arguments)}function C(E,m){if(!i(E)){const y=br(this);y.headers[E]=m}return p.apply(this,arguments)}n.axiosInstances||(c.XMLHttpRequest.prototype.open=v,c.XMLHttpRequest.prototype.send=k,c.XMLHttpRequest.prototype.setRequestHeader=C)};u(window),n.axiosInstances&&n.axiosInstances.forEach(c=>{Sf(t,c,n,l,o)}),n.captureInIframes&&t.observer.attachContextCallback(t.safe(u))}function Mf(t){t.attachEventListener(document,"selectionchange",()=>{const e=document.getSelection();if(e!==null&&!e.isCollapsed){const n=t.nodes.getID(e.anchorNode),s=t.nodes.getID(e.focusNode),i=e.toString().replace(/\s+/g," ");n&&s&&t.send(fa(n,s,i))}else t.send(fa(-1,-1,""))})}function Lf(t){function e(){document.hidden||(t.debug.log("Openreplay: tab change to"+t.session.getTabId()),t.send(Fs(t.session.getTabId())))}t.attachEventListener(window,"focus",e,!1,!1)}const Qs="/installation/javascript-sdk";function Bf(t){if(t==null)return console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${Ls}${Qs}`),!1;if(typeof t.projectKey!="string")if(typeof t.projectKey!="number"){if(typeof t.projectID!="number")return console.error(`OpenReplay: projectKey is missing or wrong type (string is expected). Please, check ${Ls}${Qs} for more information.`),!1;t.projectKey=t.projectID.toString(),Pt("`projectID` option","`projectKey` option",Qs)}else console.warn("OpenReplay: projectKey is expected to have a string type."),t.projectKey=t.projectKey.toString();return t.sessionToken!=null&&Pt("`sessionToken` option","`sessionHash` start() option","/"),!0}class Ff{constructor(e){var l;if(this.options=e,this.app=null,this.crossdomainMode=!1,this.checkDoNotTrack=()=>this.options.respectDoNotTrack&&(navigator.doNotTrack=="1"||window.doNotTrack=="1"),this.signalStartIssue=(o,u)=>{const c=this.checkDoNotTrack(),h=new XMLHttpRequest,f=this.options.ingestPoint||Ca;h.open("POST",f+"/v1/web/not-started"),h.send(JSON.stringify({trackerVersion:"14.0.4",projectKey:this.options.projectKey,doNotTrack:c,reason:u.length?`missing api: ${u.join(",")}`:o}))},this.restartCanvasTracking=()=>{this.app!==null&&this.app.restartCanvasTracking()},this.handleError=(o,u={})=>{if(this.app!==null){if(o instanceof Error){const c=qs(o,[],u);this.app.send(c)}else if(o instanceof ErrorEvent||"PromiseRejectionEvent"in window&&o instanceof PromiseRejectionEvent){const c=La(o,void 0,u);c!=null&&this.app.send(c)}}},this.crossdomainMode=!!(uu()&&((l=e.crossdomain)!=null&&l.enabled)),!rt||!Bf(e))return;if(window.__OPENREPLAY__){console.error("OpenReplay: one tracker instance has been initialised already");return}if(!e.__DISABLE_SECURE_MODE&&location.protocol!=="https:"){console.error("OpenReplay: Your website must be publicly accessible and running on SSL in order for OpenReplay to properly capture and replay the user session. You can disable this check by setting `__DISABLE_SECURE_MODE` option to `true` if you are testing in localhost. Keep in mind, that asset files on a local machine are not available to the outside world. This might affect tracking if you use css files.");return}const n=this.checkDoNotTrack(),s=[],i=["Map","Set","MutationObserver","performance","timing","startsWith","Blob","Worker"];if(n)s.push("doNotTrack");else for(const o of i)if(o==="timing"){if("performance"in window&&!(o in performance)){s.push(o);break}}else if(o==="startsWith"){if(!(o in String.prototype)){s.push(o);break}}else if(!(o in window)){s.push(o);break}if(s.length>0){const o=s.join(",");console.error(`OpenReplay: browser doesn't support API required for tracking or doNotTrack is set to 1. Reason: ${o}`),this.signalStartIssue("missing_api",s);return}const r=new Ah(e.projectKey,e.sessionToken,e,this.signalStartIssue,this.crossdomainMode);this.app=r,this.crossdomainMode||(gf(r),Ph(r),Ku(r,e),Lf(r)),uf(r,e.mouse),pf(r,this.crossdomainMode),bf(r),vf(r),Fh(r,e),Hh(r,e),Gh(r),Qh(r,e),df(r,e),wf(r),yf(r),Pf(r,e.network),Mf(r),window.__OPENREPLAY__=this,e.flags&&e.flags.onFlagsLoad&&this.onFlagsLoad(e.flags.onFlagsLoad);const a=window.open;(e.autoResetOnWindowOpen||e.resetTabOnWindowOpen)&&(r.attachStartCallback(()=>{const o=r.getTabId(),u=r.sessionStorage??window.sessionStorage;window.open=function(...c){return e.autoResetOnWindowOpen&&r.resetNextPageSession(!0),e.resetTabOnWindowOpen&&u.removeItem(e.session_tabid_key||"__openreplay_tabid"),r.resetNextPageSession(!1),u.setItem(e.session_tabid_key||"__openreplay_tabid",o),a.call(window,...c)}}),r.attachStopCallback(()=>{window.open=a}))}isFlagEnabled(e){return this.featureFlags.isFlagEnabled(e)}onFlagsLoad(e){var n;(n=this.app)==null||n.featureFlags.onFlagsLoad(e)}clearPersistFlags(){var e;(e=this.app)==null||e.featureFlags.clearPersistFlags()}reloadFlags(){var e;return(e=this.app)==null?void 0:e.featureFlags.reloadFlags()}getFeatureFlag(e){var n;return(n=this.app)==null?void 0:n.featureFlags.getFeatureFlag(e)}getAllFeatureFlags(){var e;return(e=this.app)==null?void 0:e.featureFlags.flags}use(e){return e(this.app,this.options)}isActive(){return this.app===null?!1:this.app.active()}trackWs(e){if(this.app!==null)return this.app.trackWs(e)}start(e){return this.browserEnvCheck()?this.app===null?Promise.reject("Browser doesn't support required api, or doNotTrack is active."):this.app.start(e):Promise.reject("Trying to start not in browser.")}browserEnvCheck(){return rt?!0:(console.error(`OpenReplay: you are trying to start Tracker on a node.js environment. If you want to use OpenReplay with SSR, please, use componentDidMount or useEffect API for placing the \`tracker.start()\` line. Check documentation on ${Ls}${Qs}`),!1)}coldStart(e,n){if(this.browserEnvCheck()){if(this.app===null)return Promise.reject("Tracker not initialized");this.app.coldStart(e,n)}else return Promise.reject("Trying to start not in browser.")}startOfflineRecording(e,n){return this.browserEnvCheck()?this.app===null?Promise.reject("Tracker not initialized"):this.app.offlineRecording(e,n):Promise.reject("Trying to start not in browser.")}uploadOfflineRecording(){if(this.app!==null)return this.app.uploadOfflineRecording()}stop(){if(this.app!==null)return this.app.stop(),this.app.session.getSessionHash()}forceFlushBatch(){this.app!==null&&this.app.forceFlushBatch()}getSessionToken(){return this.app===null?null:this.app.getSessionToken()}getSessionInfo(){return this.app===null?null:this.app.session.getInfo()}getSessionID(){return this.app===null?null:this.app.getSessionID()}getTabId(){return this.app===null?null:this.app.getTabId()}getUxId(){return this.app===null?null:this.app.getUxtId()}sessionID(){return Pt("'sessionID' method","'getSessionID' method","/"),this.getSessionID()}getSessionURL(e){if(this.app!==null)return this.app.getSessionURL(e)}setUserID(e){typeof e=="string"&&this.app!==null&&this.app.session.setUserID(e)}userID(e){Pt("'userID' method","'setUserID' method","/"),this.setUserID(e)}setUserAnonymousID(e){typeof e=="string"&&this.app!==null&&this.app.send(Du(e))}userAnonymousID(e){Pt("'userAnonymousID' method","'setUserAnonymousID' method","/"),this.setUserAnonymousID(e)}setMetadata(e,n){typeof e=="string"&&typeof n=="string"&&this.app!==null&&this.app.session.setMetadata(e,n)}metadata(e,n){Pt("'metadata' method","'setMetadata' method","/"),this.setMetadata(e,n)}event(e,n=null,s=!1){if(typeof e=="string"&&this.app!==null){if(s)return this.issue(e,n);try{n=JSON.stringify(n)}catch{return}this.app.send(Nu(e,n))}}issue(e,n=null){if(typeof e=="string"&&this.app!==null){try{n=JSON.stringify(n)}catch{return}this.app.send(Bu(e,n))}}}function Wf(t){return{id:String(t.ID),appellation:t.Appellation||null,country:t.Country||null,grape:t.Grape,image:t.Image,price:Number(t.Price),producer:t.Producer||null,region:t.Region,score:t.Score?Number(t.Score):null,shortDescription:t["Short Description"]||null,store:t.Store,storeId:t.Store_id||null,tags:Array.isArray(t.Tags)?t.Tags.map(String):[],title:t.Title,type:t.Type,url:t.Url||null,vintage:t.Vintage?Number(t.Vintage):null,pairingRecommendation:t.pairing_recommendation||null,total:t.Total?Number(t.Total):null,itemId:t.item_id||null,isPromote:t.is_promote?!!t.is_promote:null,stock:t.stock?Number(t.stock):null}}function jf(t){return{id:String(t.id),title:String(t.title),description:String(t.description),region:String(t.region),price:Number(t.price),grape:String(t.grape),appellation:t.appellation?String(t.appellation):null,url:t.url?String(t.url):null,store:String(t.store),storeId:t.storeId?String(t.storeId):null,image:String(t.image),country:t.country?String(t.country):null,vintage:t.vintage?Number(t.vintage):null,tags:Array.isArray(t.tags)?t.tags.map(String):[],score:t.score?Number(t.score):null,total:t.total?Number(t.total):null,isPromote:t.is_promote?!!t.is_promote:null,stock:t.stock?Number(t.stock):null,distance:Number(t.distance),reason:String(t.reason),type:String(t.type)}}class zf{constructor(e){z(this,jn,"https://wineater-backend.vercel.app/");z(this,ln,void 0);j(this,ln,e)}async getInstantRecommendations(){try{const e=await fetch(`${b(this,jn)}dish/recommendations/instant`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b(this,ln)}`}}),n=await e.json();if(!e.ok)throw new Error(`API call failed with status ${e.status}: ${n.message||"No additional error information"}`);return n.map(Wf)}catch(e){throw new Error(`Error in getInstantRecommendations: ${e.message}`)}}async getWineRecommendationsSearch(e){try{const n=await fetch(`${b(this,jn)}dish/recommendations/search`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b(this,ln)}`},body:JSON.stringify({text:e})}),s=await n.json();if(!n.ok)throw new Error(`API call failed with status ${n.status}: ${s.message||"No additional error information"}`);return s.map(jf)}catch(n){throw new Error(`Error in getWineRecommendations: ${n.message}`)}}async getStoreConfig(){try{const e=await fetch(`${b(this,jn)}stores/store`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b(this,ln)}`}});if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return await e.json()}catch(e){throw console.error("Error fetching store configuration:",e),e}}}jn=new WeakMap,ln=new WeakMap;const Uf=((sl=window==null?void 0:window.wineaterData)==null?void 0:sl.CLIENT_TOKEN)||"HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG",wr=new zf(Uf),lt={WIDGET_INITIALIZED:"widget_initialized",WIDGET_LOADED:"widget_loaded",SEARCH_PERFORMED:"search_performed",SEARCH_RESULTS_DISPLAYED:"search_results_displayed",NO_RESULTS_FOUND:"no_results_found",WINE_CARD_HOVER:"wine_card_hover",WINE_CARD_CLICK:"wine_card_click",WINE_DETAILS_VIEWED:"wine_details_viewed",WINE_DETAILS_CLOSED:"wine_details_closed",BUY_BUTTON_CLICKED:"buy_button_clicked",FILTER_APPLIED:"filter_applied",LANGUAGE_CHANGED:"language_changed",ERROR_OCCURRED:"error_occurred",MOBILE_VIEW_ACTIVATED:"mobile_view_activated"},Hf={fr:{lang:"fr",welcomeMessage:"Quel plat allez-vous déguster ? Décrivez-le-moi et je vous proposerai le vin qui l'accompagnera parfaitement.",noResultsFound:"Aucun résultat trouvé.",somethingWentWrong:"Désolé, quelque chose a mal tourné.",chatButton1:"Trouvez l'accord parfait",chatButton2:"Associez le vin",chatButton3:"Obtenez des conseils",chatTitle:"Accord Mets & Vins 🍷",chatSubtitle:"Décrivez votre plat et obtenez une recommandation en 30 secondes",inputPlaceholder:"ex., Salade de thon",sendButton:"Accorder",poweredBy:"Propulsé par",price:"Prix",region:"Région",type:"Type",reason:"Suggestion",moreInfo:"Plus d'infos",winePairingIntro:"Pour ce vin, voici quelques suggestions de plats :",askForDinner:"Que voulez-vous manger ce soir?",clearChatButton:"Effacer le chat",widgetTitle:"TROUVEZ VOTRE VIN PARFAIT",widgetSubtitle:"Partagez tout ce que vous avez en tête—votre repas, humeur, budget ou occasion—et notre sommelier IA vous recommandera le vin parfait en quelques secondes",searchPlaceholder:"Entrez un mot-clé ou une description","wineDetails.reason":"Raison","wineDetails.price":"Prix","wineDetails.region":"Région","wineDetails.type":"Type","wineDetails.moreInfo":"Plus d'infos","wineDetails.code":"Code","wineDetails.buy":"Acheter",searchButton:"Rechercher",priceRange:"Gamme de prix",wineColor:"Couleur du vin",intensity:"Intensité",red:"Rouge",white:"Blanc",rose:"Rosé",light:"Léger",medium:"Moyen",full:"Puissant",barTitle:"Sélection du bar",barSubtitle:"Choisissez vos plats ci-dessous et cliquez sur «Envoyer»",barSendButton:"Envoyer",barResetButton:"Réinitialiser",barName:"Nom du bar",barNotesPlaceholder:"Entrez vos souhaits ici...",placeholderSuggestions:["Vin pour les pâtes","Parfait avec du poisson","Recommandé pour une soirée"],headerLine1:"Partagez tout ce qui vous passe par la tête —",headerLine2:"— et obtenez des recommandations de vin parfait en quelques secondes",headerMeal:"repas",headerMood:"humeur",headerBudget:"budget",headerOccasion:"occasion",headerOr:"ou",errorMessage:"Une erreur est survenue. Veuillez réessayer plus tard.",noResultsMessage:"Aucun résultat trouvé pour votre recherche. Veuillez essayer une autre requête.",ai_sommelier:"AI sommelier"},es:{lang:"es",welcomeMessage:"¿Qué vas a comer? Cuéntame tu plato y te recomendaré el maridaje perfecto.",noResultsFound:"No se encontraron resultados.",somethingWentWrong:"Lo sentimos, algo salió mal.",chatButton1:"Encuentra tu maridaje",chatButton2:"Combina vino ya",chatButton3:"Recibe asesoría ahora",chatTitle:"Maridaje de Vinos 🍷",chatSubtitle:"Describe tu comida y obtén una recomendación en 30 segundos",inputPlaceholder:"ej., Ensalada de atún",sendButton:"Combinar",poweredBy:"Desarrollado por",price:"Precio",region:"Región",type:"Tipo",reason:"Sugerencia",moreInfo:"Más info",winePairingIntro:"Para este vino, aquí tienes algunas sugerencias de platos:",askForDinner:"¿Qué te gustaría cenar?",clearChatButton:"Limpiar el chat",widgetTitle:"ENCUENTRA TU VINO PERFECTO",widgetSubtitle:"Comparte cualquier cosa que tengas en mente—tu comida, estado de ánimo, presupuesto o evento—y nuestro sommelier de IA te recomendará el vino perfecto en segundos",searchPlaceholder:"Escribe una palabra clave o descripción","wineDetails.reason":"Razón","wineDetails.price":"Precio","wineDetails.region":"Región","wineDetails.type":"Tipo","wineDetails.code":"Código","wineDetails.moreInfo":"Más información","wineDetails.buy":"Comprar",searchButton:"Buscar",priceRange:"Rango de precios",wineColor:"Color del vino",intensity:"Intensidad",red:"Tinto",white:"Blanco",rose:"Rosado",light:"Ligero",medium:"Medio",full:"Intenso",barTitle:"Platos de Bar",barSubtitle:"Selecciona de la lista y presiona «Enviar»",barSendButton:"Enviar",barResetButton:"Reiniciar",barName:"Nombre del bar",barNotesPlaceholder:"Agrega tus comentarios aquí...",placeholderSuggestions:["Vino para pasta","Perfecto con pescado","Recomendado para una fiesta"],headerLine1:"Comparte cualquier cosa que tengas en mente —",headerLine2:"— y obtén recomendaciones del vino perfecto en cuestión de segundos",headerMeal:"comida",headerMood:"estado de ánimo",headerBudget:"presupuesto",headerOccasion:"ocasión",headerOr:"o",errorMessage:"Algo salió mal. Por favor, inténtalo de nuevo más tarde.",noResultsMessage:"No se encontraron resultados para tu búsqueda. Por favor, intenta con otra consulta.",ai_sommelier:"AI sommelier"},en:{lang:"en",welcomeMessage:"What are you planning to eat? Share your dish and I'll recommend the perfect wine pairing for your meal.",noResultsFound:"No results found.",somethingWentWrong:"Sorry, something went wrong.",chatButton1:"Find Your Pairing",chatButton2:"Pair Wine Now",chatButton3:"Get Wine Advice",chatTitle:"Wine Pairing Assistant 🍷",chatSubtitle:"Describe your meal and get a recommendation in 30 seconds",inputPlaceholder:"e.g., Tuna salad",sendButton:"Match",poweredBy:"Powered by",price:"Price",region:"Region",type:"Type",reason:"Suggestion",moreInfo:"More info",winePairingIntro:"For this wine, here are some suggested dishes:",askForDinner:"What would you like to have for dinner?",clearChatButton:"Clear Chat",widgetTitle:"FIND YOUR PERFECT WINE",widgetSubtitle:"Share anything on your mind—your meal, mood, budget, or occasion—and our AI sommelier will recommend the perfect wine in seconds",searchPlaceholder:"Enter a keyword or description","wineDetails.price":"Price","wineDetails.region":"Region","wineDetails.type":"Type","wineDetails.moreInfo":"More info","wineDetails.reason":"Reason","wineDetails.code":"Code","wineDetails.buy":"Buy",searchButton:"Search",priceRange:"Price Range",wineColor:"Wine Color",intensity:"Intensity",red:"Red",white:"White",rose:"Rosé",light:"Light",medium:"Medium",full:"Full",barTitle:"Bar Dishes",barSubtitle:"Select dishes below and click 'Send'",barSendButton:"Send",barResetButton:"Reset",barName:"Bar Name",barNotesPlaceholder:"Add your wishes here...",placeholderSuggestions:["Wine for pasta","Perfect with fish","Recommended for a party"],headerLine1:"Share anything on your mind —",headerLine2:"— and get recommendations of the perfect wine in seconds",headerMeal:"meal",headerMood:"mood",headerBudget:"budget",headerOccasion:"occasion",headerOr:"or",errorMessage:"Something went wrong. Please try again later.",noResultsMessage:"No results found for your search. Please try a different query.",ai_sommelier:"AI sommelier"},sr:{lang:"sr",welcomeMessage:"Šta planirate da jedete? Podelite svoje jelo i preporučiću vam savršeno vino uz obrok.",noResultsFound:"Nema rezultata.",somethingWentWrong:"Izvinite, nešto je pošlo po zlu.",chatButton1:"Pronađi vino",chatButton2:"Upari vino sada",chatButton3:"Zatraži preporuku",chatTitle:"Asistent za uparivanje vina 🍷",chatSubtitle:"Opišite svoj obrok i dobijte preporuku za 30 sekundi",inputPlaceholder:"npr. Tuna salata",sendButton:"Upari",poweredBy:"Pokreće",price:"Cena",region:"Regija",type:"Tip",reason:"Preporuka",moreInfo:"Više informacija",winePairingIntro:"Za ovo vino, preporučuju se sledeća jela:",askForDinner:"Šta biste želeli za večeru?",clearChatButton:"Obriši razgovor",widgetTitle:"PRONAĐITE SAVRŠENO VINO",widgetSubtitle:"Podelite bilo šta — obrok, raspoloženje, budžet ili priliku — i naš AI somelijer će vam za par sekundi preporučiti vino",searchPlaceholder:"Unesite ključnu reč ili opis","wineDetails.price":"Cena","wineDetails.region":"Regija","wineDetails.type":"Tip","wineDetails.moreInfo":"Više informacija","wineDetails.reason":"Razlog","wineDetails.code":"Šifra","wineDetails.buy":"Kupi",searchButton:"Pretraga",priceRange:"Cenovni raspon",wineColor:"Boja vina",intensity:"Intenzitet",red:"Crveno",white:"Belo",rose:"Roze",light:"Lako",medium:"Srednje",full:"Puno",barTitle:"Jela iz bara",barSubtitle:"Izaberite jela ispod i kliknite 'Pošalji'",barSendButton:"Pošalji",barResetButton:"Resetuj",barName:"Naziv bara",barNotesPlaceholder:"Dodajte svoje želje ovde...",placeholderSuggestions:["Vino uz pastu","Savršeno uz ribu","Preporuka za žurku"],headerLine1:"Podelite bilo šta što vam je na umu —",headerLine2:"— i dobijte preporuke za savršeno vino za par sekundi",headerMeal:"obrok",headerMood:"raspoloženje",headerBudget:"budžet",headerOccasion:"prilika",headerOr:"ili",errorMessage:"Nešto je pošlo po zlu. Molimo pokušajte ponovo kasnije.",noResultsMessage:"Nema rezultata za vašu pretragu. Molimo pokušajte sa drugačijim upitom.",ai_sommelier:"AI sommelier"},de:{lang:"de",welcomeMessage:"Was möchten Sie essen? Beschreiben Sie Ihr Gericht und ich empfehle Ihnen den perfekten Wein dazu.",noResultsFound:"Keine Ergebnisse gefunden.",somethingWentWrong:"Entschuldigung, etwas ist schief gelaufen.",chatButton1:"Finde Dein Pairing",chatButton2:"Wein jetzt wählen",chatButton3:"Erhalte Weinberatung",chatTitle:"Wein & Speisen 🍷",chatSubtitle:"Beschreiben Sie Ihr Gericht und erhalten Sie in 30 Sekunden eine Empfehlung",inputPlaceholder:"z.B., Thunfischsalat",sendButton:"Kombinieren",poweredBy:"Unterstützt von",price:"Preis",region:"Region",type:"Typ",reason:"Anregung",moreInfo:"Mehr Info",winePairingIntro:"Für diesen Wein gibt es folgende Essensvorschläge:",askForDinner:"Was möchten Sie zum Abendessen essen?",clearChatButton:"Chat löschen",widgetTitle:"FINDEN SIE IHREN PERFEKTEN WEIN",widgetSubtitle:"Teilen Sie alles, was Ihnen in den Sinn kommt—Ihre Mahlzeit, Stimmung, Ihr Budget oder Anlass—und unser KI-Sommelier empfiehlt Ihnen in Sekunden den perfekten Wein",placeholderSuggestions:["Wein für Pasta","Perfekt zu Fisch","Empfohlen für eine Party"],searchPlaceholder:"Geben Sie ein Stichwort oder eine Beschreibung ein","wineDetails.price":"Preis","wineDetails.region":"Region","wineDetails.type":"Typ","wineDetails.moreInfo":"Mehr Info","wineDetails.reason":"Grund","wineDetails.code":"Code","wineDetails.buy":"Kaufen",searchButton:"Suche",priceRange:"Preisspanne",wineColor:"Weinfarbe",intensity:"Intensität",red:"Rot",white:"Weiß",rose:"Rosé",light:"Leicht",medium:"Mittel",full:"Voll",barTitle:"Bar-Auswahl",barSubtitle:"Wählen Sie Ihre Gerichte und klicken Sie auf 'Senden'",barSendButton:"Senden",barResetButton:"Zurücksetzen",barName:"Name der Bar",headerLine1:"Teilen Sie alles, was Ihnen durch den Kopf geht —",headerLine2:"— und erhalten Sie in Sekundenschnelle Empfehlungen für den perfekten Wein",headerMeal:"Mahlzeit",headerMood:"Stimmung",headerBudget:"Budget",headerOccasion:"Anlass",headerOr:"oder",errorMessage:"Etwas ist schief gelaufen. Bitte versuchen Sie es später erneut.",noResultsMessage:"Keine Ergebnisse für Ihre Suche gefunden. Bitte versuchen Sie es mit einer anderen Anfrage.",ai_sommelier:"AI sommelier"},ukr:{lang:"ukr",welcomeMessage:"Що ви збираєтесь їсти? Опишіть свою страву, і я порекомендую вам ідеальне вино.",noResultsFound:"Результатів не знайдено.",somethingWentWrong:"Вибачте, щось пішло не так.",chatButton1:"Знайти ідеальне поєднання",chatButton2:"Підібрати вино",chatButton3:"Отримати пораду",chatTitle:"Сомельє-помічник 🍷",chatSubtitle:"Опишіть свою страву і отримайте рекомендацію за 30 секунд",inputPlaceholder:"наприклад, Тунець із салатом",sendButton:"Підібрати",poweredBy:"Розроблено на основі",price:"Ціна",region:"Регіон",type:"Тип",reason:"Рекомендація",moreInfo:"Докладніше",winePairingIntro:"До цього вина підходять такі страви:",askForDinner:"Що ви хочете на вечерю?",clearChatButton:"Очистити чат",widgetTitle:"ЗНАЙДІТЬ ІДЕАЛЬНЕ ВИНО",widgetSubtitle:"Поділіться тим, що у вас на думці—їжа, настрій, бюджет чи подія—і наш AI-сомельє порекомендує вам ідеальне вино за секунди",searchPlaceholder:"Введіть ключове слово або опис","wineDetails.reason":"Причина","wineDetails.price":"Ціна","wineDetails.region":"Регіон","wineDetails.type":"Тип","wineDetails.moreInfo":"Докладніше","wineDetails.code":"Код","wineDetails.buy":"Купити",searchButton:"Пошук",priceRange:"Діапазон цін",wineColor:"Колір вина",intensity:"Інтенсивність",red:"Червоне",white:"Біле",rose:"Рожеве",light:"Легке",medium:"Середнє",full:"Повне",barTitle:"Закуски до вина",barSubtitle:"Виберіть страви нижче та натисніть «Надіслати»",barSendButton:"Надіслати",barResetButton:"Скинути",barName:"Назва бару",barNotesPlaceholder:"Додайте ваші побажання тут...",placeholderSuggestions:["Вино до пасти","Ідеально до риби","Рекомендуємо для вечірки"],headerLine1:"Поділіться будь-якими вашими думками —",headerLine2:"— і отримайте рекомендації щодо ідеального вина за секунди",headerMeal:"страва",headerMood:"настрій",headerBudget:"бюджет",headerOccasion:"подія",headerOr:"або",errorMessage:"Щось пішло не так. Будь ласка, спробуйте пізніше.",noResultsMessage:"За вашим запитом не знайдено результатів. Спробуйте інший запит.",ai_sommelier:"AI sommelier"},ru:{lang:"ru",welcomeMessage:"Что вы планируете поесть? Напишите ваше блюдо, и я подберу идеальное вино к нему.",noResultsFound:"Результаты не найдены.",somethingWentWrong:"Извините, что-то пошло не так.",chatButton1:"Найти сочетание",chatButton2:"Подобрать вино",chatButton3:"Получить совет",chatTitle:"Ассистент по подбору вина 🍷",chatSubtitle:"Опишите ваше блюдо и получите рекомендацию за 30 секунд",inputPlaceholder:"например, Тунец с салатом",sendButton:"Подобрать",poweredBy:"Powered by",price:"Цена",region:"Регион",type:"Тип",reason:"Рекомендация",moreInfo:"Подробнее",winePairingIntro:"К этому вину подходят следующие блюда:",askForDinner:"Что бы вы хотели на ужин?",clearChatButton:"Очистить чат",widgetTitle:"НАЙДИТЬ ИДЕАЛЬНОЕ ВИНО",widgetSubtitle:"Поделитесь вашими предпочтениями — блюдом, настроением, бюджетом или случаем — и наш AI-сомелье подберёт идеальное вино за секунды",searchPlaceholder:"Введите ключевое слово или описание","wineDetails.price":"Цена","wineDetails.region":"Регион","wineDetails.type":"Тип","wineDetails.moreInfo":"Подробнее","wineDetails.reason":"Причина","wineDetails.code":"Код","wineDetails.buy":"Купить",searchButton:"Поиск",priceRange:"Диапазон цен",wineColor:"Цвет вина",intensity:"Интенсивность",red:"Красное",white:"Белое",rose:"Розовое",light:"Лёгкое",medium:"Среднее",full:"Полное",barTitle:"Закуски к вину",barSubtitle:"Выберите блюда ниже и нажмите 'Отправить'",barSendButton:"Отправить",barResetButton:"Сбросить",barName:"Название бара",barNotesPlaceholder:"Добавьте ваши пожелания здесь...",placeholderSuggestions:["Вино для пасты","Идеально к рыбе","Рекомендуем для вечеринки"],headerLine1:"Поделитесь любыми вашими мыслями —",headerLine2:"— и получите рекомендации по идеальному вину за считанные секунды",headerMeal:"блюдо",headerMood:"настроение",headerBudget:"бюджет",headerOccasion:"случай",headerOr:"или",errorMessage:"Что-то пошло не так. Пожалуйста, попробуйте позже.",noResultsMessage:"По вашему запросу не найдено результатов. Попробуйте другой запрос.",ai_sommelier:"AI sommelier"},kk:{lang:"kk",welcomeMessage:"Сіз не жегіңіз келеді? Тағамыңызды сипаттаңыз, мен оған керемет шарап ұсынамын.",noResultsFound:"Нәтижелер табылмады.",somethingWentWrong:"Кешіріңіз, бірдеңе дұрыс болмады.",chatButton1:"Сәйкестік табу",chatButton2:"Шарап таңдау",chatButton3:"Кеңес алу",chatTitle:"Шарап таңдаушы көмекші 🍷",chatSubtitle:"Тағамыңызды сипаттаңыз — 30 секундта ұсыныс алыңыз",inputPlaceholder:"мысалы, тунец салатымен",sendButton:"Таңдау",poweredBy:"Powered by",price:"Бағасы",region:"Өңір",type:"Түрі",reason:"Ұсыныс",moreInfo:"Толығырақ",winePairingIntro:"Бұл шарапқа келесі тағамдар сәйкес келеді:",askForDinner:"Кешкі асқа не қалайсыз?",clearChatButton:"Чатты тазалау",widgetTitle:"КЕРЕМЕТ ШАРАПТЫ ТАБЫҢЫЗ",widgetSubtitle:"Таңдауларыңызды бөлісіңіз — тағам, көңіл-күй, бюджет немесе жағдай — және біздің AI-сомелье сізге бірнеше секундта шарап ұсынады",searchPlaceholder:"Кілт сөзді немесе сипаттаманы енгізіңіз","wineDetails.price":"Бағасы","wineDetails.region":"Өңір","wineDetails.type":"Түрі","wineDetails.moreInfo":"Толығырақ","wineDetails.reason":"Себебі","wineDetails.code":"Код","wineDetails.buy":"Сатып алу",searchButton:"Іздеу",priceRange:"Баға диапазоны",wineColor:"Шарап түсі",intensity:"Қанықтылық",red:"Қызыл",white:"Ақ",rose:"Розалық",light:"Жеңіл",medium:"Орташа",full:"Толық",barTitle:"Шарапқа арналған тіскебасарлар",barSubtitle:"Төмендегі тағамдарды таңдаңыз және 'Жіберу' батырмасын басыңыз",barSendButton:"Жіберу",barResetButton:"Қалпына келтіру",barName:"Бар атауы",barNotesPlaceholder:"Мұнда өз тілектеріңізді жазыңыз...",placeholderSuggestions:["Пастаға арналған шарап","Балыққа тамаша үйлеседі","Кешке ұсынуға болады"],headerLine1:"Ойларыңызбен бөлісіңіз —",headerLine2:"— және бірнеше секундта мінсіз шарап ұсынысын алыңыз",headerMeal:"тағам",headerMood:"көңіл-күй",headerBudget:"бюджет",headerOccasion:"жағдай",headerOr:"немесе",errorMessage:"Бірдеңе дұрыс болмады. Кейінірек қайта көріңіз.",noResultsMessage:"Іздеуіңізге сәйкес нәтиже табылмады. Басқа сұрау қолданып көріңіз.",ai_sommelier:"AI sommelier"}};function qf(t){return{id:String(t.id),lang:t.lang,available_languages:t.available_languages?t.available_languages:[t.lang],open_ai_key:t.open_ai_key??null,currency:t.currency,title:t.title}}const Vf={0:{logoUrl:null,brandColor:"#7B2BEB"},25:{logoUrl:null,brandColor:"#000000",wineaterColor:"#000000",buttonUppercase:!0,customCss:`
|
|
22
|
+
@import url('https://use.typekit.net/qao2vak.css');
|
|
23
|
+
:root { --wineater-font-primary: 'termina', sans-serif; }
|
|
24
24
|
#wr-Custom {
|
|
25
25
|
.wr-Search-input {
|
|
26
26
|
border-color: #7c7c7c;
|
|
27
27
|
color: #7c7c7c;
|
|
28
|
-
}
|
|
29
|
-
.wr-Search-input::placeholder { color: #000000; }
|
|
30
|
-
.wr-Search-button {
|
|
31
|
-
background: #000000;
|
|
32
|
-
}
|
|
28
|
+
}
|
|
33
29
|
.wr-Search-button:hover {
|
|
34
30
|
background: #E3BE8D;
|
|
35
31
|
opacity: 1;
|
|
@@ -42,7 +38,6 @@ If you're using serverside rendering in your app, make sure that tracker is load
|
|
|
42
38
|
.wr-WineTilePopup-reason {
|
|
43
39
|
color: #000000;
|
|
44
40
|
}
|
|
45
|
-
|
|
46
41
|
.wr-WineTilePopup-tag {
|
|
47
42
|
color: #000000;
|
|
48
43
|
background: rgba(239,239,239,0.7);
|
|
@@ -50,8 +45,6 @@ If you're using serverside rendering in your app, make sure that tracker is load
|
|
|
50
45
|
}
|
|
51
46
|
|
|
52
47
|
.wr-WineTile-action {
|
|
53
|
-
color: #000000;
|
|
54
|
-
border-color: #000000;
|
|
55
48
|
background: transparent;
|
|
56
49
|
}
|
|
57
50
|
|
|
@@ -61,10 +54,10 @@ If you're using serverside rendering in your app, make sure that tracker is load
|
|
|
61
54
|
box-shadow: none;
|
|
62
55
|
}
|
|
63
56
|
}
|
|
64
|
-
`,translations:{fr:{"wineDetails.buy":"voir plus"}}},21:{logoUrl:"https://www.intermarche.com/images/logoIntermarche.svg",
|
|
57
|
+
`,translations:{fr:{"wineDetails.buy":"voir plus"}}},21:{logoUrl:"https://www.intermarche.com/images/logoIntermarche.svg",brandColor:"#B81242",wineaterColor:"#7B2BEB",buttonUppercase:!0,customCss:"",translations:{}}};function Gf(t){const e={logoUrl:null,brandColor:"#7B2BEB",wineaterColor:"#7B2BEB",customCss:`
|
|
65
58
|
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&display=swap');
|
|
66
59
|
:root { --wineater-font-primary: 'Bricolage Grotesque', serif; }
|
|
67
|
-
`},n=
|
|
60
|
+
`},n=Vf[t]||{};return{...e,...n}}let le=et({storeConfig:null,currentLanguage:"en",isConfigLoaded:!1,uiConfig:null});const ve={getLanguageFromURL(){return new URLSearchParams(window.location.search).get("lang")},getAppLanguage(){return(le==null?void 0:le.currentLanguage)??"en"},getStoreLanguage(){var t;return((t=le.storeConfig)==null?void 0:t.lang)??null},getApiKey(){var t;return((t=le.storeConfig)==null?void 0:t.open_ai_key)??null},getStoreId(){var t;return((t=le.storeConfig)==null?void 0:t.id)??null},setStoreLanguage(t){if(le.storeConfig&&le.storeConfig.available_languages.includes(t)){le.currentLanguage=t;const e=new URLSearchParams(window.location.search);e.set("lang",t);const n=`${window.location.pathname}?${e.toString()}`;window.history.replaceState({},"",n)}else throw new Error(`Language ${t} is not available in store configuration.`)},getSupportedLanguages(){var t;return((t=le.storeConfig)==null?void 0:t.available_languages)??["en"]},getCurrency(){var t;return((t=le.storeConfig)==null?void 0:t.currency)??"USD"},async initializeStore(){try{const t=await wr.getStoreConfig();le.storeConfig=qf(t),le.currentLanguage=le.storeConfig.lang;const e=this.getLanguageFromURL();e&&le.storeConfig.available_languages.includes(e)?this.setStoreLanguage(e):this.setStoreLanguage(le.storeConfig.lang),this.setUiConfig(Gf(le.storeConfig.id)),le.isConfigLoaded=!0}catch(t){console.error("Failed to initialize store:",t),le.isConfigLoaded=!1}},isInitialized(){return le.isConfigLoaded},getUiConfig(){return le.uiConfig},setUiConfig(t){le.uiConfig=t}},Kf={en:"en-US",de:"de-DE",fr:"fr-FR",es:"es-ES",it:"it-IT",ja:"ja-JP",zh:"zh-CN",ru:"ru-RU",kk:"kk-KZ",pt:"pt-PT"};function Xf(t,e,n="en"){if(!e)return t.toString();try{return new Intl.NumberFormat(Kf[n]||"en-US",{style:"currency",currency:e,currencyDisplay:"narrowSymbol"}).format(t)}catch{return t.toString()}}function ke({key:t,lang:e}){const n=Hf,s=ve.getUiConfig(),i=(s==null?void 0:s.translations)||{};if(i[e]&&i[e][t])return i[e][t];if(n[e]&&n[e][t])return n[e][t];throw new Error(`Translation for key "${t}" not found in language "${e}".`)}async function Yf({sourceLang:t,targetLang:e,texts:n,apiKey:s}){var u,c,h,f;if(!s||!t||!e||t===e)return n;const i="https://api.openai.com/v1/chat/completions",r={"Content-Type":"application/json",Authorization:`Bearer ${s}`},a=Object.entries(n).map(([d,p])=>({key:d,text:p})),l=`
|
|
68
61
|
You are a professional translator.
|
|
69
62
|
|
|
70
63
|
The input texts are written in language with code "${t}". Your task is to translate them strictly to the target language with code "${e}".
|
|
@@ -89,18 +82,18 @@ Output:
|
|
|
89
82
|
|
|
90
83
|
Now translate the following input:
|
|
91
84
|
${JSON.stringify(a,null,2)}
|
|
92
|
-
`,o=JSON.stringify({model:"gpt-3.5-turbo",messages:[{role:"system",content:"You are a professional translator."},{role:"user",content:l}],temperature:.2,max_tokens:1e3});try{const p=await(await fetch(i,{method:"POST",headers:r,body:o})).json(),g=(f=(h=(c=(u=p==null?void 0:p.choices)==null?void 0:u[0])==null?void 0:c.message)==null?void 0:h.content)==null?void 0:f.trim();if(!g)throw new Error("No response from OpenAI");const v=JSON.parse(g),
|
|
85
|
+
`,o=JSON.stringify({model:"gpt-3.5-turbo",messages:[{role:"system",content:"You are a professional translator."},{role:"user",content:l}],temperature:.2,max_tokens:1e3});try{const p=await(await fetch(i,{method:"POST",headers:r,body:o})).json(),g=(f=(h=(c=(u=p==null?void 0:p.choices)==null?void 0:u[0])==null?void 0:c.message)==null?void 0:h.content)==null?void 0:f.trim();if(!g)throw new Error("No response from OpenAI");const v=JSON.parse(g),k={};return v.forEach(C=>{C.key&&C.text!==void 0&&(k[C.key]=C.text)}),{...n,...k}}catch(d){return console.error("Error translating texts:",d),n}}ql();var Jf=xs('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38" fill="none"><path d="M10.036 4.96326H28.2826L34.3648 14.0865L19.1593 33.8537L3.95381 14.0865L10.036 4.96326Z" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path><path d="M17.6388 4.96326L13.0771 14.0865L19.1593 33.8537L25.2415 14.0865L20.6799 4.96326" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path><path d="M3.95381 14.0867H34.3648" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function Qf(t,e){let n=Me(e,"className",8,""),s=Me(e,"size",8,20);var i=Jf();J(()=>{Dt(i,0,Tn(n())),ye(i,"width",s()),ye(i,"height",s())}),F(t,i)}var Zf=xs('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38" fill="none"><path d="M29.533 21.4034C31.7986 19.1834 34.0946 16.5224 34.0946 13.0404C34.0946 10.8224 33.2135 8.69521 31.6451 7.12684C30.0768 5.55847 27.9496 4.67737 25.7316 4.67737C23.0554 4.67737 21.1699 5.43764 18.8891 7.71847C16.6083 5.43764 14.7228 4.67737 12.0467 4.67737C9.82865 4.67737 7.70148 5.55847 6.13311 7.12684C4.56474 8.69521 3.68364 10.8224 3.68364 13.0404C3.68364 16.5376 5.96446 19.1986 8.24528 21.4034L18.8891 32.0472L29.533 21.4034Z" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path><path d="M18.8891 19.8829L17.3686 18.3623L20.4097 15.3212L15.848 10.7596L18.8891 7.71851" stroke="currentColor" stroke-width="3.0411" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function $f(t,e){let n=Me(e,"className",8,""),s=Me(e,"size",8,20);var i=Zf();J(()=>{Dt(i,0,Tn(n())),ye(i,"width",s()),ye(i,"height",s())}),F(t,i)}var ed=xs('<svg viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.041" d="M19.57 17.655a3.801 3.801 0 1 0 0-7.602 3.801 3.801 0 0 0 0 7.602Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.041" d="M19.57 3.97a9.884 9.884 0 0 0-9.458 6.995c-1.673 4.76-1.186 5.93-4.835 9.245a4.562 4.562 0 0 0 2.889 8.09c6.082 0 12.772-2.738 17.334-6.54a9.885 9.885 0 0 0-5.93-17.79Z"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.041" d="m28.693 10.053 3.33 6.842c.316.983.475 2.009.471 3.041a9.867 9.867 0 0 1-3.953 7.907c-4.562 3.801-11.252 6.538-17.334 6.538a4.562 4.562 0 0 1-4.075-2.524l-2.92-5.839"></path></svg>');function $a(t,e){let n=Me(e,"className",8,""),s=Me(e,"size",8,20);var i=ed();J(()=>{Dt(i,0,Tn(n())),ye(i,"width",s()),ye(i,"height",s())}),F(t,i)}var td=xs('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 34" fill="none"><path d="M9.03846 17.0001C10.3456 12.1888 15.9077 8.65686 20.858 8.65686C25.8083 8.65686 29.2846 12.1888 30.5917 17.0001C29.2846 21.8252 25.8083 25.3432 20.858 25.3432C15.9077 25.3432 10.3456 21.8252 9.03846 17.0001Z" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M25.0296 17V17.6953" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22.2485 25.2457C20.4397 22.8774 19.4599 19.98 19.4599 16.9999C19.4599 14.0198 20.4397 11.1224 22.2485 8.75403" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.73372 15.1506C9.73372 11.4379 7.75916 8.6151 3.79615 7.96155C2.40562 10.0473 2.40562 14.9142 4.11597 17C2.39171 19.0858 2.39171 23.9527 3.79615 26.0385C7.75916 25.3849 9.73372 22.5621 9.73372 18.8494" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M14.545 10.4089C14.1834 8.48998 12.7512 6.20951 11.1243 4.48525H19.1893C19.8491 4.4828 20.4883 4.71502 20.9927 5.14042C21.497 5.56582 21.8337 6.15668 21.9426 6.80744L22.2624 8.75418" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path><path d="M22.2624 25.2459L21.9426 27.1926C21.8337 27.8434 21.497 28.4342 20.9927 28.8596C20.4883 29.285 19.8491 29.5172 19.1893 29.5148H13.2101C14.5573 27.9873 15.2948 26.0172 15.2819 23.9805" stroke="currentColor" stroke-width="2.78106" stroke-linecap="round" stroke-linejoin="round"></path></svg>');function nd(t,e){let n=Me(e,"className",8,""),s=Me(e,"size",8,20);var i=td();J(()=>{Dt(i,0,Tn(n())),ye(i,"width",s()),ye(i,"height",s())}),F(t,i)}var sd=Y('<h1 class="wr-Header-title svelte-oiwvqb"> </h1>'),id=Y('<h1 class="wr-Header-title svelte-oiwvqb"> <span><!></span> <span class="wr-Header-label svelte-oiwvqb"> </span>, <!> <span class="wr-Header-label svelte-oiwvqb"> </span> <br/> <!> <span class="wr-Header-label svelte-oiwvqb"> </span> </h1>'),rd=Y('<div class="wr-Header"><!></div>');const od={hash:"svelte-oiwvqb",code:`.wr-Header-title.svelte-oiwvqb {font-weight:600;font-size:24px;margin:0 auto;line-height:1.3;color:#333;text-align:center;
|
|
93
86
|
|
|
94
|
-
|
|
87
|
+
/* TODO: add wineater-color to svg */}.wr-Header-icon {display:inline-block;vertical-align:middle;color:var(--wr-wineater-color);}.wr-Header-label.svelte-oiwvqb {color:var(--wr-wineater-color);font-weight:500;}
|
|
95
88
|
|
|
96
89
|
@media screen and (max-width: 768px) {.wr-Header-title.svelte-oiwvqb {display:none;}
|
|
97
|
-
}`};function
|
|
90
|
+
}`};function ad(t,e){var u;Et(e,!0),Rt(t,od);let n=pe(()=>ve.getAppLanguage());const s=((u=window==null?void 0:window.wineaterData)==null?void 0:u.TITLE_TEXT)||null;let i=ie(et($a));var r=rd(),a=B(r);{var l=c=>{var h=sd(),f=B(h);J(()=>ee(f,s)),F(c,h)},o=c=>{var h=id(),f=B(h),d=K(f),p=B(d);Rc(p,()=>w(i),(_,A)=>{A(_,{className:"wr-Header-icon",size:"28"})});var g=K(d,2),v=B(g),k=K(g,2);$f(k,{className:"wr-Header-icon",size:"28"});var C=K(k,2),E=B(C),m=K(C,3),y=K(m);Qf(y,{className:"wr-Header-icon",size:"28"});var T=K(y,2),x=B(T),S=K(T);J((_,A,W,D,U,R)=>{ee(f,`${_??""} `),ee(v,A),ee(E,W),ee(m,` ${D??""} `),ee(x,U),ee(S,` ${R??""}`)},[()=>ke({key:"headerLine1",lang:w(n)}),()=>ke({key:"headerMeal",lang:w(n)}),()=>ke({key:"headerMood",lang:w(n)}),()=>ke({key:"headerOr",lang:w(n)}),()=>ke({key:"headerOccasion",lang:w(n)}),()=>ke({key:"headerLine2",lang:w(n)})]),Qt("mouseenter",d,()=>L(i,nd,!0)),Qt("mouseleave",d,()=>L(i,$a,!0)),F(c,h)};ne(a,c=>{s?c(l):c(o,!1)})}F(t,r),It()}var ld=Y('<option class="wr-Footer-lang"> </option>'),cd=Y('<select class="wr-Footer-dropdown svelte-1sr6y3t"></select>'),ud=Y('<footer class="wr-Footer svelte-1sr6y3t"><div class="wr-Footer-center svelte-1sr6y3t"><a href="https://wineater.com" class="wr-Footer-link svelte-1sr6y3t" target="_blank"><span class="wr-Footer-text"> </span> <img class="wr-Footer-logo svelte-1sr6y3t" alt="Wineater Logo"/> <span class="wr-Footer-text wr-Footer-text--sommelier svelte-1sr6y3t"> </span></a></div> <!></footer>');const hd={hash:"svelte-1sr6y3t",code:`.wr-Footer.svelte-1sr6y3t {position:relative;border-top:2px solid #f6f7fd;font-weight:200;padding:12px 24px;min-height:40px;}.wr-Footer-center.svelte-1sr6y3t {position:absolute;left:50%;transform:translateX(-50%);text-align:center;}.wr-Footer-dropdown.svelte-1sr6y3t {position:absolute;right:0px;top:50%;transform:translateY(-50%);padding:4px;border-radius:6px;border:2px solid var(--wr-brand-color);background-color:white;color:var(--wr-brand-color);font-weight:500;font-size:12px;cursor:pointer;transition:all 0.2s ease;}.wr-Footer-dropdown.svelte-1sr6y3t:hover {box-shadow:0 4px 8px rgba(123, 43, 235, 0.2);}.wr-Footer-link.svelte-1sr6y3t {text-decoration:none;display:flex;align-items:center;white-space:nowrap;gap:8px;color:#a8a8a8;font-size:12px;line-height:16px;transition:opacity 0.2s ease;}.wr-Footer-link.svelte-1sr6y3t:hover {opacity:0.8;}.wr-Footer-logo.svelte-1sr6y3t {height:16px;width:auto;color:#a8a8a8;}
|
|
98
91
|
|
|
99
92
|
@media screen and (max-width: 768px) {.wr-Footer-text--sommelier.svelte-1sr6y3t {display:none;}
|
|
100
|
-
}`};function
|
|
93
|
+
}`};function fd(t,e){Et(e,!0),Rt(t,hd);let n=Me(e,"countryCode",3,null),s=pe(()=>ve.getAppLanguage()),i=pe(()=>ve.getSupportedLanguages()),r=pe(()=>ve.getStoreId());function a(k){const E=k.target.value;st(lt.LANGUAGE_CHANGED,w(r),{from_language:w(s),to_language:E}),ve.setStoreLanguage(E)}var l=ud(),o=B(l),u=B(o),c=B(u),h=B(c),f=K(c,2),d=K(f,2),p=B(d),g=K(o,2);{var v=k=>{var C=cd();C.__change=a,Vn(C,21,()=>w(i),qn,(m,y)=>{var T=ld(),x=B(T),S={};J(_=>{Lc(T,w(y)===w(s)),ee(x,_),S!==(S=w(y))&&(T.value=(T.__value=w(y))??"")},[()=>w(y).toUpperCase()]),F(m,T)});var E;Ac(C),J(()=>{E!==(E=w(s))&&(C.value=(C.__value=w(s))??"",Io(C,w(s)))}),F(k,C)};ne(g,k=>{w(i).length>1&&k(v)})}J((k,C)=>{ee(h,k),ye(f,"src",n()==="ru"?"https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/divino_logo.svg?x=5":"https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/logo_medium_gray.svg"),ee(p,C)},[()=>ke({key:"poweredBy",lang:w(s)}),()=>ke({key:"ai_sommelier",lang:w(s)})]),F(t,l),It()}Ts(["change"]);var dd=Y('<a rel="noopener noreferrer"><!></a>'),pd=Y("<button><!></button>");const gd={hash:"svelte-8cxv3l",code:`.wr-Action.svelte-8cxv3l {background:transparent;border:none;font-family:inherit;cursor:pointer;display:block;text-decoration:none;transition:background 0.2s,
|
|
101
94
|
color 0.2s,
|
|
102
|
-
box-shadow 0.2s;}.wr-Action.primary.svelte-8cxv3l {background:var(--
|
|
103
|
-
opacity 0.3s ease-in-out;}.wr-Search-input.svelte-1wah7ro:focus {border-color:var(--
|
|
95
|
+
box-shadow 0.2s;}.wr-Action.primary.svelte-8cxv3l {background:var(--wr-brand-color);color:#fff;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:500;&:hover {opacity:0.8;}}.wr-Action.outlined.svelte-8cxv3l {background:transparent;color:var(--wr-brand-color);border:2px solid var(--wr-brand-color);border-radius:6px;padding:8px 16px;font-size:14px;font-weight:500;&:hover {box-shadow:0 4px 8px rgba(123, 43, 235, 0.25);background-color:var(--wr-brand-color);color:#fff;}}.wr-Action--uppercase.svelte-8cxv3l {text-transform:uppercase;}`};function yr(t,e){Et(e,!0),Rt(t,gd);let n=Me(e,"type",3,"button"),s=Me(e,"variant",3,"primary"),i=Me(e,"target",3,"_self"),r=ve.getUiConfig(),a=`wr-Action ${s()} ${e.className||""} ${r.buttonUppercase?"wr-Action--uppercase":""}`.trim();var l=_n(),o=Xt(l);{var u=h=>{var f=dd(),d=B(f);To(d,e,"default",{},null),J(()=>{Dt(f,1,Tn(a),"svelte-8cxv3l"),ye(f,"href",e.href),ye(f,"id",e.id),ye(f,"target",i())}),F(h,f)},c=h=>{var f=pd();f.__click=function(...p){var g;(g=e.handleClick)==null||g.apply(this,p)};var d=B(f);To(d,e,"default",{},null),J(()=>{Dt(f,1,Tn(a),"svelte-8cxv3l"),ye(f,"type",n()),ye(f,"id",e.id)}),F(h,f)};ne(o,h=>{e.href?h(u):h(c,!1)})}F(t,l),It()}Ts(["click"]);var md=Y('<form class="wr-Search svelte-1wah7ro"><span class="wr-Search-icon svelte-1wah7ro"></span> <input class="wr-Search-input svelte-1wah7ro" type="text"/> <!></form>');const vd={hash:"svelte-1wah7ro",code:`.wr-Search.svelte-1wah7ro {position:relative;margin:12px auto;padding:0 6px;display:flex;align-items:center;border:2px solid #d5d9ee;border-radius:10px;}.wr-Search-icon.svelte-1wah7ro {left:12px;width:24px;height:24px;flex:0 0 auto;background-image:url('https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media//search.svg?x=1');background-repeat:no-repeat;background-size:contain;z-index:2;}.wr-Search-input.svelte-1wah7ro {flex:1 1 0%;min-width:0;padding:12px;font-size:16px;border:none;border-radius:10px;outline:none;transition:border 0.2s ease;}.wr-Search-input.svelte-1wah7ro::placeholder {color:var(--wr-wineater-color);opacity:1;transition:color 0.3s ease,
|
|
96
|
+
opacity 0.3s ease-in-out;}.wr-Search-input.svelte-1wah7ro:focus {border-color:var(--wr-brand-color);}.wr-Search-input.svelte-1wah7ro:focus::placeholder {opacity:0.5;}`};function bd(t,e){Et(e,!0),Rt(t,vd);let n=Me(e,"searchQuery",15),s,i=ie(!1),r=ie(0),a=ie(0),l=ie(!0),o=ie(!1),u=pe(()=>ve.getAppLanguage()),c=0;function h(){return s}function f(){const m=++c,y=ke({key:"placeholderSuggestions",lang:w(u)});if(!s||!y.length)return;L(o,!0);const T=()=>{if(m!==c||!s||!w(o)||w(i)||n().length)return;const x=y[w(r)];if(w(l)){if(s.placeholder=x.substring(0,Kr(a)),w(a)>x.length){L(l,!1),setTimeout(T,1600);return}setTimeout(T,90)}else{if(s.placeholder=x.substring(0,Kr(a,-1)),w(a)<0){L(l,!0),L(r,(w(r)+1)%y.length),setTimeout(T,450);return}setTimeout(T,45)}};T()}function d(){L(o,!1)}function p(){L(i,!0),d(),s&&(s.placeholder="")}function g(){L(i,!1),L(a,0),L(l,!0),L(o,!1)}Yn(()=>{if(!s||n().length>0)return;c++,L(o,!1),L(r,0),L(a,0),L(l,!0);const m=ke({key:"placeholderSuggestions",lang:w(u)});m&&m.length?s.placeholder=m[0]:s.placeholder=ke({key:"searchPlaceholder",lang:w(u)})}),Yn(()=>{s&&e.initialized&&!w(i)&&!n().length&&!w(o)&&f(),n().length>0&&w(o)&&(L(o,!1),c++)}),Ii(()=>{});var v={getSearchElement:h},k=md(),C=K(B(k),2);jc(C,m=>s=m,()=>s);var E=K(C,2);return yr(E,{className:"wr-Search-button",type:"submit",variant:"primary",children:(m,y)=>{var T=Ei();J(x=>ee(T,x),[()=>ke({key:"searchButton",lang:w(u)})]),F(m,T)},$$slots:{default:!0}}),Qt("submit",k,function(...m){var y;(y=e.onSubmit)==null||y.apply(this,m)}),Qt("focus",C,p),Qt("blur",C,g),Wc(C,n),F(t,k),It(v)}var wd=Y('<div class="wr-Loader svelte-li6gfl"><div class="wr-Loader-indicator svelte-li6gfl"><span class="svelte-li6gfl"></span> <span class="svelte-li6gfl"></span> <span class="svelte-li6gfl"></span></div></div>');const yd={hash:"svelte-li6gfl",code:`.wr-Loader.svelte-li6gfl {position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);z-index:10000;text-align:center;}.wr-Loader-indicator.svelte-li6gfl {display:flex;justify-content:center;align-items:center;height:40px;visibility:visible;background-color:white;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl) {display:block;width:8px;height:8px;margin:0 3px;border-radius:50%;background:linear-gradient(90deg, var(--wr-brand-color), var(--wineater-corp-color));opacity:0.7;
|
|
104
97
|
animation: svelte-li6gfl-typing 1s infinite;}
|
|
105
98
|
|
|
106
99
|
@keyframes svelte-li6gfl-typing {
|
|
@@ -113,8 +106,8 @@ ${JSON.stringify(a,null,2)}
|
|
|
113
106
|
transform: translateY(-8px);
|
|
114
107
|
opacity: 1;
|
|
115
108
|
}
|
|
116
|
-
}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(1) {animation-delay:0s;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(2) {animation-delay:0.15s;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(3) {animation-delay:0.3s;}`};function
|
|
117
|
-
opacity 180ms cubic-bezier(0.22, 0.61, 0.36, 1);will-change:transform, opacity;}.wr-WineTile.svelte-yk3emv:last-child {border-right:none;}.wr-WineTile.ww-slide-up.svelte-yk3emv {transform:translateY(-28px);opacity:0;}.wr-WineTile-header.svelte-yk3emv {display:flex;flex-direction:column;align-items:center;justify-content:flex-start;}.wr-WineTile-image.svelte-yk3emv {height:200px;object-fit:contain;margin:0 auto 16px;display:block;}.wr-WineTile-title.svelte-yk3emv {font-size:15px;font-weight:500;margin:0 0 8px;min-height:3rem;line-height:1.2;text-align:center;color:#000;}.wr-WineTile-params.svelte-yk3emv {font-size:14px;color:#666;white-space:normal;text-align:center;}.wr-WineTile-footer.svelte-yk3emv {margin-top:auto;display:flex;align-items:center;gap:12px;justify-content:center;}.wr-WineTile-price.svelte-yk3emv {font-size:16px;font-weight:400;margin-bottom:8px;color:#333;}.wr-WineTile-actions.svelte-yk3emv {margin:16px auto 0;}
|
|
109
|
+
}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(1) {animation-delay:0s;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(2) {animation-delay:0.15s;}.wr-Loader-indicator.svelte-li6gfl span:where(.svelte-li6gfl):nth-child(3) {animation-delay:0.3s;}`};function Sd(t){Rt(t,yd);var e=wd();F(t,e)}var _d=Y('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),kd=Y('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),Td=Y('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),xd=Y('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),Ed=Y('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),Id=Y('<div class="wr-WinePopupMobile svelte-17gehox"><div class="wr-WinePopupMobile-overlay svelte-17gehox"></div> <div class="wr-WinePopupMobile-wrapper svelte-17gehox"><div class="wr-WinePopup js-WinePopup svelte-17gehox"><div class="wr-WinePopup-header svelte-17gehox"><h2 class="wr-WinePopup-title svelte-17gehox"> </h2> <button class="wr-WinePopup-close js-WinePopupClose svelte-17gehox">×</button></div> <!> <!> <!></div></div></div>'),Cd=Y('<p class="wr-WinePopup-desc wr-WinePopup-text svelte-17gehox"> </p>'),Nd=Y('<div class="wr-WinePopup-reason svelte-17gehox"> </div>'),Rd=Y('<p class="wr-WinePopup-pairing wr-WinePopup-text svelte-17gehox"> </p>'),Dd=Y('<span class="wr-WinePopup-tag svelte-17gehox"> </span>'),Od=Y('<div class="wr-WinePopup-tags svelte-17gehox"></div>'),Ad=Y('<div class="wr-WinePopup svelte-17gehox"><div class="wr-WinePopup-header svelte-17gehox"><h2 class="wr-WinePopup-title svelte-17gehox"> </h2> <button class="wr-WinePopup-close svelte-17gehox">×</button></div> <!> <!> <!></div>');const Pd={hash:"svelte-17gehox",code:".wr-WinePopup.svelte-17gehox {position:absolute;width:100%;background-color:white;padding:16px;border-radius:16px;box-shadow:0 6px 30px rgba(0, 0, 0, 0.2);text-align:left;font-size:14px;box-sizing:border-box;display:flex;flex-direction:column;}.wr-WinePopup-text.svelte-17gehox {margin:5px 0;}.wr-WinePopup-header.svelte-17gehox {display:flex;justify-content:space-between;align-items:flex-start;gap:12px;}.wr-WinePopup-title.svelte-17gehox {font-size:16px;font-weight:600;margin:0;flex:1;line-height:1.3;}.wr-WinePopup-close.svelte-17gehox {font-size:20px;font-weight:bold;cursor:pointer;color:#999;border:none;background:transparent;line-height:1;}.wr-WinePopup-close.svelte-17gehox:hover {color:#000;}.wr-WinePopup-desc.svelte-17gehox {margin-top:8px;}.wr-WinePopup-reason.svelte-17gehox {font-size:14px;font-weight:400;color:#333;margin-top:8px;}.wr-WinePopup-pairing.svelte-17gehox {margin-top:8px;}.wr-WinePopup-tags.svelte-17gehox {display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;justify-content:center;}.wr-WinePopup-tag.svelte-17gehox {display:inline-block;padding:4px 8px;border-radius:12px;background-color:#f5f0ff;border:1px solid #ddd;font-size:13px;color:#333;text-transform:capitalize;}.wr-WinePopupMobile.svelte-17gehox {position:fixed;top:0;left:0;width:100%;height:100%;z-index:10000;}.wr-WinePopupMobile-overlay.svelte-17gehox {position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.5);}.wr-WinePopupMobile-wrapper.svelte-17gehox {position:absolute;width:100%;height:100%;top:50%;left:50%;transform:translate(-50%, -50%);max-width:90%;max-height:80%;overflow-y:auto;background:transparent;}"};function el(t,e){Et(e,!0),Rt(t,Pd);const n=!!e.isMobile;var s=_n(),i=Xt(s);{var r=l=>{var o=Id(),u=B(o);u.__click=function(...x){var S;(S=e.onClose)==null||S.apply(this,x)};var c=K(u,2),h=B(c),f=B(h),d=B(f),p=B(d),g=K(d,2);g.__click=function(...x){var S;(S=e.onClose)==null||S.apply(this,x)};var v=K(f,2);{var k=x=>{var S=_d(),_=B(S);J(()=>ee(_,e.shortDescription)),F(x,S)};ne(v,x=>{e.shortDescription&&x(k)})}var C=K(v,2);{var E=x=>{var S=kd(),_=B(S);J(()=>ee(_,e.reason)),F(x,S)},m=x=>{var S=_n(),_=Xt(S);{var A=W=>{var D=Td(),U=B(D);J(()=>ee(U,e.pairing)),F(W,D)};ne(_,W=>{e.pairing&&W(A)},!0)}F(x,S)};ne(C,x=>{e.reason?x(E):x(m,!1)})}var y=K(C,2);{var T=x=>{var S=Ed();Vn(S,21,()=>e.tags,qn,(_,A)=>{var W=xd(),D=B(W);J(()=>ee(D,w(A))),F(_,W)}),F(x,S)};ne(y,x=>{e.tags&&e.tags.length&&x(T)})}J(()=>ee(p,e.title)),F(l,o)},a=l=>{var o=Ad(),u=B(o),c=B(u),h=B(c),f=K(c,2);f.__click=function(...m){var y;(y=e.onClose)==null||y.apply(this,m)};var d=K(u,2);{var p=m=>{var y=Cd(),T=B(y);J(()=>ee(T,e.shortDescription)),F(m,y)};ne(d,m=>{e.shortDescription&&m(p)})}var g=K(d,2);{var v=m=>{var y=Nd(),T=B(y);J(()=>ee(T,e.reason)),F(m,y)},k=m=>{var y=_n(),T=Xt(y);{var x=S=>{var _=Rd(),A=B(_);J(()=>ee(A,e.pairing)),F(S,_)};ne(T,S=>{e.pairing&&S(x)},!0)}F(m,y)};ne(g,m=>{e.reason?m(v):m(k,!1)})}var C=K(g,2);{var E=m=>{var y=Od();Vn(y,21,()=>e.tags,qn,(T,x)=>{var S=Dd(),_=B(S);J(()=>ee(_,w(x))),F(T,S)}),F(m,y)};ne(C,m=>{e.tags&&e.tags.length&&m(E)})}J(()=>ee(h,e.title)),F(l,o)};ne(i,l=>{n?l(r):l(a,!1)})}F(t,s),It()}Ts(["click"]);var Md=Y('<img class="wr-WineTile-image svelte-yk3emv"/>'),Ld=Y('<div class="wr-WineTile-price svelte-yk3emv"> </div>'),Bd=Y('<div class="wr-WineTile-params svelte-yk3emv"> </div>'),Fd=Y('<div class="wr-WineTilePopup-reason svelte-yk3emv"> </div>'),Wd=Y('<span class="wr-WineTilePopup-tag svelte-yk3emv"> </span>'),jd=Y('<div class="wr-WineTilePopup-tags svelte-yk3emv"></div>'),zd=Y("<div><!> <!></div>"),Ud=Y('<article><header class="wr-WineTile-header svelte-yk3emv"><!> <!> <h3 class="wr-WineTile-title svelte-yk3emv"> </h3></header> <!> <footer class="wr-WineTile-footer svelte-yk3emv"><div class="wr-WineTile-actions svelte-yk3emv"><!></div></footer> <!> <!></article> <!>',1);const Hd={hash:"svelte-yk3emv",code:`.wr-WineTile.svelte-yk3emv {display:flex;flex-direction:column;align-items:center;text-align:center;box-sizing:border-box;padding:16px 8px;border-right:2px solid #f6f7fd;position:relative;transform:translateY(0);opacity:1;transition:transform 180ms cubic-bezier(0.22, 0.61, 0.36, 1),
|
|
110
|
+
opacity 180ms cubic-bezier(0.22, 0.61, 0.36, 1);will-change:transform, opacity;}.wr-WineTile.svelte-yk3emv:last-child {border-right:none;}.wr-WineTile.ww-slide-up.svelte-yk3emv {transform:translateY(-28px);opacity:0;}.wr-WineTile-header.svelte-yk3emv {display:flex;flex-direction:column;align-items:center;justify-content:flex-start;background-color:transparent;}.wr-WineTile-image.svelte-yk3emv {height:200px;object-fit:contain;margin:0 auto 16px;display:block;}.wr-WineTile-title.svelte-yk3emv {font-size:15px;font-weight:500;margin:0 0 8px;min-height:3rem;line-height:1.2;text-align:center;color:#000;}.wr-WineTile-params.svelte-yk3emv {font-size:14px;color:#666;white-space:normal;text-align:center;}.wr-WineTile-footer.svelte-yk3emv {margin-top:auto;display:flex;align-items:center;gap:12px;justify-content:center;}.wr-WineTile-price.svelte-yk3emv {font-size:16px;font-weight:400;margin-bottom:8px;color:#333;}.wr-WineTile-actions.svelte-yk3emv {margin:16px auto 0;}
|
|
118
111
|
|
|
119
112
|
/* Hover popup inside tile */.wr-WineTilePopup.svelte-yk3emv {display:none;position:absolute;top:0;left:0;width:100%;padding:12px;background-color:#fff;border:1px solid #ddd;border-radius:8px;box-shadow:0 4px 16px rgba(0, 0, 0, 0.1);transition:transform 0.3s ease;z-index:999;}.wr-WineTilePopup.visible.svelte-yk3emv {display:block;}.wr-WineTilePopup.slide-in.svelte-yk3emv {
|
|
120
113
|
animation: svelte-yk3emv-whPopup 0.25s ease;}.wr-WineTilePopup-reason.svelte-yk3emv {font-size:14px;font-weight:400;color:#333;margin-bottom:8px;}.wr-WineTilePopup-tags.svelte-yk3emv {display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;justify-content:center;}.wr-WineTilePopup-tag.svelte-yk3emv {display:inline-block;padding:4px 8px;border-radius:12px;background-color:#f5f0ff;border:1px solid #ddd;font-size:13px;color:#333;text-transform:capitalize;}
|
|
@@ -131,9 +124,9 @@ ${JSON.stringify(a,null,2)}
|
|
|
131
124
|
}
|
|
132
125
|
|
|
133
126
|
@media screen and (max-width: 768px) {.wr-WineTile.svelte-yk3emv {flex:0 0 auto;scroll-snap-align:center;width:240px;text-align:center;}
|
|
134
|
-
}`};function
|
|
127
|
+
}`};function qd(t,e){Et(e,!0),Rt(t,Hd);let n=pe(()=>ve.getAppLanguage());const s=(I,O)=>I[O]||I[O.charAt(0).toUpperCase()+O.slice(1)],i=(I,O)=>O.map(M=>s(I,M)).filter(Boolean).join(" • ");function r(I){var O;return Xf(I,((O=ve.getCurrency)==null?void 0:O.call(ve))||"USD",w(n))}function a(I){return e.selectedWineId===I}function l(I){return!!(I.reason||I.shortDescription||I.tags)}function o(I,O){let M=(I==null?void 0:I.tags)||O.tags;return M?(Array.isArray(M)&&(M=M.join(",")),typeof M!="string"?[]:M.split(",").map(H=>H.trim()).filter(Boolean)):[]}let u=ie(!1);Ii(()=>{const I=()=>{L(u,window.innerWidth<=768)};return I(),window.addEventListener("resize",I),()=>{window.removeEventListener("resize",I)}});var c=Ud(),h=Xt(c);h.__click=I=>e.onTileClick(I,e.wine);var f=B(h),d=B(f);{var p=I=>{var O=Md();J(()=>{ye(O,"src",e.wine.image),ye(O,"alt",e.wine.title)}),F(I,O)};ne(d,I=>{e.wine.image&&I(p)})}var g=K(d,2);{var v=I=>{var O=Ld(),M=B(O);J(H=>ee(M,H),[()=>r(e.wine.total)]),F(I,O)};ne(g,I=>{e.wine.total&&I(v)})}var k=K(g,2),C=B(k),E=K(f,2);{var m=I=>{var O=Bd(),M=B(O);J(H=>ee(M,H),[()=>i(e.wine,["type","country","region","grape"])]),F(I,O)};ne(E,I=>{i(e.wine,["type","country","region","grape"])&&I(m)})}var y=K(E,2),T=B(y),x=B(T);{var S=I=>{yr(I,{get href(){return e.wine.url},className:"wr-WineTile-action wr-WineTile-action--link js-WineTileAction",target:"_blank",variant:"outlined",children:(O,M)=>{var H=Ei();J(Ce=>ee(H,Ce),[()=>ke({key:"wineDetails.buy",lang:w(n)})]),F(O,H)},$$slots:{default:!0}})},_=I=>{yr(I,{handleClick:()=>e.onBuyClick(e.wine,e.index),variant:"outlined",className:"wr-WineTile-action wr-WineTile-action--button js-WineTileAction",children:(O,M)=>{var H=Ei();J(Ce=>ee(H,Ce),[()=>ke({key:"moreInfo",lang:w(n)})]),F(O,H)},$$slots:{default:!0}})};ne(x,I=>{e.wine.url?I(S):I(_,!1)})}var A=K(y,2);{var W=I=>{{let O=pe(()=>{var Q;return((Q=e.translatedPopup)==null?void 0:Q.shortDescription)||e.wine.shortDescription}),M=pe(()=>{var Q;return((Q=e.translatedPopup)==null?void 0:Q.reason)||e.wine.reason}),H=pe(()=>{var Q;return((Q=e.translatedPopup)==null?void 0:Q.pairingRecommendation)||e.wine.pairingRecommendation}),Ce=pe(()=>o(e.translatedPopup,e.wine));el(I,{get title(){return e.wine.title},get shortDescription(){return w(O)},get reason(){return w(M)},get pairing(){return w(H)},get tags(){return w(Ce)},get onClose(){return e.onPopupClose},isMobile:!1})}};ne(A,I=>{a(e.wine.id)&&!w(u)&&I(W)})}var D=K(A,2);{var U=I=>{var O=zd(),M=B(O);{var H=Te=>{var ue=Fd(),re=B(ue);J(()=>{var N,V;return ee(re,((N=e.translatedPopup)==null?void 0:N.reason)||((V=e.translatedPopup)==null?void 0:V.shortDescription)||e.wine.reason||e.wine.shortDescription)}),F(Te,ue)};ne(M,Te=>{var ue,re;((ue=e.translatedPopup)!=null&&ue.reason||(re=e.translatedPopup)!=null&&re.shortDescription||e.wine.reason||e.wine.shortDescription)&&Te(H)})}var Ce=K(M,2);{var Q=Te=>{var ue=jd();Vn(ue,21,()=>o(e.translatedPopup,e.wine),qn,(re,N)=>{var V=Wd(),he=B(V);J(()=>ee(he,w(N))),F(re,V)}),F(Te,ue)};ne(Ce,Te=>{var ue,re;((ue=e.translatedPopup)!=null&&ue.tags||(re=e.translatedPopup)!=null&&re.Tags||e.wine.tags)&&Te(Q)})}J(()=>Dt(O,1,`wr-WineTilePopup ${e.hoveredWineId===e.wine.id?"slide-in visible":""}`,"svelte-yk3emv")),F(I,O)};ne(D,I=>{l(e.wine)&&I(U)})}var R=K(h,2);{var P=I=>{{let O=pe(()=>{var Q;return((Q=e.translatedPopup)==null?void 0:Q.shortDescription)||e.wine.shortDescription}),M=pe(()=>{var Q;return((Q=e.translatedPopup)==null?void 0:Q.reason)||e.wine.reason}),H=pe(()=>{var Q;return((Q=e.translatedPopup)==null?void 0:Q.pairingRecommendation)||e.wine.pairingRecommendation}),Ce=pe(()=>o(e.translatedPopup,e.wine));el(I,{get title(){return e.wine.title},get shortDescription(){return w(O)},get reason(){return w(M)},get pairing(){return w(H)},get tags(){return w(Ce)},get onClose(){return e.onPopupClose},isMobile:!0})}};ne(R,I=>{a(e.wine.id)&&w(u)&&I(P)})}J(()=>{Dt(h,1,`wr-WineTile ${e.isAnimating?"ww-slide-up":""}`,"svelte-yk3emv"),ee(C,e.wine.title)}),Qt("mouseenter",h,()=>e.onTileEnter(e.wine)),Qt("mouseleave",h,()=>e.onTileLeave(e.wine)),F(t,c),It()}Ts(["click"]);function Vd(t){if(!t)return"";const e="custom-ui-config-style";if(document.getElementById(e))return;const n=document.createElement("style");return n.id=e,n.innerHTML=t,document.head.appendChild(n),e}var Gd=Y('<div class="wr-App-picture svelte-1n46o8q"><img class="wr-App-logo svelte-1n46o8q" alt=""/></div>'),Kd=Y('<div class="wr-App-error svelte-1n46o8q"><p> </p></div>'),Xd=Y('<div class="wr-App-placeholder svelte-1n46o8q"></div>'),Yd=Y('<div id="wr-Custom" class="wr-App svelte-1n46o8q"><!> <!> <!> <!> <div class="wr-App-content svelte-1n46o8q"><!></div> <!></div>');const Jd={hash:"svelte-1n46o8q",code:`
|
|
135
128
|
/* ===================== 1) CSS Variables ===================== */:root {--wineater-corp-color: #0044ff;
|
|
136
|
-
/* --
|
|
129
|
+
/* --wr-brand-color is set dynamically from uiConfig.brandColor */--wr-brand-color: #7b2beb; /* fallback value */}
|
|
137
130
|
|
|
138
131
|
/* ===================== 2) Global Styles ===================== */* {box-sizing:border-box;}.hidden {display:none;}body {margin:0;padding:0;font-family:var(--wineater-font-primary, sans-serif);}
|
|
139
132
|
|
|
@@ -143,4 +136,4 @@ ${JSON.stringify(a,null,2)}
|
|
|
143
136
|
|
|
144
137
|
/* ===================== 13) Mobile Styles ===================== */
|
|
145
138
|
@media screen and (max-width: 768px) {.wr-App.svelte-1n46o8q {flex-direction:column;padding:0px 16px;min-width:100vw;}.wr-App-placeholder.svelte-1n46o8q {display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;padding:8px 0;width:calc(100vw - 32px);min-width:calc(100vw - 32px);}
|
|
146
|
-
}`};function
|
|
139
|
+
}`};function Qd(t,e){var Te,ue,re;Et(e,!0),Rt(t,Jd);function n(){var N;Ri("chatbotToken",((N=window.wineaterData)==null?void 0:N.CLIENT_TOKEN)||s,365),Oo()}const s="HeUw6IXuhvz6tRuXdPEGEbj3SGQ3Q2YtEc1Z8jd41Kg9LtyPb4Epu0to31SYIadG";new Ff({projectKey:"PA8j9fAi49i6g2QnvpNs",__DISABLE_SECURE_MODE:!0}).start(),n();const r=((Te=window==null?void 0:window.wineaterData)==null?void 0:Te.WIDGET_TYPE)||"store",a=((ue=window==null?void 0:window.wineaterData)==null?void 0:ue.COUNTRY_CODE)||null;(re=window==null?void 0:window.wineaterData)!=null&&re.WIDGET_WRAPPER;let l=ie(!1),o=ie(!1),u=ie(et([])),c=ie(null),h=ie(""),f=ie(null),d=ie(!1),p=ie(null),g=ie(et([])),v=pe(()=>ve.getAppLanguage()),k=pe(()=>ve.getStoreLanguage()),C=pe(()=>ve.getApiKey()),E=pe(()=>ve.getStoreId()),m=pe(()=>ve.isInitialized()),y=pe(()=>ve.getUiConfig());function T(){L(f,ke({key:"errorMessage",lang:w(v)}),!0)}const x=()=>L(f,null);async function S(N){if(w(v)===w(k)||r!=="bar")return N.map(()=>({}));const V=["shortDescription","reason","pairingRecommendation","tags"],he=N[0];if(!he)return N.map(()=>({}));const Tt=V.filter(Ke=>Ke in he),cn=4,Wt=[];for(let Ke=0;Ke<N.length;Ke+=cn){const jt=N.slice(Ke,Ke+cn).map(async si=>{const ii=Tt.map(oe=>{const Be=si[oe]||si[oe.toLowerCase()];return Be?{key:oe,text:Array.isArray(Be)?Be.join(", "):Be}:null}).filter(Boolean);return ii.length===0?{}:await Yf({sourceLang:w(k),targetLang:w(v),texts:Object.fromEntries(ii.map(oe=>[oe.key,oe.text])),apiKey:w(C)})}),un=await Promise.all(jt);Wt.push(...un)}return Wt}async function _(){L(o,!0);try{L(u,await wr.getInstantRecommendations(),!0)}catch{T()}finally{L(o,!1)}}function A(N=220){return!w(u)||w(u).length===0?Promise.resolve():(L(d,!0),new Promise(V=>{setTimeout(()=>{V()},N)}))}async function W(N){N.preventDefault();let V="";try{L(o,!0),x(),await A(220),L(u,[],!0),L(d,!1),V=w(h).trim()+";";try{st(lt.SEARCH_PERFORMED,w(E),{query:V})}catch(Tt){console.error("Error tracking search event:",Tt)}const he=await wr.getWineRecommendationsSearch(V);!he||he.length===0?(L(u,[],!0),L(g,[],!0),L(f,ke({key:"noResultsMessage",lang:w(v)}),!0),st(lt.NO_RESULTS_FOUND,w(E),{query:V})):(L(u,he,!0),st(lt.SEARCH_RESULTS_DISPLAYED,w(E),{results_count:he.length,results:he,query:V}))}catch(he){L(u,[],!0),st(lt.ERROR_OCCURRED,w(E),{error_message:he==null?void 0:he.message,query:V}),T()}finally{L(o,!1)}}Yn(async()=>{if(!w(u)||w(u).length===0){L(g,[],!0);return}try{const N=await S(w(u));w(u)&&w(u).length>0&&L(g,N,!0)}catch(N){console.error("translatePopupContent failed",N)}});function D(N,V){w(c)&&w(c)!==N.id&&L(c,null),L(c,N.id,!0),st(lt.WINE_DETAILS_VIEWED,w(E),{wine_id:N.id,wine_title:N.title,is_mobile:window.innerWidth<=768})}function U(){const N=w(u).find(V=>V.id===w(c));st(lt.WINE_DETAILS_CLOSED,w(E),{wine_id:w(c),wine_title:N.title}),L(c,null)}function R(N){return!!(N.reason||N.shortDescription||N.tags)}function P(N){r==="store"&&R(N)&&(L(p,N.id,!0),st(lt.WINE_CARD_HOVER,w(E),{wine_id:N.id,wine_title:N.title}))}function I(N){r==="store"&&w(p)===N.id&&L(p,null)}function O(N,V){N.target.closest(".js-WineTileAction")||N.target.closest(".js-WinePopupClose")||st(lt.WINE_CARD_CLICK,w(E),{wine_id:V.id,wine_title:V.title})}function M(N){const V=N.target;V.closest(".js-WinePopup")||V.closest(".js-WineTileAction")||L(c,null)}Yn(()=>{var N,V;(N=w(y))!=null&&N.brandColor&&document.documentElement.style.setProperty("--wr-brand-color",w(y).brandColor),(V=w(y))!=null&&V.wineaterColor&&document.documentElement.style.setProperty("--wr-wineater-color",w(y).wineaterColor)}),Ii(async()=>{if(await ve.initializeStore(),!!w(m))return L(y,ve.getUiConfig()),w(y).customCss&&Vd(w(y).customCss),await _(),st(lt.WIDGET_INITIALIZED,w(E)),L(l,!0),document.addEventListener("click",M),()=>{document.removeEventListener("click",M)}});var H=_n(),Ce=Xt(H);{var Q=N=>{var V=Yd(),he=B(V);{var Tt=oe=>{var Be=Gd(),ds=B(Be);J(()=>ye(ds,"src",w(y).logoUrl)),F(oe,Be)};ne(he,oe=>{w(y).logoUrl&&oe(Tt)})}var cn=K(he,2);ad(cn,{});var Wt=K(cn,2);bd(Wt,{onSubmit:W,get initialized(){return w(l)},get searchQuery(){return w(h)},set searchQuery(oe){L(h,oe,!0)}});var Ke=K(Wt,2);{var fs=oe=>{Sd(oe)};ne(Ke,oe=>{w(o)&&oe(fs)})}var jt=K(Ke,2),un=B(jt);{var si=oe=>{var Be=Kd(),ds=B(Be),Tr=B(ds);J(()=>ee(Tr,w(f))),F(oe,Be)},ii=oe=>{var Be=_n(),ds=Xt(Be);{var Tr=xr=>{var rl=Xd();Vn(rl,21,()=>w(u),qn,(Zd,$d,ol)=>{qd(Zd,{get wine(){return w($d)},index:ol,get hoveredWineId(){return w(p)},get selectedWineId(){return w(c)},get isAnimating(){return w(d)},get translatedPopup(){return w(g)[ol]},onBuyClick:D,onPopupClose:U,onTileEnter:P,onTileLeave:I,onTileClick:O})}),F(xr,rl)};ne(ds,xr=>{w(u)&&w(u).length>0&&xr(Tr)},!0)}F(oe,Be)};ne(un,oe=>{w(f)?oe(si):oe(ii,!1)})}var il=K(jt,2);fd(il,{get countryCode(){return a}}),F(N,V)};ne(Ce,N=>{w(m)&&N(Q)})}F(t,H),It()}return Ec(Qd,{target:document.getElementById("wineater-widget-conteiner")})});
|