@molin.ai/shop-ai 0.6.25 → 0.6.26

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.
@@ -1,16 +1,16 @@
1
- var Fc=Object.defineProperty;var ia=n=>{throw TypeError(n)};var Mc=(n,e,t)=>e in n?Fc(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var S=(n,e,t)=>Mc(n,typeof e!="symbol"?e+"":e,t),ps=(n,e,t)=>e.has(n)||ia("Cannot "+t);var d=(n,e,t)=>(ps(n,e,"read from private field"),t?t.call(n):e.get(n)),b=(n,e,t)=>e.has(n)?ia("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),A=(n,e,t,i)=>(ps(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),R=(n,e,t)=>(ps(n,e,"access private method"),t);var ra=(n,e,t,i)=>({set _(r){A(n,e,r,t)},get _(){return d(n,e,i)}});function ws(n){return[...n.v,(n.i?"!":"")+n.n].join(":")}function Dc(n,e=","){return n.map(ws).join(e)}var pa=typeof CSS<"u"&&CSS.escape||(n=>n.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function qi(n){for(var e=9,t=n.length;t--;)e=Math.imul(e^n.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function zi(n,e="@media "){return e+K(n).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(i=>`(${i}-width:${t[i]})`).join(" and "))).join(",")}function K(n=[]){return Array.isArray(n)?n:n==null?[]:[n]}function sa(n){return n}function Hi(){}var ce={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function fa(n){return n.match(/[-=:;]/g)?.length||0}function vs(n){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(n)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(fa(n),15)<<18}var Lc=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function xs({n,i:e,v:t=[]},i,r,s){n&&(n=ws({n,i:e,v:t})),s=[...K(s)];for(let a of t){let l=i.theme("screens",a);for(let u of K(l&&zi(l)||i.v(a))){var o;s.push(u),r|=l?67108864|vs(u):a=="dark"?1073741824:u[0]=="@"?vs(u):(o=u,1<<~(/:([a-z-]+)/.test(o)&&~Lc.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n,p:r,r:s,i:e}}var ha=new Map;function ms(n){if(n.d){let e=[],t=fs(n.r.reduce((i,r)=>r[0]=="@"?(e.push(r),i):r?fs(i,s=>fs(r,o=>{let a=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(a){let l=s.indexOf(a[1]);return~l?s.slice(0,l)+a[0]+s.slice(l+a[1].length):hs(s,o)}return hs(o,s)})):i,"&"),i=>hs(i,n.n?"."+pa(n.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,r)=>r+"{"+i+"}",n.d)}}function fs(n,e){return n.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,i,r)=>e(i)+r)}function hs(n,e){return n.replace(/&/g,e)}var oa=new Intl.Collator("en",{numeric:!0});function da(n,e){for(var t=0,i=n.length;t<i;){let r=i+t>>1;0>=ga(n[r],e)?t=r+1:i=r}return i}function ga(n,e){let t=n.p&ce.o;return t==(e.p&ce.o)&&(t==ce.b||t==ce.o)?0:n.p-e.p||n.o-e.o||oa.compare(aa(n.n),aa(e.n))||oa.compare(la(n.n),la(e.n))}function aa(n){return(n||"").split(/:/).pop().split("/").pop()||"\0"}function la(n){return(n||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function ds(n,e){return Math.round(parseInt(n,16)*e)}function He(n,e={}){if(typeof n=="function")return n(e);let{opacityValue:t="1",opacityVariable:i}=e,r=i?`var(${i})`:t;if(n.includes("<alpha-value>"))return n.replace("<alpha-value>",r);if(n[0]=="#"&&(n.length==4||n.length==7)){let s=(n.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[ds(n.substr(1,s),o),ds(n.substr(1+s,s),o),ds(n.substr(1+2*s,s),o),r]})`}return r=="1"?n:r=="0"?"#0000":n.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${r})`)}function va(n,e,t,i,r=[]){return function s(o,{n:a,p:l,r:u=[],i:c},p){let f=[],h="",g=0,v=0;for(let $ in o||{}){var w,D;let M=o[$];if($[0]=="@"){if(!M)continue;if($[1]=="a"){f.push(...Ss(a,l,Bi(""+M),p,l,u,c,!0));continue}if($[1]=="l"){for(let q of K(M))f.push(...s(q,{n:a,p:(w=ce[$[7]],l&~ce.o|w),r:$[7]=="d"?[]:u,i:c},p));continue}if($[1]=="i"){f.push(...K(M).map(q=>({p:-1,o:0,r:[],d:$+" "+q})));continue}if($[1]=="k"){f.push({p:ce.d,o:0,r:[$],d:s(M,{p:ce.d},p).map(ms).join("")});continue}if($[1]=="f"){f.push(...K(M).map(q=>({p:ce.d,o:0,r:[$],d:s(q,{p:ce.d},p).map(ms).join("")})));continue}}if(typeof M!="object"||Array.isArray(M))$=="label"&&M?a=M+qi(JSON.stringify([l,c,o])):(M||M===0)&&($=$.replace(/[A-Z]/g,q=>"-"+q.toLowerCase()),v+=1,g=Math.max(g,(D=$)[0]=="-"?0:fa(D)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(D)?+!!RegExp.$1||-!!RegExp.$2:0)+1),h+=(h?";":"")+K(M).map(q=>p.s($,ks(""+q,p.theme)+(c?" !important":""))).join(";"));else if($[0]=="@"||$.includes("&")){let q=l;$[0]=="@"&&($=$.replace(/\bscreen\(([^)]+)\)/g,(H,X)=>{let J=p.theme("screens",X);return J?(q|=67108864,zi(J,"")):H}),q|=vs($)),f.push(...s(M,{n:a,p:q,r:[...u,$],i:c},p))}else f.push(...s(M,{p:l,r:[...u,$]},p))}return f.unshift({n:a,p:l,o:Math.max(0,15-v)+1.5*Math.min(g||15,15),r:u,d:h}),f.sort(ga)}(n,xs(e,t,i,r),t)}function ks(n,e){return n.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,i,r,s,o="")=>{let a=e(r,o);return typeof a=="function"&&/color|fill|stroke/i.test(r)?He(a):""+K(a).filter(l=>Object(l)!==l)})}function ma(n,e){let t,i=[];for(let r of n)r.d&&r.n?t?.p==r.p&&""+t.r==""+r.r?(t.c=[t.c,r.c].filter(Boolean).join(" "),t.d=t.d+";"+r.d):i.push(t={...r,n:r.n&&e}):i.push({...r,n:r.n&&e});return i}function Ui(n,e,t=ce.u,i,r){let s=[];for(let o of n)for(let a of function(l,u,c,p,f){l={...l,i:l.i||f};let h=function(g,v){let w=ha.get(g.n);return w?w(g,v):v.r(g.n,g.v[0]=="dark")}(l,u);return h?typeof h=="string"?({r:p,p:c}=xs(l,u,c,p),ma(Ui(Bi(h),u,c,p,l.i),l.n)):Array.isArray(h)?h.map(g=>{var v,w;return{o:0,...g,r:[...K(p),...K(g.r)],p:(v=c,w=g.p??c,v&~ce.o|w)}}):va(h,l,u,c,p):[{c:ws(l),p:0,o:0,r:[]}]}(o,e,t,i,r))s.splice(da(s,a),0,a);return s}function Ss(n,e,t,i,r,s,o,a){return ma((a?t.flatMap(l=>Ui([l],i,r,s,o)):Ui(t,i,r,s,o)).map(l=>l.p&ce.o&&(l.n||e==ce.b)?{...l,p:l.p&~ce.o|e,o:0}:l),n)}function jc(n,e,t,i){var r;return r=(s,o)=>{let{n:a,p:l,r:u,i:c}=xs(s,o,e);return t&&Ss(a,e,t,o,l,u,c,i)},ha.set(n,r),n}function gs(n,e,t){if(n[n.length-1]!="("){let i=[],r=!1,s=!1,o="";for(let a of n)if(!(a=="("||/[~@]$/.test(a))){if(a[0]=="!"&&(a=a.slice(1),r=!r),a.endsWith(":")){i[a=="dark:"?"unshift":"push"](a.slice(0,-1));continue}a[0]=="-"&&(a=a.slice(1),s=!s),a.endsWith("-")&&(a=a.slice(0,-1)),a&&a!="&"&&(o+=(o&&"-")+a)}o&&(s&&(o="-"+o),e[0].push({n:o,v:i.filter(Nc),i:r}))}}function Nc(n,e,t){return t.indexOf(n)==e}var ua=new Map;function Bi(n){let e=ua.get(n);if(!e){let t=[],i=[[]],r=0,s=0,o=null,a=0,l=(u,c=0)=>{r!=a&&(t.push(n.slice(r,a+c)),u&&gs(t,i)),r=a+1};for(;a<n.length;a++){let u=n[a];if(s)n[a-1]!="\\"&&(s+=+(u=="[")||-(u=="]"));else if(u=="[")s+=1;else if(o)n[a-1]!="\\"&&o.test(n.slice(a))&&(o=null,r=a+RegExp.lastMatch.length);else if(u=="/"&&n[a-1]!="\\"&&(n[a+1]=="*"||n[a+1]=="/"))o=n[a+1]=="*"?/^\*\//:/^[\r\n]/;else if(u=="(")l(),t.push(u);else if(u==":")n[a+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(u)){l(!0);let c=t.lastIndexOf("(");if(u==")"){let p=t[c-1];if(/[~@]$/.test(p)){let f=i.shift();t.length=c,gs([...t,"#"],i);let{v:h}=i[0].pop();for(let g of f)g.v.splice(+(g.v[0]=="dark")-+(h[0]=="dark"),h.length);gs([...t,jc(p.length>1?p.slice(0,-1)+qi(JSON.stringify([p,f])):p+"("+Dc(f)+")",ce.a,f,/@$/.test(p))],i)}c=t.lastIndexOf("(",c-1)}t.length=c+1}else/[~@]/.test(u)&&n[a+1]=="("&&i.unshift([])}l(!0),ua.set(n,e=i[0])}return e}function _(n,e,t){return[n,ys(e,t)]}function ys(n,e){return typeof n=="function"?n:typeof n=="string"&&/^[\w-]+$/.test(n)?(t,i)=>({[n]:e?e(t,i):_s(t,1)}):t=>n||{[t[1]]:_s(t,2)}}function _s(n,e,t=n.slice(e).find(Boolean)||n.$$||n.input){return n.input[0]=="-"?`calc(${t} * -1)`:t}function x(n,e,t,i){return[n,Es(e,t,i)]}function Es(n,e,t){let i=typeof e=="string"?(r,s)=>({[e]:t?t(r,s):r._}):e||(({1:r,_:s},o,a)=>({[r||a]:s}));return(r,s)=>{let o=ya(n||r[1]),a=s.theme(o,r.$$)??st(r.$$,o,s);if(a!=null)return r._=_s(r,0,a),i(r,s,o)}}function pe(n,e={},t){return[n,qc(e,t)]}function qc(n={},e){return(t,i)=>{let{section:r=ya(t[0]).replace("-","")+"Color"}=n,[s,o]=Uc(t.$$);if(!s)return;let a=i.theme(r,s)||st(s,r,i);if(!a||typeof a=="object")return;let{opacityVariable:l=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:u=r.replace("Color","Opacity"),property:c=r,selector:p}=n,f=i.theme(u,o||"DEFAULT")||o&&st(o,u,i),h=e||(({_:v})=>{let w=zn(c,v);return p?{[p]:w}:w});t._={value:He(a,{opacityVariable:l||void 0,opacityValue:f||void 0}),color:v=>He(a,v),opacityVariable:l||void 0,opacityValue:f||void 0};let g=h(t,i);if(!t.dark){let v=i.d(r,s,a);v&&v!==a&&(t._={value:He(v,{opacityVariable:l||void 0,opacityValue:f||"1"}),color:w=>He(v,w),opacityVariable:l||void 0,opacityValue:f||void 0},g={"&":g,[i.v("dark")]:h(t,i)})}return g}}function Uc(n){return(n.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function zn(n,e){let t={};return typeof e=="string"?t[n]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[n]=e.value),t}function st(n,e,t){if(n[0]=="["&&n.slice(-1)=="]"){if(n=cn(ks(n.slice(1,-1),t.theme)),!e)return n;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(n)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(n))||/image/i.test(e)&&!(/^image:/.test(n)||/^[a-z-]+\(/.test(n))||/weight/i.test(e)&&!(/^(number|any):/.test(n)||/^\d+$/.test(n))||/position/i.test(e)&&/^(length|size):/.test(n)))return n.replace(/^[a-z-]+:/,"")}}function ya(n){return n.replace(/-./g,e=>e[1].toUpperCase())}function cn(n){return n.includes("url(")?n.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",i,r="")=>cn(t)+i+cn(r)):n.replace(/(^|[^\\])_+/g,(e,t)=>t+" ".repeat(e.length-t.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function Hn({presets:n=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:K(e.variants),rules:K(e.rules),ignorelist:K(e.ignorelist),hash:void 0,stringify:(i,r)=>i+":"+r,finalize:[]};for(let i of K([...n,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&K(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:r,darkMode:s=t.darkMode,darkColor:o=t.darkColor,theme:a,variants:l,rules:u,ignorelist:c,hash:p=t.hash,stringify:f=t.stringify,finalize:h}=typeof i=="function"?i(t):i;t={preflight:t.preflight!==!1&&r!==!1&&[...t.preflight,...K(r)],darkMode:s,darkColor:o,theme:{...t.theme,...a,extend:{...t.theme.extend,...a?.extend}},variants:[...t.variants,...K(l)],rules:[...t.rules,...K(u)],ignorelist:[...t.ignorelist,...K(c)],hash:p,stringify:f,finalize:[...t.finalize,...K(h)]}}return t}function ca(n,e,t,i,r,s){for(let o of e){let a=t.get(o);a||t.set(o,a=i(o));let l=a(n,r,s);if(l)return l}}function Bc(n){var e;return bs(n[0],typeof(e=n[1])=="function"?e:()=>e)}function zc(n){var e,t;return Array.isArray(n)?bs(n[0],ys(n[1],n[2])):bs(n,ys(e,t))}function bs(n,e){return _a(n,(t,i,r,s)=>{let o=i.exec(t);if(o)return o.$$=t.slice(o[0].length),o.dark=s,e(o,r)})}function _a(n,e){let t=K(n).map(Hc);return(i,r,s)=>{for(let o of t){let a=e(i,o,r,s);if(a)return a}}}function Hc(n){return typeof n=="string"?RegExp("^"+n+(n.includes("$")||n.slice(-1)=="-"?"":"$")):n}function ba(n,e){let t=Hn(n),i=function({theme:l,darkMode:u,darkColor:c=Hi,variants:p,rules:f,hash:h,stringify:g,ignorelist:v,finalize:w}){let D=new Map,$=new Map,M=new Map,q=new Map,H=_a(v,(E,ie)=>ie.test(E));p.push(["dark",Array.isArray(u)||u=="class"?`${K(u)[1]||".dark"} &`:typeof u=="string"&&u!="media"?u:"@media (prefers-color-scheme:dark)"]);let X=typeof h=="function"?E=>h(E,qi):h?qi:sa;X!==sa&&w.push(E=>({...E,n:E.n&&X(E.n),d:E.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(ie,Z)=>"--"+X(Z).replace("#",""))}));let J={theme:function({extend:E={},...ie}){let Z={},pt={get colors(){return ve("colors")},theme:ve,negative(){return{}},breakpoints(G){let ee={};for(let le in G)typeof G[le]=="string"&&(ee["screen-"+le]=G[le]);return ee}};return ve;function ve(G,ee,le,Fe){if(G){if({1:G,2:Fe}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(G)||[,G],/[.[]/.test(G)){let Ee=[];G.replace(/\[([^\]]+)\]|([^.[]+)/g,(te,me,Ce=me)=>Ee.push(Ce)),G=Ee.shift(),le=ee,ee=Ee.join("-")}let re=Z[G]||Object.assign(Object.assign(Z[G]={},ze(ie,G)),ze(E,G));if(ee==null)return re;ee||(ee="DEFAULT");let Se=re[ee]??ee.split("-").reduce((Ee,te)=>Ee?.[te],re)??le;return Fe?He(Se,{opacityValue:ks(Fe,ve)}):Se}let je={};for(let re of[...Object.keys(ie),...Object.keys(E)])je[re]=ve(re);return je}function ze(G,ee){let le=G[ee];return typeof le=="function"&&(le=le(pt)),le&&/color|fill|stroke/i.test(ee)?function Fe(je,re=[]){let Se={};for(let Ee in je){let te=je[Ee],me=[...re,Ee];Se[me.join("-")]=te,Ee=="DEFAULT"&&(me=re,Se[re.join("-")]=te),typeof te=="object"&&Object.assign(Se,Fe(te,me))}return Se}(le):le}}(l),e:pa,h:X,s(E,ie){return g(E,ie,J)},d(E,ie,Z){return c(E,ie,J,Z)},v(E){return D.has(E)||D.set(E,ca(E,p,$,Bc,J)||"&:"+E),D.get(E)},r(E,ie){let Z=JSON.stringify([E,ie]);return M.has(Z)||M.set(Z,!H(E,J)&&ca(E,f,q,zc,J,ie)),M.get(Z)},f(E){return w.reduce((ie,Z)=>Z(ie,J),E)}};return J}(t),r=new Map,s=[],o=new Set;e.resume(l=>r.set(l,l),(l,u)=>{e.insert(l,s.length,u),s.push(u),o.add(l)});function a(l){let u=i.f(l),c=ms(u);if(c&&!o.has(c)){o.add(c);let p=da(s,l);e.insert(c,p,l),s.splice(p,0,l)}return u.n}return Object.defineProperties(function(u){if(!r.size)for(let p of K(t.preflight))typeof p=="function"&&(p=p(i)),p&&(typeof p=="string"?Ss("",ce.b,Bi(p),i,ce.b,[],!1,!0):va(p,{},i,ce.b)).forEach(a);u=""+u;let c=r.get(u);if(!c){let p=new Set;for(let f of Ui(Bi(u),i))p.add(f.c).add(a(f));c=[...p].filter(Boolean).join(" "),r.set(u,c).set(c,c)}return c},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:t,snapshot(){let l=e.snapshot(),u=new Set(o),c=new Map(r),p=[...s];return()=>{l(),o=u,r=c,s=p}},clear(){e.clear(),o=new Set,r=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Wc(n,e){return n!=e&&""+n.split(" ").sort()!=""+e.split(" ").sort()}function wa(n){let e=new MutationObserver(t);return{observe(r){e.observe(r,{attributeFilter:["class"],subtree:!0,childList:!0}),i(r),t([{target:r,type:""}])},disconnect(){e.disconnect()}};function t(r){for(let{type:s,target:o}of r)if(s[0]=="a")i(o);else for(let a of o.querySelectorAll("[class]"))i(a);e.takeRecords()}function i(r){let s,o=r.getAttribute?.("class");o&&Wc(o,s=n(o))&&r.setAttribute("class",s)}}function Vc(n){let e=document.querySelector(n||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function Wi(n){let e=n?.cssRules?n:(n&&typeof n!="string"?n:Vc(n)).sheet;return{target:e,snapshot(){let t=Array.from(e.cssRules,i=>i.cssText);return()=>{this.clear(),t.forEach(this.insert)}},clear(){for(let t=e.cssRules.length;t--;)e.deleteRule(t)},destroy(){e.ownerNode?.remove()},insert(t,i){try{e.insertRule(t,i)}catch{e.insertRule(":root{}",i)}},resume:Hi}}var Gc=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function xa(n){return Gc.get(n)}function ka(n){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(n);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function Sa(n,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(n);return t?t[1]?/^sti/i.test(e)?1:0:t[2]?/^pat/i.test(e)?1:0:t[3]?/^image-/i.test(e)?1:0:t[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var Xc=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Vi(){return({stringify:n})=>({stringify(e,t,i){let r="",s=xa(e);s&&(r+=n(s,t,i)+";");let o=ka(e),a=Sa(e,t);for(let l of Xc)o&l[1]&&(r+=n(l[0]+e,t,i)+";"),a&l[1]&&(r+=n(e,l[0]+t,i)+";");return r+n(e,t,i)}})}function Gi(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Es("lineClamp",({_:n})=>Ea(n))],["line-clamp-(\\d+)",({1:n})=>Ea(n)]]}}function Ea(n){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${n}`}}var Vn={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...Ne(4,"rem",4,.5,.5),...Ne(12,"rem",4,5),14:"3.5rem",...Ne(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:B("blur"),backdropBrightness:B("brightness"),backdropContrast:B("contrast"),backdropGrayscale:B("grayscale"),backdropHueRotate:B("hueRotate"),backdropInvert:B("invert"),backdropOpacity:B("opacity"),backdropSaturate:B("saturate"),backdropSepia:B("sepia"),backgroundColor:B("colors"),backgroundImage:{none:"none"},backgroundOpacity:B("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...Ne(200,"",100,0,50),...Ne(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:n})=>({DEFAULT:n("colors.gray.200","currentColor"),...n("colors")}),borderOpacity:B("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:B("spacing"),borderWidth:{DEFAULT:"1px",...We(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:B("colors"),caretColor:B("colors"),accentColor:({theme:n})=>({auto:"auto",...n("colors")}),contrast:{...Ne(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:B("borderColor"),divideOpacity:B("borderOpacity"),divideWidth:B("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:n})=>({...n("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:n})=>({...n("spacing"),...Wn(2,6),...Wn(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:B("spacing"),gradientColorStops:B("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:n})=>({...n("spacing"),...Wn(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:n})=>({...n("spacing"),...Wn(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...Ne(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:n})=>({auto:"auto",...n("spacing")}),maxHeight:({theme:n})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...n("spacing")}),maxWidth:({theme:n,breakpoints:e})=>({...e(n("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...Ne(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:B("spacing"),placeholderColor:B("colors"),placeholderOpacity:B("opacity"),outlineColor:B("colors"),outlineOffset:We(8,"px"),outlineWidth:We(8,"px"),ringColor:({theme:n})=>({...n("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:B("colors"),ringOffsetWidth:We(8,"px"),ringOpacity:({theme:n})=>({...n("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...We(8,"px")},rotate:{...We(2,"deg"),...We(12,"deg",3),...We(180,"deg",45)},saturate:Ne(200,"",100,0,50),scale:{...Ne(150,"",100,0,50),...Ne(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:B("spacing"),scrollPadding:B("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...We(2,"deg"),...We(12,"deg",3)},space:B("spacing"),stroke:({theme:n})=>({...n("colors"),none:"none"}),strokeWidth:Ne(2),textColor:B("colors"),textDecorationColor:B("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...We(8,"px")},textUnderlineOffset:{auto:"auto",...We(8,"px")},textIndent:B("spacing"),textOpacity:B("opacity"),transitionDuration:({theme:n})=>({...n("durations"),DEFAULT:"150ms"}),transitionDelay:B("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:n})=>({...n("spacing"),...Wn(2,4),full:"100%"}),width:({theme:n})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...n("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...Ne(50,"",1,0,10),auto:"auto"}};function Wn(n,e){let t={};do for(var i=1;i<n;i++)t[`${i}/${n}`]=Number((i/n*100).toFixed(6))+"%";while(++n<=e);return t}function We(n,e,t=0){let i={};for(;t<=n;t=2*t||1)i[t]=t+e;return i}function Ne(n,e="",t=1,i=0,r=1,s={}){for(;i<=n;i+=r)s[i]=i/t+e;return s}function B(n){return({theme:e})=>e(n)}var $a={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${Vn.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${Vn.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var Pa=[_("\\[([-\\w]+):(.+)]",({1:n,2:e},t)=>({"@layer overrides":{"&":{[n]:st(`[${e}]`,"",t)}}})),_("(group|peer)([~/][^-[]+)?",({input:n},{h:e})=>[{c:e(n)}]),x("aspect-","aspectRatio"),_("container",(n,{theme:e})=>{let{screens:t=e("screens"),center:i,padding:r}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let a in t){let l=t[a];typeof l=="string"&&(s[zi(l)]={"&":{maxWidth:l,...o(a)}})}return s;function o(a){let l=r&&(typeof r=="string"?r:r[a]||r.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),x("content-","content",({_:n})=>({"--tw-content":n,content:"var(--tw-content)"})),_("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),_("box-(border|content)","boxSizing",({1:n})=>n+"-box"),_("hidden",{display:"none"}),_("table-(auto|fixed)","tableLayout"),_(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",_("isolate","isolation"),_("object-(contain|cover|fill|none|scale-down)","objectFit"),x("object-","objectPosition"),_("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Xi),_("overscroll(-[xy])?-(auto|contain|none)",({1:n="",2:e})=>({["overscroll-behavior"+n]:e})),_("(static|fixed|absolute|relative|sticky)","position"),x("-?inset(-[xy])?(?:$|-)","inset",({1:n,_:e})=>({top:n!="-x"&&e,right:n!="-y"&&e,bottom:n!="-x"&&e,left:n!="-y"&&e})),x("-?(top|bottom|left|right)(?:$|-)","inset"),_("(visible|collapse)","visibility"),_("invisible",{visibility:"hidden"}),x("-?z-","zIndex"),_("flex-((row|col)(-reverse)?)","flexDirection",Ca),_("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),x("(flex-(?:grow|shrink))(?:$|-)"),x("(flex)-"),x("grow(?:$|-)","flexGrow"),x("shrink(?:$|-)","flexShrink"),x("basis-","flexBasis"),x("-?(order)-"),"-?(order)-(\\d+)",x("grid-cols-","gridTemplateColumns"),_("grid-cols-(\\d+)","gridTemplateColumns",Ra),x("col-","gridColumn"),_("col-(span)-(\\d+)","gridColumn",Ta),x("col-start-","gridColumnStart"),_("col-start-(auto|\\d+)","gridColumnStart"),x("col-end-","gridColumnEnd"),_("col-end-(auto|\\d+)","gridColumnEnd"),x("grid-rows-","gridTemplateRows"),_("grid-rows-(\\d+)","gridTemplateRows",Ra),x("row-","gridRow"),_("row-(span)-(\\d+)","gridRow",Ta),x("row-start-","gridRowStart"),_("row-start-(auto|\\d+)","gridRowStart"),x("row-end-","gridRowEnd"),_("row-end-(auto|\\d+)","gridRowEnd"),_("grid-flow-((row|col)(-dense)?)","gridAutoFlow",n=>Xi(Ca(n))),_("grid-flow-(dense)","gridAutoFlow"),x("auto-cols-","gridAutoColumns"),x("auto-rows-","gridAutoRows"),x("gap-x(?:$|-)","gap","columnGap"),x("gap-y(?:$|-)","gap","rowGap"),x("gap(?:$|-)","gap"),"(justify-(?:items|self))-",_("justify-","justifyContent",Aa),_("(content|items|self)-",n=>({["align-"+n[1]]:Aa(n)})),_("(place-(content|items|self))-",({1:n,$$:e})=>({[n]:("wun".includes(e[3])?"space-":"")+e})),x("p([xytrbl])?(?:$|-)","padding",pn("padding")),x("-?m([xytrbl])?(?:$|-)","margin",pn("margin")),x("-?space-(x|y)(?:$|-)","space",({1:n,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${n}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[n]]:`calc(${e} * calc(1 - var(--tw-space-${n}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[n]]:`calc(${e} * var(--tw-space-${n}-reverse))`}})),_("space-(x|y)-reverse",({1:n})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${n}-reverse`]:"1"}})),x("w-","width"),x("min-w-","minWidth"),x("max-w-","maxWidth"),x("h-","height"),x("min-h-","minHeight"),x("max-h-","maxHeight"),x("font-","fontWeight"),x("font-","fontFamily",({_:n})=>typeof(n=K(n))[1]=="string"?{fontFamily:Ye(n)}:{fontFamily:Ye(n[0]),...n[1]}),_("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),_("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),_("italic","fontStyle"),_("not-italic",{fontStyle:"normal"}),_("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:n,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":n)]:n,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...kt({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),x("tracking-","letterSpacing"),x("leading-","lineHeight"),_("list-(inside|outside)","listStylePosition"),x("list-","listStyleType"),_("list-","listStyleType"),x("placeholder-opacity-","placeholderOpacity",({_:n})=>({"&::placeholder":{"--tw-placeholder-opacity":n}})),pe("placeholder-",{property:"color",selector:"&::placeholder"}),_("text-(left|center|right|justify|start|end)","textAlign"),_("text-(ellipsis|clip)","textOverflow"),x("text-opacity-","textOpacity","--tw-text-opacity"),pe("text-",{property:"color"}),x("text-","fontSize",({_:n})=>typeof n=="string"?{fontSize:n}:{fontSize:n[0],...typeof n[1]=="string"?{lineHeight:n[1]}:n[1]}),x("indent-","textIndent"),_("(overline|underline|line-through)","textDecorationLine"),_("no-underline",{textDecorationLine:"none"}),x("underline-offset-","textUnderlineOffset"),pe("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),x("decoration-","textDecorationThickness"),_("decoration-","textDecorationStyle"),_("(uppercase|lowercase|capitalize)","textTransform"),_("normal-case",{textTransform:"none"}),_("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),_("align-","verticalAlign"),_("whitespace-","whiteSpace"),_("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),_("break-words",{overflowWrap:"break-word"}),_("break-all",{wordBreak:"break-all"}),_("break-keep",{wordBreak:"keep-all"}),pe("caret-",{opacityVariable:!1,opacitySection:"opacity"}),pe("accent-",{opacityVariable:!1,opacitySection:"opacity"}),_("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:n})=>`linear-gradient(to ${zt(n," ")},var(--tw-gradient-stops))`),pe("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-gradient-from":n.value,"--tw-gradient-to":n.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),pe("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-gradient-to":n.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${n.value},var(--tw-gradient-to)`})),pe("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),_("bg-(fixed|local|scroll)","backgroundAttachment"),_("bg-origin-(border|padding|content)","backgroundOrigin",({1:n})=>n+"-box"),_(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),_("bg-blend-","backgroundBlendMode"),_("bg-clip-(border|padding|content|text)","backgroundClip",({1:n})=>n+(n=="text"?"":"-box")),x("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),pe("bg-",{section:"backgroundColor"}),x("bg-","backgroundImage"),x("bg-","backgroundPosition"),_("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Xi),x("bg-","backgroundSize"),x("rounded(?:$|-)","borderRadius"),x("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:n,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[n]||[n,n];return{[`border-${zt(t[0])}-radius`]:e,[`border-${zt(t[1])}-radius`]:e}}),_("border-(collapse|separate)","borderCollapse"),x("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),_("border-(solid|dashed|dotted|double|none)","borderStyle"),x("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:n,_:e})=>({...kt({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(n||"-x")]:e,["--tw-border-spacing"+(n||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),pe("border-([xytrbl])-",{section:"borderColor"},pn("border","Color")),pe("border-"),x("border-([xytrbl])(?:$|-)","borderWidth",pn("border","Width")),x("border(?:$|-)","borderWidth"),x("divide-opacity(?:$|-)","divideOpacity",({_:n})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":n}})),_("divide-(solid|dashed|dotted|double|none)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:n}})),_("divide-([xy]-reverse)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+n]:"1"}})),x("divide-([xy])(?:$|-)","divideWidth",({1:n,_:e})=>{let t={x:"lr",y:"tb"}[n];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${n}-reverse`]:"0",[`border-${zt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${n}-reverse)))`,[`border-${zt(t[1])}Width`]:`calc(${e} * var(--tw-divide-${n}-reverse))`}}}),pe("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),x("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),pe("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),x("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),_("ring-inset",{"--tw-ring-inset":"inset"}),pe("ring-",{property:"--tw-ring-color"}),x("ring(?:$|-)","ringWidth",({_:n},{theme:e})=>({...kt({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":He(e("ringOffsetColor","","#fff")),"--tw-ring-color":He(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${n} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),pe("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-shadow-color":n.value,"--tw-shadow":"var(--tw-shadow-colored)"})),x("shadow(?:$|-)","boxShadow",({_:n})=>({...kt({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":Ye(n),"--tw-shadow-colored":Ye(n).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),x("(opacity)-"),_("mix-blend-","mixBlendMode"),...Ia(),...Ia("backdrop-"),x("transition(?:$|-)","transitionProperty",(n,{theme:e})=>({transitionProperty:Ye(n),transitionTimingFunction:n._=="none"?void 0:Ye(e("transitionTimingFunction","")),transitionDuration:n._=="none"?void 0:Ye(e("transitionDuration",""))})),x("duration(?:$|-)","transitionDuration","transitionDuration",Ye),x("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Ye),x("delay(?:$|-)","transitionDelay","transitionDelay",Ye),x("animate(?:$|-)","animation",(n,{theme:e,h:t,e:i})=>{let r=Ye(n),s=r.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(t(s[0])))]:o,animation:s.join(" ")}:{animation:r}}),"(transform)-(none)",_("transform",Cs),_("transform-(cpu|gpu)",({1:n})=>({"--tw-transform":Oa(n=="gpu")})),x("scale(-[xy])?-","scale",({1:n,_:e})=>({["--tw-scale"+(n||"-x")]:e,["--tw-scale"+(n||"-y")]:e,...Cs()})),x("-?(rotate)-","rotate",$s),x("-?(translate-[xy])-","translate",$s),x("-?(skew-[xy])-","skew",$s),_("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Xi),"(appearance)-",x("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",x("(cursor)-"),"(cursor)-",_("snap-(none)","scroll-snap-type"),_("snap-(x|y|both)",({1:n})=>({...kt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":n+" var(--tw-scroll-snap-strictness)"})),_("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),_("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),_("snap-(normal|always)","scroll-snap-stop"),_("scroll-(auto|smooth)","scroll-behavior"),x("scroll-p([xytrbl])?(?:$|-)","padding",pn("scroll-padding")),x("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",pn("scroll-margin")),_("touch-(auto|none|manipulation)","touch-action"),_("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:n,2:e,3:t})=>({...kt({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":t?"pan-y":n}`]:n,"touch-action":"var(--tw-touch-action)"})),_("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),_("outline",{outlineStyle:"solid"}),_("outline-(dashed|dotted|double)","outlineStyle"),x("-?(outline-offset)-"),pe("outline-",{opacityVariable:!1,opacitySection:"opacity"}),x("outline-","outlineWidth"),"(pointer-events)-",x("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:n})=>({x:"horizontal",y:"vertical"})[n]||n||"both"],_("select-(none|text|all|auto)","userSelect"),pe("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),pe("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),x("stroke-","strokeWidth"),_("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),_("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Xi(n){return(typeof n=="string"?n:n[1]).replace(/-/g," ").trim()}function Ca(n){return(typeof n=="string"?n:n[1]).replace("col","column")}function zt(n,e="-"){let t=[];for(let i of n)t.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return t.join(e)}function Ye(n){return n&&""+(n._||n)}function Aa({$$:n}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[n[3]||""]||"")+n}function pn(n,e=""){return({1:t,_:i})=>{let r={x:"lr",y:"tb"}[t]||t+t;return r?{...zn(n+"-"+zt(r[0])+e,i),...zn(n+"-"+zt(r[1])+e,i)}:zn(n+e,i)}}function Ia(n=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",n&&"opacity","saturate","sepia",!n&&"drop-shadow"].filter(Boolean),t={};for(let i of e)t[`--tw-${n}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...kt(t),[`${n}filter`]:e.map(i=>`var(--tw-${n}${i})`).join(" ")},[`(${n}filter)-(none)`,_(`${n}filter`,t),...e.map(i=>x(`${i[0]=="h"?"-?":""}(${n}${i})(?:$|-)`,i,({1:r,_:s})=>({[`--tw-${r}`]:K(s).map(o=>`${i}(${o})`).join(" "),...t})))]}function $s({1:n,_:e}){return{["--tw-"+n]:e,...Cs()}}function Cs(){return{...kt({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":Oa()}),transform:"var(--tw-transform)"}}function Oa(n){return[n?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function Ta({1:n,2:e}){return`${n} ${e} / ${n} ${e}`}function Ra({1:n}){return`repeat(${n},minmax(0,1fr))`}function kt(n){return{"@layer defaults":{"*,::before,::after":n,"::backdrop":n}}}var Fa=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:n})=>`@media (orientation:${n})`],["contrast-(more|less)",({1:n})=>`@media (prefers-contrast:${n})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:n})=>`&::${n}`],["(marker|selection)",({1:n})=>`& *::${n},&::${n}`],["file","&::file-selector-button"],["(first|last|only)",({1:n})=>`&:${n}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:n,$$:e},t)=>e&&`&[${n}-${t.theme(n,e)||st(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:n,3:e="",4:t,5:i="",6:r=e},{e:s,h:o,v:a})=>{let l=cn(i)||(t[0]=="["?t:a(t.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(n+r))})`)}${n[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:n})=>`[dir="${n}"] &`],["supports-",({$$:n},e)=>{if(n&&(n=e.theme("supports",n)||st(n,"",e)),n)return n.includes(":")||(n+=":var(--tw)"),/^\w*\s*\(/.test(n)||(n=`(${n})`),`@supports ${n.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:n},e)=>{if(n&&(n=e.theme("screens",n)||st(n,"",e)),typeof n=="string")return`@media not all and (min-width:${n})`}],["min-",({$$:n},e)=>(n&&(n=st(n,"",e)),n&&`@media (min-width:${n})`)],[/^\[(.+)]$/,({1:n})=>/[&@]/.test(n)&&cn(n).replace(/[}]+$/,"").split("{")]];function Ma({colors:n,disablePreflight:e}={}){return{preflight:e?void 0:$a,theme:{...Vn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...n}},variants:Fa,rules:Pa,finalize(t){return t.n&&t.d&&t.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(t.d)?{...t,d:"content:var(--tw-content);"+t.d}:t}}}var Jc={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Yc={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Kc={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Qc={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Zc={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},ep={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},tp={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},np={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},ip={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},rp={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},sp={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},op={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},ap={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},lp={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},up={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},cp={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},pp={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},fp={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},hp={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},dp={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},gp={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},vp={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Da={__proto__:null,slate:Jc,gray:Yc,zinc:Kc,neutral:Qc,stone:Zc,red:ep,orange:tp,amber:np,yellow:ip,lime:rp,green:sp,emerald:op,teal:ap,cyan:lp,sky:up,blue:cp,indigo:pp,violet:fp,purple:hp,fuchsia:dp,pink:gp,rose:vp};function Ji({disablePreflight:n}={}){return Ma({colors:Da,disablePreflight:n})}function Yi({className:n="prose",defaultColor:e="gray",extend:t={},colors:i={}}={}){return i={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...i,dark:i.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...i.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${n}-${s}`,(a,l)=>Na(n,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,u=>`& :is(${u.trim()})`)]),rules:[[`(lead|not-${n})`,({1:s},{h:o})=>[{c:o(s)}]],[`${n}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[n+"-",({$$:s},o)=>{let a=ja(o.theme("fontSize",s));return a&&{"@layer components":a}}],[n+"-",({$$:s},o)=>r(s,o)],[n,(s,o)=>({...r(e,o),"@layer base":[La(n,o,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:P(20,16),marginBottom:P(20,16),paddingLeft:P(26,16)},li:{marginTop:P(8,16),marginBottom:P(8,16)},"ol>li,ul>li":{paddingLeft:P(6,16)},">ul>li p":{marginTop:P(12,16),marginBottom:P(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:P(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:P(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:P(12,16),marginBottom:P(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:P(48,16),marginBottom:P(48,16)},blockquote:{marginTop:P(32,20),marginBottom:P(32,20),paddingLeft:P(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:P(20,16),marginBottom:P(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:P(36,16),marginTop:"0",marginBottom:P(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:P(24,16),marginTop:P(48,24),marginBottom:P(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:P(20,16),marginTop:P(32,20),marginBottom:P(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:P(24,16),marginBottom:P(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:P(32,16),marginBottom:P(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:P(14,16),lineHeight:"1.4",marginTop:P(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:P(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:P(21,24)},"h3 code":{fontSize:P(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:P(14,16),lineHeight:"1.7",marginTop:P(24,14),marginBottom:P(24,14),borderRadius:"0.375rem",paddingTop:P(12,14),paddingRight:P(16,14),paddingBottom:P(12,14),paddingLeft:P(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:P(32,16),marginBottom:P(32,16),fontSize:P(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:P(8,14),paddingBottom:P(8,14),paddingLeft:P(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:P(8,14),paddingRight:P(8,14),paddingBottom:P(8,14),paddingLeft:P(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${o.e(o.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:P(20,16),lineHeight:"1.6",marginTop:P(24,20),marginBottom:P(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),La(n,o,t)],"@layer components":{...ja(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function r(s,o){let a={},l={},u=(c,p,f)=>{let h=o.theme(`colors.${s}.${p}`,p);f["--tw-prose-"+c]=He(h);let g=f!=l&&o.d("colors",`${s}-${p}`,h);g&&(l["--tw-prose-"+c]=He(g))};for(let c in i){let p=i[c];c!="dark"&&p&&u(c,p,a)}for(let c in i.dark||{}){let p=i.dark[c];p&&(i.dark?u("invert-"+c,p,a):u(c,p,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function La(n,e,t){let i={};for(let r in t)i[Na(n,r,e,s=>`.${e.e(e.h(n))}${s}`)]=t[r];return i}function Na(n,e,{e:t,h:i},r){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",a=s,l="")=>r(`${o}:where(${a}):not(:where(.${t(i("not-"+n))} *))${l}`))}function ja(n){return n?typeof n=="string"?{fontSize:n}:{fontSize:n[0],...typeof n[1]=="string"?{lineHeight:n[1]}:n[1]}:void 0}function P(n,e){return`${(n/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var As=Hn({darkMode:"class",theme:{extend:{fontFamily:{display:["Space Grotesk","sans-serif"],sans:["Open Sans","sans-serif"],serif:["Roboto Slab","serif"],mono:["Roboto Mono","monospace"]},colors:{primary:{50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"},secondary:{50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},tertiary:{50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"}}}},presets:[Ji(),Vi(),Gi(),Yi()],hash:!1});function Ki(n,e=!0){let t=function(){if(mp)try{let l=Wi(new CSSStyleSheet);return l.connect=u=>{let c=Is(u);c.adoptedStyleSheets=[...c.adoptedStyleSheets,l.target]},l.disconnect=Hi,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Wi(s)],a=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(u=>u.snapshot());return()=>l.forEach(u=>u())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,u,c){o[0].insert(l,u,c);let p=this.target.cssRules[u];o.forEach((f,h)=>h&&f.target.insertRule(p.cssText,u))},resume(l,u){return o[0].resume(l,u)},connect(l){let u=document.createElement("style");Is(l).appendChild(u);let c=Wi(u),{cssRules:p}=this.target;for(let f=0;f<p.length;f++)c.target.insertRule(p[f].cssText,f);o.push(c),a.set(l,c)},disconnect(l){let u=o.indexOf(a.get(l));u>=0&&o.splice(u,1)}}}(),i=ba({...n,hash:n.hash??e},t),r=wa(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),r.observe(Is(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var mp=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function Is(n){return n.shadowRoot||n.attachShadow({mode:"open"})}var Ts=n=>Ki(As)(n);var Qi=globalThis,Zi=Qi.ShadowRoot&&(Qi.ShadyCSS===void 0||Qi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rs=Symbol(),qa=new WeakMap,Gn=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Rs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Zi&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=qa.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&qa.set(t,e))}return e}toString(){return this.cssText}},Ua=n=>new Gn(typeof n=="string"?n:n+"",void 0,Rs),Ps=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((i,r,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+n[s+1],n[0]);return new Gn(t,n,Rs)},Os=(n,e)=>{if(Zi)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),r=Qi.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}},er=Zi?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return Ua(t)})(n):n;var{is:yp,defineProperty:_p,getOwnPropertyDescriptor:bp,getOwnPropertyNames:wp,getOwnPropertySymbols:xp,getPrototypeOf:kp}=Object,tr=globalThis,Ba=tr.trustedTypes,Sp=Ba?Ba.emptyScript:"",Ep=tr.reactiveElementPolyfillSupport,Xn=(n,e)=>n,Fs={toAttribute(n,e){switch(e){case Boolean:n=n?Sp:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Ha=(n,e)=>!yp(n,e),za={attribute:!0,type:String,converter:Fs,reflect:!1,hasChanged:Ha};Symbol.metadata??=Symbol("metadata"),tr.litPropertyMetadata??=new WeakMap;var ft=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=za){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(e,i,t);r!==void 0&&_p(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){let{get:r,set:s}=bp(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return r?.call(this)},set(o){let a=r?.call(this);s.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??za}static _$Ei(){if(this.hasOwnProperty(Xn("elementProperties")))return;let e=kp(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Xn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Xn("properties"))){let t=this.properties,i=[...wp(t),...xp(t)];for(let r of i)this.createProperty(r,t[r])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[i,r]of t)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[t,i]of this.elementProperties){let r=this._$Eu(t,i);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let r of i)t.unshift(er(r))}else e!==void 0&&t.push(er(e));return t}static _$Eu(e,t){let i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Os(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){let i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:Fs).toAttribute(t,i.type);this._$Em=e,s==null?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(e,t){let i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let s=i.getPropertyOptions(r),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Fs;this._$Em=r,this[r]=o.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??Ha)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,s]of this._$Ep)this[r]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,s]of i)s.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],s)}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(t)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(t=>this._$EC(t,this[t])),this._$EU()}updated(e){}firstUpdated(e){}};ft.elementStyles=[],ft.shadowRootOptions={mode:"open"},ft[Xn("elementProperties")]=new Map,ft[Xn("finalized")]=new Map,Ep?.({ReactiveElement:ft}),(tr.reactiveElementVersions??=[]).push("2.0.4");var Ds=globalThis,nr=Ds.trustedTypes,Wa=nr?nr.createPolicy("lit-html",{createHTML:n=>n}):void 0,Ls="$lit$",ht=`lit$${Math.random().toFixed(9).slice(2)}$`,js="?"+ht,$p=`<${js}>`,Vt=document,Yn=()=>Vt.createComment(""),Kn=n=>n===null||typeof n!="object"&&typeof n!="function",Ka=Array.isArray,Qa=n=>Ka(n)||typeof n?.[Symbol.iterator]=="function",Ms=`[
2
- \f\r]`,Jn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Va=/-->/g,Ga=/>/g,Ht=RegExp(`>|${Ms}(?:([^\\s"'>=/]+)(${Ms}*=${Ms}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Xa=/'/g,Ja=/"/g,Za=/^(?:script|style|textarea|title)$/i,el=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),O=el(1),gd=el(2),Ke=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),Ya=new WeakMap,Wt=Vt.createTreeWalker(Vt,129);function tl(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Wa!==void 0?Wa.createHTML(e):e}var nl=(n,e)=>{let t=n.length-1,i=[],r,s=e===2?"<svg>":"",o=Jn;for(let a=0;a<t;a++){let l=n[a],u,c,p=-1,f=0;for(;f<l.length&&(o.lastIndex=f,c=o.exec(l),c!==null);)f=o.lastIndex,o===Jn?c[1]==="!--"?o=Va:c[1]!==void 0?o=Ga:c[2]!==void 0?(Za.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=Ht):c[3]!==void 0&&(o=Ht):o===Ht?c[0]===">"?(o=r??Jn,p=-1):c[1]===void 0?p=-2:(p=o.lastIndex-c[2].length,u=c[1],o=c[3]===void 0?Ht:c[3]==='"'?Ja:Xa):o===Ja||o===Xa?o=Ht:o===Va||o===Ga?o=Jn:(o=Ht,r=void 0);let h=o===Ht&&n[a+1].startsWith("/>")?" ":"";s+=o===Jn?l+$p:p>=0?(i.push(u),l.slice(0,p)+Ls+l.slice(p)+ht+h):l+ht+(p===-2?a:h)}return[tl(n,s+(n[t]||"<?>")+(e===2?"</svg>":"")),i]},Qn=class n{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,o=0,a=e.length-1,l=this.parts,[u,c]=nl(e,t);if(this.el=n.createElement(u,i),Wt.currentNode=this.el.content,t===2){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=Wt.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let p of r.getAttributeNames())if(p.endsWith(Ls)){let f=c[o++],h=r.getAttribute(p).split(ht),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:s,name:g[2],strings:h,ctor:g[1]==="."?rr:g[1]==="?"?sr:g[1]==="@"?or:Xt}),r.removeAttribute(p)}else p.startsWith(ht)&&(l.push({type:6,index:s}),r.removeAttribute(p));if(Za.test(r.tagName)){let p=r.textContent.split(ht),f=p.length-1;if(f>0){r.textContent=nr?nr.emptyScript:"";for(let h=0;h<f;h++)r.append(p[h],Yn()),Wt.nextNode(),l.push({type:2,index:++s});r.append(p[f],Yn())}}}else if(r.nodeType===8)if(r.data===js)l.push({type:2,index:s});else{let p=-1;for(;(p=r.data.indexOf(ht,p+1))!==-1;)l.push({type:7,index:s}),p+=ht.length-1}s++}}static createElement(e,t){let i=Vt.createElement("template");return i.innerHTML=e,i}};function Gt(n,e,t=n,i){if(e===Ke)return e;let r=i!==void 0?t._$Co?.[i]:t._$Cl,s=Kn(e)?void 0:e._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),s===void 0?r=void 0:(r=new s(n),r._$AT(n,t,i)),i!==void 0?(t._$Co??=[])[i]=r:t._$Cl=r),r!==void 0&&(e=Gt(n,r._$AS(n,e.values),r,i)),e}var ir=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:i}=this._$AD,r=(e?.creationScope??Vt).importNode(t,!0);Wt.currentNode=r;let s=Wt.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let u;l.type===2?u=new fn(s,s.nextSibling,this,e):l.type===1?u=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(u=new ar(s,this,e)),this._$AV.push(u),l=i[++a]}o!==l?.index&&(s=Wt.nextNode(),o++)}return Wt.currentNode=Vt,r}p(e){let t=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},fn=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Gt(this,e,t),Kn(e)?e===L||e==null||e===""?(this._$AH!==L&&this._$AR(),this._$AH=L):e!==this._$AH&&e!==Ke&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Qa(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==L&&Kn(this._$AH)?this._$AA.nextSibling.data=e:this.T(Vt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=Qn.createElement(tl(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(t);else{let s=new ir(r,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=Ya.get(e.strings);return t===void 0&&Ya.set(e.strings,t=new Qn(e)),t}k(e){Ka(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,r=0;for(let s of e)r===t.length?t.push(i=new n(this.S(Yn()),this.S(Yn()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Xt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=L,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=L}_$AI(e,t=this,i,r){let s=this.strings,o=!1;if(s===void 0)e=Gt(this,e,t,0),o=!Kn(e)||e!==this._$AH&&e!==Ke,o&&(this._$AH=e);else{let a=e,l,u;for(e=s[0],l=0;l<s.length-1;l++)u=Gt(this,a[i+l],t,l),u===Ke&&(u=this._$AH[l]),o||=!Kn(u)||u!==this._$AH[l],u===L?e=L:e!==L&&(e+=(u??"")+s[l+1]),this._$AH[l]=u}o&&!r&&this.j(e)}j(e){e===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},rr=class extends Xt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===L?void 0:e}},sr=class extends Xt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==L)}},or=class extends Xt{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=Gt(this,e,t,0)??L)===Ke)return;let i=this._$AH,r=e===L&&i!==L||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==L&&(i===L||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ar=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Gt(this,e)}},il={P:Ls,A:ht,C:js,M:1,L:nl,R:ir,D:Qa,V:Gt,I:fn,H:Xt,N:sr,U:or,B:rr,F:ar},Cp=Ds.litHtmlPolyfillSupport;Cp?.(Qn,fn),(Ds.litHtmlVersions??=[]).push("3.1.4");var rl=(n,e,t)=>{let i=t?.renderBefore??e,r=i._$litPart$;if(r===void 0){let s=t?.renderBefore??null;i._$litPart$=r=new fn(e.insertBefore(Yn(),s),s,void 0,t??{})}return r._$AI(n),r};var N=class extends ft{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=rl(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Ke}};N._$litElement$=!0,N.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:N});var Ap=globalThis.litElementPolyfillSupport;Ap?.({LitElement:N});(globalThis.litElementVersions??=[]).push("4.0.6");var Ip="Free",lr,sl,Zn=class extends Ts(N){constructor(){super();b(this,lr);this.planConfigs}render(){return O`
1
+ var Bc=Object.defineProperty;var ua=n=>{throw TypeError(n)};var zc=(n,e,t)=>e in n?Bc(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var S=(n,e,t)=>zc(n,typeof e!="symbol"?e+"":e,t),ds=(n,e,t)=>e.has(n)||ua("Cannot "+t);var h=(n,e,t)=>(ds(n,e,"read from private field"),t?t.call(n):e.get(n)),_=(n,e,t)=>e.has(n)?ua("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),C=(n,e,t,i)=>(ds(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),$=(n,e,t)=>(ds(n,e,"access private method"),t);var ca=(n,e,t,i)=>({set _(r){C(n,e,r,t)},get _(){return h(n,e,i)}});function Ss(n){return[...n.v,(n.i?"!":"")+n.n].join(":")}function Hc(n,e=","){return n.map(Ss).join(e)}var ma=typeof CSS<"u"&&CSS.escape||(n=>n.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function zi(n){for(var e=9,t=n.length;t--;)e=Math.imul(e^n.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function Vi(n,e="@media "){return e+K(n).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(i=>`(${i}-width:${t[i]})`).join(" and "))).join(",")}function K(n=[]){return Array.isArray(n)?n:n==null?[]:[n]}function pa(n){return n}function Gi(){}var ce={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function ya(n){return n.match(/[-=:;]/g)?.length||0}function _s(n){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(n)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(ya(n),15)<<18}var Wc=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function Es({n,i:e,v:t=[]},i,r,s){n&&(n=Ss({n,i:e,v:t})),s=[...K(s)];for(let a of t){let l=i.theme("screens",a);for(let u of K(l&&Vi(l)||i.v(a))){var o;s.push(u),r|=l?67108864|_s(u):a=="dark"?1073741824:u[0]=="@"?_s(u):(o=u,1<<~(/:([a-z-]+)/.test(o)&&~Wc.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n,p:r,r:s,i:e}}var _a=new Map;function bs(n){if(n.d){let e=[],t=gs(n.r.reduce((i,r)=>r[0]=="@"?(e.push(r),i):r?gs(i,s=>gs(r,o=>{let a=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(a){let l=s.indexOf(a[1]);return~l?s.slice(0,l)+a[0]+s.slice(l+a[1].length):vs(s,o)}return vs(o,s)})):i,"&"),i=>vs(i,n.n?"."+ma(n.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((i,r)=>r+"{"+i+"}",n.d)}}function gs(n,e){return n.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,i,r)=>e(i)+r)}function vs(n,e){return n.replace(/&/g,e)}var fa=new Intl.Collator("en",{numeric:!0});function ba(n,e){for(var t=0,i=n.length;t<i;){let r=i+t>>1;0>=wa(n[r],e)?t=r+1:i=r}return i}function wa(n,e){let t=n.p&ce.o;return t==(e.p&ce.o)&&(t==ce.b||t==ce.o)?0:n.p-e.p||n.o-e.o||fa.compare(ha(n.n),ha(e.n))||fa.compare(da(n.n),da(e.n))}function ha(n){return(n||"").split(/:/).pop().split("/").pop()||"\0"}function da(n){return(n||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function ms(n,e){return Math.round(parseInt(n,16)*e)}function He(n,e={}){if(typeof n=="function")return n(e);let{opacityValue:t="1",opacityVariable:i}=e,r=i?`var(${i})`:t;if(n.includes("<alpha-value>"))return n.replace("<alpha-value>",r);if(n[0]=="#"&&(n.length==4||n.length==7)){let s=(n.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[ms(n.substr(1,s),o),ms(n.substr(1+s,s),o),ms(n.substr(1+2*s,s),o),r]})`}return r=="1"?n:r=="0"?"#0000":n.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${r})`)}function xa(n,e,t,i,r=[]){return function s(o,{n:a,p:l,r:u=[],i:c},p){let f=[],d="",g=0,v=0;for(let A in o||{}){var w,D;let M=o[A];if(A[0]=="@"){if(!M)continue;if(A[1]=="a"){f.push(...Cs(a,l,Wi(""+M),p,l,u,c,!0));continue}if(A[1]=="l"){for(let q of K(M))f.push(...s(q,{n:a,p:(w=ce[A[7]],l&~ce.o|w),r:A[7]=="d"?[]:u,i:c},p));continue}if(A[1]=="i"){f.push(...K(M).map(q=>({p:-1,o:0,r:[],d:A+" "+q})));continue}if(A[1]=="k"){f.push({p:ce.d,o:0,r:[A],d:s(M,{p:ce.d},p).map(bs).join("")});continue}if(A[1]=="f"){f.push(...K(M).map(q=>({p:ce.d,o:0,r:[A],d:s(q,{p:ce.d},p).map(bs).join("")})));continue}}if(typeof M!="object"||Array.isArray(M))A=="label"&&M?a=M+zi(JSON.stringify([l,c,o])):(M||M===0)&&(A=A.replace(/[A-Z]/g,q=>"-"+q.toLowerCase()),v+=1,g=Math.max(g,(D=A)[0]=="-"?0:ya(D)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(D)?+!!RegExp.$1||-!!RegExp.$2:0)+1),d+=(d?";":"")+K(M).map(q=>p.s(A,$s(""+q,p.theme)+(c?" !important":""))).join(";"));else if(A[0]=="@"||A.includes("&")){let q=l;A[0]=="@"&&(A=A.replace(/\bscreen\(([^)]+)\)/g,(H,X)=>{let J=p.theme("screens",X);return J?(q|=67108864,Vi(J,"")):H}),q|=_s(A)),f.push(...s(M,{n:a,p:q,r:[...u,A],i:c},p))}else f.push(...s(M,{p:l,r:[...u,A]},p))}return f.unshift({n:a,p:l,o:Math.max(0,15-v)+1.5*Math.min(g||15,15),r:u,d}),f.sort(wa)}(n,Es(e,t,i,r),t)}function $s(n,e){return n.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,i,r,s,o="")=>{let a=e(r,o);return typeof a=="function"&&/color|fill|stroke/i.test(r)?He(a):""+K(a).filter(l=>Object(l)!==l)})}function ka(n,e){let t,i=[];for(let r of n)r.d&&r.n?t?.p==r.p&&""+t.r==""+r.r?(t.c=[t.c,r.c].filter(Boolean).join(" "),t.d=t.d+";"+r.d):i.push(t={...r,n:r.n&&e}):i.push({...r,n:r.n&&e});return i}function Hi(n,e,t=ce.u,i,r){let s=[];for(let o of n)for(let a of function(l,u,c,p,f){l={...l,i:l.i||f};let d=function(g,v){let w=_a.get(g.n);return w?w(g,v):v.r(g.n,g.v[0]=="dark")}(l,u);return d?typeof d=="string"?({r:p,p:c}=Es(l,u,c,p),ka(Hi(Wi(d),u,c,p,l.i),l.n)):Array.isArray(d)?d.map(g=>{var v,w;return{o:0,...g,r:[...K(p),...K(g.r)],p:(v=c,w=g.p??c,v&~ce.o|w)}}):xa(d,l,u,c,p):[{c:Ss(l),p:0,o:0,r:[]}]}(o,e,t,i,r))s.splice(ba(s,a),0,a);return s}function Cs(n,e,t,i,r,s,o,a){return ka((a?t.flatMap(l=>Hi([l],i,r,s,o)):Hi(t,i,r,s,o)).map(l=>l.p&ce.o&&(l.n||e==ce.b)?{...l,p:l.p&~ce.o|e,o:0}:l),n)}function Vc(n,e,t,i){var r;return r=(s,o)=>{let{n:a,p:l,r:u,i:c}=Es(s,o,e);return t&&Cs(a,e,t,o,l,u,c,i)},_a.set(n,r),n}function ys(n,e,t){if(n[n.length-1]!="("){let i=[],r=!1,s=!1,o="";for(let a of n)if(!(a=="("||/[~@]$/.test(a))){if(a[0]=="!"&&(a=a.slice(1),r=!r),a.endsWith(":")){i[a=="dark:"?"unshift":"push"](a.slice(0,-1));continue}a[0]=="-"&&(a=a.slice(1),s=!s),a.endsWith("-")&&(a=a.slice(0,-1)),a&&a!="&"&&(o+=(o&&"-")+a)}o&&(s&&(o="-"+o),e[0].push({n:o,v:i.filter(Gc),i:r}))}}function Gc(n,e,t){return t.indexOf(n)==e}var ga=new Map;function Wi(n){let e=ga.get(n);if(!e){let t=[],i=[[]],r=0,s=0,o=null,a=0,l=(u,c=0)=>{r!=a&&(t.push(n.slice(r,a+c)),u&&ys(t,i)),r=a+1};for(;a<n.length;a++){let u=n[a];if(s)n[a-1]!="\\"&&(s+=+(u=="[")||-(u=="]"));else if(u=="[")s+=1;else if(o)n[a-1]!="\\"&&o.test(n.slice(a))&&(o=null,r=a+RegExp.lastMatch.length);else if(u=="/"&&n[a-1]!="\\"&&(n[a+1]=="*"||n[a+1]=="/"))o=n[a+1]=="*"?/^\*\//:/^[\r\n]/;else if(u=="(")l(),t.push(u);else if(u==":")n[a+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(u)){l(!0);let c=t.lastIndexOf("(");if(u==")"){let p=t[c-1];if(/[~@]$/.test(p)){let f=i.shift();t.length=c,ys([...t,"#"],i);let{v:d}=i[0].pop();for(let g of f)g.v.splice(+(g.v[0]=="dark")-+(d[0]=="dark"),d.length);ys([...t,Vc(p.length>1?p.slice(0,-1)+zi(JSON.stringify([p,f])):p+"("+Hc(f)+")",ce.a,f,/@$/.test(p))],i)}c=t.lastIndexOf("(",c-1)}t.length=c+1}else/[~@]/.test(u)&&n[a+1]=="("&&i.unshift([])}l(!0),ga.set(n,e=i[0])}return e}function b(n,e,t){return[n,ws(e,t)]}function ws(n,e){return typeof n=="function"?n:typeof n=="string"&&/^[\w-]+$/.test(n)?(t,i)=>({[n]:e?e(t,i):xs(t,1)}):t=>n||{[t[1]]:xs(t,2)}}function xs(n,e,t=n.slice(e).find(Boolean)||n.$$||n.input){return n.input[0]=="-"?`calc(${t} * -1)`:t}function x(n,e,t,i){return[n,As(e,t,i)]}function As(n,e,t){let i=typeof e=="string"?(r,s)=>({[e]:t?t(r,s):r._}):e||(({1:r,_:s},o,a)=>({[r||a]:s}));return(r,s)=>{let o=Sa(n||r[1]),a=s.theme(o,r.$$)??st(r.$$,o,s);if(a!=null)return r._=xs(r,0,a),i(r,s,o)}}function pe(n,e={},t){return[n,Xc(e,t)]}function Xc(n={},e){return(t,i)=>{let{section:r=Sa(t[0]).replace("-","")+"Color"}=n,[s,o]=Jc(t.$$);if(!s)return;let a=i.theme(r,s)||st(s,r,i);if(!a||typeof a=="object")return;let{opacityVariable:l=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:u=r.replace("Color","Opacity"),property:c=r,selector:p}=n,f=i.theme(u,o||"DEFAULT")||o&&st(o,u,i),d=e||(({_:v})=>{let w=Wn(c,v);return p?{[p]:w}:w});t._={value:He(a,{opacityVariable:l||void 0,opacityValue:f||void 0}),color:v=>He(a,v),opacityVariable:l||void 0,opacityValue:f||void 0};let g=d(t,i);if(!t.dark){let v=i.d(r,s,a);v&&v!==a&&(t._={value:He(v,{opacityVariable:l||void 0,opacityValue:f||"1"}),color:w=>He(v,w),opacityVariable:l||void 0,opacityValue:f||void 0},g={"&":g,[i.v("dark")]:d(t,i)})}return g}}function Jc(n){return(n.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function Wn(n,e){let t={};return typeof e=="string"?t[n]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[n]=e.value),t}function st(n,e,t){if(n[0]=="["&&n.slice(-1)=="]"){if(n=fn($s(n.slice(1,-1),t.theme)),!e)return n;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(n)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(n))||/image/i.test(e)&&!(/^image:/.test(n)||/^[a-z-]+\(/.test(n))||/weight/i.test(e)&&!(/^(number|any):/.test(n)||/^\d+$/.test(n))||/position/i.test(e)&&/^(length|size):/.test(n)))return n.replace(/^[a-z-]+:/,"")}}function Sa(n){return n.replace(/-./g,e=>e[1].toUpperCase())}function fn(n){return n.includes("url(")?n.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",i,r="")=>fn(t)+i+fn(r)):n.replace(/(^|[^\\])_+/g,(e,t)=>t+" ".repeat(e.length-t.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function Vn({presets:n=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:K(e.variants),rules:K(e.rules),ignorelist:K(e.ignorelist),hash:void 0,stringify:(i,r)=>i+":"+r,finalize:[]};for(let i of K([...n,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&K(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:r,darkMode:s=t.darkMode,darkColor:o=t.darkColor,theme:a,variants:l,rules:u,ignorelist:c,hash:p=t.hash,stringify:f=t.stringify,finalize:d}=typeof i=="function"?i(t):i;t={preflight:t.preflight!==!1&&r!==!1&&[...t.preflight,...K(r)],darkMode:s,darkColor:o,theme:{...t.theme,...a,extend:{...t.theme.extend,...a?.extend}},variants:[...t.variants,...K(l)],rules:[...t.rules,...K(u)],ignorelist:[...t.ignorelist,...K(c)],hash:p,stringify:f,finalize:[...t.finalize,...K(d)]}}return t}function va(n,e,t,i,r,s){for(let o of e){let a=t.get(o);a||t.set(o,a=i(o));let l=a(n,r,s);if(l)return l}}function Yc(n){var e;return ks(n[0],typeof(e=n[1])=="function"?e:()=>e)}function Kc(n){var e,t;return Array.isArray(n)?ks(n[0],ws(n[1],n[2])):ks(n,ws(e,t))}function ks(n,e){return Ea(n,(t,i,r,s)=>{let o=i.exec(t);if(o)return o.$$=t.slice(o[0].length),o.dark=s,e(o,r)})}function Ea(n,e){let t=K(n).map(Qc);return(i,r,s)=>{for(let o of t){let a=e(i,o,r,s);if(a)return a}}}function Qc(n){return typeof n=="string"?RegExp("^"+n+(n.includes("$")||n.slice(-1)=="-"?"":"$")):n}function $a(n,e){let t=Vn(n),i=function({theme:l,darkMode:u,darkColor:c=Gi,variants:p,rules:f,hash:d,stringify:g,ignorelist:v,finalize:w}){let D=new Map,A=new Map,M=new Map,q=new Map,H=Ea(v,(E,ie)=>ie.test(E));p.push(["dark",Array.isArray(u)||u=="class"?`${K(u)[1]||".dark"} &`:typeof u=="string"&&u!="media"?u:"@media (prefers-color-scheme:dark)"]);let X=typeof d=="function"?E=>d(E,zi):d?zi:pa;X!==pa&&w.push(E=>({...E,n:E.n&&X(E.n),d:E.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(ie,Z)=>"--"+X(Z).replace("#",""))}));let J={theme:function({extend:E={},...ie}){let Z={},ft={get colors(){return ve("colors")},theme:ve,negative(){return{}},breakpoints(G){let ee={};for(let le in G)typeof G[le]=="string"&&(ee["screen-"+le]=G[le]);return ee}};return ve;function ve(G,ee,le,Fe){if(G){if({1:G,2:Fe}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(G)||[,G],/[.[]/.test(G)){let $e=[];G.replace(/\[([^\]]+)\]|([^.[]+)/g,(te,me,Ae=me)=>$e.push(Ae)),G=$e.shift(),le=ee,ee=$e.join("-")}let re=Z[G]||Object.assign(Object.assign(Z[G]={},ze(ie,G)),ze(E,G));if(ee==null)return re;ee||(ee="DEFAULT");let Ee=re[ee]??ee.split("-").reduce(($e,te)=>$e?.[te],re)??le;return Fe?He(Ee,{opacityValue:$s(Fe,ve)}):Ee}let Ne={};for(let re of[...Object.keys(ie),...Object.keys(E)])Ne[re]=ve(re);return Ne}function ze(G,ee){let le=G[ee];return typeof le=="function"&&(le=le(ft)),le&&/color|fill|stroke/i.test(ee)?function Fe(Ne,re=[]){let Ee={};for(let $e in Ne){let te=Ne[$e],me=[...re,$e];Ee[me.join("-")]=te,$e=="DEFAULT"&&(me=re,Ee[re.join("-")]=te),typeof te=="object"&&Object.assign(Ee,Fe(te,me))}return Ee}(le):le}}(l),e:ma,h:X,s(E,ie){return g(E,ie,J)},d(E,ie,Z){return c(E,ie,J,Z)},v(E){return D.has(E)||D.set(E,va(E,p,A,Yc,J)||"&:"+E),D.get(E)},r(E,ie){let Z=JSON.stringify([E,ie]);return M.has(Z)||M.set(Z,!H(E,J)&&va(E,f,q,Kc,J,ie)),M.get(Z)},f(E){return w.reduce((ie,Z)=>Z(ie,J),E)}};return J}(t),r=new Map,s=[],o=new Set;e.resume(l=>r.set(l,l),(l,u)=>{e.insert(l,s.length,u),s.push(u),o.add(l)});function a(l){let u=i.f(l),c=bs(u);if(c&&!o.has(c)){o.add(c);let p=ba(s,l);e.insert(c,p,l),s.splice(p,0,l)}return u.n}return Object.defineProperties(function(u){if(!r.size)for(let p of K(t.preflight))typeof p=="function"&&(p=p(i)),p&&(typeof p=="string"?Cs("",ce.b,Wi(p),i,ce.b,[],!1,!0):xa(p,{},i,ce.b)).forEach(a);u=""+u;let c=r.get(u);if(!c){let p=new Set;for(let f of Hi(Wi(u),i))p.add(f.c).add(a(f));c=[...p].filter(Boolean).join(" "),r.set(u,c).set(c,c)}return c},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:i.theme,config:t,snapshot(){let l=e.snapshot(),u=new Set(o),c=new Map(r),p=[...s];return()=>{l(),o=u,r=c,s=p}},clear(){e.clear(),o=new Set,r=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Zc(n,e){return n!=e&&""+n.split(" ").sort()!=""+e.split(" ").sort()}function Ca(n){let e=new MutationObserver(t);return{observe(r){e.observe(r,{attributeFilter:["class"],subtree:!0,childList:!0}),i(r),t([{target:r,type:""}])},disconnect(){e.disconnect()}};function t(r){for(let{type:s,target:o}of r)if(s[0]=="a")i(o);else for(let a of o.querySelectorAll("[class]"))i(a);e.takeRecords()}function i(r){let s,o=r.getAttribute?.("class");o&&Zc(o,s=n(o))&&r.setAttribute("class",s)}}function ep(n){let e=document.querySelector(n||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function Xi(n){let e=n?.cssRules?n:(n&&typeof n!="string"?n:ep(n)).sheet;return{target:e,snapshot(){let t=Array.from(e.cssRules,i=>i.cssText);return()=>{this.clear(),t.forEach(this.insert)}},clear(){for(let t=e.cssRules.length;t--;)e.deleteRule(t)},destroy(){e.ownerNode?.remove()},insert(t,i){try{e.insertRule(t,i)}catch{e.insertRule(":root{}",i)}},resume:Gi}}var tp=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function Aa(n){return tp.get(n)}function Ia(n){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(n);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function Ta(n,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(n);return t?t[1]?/^sti/i.test(e)?1:0:t[2]?/^pat/i.test(e)?1:0:t[3]?/^image-/i.test(e)?1:0:t[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var np=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Ji(){return({stringify:n})=>({stringify(e,t,i){let r="",s=Aa(e);s&&(r+=n(s,t,i)+";");let o=Ia(e),a=Ta(e,t);for(let l of np)o&l[1]&&(r+=n(l[0]+e,t,i)+";"),a&l[1]&&(r+=n(e,l[0]+t,i)+";");return r+n(e,t,i)}})}function Yi(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",As("lineClamp",({_:n})=>Ra(n))],["line-clamp-(\\d+)",({1:n})=>Ra(n)]]}}function Ra(n){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${n}`}}var Xn={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...je(4,"rem",4,.5,.5),...je(12,"rem",4,5),14:"3.5rem",...je(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:B("blur"),backdropBrightness:B("brightness"),backdropContrast:B("contrast"),backdropGrayscale:B("grayscale"),backdropHueRotate:B("hueRotate"),backdropInvert:B("invert"),backdropOpacity:B("opacity"),backdropSaturate:B("saturate"),backdropSepia:B("sepia"),backgroundColor:B("colors"),backgroundImage:{none:"none"},backgroundOpacity:B("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...je(200,"",100,0,50),...je(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:n})=>({DEFAULT:n("colors.gray.200","currentColor"),...n("colors")}),borderOpacity:B("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:B("spacing"),borderWidth:{DEFAULT:"1px",...We(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:B("colors"),caretColor:B("colors"),accentColor:({theme:n})=>({auto:"auto",...n("colors")}),contrast:{...je(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:B("borderColor"),divideOpacity:B("borderOpacity"),divideWidth:B("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:n})=>({...n("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:n})=>({...n("spacing"),...Gn(2,6),...Gn(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:B("spacing"),gradientColorStops:B("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:n})=>({...n("spacing"),...Gn(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:n})=>({...n("spacing"),...Gn(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...je(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:n})=>({auto:"auto",...n("spacing")}),maxHeight:({theme:n})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...n("spacing")}),maxWidth:({theme:n,breakpoints:e})=>({...e(n("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...je(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:B("spacing"),placeholderColor:B("colors"),placeholderOpacity:B("opacity"),outlineColor:B("colors"),outlineOffset:We(8,"px"),outlineWidth:We(8,"px"),ringColor:({theme:n})=>({...n("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:B("colors"),ringOffsetWidth:We(8,"px"),ringOpacity:({theme:n})=>({...n("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...We(8,"px")},rotate:{...We(2,"deg"),...We(12,"deg",3),...We(180,"deg",45)},saturate:je(200,"",100,0,50),scale:{...je(150,"",100,0,50),...je(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:B("spacing"),scrollPadding:B("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...We(2,"deg"),...We(12,"deg",3)},space:B("spacing"),stroke:({theme:n})=>({...n("colors"),none:"none"}),strokeWidth:je(2),textColor:B("colors"),textDecorationColor:B("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...We(8,"px")},textUnderlineOffset:{auto:"auto",...We(8,"px")},textIndent:B("spacing"),textOpacity:B("opacity"),transitionDuration:({theme:n})=>({...n("durations"),DEFAULT:"150ms"}),transitionDelay:B("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:n})=>({...n("spacing"),...Gn(2,4),full:"100%"}),width:({theme:n})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...n("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...je(50,"",1,0,10),auto:"auto"}};function Gn(n,e){let t={};do for(var i=1;i<n;i++)t[`${i}/${n}`]=Number((i/n*100).toFixed(6))+"%";while(++n<=e);return t}function We(n,e,t=0){let i={};for(;t<=n;t=2*t||1)i[t]=t+e;return i}function je(n,e="",t=1,i=0,r=1,s={}){for(;i<=n;i+=r)s[i]=i/t+e;return s}function B(n){return({theme:e})=>e(n)}var Pa={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${Xn.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${Xn.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var Na=[b("\\[([-\\w]+):(.+)]",({1:n,2:e},t)=>({"@layer overrides":{"&":{[n]:st(`[${e}]`,"",t)}}})),b("(group|peer)([~/][^-[]+)?",({input:n},{h:e})=>[{c:e(n)}]),x("aspect-","aspectRatio"),b("container",(n,{theme:e})=>{let{screens:t=e("screens"),center:i,padding:r}=e("container"),s={width:"100%",marginRight:i&&"auto",marginLeft:i&&"auto",...o("xs")};for(let a in t){let l=t[a];typeof l=="string"&&(s[Vi(l)]={"&":{maxWidth:l,...o(a)}})}return s;function o(a){let l=r&&(typeof r=="string"?r:r[a]||r.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),x("content-","content",({_:n})=>({"--tw-content":n,content:"var(--tw-content)"})),b("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),b("box-(border|content)","boxSizing",({1:n})=>n+"-box"),b("hidden",{display:"none"}),b("table-(auto|fixed)","tableLayout"),b(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",b("isolate","isolation"),b("object-(contain|cover|fill|none|scale-down)","objectFit"),x("object-","objectPosition"),b("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Ki),b("overscroll(-[xy])?-(auto|contain|none)",({1:n="",2:e})=>({["overscroll-behavior"+n]:e})),b("(static|fixed|absolute|relative|sticky)","position"),x("-?inset(-[xy])?(?:$|-)","inset",({1:n,_:e})=>({top:n!="-x"&&e,right:n!="-y"&&e,bottom:n!="-x"&&e,left:n!="-y"&&e})),x("-?(top|bottom|left|right)(?:$|-)","inset"),b("(visible|collapse)","visibility"),b("invisible",{visibility:"hidden"}),x("-?z-","zIndex"),b("flex-((row|col)(-reverse)?)","flexDirection",Oa),b("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),x("(flex-(?:grow|shrink))(?:$|-)"),x("(flex)-"),x("grow(?:$|-)","flexGrow"),x("shrink(?:$|-)","flexShrink"),x("basis-","flexBasis"),x("-?(order)-"),"-?(order)-(\\d+)",x("grid-cols-","gridTemplateColumns"),b("grid-cols-(\\d+)","gridTemplateColumns",La),x("col-","gridColumn"),b("col-(span)-(\\d+)","gridColumn",Da),x("col-start-","gridColumnStart"),b("col-start-(auto|\\d+)","gridColumnStart"),x("col-end-","gridColumnEnd"),b("col-end-(auto|\\d+)","gridColumnEnd"),x("grid-rows-","gridTemplateRows"),b("grid-rows-(\\d+)","gridTemplateRows",La),x("row-","gridRow"),b("row-(span)-(\\d+)","gridRow",Da),x("row-start-","gridRowStart"),b("row-start-(auto|\\d+)","gridRowStart"),x("row-end-","gridRowEnd"),b("row-end-(auto|\\d+)","gridRowEnd"),b("grid-flow-((row|col)(-dense)?)","gridAutoFlow",n=>Ki(Oa(n))),b("grid-flow-(dense)","gridAutoFlow"),x("auto-cols-","gridAutoColumns"),x("auto-rows-","gridAutoRows"),x("gap-x(?:$|-)","gap","columnGap"),x("gap-y(?:$|-)","gap","rowGap"),x("gap(?:$|-)","gap"),"(justify-(?:items|self))-",b("justify-","justifyContent",Fa),b("(content|items|self)-",n=>({["align-"+n[1]]:Fa(n)})),b("(place-(content|items|self))-",({1:n,$$:e})=>({[n]:("wun".includes(e[3])?"space-":"")+e})),x("p([xytrbl])?(?:$|-)","padding",hn("padding")),x("-?m([xytrbl])?(?:$|-)","margin",hn("margin")),x("-?space-(x|y)(?:$|-)","space",({1:n,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${n}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[n]]:`calc(${e} * calc(1 - var(--tw-space-${n}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[n]]:`calc(${e} * var(--tw-space-${n}-reverse))`}})),b("space-(x|y)-reverse",({1:n})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${n}-reverse`]:"1"}})),x("w-","width"),x("min-w-","minWidth"),x("max-w-","maxWidth"),x("h-","height"),x("min-h-","minHeight"),x("max-h-","maxHeight"),x("font-","fontWeight"),x("font-","fontFamily",({_:n})=>typeof(n=K(n))[1]=="string"?{fontFamily:Ye(n)}:{fontFamily:Ye(n[0]),...n[1]}),b("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),b("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),b("italic","fontStyle"),b("not-italic",{fontStyle:"normal"}),b("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:n,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":n)]:n,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...St({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),x("tracking-","letterSpacing"),x("leading-","lineHeight"),b("list-(inside|outside)","listStylePosition"),x("list-","listStyleType"),b("list-","listStyleType"),x("placeholder-opacity-","placeholderOpacity",({_:n})=>({"&::placeholder":{"--tw-placeholder-opacity":n}})),pe("placeholder-",{property:"color",selector:"&::placeholder"}),b("text-(left|center|right|justify|start|end)","textAlign"),b("text-(ellipsis|clip)","textOverflow"),x("text-opacity-","textOpacity","--tw-text-opacity"),pe("text-",{property:"color"}),x("text-","fontSize",({_:n})=>typeof n=="string"?{fontSize:n}:{fontSize:n[0],...typeof n[1]=="string"?{lineHeight:n[1]}:n[1]}),x("indent-","textIndent"),b("(overline|underline|line-through)","textDecorationLine"),b("no-underline",{textDecorationLine:"none"}),x("underline-offset-","textUnderlineOffset"),pe("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),x("decoration-","textDecorationThickness"),b("decoration-","textDecorationStyle"),b("(uppercase|lowercase|capitalize)","textTransform"),b("normal-case",{textTransform:"none"}),b("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),b("align-","verticalAlign"),b("whitespace-","whiteSpace"),b("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),b("break-words",{overflowWrap:"break-word"}),b("break-all",{wordBreak:"break-all"}),b("break-keep",{wordBreak:"keep-all"}),pe("caret-",{opacityVariable:!1,opacitySection:"opacity"}),pe("accent-",{opacityVariable:!1,opacitySection:"opacity"}),b("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:n})=>`linear-gradient(to ${Wt(n," ")},var(--tw-gradient-stops))`),pe("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-gradient-from":n.value,"--tw-gradient-to":n.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),pe("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-gradient-to":n.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${n.value},var(--tw-gradient-to)`})),pe("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),b("bg-(fixed|local|scroll)","backgroundAttachment"),b("bg-origin-(border|padding|content)","backgroundOrigin",({1:n})=>n+"-box"),b(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),b("bg-blend-","backgroundBlendMode"),b("bg-clip-(border|padding|content|text)","backgroundClip",({1:n})=>n+(n=="text"?"":"-box")),x("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),pe("bg-",{section:"backgroundColor"}),x("bg-","backgroundImage"),x("bg-","backgroundPosition"),b("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Ki),x("bg-","backgroundSize"),x("rounded(?:$|-)","borderRadius"),x("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:n,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[n]||[n,n];return{[`border-${Wt(t[0])}-radius`]:e,[`border-${Wt(t[1])}-radius`]:e}}),b("border-(collapse|separate)","borderCollapse"),x("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),b("border-(solid|dashed|dotted|double|none)","borderStyle"),x("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:n,_:e})=>({...St({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(n||"-x")]:e,["--tw-border-spacing"+(n||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),pe("border-([xytrbl])-",{section:"borderColor"},hn("border","Color")),pe("border-"),x("border-([xytrbl])(?:$|-)","borderWidth",hn("border","Width")),x("border(?:$|-)","borderWidth"),x("divide-opacity(?:$|-)","divideOpacity",({_:n})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":n}})),b("divide-(solid|dashed|dotted|double|none)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:n}})),b("divide-([xy]-reverse)",({1:n})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+n]:"1"}})),x("divide-([xy])(?:$|-)","divideWidth",({1:n,_:e})=>{let t={x:"lr",y:"tb"}[n];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${n}-reverse`]:"0",[`border-${Wt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${n}-reverse)))`,[`border-${Wt(t[1])}Width`]:`calc(${e} * var(--tw-divide-${n}-reverse))`}}}),pe("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),x("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),pe("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),x("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),b("ring-inset",{"--tw-ring-inset":"inset"}),pe("ring-",{property:"--tw-ring-color"}),x("ring(?:$|-)","ringWidth",({_:n},{theme:e})=>({...St({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000","&":{"--tw-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":He(e("ringOffsetColor","","#fff")),"--tw-ring-color":He(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${n} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),pe("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:n})=>({"--tw-shadow-color":n.value,"--tw-shadow":"var(--tw-shadow-colored)"})),x("shadow(?:$|-)","boxShadow",({_:n})=>({...St({"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),"--tw-shadow":Ye(n),"--tw-shadow-colored":Ye(n).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),x("(opacity)-"),b("mix-blend-","mixBlendMode"),...Ma(),...Ma("backdrop-"),x("transition(?:$|-)","transitionProperty",(n,{theme:e})=>({transitionProperty:Ye(n),transitionTimingFunction:n._=="none"?void 0:Ye(e("transitionTimingFunction","")),transitionDuration:n._=="none"?void 0:Ye(e("transitionDuration",""))})),x("duration(?:$|-)","transitionDuration","transitionDuration",Ye),x("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Ye),x("delay(?:$|-)","transitionDelay","transitionDelay",Ye),x("animate(?:$|-)","animation",(n,{theme:e,h:t,e:i})=>{let r=Ye(n),s=r.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=i(t(s[0])))]:o,animation:s.join(" ")}:{animation:r}}),"(transform)-(none)",b("transform",Ts),b("transform-(cpu|gpu)",({1:n})=>({"--tw-transform":ja(n=="gpu")})),x("scale(-[xy])?-","scale",({1:n,_:e})=>({["--tw-scale"+(n||"-x")]:e,["--tw-scale"+(n||"-y")]:e,...Ts()})),x("-?(rotate)-","rotate",Is),x("-?(translate-[xy])-","translate",Is),x("-?(skew-[xy])-","skew",Is),b("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Ki),"(appearance)-",x("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",x("(cursor)-"),"(cursor)-",b("snap-(none)","scroll-snap-type"),b("snap-(x|y|both)",({1:n})=>({...St({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":n+" var(--tw-scroll-snap-strictness)"})),b("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),b("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),b("snap-(normal|always)","scroll-snap-stop"),b("scroll-(auto|smooth)","scroll-behavior"),x("scroll-p([xytrbl])?(?:$|-)","padding",hn("scroll-padding")),x("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",hn("scroll-margin")),b("touch-(auto|none|manipulation)","touch-action"),b("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:n,2:e,3:t})=>({...St({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":t?"pan-y":n}`]:n,"touch-action":"var(--tw-touch-action)"})),b("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),b("outline",{outlineStyle:"solid"}),b("outline-(dashed|dotted|double)","outlineStyle"),x("-?(outline-offset)-"),pe("outline-",{opacityVariable:!1,opacitySection:"opacity"}),x("outline-","outlineWidth"),"(pointer-events)-",x("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:n})=>({x:"horizontal",y:"vertical"})[n]||n||"both"],b("select-(none|text|all|auto)","userSelect"),pe("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),pe("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),x("stroke-","strokeWidth"),b("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),b("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Ki(n){return(typeof n=="string"?n:n[1]).replace(/-/g," ").trim()}function Oa(n){return(typeof n=="string"?n:n[1]).replace("col","column")}function Wt(n,e="-"){let t=[];for(let i of n)t.push({t:"top",r:"right",b:"bottom",l:"left"}[i]);return t.join(e)}function Ye(n){return n&&""+(n._||n)}function Fa({$$:n}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[n[3]||""]||"")+n}function hn(n,e=""){return({1:t,_:i})=>{let r={x:"lr",y:"tb"}[t]||t+t;return r?{...Wn(n+"-"+Wt(r[0])+e,i),...Wn(n+"-"+Wt(r[1])+e,i)}:Wn(n+e,i)}}function Ma(n=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",n&&"opacity","saturate","sepia",!n&&"drop-shadow"].filter(Boolean),t={};for(let i of e)t[`--tw-${n}${i}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...St(t),[`${n}filter`]:e.map(i=>`var(--tw-${n}${i})`).join(" ")},[`(${n}filter)-(none)`,b(`${n}filter`,t),...e.map(i=>x(`${i[0]=="h"?"-?":""}(${n}${i})(?:$|-)`,i,({1:r,_:s})=>({[`--tw-${r}`]:K(s).map(o=>`${i}(${o})`).join(" "),...t})))]}function Is({1:n,_:e}){return{["--tw-"+n]:e,...Ts()}}function Ts(){return{...St({"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1","--tw-transform":ja()}),transform:"var(--tw-transform)"}}function ja(n){return[n?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" ")}function Da({1:n,2:e}){return`${n} ${e} / ${n} ${e}`}function La({1:n}){return`repeat(${n},minmax(0,1fr))`}function St(n){return{"@layer defaults":{"*,::before,::after":n,"::backdrop":n}}}var qa=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:n})=>`@media (orientation:${n})`],["contrast-(more|less)",({1:n})=>`@media (prefers-contrast:${n})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:n})=>`&::${n}`],["(marker|selection)",({1:n})=>`& *::${n},&::${n}`],["file","&::file-selector-button"],["(first|last|only)",({1:n})=>`&:${n}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:n,$$:e},t)=>e&&`&[${n}-${t.theme(n,e)||st(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:n,3:e="",4:t,5:i="",6:r=e},{e:s,h:o,v:a})=>{let l=fn(i)||(t[0]=="["?t:a(t.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(n+r))})`)}${n[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:n})=>`[dir="${n}"] &`],["supports-",({$$:n},e)=>{if(n&&(n=e.theme("supports",n)||st(n,"",e)),n)return n.includes(":")||(n+=":var(--tw)"),/^\w*\s*\(/.test(n)||(n=`(${n})`),`@supports ${n.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:n},e)=>{if(n&&(n=e.theme("screens",n)||st(n,"",e)),typeof n=="string")return`@media not all and (min-width:${n})`}],["min-",({$$:n},e)=>(n&&(n=st(n,"",e)),n&&`@media (min-width:${n})`)],[/^\[(.+)]$/,({1:n})=>/[&@]/.test(n)&&fn(n).replace(/[}]+$/,"").split("{")]];function Ua({colors:n,disablePreflight:e}={}){return{preflight:e?void 0:Pa,theme:{...Xn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...n}},variants:qa,rules:Na,finalize(t){return t.n&&t.d&&t.r.some(i=>/^&::(before|after)$/.test(i))&&!/(^|;)content:/.test(t.d)?{...t,d:"content:var(--tw-content);"+t.d}:t}}}var ip={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},rp={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},sp={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},op={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},ap={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},lp={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},up={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},cp={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},pp={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},fp={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},hp={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},dp={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},gp={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},vp={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},mp={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},yp={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},_p={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},bp={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},wp={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},xp={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},kp={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},Sp={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Ba={__proto__:null,slate:ip,gray:rp,zinc:sp,neutral:op,stone:ap,red:lp,orange:up,amber:cp,yellow:pp,lime:fp,green:hp,emerald:dp,teal:gp,cyan:vp,sky:mp,blue:yp,indigo:_p,violet:bp,purple:wp,fuchsia:xp,pink:kp,rose:Sp};function Qi({disablePreflight:n}={}){return Ua({colors:Ba,disablePreflight:n})}function Zi({className:n="prose",defaultColor:e="gray",extend:t={},colors:i={}}={}){return i={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...i,dark:i.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...i.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,o=s])=>[`${n}-${s}`,(a,l)=>Wa(n,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,u=>`& :is(${u.trim()})`)]),rules:[[`(lead|not-${n})`,({1:s},{h:o})=>[{c:o(s)}]],[`${n}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[n+"-",({$$:s},o)=>{let a=Ha(o.theme("fontSize",s));return a&&{"@layer components":a}}],[n+"-",({$$:s},o)=>r(s,o)],[n,(s,o)=>({...r(e,o),"@layer base":[za(n,o,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:P(20,16),marginBottom:P(20,16),paddingLeft:P(26,16)},li:{marginTop:P(8,16),marginBottom:P(8,16)},"ol>li,ul>li":{paddingLeft:P(6,16)},">ul>li p":{marginTop:P(12,16),marginBottom:P(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:P(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:P(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:P(12,16),marginBottom:P(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:P(48,16),marginBottom:P(48,16)},blockquote:{marginTop:P(32,20),marginBottom:P(32,20),paddingLeft:P(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:P(20,16),marginBottom:P(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:P(36,16),marginTop:"0",marginBottom:P(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:P(24,16),marginTop:P(48,24),marginBottom:P(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:P(20,16),marginTop:P(32,20),marginBottom:P(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:P(24,16),marginBottom:P(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:P(32,16),marginBottom:P(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:P(14,16),lineHeight:"1.4",marginTop:P(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:P(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:P(21,24)},"h3 code":{fontSize:P(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:P(14,16),lineHeight:"1.7",marginTop:P(24,14),marginBottom:P(24,14),borderRadius:"0.375rem",paddingTop:P(12,14),paddingRight:P(16,14),paddingBottom:P(12,14),paddingLeft:P(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:P(32,16),marginBottom:P(32,16),fontSize:P(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:P(8,14),paddingBottom:P(8,14),paddingLeft:P(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:P(8,14),paddingRight:P(8,14),paddingBottom:P(8,14),paddingLeft:P(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${o.e(o.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:P(20,16),lineHeight:"1.6",marginTop:P(24,20),marginBottom:P(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),za(n,o,t)],"@layer components":{...Ha(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function r(s,o){let a={},l={},u=(c,p,f)=>{let d=o.theme(`colors.${s}.${p}`,p);f["--tw-prose-"+c]=He(d);let g=f!=l&&o.d("colors",`${s}-${p}`,d);g&&(l["--tw-prose-"+c]=He(g))};for(let c in i){let p=i[c];c!="dark"&&p&&u(c,p,a)}for(let c in i.dark||{}){let p=i.dark[c];p&&(i.dark?u("invert-"+c,p,a):u(c,p,l))}return Object.keys(a).length?{"@layer defaults":{"&":a,[o.v("dark")]:l}}:void 0}}function za(n,e,t){let i={};for(let r in t)i[Wa(n,r,e,s=>`.${e.e(e.h(n))}${s}`)]=t[r];return i}function Wa(n,e,{e:t,h:i},r){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",a=s,l="")=>r(`${o}:where(${a}):not(:where(.${t(i("not-"+n))} *))${l}`))}function Ha(n){return n?typeof n=="string"?{fontSize:n}:{fontSize:n[0],...typeof n[1]=="string"?{lineHeight:n[1]}:n[1]}:void 0}function P(n,e){return`${(n/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var Rs=Vn({darkMode:"class",theme:{extend:{fontFamily:{display:["Work Sans","sans-serif"],sans:["Inter","sans-serif"],serif:["Roboto Slab","serif"],mono:["Roboto Mono","monospace"]},colors:{primary:{50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"},secondary:{50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},tertiary:{50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"}}}},presets:[Qi(),Ji(),Yi(),Zi()],hash:!1});function er(n,e=!0){let t=function(){if(Ep)try{let l=Xi(new CSSStyleSheet);return l.connect=u=>{let c=Ps(u);c.adoptedStyleSheets=[...c.adoptedStyleSheets,l.target]},l.disconnect=Gi,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[Xi(s)],a=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(u=>u.snapshot());return()=>l.forEach(u=>u())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,u,c){o[0].insert(l,u,c);let p=this.target.cssRules[u];o.forEach((f,d)=>d&&f.target.insertRule(p.cssText,u))},resume(l,u){return o[0].resume(l,u)},connect(l){let u=document.createElement("style");Ps(l).appendChild(u);let c=Xi(u),{cssRules:p}=this.target;for(let f=0;f<p.length;f++)c.target.insertRule(p[f].cssText,f);o.push(c),a.set(l,c)},disconnect(l){let u=o.indexOf(a.get(l));u>=0&&o.splice(u,1)}}}(),i=$a({...n,hash:n.hash??e},t),r=Ca(i);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),t.connect(this),r.observe(Ps(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=i}}}}var Ep=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function Ps(n){return n.shadowRoot||n.attachShadow({mode:"open"})}var Os=n=>er(Rs)(n);var tr=globalThis,nr=tr.ShadowRoot&&(tr.ShadyCSS===void 0||tr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fs=Symbol(),Va=new WeakMap,Jn=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==Fs)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(nr&&e===void 0){let i=t!==void 0&&t.length===1;i&&(e=Va.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Va.set(t,e))}return e}toString(){return this.cssText}},Ga=n=>new Jn(typeof n=="string"?n:n+"",void 0,Fs),Ms=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((i,r,s)=>i+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+n[s+1],n[0]);return new Jn(t,n,Fs)},Ds=(n,e)=>{if(nr)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let i=document.createElement("style"),r=tr.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,n.appendChild(i)}},ir=nr?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let i of e.cssRules)t+=i.cssText;return Ga(t)})(n):n;var{is:$p,defineProperty:Cp,getOwnPropertyDescriptor:Ap,getOwnPropertyNames:Ip,getOwnPropertySymbols:Tp,getPrototypeOf:Rp}=Object,rr=globalThis,Xa=rr.trustedTypes,Pp=Xa?Xa.emptyScript:"",Op=rr.reactiveElementPolyfillSupport,Yn=(n,e)=>n,Ls={toAttribute(n,e){switch(e){case Boolean:n=n?Pp:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Ya=(n,e)=>!$p(n,e),Ja={attribute:!0,type:String,converter:Ls,reflect:!1,hasChanged:Ya};Symbol.metadata??=Symbol("metadata"),rr.litPropertyMetadata??=new WeakMap;var ht=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Ja){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(e,i,t);r!==void 0&&Cp(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){let{get:r,set:s}=Ap(this.prototype,e)??{get(){return this[t]},set(o){this[t]=o}};return{get(){return r?.call(this)},set(o){let a=r?.call(this);s.call(this,o),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ja}static _$Ei(){if(this.hasOwnProperty(Yn("elementProperties")))return;let e=Rp(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Yn("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Yn("properties"))){let t=this.properties,i=[...Ip(t),...Tp(t)];for(let r of i)this.createProperty(r,t[r])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[i,r]of t)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[t,i]of this.elementProperties){let r=this._$Eu(t,i);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let i=new Set(e.flat(1/0).reverse());for(let r of i)t.unshift(ir(r))}else e!==void 0&&t.push(ir(e));return t}static _$Eu(e,t){let i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ds(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){let i=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,i);if(r!==void 0&&i.reflect===!0){let s=(i.converter?.toAttribute!==void 0?i.converter:Ls).toAttribute(t,i.type);this._$Em=e,s==null?this.removeAttribute(r):this.setAttribute(r,s),this._$Em=null}}_$AK(e,t){let i=this.constructor,r=i._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let s=i.getPropertyOptions(r),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Ls;this._$Em=r,this[r]=o.fromAttribute(t,s.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??=this.constructor.getPropertyOptions(e),!(i.hasChanged??Ya)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,s]of this._$Ep)this[r]=s;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,s]of i)s.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],s)}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(t)):this._$EU()}catch(i){throw e=!1,this._$EU(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach(t=>this._$EC(t,this[t])),this._$EU()}updated(e){}firstUpdated(e){}};ht.elementStyles=[],ht.shadowRootOptions={mode:"open"},ht[Yn("elementProperties")]=new Map,ht[Yn("finalized")]=new Map,Op?.({ReactiveElement:ht}),(rr.reactiveElementVersions??=[]).push("2.0.4");var js=globalThis,sr=js.trustedTypes,Ka=sr?sr.createPolicy("lit-html",{createHTML:n=>n}):void 0,qs="$lit$",dt=`lit$${Math.random().toFixed(9).slice(2)}$`,Us="?"+dt,Fp=`<${Us}>`,Xt=document,Qn=()=>Xt.createComment(""),Zn=n=>n===null||typeof n!="object"&&typeof n!="function",il=Array.isArray,rl=n=>il(n)||typeof n?.[Symbol.iterator]=="function",Ns=`[
2
+ \f\r]`,Kn=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Qa=/-->/g,Za=/>/g,Vt=RegExp(`>|${Ns}(?:([^\\s"'>=/]+)(${Ns}*=${Ns}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),el=/'/g,tl=/"/g,sl=/^(?:script|style|textarea|title)$/i,ol=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),O=ol(1),kd=ol(2),Ke=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),nl=new WeakMap,Gt=Xt.createTreeWalker(Xt,129);function al(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ka!==void 0?Ka.createHTML(e):e}var ll=(n,e)=>{let t=n.length-1,i=[],r,s=e===2?"<svg>":"",o=Kn;for(let a=0;a<t;a++){let l=n[a],u,c,p=-1,f=0;for(;f<l.length&&(o.lastIndex=f,c=o.exec(l),c!==null);)f=o.lastIndex,o===Kn?c[1]==="!--"?o=Qa:c[1]!==void 0?o=Za:c[2]!==void 0?(sl.test(c[2])&&(r=RegExp("</"+c[2],"g")),o=Vt):c[3]!==void 0&&(o=Vt):o===Vt?c[0]===">"?(o=r??Kn,p=-1):c[1]===void 0?p=-2:(p=o.lastIndex-c[2].length,u=c[1],o=c[3]===void 0?Vt:c[3]==='"'?tl:el):o===tl||o===el?o=Vt:o===Qa||o===Za?o=Kn:(o=Vt,r=void 0);let d=o===Vt&&n[a+1].startsWith("/>")?" ":"";s+=o===Kn?l+Fp:p>=0?(i.push(u),l.slice(0,p)+qs+l.slice(p)+dt+d):l+dt+(p===-2?a:d)}return[al(n,s+(n[t]||"<?>")+(e===2?"</svg>":"")),i]},ei=class n{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let s=0,o=0,a=e.length-1,l=this.parts,[u,c]=ll(e,t);if(this.el=n.createElement(u,i),Gt.currentNode=this.el.content,t===2){let p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=Gt.nextNode())!==null&&l.length<a;){if(r.nodeType===1){if(r.hasAttributes())for(let p of r.getAttributeNames())if(p.endsWith(qs)){let f=c[o++],d=r.getAttribute(p).split(dt),g=/([.?@])?(.*)/.exec(f);l.push({type:1,index:s,name:g[2],strings:d,ctor:g[1]==="."?ar:g[1]==="?"?lr:g[1]==="@"?ur:Yt}),r.removeAttribute(p)}else p.startsWith(dt)&&(l.push({type:6,index:s}),r.removeAttribute(p));if(sl.test(r.tagName)){let p=r.textContent.split(dt),f=p.length-1;if(f>0){r.textContent=sr?sr.emptyScript:"";for(let d=0;d<f;d++)r.append(p[d],Qn()),Gt.nextNode(),l.push({type:2,index:++s});r.append(p[f],Qn())}}}else if(r.nodeType===8)if(r.data===Us)l.push({type:2,index:s});else{let p=-1;for(;(p=r.data.indexOf(dt,p+1))!==-1;)l.push({type:7,index:s}),p+=dt.length-1}s++}}static createElement(e,t){let i=Xt.createElement("template");return i.innerHTML=e,i}};function Jt(n,e,t=n,i){if(e===Ke)return e;let r=i!==void 0?t._$Co?.[i]:t._$Cl,s=Zn(e)?void 0:e._$litDirective$;return r?.constructor!==s&&(r?._$AO?.(!1),s===void 0?r=void 0:(r=new s(n),r._$AT(n,t,i)),i!==void 0?(t._$Co??=[])[i]=r:t._$Cl=r),r!==void 0&&(e=Jt(n,r._$AS(n,e.values),r,i)),e}var or=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:i}=this._$AD,r=(e?.creationScope??Xt).importNode(t,!0);Gt.currentNode=r;let s=Gt.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let u;l.type===2?u=new dn(s,s.nextSibling,this,e):l.type===1?u=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(u=new cr(s,this,e)),this._$AV.push(u),l=i[++a]}o!==l?.index&&(s=Gt.nextNode(),o++)}return Gt.currentNode=Xt,r}p(e){let t=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}},dn=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,r){this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Jt(this,e,t),Zn(e)?e===L||e==null||e===""?(this._$AH!==L&&this._$AR(),this._$AH=L):e!==this._$AH&&e!==Ke&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):rl(e)?this.k(e):this._(e)}S(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.S(e))}_(e){this._$AH!==L&&Zn(this._$AH)?this._$AA.nextSibling.data=e:this.T(Xt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=ei.createElement(al(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(t);else{let s=new or(r,this),o=s.u(this.options);s.p(t),this.T(o),this._$AH=s}}_$AC(e){let t=nl.get(e.strings);return t===void 0&&nl.set(e.strings,t=new ei(e)),t}k(e){il(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,r=0;for(let s of e)r===t.length?t.push(i=new n(this.S(Qn()),this.S(Qn()),this,this.options)):i=t[r],i._$AI(s),r++;r<t.length&&(this._$AR(i&&i._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Yt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,r,s){this.type=1,this._$AH=L,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=L}_$AI(e,t=this,i,r){let s=this.strings,o=!1;if(s===void 0)e=Jt(this,e,t,0),o=!Zn(e)||e!==this._$AH&&e!==Ke,o&&(this._$AH=e);else{let a=e,l,u;for(e=s[0],l=0;l<s.length-1;l++)u=Jt(this,a[i+l],t,l),u===Ke&&(u=this._$AH[l]),o||=!Zn(u)||u!==this._$AH[l],u===L?e=L:e!==L&&(e+=(u??"")+s[l+1]),this._$AH[l]=u}o&&!r&&this.j(e)}j(e){e===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},ar=class extends Yt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===L?void 0:e}},lr=class extends Yt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==L)}},ur=class extends Yt{constructor(e,t,i,r,s){super(e,t,i,r,s),this.type=5}_$AI(e,t=this){if((e=Jt(this,e,t,0)??L)===Ke)return;let i=this._$AH,r=e===L&&i!==L||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,s=e!==L&&(i===L||r);r&&this.element.removeEventListener(this.name,this,i),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},cr=class{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){Jt(this,e)}},ul={P:qs,A:dt,C:Us,M:1,L:ll,R:or,D:rl,V:Jt,I:dn,H:Yt,N:lr,U:ur,B:ar,F:cr},Mp=js.litHtmlPolyfillSupport;Mp?.(ei,dn),(js.litHtmlVersions??=[]).push("3.1.4");var cl=(n,e,t)=>{let i=t?.renderBefore??e,r=i._$litPart$;if(r===void 0){let s=t?.renderBefore??null;i._$litPart$=r=new dn(e.insertBefore(Qn(),s),s,void 0,t??{})}return r._$AI(n),r};var j=class extends ht{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=cl(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Ke}};j._$litElement$=!0,j.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:j});var Dp=globalThis.litElementPolyfillSupport;Dp?.({LitElement:j});(globalThis.litElementVersions??=[]).push("4.0.6");var Lp="Free",pr,pl,ti=class extends Os(j){constructor(){super();_(this,pr);this.planConfigs}render(){return O`
4
4
  <a href="/pricing-plans" target="_blank" class="text-sm text-white">
5
5
  <div class="flex m-3 px-3 py-2 bg-tertiary-500 flex-row rounded-xl items-start">
6
6
  <p class="flex-grow">Upgrade your <span class="font-bold text-[#b9e901]">${this.planConfigs?.title}</span> plan to add more than <span class="font-bold text-[#b9e901]">${this.planConfigs?.maxProducts?.toLocaleString()}</span> products.</p>
7
- <span class="h-full flex-none rounded-full border border-white px-5 py-2 text-sm font-medium text-white transition-colors duration-200 hover:bg-white/10">${this.planConfigs.title!==Ip?"Upgrade":"Try Free"}</span>
8
- <button type="button" @click="${R(this,lr,sl)}" class="ml-1 h-6 rounded-full transition-colors bg-tertiary-500 hover:bg-tertiary-700" aria-label="Close">
7
+ <span class="h-full flex-none rounded-full border border-white px-5 py-2 text-sm font-medium text-white transition-colors duration-200 hover:bg-white/10">${this.planConfigs.title!==Lp?"Upgrade":"Try Free"}</span>
8
+ <button type="button" @click="${$(this,pr,pl)}" class="ml-1 h-6 rounded-full transition-colors bg-tertiary-500 hover:bg-tertiary-700" aria-label="Close">
9
9
  <span class="inline-block h-6 w-6 leading-6">✕</span>
10
10
  </button>
11
11
  </div>
12
12
  </a>
13
- `}firstUpdated(){this.planConfigs.slug==="scale"&&(this.style.display="none")}};lr=new WeakSet,sl=function(t){t.preventDefault(),this.style.display="none"},S(Zn,"properties",{planConfigs:{type:Object,attribute:"plan-configs"}});var Ns=Hn({darkMode:"class",theme:{extend:{spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]},fontFamily:{sans:["system-ui","Roboto","Helvetica","Arial","sans-serif"],serif:["ui-serif","Georgia","Cambria","serif"],mono:["ui-monospace","Menlo","Monaco","monospace"]}}},presets:[Ji(),Vi(),Gi(),Yi()],hash:!1});var z=n=>Ki(Ns)(n);var ei=class extends z(N){constructor(){super();S(this,"render",()=>O`
13
+ `}firstUpdated(){this.planConfigs.slug==="scale"&&(this.style.display="none")}};pr=new WeakSet,pl=function(t){t.preventDefault(),this.style.display="none"},S(ti,"properties",{planConfigs:{type:Object,attribute:"plan-configs"}});var Bs=Vn({darkMode:"class",theme:{extend:{spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]},fontFamily:{sans:["system-ui","Roboto","Helvetica","Arial","sans-serif"],serif:["ui-serif","Georgia","Cambria","serif"],mono:["ui-monospace","Menlo","Monaco","monospace"]}}},presets:[Qi(),Ji(),Yi(),Zi()],hash:!1});var z=n=>er(Bs)(n);var ni=class extends z(j){constructor(){super();S(this,"render",()=>O`
14
14
  <!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
15
15
  <!-- the background color is set on the root button so that when we cross fade between the open/close states there's no white flicker -->
16
16
  <button class="leading-0 bg-slate-800 relative inline-block h-14 w-14 rounded-full overflow-hidden shadow-xl transition-transform hover:scale-105 active:scale-90 text-sm text-white">
@@ -35,15 +35,15 @@ var Fc=Object.defineProperty;var ia=n=>{throw TypeError(n)};var Mc=(n,e,t)=>e in
35
35
  </svg>
36
36
  </div>
37
37
  </button>
38
- `);this.state="open",this.src=""}};S(ei,"properties",{state:{type:String},src:{type:String}});var ur={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},cr=n=>(...e)=>({_$litDirective$:n,values:e}),hn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Tp}=il;var ol=()=>document.createComment(""),dn=(n,e,t)=>{let i=n._$AA.parentNode,r=e===void 0?n._$AB:e._$AA;if(t===void 0){let s=i.insertBefore(ol(),r),o=i.insertBefore(ol(),r);t=new Tp(s,o,n,n.options)}else{let s=t._$AB.nextSibling,o=t._$AM,a=o!==n;if(a){let l;t._$AQ?.(n),t._$AM=n,t._$AP!==void 0&&(l=n._$AU)!==o._$AU&&t._$AP(l)}if(s!==r||a){let l=t._$AA;for(;l!==s;){let u=l.nextSibling;i.insertBefore(l,r),l=u}}}return t},St=(n,e,t=n)=>(n._$AI(e,t),n),Rp={},al=(n,e=Rp)=>n._$AH=e,ll=n=>n._$AH,pr=n=>{n._$AP?.(!1,!0);let e=n._$AA,t=n._$AB.nextSibling;for(;e!==t;){let i=e.nextSibling;e.remove(),e=i}};var ul=(n,e,t)=>{let i=new Map;for(let r=e;r<=t;r++)i.set(n[r],r);return i},ti=cr(class extends hn{constructor(n){if(super(n),n.type!==ur.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);let r=[],s=[],o=0;for(let a of n)r[o]=i?i(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:r}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,i]){let r=ll(n),{values:s,keys:o}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=o,s;let a=this.ut??=[],l=[],u,c,p=0,f=r.length-1,h=0,g=s.length-1;for(;p<=f&&h<=g;)if(r[p]===null)p++;else if(r[f]===null)f--;else if(a[p]===o[h])l[h]=St(r[p],s[h]),p++,h++;else if(a[f]===o[g])l[g]=St(r[f],s[g]),f--,g--;else if(a[p]===o[g])l[g]=St(r[p],s[g]),dn(n,l[g+1],r[p]),p++,g--;else if(a[f]===o[h])l[h]=St(r[f],s[h]),dn(n,r[p],r[f]),f--,h++;else if(u===void 0&&(u=ul(o,h,g),c=ul(a,p,f)),u.has(a[p]))if(u.has(a[f])){let v=c.get(o[h]),w=v!==void 0?r[v]:null;if(w===null){let D=dn(n,r[p]);St(D,s[h]),l[h]=D}else l[h]=St(w,s[h]),dn(n,r[p],w),r[v]=null;h++}else pr(r[f]),f--;else pr(r[p]),p++;for(;h<=g;){let v=dn(n,l[g+1]);St(v,s[h]),l[h++]=v}for(;p<=f;){let v=r[p++];v!==null&&pr(v)}return this.ut=o,al(n,l),Ke}});function cl(n,e,t){return n?e(n):t?.(n)}var fr,pl,hr=class hr extends z(N){constructor(){super();b(this,fr);S(this,"render",()=>!this.examples?.title&&!this.examples?.items?.length?L:O`
38
+ `);this.state="open",this.src=""}};S(ni,"properties",{state:{type:String},src:{type:String}});var fr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},hr=n=>(...e)=>({_$litDirective$:n,values:e}),gn=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Np}=ul;var fl=()=>document.createComment(""),vn=(n,e,t)=>{let i=n._$AA.parentNode,r=e===void 0?n._$AB:e._$AA;if(t===void 0){let s=i.insertBefore(fl(),r),o=i.insertBefore(fl(),r);t=new Np(s,o,n,n.options)}else{let s=t._$AB.nextSibling,o=t._$AM,a=o!==n;if(a){let l;t._$AQ?.(n),t._$AM=n,t._$AP!==void 0&&(l=n._$AU)!==o._$AU&&t._$AP(l)}if(s!==r||a){let l=t._$AA;for(;l!==s;){let u=l.nextSibling;i.insertBefore(l,r),l=u}}}return t},Et=(n,e,t=n)=>(n._$AI(e,t),n),jp={},hl=(n,e=jp)=>n._$AH=e,dl=n=>n._$AH,dr=n=>{n._$AP?.(!1,!0);let e=n._$AA,t=n._$AB.nextSibling;for(;e!==t;){let i=e.nextSibling;e.remove(),e=i}};var gl=(n,e,t)=>{let i=new Map;for(let r=e;r<=t;r++)i.set(n[r],r);return i},ii=hr(class extends gn{constructor(n){if(super(n),n.type!==fr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,t){let i;t===void 0?t=e:e!==void 0&&(i=e);let r=[],s=[],o=0;for(let a of n)r[o]=i?i(a,o):o,s[o]=t(a,o),o++;return{values:s,keys:r}}render(n,e,t){return this.dt(n,e,t).values}update(n,[e,t,i]){let r=dl(n),{values:s,keys:o}=this.dt(e,t,i);if(!Array.isArray(r))return this.ut=o,s;let a=this.ut??=[],l=[],u,c,p=0,f=r.length-1,d=0,g=s.length-1;for(;p<=f&&d<=g;)if(r[p]===null)p++;else if(r[f]===null)f--;else if(a[p]===o[d])l[d]=Et(r[p],s[d]),p++,d++;else if(a[f]===o[g])l[g]=Et(r[f],s[g]),f--,g--;else if(a[p]===o[g])l[g]=Et(r[p],s[g]),vn(n,l[g+1],r[p]),p++,g--;else if(a[f]===o[d])l[d]=Et(r[f],s[d]),vn(n,r[p],r[f]),f--,d++;else if(u===void 0&&(u=gl(o,d,g),c=gl(a,p,f)),u.has(a[p]))if(u.has(a[f])){let v=c.get(o[d]),w=v!==void 0?r[v]:null;if(w===null){let D=vn(n,r[p]);Et(D,s[d]),l[d]=D}else l[d]=Et(w,s[d]),vn(n,r[p],w),r[v]=null;d++}else dr(r[f]),f--;else dr(r[p]),p++;for(;d<=g;){let v=vn(n,l[g+1]);Et(v,s[d]),l[d++]=v}for(;p<=f;){let v=r[p++];v!==null&&dr(v)}return this.ut=o,hl(n,l),Ke}});function vl(n,e,t){return n?e(n):t?.(n)}var gr,ml,vr=class vr extends z(j){constructor(){super();_(this,gr);S(this,"render",()=>!this.examples?.title&&!this.examples?.items?.length?L:O`
39
39
  <div class="h-full w-full flex flex-col font-sans text-base bg-[#FDFDFD] items-stretch justify-center">
40
40
  <!-- examples section -->
41
41
  <div class="m-4">
42
- ${cl(this.examples.title,()=>O`<p class="text-md text-center text-gray-500 font-semibold select-none">${this.examples.title}</p>`)}
42
+ ${vl(this.examples.title,()=>O`<p class="text-md text-center text-gray-500 font-semibold select-none">${this.examples.title}</p>`)}
43
43
  ${this.examples?.items?.length?O`
44
44
  <ul class="prose mt-2 text-left text-gray-400 select-none">
45
- ${ti(this.examples.items,t=>t,t=>O`
46
- <li class="w-full rounded-2xl bg-white px-4 py-3 text-sm outline outline-1 outline-[#eeedf1] transition-[color,outline] hover:cursor-pointer hover:outline-[#999]" @click="${()=>R(this,fr,pl).call(this,t)}">
45
+ ${ii(this.examples.items,t=>t,t=>O`
46
+ <li class="w-full rounded-2xl bg-white px-4 py-3 text-sm outline outline-1 outline-[#eeedf1] transition-[color,outline] hover:cursor-pointer hover:outline-[#999]" @click="${()=>$(this,gr,ml).call(this,t)}">
47
47
  <span>“${t.trim()}” →</span>
48
48
  </li>
49
49
  `)}
@@ -54,7 +54,7 @@ var Fc=Object.defineProperty;var ia=n=>{throw TypeError(n)};var Mc=(n,e,t)=>e in
54
54
  <!-- spacer for visual alignment -->
55
55
  <div class="h-1/9"></div>
56
56
  </div>
57
- `);this.examples={title:"",items:[]}}};fr=new WeakSet,pl=function(t){this.dispatchEvent(new hr.ExampleClickEvent({example:t}))},S(hr,"properties",{examples:{type:Object}});var gn=hr,qs;gn.ExampleClickEvent=(qs=class extends CustomEvent{constructor(e,t={}){super(gn.ExampleClickEvent.type,{detail:e,...t})}},S(qs,"type","mw:example-click"),qs);var vn,fl,hl,ni=class ni extends z(N){constructor(){super();b(this,vn);S(this,"render",()=>O`
57
+ `);this.examples={title:"",items:[]}}};gr=new WeakSet,ml=function(t){this.dispatchEvent(new vr.ExampleClickEvent({example:t}))},S(vr,"properties",{examples:{type:Object}});var mn=vr,zs;mn.ExampleClickEvent=(zs=class extends CustomEvent{constructor(e,t={}){super(mn.ExampleClickEvent.type,{detail:e,...t})}},S(zs,"type","mw:example-click"),zs);var yn,yl,_l,ri=class ri extends z(j){constructor(){super();_(this,yn);S(this,"render",()=>O`
58
58
  <div class="flex items-center justify-between space-x-4 p-4 text-lg bg-white font-sans">
59
59
  <mw-pulse-dot class="contents" position="bottom-right" color="green-500">
60
60
  <div class="h-10 w-10 overflow-hidden rounded">
@@ -72,7 +72,7 @@ var Fc=Object.defineProperty;var ia=n=>{throw TypeError(n)};var Mc=(n,e,t)=>e in
72
72
 
73
73
  <div class="flex-grow"></div>
74
74
 
75
- <button @click=${R(this,vn,fl)} class="${this.showNewChat?"inline-flex":"hidden"} items-center justify-center rounded-lg bg-gray-100 p-3 text-gray-400 transition-colors hover:bg-gray-50">
75
+ <button @click=${$(this,yn,yl)} class="${this.showNewChat?"inline-flex":"hidden"} items-center justify-center rounded-lg bg-gray-100 p-3 text-gray-400 transition-colors hover:bg-gray-50">
76
76
  <!-- -->
77
77
  <p class="inline-flex h-6 w-6 items-center justify-center">
78
78
  <span class="whitespace-pre text-[11px] font-medium leading-[15px]">${this.content.newChatTitle||`NEW
@@ -80,15 +80,15 @@ CHAT`}</span>
80
80
  </p>
81
81
  </button>
82
82
 
83
- <button @click=${R(this,vn,hl)} class="${this.showClose?"inline-flex":"hidden"} items-center justify-center rounded-lg bg-gray-100 p-3 text-gray-400 transition-colors hover:bg-gray-50 sm:hidden">
83
+ <button @click=${$(this,yn,_l)} class="${this.showClose?"inline-flex":"hidden"} items-center justify-center rounded-lg bg-gray-100 p-3 text-gray-400 transition-colors hover:bg-gray-50 sm:hidden">
84
84
  <!-- x -->
85
85
  <span class="inline-block h-6 w-6 leading-6">✕</span>
86
86
  </button>
87
87
  </div>
88
- `);this.content={logoUrl:"",title:"",status:"",color:"",newChatTitle:""},this.showNewChat=!1,this.showClose=!1}};vn=new WeakSet,fl=function(){this.dispatchEvent(new ni.NewChatClickEvent)},hl=function(){this.dispatchEvent(new ni.CloseClickEvent)},S(ni,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}});var Et=ni,Us;Et.NewChatClickEvent=(Us=class extends CustomEvent{constructor(e={}){super(Et.NewChatClickEvent.type,{...e})}},S(Us,"type","mw:new-chat-click"),Us);var Bs;Et.CloseClickEvent=(Bs=class extends CustomEvent{constructor(e={}){super(Et.CloseClickEvent.type,{...e})}},S(Bs,"type","mw:close-click"),Bs);var Ve,dl,gl,vl,ml,yl,mn=class mn extends z(N){constructor(){super();b(this,Ve);S(this,"render",()=>O`
89
- <form class="flex items-center space-x-4 border-t font-sans text-base bg-white px-4" @submit="${R(this,Ve,ml)}">
88
+ `);this.content={logoUrl:"",title:"",status:"",color:"",newChatTitle:""},this.showNewChat=!1,this.showClose=!1}};yn=new WeakSet,yl=function(){this.dispatchEvent(new ri.NewChatClickEvent)},_l=function(){this.dispatchEvent(new ri.CloseClickEvent)},S(ri,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}});var $t=ri,Hs;$t.NewChatClickEvent=(Hs=class extends CustomEvent{constructor(e={}){super($t.NewChatClickEvent.type,{...e})}},S(Hs,"type","mw:new-chat-click"),Hs);var Ws;$t.CloseClickEvent=(Ws=class extends CustomEvent{constructor(e={}){super($t.CloseClickEvent.type,{...e})}},S(Ws,"type","mw:close-click"),Ws);var Ve,bl,wl,xl,kl,Sl,_n=class _n extends z(j){constructor(){super();_(this,Ve);S(this,"render",()=>O`
89
+ <form class="flex items-center space-x-4 border-t font-sans text-base bg-white px-4" @submit="${$(this,Ve,kl)}">
90
90
  <!-- text input -->
91
- <textarea name="input" @input="${R(this,Ve,yl)}" @keydown="${R(this,Ve,vl)}" class="bg-white disabled:bg-white my-2 block w-full flex-1 resize-none rounded py-2 text-[16px] text-gray-800 outline-none transition-colors" placeholder="${this.placeholder}" autofocus ?disabled="${this.disabled}"></textarea>
91
+ <textarea name="input" @input="${$(this,Ve,Sl)}" @keydown="${$(this,Ve,xl)}" class="bg-white disabled:bg-white my-2 block w-full flex-1 resize-none rounded py-2 text-[16px] text-gray-800 outline-none transition-colors" placeholder="${this.placeholder}" autofocus ?disabled="${this.disabled}"></textarea>
92
92
 
93
93
  <!-- send/cancel button -->
94
94
  <div class="py-2">
@@ -107,7 +107,7 @@ CHAT`}</span>
107
107
  </button>
108
108
  </div>
109
109
  </form>
110
- `);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message...",this.color=""}};Ve=new WeakSet,dl=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},gl=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},vl=function(t){Pp(t)&&(t.preventDefault(),this.streaming||d(this,Ve,gl)?.click())},ml=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new mn.CancelEvent);return}let i=d(this,Ve,dl);if(!i)throw new Error("Expected input element to be present");i.value&&this.dispatchEvent(new mn.SubmitEvent(i.value))&&(i.value="")},yl=function(t){this.dispatchEvent(new mn.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""}))},S(mn,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String},color:{type:String}});var ot=mn,zs;ot.ChangeEvent=(zs=class extends CustomEvent{constructor(e,t={}){super(ot.ChangeEvent.type,{detail:e,...t})}},S(zs,"type","mw:change"),zs);var Hs;ot.SubmitEvent=(Hs=class extends CustomEvent{constructor(e,t={}){super(ot.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},S(Hs,"type","mw:submit"),Hs);var Ws;ot.CancelEvent=(Ws=class extends CustomEvent{constructor(e={}){super(ot.CancelEvent.type,{...e})}},S(Ws,"type","mw:cancel"),Ws);function Pp(n){return n.code==="Enter"&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey}var ii=class extends z(N){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl=""}render(){switch(this.side){case"user":return O`
110
+ `);this.disabled=!1,this.streaming=!1,this.placeholder="Type a message...",this.color=""}};Ve=new WeakSet,bl=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},wl=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},xl=function(t){qp(t)&&(t.preventDefault(),this.streaming||h(this,Ve,wl)?.click())},kl=function(t){if(t.preventDefault(),this.streaming){this.dispatchEvent(new _n.CancelEvent);return}let i=h(this,Ve,bl);if(!i)throw new Error("Expected input element to be present");i.value&&this.dispatchEvent(new _n.SubmitEvent(i.value))&&(i.value="")},Sl=function(t){this.dispatchEvent(new _n.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""}))},S(_n,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},placeholder:{type:String},color:{type:String}});var ot=_n,Vs;ot.ChangeEvent=(Vs=class extends CustomEvent{constructor(e,t={}){super(ot.ChangeEvent.type,{detail:e,...t})}},S(Vs,"type","mw:change"),Vs);var Gs;ot.SubmitEvent=(Gs=class extends CustomEvent{constructor(e,t={}){super(ot.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},S(Gs,"type","mw:submit"),Gs);var Xs;ot.CancelEvent=(Xs=class extends CustomEvent{constructor(e={}){super(ot.CancelEvent.type,{...e})}},S(Xs,"type","mw:cancel"),Xs);function qp(n){return n.code==="Enter"&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey}var si=class extends z(j){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl=""}render(){switch(this.side){case"user":return O`
111
111
  <div class="ml-20 flex justify-end font-sans text-base">
112
112
  <div class="max-w-full">
113
113
  <!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
@@ -142,15 +142,15 @@ CHAT`}</span>
142
142
  </div>
143
143
  </div>
144
144
  </div>
145
- `;default:throw new Error(`Unknown side: ${this.side}`)}}};S(ii,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"}});var ri=class extends hn{constructor(e){if(super(e),this.it=L,e.type!==ur.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===L||e==null)return this._t=void 0,this.it=e;if(e===Ke)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};ri.directiveName="unsafeHTML",ri.resultType=1;var _l=cr(ri);var Vs;function Op(n){return{lang:n?.lang??Vs?.lang,message:n?.message,abortEarly:n?.abortEarly??Vs?.abortEarly,abortPipeEarly:n?.abortPipeEarly??Vs?.abortPipeEarly}}var Fp;function Mp(n){return Fp?.get(n)}var Dp;function Lp(n){return Dp?.get(n)}var jp;function Np(n,e){return jp?.get(n)?.get(e)}function yn(n){let e=typeof n;return e==="object"&&(e=(n&&Object.getPrototypeOf(n)?.constructor?.name)??"null"),e==="string"?`"${n}"`:e==="number"||e==="bigint"||e==="boolean"?`${n}`:e}function $t(n,e,t,i,r){let s=r&&"input"in r?r.input:t.value,o=r?.expected??n.expects??null,a=r?.received??yn(s),l={kind:n.kind,type:n.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:n.requirement,path:r?.path,issues:r?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},u=n.kind==="schema",c=r?.message??n.message??Np(n.reference,l.lang)??(u?Lp(l.lang):null)??i.message??Mp(l.lang);c&&(l.message=typeof c=="function"?c(l):c),u&&(t.typed=!1),t.issues?t.issues.push(l):t.issues=[l]}var qp=class extends Error{constructor(e){super(e[0].message);S(this,"issues");this.name="ValiError",this.issues=e}};function Gs(n,e){return{kind:"validation",type:"max_value",reference:Gs,async:!1,expects:`<=${n instanceof Date?n.toJSON():yn(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value>this.requirement&&$t(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():yn(t.value)}),t}}}function Xs(n,e){return{kind:"validation",type:"min_value",reference:Xs,async:!1,expects:`>=${n instanceof Date?n.toJSON():yn(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value<this.requirement&&$t(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():yn(t.value)}),t}}}function Up(n,e,t){return typeof n.default=="function"?n.default(e,t):n.default}function Ct(n,e){return{kind:"schema",type:"array",reference:Ct,expects:"Array",async:!1,item:n,message:e,_run(t,i){let r=t.value;if(Array.isArray(r)){t.typed=!0,t.value=[];for(let s=0;s<r.length;s++){let o=r[s],a=this.item._run({typed:!1,value:o},i);if(a.issues){let l={type:"array",origin:"value",input:r,key:s,value:o};for(let u of a.issues)u.path?u.path.unshift(l):u.path=[l],t.issues?.push(u);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),t.value.push(a.value)}}else $t(this,"type",t,i);return t}}}function $e(n){return{kind:"schema",type:"boolean",reference:$e,expects:"boolean",async:!1,message:n,_run(e,t){return typeof e.value=="boolean"?e.typed=!0:$t(this,"type",e,t),e}}}function Ge(n){return{kind:"schema",type:"number",reference:Ge,expects:"number",async:!1,message:n,_run(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:$t(this,"type",e,t),e}}}function se(n,e){return{kind:"schema",type:"object",reference:se,expects:"Object",async:!1,entries:n,message:e,_run(t,i){let r=t.value;if(r&&typeof r=="object"){t.typed=!0,t.value={};for(let s in this.entries){let o=r[s],a=this.entries[s]._run({typed:!1,value:o},i);if(a.issues){let l={type:"object",origin:"value",input:r,key:s,value:o};for(let u of a.issues)u.path?u.path.unshift(l):u.path=[l],t.issues?.push(u);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),(a.value!==void 0||s in r)&&(t.value[s]=a.value)}}else $t(this,"type",t,i);return t}}}function C(n,...e){let t={kind:"schema",type:"optional",reference:C,expects:`${n.expects} | undefined`,async:!1,wrapped:n,_run(i,r){return i.value===void 0&&("default"in this&&(i.value=Up(this,i,r)),i.value===void 0)?(i.typed=!0,i):this.wrapped._run(i,r)}};return 0 in e&&(t.default=e[0]),t}function _n(n,e){return{kind:"schema",type:"picklist",reference:_n,expects:n.map(yn).join(" | ")||"never",async:!1,options:n,message:e,_run(t,i){return this.options.includes(t.value)?t.typed=!0:$t(this,"type",t,i),t}}}function j(n){return{kind:"schema",type:"string",reference:j,expects:"string",async:!1,message:n,_run(e,t){return typeof e.value=="string"?e.typed=!0:$t(this,"type",e,t),e}}}function bl(n,e,t){let i=n._run({typed:!1,value:e},Op(t));if(i.issues)throw new qp(i.issues);return i.value}function wl(...n){return{...n[0],pipe:n,_run(e,t){for(let i=0;i<n.length;i++){if(e.issues&&(n[i].kind==="schema"||n[i].kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=n[i]._run(e,t))}return e}}}var si,Me,Qe,oi,Js,dr=class{constructor(e,t){b(this,oi);b(this,si);b(this,Me);b(this,Qe);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");A(this,si,e),d(this,si).addController(this),A(this,Me,t)}connect(e){A(this,Me,e),A(this,Qe,R(this,oi,Js).call(this))}hostConnected(){setTimeout(()=>{A(this,Qe,R(this,oi,Js).call(this))},0)}hostDisconnected(){d(this,Qe)?.close(1e3,"lit_host_disconnected"),A(this,Qe,void 0)}send(e){d(this,Qe)?.send(e)}close(e,t){d(this,Qe)?.close(e,t)}render(e={}){switch(d(this,Qe)?.readyState){case WebSocket.CLOSED:return e.closed?.();case WebSocket.CLOSING:return e.closing?.();case WebSocket.CONNECTING:return e.connecting?.();case WebSocket.OPEN:return e.open?.()}}get isConnected(){return d(this,Qe)?.readyState===WebSocket.OPEN}};si=new WeakMap,Me=new WeakMap,Qe=new WeakMap,oi=new WeakSet,Js=function(){let e=new WebSocket(d(this,Me).url());return d(this,Me).onClose&&(e.onclose=d(this,Me).onClose),d(this,Me).onOpen&&(e.onopen=d(this,Me).onOpen),d(this,Me).onError&&(e.onerror=d(this,Me).onError),d(this,Me).onMessage&&(e.onmessage=d(this,Me).onMessage),e};var kl="664df22d-d461-42d6-801e-f70247e2cd7c",ye,_e,Ze,bn,wn,we,Jt,Sl,El,$l,Cl,gr=class{constructor(e,t){b(this,we);b(this,ye);b(this,_e);b(this,Ze);S(this,"isStreaming",!1);S(this,"typingIndicator");S(this,"ranOutOfCredits",!1);S(this,"messages",[]);S(this,"conversationId","");b(this,bn,0);b(this,wn);S(this,"isLiveMode",!1);A(this,ye,e),A(this,_e,t),A(this,Ze,this.initWS()),e.addController(this)}sendUserInput(e,{role:t="user",expectStreaming:i=!1}={}){return R(this,we,Jt).call(this,{type:"USER_INPUT",value:e,role:t},{expectStreaming:i})}sendUserCancel(){return R(this,we,Jt).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return R(this,we,Jt).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return R(this,we,Jt).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){R(this,we,Jt).call(this,{type:"RELOAD_CONFIG"})}close(){d(this,Ze).close(1e3,"closed by user")}retry(){clearTimeout(d(this,wn)),A(this,wn,setTimeout(()=>{d(this,_e).onReconnect?.(),A(this,Ze,this.initWS())},1e3*d(this,bn))),ra(this,bn)._++}initWS(){return new dr(d(this,ye),{url:()=>d(this,_e).url(this.conversationId,{}),onOpen:e=>R(this,we,Sl).call(this,e),onMessage:e=>R(this,we,El).call(this,JSON.parse(e.data)),onError:e=>R(this,we,$l).call(this,e),onClose:e=>R(this,we,Cl).call(this,e)})}hostConnected(){this.conversationId=d(this,_e).restoreConversationState?.()?.conversationId||"",this.messages=d(this,_e).restoreConversationState?.()?.messages||[]}reset(){R(this,we,Jt).call(this,{type:"NEW_CHAT"}),d(this,_e).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,d(this,ye).requestUpdate()}hostDisconnected(){clearTimeout(d(this,wn))}reconnectSocket(){d(this,Ze).close(1e3,"destroy"),A(this,Ze,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};ye=new WeakMap,_e=new WeakMap,Ze=new WeakMap,bn=new WeakMap,wn=new WeakMap,we=new WeakSet,Jt=function(e,{expectStreaming:t=!1}={}){return d(this,Ze).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,d(this,ye).requestUpdate()),d(this,Ze).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},Sl=function(e){A(this,bn,0)},El=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,e.message].filter((t,i,r)=>i===r.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,d(this,ye).requestUpdate(),d(this,_e).onNewMessage?.(e.message);break}case"UPDATE_MESSAGE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message),d(this,ye).requestUpdate(),d(this,_e).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message);else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,d(this,ye).requestUpdate(),d(this,_e).onMessageDone?.(e,t),d(this,_e).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,d(this,ye).requestUpdate();break}case"ERROR":{d(this,_e).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,d(this,_e).onConnect?.(e.conversationId),d(this,_e).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,d(this,ye).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},d(this,ye).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,d(this,ye).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===kl)||this.messages.push({id:kl,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,d(this,ye).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),d(this,ye).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},$l=function(e){console.error("onError",e),d(this,_e).onError?.(e)},Cl=function(e){d(this,ye).isConnected&&!d(this,Ze).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,d(this,ye).requestUpdate(),d(this,_e).onClose?.()};var ai,xn,At,Yt,mr,Al,vr=class{constructor(e,t,{timeoutMs:i=2e3}={}){b(this,mr);b(this,ai);b(this,xn);b(this,At);b(this,Yt,!1);S(this,"timeoutMs");A(this,ai,e),A(this,xn,t),this.timeoutMs=i,e.addController(this)}get isTyping(){return d(this,Yt)}hostDisconnected(){clearTimeout(d(this,At)),A(this,At,void 0)}onInput(e){if(d(this,ai).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(d(this,At)),A(this,At,setTimeout(()=>this.typingStopped(),this.timeoutMs)),d(this,Yt)||R(this,mr,Al).call(this)}}typingStopped(){clearTimeout(d(this,At)),A(this,Yt,!1),d(this,xn).typingStopped()}};ai=new WeakMap,xn=new WeakMap,At=new WeakMap,Yt=new WeakMap,mr=new WeakSet,Al=function(){A(this,Yt,!0),d(this,xn).typingStarted()};function Il(n,e){let t=new Map;for(let i of n){let r=e(i);t.has(r)||t.set(r,[]),(t.get(r)||[]).push(i)}return t}function Tl(n,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(n);return`${n.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var Qg=se({wsApiUrl:j(),url:j(),logoUrl:C(j()),title:j(),status:j(),color:j(),showStillLearningBanner:C($e()),allowedOrigins:C(Ct(j())),input:se({placeholder:j()}),bubble:se({imageUrl:C(j()),position:se({bottom:C(j()),right:C(j()),left:C(j())}),mobilePosition:C(se({bottom:C(j()),right:C(j()),left:C(j())}))}),examples:se({title:j(),items:Ct(j())}),instructions:se({items:Ct(j())}),popup:C(se({mobileEnabled:C($e()),desktopEnabled:C($e()),delayMs:C(Ge()),text:C(j()),mobileTitleText:C(j()),mobileButtonText:C(j())})),tryItOut:C(se({mobileEnabled:C($e()),desktopEnabled:C($e()),text:C(j())})),contactDetails:C(se({email:C(j()),phone:C(j()),socialMedia:C(se({facebook:C(j()),instagram:C(j()),twitter:C(j())}))})),neverShowStillLearningBanner:C($e()),hidden:C($e()),newChatTitle:C(j()),webhookURL:C(j()),automatedResponse:C(se({enabled:C($e()),text:C(j()),latencyThresholdMs:C(Ge())})),manual:C($e()),removePoweredBy:C($e()),claimable:C($e()),feed:C(j()),scraper:C(_n(["netkazan","jateknet","grandopet","insportline","partocean"])),platform:C(_n(["shopify","shoprenter","unas","scraper"])),workingHours:C(se({dailyAvailability:Ct(se({dayOfWeek:wl(Ge(),Xs(0),Gs(6)),startTime:j(),endTime:j(),isActive:$e()})),userTimeZone:C(j())})),planOverrides:C(se({maxProducts:C(Ge()),conversations:C(Ge()),faqs:C(se({max:C(Ge()),questionLength:C(Ge()),answerLength:C(Ge())}))})),omitGeneralGuidelines:C($e()),forceStripe:C($e())});var Bp="\xB7 \xB7 \xB7",zp=se({conversationId:C(j()),messages:C(Ct(se({id:j(),timestamp:Ge(),role:_n(["user","assistant","support"]),content:j(),content_html:C(j())})))}),ne,yr,li,oe,Rl,Pl,Ol,Fl,Ml,Dl,Ll,Ks,_r=class _r extends z(N){constructor(){super();b(this,ne);b(this,li,new vr(this,{typingStarted:()=>d(this,oe).sendUserTypingStart(),typingStopped:()=>d(this,oe).sendUserTypingStop()}));b(this,oe,new gr(this,{url:(t,{resume:i}={})=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("resume",i?"1":""),r.searchParams.set("conversationId",t),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{t.role==="user"&&d(this,ne,Ks)?.scrollTo(0,d(this,ne,Ks).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageDone:(t,i)=>{i.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:i.content??"",message:i,usage_TOKENS_COMPLETION:t.message.usage.TOKENS_COMPLETION,conversationId:this.conversationId})},onMessageError:t=>{console.error("ws message error",t),t.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+t.message})},onReset:()=>{localStorage.removeItem(d(this,ne,yr))},onConnect:t=>{},persistConversationState:(t,i)=>{localStorage.setItem(d(this,ne,yr),JSON.stringify({conversationId:t,messages:i}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(d(this,ne,yr))||"{}"),i=bl(zp,t);return{conversationId:i.conversationId||"",messages:i.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));this.config={},this.callbacks={},this.showClose=!1}get widgetId(){return this.config.widgetId}get conversationId(){return d(this,oe).conversationId}get messages(){return d(this,oe).messages}render(){let t=Il(this.messages,i=>new Date(i.timestamp).setSeconds(0,0).toString());return O`
145
+ `;default:throw new Error(`Unknown side: ${this.side}`)}}};S(si,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"}});var oi=class extends gn{constructor(e){if(super(e),this.it=L,e.type!==fr.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===L||e==null)return this._t=void 0,this.it=e;if(e===Ke)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};oi.directiveName="unsafeHTML",oi.resultType=1;var El=hr(oi);var Js;function Up(n){return{lang:n?.lang??Js?.lang,message:n?.message,abortEarly:n?.abortEarly??Js?.abortEarly,abortPipeEarly:n?.abortPipeEarly??Js?.abortPipeEarly}}var Bp;function zp(n){return Bp?.get(n)}var Hp;function Wp(n){return Hp?.get(n)}var Vp;function Gp(n,e){return Vp?.get(n)?.get(e)}function bn(n){let e=typeof n;return e==="object"&&(e=(n&&Object.getPrototypeOf(n)?.constructor?.name)??"null"),e==="string"?`"${n}"`:e==="number"||e==="bigint"||e==="boolean"?`${n}`:e}function Ct(n,e,t,i,r){let s=r&&"input"in r?r.input:t.value,o=r?.expected??n.expects??null,a=r?.received??bn(s),l={kind:n.kind,type:n.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:n.requirement,path:r?.path,issues:r?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},u=n.kind==="schema",c=r?.message??n.message??Gp(n.reference,l.lang)??(u?Wp(l.lang):null)??i.message??zp(l.lang);c&&(l.message=typeof c=="function"?c(l):c),u&&(t.typed=!1),t.issues?t.issues.push(l):t.issues=[l]}var Xp=class extends Error{constructor(e){super(e[0].message);S(this,"issues");this.name="ValiError",this.issues=e}};function Ys(n,e){return{kind:"validation",type:"max_value",reference:Ys,async:!1,expects:`<=${n instanceof Date?n.toJSON():bn(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value>this.requirement&&Ct(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():bn(t.value)}),t}}}function Ks(n,e){return{kind:"validation",type:"min_value",reference:Ks,async:!1,expects:`>=${n instanceof Date?n.toJSON():bn(n)}`,requirement:n,message:e,_run(t,i){return t.typed&&t.value<this.requirement&&Ct(this,"value",t,i,{received:t.value instanceof Date?t.value.toJSON():bn(t.value)}),t}}}function Jp(n,e,t){return typeof n.default=="function"?n.default(e,t):n.default}function At(n,e){return{kind:"schema",type:"array",reference:At,expects:"Array",async:!1,item:n,message:e,_run(t,i){let r=t.value;if(Array.isArray(r)){t.typed=!0,t.value=[];for(let s=0;s<r.length;s++){let o=r[s],a=this.item._run({typed:!1,value:o},i);if(a.issues){let l={type:"array",origin:"value",input:r,key:s,value:o};for(let u of a.issues)u.path?u.path.unshift(l):u.path=[l],t.issues?.push(u);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),t.value.push(a.value)}}else Ct(this,"type",t,i);return t}}}function Ce(n){return{kind:"schema",type:"boolean",reference:Ce,expects:"boolean",async:!1,message:n,_run(e,t){return typeof e.value=="boolean"?e.typed=!0:Ct(this,"type",e,t),e}}}function Ge(n){return{kind:"schema",type:"number",reference:Ge,expects:"number",async:!1,message:n,_run(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:Ct(this,"type",e,t),e}}}function se(n,e){return{kind:"schema",type:"object",reference:se,expects:"Object",async:!1,entries:n,message:e,_run(t,i){let r=t.value;if(r&&typeof r=="object"){t.typed=!0,t.value={};for(let s in this.entries){let o=r[s],a=this.entries[s]._run({typed:!1,value:o},i);if(a.issues){let l={type:"object",origin:"value",input:r,key:s,value:o};for(let u of a.issues)u.path?u.path.unshift(l):u.path=[l],t.issues?.push(u);if(t.issues||(t.issues=a.issues),i.abortEarly){t.typed=!1;break}}a.typed||(t.typed=!1),(a.value!==void 0||s in r)&&(t.value[s]=a.value)}}else Ct(this,"type",t,i);return t}}}function I(n,...e){let t={kind:"schema",type:"optional",reference:I,expects:`${n.expects} | undefined`,async:!1,wrapped:n,_run(i,r){return i.value===void 0&&("default"in this&&(i.value=Jp(this,i,r)),i.value===void 0)?(i.typed=!0,i):this.wrapped._run(i,r)}};return 0 in e&&(t.default=e[0]),t}function wn(n,e){return{kind:"schema",type:"picklist",reference:wn,expects:n.map(bn).join(" | ")||"never",async:!1,options:n,message:e,_run(t,i){return this.options.includes(t.value)?t.typed=!0:Ct(this,"type",t,i),t}}}function N(n){return{kind:"schema",type:"string",reference:N,expects:"string",async:!1,message:n,_run(e,t){return typeof e.value=="string"?e.typed=!0:Ct(this,"type",e,t),e}}}function $l(n,e,t){let i=n._run({typed:!1,value:e},Up(t));if(i.issues)throw new Xp(i.issues);return i.value}function Cl(...n){return{...n[0],pipe:n,_run(e,t){for(let i=0;i<n.length;i++){if(e.issues&&(n[i].kind==="schema"||n[i].kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=n[i]._run(e,t))}return e}}}var ai,Me,Qe,li,Qs,mr=class{constructor(e,t){_(this,li);_(this,ai);_(this,Me);_(this,Qe);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");C(this,ai,e),h(this,ai).addController(this),C(this,Me,t)}connect(e){C(this,Me,e),C(this,Qe,$(this,li,Qs).call(this))}hostConnected(){setTimeout(()=>{C(this,Qe,$(this,li,Qs).call(this))},0)}hostDisconnected(){h(this,Qe)?.close(1e3,"lit_host_disconnected"),C(this,Qe,void 0)}send(e){h(this,Qe)?.send(e)}close(e,t){h(this,Qe)?.close(e,t)}render(e={}){switch(h(this,Qe)?.readyState){case WebSocket.CLOSED:return e.closed?.();case WebSocket.CLOSING:return e.closing?.();case WebSocket.CONNECTING:return e.connecting?.();case WebSocket.OPEN:return e.open?.()}}get isConnected(){return h(this,Qe)?.readyState===WebSocket.OPEN}};ai=new WeakMap,Me=new WeakMap,Qe=new WeakMap,li=new WeakSet,Qs=function(){let e=new WebSocket(h(this,Me).url());return h(this,Me).onClose&&(e.onclose=h(this,Me).onClose),h(this,Me).onOpen&&(e.onopen=h(this,Me).onOpen),h(this,Me).onError&&(e.onerror=h(this,Me).onError),h(this,Me).onMessage&&(e.onmessage=h(this,Me).onMessage),e};var Il="664df22d-d461-42d6-801e-f70247e2cd7c",ye,_e,Ze,xn,kn,we,Kt,Tl,Rl,Pl,Ol,yr=class{constructor(e,t){_(this,we);_(this,ye);_(this,_e);_(this,Ze);S(this,"isStreaming",!1);S(this,"typingIndicator");S(this,"ranOutOfCredits",!1);S(this,"messages",[]);S(this,"conversationId","");_(this,xn,0);_(this,kn);S(this,"isLiveMode",!1);C(this,ye,e),C(this,_e,t),C(this,Ze,this.initWS()),e.addController(this)}sendUserInput(e,{role:t="user",expectStreaming:i=!1}={}){return $(this,we,Kt).call(this,{type:"USER_INPUT",value:e,role:t},{expectStreaming:i})}sendUserCancel(){return $(this,we,Kt).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return $(this,we,Kt).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return $(this,we,Kt).call(this,{type:"USER_TYPING_STOP"})}reloadConfig(){$(this,we,Kt).call(this,{type:"RELOAD_CONFIG"})}close(){h(this,Ze).close(1e3,"closed by user")}retry(){clearTimeout(h(this,kn)),C(this,kn,setTimeout(()=>{h(this,_e).onReconnect?.(),C(this,Ze,this.initWS())},1e3*h(this,xn))),ca(this,xn)._++}initWS(){return new mr(h(this,ye),{url:()=>h(this,_e).url(this.conversationId,{}),onOpen:e=>$(this,we,Tl).call(this,e),onMessage:e=>$(this,we,Rl).call(this,JSON.parse(e.data)),onError:e=>$(this,we,Pl).call(this,e),onClose:e=>$(this,we,Ol).call(this,e)})}hostConnected(){this.conversationId=h(this,_e).restoreConversationState?.()?.conversationId||"",this.messages=h(this,_e).restoreConversationState?.()?.messages||[]}reset(){$(this,we,Kt).call(this,{type:"NEW_CHAT"}),h(this,_e).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,h(this,ye).requestUpdate()}hostDisconnected(){clearTimeout(h(this,kn))}reconnectSocket(){h(this,Ze).close(1e3,"destroy"),C(this,Ze,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};ye=new WeakMap,_e=new WeakMap,Ze=new WeakMap,xn=new WeakMap,kn=new WeakMap,we=new WeakSet,Kt=function(e,{expectStreaming:t=!1}={}){return h(this,Ze).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,h(this,ye).requestUpdate()),h(this,Ze).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent - reconnecting now",e),this.retry(),!1)},Tl=function(e){C(this,xn,0)},Rl=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,e.message].filter((t,i,r)=>i===r.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,h(this,ye).requestUpdate(),h(this,_e).onNewMessage?.(e.message);break}case"UPDATE_MESSAGE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message),h(this,ye).requestUpdate(),h(this,_e).onUpdateMessage?.(e);else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(i=>i.id===e.message.id);if(t)Object.assign(t,e.message);else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,h(this,ye).requestUpdate(),h(this,_e).onMessageDone?.(e,t),h(this,_e).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,h(this,ye).requestUpdate();break}case"ERROR":{h(this,_e).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,h(this,_e).onConnect?.(e.conversationId),h(this,_e).persistConversationState?.(this.conversationId,this.messages),this.isLiveMode=e.metadata?.isLiveMode,h(this,ye).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},h(this,ye).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,h(this,ye).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.messages.some(t=>t.id===Il)||this.messages.push({id:Il,role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}),this.ranOutOfCredits=!0,h(this,ye).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),h(this,ye).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},Pl=function(e){console.error("onError",e),h(this,_e).onError?.(e)},Ol=function(e){h(this,ye).isConnected&&!h(this,Ze).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,h(this,ye).requestUpdate(),h(this,_e).onClose?.()};var ui,Sn,It,Qt,br,Fl,_r=class{constructor(e,t,{timeoutMs:i=2e3}={}){_(this,br);_(this,ui);_(this,Sn);_(this,It);_(this,Qt,!1);S(this,"timeoutMs");C(this,ui,e),C(this,Sn,t),this.timeoutMs=i,e.addController(this)}get isTyping(){return h(this,Qt)}hostDisconnected(){clearTimeout(h(this,It)),C(this,It,void 0)}onInput(e){if(h(this,ui).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(h(this,It)),C(this,It,setTimeout(()=>this.typingStopped(),this.timeoutMs)),h(this,Qt)||$(this,br,Fl).call(this)}}typingStopped(){clearTimeout(h(this,It)),C(this,Qt,!1),h(this,Sn).typingStopped()}};ui=new WeakMap,Sn=new WeakMap,It=new WeakMap,Qt=new WeakMap,br=new WeakSet,Fl=function(){C(this,Qt,!0),h(this,Sn).typingStarted()};function Ml(n,e){let t=new Map;for(let i of n){let r=e(i);t.has(r)||t.set(r,[]),(t.get(r)||[]).push(i)}return t}function Dl(n,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(n);return`${n.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}var ov=se({wsApiUrl:N(),url:N(),logoUrl:I(N()),title:N(),status:N(),color:N(),showStillLearningBanner:I(Ce()),allowedOrigins:I(At(N())),input:se({placeholder:N()}),bubble:se({imageUrl:I(N()),position:se({bottom:I(N()),right:I(N()),left:I(N())}),mobilePosition:I(se({bottom:I(N()),right:I(N()),left:I(N())}))}),examples:se({title:N(),items:At(N())}),instructions:se({items:At(N())}),popup:I(se({mobileEnabled:I(Ce()),desktopEnabled:I(Ce()),delayMs:I(Ge()),text:I(N()),mobileTitleText:I(N()),mobileButtonText:I(N())})),tryItOut:I(se({mobileEnabled:I(Ce()),desktopEnabled:I(Ce()),text:I(N())})),contactDetails:I(se({email:I(N()),phone:I(N()),socialMedia:I(se({facebook:I(N()),instagram:I(N()),twitter:I(N())}))})),neverShowStillLearningBanner:I(Ce()),hidden:I(Ce()),newChatTitle:I(N()),webhookURL:I(N()),automatedResponse:I(se({enabled:I(Ce()),text:I(N()),latencyThresholdMs:I(Ge())})),manual:I(Ce()),removePoweredBy:I(Ce()),claimable:I(Ce()),feed:I(N()),scraper:I(wn(["netkazan","jateknet","grandopet","insportline","partocean"])),platform:I(wn(["shopify","shoprenter","unas","scraper"])),workingHours:I(se({dailyAvailability:At(se({dayOfWeek:Cl(Ge(),Ks(0),Ys(6)),startTime:N(),endTime:N(),isActive:Ce()})),userTimeZone:I(N())})),planOverrides:I(se({maxProducts:I(Ge()),conversations:I(Ge()),faqs:I(se({max:I(Ge()),questionLength:I(Ge()),answerLength:I(Ge())}))})),omitGeneralGuidelines:I(Ce()),forceStripe:I(Ce())});var Yp="\xB7 \xB7 \xB7",Kp=se({conversationId:I(N()),messages:I(At(se({id:N(),timestamp:Ge(),role:wn(["user","assistant","support"]),content:N(),content_html:I(N())})))}),ne,wr,ci,oe,Ll,Nl,jl,ql,Ul,Bl,zl,eo,xr=class xr extends z(j){constructor(){super();_(this,ne);_(this,ci,new _r(this,{typingStarted:()=>h(this,oe).sendUserTypingStart(),typingStopped:()=>h(this,oe).sendUserTypingStop()}));_(this,oe,new yr(this,{url:(t,{resume:i}={})=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("resume",i?"1":""),r.searchParams.set("conversationId",t),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{t.role==="user"&&h(this,ne,eo)?.scrollTo(0,h(this,ne,eo).scrollHeight),t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:this.conversationId})},onMessageDone:(t,i)=>{i.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:i.content??"",message:i,usage_TOKENS_COMPLETION:t.message.usage.TOKENS_COMPLETION,conversationId:this.conversationId})},onMessageError:t=>{console.error("ws message error",t),t.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+t.message})},onReset:()=>{localStorage.removeItem(h(this,ne,wr))},onConnect:t=>{},persistConversationState:(t,i)=>{localStorage.setItem(h(this,ne,wr),JSON.stringify({conversationId:t,messages:i}))},restoreConversationState:()=>{try{let t=JSON.parse(localStorage.getItem(h(this,ne,wr))||"{}"),i=$l(Kp,t);return{conversationId:i.conversationId||"",messages:i.messages||[]}}catch(t){return console.error(t),{conversationId:"",messages:[]}}}}));this.config={},this.callbacks={},this.showClose=!1}get widgetId(){return this.config.widgetId}get conversationId(){return h(this,oe).conversationId}get messages(){return h(this,oe).messages}render(){let t=Ml(this.messages,i=>new Date(i.timestamp).setSeconds(0,0).toString());return O`
146
146
  <div class="mx-auto flex h-full w-full flex-col bg-white font-sans text-base">
147
147
  <mw-header
148
148
  class="z-10 border-b"
149
149
  .content="${{logoUrl:this.config.logoUrl,title:this.config.title,status:this.config.status,color:this.config.color,newChatTitle:this.config.newChatTitle}}"
150
- ?show-new-chat="${!d(this,oe).isLiveMode&&this.messages.length>0}"
150
+ ?show-new-chat="${!h(this,oe).isLiveMode&&this.messages.length>0}"
151
151
  ?show-close="${this.showClose}"
152
- @mw:new-chat-click="${R(this,ne,Dl)}"
153
- @mw:close-click="${R(this,ne,Ll)}">
152
+ @mw:new-chat-click="${$(this,ne,Bl)}"
153
+ @mw:close-click="${$(this,ne,zl)}">
154
154
  </mw-header>
155
155
 
156
156
  <!-- used by the dashboard to inject content -->
@@ -176,13 +176,13 @@ CHAT`}</span>
176
176
 
177
177
  <!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
178
178
  <div>
179
- ${ti(Array.from(t),([i])=>i,([i,r])=>O`
180
- <div class="my-2 text-center text-xs text-gray-500">${Tl(new Date(Number(i)),window.navigator.language)}</div>
181
- ${ti(r??[],s=>s.id,(s,o)=>{let l=r[o+1]?.role===s.role,u=d(this,oe).isLiveMode&&s.role==="user"&&s.id===d(this,oe).lastMsg?.id?"sent":"";return O`
179
+ ${ii(Array.from(t),([i])=>i,([i,r])=>O`
180
+ <div class="my-2 text-center text-xs text-gray-500">${Dl(new Date(Number(i)),window.navigator.language)}</div>
181
+ ${ii(r??[],s=>s.id,(s,o)=>{let l=r[o+1]?.role===s.role,u=h(this,oe).isLiveMode&&s.role==="user"&&s.id===h(this,oe).lastMsg?.id?"sent":"";return O`
182
182
  <div class="${l?"mb-[2px]":"mb-3"} mx-4 flex-row">
183
- <mw-chat-message color="${this.config.color}" status="${u}" logo="${s.metadata?.avatar||this.config.logoUrl}" side="${s.role}" @click="${R(this,ne,Rl)}">
183
+ <mw-chat-message color="${this.config.color}" status="${u}" logo="${s.metadata?.avatar||this.config.logoUrl}" side="${s.role}" @click="${$(this,ne,Ll)}">
184
184
  <div class="prose break-words text-inherit">
185
- ${s.content===Bp?O`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.content_html?_l(s.content_html):O`<p>${s.content}</p>`}
185
+ ${s.content===Yp?O`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>`:s.content_html?El(s.content_html):O`<p>${s.content}</p>`}
186
186
  </div>
187
187
  </mw-chat-message>
188
188
  </div>
@@ -190,8 +190,8 @@ CHAT`}</span>
190
190
  `)}
191
191
 
192
192
  <!-- show typing indicator if the non-user side is typing -->
193
- ${["assistant","support"].includes(d(this,oe)?.typingIndicator?.role??"")&&d(this,oe)?.typingIndicator?.role?O`
194
- <mw-chat-message class="mx-4 mb-4 block" color="${this.config.color}" logo="${d(this,oe)?.typingIndicator?.metadata?.avatar||this.config.logoUrl}" side="${d(this,oe).typingIndicator.role}">
193
+ ${["assistant","support"].includes(h(this,oe)?.typingIndicator?.role??"")&&h(this,oe)?.typingIndicator?.role?O`
194
+ <mw-chat-message class="mx-4 mb-4 block" color="${this.config.color}" logo="${h(this,oe)?.typingIndicator?.metadata?.avatar||this.config.logoUrl}" side="${h(this,oe).typingIndicator.role}">
195
195
  <div class="prose break-words text-inherit">
196
196
  <mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config.color}]"></mw-loading>
197
197
  </div>
@@ -202,15 +202,15 @@ CHAT`}</span>
202
202
  <mw-background
203
203
  class="mx-auto max-w-sm flex-grow"
204
204
  .examples="${this.messages.length>0?[]:this.config.examples}"
205
- @mw:example-click="${R(this,ne,Pl)}"></mw-background>
205
+ @mw:example-click="${$(this,ne,Nl)}"></mw-background>
206
206
  </div>
207
207
 
208
208
  <div class="flex-shrink-0 flex-grow-0 space-y-2 pb-2">
209
- <mw-chat-input @mw:change="${R(this,ne,Fl)}" @mw:submit="${R(this,ne,Ol)}" @mw:cancel="${R(this,ne,Ml)}" placeholder="${this.config.input?.placeholder}" color="${this.config.color}" ?disabled="${d(this,oe).ranOutOfCredits}" ?streaming="${d(this,oe)?.isStreaming??!0}"></mw-chat-input>
209
+ <mw-chat-input @mw:change="${$(this,ne,ql)}" @mw:submit="${$(this,ne,jl)}" @mw:cancel="${$(this,ne,Ul)}" placeholder="${this.config.input?.placeholder}" color="${this.config.color}" ?disabled="${h(this,oe).ranOutOfCredits}" ?streaming="${h(this,oe)?.isStreaming??!0}"></mw-chat-input>
210
210
  ${this.config.removePoweredBy?L:O`<mw-powered-by></mw-powered-by>`}
211
211
  </div>
212
212
  </div>
213
- `}reloadConfig(){d(this,oe).reloadConfig(),this.requestUpdate()}};ne=new WeakSet,yr=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},li=new WeakMap,oe=new WeakMap,Rl=function(t){let i=t.target;if(i instanceof HTMLAnchorElement){if(t.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}window.open(i.href,i.target)}},Pl=function(t){let i=t.detail.example;if(!d(this,oe)?.sendUserInput(i)){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!0,conversationId:this.conversationId})},Ol=function(t){let i=t.detail;if(!d(this,oe)?.sendUserInput(i)){t.preventDefault();return}d(this,li).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!1,conversationId:this.conversationId})},Fl=function(t){d(this,li).onInput(t.detail.full)},Ml=function(){d(this,oe)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},Dl=function(){d(this,oe).reset()},Ll=function(){this.dispatchEvent(new _r.CloseClickEvent)},Ks=function(){return this.renderRoot.querySelector("#scrollable-content")},S(_r,"properties",{config:{type:Object,attribute:!1},callbacks:{type:Object,attribute:!1},showClose:{type:Boolean,attribute:"show-close"}});var kn=_r,Ys;kn.CloseClickEvent=(Ys=class extends CustomEvent{constructor(e={}){super(kn.CloseClickEvent.type,{...e})}},S(Ys,"type","mw:close-click"),Ys);var br=class extends z(N){constructor(){super(...arguments);S(this,"render",()=>O`
213
+ `}reloadConfig(){h(this,oe).reloadConfig(),this.requestUpdate()}};ne=new WeakSet,wr=function(){if(!this.widgetId)throw new Error("widgetId is not set");return`_molin_${this.widgetId}`},ci=new WeakMap,oe=new WeakMap,Ll=function(t){let i=t.target;if(i instanceof HTMLAnchorElement){if(t.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}window.open(i.href,i.target)}},Nl=function(t){let i=t.detail.example;if(!h(this,oe)?.sendUserInput(i)){t.preventDefault();return}this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!0,conversationId:this.conversationId})},jl=function(t){let i=t.detail;if(!h(this,oe)?.sendUserInput(i)){t.preventDefault();return}h(this,ci).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:i,example:!1,conversationId:this.conversationId})},ql=function(t){h(this,ci).onInput(t.detail.full)},Ul=function(){h(this,oe)?.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},Bl=function(){h(this,oe).reset()},zl=function(){this.dispatchEvent(new xr.CloseClickEvent)},eo=function(){return this.renderRoot.querySelector("#scrollable-content")},S(xr,"properties",{config:{type:Object,attribute:!1},callbacks:{type:Object,attribute:!1},showClose:{type:Boolean,attribute:"show-close"}});var En=xr,Zs;En.CloseClickEvent=(Zs=class extends CustomEvent{constructor(e={}){super(En.CloseClickEvent.type,{...e})}},S(Zs,"type","mw:close-click"),Zs);var kr=class extends z(j){constructor(){super(...arguments);S(this,"render",()=>O`
214
214
  <svg class="leading-0 inline-block h-full w-full" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" xml:space="preserve">
215
215
  <circle fill="currentFill" stroke="none" cx="27" cy="50" r="6">
216
216
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
@@ -222,25 +222,25 @@ CHAT`}</span>
222
222
  <animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
223
223
  </circle>
224
224
  </svg>
225
- `)}};var Sn,jl,Nl,ui=class ui extends z(N){constructor(){super();b(this,Sn);S(this,"render",()=>O`
225
+ `)}};var $n,Hl,Wl,pi=class pi extends z(j){constructor(){super();_(this,$n);S(this,"render",()=>O`
226
226
  <!-- wrapper -->
227
227
  <div class="group relative z-[2147483647] rounded-t-2xl bg-white font-sans text-base leading-normal shadow-2xl select-none w-[300px] rounded-2xl cursor-pointer">
228
228
  <!-- close button -->
229
- <button class="absolute pb-[2px] -top-2 right-3 inline-flex h-6 w-6 items-center justify-center rounded-full text-gray-700 bg-gray-300 bg-opacity-50 text-center duration-300 ease-in-out opacity-0 shadow transition-opacity group-hover:opacity-100" @click="${R(this,Sn,jl)}" aria-label="Close">×</button>
229
+ <button class="absolute pb-[2px] -top-2 right-3 inline-flex h-6 w-6 items-center justify-center rounded-full text-gray-700 bg-gray-300 bg-opacity-50 text-center duration-300 ease-in-out opacity-0 shadow transition-opacity group-hover:opacity-100" @click="${$(this,$n,Hl)}" aria-label="Close">×</button>
230
230
 
231
231
  <!-- content -->
232
- <div class="p-4 text-left text-gray-800" @click="${R(this,Sn,Nl)}">
232
+ <div class="p-4 text-left text-gray-800" @click="${$(this,$n,Wl)}">
233
233
  <p>${this.text}</p>
234
234
  </div>
235
235
  </div>
236
- `);this.text="Hello there. How can we help?"}};Sn=new WeakSet,jl=function(){this.dispatchEvent(new ui.CloseEvent)},Nl=function(){this.dispatchEvent(new ui.ClickEvent)},S(ui,"properties",{text:{type:String}});var It=ui,Qs;It.CloseEvent=(Qs=class extends CustomEvent{constructor(e={}){super(It.CloseEvent.type,{...e})}},S(Qs,"type","mw:close"),Qs);var Zs;It.ClickEvent=(Zs=class extends CustomEvent{constructor(e={}){super(It.ClickEvent.type,{...e})}},S(Zs,"type","mw:click"),Zs);var En,ql,Ul,ci=class ci extends z(N){constructor(){super();b(this,En);S(this,"render",()=>O`
236
+ `);this.text="Hello there. How can we help?"}};$n=new WeakSet,Hl=function(){this.dispatchEvent(new pi.CloseEvent)},Wl=function(){this.dispatchEvent(new pi.ClickEvent)},S(pi,"properties",{text:{type:String}});var Tt=pi,to;Tt.CloseEvent=(to=class extends CustomEvent{constructor(e={}){super(Tt.CloseEvent.type,{...e})}},S(to,"type","mw:close"),to);var no;Tt.ClickEvent=(no=class extends CustomEvent{constructor(e={}){super(Tt.ClickEvent.type,{...e})}},S(no,"type","mw:click"),no);var Cn,Vl,Gl,fi=class fi extends z(j){constructor(){super();_(this,Cn);S(this,"render",()=>O`
237
237
  <!-- wrapper -->
238
238
  <div class="group relative z-[2147483647] rounded-t-2xl text-left bg-white font-sans text-base text-[16px] leading-normal shadow-2xl select-none text-gray-800 transition-all">
239
239
  <!-- close button -->
240
- <button class="absolute pb-[2px] top-[28px] right-4 inline-flex h-6 w-6 items-center justify-center rounded-full bg-gray-300 bg-opacity-50 text-center shadow-none duration-300 ease-in-out focus:outline-none" @click="${R(this,En,ql)}" aria-label="Close">×</button>
240
+ <button class="absolute pb-[2px] top-[28px] right-4 inline-flex h-6 w-6 items-center justify-center rounded-full bg-gray-300 bg-opacity-50 text-center shadow-none duration-300 ease-in-out focus:outline-none" @click="${$(this,Cn,Vl)}" aria-label="Close">×</button>
241
241
 
242
242
  <!-- content -->
243
- <div class="p-4 text-gray-800" @click="${R(this,En,Ul)}">
243
+ <div class="p-4 text-gray-800" @click="${$(this,Cn,Gl)}">
244
244
  <h1 class="mr-8 py-2.5 text-left font-display text-lg font-bold">${this.title}</h1>
245
245
  <p class="py-2.5 text-left">${this.text}</p>
246
246
  <div class="h-4"></div>
@@ -253,29 +253,33 @@ CHAT`}</span>
253
253
  <!-- can append any other content -->
254
254
  <slot name="footer"></slot>
255
255
  </div>
256
- `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};En=new WeakSet,ql=function(){this.dispatchEvent(new ci.CloseEvent)},Ul=function(){this.dispatchEvent(new ci.ClickEvent)},S(ci,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var Tt=ci,eo;Tt.CloseEvent=(eo=class extends CustomEvent{constructor(e={}){super(Tt.CloseEvent.type,{...e})}},S(eo,"type","mw:close"),eo);var to;Tt.ClickEvent=(to=class extends CustomEvent{constructor(e={}){super(Tt.ClickEvent.type,{...e})}},S(to,"type","mw:click"),to);var $n,pi,Kt,wr=class{constructor(e,t){b(this,$n);b(this,pi,!1);b(this,Kt,()=>{d(this,pi)||(d(this,$n).userFirstInteracted?.(),A(this,pi,!0)),d(this,$n).userInteracted?.()});A(this,$n,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",d(this,Kt)),window.addEventListener("keydown",d(this,Kt))}stopListening(){window.removeEventListener("click",d(this,Kt)),window.removeEventListener("keydown",d(this,Kt))}};$n=new WeakMap,pi=new WeakMap,Kt=new WeakMap;var Hp=2*60*60*1e3,Cn,qe,Qt,fi,Zt,hi,kr,Bl,xr=class{constructor(e,t,i=Date){b(this,kr);b(this,Cn);b(this,qe);b(this,Qt);b(this,fi);b(this,Zt,!1);b(this,hi,!1);A(this,Cn,e),A(this,qe,t),A(this,Qt,i),e.addController(this)}get showing(){return d(this,Zt)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!d(this,Zt)&&(A(this,Zt,!0),d(this,Cn).requestUpdate(),e)){d(this,qe).playPopupSound();let t=d(this,qe).getPersistedState();d(this,qe).setPersistedState({...t,playedSoundOnce:!0})}}hide(){A(this,hi,!0),this.abortAutoShowTimer(),A(this,Zt,!1),d(this,Cn).requestUpdate()}abortAutoShowTimer(){clearTimeout(d(this,fi))}onCloseClick(){let e=d(this,qe).getPersistedState();d(this,qe).setPersistedState({...e,userDismissedAt:d(this,Qt).now()}),this.hide()}onContentClick(){let e=d(this,qe).getPersistedState();d(this,qe).setPersistedState({...e,userDismissedAt:d(this,Qt).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),d(this,hi)||A(this,fi,setTimeout(()=>R(this,kr,Bl).call(this),d(this,qe).delayMs()))}};Cn=new WeakMap,qe=new WeakMap,Qt=new WeakMap,fi=new WeakMap,Zt=new WeakMap,hi=new WeakMap,kr=new WeakSet,Bl=function(){let e=d(this,qe).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&d(this,Qt).now()-e.userDismissedAt<Hp||this.show({sound:!t})};var Rt,so,Pt,io,ro,Sr=class Sr extends z(N){constructor(){super();b(this,Pt);b(this,Rt,new xr(this,{delayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(t=>{console.error("Error playing audio:",t,{})})},setPersistedState:t=>{t?localStorage.setItem("_molin_popup",JSON.stringify(t)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let t=localStorage.getItem("_molin_popup");try{return t?JSON.parse(t):null}catch{return null}}}));b(this,so,new wr(this,d(this,Rt)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=d(this,Rt).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",i=this.content;return O`
256
+ `);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Cn=new WeakSet,Vl=function(){this.dispatchEvent(new fi.CloseEvent)},Gl=function(){this.dispatchEvent(new fi.ClickEvent)},S(fi,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var Rt=fi,io;Rt.CloseEvent=(io=class extends CustomEvent{constructor(e={}){super(Rt.CloseEvent.type,{...e})}},S(io,"type","mw:close"),io);var ro;Rt.ClickEvent=(ro=class extends CustomEvent{constructor(e={}){super(Rt.ClickEvent.type,{...e})}},S(ro,"type","mw:click"),ro);var An,hi,Zt,Sr=class{constructor(e,t){_(this,An);_(this,hi,!1);_(this,Zt,()=>{h(this,hi)||(h(this,An).userFirstInteracted?.(),C(this,hi,!0)),h(this,An).userInteracted?.()});C(this,An,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",h(this,Zt)),window.addEventListener("keydown",h(this,Zt))}stopListening(){window.removeEventListener("click",h(this,Zt)),window.removeEventListener("keydown",h(this,Zt))}};An=new WeakMap,hi=new WeakMap,Zt=new WeakMap;var Qp=2*60*60*1e3,In,qe,en,di,tn,gi,$r,Xl,Er=class{constructor(e,t,i=Date){_(this,$r);_(this,In);_(this,qe);_(this,en);_(this,di);_(this,tn,!1);_(this,gi,!1);C(this,In,e),C(this,qe,t),C(this,en,i),e.addController(this)}get showing(){return h(this,tn)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!h(this,tn)&&(C(this,tn,!0),h(this,In).requestUpdate(),e)){h(this,qe).playPopupSound();let t=h(this,qe).getPersistedState();h(this,qe).setPersistedState({...t,playedSoundOnce:!0})}}hide(){C(this,gi,!0),this.abortAutoShowTimer(),C(this,tn,!1),h(this,In).requestUpdate()}abortAutoShowTimer(){clearTimeout(h(this,di))}onCloseClick(){let e=h(this,qe).getPersistedState();h(this,qe).setPersistedState({...e,userDismissedAt:h(this,en).now()}),this.hide()}onContentClick(){let e=h(this,qe).getPersistedState();h(this,qe).setPersistedState({...e,userDismissedAt:h(this,en).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),h(this,gi)||C(this,di,setTimeout(()=>$(this,$r,Xl).call(this),h(this,qe).delayMs()))}};In=new WeakMap,qe=new WeakMap,en=new WeakMap,di=new WeakMap,tn=new WeakMap,gi=new WeakMap,$r=new WeakSet,Xl=function(){let e=h(this,qe).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&h(this,en).now()-e.userDismissedAt<Qp||this.show({sound:!t})};var Pt,lo,Ot,oo,ao,Cr=class Cr extends z(j){constructor(){super();_(this,Ot);_(this,Pt,new Er(this,{delayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(t=>{console.error("Error playing audio:",t,{})})},setPersistedState:t=>{t?localStorage.setItem("_molin_popup",JSON.stringify(t)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let t=localStorage.getItem("_molin_popup");try{return t?JSON.parse(t):null}catch{return null}}}));_(this,lo,new Sr(this,h(this,Pt)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=h(this,Pt).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",i=this.content;return O`
257
257
  <!-- mobile shadow backdrop -->
258
258
  <div class="sm:hidden ${t} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility]"></div>
259
259
 
260
260
  <!-- mobile overlay -->
261
261
  <div class="sm:hidden ${t} fixed bottom-0 z-[2147483647] left-0 right-0">
262
- <mw-popup-mobile title="${i.mobile.title}" text="${i.mobile.text}" button="${i.mobile.button}" color="${i.mobile.color}" @mw:click="${R(this,Pt,ro)}" @mw:close="${R(this,Pt,io)}">
262
+ <mw-popup-mobile title="${i.mobile.title}" text="${i.mobile.text}" button="${i.mobile.button}" color="${i.mobile.color}" @mw:click="${$(this,Ot,ao)}" @mw:close="${$(this,Ot,oo)}">
263
263
  ${i.mobile.poweredBy?O`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:L}
264
264
  </mw-popup-mobile>
265
265
  </div>
266
266
 
267
267
  <!-- desktop -->
268
268
  <div class="max-sm:hidden ${t} ${this.positionClasses} z-[2147483647] fixed transition-[opacity,translate,visibility]">
269
- <mw-popup-desktop text="${i.desktop.text}" @mw:click="${R(this,Pt,ro)}" @mw:close="${R(this,Pt,io)}"></mw-popup-desktop>
269
+ <mw-popup-desktop text="${i.desktop.text}" @mw:click="${$(this,Ot,ao)}" @mw:close="${$(this,Ot,oo)}"></mw-popup-desktop>
270
270
  </div>
271
- `}hide(){d(this,Rt).hide()}};Rt=new WeakMap,so=new WeakMap,Pt=new WeakSet,io=function(){d(this,Rt).onCloseClick()},ro=function(){this.dispatchEvent(new Sr.ClickEvent),d(this,Rt).onContentClick()},S(Sr,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var An=Sr,no;An.ClickEvent=(no=class extends CustomEvent{constructor(e={}){super(An.ClickEvent.type,{...e})}},S(no,"type","mw:click"),no);var Wp="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",di=class extends z(N){constructor(){super(...arguments);S(this,"render",()=>O`
271
+ `}hide(){h(this,Pt).hide()}};Pt=new WeakMap,lo=new WeakMap,Ot=new WeakSet,oo=function(){h(this,Pt).onCloseClick()},ao=function(){this.dispatchEvent(new Cr.ClickEvent),h(this,Pt).onContentClick()},S(Cr,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var Tn=Cr,so;Tn.ClickEvent=(so=class extends CustomEvent{constructor(e={}){super(Tn.ClickEvent.type,{...e})}},S(so,"type","mw:click"),so);var Zp="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",vi=class extends z(j){constructor(){super(...arguments);S(this,"render",()=>O`
272
272
  <p class="flex items-center justify-center bg-white m-0 space-x-1 text-xs font-sans text-gray-400">
273
273
  <span class="pointer-events-none select-none">Powered by</span>
274
- <a class="inline-flex items-center space-x-1 text-gray-600 underline" href="${Wp}" target="_blank">
274
+ <a class="inline-flex items-center space-x-1 text-gray-600 underline" href="${Zp}" target="_blank">
275
275
  <!-- molin logo icon -->
276
276
  <svg class="h-4 w-4 text-gray-600" width="1600" height="1600" viewBox="0 0 1600 1600" fill="none" xmlns="http://www.w3.org/2000/svg">
277
277
  <g clip-path="url(#clip0_1347_2815)">
278
- <path fill-rule="evenodd" clip-rule="evenodd" d="M800 1600C1241.83 1600 1600 1241.83 1600 800C1600 358.172 1241.83 0 800 0C358.172 0 0 358.172 0 800C0 1241.83 358.172 1600 800 1600ZM1053.93 1204.94C1004.11 1233.7 944.905 1241.5 889.338 1226.61C833.772 1211.72 786.395 1175.37 757.632 1125.55C757.546 1125.4 757.46 1125.25 757.375 1125.1C757.312 1124.99 757.248 1124.88 757.185 1124.77L757.051 1124.53C756.97 1124.4 756.89 1124.26 756.81 1124.12C756.729 1123.98 756.648 1123.85 756.567 1123.71L520.274 714.434C516.674 706.633 512.851 698.527 508.828 690.171V690.175C500.263 672.388 490.791 653.467 480.628 633.946C430.934 538.484 383.555 464.79 374.805 469.345C366.054 473.901 399.245 554.98 448.939 650.442C470.289 691.455 491.212 728.45 508.828 756.948V793.508H508.83V1010.2V1226.89C451.303 1226.89 396.132 1204.06 355.455 1163.43C314.777 1122.79 291.925 1067.67 291.925 1010.2C291.925 1009.83 291.925 1009.45 291.927 1009.08C291.924 1008.71 291.922 1008.34 291.922 1007.97V471.125C291.922 423.461 322.67 382.979 365.413 368.431C406.508 353.902 452.128 352.113 494.791 363.544C550.357 378.433 597.734 414.786 626.497 464.606C626.705 464.966 626.911 465.326 627.117 465.687C627.194 465.819 627.272 465.951 627.349 466.083C627.42 466.205 627.49 466.326 627.561 466.448L837.024 829.249L837.025 829.249L945.478 1017.09L1053.93 1204.94ZM813.776 363.545C758.21 348.656 699.004 356.451 649.184 385.214L757.637 573.06L758.402 574.384C758.5 574.557 758.599 574.729 758.698 574.901L1075.55 1123.71C1075.71 1123.98 1075.87 1124.26 1076.03 1124.53L1076.16 1124.76C1076.31 1125.02 1076.46 1125.28 1076.62 1125.55C1105.38 1175.37 1152.75 1211.72 1208.32 1226.61C1263.89 1241.5 1323.09 1233.7 1372.91 1204.94L1264.46 1017.09L1156.01 829.249L1156.01 829.249L946.544 466.448C946.416 466.227 946.288 466.006 946.158 465.785C946.074 465.637 945.99 465.489 945.905 465.341C945.765 465.096 945.624 464.852 945.483 464.607C916.719 414.787 869.343 378.434 813.776 363.545Z" fill="currentColor" />
278
+ <path
279
+ fill-rule="evenodd"
280
+ clip-rule="evenodd"
281
+ d="M800 1600C1241.83 1600 1600 1241.83 1600 800C1600 358.172 1241.83 0 800 0C358.172 0 0 358.172 0 800C0 1241.83 358.172 1600 800 1600ZM1053.93 1204.94C1004.11 1233.7 944.905 1241.5 889.338 1226.61C833.772 1211.72 786.395 1175.37 757.632 1125.55C757.546 1125.4 757.46 1125.25 757.375 1125.1C757.312 1124.99 757.248 1124.88 757.185 1124.77L757.051 1124.53C756.97 1124.4 756.89 1124.26 756.81 1124.12C756.729 1123.98 756.648 1123.85 756.567 1123.71L520.274 714.434C516.674 706.633 512.851 698.527 508.828 690.171V690.175C500.263 672.388 490.791 653.467 480.628 633.946C430.934 538.484 383.555 464.79 374.805 469.345C366.054 473.901 399.245 554.98 448.939 650.442C470.289 691.455 491.212 728.45 508.828 756.948V793.508H508.83V1010.2V1226.89C451.303 1226.89 396.132 1204.06 355.455 1163.43C314.777 1122.79 291.925 1067.67 291.925 1010.2C291.925 1009.83 291.925 1009.45 291.927 1009.08C291.924 1008.71 291.922 1008.34 291.922 1007.97V471.125C291.922 423.461 322.67 382.979 365.413 368.431C406.508 353.902 452.128 352.113 494.791 363.544C550.357 378.433 597.734 414.786 626.497 464.606C626.705 464.966 626.911 465.326 627.117 465.687C627.194 465.819 627.272 465.951 627.349 466.083C627.42 466.205 627.49 466.326 627.561 466.448L837.024 829.249L837.025 829.249L945.478 1017.09L1053.93 1204.94ZM813.776 363.545C758.21 348.656 699.004 356.451 649.184 385.214L757.637 573.06L758.402 574.384C758.5 574.557 758.599 574.729 758.698 574.901L1075.55 1123.71C1075.71 1123.98 1075.87 1124.26 1076.03 1124.53L1076.16 1124.76C1076.31 1125.02 1076.46 1125.28 1076.62 1125.55C1105.38 1175.37 1152.75 1211.72 1208.32 1226.61C1263.89 1241.5 1323.09 1233.7 1372.91 1204.94L1264.46 1017.09L1156.01 829.249L1156.01 829.249L946.544 466.448C946.416 466.227 946.288 466.006 946.158 465.785C946.074 465.637 945.99 465.489 945.905 465.341C945.765 465.096 945.624 464.852 945.483 464.607C916.719 414.787 869.343 378.434 813.776 363.545Z"
282
+ fill="currentColor" />
279
283
  </g>
280
284
  <defs>
281
285
  <clipPath id="clip0_1347_2815">
@@ -287,19 +291,19 @@ CHAT`}</span>
287
291
  <span>Molin AI</span>
288
292
  </a>
289
293
  </p>
290
- `)}};S(di,"styles",Ps`
294
+ `)}};S(vi,"styles",Ms`
291
295
  :host {
292
296
  display: block;
293
297
  }
294
- `);var Er,zl,gi=class extends z(N){constructor(){super();b(this,Er);S(this,"render",()=>O`
298
+ `);var Ar,Jl,mi=class extends z(j){constructor(){super();_(this,Ar);S(this,"render",()=>O`
295
299
  <span class="relative inline-flex">
296
300
  <slot></slot>
297
- <span class="${d(this,Er,zl)} pointer-events-none absolute flex h-3 w-3">
301
+ <span class="${h(this,Ar,Jl)} pointer-events-none absolute flex h-3 w-3">
298
302
  <span class="bg-${this.color} absolute inline-flex h-3 w-3 animate-ping rounded-full opacity-75"></span>
299
303
  <span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
300
304
  </span>
301
305
  </span>
302
- `);this.color="sky-500",this.position="top-right"}};Er=new WeakSet,zl=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}},S(gi,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});var vi=class extends z(N){constructor(){super();S(this,"render",()=>O`
306
+ `);this.color="sky-500",this.position="top-right"}};Ar=new WeakSet,Jl=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}},S(mi,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});var yi=class extends z(j){constructor(){super();S(this,"render",()=>O`
303
307
  <div class="fixed bottom-24 right-6 flex animate-bounce flex-col items-center justify-center font-sans text-base ${this.positionClasses}">
304
308
  <p class="text-md mb-2 -translate-x-4 -rotate-12 transform text-lg font-bold leading-normal text-gray-800">${this.text}</p>
305
309
 
@@ -308,22 +312,22 @@ CHAT`}</span>
308
312
  <path d="M1.41089 1.17749C13.4657 11.874 23.3966 26.992 30.4581 41.4117C31.9751 44.5093 33.1523 47.7224 34.4136 50.9242C34.6288 51.4705 35.4719 52.2988 34.8747 51.5309C33.1064 49.2574 28.9356 48.4966 26.3813 47.9151C23.973 47.3669 17.1432 44.725 19.1984 46.0951C22.9606 48.6033 26.6842 51.3163 30.5552 53.7391C32.8502 55.1756 34.9449 57.9465 37.0101 55.8018C41.8322 50.7943 47.8486 46.2228 53.4629 42.1397" stroke="#303132" stroke-width="2" stroke-linecap="round"></path>
309
313
  </svg>
310
314
  </div>
311
- `);this.positionClasses="",this.text="Try it out"}};S(vi,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.define("mw-background",gn);customElements.define("mw-bubble",ei);customElements.define("mw-chat",kn);customElements.define("mw-chat-input",ot);customElements.define("mw-chat-message",ii);customElements.define("mw-header",Et);customElements.define("mw-loading",br);customElements.define("mw-popup",An);customElements.define("mw-powered-by",di);customElements.define("mw-pulse-dot",gi);customElements.define("mw-try-it-out",vi);customElements.define("mw-upsell-banner",Zn);customElements.define("mw-popup-desktop",It);customElements.define("mw-popup-mobile",Tt);window.__INIT_MOLIN_SHOP_AI=function(e){if(Vp(e),e.auto){let t=document.createElement("molin-shop-ai");t.setAttribute("cdn",e.cdn),t.setAttribute("widget",e.widgetId),document.body.appendChild(t)}};function Vp(n){window.__INIT_MOLIN_SHOP_AI_OPTIONS=n}function Hl(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var en,mi,Ot,tn,Cr,Wl,$r=class{constructor(e,t,i){b(this,Cr);b(this,en);b(this,mi);b(this,Ot);b(this,tn);S(this,"isLoading",!1);S(this,"data");A(this,en,e),A(this,mi,t),A(this,Ot,i),e.addController(this)}fetch(){if(this.isLoading)return;d(this,tn)?.abort();let e=new AbortController;A(this,tn,e),this.isLoading=!0,this.data=void 0,d(this,en).requestUpdate(),(async()=>{let t=R(this,Cr,Wl).call(this);return t.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(t,{signal:e.signal})})().then(async t=>{if(!t.ok)throw new Error(`${t.statusText}: ${await t.text()}`);this.isLoading=!1,this.data=typeof d(this,Ot)?.transform=="function"?await d(this,Ot).transform(t):t,d(this,en).requestUpdate()}).catch(t=>{d(this,Ot)?.onError?.(t),this.isLoading=!1,this.data=void 0,d(this,en).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||d(this,Ot)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){d(this,tn)?.abort(),A(this,tn,void 0)}};en=new WeakMap,mi=new WeakMap,Ot=new WeakMap,tn=new WeakMap,Cr=new WeakSet,Wl=function(){let e=d(this,mi);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var at,yi,In,Tn,Ft=class{constructor(e,t){b(this,at);b(this,yi);b(this,In);b(this,Tn);A(this,at,e),A(this,yi,t),e.addController(this)}get data(){return d(this,Tn)||d(this,In)?.data}hostConnected(){if(d(this,In)||d(this,Tn))return;let e=Hl();e&&e.widgetId===d(this,at).widgetId?A(this,Tn,e.config):A(this,In,new $r(d(this,at),()=>{if(d(this,at).cdn&&d(this,at).widgetId)return`${d(this,at).cdn}/config?w=${d(this,at).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:d(this,yi)?.onError}))}};at=new WeakMap,yi=new WeakMap,In=new WeakMap,Tn=new WeakMap;function Vl(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function I(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vl(Object(t),!0).forEach(function(i){y(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Vl(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Ti(n){return Ti=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ti(n)}function W(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Gl(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function V(n,e,t){return e&&Gl(n.prototype,e),t&&Gl(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function y(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Gp(n,e){if(n==null)return{};var t,i,r=function(o,a){if(o==null)return{};var l,u,c={},p=Object.keys(o);for(u=0;u<p.length;u++)l=p[u],a.indexOf(l)>=0||(c[l]=o[l]);return c}(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(i=0;i<s.length;i++)t=s[i],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Ie(n,e){return function(t){if(Array.isArray(t))return t}(n)||function(t,i){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var s,o,a=[],l=!0,u=!1;try{for(r=r.call(t);!(l=(s=r.next()).done)&&(a.push(s.value),!i||a.length!==i);l=!0);}catch(c){u=!0,o=c}finally{try{l||r.return==null||r.return()}finally{if(u)throw o}}return a}}(n,e)||Bo(n,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
312
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function on(n){return function(e){if(Array.isArray(e))return _o(e)}(n)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||Bo(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
313
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Bo(n,e){if(n){if(typeof n=="string")return _o(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_o(n,e):void 0}}function _o(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function rt(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=Bo(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(l){throw l},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
314
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(n)},n:function(){var l=t.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}var jt={DEBUG:!1,LIB_VERSION:"1.140.0"},Xp=Array.isArray,Du=Object.prototype,Lu=Du.hasOwnProperty,Jr=Du.toString,de=Xp||function(n){return Jr.call(n)==="[object Array]"},it=function(n){return typeof n=="function"},nt=function(n){return n===Object(n)&&!de(n)},oo=function(n){if(nt(n)){for(var e in n)if(Lu.call(n,e))return!1;return!0}return!1},F=function(n){return n===void 0},Re=function(n){return Jr.call(n)=="[object String]"},bt=function(n){return n===null},ut=function(n){return F(n)||bt(n)},lt=function(n){return Jr.call(n)=="[object Number]"},Fr=function(n){return Jr.call(n)==="[object Boolean]"},Jp=function(n){return n instanceof FormData},m=typeof window<"u"?window:void 0,Le=typeof globalThis<"u"?globalThis:m,ju=Array.prototype,Xl=ju.forEach,Jl=ju.indexOf,yt=Le?.navigator,T=Le?.document,De=Le?.location,bo=Le?.fetch,wo=Le!=null&&Le.XMLHttpRequest&&"withCredentials"in new Le.XMLHttpRequest?Le.XMLHttpRequest:void 0,Yl=Le?.AbortController,ae=yt?.userAgent,he=m??{},Kl="[PostHog.js]",k={_log:function(n){if(m&&(jt.DEBUG||he.POSTHOG_DEBUG)&&!F(m.console)&&m.console){for(var e=("__rrweb_original__"in m.console[n])?m.console[n].__rrweb_original__:m.console[n],t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];e.apply(void 0,[Kl].concat(i))}},info:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];k._log.apply(k,["log"].concat(e))},warn:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];k._log.apply(k,["warn"].concat(e))},error:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];k._log.apply(k,["error"].concat(e))},critical:function(){for(var n,e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];(n=console).error.apply(n,[Kl].concat(t))},uninitializedWarning:function(n){k.error("You must initialize PostHog before calling ".concat(n))}},Lr={},Yr=function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Fn(n,e,t){if(de(n)){if(Xl&&n.forEach===Xl)n.forEach(e,t);else if("length"in n&&n.length===+n.length){for(var i=0,r=n.length;i<r;i++)if(i in n&&e.call(t,n[i],i)===Lr)return}}}function Y(n,e,t){if(!ut(n)){if(de(n))return Fn(n,e,t);if(Jp(n)){var i,r=rt(n.entries());try{for(r.s();!(i=r.n()).done;){var s=i.value;if(e.call(t,s[1],s[0])===Lr)return}}catch(a){r.e(a)}finally{r.f()}}else for(var o in n)if(Lu.call(n,o)&&e.call(t,n[o],o)===Lr)return}}var Te=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Fn(t,function(r){for(var s in r)r[s]!==void 0&&(n[s]=r[s])}),n};function U(n,e){return n.indexOf(e)!==-1}function Mr(n){for(var e=Object.keys(n),t=e.length,i=new Array(t);t--;)i[t]=[e[t],n[e[t]]];return i}var Nu=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Ql=function(n){try{return n()}catch{return}},Yp=function(n){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n.apply(this,t)}catch(r){k.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),k.critical(r)}}},xo=function(n){var e={};return Y(n,function(t,i){Re(t)&&t.length>0&&(e[i]=t)}),e},ko=function(n){return n.replace(/^\$/,"")};function Kp(n,e){return t=n,i=function(s){return Re(s)&&!bt(e)?s.slice(0,e):s},r=new Set,function s(o,a){return o!==Object(o)?i?i(o,a):o:r.has(o)?void 0:(r.add(o),de(o)?(l=[],Fn(o,function(u){l.push(s(u))})):(l={},Y(o,function(u,c){r.has(u)||(l[c]=s(u,c))})),l);var l}(t);var t,i,r}var tt,Qp=function(n){var e,t,i,r,s="";for(e=t=0,i=(n=(n+"").replace(/\r\n/g,`
315
+ `);this.positionClasses="",this.text="Try it out"}};S(yi,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.define("mw-background",mn);customElements.define("mw-bubble",ni);customElements.define("mw-chat",En);customElements.define("mw-chat-input",ot);customElements.define("mw-chat-message",si);customElements.define("mw-header",$t);customElements.define("mw-loading",kr);customElements.define("mw-popup",Tn);customElements.define("mw-powered-by",vi);customElements.define("mw-pulse-dot",mi);customElements.define("mw-try-it-out",yi);customElements.define("mw-upsell-banner",ti);customElements.define("mw-popup-desktop",Tt);customElements.define("mw-popup-mobile",Rt);window.__INIT_MOLIN_SHOP_AI=function(e){if(ef(e),e.auto){let t=document.createElement("molin-shop-ai");t.setAttribute("cdn",e.cdn),t.setAttribute("widget",e.widgetId),document.body.appendChild(t)}};function ef(n){window.__INIT_MOLIN_SHOP_AI_OPTIONS=n}function Yl(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var nn,_i,Ft,rn,Tr,Kl,Ir=class{constructor(e,t,i){_(this,Tr);_(this,nn);_(this,_i);_(this,Ft);_(this,rn);S(this,"isLoading",!1);S(this,"data");C(this,nn,e),C(this,_i,t),C(this,Ft,i),e.addController(this)}fetch(){if(this.isLoading)return;h(this,rn)?.abort();let e=new AbortController;C(this,rn,e),this.isLoading=!0,this.data=void 0,h(this,nn).requestUpdate(),(async()=>{let t=$(this,Tr,Kl).call(this);return t.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(t,{signal:e.signal})})().then(async t=>{if(!t.ok)throw new Error(`${t.statusText}: ${await t.text()}`);this.isLoading=!1,this.data=typeof h(this,Ft)?.transform=="function"?await h(this,Ft).transform(t):t,h(this,nn).requestUpdate()}).catch(t=>{h(this,Ft)?.onError?.(t),this.isLoading=!1,this.data=void 0,h(this,nn).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||h(this,Ft)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){h(this,rn)?.abort(),C(this,rn,void 0)}};nn=new WeakMap,_i=new WeakMap,Ft=new WeakMap,rn=new WeakMap,Tr=new WeakSet,Kl=function(){let e=h(this,_i);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};var at,bi,Rn,Pn,Mt=class{constructor(e,t){_(this,at);_(this,bi);_(this,Rn);_(this,Pn);C(this,at,e),C(this,bi,t),e.addController(this)}get data(){return h(this,Pn)||h(this,Rn)?.data}hostConnected(){if(h(this,Rn)||h(this,Pn))return;let e=Yl();e&&e.widgetId===h(this,at).widgetId?C(this,Pn,e.config):C(this,Rn,new Ir(h(this,at),()=>{if(h(this,at).cdn&&h(this,at).widgetId)return`${h(this,at).cdn}/config?w=${h(this,at).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:t=>t.json(),onError:h(this,bi)?.onError}))}};at=new WeakMap,bi=new WeakMap,Rn=new WeakMap,Pn=new WeakMap;function Ql(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function T(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ql(Object(t),!0).forEach(function(i){y(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Ql(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function Pi(n){return Pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pi(n)}function W(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Zl(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function V(n,e,t){return e&&Zl(n.prototype,e),t&&Zl(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function y(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function tf(n,e){if(n==null)return{};var t,i,r=function(o,a){if(o==null)return{};var l,u,c={},p=Object.keys(o);for(u=0;u<p.length;u++)l=p[u],a.indexOf(l)>=0||(c[l]=o[l]);return c}(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(i=0;i<s.length;i++)t=s[i],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}function Te(n,e){return function(t){if(Array.isArray(t))return t}(n)||function(t,i){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var s,o,a=[],l=!0,u=!1;try{for(r=r.call(t);!(l=(s=r.next()).done)&&(a.push(s.value),!i||a.length!==i);l=!0);}catch(c){u=!0,o=c}finally{try{l||r.return==null||r.return()}finally{if(u)throw o}}return a}}(n,e)||Wo(n,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
316
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ln(n){return function(e){if(Array.isArray(e))return xo(e)}(n)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(n)||Wo(n)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
317
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Wo(n,e){if(n){if(typeof n=="string")return xo(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?xo(n,e):void 0}}function xo(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function rt(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=Wo(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(l){throw l},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
318
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){t=t.call(n)},n:function(){var l=t.next();return o=l.done,l},e:function(l){a=!0,s=l},f:function(){try{o||t.return==null||t.return()}finally{if(a)throw s}}}}var jt={DEBUG:!1,LIB_VERSION:"1.140.0"},nf=Array.isArray,Bu=Object.prototype,zu=Bu.hasOwnProperty,Qr=Bu.toString,de=nf||function(n){return Qr.call(n)==="[object Array]"},it=function(n){return typeof n=="function"},nt=function(n){return n===Object(n)&&!de(n)},uo=function(n){if(nt(n)){for(var e in n)if(zu.call(n,e))return!1;return!0}return!1},F=function(n){return n===void 0},Pe=function(n){return Qr.call(n)=="[object String]"},wt=function(n){return n===null},ut=function(n){return F(n)||wt(n)},lt=function(n){return Qr.call(n)=="[object Number]"},Lr=function(n){return Qr.call(n)==="[object Boolean]"},rf=function(n){return n instanceof FormData},m=typeof window<"u"?window:void 0,Le=typeof globalThis<"u"?globalThis:m,Hu=Array.prototype,eu=Hu.forEach,tu=Hu.indexOf,_t=Le?.navigator,R=Le?.document,De=Le?.location,ko=Le?.fetch,So=Le!=null&&Le.XMLHttpRequest&&"withCredentials"in new Le.XMLHttpRequest?Le.XMLHttpRequest:void 0,nu=Le?.AbortController,ae=_t?.userAgent,he=m??{},iu="[PostHog.js]",k={_log:function(n){if(m&&(jt.DEBUG||he.POSTHOG_DEBUG)&&!F(m.console)&&m.console){for(var e=("__rrweb_original__"in m.console[n])?m.console[n].__rrweb_original__:m.console[n],t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];e.apply(void 0,[iu].concat(i))}},info:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];k._log.apply(k,["log"].concat(e))},warn:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];k._log.apply(k,["warn"].concat(e))},error:function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];k._log.apply(k,["error"].concat(e))},critical:function(){for(var n,e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];(n=console).error.apply(n,[iu].concat(t))},uninitializedWarning:function(n){k.error("You must initialize PostHog before calling ".concat(n))}},qr={},Zr=function(n){return n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Dn(n,e,t){if(de(n)){if(eu&&n.forEach===eu)n.forEach(e,t);else if("length"in n&&n.length===+n.length){for(var i=0,r=n.length;i<r;i++)if(i in n&&e.call(t,n[i],i)===qr)return}}}function Y(n,e,t){if(!ut(n)){if(de(n))return Dn(n,e,t);if(rf(n)){var i,r=rt(n.entries());try{for(r.s();!(i=r.n()).done;){var s=i.value;if(e.call(t,s[1],s[0])===qr)return}}catch(a){r.e(a)}finally{r.f()}}else for(var o in n)if(zu.call(n,o)&&e.call(t,n[o],o)===qr)return}}var Re=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Dn(t,function(r){for(var s in r)r[s]!==void 0&&(n[s]=r[s])}),n};function U(n,e){return n.indexOf(e)!==-1}function Nr(n){for(var e=Object.keys(n),t=e.length,i=new Array(t);t--;)i[t]=[e[t],n[e[t]]];return i}var Wu=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},ru=function(n){try{return n()}catch{return}},sf=function(n){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return n.apply(this,t)}catch(r){k.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),k.critical(r)}}},Eo=function(n){var e={};return Y(n,function(t,i){Pe(t)&&t.length>0&&(e[i]=t)}),e},$o=function(n){return n.replace(/^\$/,"")};function of(n,e){return t=n,i=function(s){return Pe(s)&&!wt(e)?s.slice(0,e):s},r=new Set,function s(o,a){return o!==Object(o)?i?i(o,a):o:r.has(o)?void 0:(r.add(o),de(o)?(l=[],Dn(o,function(u){l.push(s(u))})):(l={},Y(o,function(u,c){r.has(u)||(l[c]=s(u,c))})),l);var l}(t);var t,i,r}var tt,af=function(n){var e,t,i,r,s="";for(e=t=0,i=(n=(n+"").replace(/\r\n/g,`
315
319
  `).replace(/\r/g,`
316
- `)).length,r=0;r<i;r++){var o=n.charCodeAt(r),a=null;o<128?t++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),bt(a)||(t>e&&(s+=n.substring(e,t)),s+=a,e=t=r+1)}return t>e&&(s+=n.substring(e,n.length)),s},mt=function(){function n(e){return e&&(e.preventDefault=n.preventDefault,e.stopPropagation=n.stopPropagation),e}return n.preventDefault=function(){this.returnValue=!1},n.stopPropagation=function(){this.cancelBubble=!0},function(e,t,i,r,s){if(e)if(e.addEventListener&&!r)e.addEventListener(t,i,!!s);else{var o="on"+t,a=e[o];e[o]=function(l,u,c){return function(p){if(p=p||n(m?.event)){var f,h=!0;it(c)&&(f=c(p));var g=u.call(l,p);return f!==!1&&g!==!1||(h=!1),h}}}(e,i,a)}else k.error("No valid element provided to register_event")}}();function jn(n,e){var t=function(){if(!T)return e("document not found");var i=T.createElement("script");i.type="text/javascript",i.src=n,i.onload=function(o){return e(void 0,o)},i.onerror=function(o){return e(o)};var r,s=T.querySelectorAll("body > script");s.length>0?(r=s[0].parentNode)===null||r===void 0||r.insertBefore(i,s[0]):T.body.appendChild(i)};T!=null&&T.body?t():T?.addEventListener("DOMContentLoaded",t)}function qu(n,e){for(var t=0;t<n.length;t++)if(e(n[t]))return n[t]}(function(n){n.GZipJS="gzip-js",n.Base64="base64"})(tt||(tt={}));var Uu="$people_distinct_id",xi="__alias",ki="__timers",Zl="$autocapture_disabled_server_side",So="$heatmaps_enabled_server_side",Eo="$session_recording_enabled_server_side",eu="$console_log_recording_enabled_server_side",tu="$session_recording_network_payload_capture",nu="$session_recording_canvas_recording",iu="$replay_sample_rate",ru="$replay_minimum_duration",jr="$sesid",Ei="$session_is_sampled",Pn="$enabled_feature_flags",$o="$early_access_features",On="$stored_person_properties",Dt="$stored_group_properties",Co="$surveys",ao="$surveys_activated",Nr="$flag_call_reported",gt="$user_state",Ao="$client_session_props",Io="$capture_rate_limit",To="$initial_campaign_params",Ro="$initial_referrer_info",su="$initial_person_info",qr="$epp",Po="__POSTHOG_TOOLBAR__",Zp=[Uu,xi,"__cmpns",ki,Eo,So,jr,Pn,gt,$o,Dt,On,Co,Nr,Ao,Io,To,Ro,qr],lo="$active_feature_flags",Ar="$override_feature_flags",ou="$feature_flag_payloads",au=function(n){var e,t={},i=rt(Mr(n||{}));try{for(i.s();!(e=i.n()).done;){var r=Ie(e.value,2),s=r[0],o=r[1];o&&(t[s]=o)}}catch(a){i.e(a)}finally{i.f()}return t},ef=function(){function n(e){W(this,n),this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return V(n,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Pn),t=this.instance.get_property(Ar);if(!t)return e||{};for(var i=Te({},e),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this._override_warning||(k.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(ou)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,i=this.instance.get_property(On),r=this.instance.get_property(Dt),s={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:s,compression:this.instance.config.disable_compression?void 0:tt.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(o){var a;e.setReloadingPaused(!1);var l=!0;o.statusCode===200&&(e.$anon_distinct_id=void 0,l=!1),e.receivedFeatureFlags((a=o.json)!==null&&a!==void 0?a:{},l),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var i,r=this.getFlagVariants()[e],s="".concat(r),o=this.instance.get_property(Nr)||{};return(t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))&&(de(o[e])?o[e].push(s):o[e]=[s],(i=this.instance.persistence)===null||i===void 0||i.register(y({},Nr,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r})),r}k.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);k.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})}},{key:"receivedFeatureFlags",value:function(e,t){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads();(function(s,o){var a,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},c=s.featureFlags,p=s.featureFlagPayloads;if(c)if(de(c)){var f,h={};if(c)for(var g=0;g<c.length;g++)h[c[g]]=!0;o&&o.register((y(f={},lo,c),y(f,Pn,h),f))}else{var v=c,w=p;s.errorsWhileComputingFlags&&(v=I(I({},l),v),w=I(I({},u),w)),o&&o.register((y(a={},lo,Object.keys(au(v))),y(a,Pn,v||{}),y(a,ou,w||{}),a))}})(e,this.instance.persistence,i,r),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return k.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,e===!1)this.instance.persistence.unregister(Ar);else if(de(e)){for(var t={},i=0;i<e.length;i++)t[e[i]]=!0;this.instance.persistence.register(y({},Ar,t))}else this.instance.persistence.register(y({},Ar,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var i=this._prepareFeatureFlagsForCallbacks(),r=i.flags,s=i.flagVariants;e(r,s)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var i,r,s=y({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:s}),this.setPersonPropertiesForFlags(s,!1);var o=I(I({},this.getFlagVariants()),{},y({},e,t));(i=this.instance.persistence)===null||i===void 0||i.register((y(r={},lo,Object.keys(au(o))),y(r,Pn,o),r)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=this.instance.get_property($o);if(r&&!i)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(s){var o;if(s.json){var a=s.json.earlyAccessFeatures;return(o=t.instance.persistence)===null||o===void 0||o.register(y({},$o,a)),e(a)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(i){return t[i]}),flagVariants:Object.keys(t).filter(function(i){return t[i]}).reduce(function(i,r){return i[r]=t[r],i},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),i=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(function(s){return s(i,r,{errorsLoading:e})})}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(On)||{};this.instance.register(y({},On,I(I({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(On)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Dt)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(function(r){i[r]=I(I({},i[r]),e[r]),delete e[r]}),this.instance.register(y({},Dt,I(I({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(Dt)||{};this.instance.register(y({},Dt,I(I({},t),{},y({},e,{}))))}else this.instance.unregister(Dt)}}]),n}();Math.trunc||(Math.trunc=function(n){return n<0?Math.ceil(n):Math.floor(n)}),Number.isInteger||(Number.isInteger=function(n){return lt(n)&&isFinite(n)&&Math.floor(n)===n});var lu="0123456789abcdef",tf=function(){function n(e){if(W(this,n),this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}return V(n,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+lu.charAt(this.bytes[t]>>>4)+lu.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new n(this.bytes.slice(0))}},{key:"equals",value:function(e){return this.compareTo(e)===0}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}}],[{key:"fromFieldsV7",value:function(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new n(s)}}]),n}(),nf=function(){function n(){W(this,n),y(this,"timestamp",0),y(this,"counter",0),y(this,"random",new rf)}return V(n,[{key:"generate",value:function(){var e=this.generateOrAbort();if(F(e)){this.timestamp=0;var t=this.generateOrAbort();if(F(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return tf.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),n}(),Bu=function(n){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<n.length;e++)n[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return n};m&&!F(m.crypto)&&crypto.getRandomValues&&(Bu=function(n){return crypto.getRandomValues(n)});var uu,rf=function(){function n(){W(this,n),y(this,"buffer",new Uint32Array(8)),y(this,"cursor",1/0)}return V(n,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(Bu(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),n}(),Nt=function(){return sf().toString()},sf=function(){return(uu||(uu=new nf)).generate()},of="Thu, 01 Jan 1970 00:00:00 GMT",_i="",af=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function lf(n,e){if(e){var t=function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T;if(_i)return _i;if(!s||["localhost","127.0.0.1"].includes(r))return"";for(var o=r.split("."),a=Math.min(o.length,8),l="dmn_chk_"+Nt(),u=new RegExp("(^|;)\\s*"+l+"=1");!_i&&a--;){var c=o.slice(a).join("."),p=l+"=1;domain=."+c;s.cookie=p,u.test(s.cookie)&&(s.cookie=p+";expires="+of,_i=c)}return _i}(n);if(!t){var i=function(r){var s=r.match(af);return s?s[0]:""}(n);i!==t&&k.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var xe,_t={is_supported:function(){return!!T},error:function(n){k.error("cookieStore error: "+n)},get:function(n){if(T){try{for(var e=n+"=",t=T.cookie.split(";").filter(function(s){return s.length}),i=0;i<t.length;i++){for(var r=t[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},parse:function(n){var e;try{e=JSON.parse(_t.get(n))||{}}catch{}return e},set:function(n,e,t,i,r){if(T)try{var s="",o="",a=lf(T.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),s="; expires="+l.toUTCString()}r&&(o="; secure");var u=n+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&k.warn("cookieStore warning: large cookie, len="+u.length),T.cookie=u,u}catch{return}},remove:function(n,e){try{_t.set(n,"",-1,e)}catch{return}}},uo=null,fe={is_supported:function(){if(!bt(uo))return uo;var n=!0;if(F(m))n=!1;else try{var e="__mplssupport__";fe.set(e,"xyz"),fe.get(e)!=='"xyz"'&&(n=!1),fe.remove(e)}catch{n=!1}return n||k.error("localStorage unsupported; falling back to cookie store"),uo=n,n},error:function(n){k.error("localStorage error: "+n)},get:function(n){try{return m?.localStorage.getItem(n)}catch(e){fe.error(e)}return null},parse:function(n){try{return JSON.parse(fe.get(n))||{}}catch{}return null},set:function(n,e){try{m?.localStorage.setItem(n,JSON.stringify(e))}catch(t){fe.error(t)}},remove:function(n){try{m?.localStorage.removeItem(n)}catch(e){fe.error(e)}}},uf=["distinct_id",jr,Ei,qr],Ir=I(I({},fe),{},{parse:function(n){try{var e={};try{e=_t.parse(n)||{}}catch{}var t=Te(e,JSON.parse(fe.get(n)||"{}"));return fe.set(n,t),t}catch{}return null},set:function(n,e,t,i,r){try{fe.set(n,e);var s={};uf.forEach(function(o){e[o]&&(s[o]=e[o])}),Object.keys(s).length&&_t.set(n,s,t,i,r)}catch(o){fe.error(o)}},remove:function(n,e){try{m?.localStorage.removeItem(n),_t.remove(n,e)}catch(t){fe.error(t)}}}),Tr={},cf={is_supported:function(){return!0},error:function(n){k.error("memoryStorage error: "+n)},get:function(n){return Tr[n]||null},parse:function(n){return Tr[n]||null},set:function(n,e){Tr[n]=e},remove:function(n){delete Tr[n]}},nn=null,ke={is_supported:function(){if(!bt(nn))return nn;if(nn=!0,F(m))nn=!1;else try{var n="__support__";ke.set(n,"xyz"),ke.get(n)!=='"xyz"'&&(nn=!1),ke.remove(n)}catch{nn=!1}return nn},error:function(n){k.error("sessionStorage error: ",n)},get:function(n){try{return m?.sessionStorage.getItem(n)}catch(e){ke.error(e)}return null},parse:function(n){try{return JSON.parse(ke.get(n))||null}catch{}return null},set:function(n,e){try{m?.sessionStorage.setItem(n,JSON.stringify(e))}catch(t){ke.error(t)}},remove:function(n){try{m?.sessionStorage.removeItem(n)}catch(e){ke.error(e)}}},pf=["localhost","127.0.0.1"],$i=function(n){var e=T?.createElement("a");return F(e)?null:(e.href=n,e)},cu=function(n,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(n)},ff=function(n){var e,t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",r=[];return Y(n,function(s,o){F(s)||F(o)||o==="undefined"||(e=encodeURIComponent(function(a){return a instanceof File}(s)?s.name:s.toString()),t=encodeURIComponent(o),r[r.length]=t+"="+e)}),r.join(i)},pu=function(n,e){for(var t,i=((n.split("#")[0]||"").split("?")[1]||"").split("&"),r=0;r<i.length;r++){var s=i[r].split("=");if(s[0]===e){t=s;break}}if(!de(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{k.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Ur=function(n,e){var t=n.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Je="Mobile",Br="iOS",ct="Android",Ri="Tablet",zu=ct+" "+Ri,Hu="iPad",Wu="Apple",Vu=Wu+" Watch",Pi="Safari",Nn="BlackBerry",Gu="Samsung",Xu=Gu+"Browser",Ju=Gu+" Internet",qt="Chrome",hf=qt+" OS",Yu=qt+" "+Br,zo="Internet Explorer",Ku=zo+" "+Je,Ho="Opera",df=Ho+" Mini",Wo="Edge",Qu="Microsoft "+Wo,Mn="Firefox",Zu=Mn+" "+Br,Oi="Nintendo",Fi="PlayStation",Dn="Xbox",ec=ct+" "+Je,tc=Je+" "+Pi,Si="Windows",Oo=Si+" Phone",fu="Nokia",Fo="Ouya",nc="Generic",gf=nc+" "+Je.toLowerCase(),ic=nc+" "+Ri.toLowerCase(),Mo="Konqueror",Ae="(\\d+(\\.\\d+)?)",co=new RegExp("Version/"+Ae),vf=new RegExp(Dn,"i"),mf=new RegExp(Fi+" \\w+","i"),yf=new RegExp(Oi+" \\w+","i"),Vo=new RegExp(Nn+"|PlayBook|BB10","i"),_f={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},bf=function(n,e){return e&&U(e,Wu)||function(t){return U(t,Pi)&&!U(t,qt)&&!U(t,ct)}(n)},hu=function(n,e){return e=e||"",U(n," OPR/")&&U(n,"Mini")?df:U(n," OPR/")?Ho:Vo.test(n)?Nn:U(n,"IE"+Je)||U(n,"WPDesktop")?Ku:U(n,Xu)?Ju:U(n,Wo)||U(n,"Edg/")?Qu:U(n,"FBIOS")?"Facebook "+Je:U(n,"UCWEB")||U(n,"UCBrowser")?"UC Browser":U(n,"CriOS")?Yu:U(n,"CrMo")?qt:U(n,ct)&&U(n,Pi)?ec:U(n,qt)?qt:U(n,"FxiOS")?Zu:U(n.toLowerCase(),Mo.toLowerCase())?Mo:bf(n,e)?U(n,Je)?tc:Pi:U(n,Mn)?Mn:U(n,"MSIE")||U(n,"Trident/")?zo:U(n,"Gecko")?Mn:""},wf=(y(xe={},Ku,[new RegExp("rv:"+Ae)]),y(xe,Qu,[new RegExp(Wo+"?\\/"+Ae)]),y(xe,qt,[new RegExp("("+qt+"|CrMo)\\/"+Ae)]),y(xe,Yu,[new RegExp("CriOS\\/"+Ae)]),y(xe,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+Ae)]),y(xe,Pi,[co]),y(xe,tc,[co]),y(xe,Ho,[new RegExp("(Opera|OPR)\\/"+Ae)]),y(xe,Mn,[new RegExp(Mn+"\\/"+Ae)]),y(xe,Zu,[new RegExp("FxiOS\\/"+Ae)]),y(xe,Mo,[new RegExp("Konqueror[:/]?"+Ae,"i")]),y(xe,Nn,[new RegExp(Nn+" "+Ae),co]),y(xe,ec,[new RegExp("android\\s"+Ae,"i")]),y(xe,Ju,[new RegExp(Xu+"\\/"+Ae)]),y(xe,zo,[new RegExp("(rv:|MSIE )"+Ae)]),y(xe,"Mozilla",[new RegExp("rv:"+Ae)]),xe),du=[[new RegExp(Dn+"; "+Dn+" (.*?)[);]","i"),function(n){return[Dn,n&&n[1]||""]}],[new RegExp(Oi,"i"),[Oi,""]],[new RegExp(Fi,"i"),[Fi,""]],[Vo,[Nn,""]],[new RegExp(Si,"i"),function(n,e){if(/Phone/.test(e)||/WPDesktop/.test(e))return[Oo,""];if(new RegExp(Je).test(e)&&!/IEMobile\b/.test(e))return[Si+" "+Je,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],r=_f[i]||"";return/arm/i.test(e)&&(r="RT"),[Si,r]}return[Si,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(n){if(n&&n[3]){var e=[n[3],n[4],n[5]||"0"];return[Br,e.join(".")]}return[Br,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(n){var e="";return n&&n.length>=3&&(e=F(n[2])?n[3]:n[2]),["watchOS",e]}],[new RegExp("("+ct+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ct+")","i"),function(n){if(n&&n[2]){var e=[n[2],n[3],n[4]||"0"];return[ct,e.join(".")]}return[ct,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(n){var e=["Mac OS X",""];if(n&&n[1]){var t=[n[1],n[2],n[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[hf,""]],[/Linux|debian/i,["Linux",""]]],gu=function(n){return yf.test(n)?Oi:mf.test(n)?Fi:vf.test(n)?Dn:new RegExp(Fo,"i").test(n)?Fo:new RegExp("("+Oo+"|WPDesktop)","i").test(n)?Oo:/iPad/.test(n)?Hu:/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(n)?Vu:Vo.test(n)?Nn:/(kobo)\s(ereader|touch)/i.test(n)?"Kobo":new RegExp(fu,"i").test(n)?fu:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(n)||/(kf[a-z]+)( bui|\)).+silk\//i.test(n)?"Kindle Fire":/(Android|ZTE)/i.test(n)?!new RegExp(Je).test(n)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(n)?/pixel[\daxl ]{1,6}/i.test(n)&&!/pixel c/i.test(n)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(n)||/lmy47v/i.test(n)&&!/QTAQZ3/i.test(n)?ct:zu:ct:new RegExp("(pda|"+Je+")","i").test(n)?gf:new RegExp(Ri,"i").test(n)&&!new RegExp(Ri+" pc","i").test(n)?ic:""},Rr="https?://(.*)",xf=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid"],be={campaignParams:function(n){return T?this._campaignParamsFromUrl(T.URL,n):{}},_campaignParamsFromUrl:function(n,e){var t=xf.concat(e||[]),i={};return Y(t,function(r){var s=pu(n,r);s&&(i[r]=s)}),i},_searchEngine:function(n){return n?n.search(Rr+"google.([^/?]*)")===0?"google":n.search(Rr+"bing.com")===0?"bing":n.search(Rr+"yahoo.com")===0?"yahoo":n.search(Rr+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(n){var e=be._searchEngine(n),t=e!="yahoo"?"q":"p",i={};if(!bt(e)){i.$search_engine=e;var r=T?pu(T.referrer,t):"";r.length&&(i.ph_keyword=r)}return i},searchInfo:function(){var n=T?.referrer;return n?this._searchInfoFromReferrer(n):{}},browser:hu,browserVersion:function(n,e){var t=hu(n,e),i=wf[t];if(F(i))return null;for(var r=0;r<i.length;r++){var s=i[r],o=n.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(n){for(var e=0;e<du.length;e++){var t=Ie(du[e],2),i=t[0],r=t[1],s=i.exec(n),o=s&&(it(r)?r(s,n):r);if(o)return o}return["",""]},device:gu,deviceType:function(n){var e=gu(n);return e===Hu||e===zu||e==="Kobo"||e==="Kindle Fire"||e===ic?Ri:e===Oi||e===Dn||e===Fi||e===Fo?"Console":e===Vu?"Wearable":e?Je:"Desktop"},referrer:function(){return T?.referrer||"$direct"},referringDomain:function(){var n;return T!=null&&T.referrer&&((n=$i(T.referrer))===null||n===void 0?void 0:n.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:De?.href}},initialPersonPropsFromInfo:function(n){var e,t=n.r,i=n.u,r={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=$i(t))===null||e===void 0?void 0:e.host};if(i){r.$initial_current_url=i;var s=$i(i);r.$initial_host=s?.host,r.$initial_pathname=s?.pathname,Y(this._campaignParamsFromUrl(i),function(o,a){r["$initial_"+ko(a)]=o})}return t&&Y(this._searchInfoFromReferrer(t),function(o,a){r["$initial_"+ko(a)]=o}),r},properties:function(){if(!ae)return{};var n=Ie(be.os(ae),2),e=n[0],t=n[1];return Te(xo({$os:e,$os_version:t,$browser:be.browser(ae,navigator.vendor),$device:be.device(ae),$device_type:be.deviceType(ae)}),{$current_url:De?.href,$host:De?.host,$pathname:De?.pathname,$raw_user_agent:ae.length>1e3?ae.substring(0,997)+"...":ae,$browser_version:be.browserVersion(ae,navigator.vendor),$browser_language:be.browserLanguage(),$screen_height:m?.screen.height,$screen_width:m?.screen.width,$viewport_height:m?.innerHeight,$viewport_width:m?.innerWidth,$lib:"web",$lib_version:jt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Nu()/1e3})},people_properties:function(){if(!ae)return{};var n=Ie(be.os(ae),2),e=n[0],t=n[1];return Te(xo({$os:e,$os_version:t,$browser:be.browser(ae,navigator.vendor)}),{$browser_version:be.browserVersion(ae,navigator.vendor)})}},kf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],po=function(){function n(e){W(this,n),this.config=e,this.props={},this.campaign_params_saved=!1,this.name=function(t){var i="";return t.token&&(i=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+i+"_posthog"}(e),this.storage=this.buildStorage(e),this.load(),this.update_config(e,e),this.save()}return V(n,[{key:"buildStorage",value:function(e){kf.indexOf(e.persistence.toLowerCase())===-1&&(k.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&fe.is_supported()?fe:t==="localstorage+cookie"&&Ir.is_supported()?Ir:t==="sessionstorage"&&ke.is_supported()?ke:t==="memory"?cf:t==="cookie"?_t:Ir.is_supported()?Ir:_t}},{key:"properties",value:function(){var e={};return Y(this.props,function(t,i){if(i===Pn&&nt(t))for(var r=Object.keys(t),s=0;s<r.length;s++)e["$feature/".concat(r[s])]=t[r[s]];else a=i,l=!1,(bt(o=Zp)?l:Jl&&o.indexOf===Jl?o.indexOf(a)!=-1:(Y(o,function(u){if(l||(l=u===a))return Lr}),l))||(e[i]=t);var o,a,l}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Te({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,i){var r=this;if(nt(e)){F(t)&&(t="None"),this.expire_days=F(i)?this.default_expiry:i;var s=!1;if(Y(e,function(o,a){r.props.hasOwnProperty(a)&&r.props[a]!==t||(r.props[a]=o,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var i=this;if(nt(e)){this.expire_days=F(t)?this.default_expiry:t;var r=!1;if(Y(e,function(s,o){e.hasOwnProperty(o)&&i.props[o]!==s&&(i.props[o]=s,r=!0)}),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(be.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(be.searchInfo())}},{key:"update_referrer_info",value:function(){this.register(be.referrerInfo())}},{key:"set_initial_person_info",value:function(){this.props[To]||this.props[Ro]||this.register_once(y({},su,be.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return xo({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};Y([Ro,To],function(s){var o=e.props[s];o&&Y(o,function(a,l){t["$initial_"+ko(l)]=a})});var i=this.props[su];if(i){var r=be.initialPersonPropsFromInfo(i);Te(t,r)}return t}},{key:"safe_merge",value:function(e){return Y(this.props,function(t,i){i in e||(e[i]=t)}),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this.buildStorage(e),r=this.props;this.clear(),this.storage=i,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var i=this.props[ki]||{};i[e]=t,this.props[ki]=i,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[ki]||{})[e];return F(t)||(delete this.props[ki][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),n}(),Sf=2,Ef=4,sn=function(n){return n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n}(sn||{}),Ue=function(n){return n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n}(Ue||{});function Go(n){return n?Yr(n).split(/\s+/):[]}function zr(n){var e="";switch(Ti(n.className)){case"string":e=n.className;break;case"object":e=("baseVal"in n.className?n.className.baseVal:null)||n.getAttribute("class")||"";break;default:e=""}return Go(e)}function rc(n){return ut(n)?null:Yr(n).split(/(\s+)/).filter(function(e){return Ln(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Hr(n){var e="";return Lo(n)&&!lc(n)&&n.childNodes&&n.childNodes.length&&Y(n.childNodes,function(t){var i;sc(t)&&t.textContent&&(e+=(i=rc(t.textContent))!==null&&i!==void 0?i:"")}),Yr(e)}function Xo(n){return!!n&&n.nodeType===1}function Ut(n,e){return!!n&&!!n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function sc(n){return!!n&&n.nodeType===3}function oc(n){return!!n&&n.nodeType===11}var Do=["a","button","form","input","select","textarea","label"];function ac(n){var e=n.parentNode;return!(!e||!Xo(e))&&e}function $f(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!m||!n||Ut(n,"html")||!Xo(n))return!1;if(t!=null&&t.url_allowlist){var s=m.location.href,o=t.url_allowlist;if(o&&!o.some(function(v){return s.match(v)}))return!1}if(t!=null&&t.dom_event_allowlist){var a=t.dom_event_allowlist;if(a&&!a.some(function(v){return e.type===v}))return!1}for(var l=!1,u=[n],c=!0,p=n;p.parentNode&&!Ut(p,"body");)if(oc(p.parentNode))u.push(p.parentNode.host),p=p.parentNode.host;else{if(!(c=ac(p)))break;if(i||Do.indexOf(c.tagName.toLowerCase())>-1)l=!0;else{var f=m.getComputedStyle(c);f&&f.getPropertyValue("cursor")==="pointer"&&(l=!0)}u.push(c),p=c}if(!function(v,w){var D=w?.element_allowlist;if(F(D))return!0;var $,M=rt(v);try{var q=function(){var X=$.value;if(D.some(function(J){return X.tagName.toLowerCase()===J}))return{v:!0}};for(M.s();!($=M.n()).done;){var H=q();if(Ti(H)==="object")return H.v}}catch(X){M.e(X)}finally{M.f()}return!1}(u,t)||!function(v,w){var D=w?.css_selector_allowlist;if(F(D))return!0;var $,M=rt(v);try{var q=function(){var X=$.value;if(D.some(function(J){return X.matches(J)}))return{v:!0}};for(M.s();!($=M.n()).done;){var H=q();if(Ti(H)==="object")return H.v}}catch(X){M.e(X)}finally{M.f()}return!1}(u,t))return!1;var h=m.getComputedStyle(n);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=n.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return l?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Do.indexOf(g)>-1||n.getAttribute("contenteditable")==="true")}}function Lo(n){for(var e=n;e.parentNode&&!Ut(e,"body");e=e.parentNode){var t=zr(e);if(U(t,"ph-sensitive")||U(t,"ph-no-capture"))return!1}if(U(zr(n),"ph-include"))return!0;var i=n.type||"";if(Re(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=n.name||n.id||"";return!(Re(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function lc(n){return!!(Ut(n,"input")&&!["button","checkbox","submit","reset"].includes(n.type)||Ut(n,"select")||Ut(n,"textarea")||n.getAttribute("contenteditable")==="true")}var uc="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Cf=new RegExp("^(?:".concat(uc,")$")),Af=new RegExp(uc),cc="\\d{3}-?\\d{2}-?\\d{4}",If=new RegExp("^(".concat(cc,")$")),Tf=new RegExp("(".concat(cc,")"));function Ln(n){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(ut(n)||Re(n)&&(n=Yr(n),(e?Cf:Af).test((n||"").replace(/[- ]/g,""))||(e?If:Tf).test(n)))}function vu(n){var e=Hr(n);return Ln(e="".concat(e," ").concat(pc(n)).trim())?e:""}function pc(n){var e="";return n&&n.childNodes&&n.childNodes.length&&Y(n.childNodes,function(t){var i;if(t&&((i=t.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var r=Hr(t);e="".concat(e," ").concat(r).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(pc(t)).trim())}catch(s){k.error(s)}}),e}function Rf(n){return function(e){var t=e.map(function(i){var r,s,o="";if(i.tag_name&&(o+=i.tag_name),i.attr_class){i.attr_class.sort();var a,l=rt(i.attr_class);try{for(l.s();!(a=l.n()).done;){var u=a.value;o+=".".concat(u.replace(/"/g,""))}}catch(f){l.e(f)}finally{l.f()}}var c=I(I(I(I({},i.text?{text:i.text}:{}),{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(s=i.nth_of_type)!==null&&s!==void 0?s:0},i.href?{href:i.href}:{}),i.attr_id?{attr_id:i.attr_id}:{}),i.attributes),p={};return Mr(c).sort(function(f,h){var g=Ie(f,1)[0],v=Ie(h,1)[0];return g.localeCompare(v)}).forEach(function(f){var h=Ie(f,2),g=h[0],v=h[1];return p[mu(g.toString())]=mu(v.toString())}),o+=":",o+=Mr(c).map(function(f){var h=Ie(f,2),g=h[0],v=h[1];return"".concat(g,'="').concat(v,'"')}).join("")});return t.join(";")}(function(e){return e.map(function(t){var i,r,s={text:(i=t.$el_text)===null||i===void 0?void 0:i.slice(0,400),tag_name:t.tag_name,href:(r=t.attr__href)===null||r===void 0?void 0:r.slice(0,2048),attr_class:Pf(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Mr(t).filter(function(o){return Ie(o,1)[0].indexOf("attr__")===0}).forEach(function(o){var a=Ie(o,2),l=a[0],u=a[1];return s.attributes[l]=u}),s})}(n))}function mu(n){return n.replace(/"|\\"/g,'\\"')}function Pf(n){var e=n.attr__class;return e?de(e)?e:Go(e):void 0}var jo="[SessionRecording]",No="redacted",fo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(n){return n},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},Of=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Ff=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Mf=["/s/","/e/","/i/"];function yu(n,e,t,i){if(ut(n))return n;var r=e?.["content-length"]||function(s){return new Blob([s]).size}(n);return Re(r)&&(r=parseInt(r)),r>t?jo+" ".concat(i," body too large to record (").concat(r," bytes)"):n}function _u(n,e){if(ut(n))return n;var t=n;return Ln(t,!1)||(t=jo+" "+e+" body "+No),Y(Ff,function(i){var r,s;(r=t)!==null&&r!==void 0&&r.length&&((s=t)===null||s===void 0?void 0:s.indexOf(i))!==-1&&(t=jo+" "+e+" body "+No+" as might contain: "+i)}),t}var Df=function(n,e){var t,i,r,s={payloadSizeLimitBytes:fo.payloadSizeLimitBytes,performanceEntryTypeToObserve:on(fo.performanceEntryTypeToObserve)},o=n.session_recording.recordHeaders!==!1&&e.recordHeaders,a=n.session_recording.recordBody!==!1&&e.recordBody,l=n.capture_performance!==!1&&e.recordPerformance,u=(t=s,r=Math.min(1e6,(i=t.payloadSizeLimitBytes)!==null&&i!==void 0?i:1e6),function(f){return f!=null&&f.requestBody&&(f.requestBody=yu(f.requestBody,f.requestHeaders,r,"Request")),f!=null&&f.responseBody&&(f.responseBody=yu(f.responseBody,f.responseHeaders,r,"Response")),f}),c=function(f){return u(function(v){var w=$i(v.name);if(!(w&&w.pathname&&Mf.some(function(D){return w.pathname.indexOf(D)===0})))return v}((g=(h=f).requestHeaders,ut(g)||Y(Object.keys(g??{}),function(v){Of.includes(v.toLowerCase())&&(g[v]=No)}),h)));var h,g},p=it(n.session_recording.maskNetworkRequestFn);return p&&it(n.session_recording.maskCapturedNetworkRequestFn)&&k.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),p&&(n.session_recording.maskCapturedNetworkRequestFn=function(f){var h=n.session_recording.maskNetworkRequestFn({url:f.name});return I(I({},f),{},{name:h?.url})}),s.maskRequestFn=it(n.session_recording.maskCapturedNetworkRequestFn)?function(f){var h,g,v,w=c(f);return w&&(h=(g=(v=n.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(v,w))!==null&&h!==void 0?h:void 0}:function(f){return function(h){if(!F(h))return h.requestBody=_u(h.requestBody,"Request"),h.responseBody=_u(h.responseBody,"Response"),h}(c(f))},I(I(I({},fo),s),{},{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})},Lf=V(function n(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};W(this,n),y(this,"bucketSize",100),y(this,"refillRate",10),y(this,"mutationBuckets",{}),y(this,"loggedTracker",{}),y(this,"refillBuckets",function(){Object.keys(r.mutationBuckets).forEach(function(o){r.mutationBuckets[o]=r.mutationBuckets[o]+r.refillRate,r.mutationBuckets[o]>=r.bucketSize&&delete r.mutationBuckets[o]})}),y(this,"getNodeOrRelevantParent",function(o){var a=r.rrweb.mirror.getNode(o);if(a?.nodeName!=="svg"&&a instanceof Element){var l=a.closest("svg");if(l)return[r.rrweb.mirror.getId(l),l]}return[o,a]}),y(this,"numberOfChanges",function(o){var a,l,u,c,p,f,h,g;return((a=(l=o.removes)===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0)+((u=(c=o.attributes)===null||c===void 0?void 0:c.length)!==null&&u!==void 0?u:0)+((p=(f=o.texts)===null||f===void 0?void 0:f.length)!==null&&p!==void 0?p:0)+((h=(g=o.adds)===null||g===void 0?void 0:g.length)!==null&&h!==void 0?h:0)}),y(this,"throttleMutations",function(o){if(o.type!==3||o.data.source!==0)return o;var a=o.data,l=r.numberOfChanges(a);a.attributes&&(a.attributes=a.attributes.filter(function(c){var p,f,h,g=Ie(r.getNodeOrRelevantParent(c.id),2),v=g[0],w=g[1];return r.mutationBuckets[v]===0?!1:(r.mutationBuckets[v]=(p=r.mutationBuckets[v])!==null&&p!==void 0?p:r.bucketSize,r.mutationBuckets[v]=Math.max(r.mutationBuckets[v]-1,0),r.mutationBuckets[v]===0&&(r.loggedTracker[v]||(r.loggedTracker[v]=!0,(f=(h=r.options).onBlockedNode)===null||f===void 0||f.call(h,v,w))),c)}));var u=r.numberOfChanges(a);return u!==0||l===u?o:void 0}),this.rrweb=e,this.options=s,this.refillRate=(t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,this.bucketSize=(i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,setInterval(function(){r.refillBuckets()},1e3)}),jf=3e5,Nf=[Ue.MouseMove,Ue.MouseInteraction,Ue.Scroll,Ue.ViewportResize,Ue.Input,Ue.TouchMove,Ue.MediaInteraction,Ue.Drag],qf=[Ue.StyleSheetRule,Ue.StyleDeclaration,Ue.AdoptedStyleSheet,Ue.Font],Uf=[sn.Custom,sn.Meta,sn.FullSnapshot],bu=function(){function n(e,t){W(this,n),this.size=0,this.data=[],this.sessionId=e,this.windowId=t}return V(n,[{key:"mostRecentSnapshotTimestamp",get:function(){return this.data.length?this.data[this.data.length-1].timestamp:null}},{key:"add",value:function(e){this.size+=e.$snapshot_bytes,this.data.push(e.$snapshot_data)}}]),n}(),wu=function(n){return{rrwebMethod:n,enqueuedAt:Date.now(),attempt:1}},Xe="[SessionRecording]";function Bf(n){return JSON.stringify(n,(e=[],function(t,i){if(nt(i)){for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(i)?"[Circular]":(e.push(i),i)}return i})).length;var e}var vt,zf=function(){function n(e){var t=this;if(W(this,n),y(this,"queuedRRWebEvents",[]),y(this,"isIdle",!1),y(this,"_linkedFlagSeen",!1),y(this,"_lastActivityTimestamp",Date.now()),y(this,"_linkedFlag",null),y(this,"_forceAllowLocalhostNetworkCapture",!1),y(this,"_samplingSessionListener",null),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,m?.addEventListener("beforeunload",function(){t._flushBuffer()}),m?.addEventListener("offline",function(){t._tryAddCustomEvent("browser offline",{})}),m?.addEventListener("online",function(){t._tryAddCustomEvent("browser online",{})}),m?.addEventListener("visibilitychange",function(){if(T!=null&&T.visibilityState){var o="window "+T.visibilityState;t._tryAddCustomEvent(o,{})}}),!this.instance.sessionManager)throw k.error(Xe+" started without valid sessionManager"),new Error(Xe+" started without valid sessionManager. This is a bug.");var i=this.sessionManager.checkAndGetSessionAndWindowId(),r=i.sessionId,s=i.windowId;this.sessionId=r,this.windowId=s,this.buffer=new bu(this.sessionId,this.windowId),this._setupSampling()}return V(n,[{key:"rrwebRecord",get:function(){var e;return he==null||(e=he.rrweb)===null||e===void 0?void 0:e.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw new Error(Xe+" started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"fullSnapshotIntervalMillis",get:function(){var e;return((e=this.instance.config.session_recording)===null||e===void 0?void 0:e.full_snapshot_interval_millis)||jf}},{key:"isSampled",get:function(){var e=this.instance.get_property(Ei);return Fr(e)?e:null}},{key:"sessionDuration",get:function(){var e=this.buffer.mostRecentSnapshotTimestamp,t=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return e?e-t:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Eo),t=!this.instance.config.disable_session_recording;return m&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(eu),t=this.instance.config.enable_recording_console_log;return t??e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(nu);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,i=this.instance.get_property(tu),r={recordHeaders:(e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recordHeaders,recordBody:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.recordBody},s=r?.recordHeaders||i?.recordHeaders,o=r?.recordBody||i?.recordBody,a=this.instance.config.capture_performance||i?.capturePerformance;return s||o||a?{recordHeaders:s,recordBody:o,recordPerformance:a}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(iu);return lt(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(ru);return lt(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?ut(this._linkedFlag)||this._linkedFlagSeen?Fr(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),k.info(Xe+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,k.info(Xe+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,i=this.sessionId!==e,r=this.sampleRate;if(lt(r)){var s,o=this.isSampled,a=i||!Fr(o);a?s=Math.random()<r:s=o,!s&&a&&k.warn(Xe+" Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r}),(t=this.instance.persistence)===null||t===void 0||t.register(y({},Ei,s))}else{var l;(l=this.instance.persistence)===null||l===void 0||l.register(y({},Ei,null))}}},{key:"afterDecideResponse",value:function(e){var t,i,r,s=this;if(this._persistDecideResponse(e),this._linkedFlag=((t=e.sessionRecording)===null||t===void 0?void 0:t.linkedFlag)||null,(i=e.sessionRecording)!==null&&i!==void 0&&i.endpoint&&(this._endpoint=(r=e.sessionRecording)===null||r===void 0?void 0:r.endpoint),this._setupSampling(),!ut(this._linkedFlag)){var o=Re(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=Re(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(function(l,u){var c=nt(u)&&o in u,p=a?u[o]===a:c;if(p){var f={linkedFlag:o,linkedVariant:a},h="linked flag matched";k.info(Xe+" "+h,f),s._tryAddCustomEvent(h,f)}s._linkedFlagSeen=p})}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;lt(this.sampleRate)&&bt(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(function(t){e.makeSamplingDecision(t)}))}},{key:"_persistDecideResponse",value:function(e){if(this.instance.persistence){var t=this.instance.persistence,i=function(){var r,s,o,a,l,u,c,p,f=(r=e.sessionRecording)===null||r===void 0?void 0:r.sampleRate,h=ut(f)?null:parseFloat(f),g=(s=e.sessionRecording)===null||s===void 0?void 0:s.minimumDurationMilliseconds;t.register((y(p={},Eo,!!e.sessionRecording),y(p,eu,(o=e.sessionRecording)===null||o===void 0?void 0:o.consoleLogRecordingEnabled),y(p,tu,I({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture)),y(p,nu,{enabled:(l=e.sessionRecording)===null||l===void 0?void 0:l.recordCanvas,fps:(u=e.sessionRecording)===null||u===void 0?void 0:u.canvasFps,quality:(c=e.sessionRecording)===null||c===void 0?void 0:c.canvasQuality}),y(p,iu,h),y(p,ru,F(g)?null:g),p))};i(),this.sessionManager.onSessionId(i)}}},{key:"log",value:function(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(t=this.instance.sessionRecording)===null||t===void 0||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:Nu()})}},{key:"_startCapture",value:function(){var e=this;F(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():jn(this.instance.requestRouter.endpointFor("assets","/static/recorder.js?v=".concat(jt.LIB_VERSION)),function(t){if(t)return k.error(Xe+" could not load recorder.js",t);e._onScriptLoaded()}))}},{key:"isInteractiveEvent",value:function(e){var t;return e.type===3&&Nf.indexOf((t=e.data)===null||t===void 0?void 0:t.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0,clearTimeout(this._fullSnapshotTimer),this._flushBuffer());var i=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),s=r.windowId,o=r.sessionId,a=this.sessionId!==o,l=this.windowId!==s;this.windowId=s,this.sessionId=o,(i||[Sf,Ef].indexOf(e.type)===-1&&(l||a||F(this._fullSnapshotTimer)))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):k.warn(Xe+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var i=this;return this._tryRRWebMethod(wu(function(){return i.rrwebRecord.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(wu(function(){return e.rrwebRecord.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){for(var e,t=this,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},r=this.instance.config.session_recording,s=0,o=Object.entries(r||{});s<o.length;s++){var a=Ie(o[s],2),l=a[0],u=a[1];l in i&&(i[l]=u)}if(this.canvasRecording&&this.canvasRecording.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.canvasRecording.fps},i.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new Lf(this.rrwebRecord,{onBlockedNode:function(p,f){var h="Too many mutations on node '".concat(p,"'. Rate limiting. This could be due to SVG animations or something similar");k.info(h,{node:f}),t.log(Xe+" "+h,"warn")}});var c=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(I({emit:function(p){t.onRRwebEmit(p)},plugins:c},i)),this.instance._addCaptureHook(function(p){try{if(p==="$pageview"){var f=m?t._maskUrl(m.location.href):"";if(!f)return;t._tryAddCustomEvent("$pageview",{href:f}),t._tryTakeFullSnapshot()}}catch(h){k.error("Could not add $pageview to rrweb session",h)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:i,activePlugins:c.map(function(p){return p?.name})}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else k.error(Xe+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval(function(){e._tryTakeFullSnapshot()},t))}}},{key:"_gatherRRWebPlugins",value:function(){var e=[];return he.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(he.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&it(he.getRecordNetworkPlugin)&&(!pf.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(he.getRecordNetworkPlugin(Df(this.instance.config,this.networkPayloadCapture))):k.info(Xe+" NetworkCapture not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&nt(e)){if(e.type===sn.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===sn.FullSnapshot&&this._scheduleFullSnapshot();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var r=function(a){var l=a;if(l&&nt(l)&&l.type===6&&nt(l.data)&&l.data.plugin==="rrweb/console@1"){l.data.payload.payload.length>10&&(l.data.payload.payload=l.data.payload.payload.slice(0,10),l.data.payload.payload.push("...[truncated]"));for(var u=[],c=0;c<l.data.payload.payload.length;c++)l.data.payload.payload[c]&&l.data.payload.payload[c].length>2e3?u.push(l.data.payload.payload[c].slice(0,2e3)+"...[truncated]"):u.push(l.data.payload.payload[c]);return l.data.payload.payload=u,a}return a}(i),s=Bf(r);if(this._updateWindowAndSessionIds(r),!this.isIdle||function(a){var l=a.type===sn.IncrementalSnapshot&&!ut(a.data.source)&&qf.includes(a.data.source);return Uf.includes(a.type)||l}(r)){var o={$snapshot_bytes:s,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&m){var e=this._maskUrl(m.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=on(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach(function(i){Date.now()-i.enqueuedAt<=2e3&&e._tryRRWebMethod(i)})}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var i,r={url:e};return(i=r=t.maskNetworkRequestFn(r))===null||i===void 0?void 0:i.url}return e}},{key:"clearBuffer",value:function(){this.buffer=new bu(this.sessionId,this.windowId)}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,i=this.sessionDuration,r=lt(i)&&i>=0,s=lt(t)&&r&&i<t;this.status==="buffering"||s?this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3):(this.buffer.data.length>0&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer())}},{key:"_captureSnapshotBuffered",value:function(e){var t,i=this,r=2+(((t=this.buffer)===null||t===void 0?void 0:t.data.length)||0);(this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&this._flushBuffer(),this.buffer.add(e),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){i._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",_noHeatmaps:!0})}}]),n}(),Hf=function(){function n(e){W(this,n),this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return V(n,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(On),group_properties:this.instance.get_property(Dt),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:tt.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(i){return e.parseDecideResponse(i.json)}})}},{key:"parseDecideResponse",value:function(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var i=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},i),i)k.error("Failed to fetch feature flags from PostHog.");else{if(!T||!T.body)return k.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){t.parseDecideResponse(e)},500);this.instance._afterDecideResponse(e);var r=m?.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&F(r)&&jn(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js"),function(l){if(l)return k.error("Could not load exception autocapture script",l);m.extendPostHogWithExceptionAutocapture(t.instance,e)}),e.siteApps)if(this.instance.config.opt_in_site_apps){var s,o=rt(e.siteApps);try{var a=function(){var l=s.value,u=l.id,c=l.url,p=t.instance.requestRouter.endpointFor("api",c);he["__$$ph_site_app_".concat(u)]=t.instance,jn(p,function(f){f&&k.error("Error while initializing PostHog app with config id ".concat(u),f)})};for(o.s();!(s=o.n()).done;)a()}catch(l){o.e(l)}finally{o.f()}}else e.siteApps.length>0&&k.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),n}(),Wf=m!=null&&m.location?Ur(m.location.hash,"__posthog")||Ur(location.hash,"state"):null,xu="_postHogToolbarParams";(function(n){n[n.UNINITIALIZED=0]="UNINITIALIZED",n[n.LOADING=1]="LOADING",n[n.LOADED=2]="LOADED"})(vt||(vt={}));var Vf=function(){function n(e){W(this,n),this.instance=e}return V(n,[{key:"setToolbarState",value:function(e){he.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return(e=he.ph_toolbar_state)!==null&&e!==void 0?e:vt.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!m||!T)return!1;i=(e=i)!==null&&e!==void 0?e:m.location,s=(t=s)!==null&&t!==void 0?t:m.history;try{if(!r){try{m.localStorage.setItem("test","test"),m.localStorage.removeItem("test")}catch{return!1}r=m?.localStorage}var o,a=Wf||Ur(i.hash,"__posthog")||Ur(i.hash,"state"),l=a?Ql(function(){return JSON.parse(atob(decodeURIComponent(a)))})||Ql(function(){return JSON.parse(decodeURIComponent(a))}):null;return l&&l.action==="ph_authorize"?((o=l).source="url",o&&Object.keys(o).length>0&&(l.desiredHash?i.hash=l.desiredHash:s?s.replaceState(s.state,"",i.pathname+i.search):i.hash="")):((o=JSON.parse(r.getItem(xu)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}},{key:"_callLoadToolbar",value:function(e){(he.ph_load_toolbar||he.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var t=this,i=!(T==null||!T.getElementById(Po));if(!m||i)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=I(I({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(m.localStorage.setItem(xu,JSON.stringify(I(I({},s),{},{source:void 0}))),this.getToolbarState()===vt.LOADED)this._callLoadToolbar(s);else if(this.getToolbarState()===vt.UNINITIALIZED){this.setToolbarState(vt.LOADING);var o=3e5,a=Math.floor(Date.now()/o)*o;jn(this.instance.requestRouter.endpointFor("assets","/static/toolbar.js?t=".concat(a)),function(l){if(l)return k.error("Failed to load toolbar",l),void t.setToolbarState(vt.UNINITIALIZED);t.setToolbarState(vt.LOADED),t._callLoadToolbar(s)}),mt(m,"turbolinks:load",function(){t.setToolbarState(vt.UNINITIALIZED),t.loadToolbar(s)})}return!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,i)}}]),n}(),Gf=function(){function n(e){W(this,n),y(this,"isPaused",!0),y(this,"queue",[]),y(this,"flushTimeoutMs",3e3),this.sendRequest=e}return V(n,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},i=Object.values(t);[].concat(on(i.filter(function(r){return r.url.indexOf("/e")===0})),on(i.filter(function(r){return r.url.indexOf("/e")!==0}))).map(function(r){e.sendRequest(I(I({},r),{},{transport:"sendBeacon"}))})}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),i=function(s){var o=t[s],a=new Date().getTime();o.data&&de(o.data)&&Y(o.data,function(l){l.offset=Math.abs(l.timestamp-a),delete l.timestamp}),e.sendRequest(o)};for(var r in t)i(r)}},this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return Y(this.queue,function(t){var i,r=t,s=(r?r.batchKey:null)||r.url;F(e[s])&&(e[s]=I(I({},r),{},{data:[]})),(i=e[s].data)===null||i===void 0||i.push(r.data)}),this.queue=[],e}}]),n}(),Be=Uint8Array,Pe=Uint16Array,qn=Uint32Array,Jo=new Be([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]),Yo=new Be([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]),ku=new Be([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),fc=function(n,e){for(var t=new Pe(31),i=0;i<31;++i)t[i]=e+=1<<n[i-1];var r=new qn(t[30]);for(i=1;i<30;++i)for(var s=t[i];s<t[i+1];++s)r[s]=s-t[i]<<5|i;return[t,r]},hc=fc(Jo,2),Xf=hc[0],qo=hc[1];Xf[28]=258,qo[258]=28;for(Uo=fc(Yo,0)[1],Wr=new Pe(32768),Q=0;Q<32768;++Q)Mt=(43690&Q)>>>1|(21845&Q)<<1,Mt=(61680&(Mt=(52428&Mt)>>>2|(13107&Mt)<<2))>>>4|(3855&Mt)<<4,Wr[Q]=((65280&Mt)>>>8|(255&Mt)<<8)>>>1;var Mt,Uo,Wr,Q,Ci=function(n,e,t){for(var i=n.length,r=0,s=new Pe(e);r<i;++r)++s[n[r]-1];var o,a=new Pe(e);for(r=0;r<e;++r)a[r]=a[r-1]+s[r-1]<<1;if(t){o=new Pe(1<<e);var l=15-e;for(r=0;r<i;++r)if(n[r])for(var u=r<<4|n[r],c=e-n[r],p=a[n[r]-1]++<<c,f=p|(1<<c)-1;p<=f;++p)o[Wr[p]>>>l]=u}else for(o=new Pe(i),r=0;r<i;++r)o[r]=Wr[a[n[r]-1]++]>>>15-n[r];return o},an=new Be(288);for(Q=0;Q<144;++Q)an[Q]=8;for(Q=144;Q<256;++Q)an[Q]=9;for(Q=256;Q<280;++Q)an[Q]=7;for(Q=280;Q<288;++Q)an[Q]=8;var Vr=new Be(32);for(Q=0;Q<32;++Q)Vr[Q]=5;var Jf=Ci(an,9,0),Yf=Ci(Vr,5,0),dc=function(n){return(n/8>>0)+(7&n&&1)},gc=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var i=new(n instanceof Pe?Pe:n instanceof qn?qn:Be)(t-e);return i.set(n.subarray(e,t)),i},dt=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8},bi=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8,n[i+2]|=t>>>16},ho=function(n,e){for(var t=[],i=0;i<n.length;++i)n[i]&&t.push({s:i,f:n[i]});var r=t.length,s=t.slice();if(!r)return[new Be(0),0];if(r==1){var o=new Be(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(H,X){return H.f-X.f}),t.push({s:-1,f:25001});var a=t[0],l=t[1],u=0,c=1,p=2;for(t[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=t[t[u].f<t[p].f?u++:p++],l=t[u!=c&&t[u].f<t[p].f?u++:p++],t[c++]={s:-1,f:a.f+l.f,l:a,r:l};var f=s[0].s;for(i=1;i<r;++i)s[i].s>f&&(f=s[i].s);var h=new Pe(f+1),g=Kf(t[c-1],h,0);if(g>e){i=0;var v=0,w=g-e,D=1<<w;for(s.sort(function(H,X){return h[X.s]-h[H.s]||H.f-X.f});i<r;++i){var $=s[i].s;if(!(h[$]>e))break;v+=D-(1<<g-h[$]),h[$]=e}for(v>>>=w;v>0;){var M=s[i].s;h[M]<e?v-=1<<e-h[M]++-1:++i}for(;i>=0&&v;--i){var q=s[i].s;h[q]==e&&(--h[q],++v)}g=e}return[new Be(h),g]},Kf=function n(e,t,i){return e.s==-1?Math.max(n(e.l,t,i+1),n(e.r,t,i+1)):t[e.s]=i},Su=function(n){for(var e=n.length;e&&!n[--e];);for(var t=new Pe(++e),i=0,r=n[0],s=1,o=function(l){t[i++]=l},a=1;a<=e;++a)if(n[a]==r&&a!=e)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=n[a]}return[t.subarray(0,i),e]},wi=function(n,e){for(var t=0,i=0;i<e.length;++i)t+=n[i]*e[i];return t},Dr=function(n,e,t){var i=t.length,r=dc(e+2);n[r]=255&i,n[r+1]=i>>>8,n[r+2]=255^n[r],n[r+3]=255^n[r+1];for(var s=0;s<i;++s)n[r+s+4]=t[s];return 8*(r+4+i)},Eu=function(n,e,t,i,r,s,o,a,l,u,c){dt(e,c++,t),++r[256];for(var p=ho(r,15),f=p[0],h=p[1],g=ho(s,15),v=g[0],w=g[1],D=Su(f),$=D[0],M=D[1],q=Su(v),H=q[0],X=q[1],J=new Pe(19),E=0;E<$.length;++E)J[31&$[E]]++;for(E=0;E<H.length;++E)J[31&H[E]]++;for(var ie=ho(J,7),Z=ie[0],pt=ie[1],ve=19;ve>4&&!Z[ku[ve-1]];--ve);var ze,G,ee,le,Fe=u+5<<3,je=wi(r,an)+wi(s,Vr)+o,re=wi(r,f)+wi(s,v)+o+14+3*ve+wi(J,Z)+(2*J[16]+3*J[17]+7*J[18]);if(Fe<=je&&Fe<=re)return Dr(e,c,n.subarray(l,l+u));if(dt(e,c,1+(re<je)),c+=2,re<je){ze=Ci(f,h,0),G=f,ee=Ci(v,w,0),le=v;var Se=Ci(Z,pt,0);for(dt(e,c,M-257),dt(e,c+5,X-1),dt(e,c+10,ve-4),c+=14,E=0;E<ve;++E)dt(e,c+3*E,Z[ku[E]]);c+=3*ve;for(var Ee=[$,H],te=0;te<2;++te){var me=Ee[te];for(E=0;E<me.length;++E){var Ce=31&me[E];dt(e,c,Se[Ce]),c+=Z[Ce],Ce>15&&(dt(e,c,me[E]>>>5&127),c+=me[E]>>>12)}}}else ze=Jf,G=an,ee=Yf,le=Vr;for(E=0;E<a;++E)if(i[E]>255){Ce=i[E]>>>18&31,bi(e,c,ze[Ce+257]),c+=G[Ce+257],Ce>7&&(dt(e,c,i[E]>>>23&31),c+=Jo[Ce]);var un=31&i[E];bi(e,c,ee[un]),c+=le[un],un>3&&(bi(e,c,i[E]>>>5&8191),c+=Yo[un])}else bi(e,c,ze[i[E]]),c+=G[i[E]];return bi(e,c,ze[256]),c+G[256]},Qf=new qn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Zf=new Be(0),eh=function(){for(var n=new qn(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;n[e]=t}return n}(),th=function(n,e,t,i,r){return function(s,o,a,l,u,c){var p=s.length,f=new Be(l+p+5*(1+Math.floor(p/7e3))+u),h=f.subarray(l,f.length-u),g=0;if(!o||p<8)for(var v=0;v<=p;v+=65535){var w=v+65535;w<p?g=Dr(h,g,s.subarray(v,w)):(h[v]=c,g=Dr(h,g,s.subarray(v,p)))}else{for(var D=Qf[o-1],$=D>>>13,M=8191&D,q=(1<<a)-1,H=new Pe(32768),X=new Pe(q+1),J=Math.ceil(a/3),E=2*J,ie=function(cs){return(s[cs]^s[cs+1]<<J^s[cs+2]<<E)&q},Z=new qn(25e3),pt=new Pe(288),ve=new Pe(32),ze=0,G=0,ee=(v=0,0),le=0,Fe=0;v<p;++v){var je=ie(v),re=32767&v,Se=X[je];if(H[re]=Se,X[je]=re,le<=v){var Ee=p-v;if((ze>7e3||ee>24576)&&Ee>423){g=Eu(s,h,0,Z,pt,ve,G,ee,Fe,v-Fe,g),ee=ze=G=0,Fe=v;for(var te=0;te<286;++te)pt[te]=0;for(te=0;te<30;++te)ve[te]=0}var me=2,Ce=0,un=M,wt=re-Se&32767;if(Ee>2&&je==ie(v-wt))for(var Tc=Math.min($,Ee)-1,Rc=Math.min(32767,v),Pc=Math.min(258,Ee);wt<=Rc&&--un&&re!=Se;){if(s[v+me]==s[v+me-wt]){for(var xt=0;xt<Pc&&s[v+xt]==s[v+xt-wt];++xt);if(xt>me){if(me=xt,Ce=wt,xt>Tc)break;var Oc=Math.min(wt,xt-2),Zo=0;for(te=0;te<Oc;++te){var us=v-wt+te+32768&32767,ea=us-H[us]+32768&32767;ea>Zo&&(Zo=ea,Se=us)}}}wt+=(re=Se)-(Se=H[re])+32768&32767}if(Ce){Z[ee++]=268435456|qo[me]<<18|Uo[Ce];var ta=31&qo[me],na=31&Uo[Ce];G+=Jo[ta]+Yo[na],++pt[257+ta],++ve[na],le=v+me,++ze}else Z[ee++]=s[v],++pt[s[v]]}}g=Eu(s,h,c,Z,pt,ve,G,ee,Fe,v-Fe,g),c||(g=Dr(h,g,Zf))}return gc(f,0,l+dc(g)+u)}(n,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+e.mem,t,i,!r)},go=function(n,e,t){for(;t;++e)n[e]=t,t>>>=8};function nh(n,e){e===void 0&&(e={});var t=function(){var a=4294967295;return{p:function(l){for(var u=a,c=0;c<l.length;++c)u=eh[255&u^l[c]]^u>>>8;a=u},d:function(){return 4294967295^a}}}(),i=n.length;t.p(n);var r,s=th(n,e,10+((r=e).filename&&r.filename.length+1||0),8),o=s.length;return function(a,l){var u=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&go(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){a[3]=8;for(var c=0;c<=u.length;++c)a[c+10]=u.charCodeAt(c)}}(s,e),go(s,o-8,t.d()),go(s,o-4,i),s}var ih=!!wo||!!bo,$u="text/plain",Gr=function(n,e){var t=Ie(n.split("?"),2),i=t[0],r=t[1],s=I({},e);r?.split("&").forEach(function(a){var l=Ie(a.split("="),1)[0];delete s[l]});var o=ff(s);return o=o?(r?r+"&":"")+o:r,"".concat(i,"?").concat(o)},rh=function(n){return"data="+encodeURIComponent(typeof n=="string"?n:JSON.stringify(n))},vo=function(n){var e=n.data,t=n.compression;if(e){if(t===tt.GZipJS){var i=nh(function(s,o){var a=s.length;if(!o&&typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var l=new Be(s.length+(s.length>>>1)),u=0,c=function(g){l[u++]=g},p=0;p<a;++p){if(u+5>l.length){var f=new Be(u+8+(a-p<<1));f.set(l),l=f}var h=s.charCodeAt(p);h<128||o?c(h):h<2048?(c(192|h>>>6),c(128|63&h)):h>55295&&h<57344?(c(240|(h=65536+(1047552&h)|1023&s.charCodeAt(++p))>>>18),c(128|h>>>12&63),c(128|h>>>6&63),c(128|63&h)):(c(224|h>>>12),c(128|h>>>6&63),c(128|63&h))}return gc(l,0,u)}(JSON.stringify(e)),{mtime:0});return{contentType:$u,body:new Blob([i],{type:$u})}}if(t===tt.Base64){var r=function(s){var o,a,l,u,c,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=0,h=0,g="",v=[];if(!s)return s;s=Qp(s);do o=(c=s.charCodeAt(f++)<<16|s.charCodeAt(f++)<<8|s.charCodeAt(f++))>>18&63,a=c>>12&63,l=c>>6&63,u=63&c,v[h++]=p.charAt(o)+p.charAt(a)+p.charAt(l)+p.charAt(u);while(f<s.length);switch(g=v.join(""),s.length%3){case 1:g=g.slice(0,-2)+"==";break;case 2:g=g.slice(0,-1)+"="}return g}(JSON.stringify(e));return{contentType:"application/x-www-form-urlencoded",body:rh(r)}}return{contentType:"application/json",body:JSON.stringify(e)}}},Ai=[];wo&&Ai.push({transport:"XHR",method:function(n){var e,t=new wo;t.open(n.method||"GET",n.url,!0);var i=(e=vo(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body;Y(n.headers,function(o,a){t.setRequestHeader(a,o)}),r&&t.setRequestHeader("Content-Type",r),n.timeout&&(t.timeout=n.timeout),t.withCredentials=!0,t.onreadystatechange=function(){if(t.readyState===4){var o,a={statusCode:t.status,text:t.responseText};if(t.status===200)try{a.json=JSON.parse(t.responseText)}catch{}(o=n.callback)===null||o===void 0||o.call(n,a)}},t.send(s)}}),bo&&Ai.push({transport:"fetch",method:function(n){var e,t,i=(e=vo(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body,o=new Headers;Y(o,function(c,p){o.append(p,c)}),r&&o.append("Content-Type",r);var a=n.url,l=null;if(Yl){var u=new Yl;l={signal:u.signal,timeout:setTimeout(function(){return u.abort()},n.timeout)}}bo(a,{method:n?.method||"GET",headers:o,keepalive:n.method==="POST",body:s,signal:(t=l)===null||t===void 0?void 0:t.signal}).then(function(c){return c.text().then(function(p){var f,h={statusCode:c.status,text:p};if(c.status===200)try{h.json=JSON.parse(p)}catch(g){k.error(g)}(f=n.callback)===null||f===void 0||f.call(n,h)})}).catch(function(c){var p;k.error(c),(p=n.callback)===null||p===void 0||p.call(n,{statusCode:0,text:c})}).finally(function(){return l?clearTimeout(l.timeout):null})}}),yt!=null&&yt.sendBeacon&&Ai.push({transport:"sendBeacon",method:function(n){var e=Gr(n.url,{beacon:"1"});try{var t,i=(t=vo(n))!==null&&t!==void 0?t:{},r=i.contentType,s=i.body,o=typeof s=="string"?new Blob([s],{type:r}):s;yt.sendBeacon(e,o)}catch{}}});var sh=["retriesPerformedSoFar"],rn,oh=function(){function n(e){var t=this;W(this,n),y(this,"isPolling",!1),y(this,"pollIntervalMs",3e3),y(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!F(m)&&"onLine"in m.navigator&&(this.areWeOnline=m.navigator.onLine,m.addEventListener("online",function(){t.areWeOnline=!0,t.flush()}),m.addEventListener("offline",function(){t.areWeOnline=!1}))}return V(n,[{key:"retriableRequest",value:function(e){var t=this,i=e.retriesPerformedSoFar,r=Gp(e,sh);lt(i)&&i>0&&(r.url=Gr(r.url,{retry_count:i})),this.instance._send_request(I(I({},r),{},{callback:function(s){var o;s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(i??0)<10?t.enqueue(I({retriesPerformedSoFar:i},r)):(o=r.callback)===null||o===void 0||o.call(r,s)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)}(t),r=Date.now()+i;this.queue.push({retryAt:r,requestOptions:e});var s="Enqueued failed request for retry in ".concat(i);navigator.onLine||(s+=" (Browser is offline)"),k.warn(s),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout(function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()},this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],i=this.queue.filter(function(a){return a.retryAt<e||(t.push(a),!1)});if(this.queue=t,i.length>0){var r,s=rt(i);try{for(s.s();!(r=s.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(a){s.e(a)}finally{s.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,t=rt(this.queue);try{for(t.s();!(e=t.n()).done;){var i=e.value.requestOptions;try{this.instance._send_request(I(I({},i),{},{transport:"sendBeacon"}))}catch(r){k.error(r)}}}catch(r){t.e(r)}finally{t.f()}this.queue=[]}}]),n}(),Pr=1800,ah=function(){function n(e,t,i,r){var s;W(this,n),y(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=i||Nt,this._windowIdGenerator=r||Nt;var o=e.persistence_name||e.token,a=e.session_idle_timeout_seconds||Pr;if(lt(a)?a>Pr?k.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<60&&k.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(k.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=Pr),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,60),Pr),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var l=ke.parse(this._window_id_storage_key),u=ke.parse(this._primary_window_exists_storage_key);l&&!u?this._windowId=l:ke.remove(this._window_id_storage_key),ke.set(this._primary_window_exists_storage_key,!0)}if((s=this.config.bootstrap)!==null&&s!==void 0&&s.sessionID)try{var c=function(p){var f=p.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)}(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),c)}catch(p){k.error("Invalid sessionID in bootstrap",p)}this._listenToReloadWindow()}return V(n,[{key:"onSessionId",value:function(e){var t=this;return F(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter(function(i){return i!==e})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&ke.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&ke.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?ke.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,i){e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(y({},jr,[t,e,i])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[jr];return de(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;m?.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&ke.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),i=Ie(this._getSessionId(),3),r=i[0],s=i[1],o=i[2],a=this._getWindowId(),l=o&&o>0&&Math.abs(t-o)>864e5,u=!1,c=!s,p=!e&&Math.abs(t-r)>this._sessionTimeoutMs;c||p||l?(s=this._sessionIdGenerator(),a=this._windowIdGenerator(),k.info("[SessionId] new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:c,activityTimeout:p,sessionPastMaximumLength:l}}),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var f=r===0||!e||l?t:r,h=o===0?new Date().getTime():o;return this._setWindowId(a),this._setSessionId(s,f,h),u&&this._sessionIdChangedHandlers.forEach(function(g){return g(s,a)}),{sessionId:s,windowId:a,sessionStartTimestamp:h}}}]),n}();(function(n){n.US="us",n.EU="eu",n.CUSTOM="custom"})(rn||(rn={}));var Cu="i.posthog.com",lh=function(){function n(e){W(this,n),y(this,"_regionCache",{}),this.instance=e}return V(n,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e,t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=rn.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=rn.EU:this._regionCache[this.apiHost]=rn.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t&&(t=t[0]==="/"?t:"/".concat(t)),e==="ui")return(this.uiHost||this.apiHost.replace(".".concat(Cu),".posthog.com"))+t;if(this.region===rn.CUSTOM)return this.apiHost+t;var i=Cu+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}}]),n}(),vc="posthog-js";function mc(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.organization,i=e.projectId,r=e.prefix,s=e.severityAllowList,o=s===void 0?["error"]:s;return function(a){var l,u,c,p,f;if(!(o==="*"||o.includes(a.level))||!n.__loaded)return a;a.tags||(a.tags={});var h=n.requestRouter.endpointFor("ui","/project/".concat(n.config.token,"/person/").concat(n.get_distinct_id()));a.tags["PostHog Person URL"]=h,n.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=n.get_session_replay_url({withTimestamp:!0}));var g=((l=a.exception)===null||l===void 0?void 0:l.values)||[],v={$exception_message:((u=g[0])===null||u===void 0?void 0:u.value)||a.message,$exception_type:(c=g[0])===null||c===void 0?void 0:c.type,$exception_personURL:h,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((p=g[0])===null||p===void 0?void 0:p.value)||a.message,$sentry_exception_type:(f=g[0])===null||f===void 0?void 0:f.type,$sentry_tags:a.tags,$level:a.level};return t&&i&&(v.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+a.event_id),n.capture("$exception",v),a}}var uh=V(function n(e,t,i,r,s){W(this,n),this.name=vc,this.setupOnce=function(o){o(mc(e,{organization:t,projectId:i,prefix:r,severityAllowList:s}))}});function ch(n,e){var t=n.config.segment;if(!t)return e();(function(i,r){var s=i.config.segment;if(!s)return r();var o=function(l){var u=function(){return l.anonymousId()||Nt()};i.config.get_device_id=u,l.id()&&(i.register({distinct_id:l.id(),$device_id:u()}),i.persistence.set_property(gt,"identified")),r()},a=s.user();"then"in a&&it(a.then)?a.then(function(l){return o(l)}):o(a)})(n,function(){t.register(function(i){Promise&&Promise.resolve||k.warn("This browser does not have Promise support, and can not use the segment integration");var r=function(s,o){var a;if(!o)return s;s.event.userId||s.event.anonymousId===i.get_distinct_id()||i.reset(),s.event.userId&&s.event.userId!==i.get_distinct_id()&&(i.register({distinct_id:s.event.userId}),i.reloadFeatureFlags());var l=i._calculate_event_properties(o,(a=s.event.properties)!==null&&a!==void 0?a:{});return s.event.properties=Object.assign({},l,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(s){return r(s,s.event.event)},page:function(s){return r(s,"$pageview")},identify:function(s){return r(s,"$identify")},screen:function(s){return r(s,"$screen")}}}(n)).then(function(){e()})})}var Au,Xr,et,ph=function(){function n(e){W(this,n),this._instance=e}return V(n,[{key:"doPageView",value:function(){var e,t=this._previousScrollProperties();return this._currentPath=(e=m?.location.pathname)!==null&&e!==void 0?e:"",this._instance.scrollManager.resetContext(),t}},{key:"doPageLeave",value:function(){return this._previousScrollProperties()}},{key:"_previousScrollProperties",value:function(){var e=this._currentPath,t=this._instance.scrollManager.getContext();if(!e||!t)return{};var i=t.maxScrollHeight,r=t.lastScrollY,s=t.maxScrollY,o=t.maxContentHeight,a=t.lastContentY,l=t.maxContentY;return F(i)||F(r)||F(s)||F(o)||F(a)||F(l)?{}:(i=Math.ceil(i),r=Math.ceil(r),s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),{$prev_pageview_pathname:e,$prev_pageview_last_scroll:r,$prev_pageview_last_scroll_percentage:i<=1?1:Or(r/i,0,1),$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:i<=1?1:Or(s/i,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:o<=1?1:Or(a/o,0,1),$prev_pageview_max_content:l,$prev_pageview_max_content_percentage:o<=1?1:Or(l/o,0,1)})}}]),n}();function Or(n,e,t){return Math.max(e,Math.min(n,t))}(function(n){n.Popover="popover",n.API="api",n.Widget="widget"})(Au||(Au={})),function(n){n.Open="open",n.MultipleChoice="multiple_choice",n.SingleChoice="single_choice",n.Rating="rating",n.Link="link"}(Xr||(Xr={})),function(n){n.NextQuestion="next_question",n.End="end",n.ResponseBased="response_based",n.SpecificQuestion="specific_question"}(et||(et={}));var Iu=function(){function n(e){W(this,n),this.persistence=e,this.eventRegistry=new Map}return V(n,[{key:"register",value:function(e){var t=this;e.forEach(function(i){var r,s,o,a,l;(r=i.conditions)!==null&&r!==void 0&&r.events&&(s=i.conditions)!==null&&s!==void 0&&(o=s.events)!==null&&o!==void 0&&o.values&&((a=i.conditions)===null||a===void 0?void 0:a.events.values.length)>0&&t.eventRegistry.set(i.id,(l=i.conditions)===null||l===void 0?void 0:l.events.values.map(function(u){return u.name}))})}},{key:"on",value:function(e){var t,i=[];this.eventRegistry.forEach(function(o,a){o.includes(e)&&i.push(a)});var r=(t=this.persistence)===null||t===void 0?void 0:t.props[ao],s=(r||[]).concat(i);this._saveSurveysToStorage(s)}},{key:"getSurveys",value:function(){var e,t=(e=this.persistence)===null||e===void 0?void 0:e.props[ao];return t||[]}},{key:"getEventRegistry",value:function(){return this.eventRegistry}},{key:"_saveSurveysToStorage",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.register(y({},ao,on(new Set(e))))}}]),n}(),fh={icontains:function(n){return!!m&&m.location.href.toLowerCase().indexOf(n.toLowerCase())>-1},not_icontains:function(n){return!!m&&m.location.href.toLowerCase().indexOf(n.toLowerCase())===-1},regex:function(n){return!!m&&cu(m.location.href,n)},not_regex:function(n){return!!m&&!cu(m.location.href,n)},exact:function(n){return m?.location.href===n},is_not:function(n){return m?.location.href!==n}},hh=function(){function n(e){W(this,n),this.instance=e,this._surveyEventReceiver=null}return V(n,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,t=he?.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Iu(this.instance.persistence)),jn(this.instance.requestRouter.endpointFor("assets","/static/surveys.js"),function(i){if(i)return k.error("Could not load surveys script",i);he.extendPostHogWithSurveys(e.instance)}))}},{key:"getSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return e([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Iu(this.instance.persistence));var r=this.instance.get_property(Co);if(r&&!i)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(s){var o;if(s.statusCode!==200||!s.json)return e([]);var a=s.json.surveys||[],l=a.filter(function(c){var p,f,h,g,v,w;return((p=c.conditions)===null||p===void 0?void 0:p.events)&&((f=c.conditions)===null||f===void 0||(h=f.events)===null||h===void 0?void 0:h.values)&&((g=c.conditions)===null||g===void 0||(v=g.events)===null||v===void 0||(w=v.values)===null||w===void 0?void 0:w.length)>0});if(l.length>0&&!F(t.instance._addCaptureHook)){var u;(u=t._surveyEventReceiver)===null||u===void 0||u.register(l),t.instance._addCaptureHook(function(c){var p;(p=t._surveyEventReceiver)===null||p===void 0||p.on(c)})}return(o=t.instance.persistence)===null||o===void 0||o.register(y({},Co,a)),e(a)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(r){var s,o=r.filter(function(u){return!(!u.start_date||u.end_date)}).filter(function(u){var c,p,f,h;if(!u.conditions)return!0;var g=(c=u.conditions)===null||c===void 0||!c.url||fh[(p=(f=u.conditions)===null||f===void 0?void 0:f.urlMatchType)!==null&&p!==void 0?p:"icontains"](u.conditions.url),v=(h=u.conditions)===null||h===void 0||!h.selector||T?.querySelector(u.conditions.selector);return g&&v}),a=(s=t._surveyEventReceiver)===null||s===void 0?void 0:s.getSurveys(),l=o.filter(function(u){var c,p,f,h,g;if(!u.linked_flag_key&&!u.targeting_flag_key&&!u.internal_targeting_flag_key)return!0;var v=!u.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(u.linked_flag_key),w=!u.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(u.targeting_flag_key),D=!u.internal_targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(u.internal_targeting_flag_key),$=!(!((c=u.conditions)===null||c===void 0)&&c.events&&(!((p=u.conditions)===null||p===void 0||(f=p.events)===null||f===void 0)&&f.values)&&((h=u.conditions)===null||h===void 0||(g=h.events)===null||g===void 0?void 0:g.values.length)>0)||a?.includes(u.id);return v&&w&&D&&$});return e(l)},i)}},{key:"getNextSurveyStep",value:function(e,t,i){var r,s=e.questions[t],o=t+1;if((r=s.branching)===null||r===void 0||!r.type)return t===e.questions.length-1?et.End:o;if(s.branching.type===et.End)return et.End;if(s.branching.type===et.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===et.ResponseBased){if(s.type===Xr.SingleChoice){var a,l,u=s.choices.indexOf("".concat(i));if((a=s.branching)!==null&&a!==void 0&&(l=a.responseValues)!==null&&l!==void 0&&l.hasOwnProperty(u)){var c=s.branching.responseValues[u];return Number.isInteger(c)?c:c===et.End?et.End:o}}else if(s.type===Xr.Rating){var p,f;if(typeof i!="number"||!Number.isInteger(i))throw new Error("The response type must be an integer");var h=function(v,w){if(w===3){if(v<1||v>3)throw new Error("The response must be in range 1-3");return v===1?"negative":v===2?"neutral":"positive"}if(w===5){if(v<1||v>5)throw new Error("The response must be in range 1-5");return v<=2?"negative":v===3?"neutral":"positive"}if(w===10){if(v<0||v>10)throw new Error("The response must be in range 0-10");return v<=6?"detractors":v<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 10")}(i,s.scale);if((p=s.branching)!==null&&p!==void 0&&(f=p.responseValues)!==null&&f!==void 0&&f.hasOwnProperty(h)){var g=s.branching.responseValues[h];return Number.isInteger(g)?g:g===et.End?et.End:o}}return o}return console.warn("Falling back to next question index due to unexpected branching type"),o}}]),n}(),dh=function(){function n(e){var t,i,r=this;W(this,n),y(this,"serverLimits",{}),y(this,"lastEventRateLimited",!1),y(this,"checkForLimiting",function(s){var o=s.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(function(a){k.info("[RateLimiter] ".concat(a||"events"," is quota limited.")),r.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void k.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(a?.message,'"'),{text:o})}}),this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)===null||i===void 0?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return V(n,[{key:"clientRateLimitContext",value:function(){var e,t,i,r=arguments.length>0&&arguments[0]!==void 0&&arguments[0],s=new Date().getTime(),o=(e=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_property(Io))!==null&&e!==void 0?e:{tokens:this.captureEventsBurstLimit,last:s};o.tokens+=(s-o.last)/1e3*this.captureEventsPerSecond,o.last=s,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var a=o.tokens<1;return a||r||(o.tokens=Math.max(0,o.tokens-1)),!a||this.lastEventRateLimited||r||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,(i=this.instance.persistence)===null||i===void 0||i.set_property(Io,o),{isRateLimited:a,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}]),n}(),gh=function(){return I({initialPathName:De?.pathname||"",referringDomain:be.referringDomain()},be.campaignParams())},vh=function(){function n(e,t,i){var r=this;W(this,n),y(this,"_onSessionIdCallback",function(s){var o=r._getStoredProps();if(!o||o.sessionId!==s){var a={sessionId:s,props:r._sessionSourceParamGenerator()};r._persistence.register(y({},Ao,a))}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||gh,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return V(n,[{key:"_getStoredProps",value:function(){return this._persistence.props[Ao]}},{key:"getSessionProps",value:function(){var e,t=(e=this._getStoredProps())===null||e===void 0?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}]),n}(),mh=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Tu=function(n,e){if(!n)return!1;var t=n.toLowerCase();return mh.concat(e||[]).some(function(i){var r=i.toLowerCase();return t.indexOf(r)!==-1})},yc=function(){function n(){W(this,n),this.clicks=[]}return V(n,[{key:"isRageClick",value:function(e,t,i){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&i-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}]),n}();function Ru(n){var e;return n.id===Po||!((e=n.closest)===null||e===void 0||!e.call(n,"#"+Po))}var yh=function(){function n(e){var t;W(this,n),y(this,"rageclicks",new yc),y(this,"_enabledServerSide",!1),y(this,"_initialized",!1),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[So])}return V(n,[{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(k.info("[heatmaps] Heatmaps enabled, starting..."),this._setupListeners())}},{key:"isEnabled",get:function(){return F(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(y({},So,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_setupListeners",value:function(){var e=this;m&&T&&(mt(T,"click",function(t){return e._onClick(t||m?.event)},!1,!0),mt(T,"mousemove",function(t){return e._onMouseMove(t||m?.event)},!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(a,l,u){for(var c=a;c&&!Ut(c,"body");){if(c===u)return!1;if(U(l,m?.getComputedStyle(c).position))return!0;c=ac(c)}return!1}(e.target,["fixed","sticky"],s);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var t;if(!Ru(e.target)){var i=this._getProperties(e,"click");(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(I(I({},i),{},{type:"rageclick"})),this._capture(i)}}},{key:"_onMouseMove",value:function(e){var t=this;Ru(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))}},{key:"_capture",value:function(e){if(m){var t=m.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}}]),n}(),_h=function(){function n(e){var t=this;W(this,n),y(this,"_updateScrollData",function(){var i,r,s,o;t.context||(t.context={});var a=t.scrollElement(),l=t.scrollY(),u=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=l+(a?.clientHeight||0),p=a?.scrollHeight||0;t.context.lastScrollY=Math.ceil(l),t.context.maxScrollY=Math.max(l,(i=t.context.maxScrollY)!==null&&i!==void 0?i:0),t.context.maxScrollHeight=Math.max(u,(r=t.context.maxScrollHeight)!==null&&r!==void 0?r:0),t.context.lastContentY=c,t.context.maxContentY=Math.max(c,(s=t.context.maxContentY)!==null&&s!==void 0?s:0),t.context.maxContentHeight=Math.max(p,(o=t.context.maxContentHeight)!==null&&o!==void 0?o:0)}),this.instance=e}return V(n,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){m?.addEventListener("scroll",this._updateScrollData,!0),m?.addEventListener("scrollend",this._updateScrollData,!0),m?.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return m?.document.documentElement;var e,t=rt(de(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var i=e.value,r=m?.document.querySelector(i);if(r)return r}}catch(s){t.e(s)}finally{t.f()}}},{key:"scrollY",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return m&&(m.scrollY||m.pageYOffset||m.document.documentElement.scrollTop)||0}},{key:"scrollX",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return m&&(m.scrollX||m.pageXOffset||m.document.documentElement.scrollLeft)||0}}]),n}(),bh=function(){function n(){W(this,n),y(this,"events",{}),this.events={}}return V(n,[{key:"on",value:function(e,t){var i=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){i.events[e]=i.events[e].filter(function(r){return r!==t})}}},{key:"emit",value:function(e,t){var i,r=rt(this.events[e]||[]);try{for(r.s();!(i=r.n()).done;)(0,i.value)(t)}catch(a){r.e(a)}finally{r.f()}var s,o=rt(this.events["*"]||[]);try{for(o.s();!(s=o.n()).done;)(0,s.value)(e,t)}catch(a){o.e(a)}finally{o.f()}}}]),n}(),mo="$copy_autocapture";function yo(n,e){return e.length>n?e.slice(0,n)+"...":e}var Lt,wh=function(){function n(e){W(this,n),y(this,"_initialized",!1),y(this,"_isDisabledServerSide",null),y(this,"rageclicks",new yc),y(this,"_elementsChainAsString",!1),this.instance=e}return V(n,[{key:"config",get:function(){var e,t=nt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=(e=t.url_allowlist)===null||e===void 0?void 0:e.map(function(i){return new RegExp(i)}),t}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(m&&T){var t=function(r){r=r||m?.event;try{e._captureEvent(r)}catch(s){k.error("Failed to capture event",s)}},i=function(r){r=r||m?.event,e._captureEvent(r,mo)};mt(T,"submit",t,!1,!0),mt(T,"change",t,!1,!0),mt(T,"click",t,!1,!0),this.config.capture_copied_text&&(mt(T,"copy",i,!1,!0),mt(T,"cut",i,!1,!0))}}else k.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(y({},Zl,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"isEnabled",get:function(){var e,t,i=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[Zl],r=this._isDisabledServerSide;if(bt(r)&&!Fr(i)&&!this.instance.config.advanced_disable_decide)return!1;var s=(t=this._isDisabledServerSide)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!s}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Xo(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!Lo(e))return{};var t={};return Y(e.attributes,function(i){if(i.name&&i.name.indexOf("data-ph-capture-attribute")===0){var r=i.name.replace("data-ph-capture-attribute-",""),s=i.value;r&&s&&Ln(s)&&(t[r]=s)}}),t}},{key:"_getPropertiesFromElement",value:function(e,t,i){var r,s=e.tagName.toLowerCase(),o={tag_name:s};Do.indexOf(s)>-1&&!i&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?o.$el_text=yo(1024,vu(e)):o.$el_text=yo(1024,Hr(e)));var a=zr(e);a.length>0&&(o.classes=a.filter(function(f){return f!==""}));var l=(r=this.config)===null||r===void 0?void 0:r.element_attribute_ignorelist;Y(e.attributes,function(f){var h;if((!lc(e)||["name","id","class","aria-label"].indexOf(f.name)!==-1)&&(l==null||!l.includes(f.name))&&!t&&Ln(f.value)&&(h=f.name,!Re(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var g=f.value;f.name==="class"&&(g=Go(g).join(" ")),o["attr__"+f.name]=yo(1024,g)}});for(var u=1,c=1,p=e;p=this._previousElementSibling(p);)u++,p.tagName===e.tagName&&c++;return o.nth_child=u,o.nth_of_type=c,o}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){return F(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}},{key:"_captureEvent",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,s=this._getEventTarget(e);sc(s)&&(s=s.parentNode||null),i==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,"$rageclick");var o=i===mo;if(s&&$f(s,e,this.config,o,o?["copy","cut"]:void 0)){for(var a,l,u=[s],c=s;c.parentNode&&!Ut(c,"body");)oc(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var p,f,h=[],g={},v=!1;if(Y(u,function(E){var ie=Lo(E);E.tagName.toLowerCase()==="a"&&(p=E.getAttribute("href"),p=ie&&Ln(p)&&p),U(zr(E),"ph-no-capture")&&(v=!0),h.push(t._getPropertiesFromElement(E,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var Z=t._getAugmentPropertiesFromElement(E);Te(g,Z)}),this.instance.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?h[0].$el_text=vu(s):h[0].$el_text=Hr(s)),p){var w,D;h[0].attr__href=p;var $=(w=$i(p))===null||w===void 0?void 0:w.host,M=m==null||(D=m.location)===null||D===void 0?void 0:D.host;$&&M&&$!==M&&(f=p)}if(v)return!1;var q=Te(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:Rf(h)}:{$elements:h},(a=h[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(l=h[0])===null||l===void 0?void 0:l.$el_text}:{},f&&e.type==="click"?{$external_click_url:f}:{},g);if(i===mo){var H,X=rc(m==null||(H=m.getSelection())===null||H===void 0?void 0:H.toString()),J=e.type||"clipboard";if(!X)return!1;q.$selected_content=X,q.$copy_type=J}return this.instance.capture(i,q),!0}}}},{key:"isBrowserSupported",value:function(){return it(T?.querySelectorAll)}}]),n}(),xh=function(){function n(e){var t=this;W(this,n),y(this,"_restoreXHRPatch",void 0),y(this,"_restoreFetchPatch",void 0),y(this,"_startCapturing",function(){F(t._restoreXHRPatch)&&he.postHogTracingHeadersPatchFns._patchXHR(t.instance.sessionManager),F(t._restoreFetchPatch)&&he.postHogTracingHeadersPatchFns._patchFetch(t.instance.sessionManager)}),this.instance=e}return V(n,[{key:"_loadScript",value:function(e){he.postHogTracingHeadersPatchFns&&e(),jn(this.instance.requestRouter.endpointFor("assets","/static/tracing-headers.js?v=".concat(jt.LIB_VERSION)),function(t){t&&k.error("[TRACING-HEADERS] failed to load script",t),e()})}},{key:"startIfEnabledOrStop",value:function(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((e=this._restoreXHRPatch)===null||e===void 0||e.call(this),(t=this._restoreFetchPatch)===null||t===void 0||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}]),n}();(function(n){n[n.PENDING=-1]="PENDING",n[n.DENIED=0]="DENIED",n[n.GRANTED=1]="GRANTED"})(Lt||(Lt={}));var kh=function(){function n(e){W(this,n),this.instance=e}return V(n,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?Lt.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===Lt.DENIED||this.consent===Lt.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return e==="1"?Lt.GRANTED:e==="0"?Lt.DENIED:Lt.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?fe:_t;var t=e==="localStorage"?_t:fe;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(t.get(this.storageKey)==="1"),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!qu([yt?.doNotTrack,yt?.msDoNotTrack,he.doNotTrack],function(e){return U([!0,1,"1","yes"],e)})}}]),n}(),Ii={},Pu=function(){},Rn="posthog",_c=!ih&&ae?.indexOf("MSIE")===-1&&ae?.indexOf("Mozilla")===-1,Ou=function(){var n,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=T?.location,t=e?.hostname,!!Re(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:Pu,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:De&&Re(De?.search)&&De.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(m==null||(n=m.location)===null||n===void 0?void 0:n.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:function(i){var r="Bad HTTP status: "+i.statusCode+" "+i.text;k.error(r)},get_device_id:function(i){return i},_onCapture:Pu,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},Fu=function(n){var e={};F(n.process_person)||(e.person_profiles=n.process_person),F(n.xhr_headers)||(e.request_headers=n.xhr_headers),F(n.cookie_name)||(e.persistence_name=n.cookie_name),F(n.disable_cookie)||(e.disable_persistence=n.disable_cookie);var t=Te({},e,n);return de(n.property_blacklist)&&(F(n.property_denylist)?t.property_denylist=n.property_blacklist:de(n.property_denylist)?t.property_denylist=[].concat(on(n.property_blacklist),on(n.property_denylist)):k.error("Invalid value for property_denylist config: "+n.property_denylist)),t},Sh=function(){function n(){W(this,n),y(this,"__forceAllowLocalhost",!1)}return V(n,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){k.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),n}(),bc=function(){function n(){var e=this;W(this,n),y(this,"webPerformance",new Sh),y(this,"_debugEventEmitter",new bh),this.config=Ou(),this.decideEndpointWasHit=!1,this.SentryIntegration=uh,this.sentryIntegration=function(t){return function(i,r){var s=mc(i,r);return{name:vc,processEvent:function(o){return s(o)}}}(e,t)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new ef(this),this.toolbar=new Vf(this),this.scrollManager=new _h(this),this.pageViewManager=new ph(this),this.surveys=new hh(this),this.rateLimiter=new dh(this),this.requestRouter=new lh(this),this.consent=new kh(this),this.people={set:function(t,i,r){var s=Re(t)?y({},t,i):t;e.setPersonProperties(s),r?.({})},set_once:function(t,i,r){var s=Re(t)?y({},t,i):t;e.setPersonProperties(void 0,s),r?.({})}},this.on("eventCaptured",function(t){return k.info("send",t)})}return V(n,[{key:"init",value:function(e,t,i){if(i&&i!==Rn){var r,s=(r=Ii[i])!==null&&r!==void 0?r:new n;return s._init(e,t,i),Ii[i]=s,Ii[Rn][i]=s,s}return this._init(e,t,i)}},{key:"_init",value:function(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(F(e)||function(w){return Re(w)&&w.trim().length===0}(e))return k.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return k.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(Te({},Ou(),Fu(s),{name:o,token:e})),this.compression=s.disable_compression?void 0:tt.Base64,this.persistence=new po(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new po(I(I({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new Gf(function(w){return r._send_retriable_request(w)}),this._retryQueue=new oh(this),this.__request_queue=[],this.sessionManager=new ah(this.config,this.persistence),this.sessionPropsManager=new vh(this.sessionManager,this.persistence),new xh(this).startIfEnabledOrStop(),this.sessionRecording=new zf(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new wh(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new yh(this),this.heatmaps.startIfEnabled(),jt.DEBUG=jt.DEBUG||this.config.debug,this._sync_opt_out_with_persistence(),((t=s.bootstrap)===null||t===void 0?void 0:t.distinctID)!==void 0){var a,l,u=this.config.get_device_id(Nt()),c=(a=s.bootstrap)!==null&&a!==void 0&&a.isIdentifiedID?u:s.bootstrap.distinctID;this.persistence.set_property(gt,(l=s.bootstrap)!==null&&l!==void 0&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:c})}if(this._hasBootstrappedFeatureFlags()){var p,f,h=Object.keys(((p=s.bootstrap)===null||p===void 0?void 0:p.featureFlags)||{}).filter(function(w){var D,$;return!((D=s.bootstrap)===null||D===void 0||($=D.featureFlags)===null||$===void 0||!$[w])}).reduce(function(w,D){var $,M;return w[D]=(($=s.bootstrap)===null||$===void 0||(M=$.featureFlags)===null||M===void 0?void 0:M[D])||!1,w},{}),g=Object.keys(((f=s.bootstrap)===null||f===void 0?void 0:f.featureFlagPayloads)||{}).filter(function(w){return h[w]}).reduce(function(w,D){var $,M,q,H;return($=s.bootstrap)!==null&&$!==void 0&&(M=$.featureFlagPayloads)!==null&&M!==void 0&&M[D]&&(w[D]=(q=s.bootstrap)===null||q===void 0||(H=q.featureFlagPayloads)===null||H===void 0?void 0:H[D]),w},{});this.featureFlags.receivedFeatureFlags({featureFlags:h,featureFlagPayloads:g})}if(!this.get_distinct_id()){var v=this.config.get_device_id(Nt());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(gt,"anonymous")}return m==null||(i=m.addEventListener)===null||i===void 0||i.call(m,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?ch(this,function(){return r._loaded()}):this._loaded(),it(this.config._onCapture)&&this.on("eventCaptured",function(w){return r.config._onCapture(w.event,w)}),this}},{key:"_afterDecideResponse",value:function(e){var t,i,r,s,o;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=U(e.supportedCompression,tt.GZipJS)?tt.GZipJS:U(e.supportedCompression,tt.Base64)?tt.Base64:void 0),(t=e.analytics)!==null&&t!==void 0&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),(i=this.sessionRecording)===null||i===void 0||i.afterDecideResponse(e),(r=this.autocapture)===null||r===void 0||r.afterDecideResponse(e),(s=this.heatmaps)===null||s===void 0||s.afterDecideResponse(e),(o=this.surveys)===null||o===void 0||o.afterDecideResponse(e)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(i){k.critical("`loaded` function failed",i)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(function(){T&&e.capture("$pageview",{title:T.title},{send_instantly:!0})},1),t||(new Hf(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Fn(this.__request_queue,function(t){return e._send_retriable_request(t)}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(e=this._requestQueue)===null||e===void 0||e.unload(),(t=this._retryQueue)===null||t===void 0||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var t=this;this.__loaded&&(_c?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Gr(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression=e.compression==="best-available"?this.compression:e.compression,function(i){var r,s,o,a=I({},i);a.timeout=a.timeout||6e4,a.url=Gr(a.url,{_:new Date().getTime().toString(),ver:jt.LIB_VERSION,compression:a.compression});var l=(r=a.transport)!==null&&r!==void 0?r:"XHR",u=(s=(o=qu(Ai,function(c){return c.transport===l}))===null||o===void 0?void 0:o.method)!==null&&s!==void 0?s:Ai[0].method;if(!u)throw new Error("No available transport method");u(a)}(I(I({},e),{},{callback:function(i){var r,s,o;t.rateLimiter.checkForLimiting(i),i.statusCode>=400&&((s=(o=t.config).on_request_error)===null||s===void 0||s.call(o,i)),(r=e.callback)===null||r===void 0||r.call(e,i)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,i=this,r=[],s=[],o=[];Fn(e,function(l){l&&(t=l[0],de(t)?o.push(l):it(l)?l.call(i):de(l)&&t==="alias"?r.push(l):de(l)&&t.indexOf("capture")!==-1&&it(i[t])?o.push(l):s.push(l))});var a=function(l,u){Fn(l,function(c){if(de(c[0])){var p=u;Y(c,function(f){p=p[f[0]].apply(p,f.slice(1))})}else this[c[0]].apply(this,c.slice(1))},u)};a(r,this),a(s,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return((e=this.config.bootstrap)===null||e===void 0?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t,i){var r;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return k.uninitializedWarning("posthog.capture");if(!this.consent.isOptedOut())if(!F(e)&&Re(e)){if(!ae||this.config.opt_out_useragent_filter||!Tu(ae,this.config.custom_blocked_useragents)){var s=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o={uuid:Nt(),event:e,properties:this._calculate_event_properties(e,t||{},i)};s&&(o.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),i?.$set&&(o.$set=i?.$set);var a=this._calculate_set_once_properties(i?.$set_once);a&&(o.$set_once=a),(o=Kp(o,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=i?.timestamp||new Date,F(i?.timestamp)||(o.properties.$event_time_override_provided=!0,o.properties.$event_time_override_system_time=new Date);var l=I(I({},o.properties.$set),o.$set);oo(l)||this.setPersonPropertiesForFlags(l),this._debugEventEmitter.emit("eventCaptured",o);var u={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:o,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this._send_retriable_request(u):this._requestQueue.enqueue(u),o}k.critical("This capture call is ignored due to client rate limiting.")}}else k.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.on("eventCaptured",function(t){return e(t.event)})}},{key:"_calculate_event_properties",value:function(e,t,i){if(!this.persistence||!this.sessionPersistence)return t;var r=this.persistence.remove_event_timer(e),s=I({},t);if(s.token=this.config.token,e==="$snapshot"){var o=I(I({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,s}var a=be.properties();if(this.sessionManager){var l=this.sessionManager.checkAndGetSessionAndWindowId(),u=l.sessionId,c=l.windowId;s.$session_id=u,s.$window_id=c}if(this.requestRouter.region===rn.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(e==="$pageview"||e==="$pageleave"||e==="$autocapture")){var p=this.sessionPropsManager.getSessionProps();s=Te(s,p)}if(!this.config.disable_scroll_properties){var f={};e==="$pageview"?f=this.pageViewManager.doPageView():e==="$pageleave"&&(f=this.pageViewManager.doPageLeave()),s=Te(s,f)}if(e==="$pageview"&&T&&(s.title=T.title),!F(r)){var h=new Date().getTime()-r;s.$duration=parseFloat((h/1e3).toFixed(3))}if(ae&&this.config.opt_out_useragent_filter&&(s.$browser_type=Tu(ae,this.config.custom_blocked_useragents)?"bot":"browser"),(s=Te({},a,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),i==null||!i._noHeatmaps){var g,v=(g=this.heatmaps)===null||g===void 0?void 0:g.getAndClearBuffer();v&&(s.$heatmap_data=v)}de(this.config.property_denylist)?Y(this.config.property_denylist,function(D){delete s[D]}):k.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var w=this.config.sanitize_properties;return w&&(s=w(s,e)),s.$process_person_profile=this._hasPersonProcessing(),s}},{key:"_calculate_set_once_properties",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=Te({},this.persistence.get_initial_props(),e||{});return oo(t)?void 0:t}},{key:"register",value:function(e,t){var i;(i=this.persistence)===null||i===void 0||i.register(e,t)}},{key:"register_once",value:function(e,t,i){var r;(r=this.persistence)===null||r===void 0||r.register_once(e,t,i)}},{key:"register_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.register(e)}},{key:"unregister",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(y({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"on",value:function(e,t){return this._debugEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,i;return(t=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&t!==void 0?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"getNextSurveyStep",value:function(e,t,i){return this.surveys.getNextSurveyStep(e,t,i)}},{key:"identify",value:function(e,t,i){if(!this.__loaded||!this.persistence)return k.uninitializedWarning("posthog.identify");if(lt(e)&&(e=e.toString(),k.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))k.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==r&&e!==this.get_property(xi)&&(this.unregister(xi),this.register({distinct_id:e}));var o=(this.persistence.get_property(gt)||"anonymous")==="anonymous";e!==r&&o?(this.persistence.set_property(gt,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(Nr))}}else k.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,t,i){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:I(I({},r),{},y({},e,t))}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags(y({},e,i))),r[e]===t||i||this.reloadFeatureFlags()}}else k.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,i,r,s;if(!this.__loaded)return k.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");this.consent.reset(),(t=this.persistence)===null||t===void 0||t.clear(),(i=this.sessionPersistence)===null||i===void 0||i.clear(),(r=this.persistence)===null||r===void 0||r.set_property(gt,"anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var a=this.config.get_device_id(Nt());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return(e=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionId,r=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(i));if(e!=null&&e.withTimestamp&&r){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return s;var l=Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0);s+="?t=".concat(l)}return s}},{key:"alias",value:function(e,t){return e===this.get_property(Uu)?(k.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(F(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(xi,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(k.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var t,i,r,s,o=I({},this.config);nt(e)&&(Te(this.config,Fu(e)),(t=this.persistence)===null||t===void 0||t.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new po(I(I({},this.config),{},{persistence:"sessionStorage"})),fe.is_supported()&&fe.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(jt.DEBUG=!0),(i=this.sessionRecording)===null||i===void 0||i.startIfEnabledOrStop(),(r=this.autocapture)===null||r===void 0||r.startIfEnabled(),(s=this.heatmaps)===null||s===void 0||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){if(e!=null&&e.sampling){var t,i,r=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId();(i=this.persistence)===null||i===void 0||i.register(y({},Ei,!0)),k.info("Session recording started with sampling override for session: ",r?.sessionId)}this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return(t=this.persistence)===null||t===void 0?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return(t=this.sessionPersistence)===null||t===void 0?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:Rn;return t!==Rn&&(t=Rn+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(gt))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(gt))==="identified"}},{key:"_hasPersonProcessing",value:function(){var e,t,i,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&oo(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[xi])&&((i=this.persistence)===null||i===void 0||(r=i.props)===null||r===void 0||!r[qr]))}},{key:"_shouldCapturePageleave",value:function(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return this.config.person_profiles==="never"?(k.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(qr,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,i,r,s=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,a=this.config.disable_persistence||s&&!!o;((e=this.persistence)===null||e===void 0?void 0:e.disabled)!==a&&((i=this.persistence)===null||i===void 0||i.set_disabled(a)),((t=this.sessionPersistence)===null||t===void 0?void 0:t.disabled)!==a&&((r=this.sessionPersistence)===null||r===void 0||r.set_disabled(a))}},{key:"opt_in_capturing",value:function(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(F(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e?.captureEventName)!==null&&t!==void 0?t:"$opt_in",e?.captureProperties,{send_instantly:!0})}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"debug",value:function(e){e===!1?(m?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(m?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),n}();(function(n,e){for(var t=0;t<e.length;t++)n.prototype[e[t]]=Yp(n.prototype[e[t]])})(bc,["identify"]);var Mu,wc=(Mu=Ii[Rn]=new bc,function(){function n(){n.done||(n.done=!0,_c=!1,Y(Ii,function(e){e._dom_loaded()}))}T!=null&&T.addEventListener&&(T.readyState==="complete"?n():T.addEventListener("DOMContentLoaded",n,!1)),m&&mt(m,"load",n,!0)}(),Mu);var xc=wc.init("phc_OTZ3wJ6VemgVupCRKS5Sbqb9Ks0JYe0hMYZPtLwl0nu",{api_host:"https://pheu.molin.ai",ui_host:"https://eu.posthog.com",secure_cookie:document.location.protocol==="https:",persistence:"cookie",autocapture:!1,rageclick:!1,capture_pageview:!1,capture_pageleave:!1,disable_session_recording:!0,advanced_disable_decide:!0},"MolinShopAI");function ue(n,e){if(!xc)throw new Error("Failed to initialize PostHog");xc.capture(n,e)}var Qr,Di,Zr,Bt,Sc,Kr,es=class es extends z(N){constructor(){super();b(this,Bt);b(this,Qr,new Ft(this,{onError:console.error}));b(this,Di);b(this,Zr,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),ue("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>ue("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>ue("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>ue("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>ue("ShopAssistant: user clicked link",t),onUserSentInput:t=>ue("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1}get config(){return d(this,Di)||d(this,Qr).data}render(){return this.config?O`
320
+ `)).length,r=0;r<i;r++){var o=n.charCodeAt(r),a=null;o<128?t++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),wt(a)||(t>e&&(s+=n.substring(e,t)),s+=a,e=t=r+1)}return t>e&&(s+=n.substring(e,n.length)),s},yt=function(){function n(e){return e&&(e.preventDefault=n.preventDefault,e.stopPropagation=n.stopPropagation),e}return n.preventDefault=function(){this.returnValue=!1},n.stopPropagation=function(){this.cancelBubble=!0},function(e,t,i,r,s){if(e)if(e.addEventListener&&!r)e.addEventListener(t,i,!!s);else{var o="on"+t,a=e[o];e[o]=function(l,u,c){return function(p){if(p=p||n(m?.event)){var f,d=!0;it(c)&&(f=c(p));var g=u.call(l,p);return f!==!1&&g!==!1||(d=!1),d}}}(e,i,a)}else k.error("No valid element provided to register_event")}}();function qn(n,e){var t=function(){if(!R)return e("document not found");var i=R.createElement("script");i.type="text/javascript",i.src=n,i.onload=function(o){return e(void 0,o)},i.onerror=function(o){return e(o)};var r,s=R.querySelectorAll("body > script");s.length>0?(r=s[0].parentNode)===null||r===void 0||r.insertBefore(i,s[0]):R.body.appendChild(i)};R!=null&&R.body?t():R?.addEventListener("DOMContentLoaded",t)}function Vu(n,e){for(var t=0;t<n.length;t++)if(e(n[t]))return n[t]}(function(n){n.GZipJS="gzip-js",n.Base64="base64"})(tt||(tt={}));var Gu="$people_distinct_id",Si="__alias",Ei="__timers",su="$autocapture_disabled_server_side",Co="$heatmaps_enabled_server_side",Ao="$session_recording_enabled_server_side",ou="$console_log_recording_enabled_server_side",au="$session_recording_network_payload_capture",lu="$session_recording_canvas_recording",uu="$replay_sample_rate",cu="$replay_minimum_duration",Ur="$sesid",Ci="$session_is_sampled",Fn="$enabled_feature_flags",Io="$early_access_features",Mn="$stored_person_properties",Lt="$stored_group_properties",To="$surveys",co="$surveys_activated",Br="$flag_call_reported",vt="$user_state",Ro="$client_session_props",Po="$capture_rate_limit",Oo="$initial_campaign_params",Fo="$initial_referrer_info",pu="$initial_person_info",zr="$epp",Mo="__POSTHOG_TOOLBAR__",lf=[Gu,Si,"__cmpns",Ei,Ao,Co,Ur,Fn,vt,Io,Lt,Mn,To,Br,Ro,Po,Oo,Fo,zr],po="$active_feature_flags",Rr="$override_feature_flags",fu="$feature_flag_payloads",hu=function(n){var e,t={},i=rt(Nr(n||{}));try{for(i.s();!(e=i.n()).done;){var r=Te(e.value,2),s=r[0],o=r[1];o&&(t[s]=o)}}catch(a){i.e(a)}finally{i.f()}return t},uf=function(){function n(e){W(this,n),this.instance=e,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return V(n,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Fn),t=this.instance.get_property(Rr);if(!t)return e||{};for(var i=Re({},e),r=Object.keys(t),s=0;s<r.length;s++)i[r[s]]=t[r[s]];return this._override_warning||(k.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(fu)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,i=this.instance.get_property(Mn),r=this.instance.get_property(Lt),s={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:s,compression:this.instance.config.disable_compression?void 0:tt.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(o){var a;e.setReloadingPaused(!1);var l=!0;o.statusCode===200&&(e.$anon_distinct_id=void 0,l=!1),e.receivedFeatureFlags((a=o.json)!==null&&a!==void 0?a:{},l),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var i,r=this.getFlagVariants()[e],s="".concat(r),o=this.instance.get_property(Br)||{};return(t.send_event||!("send_event"in t))&&(!(e in o)||!o[e].includes(s))&&(de(o[e])?o[e].push(s):o[e]=[s],(i=this.instance.persistence)===null||i===void 0||i.register(y({},Br,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r})),r}k.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);k.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})}},{key:"receivedFeatureFlags",value:function(e,t){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads();(function(s,o){var a,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},c=s.featureFlags,p=s.featureFlagPayloads;if(c)if(de(c)){var f,d={};if(c)for(var g=0;g<c.length;g++)d[c[g]]=!0;o&&o.register((y(f={},po,c),y(f,Fn,d),f))}else{var v=c,w=p;s.errorsWhileComputingFlags&&(v=T(T({},l),v),w=T(T({},u),w)),o&&o.register((y(a={},po,Object.keys(hu(v))),y(a,Fn,v||{}),y(a,fu,w||{}),a))}})(e,this.instance.persistence,i,r),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return k.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,e===!1)this.instance.persistence.unregister(Rr);else if(de(e)){for(var t={},i=0;i<e.length;i++)t[e[i]]=!0;this.instance.persistence.register(y({},Rr,t))}else this.instance.persistence.register(y({},Rr,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var i=this._prepareFeatureFlagsForCallbacks(),r=i.flags,s=i.flagVariants;e(r,s)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var i,r,s=y({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:s}),this.setPersonPropertiesForFlags(s,!1);var o=T(T({},this.getFlagVariants()),{},y({},e,t));(i=this.instance.persistence)===null||i===void 0||i.register((y(r={},po,Object.keys(hu(o))),y(r,Fn,o),r)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=this.instance.get_property(Io);if(r&&!i)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(s){var o;if(s.json){var a=s.json.earlyAccessFeatures;return(o=t.instance.persistence)===null||o===void 0||o.register(y({},Io,a)),e(a)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(i){return t[i]}),flagVariants:Object.keys(t).filter(function(i){return t[i]}).reduce(function(i,r){return i[r]=t[r],i},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),i=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(function(s){return s(i,r,{errorsLoading:e})})}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Mn)||{};this.instance.register(y({},Mn,T(T({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Mn)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],i=this.instance.get_property(Lt)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(function(r){i[r]=T(T({},i[r]),e[r]),delete e[r]}),this.instance.register(y({},Lt,T(T({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(Lt)||{};this.instance.register(y({},Lt,T(T({},t),{},y({},e,{}))))}else this.instance.unregister(Lt)}}]),n}();Math.trunc||(Math.trunc=function(n){return n<0?Math.ceil(n):Math.floor(n)}),Number.isInteger||(Number.isInteger=function(n){return lt(n)&&isFinite(n)&&Math.floor(n)===n});var du="0123456789abcdef",cf=function(){function n(e){if(W(this,n),this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}return V(n,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+du.charAt(this.bytes[t]>>>4)+du.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new n(this.bytes.slice(0))}},{key:"equals",value:function(e){return this.compareTo(e)===0}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}}],[{key:"fromFieldsV7",value:function(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),s[4]=e/Math.pow(2,8),s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new n(s)}}]),n}(),pf=function(){function n(){W(this,n),y(this,"timestamp",0),y(this,"counter",0),y(this,"random",new ff)}return V(n,[{key:"generate",value:function(){var e=this.generateOrAbort();if(F(e)){this.timestamp=0;var t=this.generateOrAbort();if(F(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return cf.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),n}(),Xu=function(n){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<n.length;e++)n[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return n};m&&!F(m.crypto)&&crypto.getRandomValues&&(Xu=function(n){return crypto.getRandomValues(n)});var gu,ff=function(){function n(){W(this,n),y(this,"buffer",new Uint32Array(8)),y(this,"cursor",1/0)}return V(n,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(Xu(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),n}(),qt=function(){return hf().toString()},hf=function(){return(gu||(gu=new pf)).generate()},df="Thu, 01 Jan 1970 00:00:00 GMT",wi="",gf=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function vf(n,e){if(e){var t=function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R;if(wi)return wi;if(!s||["localhost","127.0.0.1"].includes(r))return"";for(var o=r.split("."),a=Math.min(o.length,8),l="dmn_chk_"+qt(),u=new RegExp("(^|;)\\s*"+l+"=1");!wi&&a--;){var c=o.slice(a).join("."),p=l+"=1;domain=."+c;s.cookie=p,u.test(s.cookie)&&(s.cookie=p+";expires="+df,wi=c)}return wi}(n);if(!t){var i=function(r){var s=r.match(gf);return s?s[0]:""}(n);i!==t&&k.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var xe,bt={is_supported:function(){return!!R},error:function(n){k.error("cookieStore error: "+n)},get:function(n){if(R){try{for(var e=n+"=",t=R.cookie.split(";").filter(function(s){return s.length}),i=0;i<t.length;i++){for(var r=t[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},parse:function(n){var e;try{e=JSON.parse(bt.get(n))||{}}catch{}return e},set:function(n,e,t,i,r){if(R)try{var s="",o="",a=vf(R.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),s="; expires="+l.toUTCString()}r&&(o="; secure");var u=n+"="+encodeURIComponent(JSON.stringify(e))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&k.warn("cookieStore warning: large cookie, len="+u.length),R.cookie=u,u}catch{return}},remove:function(n,e){try{bt.set(n,"",-1,e)}catch{return}}},fo=null,fe={is_supported:function(){if(!wt(fo))return fo;var n=!0;if(F(m))n=!1;else try{var e="__mplssupport__";fe.set(e,"xyz"),fe.get(e)!=='"xyz"'&&(n=!1),fe.remove(e)}catch{n=!1}return n||k.error("localStorage unsupported; falling back to cookie store"),fo=n,n},error:function(n){k.error("localStorage error: "+n)},get:function(n){try{return m?.localStorage.getItem(n)}catch(e){fe.error(e)}return null},parse:function(n){try{return JSON.parse(fe.get(n))||{}}catch{}return null},set:function(n,e){try{m?.localStorage.setItem(n,JSON.stringify(e))}catch(t){fe.error(t)}},remove:function(n){try{m?.localStorage.removeItem(n)}catch(e){fe.error(e)}}},mf=["distinct_id",Ur,Ci,zr],Pr=T(T({},fe),{},{parse:function(n){try{var e={};try{e=bt.parse(n)||{}}catch{}var t=Re(e,JSON.parse(fe.get(n)||"{}"));return fe.set(n,t),t}catch{}return null},set:function(n,e,t,i,r){try{fe.set(n,e);var s={};mf.forEach(function(o){e[o]&&(s[o]=e[o])}),Object.keys(s).length&&bt.set(n,s,t,i,r)}catch(o){fe.error(o)}},remove:function(n,e){try{m?.localStorage.removeItem(n),bt.remove(n,e)}catch(t){fe.error(t)}}}),Or={},yf={is_supported:function(){return!0},error:function(n){k.error("memoryStorage error: "+n)},get:function(n){return Or[n]||null},parse:function(n){return Or[n]||null},set:function(n,e){Or[n]=e},remove:function(n){delete Or[n]}},sn=null,ke={is_supported:function(){if(!wt(sn))return sn;if(sn=!0,F(m))sn=!1;else try{var n="__support__";ke.set(n,"xyz"),ke.get(n)!=='"xyz"'&&(sn=!1),ke.remove(n)}catch{sn=!1}return sn},error:function(n){k.error("sessionStorage error: ",n)},get:function(n){try{return m?.sessionStorage.getItem(n)}catch(e){ke.error(e)}return null},parse:function(n){try{return JSON.parse(ke.get(n))||null}catch{}return null},set:function(n,e){try{m?.sessionStorage.setItem(n,JSON.stringify(e))}catch(t){ke.error(t)}},remove:function(n){try{m?.sessionStorage.removeItem(n)}catch(e){ke.error(e)}}},_f=["localhost","127.0.0.1"],Ai=function(n){var e=R?.createElement("a");return F(e)?null:(e.href=n,e)},vu=function(n,e){return!!function(t){try{new RegExp(t)}catch{return!1}return!0}(e)&&new RegExp(e).test(n)},bf=function(n){var e,t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",r=[];return Y(n,function(s,o){F(s)||F(o)||o==="undefined"||(e=encodeURIComponent(function(a){return a instanceof File}(s)?s.name:s.toString()),t=encodeURIComponent(o),r[r.length]=t+"="+e)}),r.join(i)},mu=function(n,e){for(var t,i=((n.split("#")[0]||"").split("?")[1]||"").split("&"),r=0;r<i.length;r++){var s=i[r].split("=");if(s[0]===e){t=s;break}}if(!de(t)||t.length<2)return"";var o=t[1];try{o=decodeURIComponent(o)}catch{k.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Hr=function(n,e){var t=n.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Je="Mobile",Wr="iOS",ct="Android",Oi="Tablet",Ju=ct+" "+Oi,Yu="iPad",Ku="Apple",Qu=Ku+" Watch",Fi="Safari",Un="BlackBerry",Zu="Samsung",ec=Zu+"Browser",tc=Zu+" Internet",Ut="Chrome",wf=Ut+" OS",nc=Ut+" "+Wr,Vo="Internet Explorer",ic=Vo+" "+Je,Go="Opera",xf=Go+" Mini",Xo="Edge",rc="Microsoft "+Xo,Ln="Firefox",sc=Ln+" "+Wr,Mi="Nintendo",Di="PlayStation",Nn="Xbox",oc=ct+" "+Je,ac=Je+" "+Fi,$i="Windows",Do=$i+" Phone",yu="Nokia",Lo="Ouya",lc="Generic",kf=lc+" "+Je.toLowerCase(),uc=lc+" "+Oi.toLowerCase(),No="Konqueror",Ie="(\\d+(\\.\\d+)?)",ho=new RegExp("Version/"+Ie),Sf=new RegExp(Nn,"i"),Ef=new RegExp(Di+" \\w+","i"),$f=new RegExp(Mi+" \\w+","i"),Jo=new RegExp(Un+"|PlayBook|BB10","i"),Cf={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Af=function(n,e){return e&&U(e,Ku)||function(t){return U(t,Fi)&&!U(t,Ut)&&!U(t,ct)}(n)},_u=function(n,e){return e=e||"",U(n," OPR/")&&U(n,"Mini")?xf:U(n," OPR/")?Go:Jo.test(n)?Un:U(n,"IE"+Je)||U(n,"WPDesktop")?ic:U(n,ec)?tc:U(n,Xo)||U(n,"Edg/")?rc:U(n,"FBIOS")?"Facebook "+Je:U(n,"UCWEB")||U(n,"UCBrowser")?"UC Browser":U(n,"CriOS")?nc:U(n,"CrMo")?Ut:U(n,ct)&&U(n,Fi)?oc:U(n,Ut)?Ut:U(n,"FxiOS")?sc:U(n.toLowerCase(),No.toLowerCase())?No:Af(n,e)?U(n,Je)?ac:Fi:U(n,Ln)?Ln:U(n,"MSIE")||U(n,"Trident/")?Vo:U(n,"Gecko")?Ln:""},If=(y(xe={},ic,[new RegExp("rv:"+Ie)]),y(xe,rc,[new RegExp(Xo+"?\\/"+Ie)]),y(xe,Ut,[new RegExp("("+Ut+"|CrMo)\\/"+Ie)]),y(xe,nc,[new RegExp("CriOS\\/"+Ie)]),y(xe,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+Ie)]),y(xe,Fi,[ho]),y(xe,ac,[ho]),y(xe,Go,[new RegExp("(Opera|OPR)\\/"+Ie)]),y(xe,Ln,[new RegExp(Ln+"\\/"+Ie)]),y(xe,sc,[new RegExp("FxiOS\\/"+Ie)]),y(xe,No,[new RegExp("Konqueror[:/]?"+Ie,"i")]),y(xe,Un,[new RegExp(Un+" "+Ie),ho]),y(xe,oc,[new RegExp("android\\s"+Ie,"i")]),y(xe,tc,[new RegExp(ec+"\\/"+Ie)]),y(xe,Vo,[new RegExp("(rv:|MSIE )"+Ie)]),y(xe,"Mozilla",[new RegExp("rv:"+Ie)]),xe),bu=[[new RegExp(Nn+"; "+Nn+" (.*?)[);]","i"),function(n){return[Nn,n&&n[1]||""]}],[new RegExp(Mi,"i"),[Mi,""]],[new RegExp(Di,"i"),[Di,""]],[Jo,[Un,""]],[new RegExp($i,"i"),function(n,e){if(/Phone/.test(e)||/WPDesktop/.test(e))return[Do,""];if(new RegExp(Je).test(e)&&!/IEMobile\b/.test(e))return[$i+" "+Je,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],r=Cf[i]||"";return/arm/i.test(e)&&(r="RT"),[$i,r]}return[$i,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(n){if(n&&n[3]){var e=[n[3],n[4],n[5]||"0"];return[Wr,e.join(".")]}return[Wr,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(n){var e="";return n&&n.length>=3&&(e=F(n[2])?n[3]:n[2]),["watchOS",e]}],[new RegExp("("+ct+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ct+")","i"),function(n){if(n&&n[2]){var e=[n[2],n[3],n[4]||"0"];return[ct,e.join(".")]}return[ct,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(n){var e=["Mac OS X",""];if(n&&n[1]){var t=[n[1],n[2],n[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[wf,""]],[/Linux|debian/i,["Linux",""]]],wu=function(n){return $f.test(n)?Mi:Ef.test(n)?Di:Sf.test(n)?Nn:new RegExp(Lo,"i").test(n)?Lo:new RegExp("("+Do+"|WPDesktop)","i").test(n)?Do:/iPad/.test(n)?Yu:/iPod/.test(n)?"iPod Touch":/iPhone/.test(n)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(n)?Qu:Jo.test(n)?Un:/(kobo)\s(ereader|touch)/i.test(n)?"Kobo":new RegExp(yu,"i").test(n)?yu:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(n)||/(kf[a-z]+)( bui|\)).+silk\//i.test(n)?"Kindle Fire":/(Android|ZTE)/i.test(n)?!new RegExp(Je).test(n)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(n)?/pixel[\daxl ]{1,6}/i.test(n)&&!/pixel c/i.test(n)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(n)||/lmy47v/i.test(n)&&!/QTAQZ3/i.test(n)?ct:Ju:ct:new RegExp("(pda|"+Je+")","i").test(n)?kf:new RegExp(Oi,"i").test(n)&&!new RegExp(Oi+" pc","i").test(n)?uc:""},Fr="https?://(.*)",Tf=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid"],be={campaignParams:function(n){return R?this._campaignParamsFromUrl(R.URL,n):{}},_campaignParamsFromUrl:function(n,e){var t=Tf.concat(e||[]),i={};return Y(t,function(r){var s=mu(n,r);s&&(i[r]=s)}),i},_searchEngine:function(n){return n?n.search(Fr+"google.([^/?]*)")===0?"google":n.search(Fr+"bing.com")===0?"bing":n.search(Fr+"yahoo.com")===0?"yahoo":n.search(Fr+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(n){var e=be._searchEngine(n),t=e!="yahoo"?"q":"p",i={};if(!wt(e)){i.$search_engine=e;var r=R?mu(R.referrer,t):"";r.length&&(i.ph_keyword=r)}return i},searchInfo:function(){var n=R?.referrer;return n?this._searchInfoFromReferrer(n):{}},browser:_u,browserVersion:function(n,e){var t=_u(n,e),i=If[t];if(F(i))return null;for(var r=0;r<i.length;r++){var s=i[r],o=n.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(n){for(var e=0;e<bu.length;e++){var t=Te(bu[e],2),i=t[0],r=t[1],s=i.exec(n),o=s&&(it(r)?r(s,n):r);if(o)return o}return["",""]},device:wu,deviceType:function(n){var e=wu(n);return e===Yu||e===Ju||e==="Kobo"||e==="Kindle Fire"||e===uc?Oi:e===Mi||e===Nn||e===Di||e===Lo?"Console":e===Qu?"Wearable":e?Je:"Desktop"},referrer:function(){return R?.referrer||"$direct"},referringDomain:function(){var n;return R!=null&&R.referrer&&((n=Ai(R.referrer))===null||n===void 0?void 0:n.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:De?.href}},initialPersonPropsFromInfo:function(n){var e,t=n.r,i=n.u,r={$initial_referrer:t,$initial_referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Ai(t))===null||e===void 0?void 0:e.host};if(i){r.$initial_current_url=i;var s=Ai(i);r.$initial_host=s?.host,r.$initial_pathname=s?.pathname,Y(this._campaignParamsFromUrl(i),function(o,a){r["$initial_"+$o(a)]=o})}return t&&Y(this._searchInfoFromReferrer(t),function(o,a){r["$initial_"+$o(a)]=o}),r},properties:function(){if(!ae)return{};var n=Te(be.os(ae),2),e=n[0],t=n[1];return Re(Eo({$os:e,$os_version:t,$browser:be.browser(ae,navigator.vendor),$device:be.device(ae),$device_type:be.deviceType(ae)}),{$current_url:De?.href,$host:De?.host,$pathname:De?.pathname,$raw_user_agent:ae.length>1e3?ae.substring(0,997)+"...":ae,$browser_version:be.browserVersion(ae,navigator.vendor),$browser_language:be.browserLanguage(),$screen_height:m?.screen.height,$screen_width:m?.screen.width,$viewport_height:m?.innerHeight,$viewport_width:m?.innerWidth,$lib:"web",$lib_version:jt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Wu()/1e3})},people_properties:function(){if(!ae)return{};var n=Te(be.os(ae),2),e=n[0],t=n[1];return Re(Eo({$os:e,$os_version:t,$browser:be.browser(ae,navigator.vendor)}),{$browser_version:be.browserVersion(ae,navigator.vendor)})}},Rf=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],go=function(){function n(e){W(this,n),this.config=e,this.props={},this.campaign_params_saved=!1,this.name=function(t){var i="";return t.token&&(i=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+i+"_posthog"}(e),this.storage=this.buildStorage(e),this.load(),this.update_config(e,e),this.save()}return V(n,[{key:"buildStorage",value:function(e){Rf.indexOf(e.persistence.toLowerCase())===-1&&(k.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&fe.is_supported()?fe:t==="localstorage+cookie"&&Pr.is_supported()?Pr:t==="sessionstorage"&&ke.is_supported()?ke:t==="memory"?yf:t==="cookie"?bt:Pr.is_supported()?Pr:bt}},{key:"properties",value:function(){var e={};return Y(this.props,function(t,i){if(i===Fn&&nt(t))for(var r=Object.keys(t),s=0;s<r.length;s++)e["$feature/".concat(r[s])]=t[r[s]];else a=i,l=!1,(wt(o=lf)?l:tu&&o.indexOf===tu?o.indexOf(a)!=-1:(Y(o,function(u){if(l||(l=u===a))return qr}),l))||(e[i]=t);var o,a,l}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Re({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,i){var r=this;if(nt(e)){F(t)&&(t="None"),this.expire_days=F(i)?this.default_expiry:i;var s=!1;if(Y(e,function(o,a){r.props.hasOwnProperty(a)&&r.props[a]!==t||(r.props[a]=o,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var i=this;if(nt(e)){this.expire_days=F(t)?this.default_expiry:t;var r=!1;if(Y(e,function(s,o){e.hasOwnProperty(o)&&i.props[o]!==s&&(i.props[o]=s,r=!0)}),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(be.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(be.searchInfo())}},{key:"update_referrer_info",value:function(){this.register(be.referrerInfo())}},{key:"set_initial_person_info",value:function(){this.props[Oo]||this.props[Fo]||this.register_once(y({},pu,be.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return Eo({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};Y([Fo,Oo],function(s){var o=e.props[s];o&&Y(o,function(a,l){t["$initial_"+$o(l)]=a})});var i=this.props[pu];if(i){var r=be.initialPersonPropsFromInfo(i);Re(t,r)}return t}},{key:"safe_merge",value:function(e){return Y(this.props,function(t,i){i in e||(e[i]=t)}),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this.buildStorage(e),r=this.props;this.clear(),this.storage=i,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var i=this.props[Ei]||{};i[e]=t,this.props[Ei]=i,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Ei]||{})[e];return F(t)||(delete this.props[Ei][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),n}(),Pf=2,Of=4,an=function(n){return n[n.DomContentLoaded=0]="DomContentLoaded",n[n.Load=1]="Load",n[n.FullSnapshot=2]="FullSnapshot",n[n.IncrementalSnapshot=3]="IncrementalSnapshot",n[n.Meta=4]="Meta",n[n.Custom=5]="Custom",n[n.Plugin=6]="Plugin",n}(an||{}),Ue=function(n){return n[n.Mutation=0]="Mutation",n[n.MouseMove=1]="MouseMove",n[n.MouseInteraction=2]="MouseInteraction",n[n.Scroll=3]="Scroll",n[n.ViewportResize=4]="ViewportResize",n[n.Input=5]="Input",n[n.TouchMove=6]="TouchMove",n[n.MediaInteraction=7]="MediaInteraction",n[n.StyleSheetRule=8]="StyleSheetRule",n[n.CanvasMutation=9]="CanvasMutation",n[n.Font=10]="Font",n[n.Log=11]="Log",n[n.Drag=12]="Drag",n[n.StyleDeclaration=13]="StyleDeclaration",n[n.Selection=14]="Selection",n[n.AdoptedStyleSheet=15]="AdoptedStyleSheet",n[n.CustomElement=16]="CustomElement",n}(Ue||{});function Yo(n){return n?Zr(n).split(/\s+/):[]}function Vr(n){var e="";switch(Pi(n.className)){case"string":e=n.className;break;case"object":e=("baseVal"in n.className?n.className.baseVal:null)||n.getAttribute("class")||"";break;default:e=""}return Yo(e)}function cc(n){return ut(n)?null:Zr(n).split(/(\s+)/).filter(function(e){return jn(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Gr(n){var e="";return qo(n)&&!dc(n)&&n.childNodes&&n.childNodes.length&&Y(n.childNodes,function(t){var i;pc(t)&&t.textContent&&(e+=(i=cc(t.textContent))!==null&&i!==void 0?i:"")}),Zr(e)}function Ko(n){return!!n&&n.nodeType===1}function Bt(n,e){return!!n&&!!n.tagName&&n.tagName.toLowerCase()===e.toLowerCase()}function pc(n){return!!n&&n.nodeType===3}function fc(n){return!!n&&n.nodeType===11}var jo=["a","button","form","input","select","textarea","label"];function hc(n){var e=n.parentNode;return!(!e||!Ko(e))&&e}function Ff(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!m||!n||Bt(n,"html")||!Ko(n))return!1;if(t!=null&&t.url_allowlist){var s=m.location.href,o=t.url_allowlist;if(o&&!o.some(function(v){return s.match(v)}))return!1}if(t!=null&&t.dom_event_allowlist){var a=t.dom_event_allowlist;if(a&&!a.some(function(v){return e.type===v}))return!1}for(var l=!1,u=[n],c=!0,p=n;p.parentNode&&!Bt(p,"body");)if(fc(p.parentNode))u.push(p.parentNode.host),p=p.parentNode.host;else{if(!(c=hc(p)))break;if(i||jo.indexOf(c.tagName.toLowerCase())>-1)l=!0;else{var f=m.getComputedStyle(c);f&&f.getPropertyValue("cursor")==="pointer"&&(l=!0)}u.push(c),p=c}if(!function(v,w){var D=w?.element_allowlist;if(F(D))return!0;var A,M=rt(v);try{var q=function(){var X=A.value;if(D.some(function(J){return X.tagName.toLowerCase()===J}))return{v:!0}};for(M.s();!(A=M.n()).done;){var H=q();if(Pi(H)==="object")return H.v}}catch(X){M.e(X)}finally{M.f()}return!1}(u,t)||!function(v,w){var D=w?.css_selector_allowlist;if(F(D))return!0;var A,M=rt(v);try{var q=function(){var X=A.value;if(D.some(function(J){return X.matches(J)}))return{v:!0}};for(M.s();!(A=M.n()).done;){var H=q();if(Pi(H)==="object")return H.v}}catch(X){M.e(X)}finally{M.f()}return!1}(u,t))return!1;var d=m.getComputedStyle(n);if(d&&d.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=n.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return l?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(jo.indexOf(g)>-1||n.getAttribute("contenteditable")==="true")}}function qo(n){for(var e=n;e.parentNode&&!Bt(e,"body");e=e.parentNode){var t=Vr(e);if(U(t,"ph-sensitive")||U(t,"ph-no-capture"))return!1}if(U(Vr(n),"ph-include"))return!0;var i=n.type||"";if(Pe(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=n.name||n.id||"";return!(Pe(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function dc(n){return!!(Bt(n,"input")&&!["button","checkbox","submit","reset"].includes(n.type)||Bt(n,"select")||Bt(n,"textarea")||n.getAttribute("contenteditable")==="true")}var gc="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Mf=new RegExp("^(?:".concat(gc,")$")),Df=new RegExp(gc),vc="\\d{3}-?\\d{2}-?\\d{4}",Lf=new RegExp("^(".concat(vc,")$")),Nf=new RegExp("(".concat(vc,")"));function jn(n){var e=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(ut(n)||Pe(n)&&(n=Zr(n),(e?Mf:Df).test((n||"").replace(/[- ]/g,""))||(e?Lf:Nf).test(n)))}function xu(n){var e=Gr(n);return jn(e="".concat(e," ").concat(mc(n)).trim())?e:""}function mc(n){var e="";return n&&n.childNodes&&n.childNodes.length&&Y(n.childNodes,function(t){var i;if(t&&((i=t.tagName)===null||i===void 0?void 0:i.toLowerCase())==="span")try{var r=Gr(t);e="".concat(e," ").concat(r).trim(),t.childNodes&&t.childNodes.length&&(e="".concat(e," ").concat(mc(t)).trim())}catch(s){k.error(s)}}),e}function jf(n){return function(e){var t=e.map(function(i){var r,s,o="";if(i.tag_name&&(o+=i.tag_name),i.attr_class){i.attr_class.sort();var a,l=rt(i.attr_class);try{for(l.s();!(a=l.n()).done;){var u=a.value;o+=".".concat(u.replace(/"/g,""))}}catch(f){l.e(f)}finally{l.f()}}var c=T(T(T(T({},i.text?{text:i.text}:{}),{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(s=i.nth_of_type)!==null&&s!==void 0?s:0},i.href?{href:i.href}:{}),i.attr_id?{attr_id:i.attr_id}:{}),i.attributes),p={};return Nr(c).sort(function(f,d){var g=Te(f,1)[0],v=Te(d,1)[0];return g.localeCompare(v)}).forEach(function(f){var d=Te(f,2),g=d[0],v=d[1];return p[ku(g.toString())]=ku(v.toString())}),o+=":",o+=Nr(c).map(function(f){var d=Te(f,2),g=d[0],v=d[1];return"".concat(g,'="').concat(v,'"')}).join("")});return t.join(";")}(function(e){return e.map(function(t){var i,r,s={text:(i=t.$el_text)===null||i===void 0?void 0:i.slice(0,400),tag_name:t.tag_name,href:(r=t.attr__href)===null||r===void 0?void 0:r.slice(0,2048),attr_class:qf(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Nr(t).filter(function(o){return Te(o,1)[0].indexOf("attr__")===0}).forEach(function(o){var a=Te(o,2),l=a[0],u=a[1];return s.attributes[l]=u}),s})}(n))}function ku(n){return n.replace(/"|\\"/g,'\\"')}function qf(n){var e=n.attr__class;return e?de(e)?e:Yo(e):void 0}var Uo="[SessionRecording]",Bo="redacted",vo={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(n){return n},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6},Uf=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Bf=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],zf=["/s/","/e/","/i/"];function Su(n,e,t,i){if(ut(n))return n;var r=e?.["content-length"]||function(s){return new Blob([s]).size}(n);return Pe(r)&&(r=parseInt(r)),r>t?Uo+" ".concat(i," body too large to record (").concat(r," bytes)"):n}function Eu(n,e){if(ut(n))return n;var t=n;return jn(t,!1)||(t=Uo+" "+e+" body "+Bo),Y(Bf,function(i){var r,s;(r=t)!==null&&r!==void 0&&r.length&&((s=t)===null||s===void 0?void 0:s.indexOf(i))!==-1&&(t=Uo+" "+e+" body "+Bo+" as might contain: "+i)}),t}var Hf=function(n,e){var t,i,r,s={payloadSizeLimitBytes:vo.payloadSizeLimitBytes,performanceEntryTypeToObserve:ln(vo.performanceEntryTypeToObserve)},o=n.session_recording.recordHeaders!==!1&&e.recordHeaders,a=n.session_recording.recordBody!==!1&&e.recordBody,l=n.capture_performance!==!1&&e.recordPerformance,u=(t=s,r=Math.min(1e6,(i=t.payloadSizeLimitBytes)!==null&&i!==void 0?i:1e6),function(f){return f!=null&&f.requestBody&&(f.requestBody=Su(f.requestBody,f.requestHeaders,r,"Request")),f!=null&&f.responseBody&&(f.responseBody=Su(f.responseBody,f.responseHeaders,r,"Response")),f}),c=function(f){return u(function(v){var w=Ai(v.name);if(!(w&&w.pathname&&zf.some(function(D){return w.pathname.indexOf(D)===0})))return v}((g=(d=f).requestHeaders,ut(g)||Y(Object.keys(g??{}),function(v){Uf.includes(v.toLowerCase())&&(g[v]=Bo)}),d)));var d,g},p=it(n.session_recording.maskNetworkRequestFn);return p&&it(n.session_recording.maskCapturedNetworkRequestFn)&&k.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),p&&(n.session_recording.maskCapturedNetworkRequestFn=function(f){var d=n.session_recording.maskNetworkRequestFn({url:f.name});return T(T({},f),{},{name:d?.url})}),s.maskRequestFn=it(n.session_recording.maskCapturedNetworkRequestFn)?function(f){var d,g,v,w=c(f);return w&&(d=(g=(v=n.session_recording).maskCapturedNetworkRequestFn)===null||g===void 0?void 0:g.call(v,w))!==null&&d!==void 0?d:void 0}:function(f){return function(d){if(!F(d))return d.requestBody=Eu(d.requestBody,"Request"),d.responseBody=Eu(d.responseBody,"Response"),d}(c(f))},T(T(T({},vo),s),{},{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})},Wf=V(function n(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};W(this,n),y(this,"bucketSize",100),y(this,"refillRate",10),y(this,"mutationBuckets",{}),y(this,"loggedTracker",{}),y(this,"refillBuckets",function(){Object.keys(r.mutationBuckets).forEach(function(o){r.mutationBuckets[o]=r.mutationBuckets[o]+r.refillRate,r.mutationBuckets[o]>=r.bucketSize&&delete r.mutationBuckets[o]})}),y(this,"getNodeOrRelevantParent",function(o){var a=r.rrweb.mirror.getNode(o);if(a?.nodeName!=="svg"&&a instanceof Element){var l=a.closest("svg");if(l)return[r.rrweb.mirror.getId(l),l]}return[o,a]}),y(this,"numberOfChanges",function(o){var a,l,u,c,p,f,d,g;return((a=(l=o.removes)===null||l===void 0?void 0:l.length)!==null&&a!==void 0?a:0)+((u=(c=o.attributes)===null||c===void 0?void 0:c.length)!==null&&u!==void 0?u:0)+((p=(f=o.texts)===null||f===void 0?void 0:f.length)!==null&&p!==void 0?p:0)+((d=(g=o.adds)===null||g===void 0?void 0:g.length)!==null&&d!==void 0?d:0)}),y(this,"throttleMutations",function(o){if(o.type!==3||o.data.source!==0)return o;var a=o.data,l=r.numberOfChanges(a);a.attributes&&(a.attributes=a.attributes.filter(function(c){var p,f,d,g=Te(r.getNodeOrRelevantParent(c.id),2),v=g[0],w=g[1];return r.mutationBuckets[v]===0?!1:(r.mutationBuckets[v]=(p=r.mutationBuckets[v])!==null&&p!==void 0?p:r.bucketSize,r.mutationBuckets[v]=Math.max(r.mutationBuckets[v]-1,0),r.mutationBuckets[v]===0&&(r.loggedTracker[v]||(r.loggedTracker[v]=!0,(f=(d=r.options).onBlockedNode)===null||f===void 0||f.call(d,v,w))),c)}));var u=r.numberOfChanges(a);return u!==0||l===u?o:void 0}),this.rrweb=e,this.options=s,this.refillRate=(t=this.options.refillRate)!==null&&t!==void 0?t:this.refillRate,this.bucketSize=(i=this.options.bucketSize)!==null&&i!==void 0?i:this.bucketSize,setInterval(function(){r.refillBuckets()},1e3)}),Vf=3e5,Gf=[Ue.MouseMove,Ue.MouseInteraction,Ue.Scroll,Ue.ViewportResize,Ue.Input,Ue.TouchMove,Ue.MediaInteraction,Ue.Drag],Xf=[Ue.StyleSheetRule,Ue.StyleDeclaration,Ue.AdoptedStyleSheet,Ue.Font],Jf=[an.Custom,an.Meta,an.FullSnapshot],$u=function(){function n(e,t){W(this,n),this.size=0,this.data=[],this.sessionId=e,this.windowId=t}return V(n,[{key:"mostRecentSnapshotTimestamp",get:function(){return this.data.length?this.data[this.data.length-1].timestamp:null}},{key:"add",value:function(e){this.size+=e.$snapshot_bytes,this.data.push(e.$snapshot_data)}}]),n}(),Cu=function(n){return{rrwebMethod:n,enqueuedAt:Date.now(),attempt:1}},Xe="[SessionRecording]";function Yf(n){return JSON.stringify(n,(e=[],function(t,i){if(nt(i)){for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(i)?"[Circular]":(e.push(i),i)}return i})).length;var e}var mt,Kf=function(){function n(e){var t=this;if(W(this,n),y(this,"queuedRRWebEvents",[]),y(this,"isIdle",!1),y(this,"_linkedFlagSeen",!1),y(this,"_lastActivityTimestamp",Date.now()),y(this,"_linkedFlag",null),y(this,"_forceAllowLocalhostNetworkCapture",!1),y(this,"_samplingSessionListener",null),this.instance=e,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,m?.addEventListener("beforeunload",function(){t._flushBuffer()}),m?.addEventListener("offline",function(){t._tryAddCustomEvent("browser offline",{})}),m?.addEventListener("online",function(){t._tryAddCustomEvent("browser online",{})}),m?.addEventListener("visibilitychange",function(){if(R!=null&&R.visibilityState){var o="window "+R.visibilityState;t._tryAddCustomEvent(o,{})}}),!this.instance.sessionManager)throw k.error(Xe+" started without valid sessionManager"),new Error(Xe+" started without valid sessionManager. This is a bug.");var i=this.sessionManager.checkAndGetSessionAndWindowId(),r=i.sessionId,s=i.windowId;this.sessionId=r,this.windowId=s,this.buffer=new $u(this.sessionId,this.windowId),this._setupSampling()}return V(n,[{key:"rrwebRecord",get:function(){var e;return he==null||(e=he.rrweb)===null||e===void 0?void 0:e.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw new Error(Xe+" started without valid sessionManager. This is a bug.");return this.instance.sessionManager}},{key:"fullSnapshotIntervalMillis",get:function(){var e;return((e=this.instance.config.session_recording)===null||e===void 0?void 0:e.full_snapshot_interval_millis)||Vf}},{key:"isSampled",get:function(){var e=this.instance.get_property(Ci);return Lr(e)?e:null}},{key:"sessionDuration",get:function(){var e=this.buffer.mostRecentSnapshotTimestamp,t=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return e?e-t:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(Ao),t=!this.instance.config.disable_session_recording;return m&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(ou),t=this.instance.config.enable_recording_console_log;return t??e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(lu);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,i=this.instance.get_property(au),r={recordHeaders:(e=this.instance.config.session_recording)===null||e===void 0?void 0:e.recordHeaders,recordBody:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.recordBody},s=r?.recordHeaders||i?.recordHeaders,o=r?.recordBody||i?.recordBody,a=this.instance.config.capture_performance||i?.capturePerformance;return s||o||a?{recordHeaders:s,recordBody:o,recordPerformance:a}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(uu);return lt(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(cu);return lt(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?ut(this._linkedFlag)||this._linkedFlagSeen?Lr(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),k.info(Xe+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,k.info(Xe+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,i=this.sessionId!==e,r=this.sampleRate;if(lt(r)){var s,o=this.isSampled,a=i||!Lr(o);a?s=Math.random()<r:s=o,!s&&a&&k.warn(Xe+" Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r}),(t=this.instance.persistence)===null||t===void 0||t.register(y({},Ci,s))}else{var l;(l=this.instance.persistence)===null||l===void 0||l.register(y({},Ci,null))}}},{key:"afterDecideResponse",value:function(e){var t,i,r,s=this;if(this._persistDecideResponse(e),this._linkedFlag=((t=e.sessionRecording)===null||t===void 0?void 0:t.linkedFlag)||null,(i=e.sessionRecording)!==null&&i!==void 0&&i.endpoint&&(this._endpoint=(r=e.sessionRecording)===null||r===void 0?void 0:r.endpoint),this._setupSampling(),!ut(this._linkedFlag)){var o=Pe(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=Pe(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(function(l,u){var c=nt(u)&&o in u,p=a?u[o]===a:c;if(p){var f={linkedFlag:o,linkedVariant:a},d="linked flag matched";k.info(Xe+" "+d,f),s._tryAddCustomEvent(d,f)}s._linkedFlagSeen=p})}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;lt(this.sampleRate)&&wt(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(function(t){e.makeSamplingDecision(t)}))}},{key:"_persistDecideResponse",value:function(e){if(this.instance.persistence){var t=this.instance.persistence,i=function(){var r,s,o,a,l,u,c,p,f=(r=e.sessionRecording)===null||r===void 0?void 0:r.sampleRate,d=ut(f)?null:parseFloat(f),g=(s=e.sessionRecording)===null||s===void 0?void 0:s.minimumDurationMilliseconds;t.register((y(p={},Ao,!!e.sessionRecording),y(p,ou,(o=e.sessionRecording)===null||o===void 0?void 0:o.consoleLogRecordingEnabled),y(p,au,T({capturePerformance:e.capturePerformance},(a=e.sessionRecording)===null||a===void 0?void 0:a.networkPayloadCapture)),y(p,lu,{enabled:(l=e.sessionRecording)===null||l===void 0?void 0:l.recordCanvas,fps:(u=e.sessionRecording)===null||u===void 0?void 0:u.canvasFps,quality:(c=e.sessionRecording)===null||c===void 0?void 0:c.canvasQuality}),y(p,uu,d),y(p,cu,F(g)?null:g),p))};i(),this.sessionManager.onSessionId(i)}}},{key:"log",value:function(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(t=this.instance.sessionRecording)===null||t===void 0||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:Wu()})}},{key:"_startCapture",value:function(){var e=this;F(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():qn(this.instance.requestRouter.endpointFor("assets","/static/recorder.js?v=".concat(jt.LIB_VERSION)),function(t){if(t)return k.error(Xe+" could not load recorder.js",t);e._onScriptLoaded()}))}},{key:"isInteractiveEvent",value:function(e){var t;return e.type===3&&Gf.indexOf((t=e.data)===null||t===void 0?void 0:t.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0,clearTimeout(this._fullSnapshotTimer),this._flushBuffer());var i=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),s=r.windowId,o=r.sessionId,a=this.sessionId!==o,l=this.windowId!==s;this.windowId=s,this.sessionId=o,(i||[Pf,Of].indexOf(e.type)===-1&&(l||a||F(this._fullSnapshotTimer)))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):k.warn(Xe+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var i=this;return this._tryRRWebMethod(Cu(function(){return i.rrwebRecord.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(Cu(function(){return e.rrwebRecord.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){for(var e,t=this,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},r=this.instance.config.session_recording,s=0,o=Object.entries(r||{});s<o.length;s++){var a=Te(o[s],2),l=a[0],u=a[1];l in i&&(i[l]=u)}if(this.canvasRecording&&this.canvasRecording.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.canvasRecording.fps},i.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(e=this.mutationRateLimiter)!==null&&e!==void 0?e:new Wf(this.rrwebRecord,{onBlockedNode:function(p,f){var d="Too many mutations on node '".concat(p,"'. Rate limiting. This could be due to SVG animations or something similar");k.info(d,{node:f}),t.log(Xe+" "+d,"warn")}});var c=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(T({emit:function(p){t.onRRwebEmit(p)},plugins:c},i)),this.instance._addCaptureHook(function(p){try{if(p==="$pageview"){var f=m?t._maskUrl(m.location.href):"";if(!f)return;t._tryAddCustomEvent("$pageview",{href:f}),t._tryTakeFullSnapshot()}}catch(d){k.error("Could not add $pageview to rrweb session",d)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:i,activePlugins:c.map(function(p){return p?.name})}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else k.error(Xe+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval(function(){e._tryTakeFullSnapshot()},t))}}},{key:"_gatherRRWebPlugins",value:function(){var e=[];return he.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(he.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&it(he.getRecordNetworkPlugin)&&(!_f.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(he.getRecordNetworkPlugin(Hf(this.instance.config,this.networkPayloadCapture))):k.info(Xe+" NetworkCapture not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&nt(e)){if(e.type===an.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===an.FullSnapshot&&this._scheduleFullSnapshot();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var r=function(a){var l=a;if(l&&nt(l)&&l.type===6&&nt(l.data)&&l.data.plugin==="rrweb/console@1"){l.data.payload.payload.length>10&&(l.data.payload.payload=l.data.payload.payload.slice(0,10),l.data.payload.payload.push("...[truncated]"));for(var u=[],c=0;c<l.data.payload.payload.length;c++)l.data.payload.payload[c]&&l.data.payload.payload[c].length>2e3?u.push(l.data.payload.payload[c].slice(0,2e3)+"...[truncated]"):u.push(l.data.payload.payload[c]);return l.data.payload.payload=u,a}return a}(i),s=Yf(r);if(this._updateWindowAndSessionIds(r),!this.isIdle||function(a){var l=a.type===an.IncrementalSnapshot&&!ut(a.data.source)&&Xf.includes(a.data.source);return Jf.includes(a.type)||l}(r)){var o={$snapshot_bytes:s,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&m){var e=this._maskUrl(m.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=ln(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach(function(i){Date.now()-i.enqueuedAt<=2e3&&e._tryRRWebMethod(i)})}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var i,r={url:e};return(i=r=t.maskNetworkRequestFn(r))===null||i===void 0?void 0:i.url}return e}},{key:"clearBuffer",value:function(){this.buffer=new $u(this.sessionId,this.windowId)}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,i=this.sessionDuration,r=lt(i)&&i>=0,s=lt(t)&&r&&i<t;this.status==="buffering"||s?this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3):(this.buffer.data.length>0&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer())}},{key:"_captureSnapshotBuffered",value:function(e){var t,i=this,r=2+(((t=this.buffer)===null||t===void 0?void 0:t.data.length)||0);(this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&this._flushBuffer(),this.buffer.add(e),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){i._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",_noHeatmaps:!0})}}]),n}(),Qf=function(){function n(e){W(this,n),this.instance=e,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return V(n,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Mn),group_properties:this.instance.get_property(Lt),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:tt.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(i){return e.parseDecideResponse(i.json)}})}},{key:"parseDecideResponse",value:function(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var i=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(e??{},i),i)k.error("Failed to fetch feature flags from PostHog.");else{if(!R||!R.body)return k.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){t.parseDecideResponse(e)},500);this.instance._afterDecideResponse(e);var r=m?.extendPostHogWithExceptionAutoCapture;if(e.autocaptureExceptions&&e.autocaptureExceptions&&F(r)&&qn(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js"),function(l){if(l)return k.error("Could not load exception autocapture script",l);m.extendPostHogWithExceptionAutocapture(t.instance,e)}),e.siteApps)if(this.instance.config.opt_in_site_apps){var s,o=rt(e.siteApps);try{var a=function(){var l=s.value,u=l.id,c=l.url,p=t.instance.requestRouter.endpointFor("api",c);he["__$$ph_site_app_".concat(u)]=t.instance,qn(p,function(f){f&&k.error("Error while initializing PostHog app with config id ".concat(u),f)})};for(o.s();!(s=o.n()).done;)a()}catch(l){o.e(l)}finally{o.f()}}else e.siteApps.length>0&&k.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),n}(),Zf=m!=null&&m.location?Hr(m.location.hash,"__posthog")||Hr(location.hash,"state"):null,Au="_postHogToolbarParams";(function(n){n[n.UNINITIALIZED=0]="UNINITIALIZED",n[n.LOADING=1]="LOADING",n[n.LOADED=2]="LOADED"})(mt||(mt={}));var eh=function(){function n(e){W(this,n),this.instance=e}return V(n,[{key:"setToolbarState",value:function(e){he.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return(e=he.ph_toolbar_state)!==null&&e!==void 0?e:mt.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!m||!R)return!1;i=(e=i)!==null&&e!==void 0?e:m.location,s=(t=s)!==null&&t!==void 0?t:m.history;try{if(!r){try{m.localStorage.setItem("test","test"),m.localStorage.removeItem("test")}catch{return!1}r=m?.localStorage}var o,a=Zf||Hr(i.hash,"__posthog")||Hr(i.hash,"state"),l=a?ru(function(){return JSON.parse(atob(decodeURIComponent(a)))})||ru(function(){return JSON.parse(decodeURIComponent(a))}):null;return l&&l.action==="ph_authorize"?((o=l).source="url",o&&Object.keys(o).length>0&&(l.desiredHash?i.hash=l.desiredHash:s?s.replaceState(s.state,"",i.pathname+i.search):i.hash="")):((o=JSON.parse(r.getItem(Au)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}},{key:"_callLoadToolbar",value:function(e){(he.ph_load_toolbar||he.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var t=this,i=!(R==null||!R.getElementById(Mo));if(!m||i)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=T(T({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(m.localStorage.setItem(Au,JSON.stringify(T(T({},s),{},{source:void 0}))),this.getToolbarState()===mt.LOADED)this._callLoadToolbar(s);else if(this.getToolbarState()===mt.UNINITIALIZED){this.setToolbarState(mt.LOADING);var o=3e5,a=Math.floor(Date.now()/o)*o;qn(this.instance.requestRouter.endpointFor("assets","/static/toolbar.js?t=".concat(a)),function(l){if(l)return k.error("Failed to load toolbar",l),void t.setToolbarState(mt.UNINITIALIZED);t.setToolbarState(mt.LOADED),t._callLoadToolbar(s)}),yt(m,"turbolinks:load",function(){t.setToolbarState(mt.UNINITIALIZED),t.loadToolbar(s)})}return!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,i)}}]),n}(),th=function(){function n(e){W(this,n),y(this,"isPaused",!0),y(this,"queue",[]),y(this,"flushTimeoutMs",3e3),this.sendRequest=e}return V(n,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},i=Object.values(t);[].concat(ln(i.filter(function(r){return r.url.indexOf("/e")===0})),ln(i.filter(function(r){return r.url.indexOf("/e")!==0}))).map(function(r){e.sendRequest(T(T({},r),{},{transport:"sendBeacon"}))})}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),i=function(s){var o=t[s],a=new Date().getTime();o.data&&de(o.data)&&Y(o.data,function(l){l.offset=Math.abs(l.timestamp-a),delete l.timestamp}),e.sendRequest(o)};for(var r in t)i(r)}},this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return Y(this.queue,function(t){var i,r=t,s=(r?r.batchKey:null)||r.url;F(e[s])&&(e[s]=T(T({},r),{},{data:[]})),(i=e[s].data)===null||i===void 0||i.push(r.data)}),this.queue=[],e}}]),n}(),Be=Uint8Array,Oe=Uint16Array,Bn=Uint32Array,Qo=new Be([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]),Zo=new Be([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]),Iu=new Be([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),yc=function(n,e){for(var t=new Oe(31),i=0;i<31;++i)t[i]=e+=1<<n[i-1];var r=new Bn(t[30]);for(i=1;i<30;++i)for(var s=t[i];s<t[i+1];++s)r[s]=s-t[i]<<5|i;return[t,r]},_c=yc(Qo,2),nh=_c[0],zo=_c[1];nh[28]=258,zo[258]=28;for(Ho=yc(Zo,0)[1],Xr=new Oe(32768),Q=0;Q<32768;++Q)Dt=(43690&Q)>>>1|(21845&Q)<<1,Dt=(61680&(Dt=(52428&Dt)>>>2|(13107&Dt)<<2))>>>4|(3855&Dt)<<4,Xr[Q]=((65280&Dt)>>>8|(255&Dt)<<8)>>>1;var Dt,Ho,Xr,Q,Ii=function(n,e,t){for(var i=n.length,r=0,s=new Oe(e);r<i;++r)++s[n[r]-1];var o,a=new Oe(e);for(r=0;r<e;++r)a[r]=a[r-1]+s[r-1]<<1;if(t){o=new Oe(1<<e);var l=15-e;for(r=0;r<i;++r)if(n[r])for(var u=r<<4|n[r],c=e-n[r],p=a[n[r]-1]++<<c,f=p|(1<<c)-1;p<=f;++p)o[Xr[p]>>>l]=u}else for(o=new Oe(i),r=0;r<i;++r)o[r]=Xr[a[n[r]-1]++]>>>15-n[r];return o},un=new Be(288);for(Q=0;Q<144;++Q)un[Q]=8;for(Q=144;Q<256;++Q)un[Q]=9;for(Q=256;Q<280;++Q)un[Q]=7;for(Q=280;Q<288;++Q)un[Q]=8;var Jr=new Be(32);for(Q=0;Q<32;++Q)Jr[Q]=5;var ih=Ii(un,9,0),rh=Ii(Jr,5,0),bc=function(n){return(n/8>>0)+(7&n&&1)},wc=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var i=new(n instanceof Oe?Oe:n instanceof Bn?Bn:Be)(t-e);return i.set(n.subarray(e,t)),i},gt=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8},xi=function(n,e,t){t<<=7&e;var i=e/8>>0;n[i]|=t,n[i+1]|=t>>>8,n[i+2]|=t>>>16},mo=function(n,e){for(var t=[],i=0;i<n.length;++i)n[i]&&t.push({s:i,f:n[i]});var r=t.length,s=t.slice();if(!r)return[new Be(0),0];if(r==1){var o=new Be(t[0].s+1);return o[t[0].s]=1,[o,1]}t.sort(function(H,X){return H.f-X.f}),t.push({s:-1,f:25001});var a=t[0],l=t[1],u=0,c=1,p=2;for(t[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=t[t[u].f<t[p].f?u++:p++],l=t[u!=c&&t[u].f<t[p].f?u++:p++],t[c++]={s:-1,f:a.f+l.f,l:a,r:l};var f=s[0].s;for(i=1;i<r;++i)s[i].s>f&&(f=s[i].s);var d=new Oe(f+1),g=sh(t[c-1],d,0);if(g>e){i=0;var v=0,w=g-e,D=1<<w;for(s.sort(function(H,X){return d[X.s]-d[H.s]||H.f-X.f});i<r;++i){var A=s[i].s;if(!(d[A]>e))break;v+=D-(1<<g-d[A]),d[A]=e}for(v>>>=w;v>0;){var M=s[i].s;d[M]<e?v-=1<<e-d[M]++-1:++i}for(;i>=0&&v;--i){var q=s[i].s;d[q]==e&&(--d[q],++v)}g=e}return[new Be(d),g]},sh=function n(e,t,i){return e.s==-1?Math.max(n(e.l,t,i+1),n(e.r,t,i+1)):t[e.s]=i},Tu=function(n){for(var e=n.length;e&&!n[--e];);for(var t=new Oe(++e),i=0,r=n[0],s=1,o=function(l){t[i++]=l},a=1;a<=e;++a)if(n[a]==r&&a!=e)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=n[a]}return[t.subarray(0,i),e]},ki=function(n,e){for(var t=0,i=0;i<e.length;++i)t+=n[i]*e[i];return t},jr=function(n,e,t){var i=t.length,r=bc(e+2);n[r]=255&i,n[r+1]=i>>>8,n[r+2]=255^n[r],n[r+3]=255^n[r+1];for(var s=0;s<i;++s)n[r+s+4]=t[s];return 8*(r+4+i)},Ru=function(n,e,t,i,r,s,o,a,l,u,c){gt(e,c++,t),++r[256];for(var p=mo(r,15),f=p[0],d=p[1],g=mo(s,15),v=g[0],w=g[1],D=Tu(f),A=D[0],M=D[1],q=Tu(v),H=q[0],X=q[1],J=new Oe(19),E=0;E<A.length;++E)J[31&A[E]]++;for(E=0;E<H.length;++E)J[31&H[E]]++;for(var ie=mo(J,7),Z=ie[0],ft=ie[1],ve=19;ve>4&&!Z[Iu[ve-1]];--ve);var ze,G,ee,le,Fe=u+5<<3,Ne=ki(r,un)+ki(s,Jr)+o,re=ki(r,f)+ki(s,v)+o+14+3*ve+ki(J,Z)+(2*J[16]+3*J[17]+7*J[18]);if(Fe<=Ne&&Fe<=re)return jr(e,c,n.subarray(l,l+u));if(gt(e,c,1+(re<Ne)),c+=2,re<Ne){ze=Ii(f,d,0),G=f,ee=Ii(v,w,0),le=v;var Ee=Ii(Z,ft,0);for(gt(e,c,M-257),gt(e,c+5,X-1),gt(e,c+10,ve-4),c+=14,E=0;E<ve;++E)gt(e,c+3*E,Z[Iu[E]]);c+=3*ve;for(var $e=[A,H],te=0;te<2;++te){var me=$e[te];for(E=0;E<me.length;++E){var Ae=31&me[E];gt(e,c,Ee[Ae]),c+=Z[Ae],Ae>15&&(gt(e,c,me[E]>>>5&127),c+=me[E]>>>12)}}}else ze=ih,G=un,ee=rh,le=Jr;for(E=0;E<a;++E)if(i[E]>255){Ae=i[E]>>>18&31,xi(e,c,ze[Ae+257]),c+=G[Ae+257],Ae>7&&(gt(e,c,i[E]>>>23&31),c+=Qo[Ae]);var pn=31&i[E];xi(e,c,ee[pn]),c+=le[pn],pn>3&&(xi(e,c,i[E]>>>5&8191),c+=Zo[pn])}else xi(e,c,ze[i[E]]),c+=G[i[E]];return xi(e,c,ze[256]),c+G[256]},oh=new Bn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ah=new Be(0),lh=function(){for(var n=new Bn(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;n[e]=t}return n}(),uh=function(n,e,t,i,r){return function(s,o,a,l,u,c){var p=s.length,f=new Be(l+p+5*(1+Math.floor(p/7e3))+u),d=f.subarray(l,f.length-u),g=0;if(!o||p<8)for(var v=0;v<=p;v+=65535){var w=v+65535;w<p?g=jr(d,g,s.subarray(v,w)):(d[v]=c,g=jr(d,g,s.subarray(v,p)))}else{for(var D=oh[o-1],A=D>>>13,M=8191&D,q=(1<<a)-1,H=new Oe(32768),X=new Oe(q+1),J=Math.ceil(a/3),E=2*J,ie=function(hs){return(s[hs]^s[hs+1]<<J^s[hs+2]<<E)&q},Z=new Bn(25e3),ft=new Oe(288),ve=new Oe(32),ze=0,G=0,ee=(v=0,0),le=0,Fe=0;v<p;++v){var Ne=ie(v),re=32767&v,Ee=X[Ne];if(H[re]=Ee,X[Ne]=re,le<=v){var $e=p-v;if((ze>7e3||ee>24576)&&$e>423){g=Ru(s,d,0,Z,ft,ve,G,ee,Fe,v-Fe,g),ee=ze=G=0,Fe=v;for(var te=0;te<286;++te)ft[te]=0;for(te=0;te<30;++te)ve[te]=0}var me=2,Ae=0,pn=M,xt=re-Ee&32767;if($e>2&&Ne==ie(v-xt))for(var Nc=Math.min(A,$e)-1,jc=Math.min(32767,v),qc=Math.min(258,$e);xt<=jc&&--pn&&re!=Ee;){if(s[v+me]==s[v+me-xt]){for(var kt=0;kt<qc&&s[v+kt]==s[v+kt-xt];++kt);if(kt>me){if(me=kt,Ae=xt,kt>Nc)break;var Uc=Math.min(xt,kt-2),sa=0;for(te=0;te<Uc;++te){var fs=v-xt+te+32768&32767,oa=fs-H[fs]+32768&32767;oa>sa&&(sa=oa,Ee=fs)}}}xt+=(re=Ee)-(Ee=H[re])+32768&32767}if(Ae){Z[ee++]=268435456|zo[me]<<18|Ho[Ae];var aa=31&zo[me],la=31&Ho[Ae];G+=Qo[aa]+Zo[la],++ft[257+aa],++ve[la],le=v+me,++ze}else Z[ee++]=s[v],++ft[s[v]]}}g=Ru(s,d,c,Z,ft,ve,G,ee,Fe,v-Fe,g),c||(g=jr(d,g,ah))}return wc(f,0,l+bc(g)+u)}(n,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+e.mem,t,i,!r)},yo=function(n,e,t){for(;t;++e)n[e]=t,t>>>=8};function ch(n,e){e===void 0&&(e={});var t=function(){var a=4294967295;return{p:function(l){for(var u=a,c=0;c<l.length;++c)u=lh[255&u^l[c]]^u>>>8;a=u},d:function(){return 4294967295^a}}}(),i=n.length;t.p(n);var r,s=uh(n,e,10+((r=e).filename&&r.filename.length+1||0),8),o=s.length;return function(a,l){var u=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&yo(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){a[3]=8;for(var c=0;c<=u.length;++c)a[c+10]=u.charCodeAt(c)}}(s,e),yo(s,o-8,t.d()),yo(s,o-4,i),s}var ph=!!So||!!ko,Pu="text/plain",Yr=function(n,e){var t=Te(n.split("?"),2),i=t[0],r=t[1],s=T({},e);r?.split("&").forEach(function(a){var l=Te(a.split("="),1)[0];delete s[l]});var o=bf(s);return o=o?(r?r+"&":"")+o:r,"".concat(i,"?").concat(o)},fh=function(n){return"data="+encodeURIComponent(typeof n=="string"?n:JSON.stringify(n))},_o=function(n){var e=n.data,t=n.compression;if(e){if(t===tt.GZipJS){var i=ch(function(s,o){var a=s.length;if(!o&&typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var l=new Be(s.length+(s.length>>>1)),u=0,c=function(g){l[u++]=g},p=0;p<a;++p){if(u+5>l.length){var f=new Be(u+8+(a-p<<1));f.set(l),l=f}var d=s.charCodeAt(p);d<128||o?c(d):d<2048?(c(192|d>>>6),c(128|63&d)):d>55295&&d<57344?(c(240|(d=65536+(1047552&d)|1023&s.charCodeAt(++p))>>>18),c(128|d>>>12&63),c(128|d>>>6&63),c(128|63&d)):(c(224|d>>>12),c(128|d>>>6&63),c(128|63&d))}return wc(l,0,u)}(JSON.stringify(e)),{mtime:0});return{contentType:Pu,body:new Blob([i],{type:Pu})}}if(t===tt.Base64){var r=function(s){var o,a,l,u,c,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f=0,d=0,g="",v=[];if(!s)return s;s=af(s);do o=(c=s.charCodeAt(f++)<<16|s.charCodeAt(f++)<<8|s.charCodeAt(f++))>>18&63,a=c>>12&63,l=c>>6&63,u=63&c,v[d++]=p.charAt(o)+p.charAt(a)+p.charAt(l)+p.charAt(u);while(f<s.length);switch(g=v.join(""),s.length%3){case 1:g=g.slice(0,-2)+"==";break;case 2:g=g.slice(0,-1)+"="}return g}(JSON.stringify(e));return{contentType:"application/x-www-form-urlencoded",body:fh(r)}}return{contentType:"application/json",body:JSON.stringify(e)}}},Ti=[];So&&Ti.push({transport:"XHR",method:function(n){var e,t=new So;t.open(n.method||"GET",n.url,!0);var i=(e=_o(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body;Y(n.headers,function(o,a){t.setRequestHeader(a,o)}),r&&t.setRequestHeader("Content-Type",r),n.timeout&&(t.timeout=n.timeout),t.withCredentials=!0,t.onreadystatechange=function(){if(t.readyState===4){var o,a={statusCode:t.status,text:t.responseText};if(t.status===200)try{a.json=JSON.parse(t.responseText)}catch{}(o=n.callback)===null||o===void 0||o.call(n,a)}},t.send(s)}}),ko&&Ti.push({transport:"fetch",method:function(n){var e,t,i=(e=_o(n))!==null&&e!==void 0?e:{},r=i.contentType,s=i.body,o=new Headers;Y(o,function(c,p){o.append(p,c)}),r&&o.append("Content-Type",r);var a=n.url,l=null;if(nu){var u=new nu;l={signal:u.signal,timeout:setTimeout(function(){return u.abort()},n.timeout)}}ko(a,{method:n?.method||"GET",headers:o,keepalive:n.method==="POST",body:s,signal:(t=l)===null||t===void 0?void 0:t.signal}).then(function(c){return c.text().then(function(p){var f,d={statusCode:c.status,text:p};if(c.status===200)try{d.json=JSON.parse(p)}catch(g){k.error(g)}(f=n.callback)===null||f===void 0||f.call(n,d)})}).catch(function(c){var p;k.error(c),(p=n.callback)===null||p===void 0||p.call(n,{statusCode:0,text:c})}).finally(function(){return l?clearTimeout(l.timeout):null})}}),_t!=null&&_t.sendBeacon&&Ti.push({transport:"sendBeacon",method:function(n){var e=Yr(n.url,{beacon:"1"});try{var t,i=(t=_o(n))!==null&&t!==void 0?t:{},r=i.contentType,s=i.body,o=typeof s=="string"?new Blob([s],{type:r}):s;_t.sendBeacon(e,o)}catch{}}});var hh=["retriesPerformedSoFar"],on,dh=function(){function n(e){var t=this;W(this,n),y(this,"isPolling",!1),y(this,"pollIntervalMs",3e3),y(this,"queue",[]),this.instance=e,this.queue=[],this.areWeOnline=!0,!F(m)&&"onLine"in m.navigator&&(this.areWeOnline=m.navigator.onLine,m.addEventListener("online",function(){t.areWeOnline=!0,t.flush()}),m.addEventListener("offline",function(){t.areWeOnline=!1}))}return V(n,[{key:"retriableRequest",value:function(e){var t=this,i=e.retriesPerformedSoFar,r=tf(e,hh);lt(i)&&i>0&&(r.url=Yr(r.url,{retry_count:i})),this.instance._send_request(T(T({},r),{},{callback:function(s){var o;s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(i??0)<10?t.enqueue(T({retriesPerformedSoFar:i},r)):(o=r.callback)===null||o===void 0||o.call(r,s)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)}(t),r=Date.now()+i;this.queue.push({retryAt:r,requestOptions:e});var s="Enqueued failed request for retry in ".concat(i);navigator.onLine||(s+=" (Browser is offline)"),k.warn(s),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout(function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()},this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],i=this.queue.filter(function(a){return a.retryAt<e||(t.push(a),!1)});if(this.queue=t,i.length>0){var r,s=rt(i);try{for(s.s();!(r=s.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(a){s.e(a)}finally{s.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,t=rt(this.queue);try{for(t.s();!(e=t.n()).done;){var i=e.value.requestOptions;try{this.instance._send_request(T(T({},i),{},{transport:"sendBeacon"}))}catch(r){k.error(r)}}}catch(r){t.e(r)}finally{t.f()}this.queue=[]}}]),n}(),Mr=1800,gh=function(){function n(e,t,i,r){var s;W(this,n),y(this,"_sessionIdChangedHandlers",[]),this.config=e,this.persistence=t,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=i||qt,this._windowIdGenerator=r||qt;var o=e.persistence_name||e.token,a=e.session_idle_timeout_seconds||Mr;if(lt(a)?a>Mr?k.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a<60&&k.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(k.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=Mr),this._sessionTimeoutMs=1e3*Math.min(Math.max(a,60),Mr),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var l=ke.parse(this._window_id_storage_key),u=ke.parse(this._primary_window_exists_storage_key);l&&!u?this._windowId=l:ke.remove(this._window_id_storage_key),ke.set(this._primary_window_exists_storage_key,!0)}if((s=this.config.bootstrap)!==null&&s!==void 0&&s.sessionID)try{var c=function(p){var f=p.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)}(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),c)}catch(p){k.error("Invalid sessionID in bootstrap",p)}this._listenToReloadWindow()}return V(n,[{key:"onSessionId",value:function(e){var t=this;return F(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter(function(i){return i!==e})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&ke.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&ke.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?ke.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,i){e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(y({},Ur,[t,e,i])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Ur];return de(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;m?.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&ke.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&arguments[0]!==void 0&&arguments[0],t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),i=Te(this._getSessionId(),3),r=i[0],s=i[1],o=i[2],a=this._getWindowId(),l=o&&o>0&&Math.abs(t-o)>864e5,u=!1,c=!s,p=!e&&Math.abs(t-r)>this._sessionTimeoutMs;c||p||l?(s=this._sessionIdGenerator(),a=this._windowIdGenerator(),k.info("[SessionId] new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:c,activityTimeout:p,sessionPastMaximumLength:l}}),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var f=r===0||!e||l?t:r,d=o===0?new Date().getTime():o;return this._setWindowId(a),this._setSessionId(s,f,d),u&&this._sessionIdChangedHandlers.forEach(function(g){return g(s,a)}),{sessionId:s,windowId:a,sessionStartTimestamp:d}}}]),n}();(function(n){n.US="us",n.EU="eu",n.CUSTOM="custom"})(on||(on={}));var Ou="i.posthog.com",vh=function(){function n(e){W(this,n),y(this,"_regionCache",{}),this.instance=e}return V(n,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e,t=(e=this.instance.config.ui_host)===null||e===void 0?void 0:e.replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=on.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=on.EU:this._regionCache[this.apiHost]=on.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(t&&(t=t[0]==="/"?t:"/".concat(t)),e==="ui")return(this.uiHost||this.apiHost.replace(".".concat(Ou),".posthog.com"))+t;if(this.region===on.CUSTOM)return this.apiHost+t;var i=Ou+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}}]),n}(),xc="posthog-js";function kc(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.organization,i=e.projectId,r=e.prefix,s=e.severityAllowList,o=s===void 0?["error"]:s;return function(a){var l,u,c,p,f;if(!(o==="*"||o.includes(a.level))||!n.__loaded)return a;a.tags||(a.tags={});var d=n.requestRouter.endpointFor("ui","/project/".concat(n.config.token,"/person/").concat(n.get_distinct_id()));a.tags["PostHog Person URL"]=d,n.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=n.get_session_replay_url({withTimestamp:!0}));var g=((l=a.exception)===null||l===void 0?void 0:l.values)||[],v={$exception_message:((u=g[0])===null||u===void 0?void 0:u.value)||a.message,$exception_type:(c=g[0])===null||c===void 0?void 0:c.type,$exception_personURL:d,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((p=g[0])===null||p===void 0?void 0:p.value)||a.message,$sentry_exception_type:(f=g[0])===null||f===void 0?void 0:f.type,$sentry_tags:a.tags,$level:a.level};return t&&i&&(v.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+a.event_id),n.capture("$exception",v),a}}var mh=V(function n(e,t,i,r,s){W(this,n),this.name=xc,this.setupOnce=function(o){o(kc(e,{organization:t,projectId:i,prefix:r,severityAllowList:s}))}});function yh(n,e){var t=n.config.segment;if(!t)return e();(function(i,r){var s=i.config.segment;if(!s)return r();var o=function(l){var u=function(){return l.anonymousId()||qt()};i.config.get_device_id=u,l.id()&&(i.register({distinct_id:l.id(),$device_id:u()}),i.persistence.set_property(vt,"identified")),r()},a=s.user();"then"in a&&it(a.then)?a.then(function(l){return o(l)}):o(a)})(n,function(){t.register(function(i){Promise&&Promise.resolve||k.warn("This browser does not have Promise support, and can not use the segment integration");var r=function(s,o){var a;if(!o)return s;s.event.userId||s.event.anonymousId===i.get_distinct_id()||i.reset(),s.event.userId&&s.event.userId!==i.get_distinct_id()&&(i.register({distinct_id:s.event.userId}),i.reloadFeatureFlags());var l=i._calculate_event_properties(o,(a=s.event.properties)!==null&&a!==void 0?a:{});return s.event.properties=Object.assign({},l,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(s){return r(s,s.event.event)},page:function(s){return r(s,"$pageview")},identify:function(s){return r(s,"$identify")},screen:function(s){return r(s,"$screen")}}}(n)).then(function(){e()})})}var Fu,Kr,et,_h=function(){function n(e){W(this,n),this._instance=e}return V(n,[{key:"doPageView",value:function(){var e,t=this._previousScrollProperties();return this._currentPath=(e=m?.location.pathname)!==null&&e!==void 0?e:"",this._instance.scrollManager.resetContext(),t}},{key:"doPageLeave",value:function(){return this._previousScrollProperties()}},{key:"_previousScrollProperties",value:function(){var e=this._currentPath,t=this._instance.scrollManager.getContext();if(!e||!t)return{};var i=t.maxScrollHeight,r=t.lastScrollY,s=t.maxScrollY,o=t.maxContentHeight,a=t.lastContentY,l=t.maxContentY;return F(i)||F(r)||F(s)||F(o)||F(a)||F(l)?{}:(i=Math.ceil(i),r=Math.ceil(r),s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),{$prev_pageview_pathname:e,$prev_pageview_last_scroll:r,$prev_pageview_last_scroll_percentage:i<=1?1:Dr(r/i,0,1),$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:i<=1?1:Dr(s/i,0,1),$prev_pageview_last_content:a,$prev_pageview_last_content_percentage:o<=1?1:Dr(a/o,0,1),$prev_pageview_max_content:l,$prev_pageview_max_content_percentage:o<=1?1:Dr(l/o,0,1)})}}]),n}();function Dr(n,e,t){return Math.max(e,Math.min(n,t))}(function(n){n.Popover="popover",n.API="api",n.Widget="widget"})(Fu||(Fu={})),function(n){n.Open="open",n.MultipleChoice="multiple_choice",n.SingleChoice="single_choice",n.Rating="rating",n.Link="link"}(Kr||(Kr={})),function(n){n.NextQuestion="next_question",n.End="end",n.ResponseBased="response_based",n.SpecificQuestion="specific_question"}(et||(et={}));var Mu=function(){function n(e){W(this,n),this.persistence=e,this.eventRegistry=new Map}return V(n,[{key:"register",value:function(e){var t=this;e.forEach(function(i){var r,s,o,a,l;(r=i.conditions)!==null&&r!==void 0&&r.events&&(s=i.conditions)!==null&&s!==void 0&&(o=s.events)!==null&&o!==void 0&&o.values&&((a=i.conditions)===null||a===void 0?void 0:a.events.values.length)>0&&t.eventRegistry.set(i.id,(l=i.conditions)===null||l===void 0?void 0:l.events.values.map(function(u){return u.name}))})}},{key:"on",value:function(e){var t,i=[];this.eventRegistry.forEach(function(o,a){o.includes(e)&&i.push(a)});var r=(t=this.persistence)===null||t===void 0?void 0:t.props[co],s=(r||[]).concat(i);this._saveSurveysToStorage(s)}},{key:"getSurveys",value:function(){var e,t=(e=this.persistence)===null||e===void 0?void 0:e.props[co];return t||[]}},{key:"getEventRegistry",value:function(){return this.eventRegistry}},{key:"_saveSurveysToStorage",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.register(y({},co,ln(new Set(e))))}}]),n}(),bh={icontains:function(n){return!!m&&m.location.href.toLowerCase().indexOf(n.toLowerCase())>-1},not_icontains:function(n){return!!m&&m.location.href.toLowerCase().indexOf(n.toLowerCase())===-1},regex:function(n){return!!m&&vu(m.location.href,n)},not_regex:function(n){return!!m&&!vu(m.location.href,n)},exact:function(n){return m?.location.href===n},is_not:function(n){return m?.location.href!==n}},wh=function(){function n(e){W(this,n),this.instance=e,this._surveyEventReceiver=null}return V(n,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,t=he?.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Mu(this.instance.persistence)),qn(this.instance.requestRouter.endpointFor("assets","/static/surveys.js"),function(i){if(i)return k.error("Could not load surveys script",i);he.extendPostHogWithSurveys(e.instance)}))}},{key:"getSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return e([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new Mu(this.instance.persistence));var r=this.instance.get_property(To);if(r&&!i)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(s){var o;if(s.statusCode!==200||!s.json)return e([]);var a=s.json.surveys||[],l=a.filter(function(c){var p,f,d,g,v,w;return((p=c.conditions)===null||p===void 0?void 0:p.events)&&((f=c.conditions)===null||f===void 0||(d=f.events)===null||d===void 0?void 0:d.values)&&((g=c.conditions)===null||g===void 0||(v=g.events)===null||v===void 0||(w=v.values)===null||w===void 0?void 0:w.length)>0});if(l.length>0&&!F(t.instance._addCaptureHook)){var u;(u=t._surveyEventReceiver)===null||u===void 0||u.register(l),t.instance._addCaptureHook(function(c){var p;(p=t._surveyEventReceiver)===null||p===void 0||p.on(c)})}return(o=t.instance.persistence)===null||o===void 0||o.register(y({},To,a)),e(a)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(r){var s,o=r.filter(function(u){return!(!u.start_date||u.end_date)}).filter(function(u){var c,p,f,d;if(!u.conditions)return!0;var g=(c=u.conditions)===null||c===void 0||!c.url||bh[(p=(f=u.conditions)===null||f===void 0?void 0:f.urlMatchType)!==null&&p!==void 0?p:"icontains"](u.conditions.url),v=(d=u.conditions)===null||d===void 0||!d.selector||R?.querySelector(u.conditions.selector);return g&&v}),a=(s=t._surveyEventReceiver)===null||s===void 0?void 0:s.getSurveys(),l=o.filter(function(u){var c,p,f,d,g;if(!u.linked_flag_key&&!u.targeting_flag_key&&!u.internal_targeting_flag_key)return!0;var v=!u.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(u.linked_flag_key),w=!u.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(u.targeting_flag_key),D=!u.internal_targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(u.internal_targeting_flag_key),A=!(!((c=u.conditions)===null||c===void 0)&&c.events&&(!((p=u.conditions)===null||p===void 0||(f=p.events)===null||f===void 0)&&f.values)&&((d=u.conditions)===null||d===void 0||(g=d.events)===null||g===void 0?void 0:g.values.length)>0)||a?.includes(u.id);return v&&w&&D&&A});return e(l)},i)}},{key:"getNextSurveyStep",value:function(e,t,i){var r,s=e.questions[t],o=t+1;if((r=s.branching)===null||r===void 0||!r.type)return t===e.questions.length-1?et.End:o;if(s.branching.type===et.End)return et.End;if(s.branching.type===et.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}else if(s.branching.type===et.ResponseBased){if(s.type===Kr.SingleChoice){var a,l,u=s.choices.indexOf("".concat(i));if((a=s.branching)!==null&&a!==void 0&&(l=a.responseValues)!==null&&l!==void 0&&l.hasOwnProperty(u)){var c=s.branching.responseValues[u];return Number.isInteger(c)?c:c===et.End?et.End:o}}else if(s.type===Kr.Rating){var p,f;if(typeof i!="number"||!Number.isInteger(i))throw new Error("The response type must be an integer");var d=function(v,w){if(w===3){if(v<1||v>3)throw new Error("The response must be in range 1-3");return v===1?"negative":v===2?"neutral":"positive"}if(w===5){if(v<1||v>5)throw new Error("The response must be in range 1-5");return v<=2?"negative":v===3?"neutral":"positive"}if(w===10){if(v<0||v>10)throw new Error("The response must be in range 0-10");return v<=6?"detractors":v<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 10")}(i,s.scale);if((p=s.branching)!==null&&p!==void 0&&(f=p.responseValues)!==null&&f!==void 0&&f.hasOwnProperty(d)){var g=s.branching.responseValues[d];return Number.isInteger(g)?g:g===et.End?et.End:o}}return o}return console.warn("Falling back to next question index due to unexpected branching type"),o}}]),n}(),xh=function(){function n(e){var t,i,r=this;W(this,n),y(this,"serverLimits",{}),y(this,"lastEventRateLimited",!1),y(this,"checkForLimiting",function(s){var o=s.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(function(a){k.info("[RateLimiter] ".concat(a||"events"," is quota limited.")),r.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void k.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(a?.message,'"'),{text:o})}}),this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)===null||t===void 0?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)===null||i===void 0?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return V(n,[{key:"clientRateLimitContext",value:function(){var e,t,i,r=arguments.length>0&&arguments[0]!==void 0&&arguments[0],s=new Date().getTime(),o=(e=(t=this.instance.persistence)===null||t===void 0?void 0:t.get_property(Po))!==null&&e!==void 0?e:{tokens:this.captureEventsBurstLimit,last:s};o.tokens+=(s-o.last)/1e3*this.captureEventsPerSecond,o.last=s,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var a=o.tokens<1;return a||r||(o.tokens=Math.max(0,o.tokens-1)),!a||this.lastEventRateLimited||r||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,(i=this.instance.persistence)===null||i===void 0||i.set_property(Po,o),{isRateLimited:a,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}]),n}(),kh=function(){return T({initialPathName:De?.pathname||"",referringDomain:be.referringDomain()},be.campaignParams())},Sh=function(){function n(e,t,i){var r=this;W(this,n),y(this,"_onSessionIdCallback",function(s){var o=r._getStoredProps();if(!o||o.sessionId!==s){var a={sessionId:s,props:r._sessionSourceParamGenerator()};r._persistence.register(y({},Ro,a))}}),this._sessionIdManager=e,this._persistence=t,this._sessionSourceParamGenerator=i||kh,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return V(n,[{key:"_getStoredProps",value:function(){return this._persistence.props[Ro]}},{key:"getSessionProps",value:function(){var e,t=(e=this._getStoredProps())===null||e===void 0?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}]),n}(),Eh=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Du=function(n,e){if(!n)return!1;var t=n.toLowerCase();return Eh.concat(e||[]).some(function(i){var r=i.toLowerCase();return t.indexOf(r)!==-1})},Sc=function(){function n(){W(this,n),this.clicks=[]}return V(n,[{key:"isRageClick",value:function(e,t,i){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&i-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}]),n}();function Lu(n){var e;return n.id===Mo||!((e=n.closest)===null||e===void 0||!e.call(n,"#"+Mo))}var $h=function(){function n(e){var t;W(this,n),y(this,"rageclicks",new Sc),y(this,"_enabledServerSide",!1),y(this,"_initialized",!1),this.instance=e,this._enabledServerSide=!((t=this.instance.persistence)===null||t===void 0||!t.props[Co])}return V(n,[{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(k.info("[heatmaps] Heatmaps enabled, starting..."),this._setupListeners())}},{key:"isEnabled",get:function(){return F(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(y({},Co,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_setupListeners",value:function(){var e=this;m&&R&&(yt(R,"click",function(t){return e._onClick(t||m?.event)},!1,!0),yt(R,"mousemove",function(t){return e._onMouseMove(t||m?.event)},!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(a,l,u){for(var c=a;c&&!Bt(c,"body");){if(c===u)return!1;if(U(l,m?.getComputedStyle(c).position))return!0;c=hc(c)}return!1}(e.target,["fixed","sticky"],s);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var t;if(!Lu(e.target)){var i=this._getProperties(e,"click");(t=this.rageclicks)!==null&&t!==void 0&&t.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._capture(T(T({},i),{},{type:"rageclick"})),this._capture(i)}}},{key:"_onMouseMove",value:function(e){var t=this;Lu(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))}},{key:"_capture",value:function(e){if(m){var t=m.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}}]),n}(),Ch=function(){function n(e){var t=this;W(this,n),y(this,"_updateScrollData",function(){var i,r,s,o;t.context||(t.context={});var a=t.scrollElement(),l=t.scrollY(),u=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=l+(a?.clientHeight||0),p=a?.scrollHeight||0;t.context.lastScrollY=Math.ceil(l),t.context.maxScrollY=Math.max(l,(i=t.context.maxScrollY)!==null&&i!==void 0?i:0),t.context.maxScrollHeight=Math.max(u,(r=t.context.maxScrollHeight)!==null&&r!==void 0?r:0),t.context.lastContentY=c,t.context.maxContentY=Math.max(c,(s=t.context.maxContentY)!==null&&s!==void 0?s:0),t.context.maxContentHeight=Math.max(p,(o=t.context.maxContentHeight)!==null&&o!==void 0?o:0)}),this.instance=e}return V(n,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){m?.addEventListener("scroll",this._updateScrollData,!0),m?.addEventListener("scrollend",this._updateScrollData,!0),m?.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return m?.document.documentElement;var e,t=rt(de(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var i=e.value,r=m?.document.querySelector(i);if(r)return r}}catch(s){t.e(s)}finally{t.f()}}},{key:"scrollY",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return m&&(m.scrollY||m.pageYOffset||m.document.documentElement.scrollTop)||0}},{key:"scrollX",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return m&&(m.scrollX||m.pageXOffset||m.document.documentElement.scrollLeft)||0}}]),n}(),Ah=function(){function n(){W(this,n),y(this,"events",{}),this.events={}}return V(n,[{key:"on",value:function(e,t){var i=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){i.events[e]=i.events[e].filter(function(r){return r!==t})}}},{key:"emit",value:function(e,t){var i,r=rt(this.events[e]||[]);try{for(r.s();!(i=r.n()).done;)(0,i.value)(t)}catch(a){r.e(a)}finally{r.f()}var s,o=rt(this.events["*"]||[]);try{for(o.s();!(s=o.n()).done;)(0,s.value)(e,t)}catch(a){o.e(a)}finally{o.f()}}}]),n}(),bo="$copy_autocapture";function wo(n,e){return e.length>n?e.slice(0,n)+"...":e}var Nt,Ih=function(){function n(e){W(this,n),y(this,"_initialized",!1),y(this,"_isDisabledServerSide",null),y(this,"rageclicks",new Sc),y(this,"_elementsChainAsString",!1),this.instance=e}return V(n,[{key:"config",get:function(){var e,t=nt(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=(e=t.url_allowlist)===null||e===void 0?void 0:e.map(function(i){return new RegExp(i)}),t}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(m&&R){var t=function(r){r=r||m?.event;try{e._captureEvent(r)}catch(s){k.error("Failed to capture event",s)}},i=function(r){r=r||m?.event,e._captureEvent(r,bo)};yt(R,"submit",t,!1,!0),yt(R,"change",t,!1,!0),yt(R,"click",t,!1,!0),this.config.capture_copied_text&&(yt(R,"copy",i,!1,!0),yt(R,"cut",i,!1,!0))}}else k.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(y({},su,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"isEnabled",get:function(){var e,t,i=(e=this.instance.persistence)===null||e===void 0?void 0:e.props[su],r=this._isDisabledServerSide;if(wt(r)&&!Lr(i)&&!this.instance.config.advanced_disable_decide)return!1;var s=(t=this._isDisabledServerSide)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!s}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Ko(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!qo(e))return{};var t={};return Y(e.attributes,function(i){if(i.name&&i.name.indexOf("data-ph-capture-attribute")===0){var r=i.name.replace("data-ph-capture-attribute-",""),s=i.value;r&&s&&jn(s)&&(t[r]=s)}}),t}},{key:"_getPropertiesFromElement",value:function(e,t,i){var r,s=e.tagName.toLowerCase(),o={tag_name:s};jo.indexOf(s)>-1&&!i&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?o.$el_text=wo(1024,xu(e)):o.$el_text=wo(1024,Gr(e)));var a=Vr(e);a.length>0&&(o.classes=a.filter(function(f){return f!==""}));var l=(r=this.config)===null||r===void 0?void 0:r.element_attribute_ignorelist;Y(e.attributes,function(f){var d;if((!dc(e)||["name","id","class","aria-label"].indexOf(f.name)!==-1)&&(l==null||!l.includes(f.name))&&!t&&jn(f.value)&&(d=f.name,!Pe(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var g=f.value;f.name==="class"&&(g=Yo(g).join(" ")),o["attr__"+f.name]=wo(1024,g)}});for(var u=1,c=1,p=e;p=this._previousElementSibling(p);)u++,p.tagName===e.tagName&&c++;return o.nth_child=u,o.nth_of_type=c,o}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){return F(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}},{key:"_captureEvent",value:function(e){var t=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,s=this._getEventTarget(e);pc(s)&&(s=s.parentNode||null),i==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,"$rageclick");var o=i===bo;if(s&&Ff(s,e,this.config,o,o?["copy","cut"]:void 0)){for(var a,l,u=[s],c=s;c.parentNode&&!Bt(c,"body");)fc(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var p,f,d=[],g={},v=!1;if(Y(u,function(E){var ie=qo(E);E.tagName.toLowerCase()==="a"&&(p=E.getAttribute("href"),p=ie&&jn(p)&&p),U(Vr(E),"ph-no-capture")&&(v=!0),d.push(t._getPropertiesFromElement(E,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var Z=t._getAugmentPropertiesFromElement(E);Re(g,Z)}),this.instance.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?d[0].$el_text=xu(s):d[0].$el_text=Gr(s)),p){var w,D;d[0].attr__href=p;var A=(w=Ai(p))===null||w===void 0?void 0:w.host,M=m==null||(D=m.location)===null||D===void 0?void 0:D.host;A&&M&&A!==M&&(f=p)}if(v)return!1;var q=Re(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:jf(d)}:{$elements:d},(a=d[0])!==null&&a!==void 0&&a.$el_text?{$el_text:(l=d[0])===null||l===void 0?void 0:l.$el_text}:{},f&&e.type==="click"?{$external_click_url:f}:{},g);if(i===bo){var H,X=cc(m==null||(H=m.getSelection())===null||H===void 0?void 0:H.toString()),J=e.type||"clipboard";if(!X)return!1;q.$selected_content=X,q.$copy_type=J}return this.instance.capture(i,q),!0}}}},{key:"isBrowserSupported",value:function(){return it(R?.querySelectorAll)}}]),n}(),Th=function(){function n(e){var t=this;W(this,n),y(this,"_restoreXHRPatch",void 0),y(this,"_restoreFetchPatch",void 0),y(this,"_startCapturing",function(){F(t._restoreXHRPatch)&&he.postHogTracingHeadersPatchFns._patchXHR(t.instance.sessionManager),F(t._restoreFetchPatch)&&he.postHogTracingHeadersPatchFns._patchFetch(t.instance.sessionManager)}),this.instance=e}return V(n,[{key:"_loadScript",value:function(e){he.postHogTracingHeadersPatchFns&&e(),qn(this.instance.requestRouter.endpointFor("assets","/static/tracing-headers.js?v=".concat(jt.LIB_VERSION)),function(t){t&&k.error("[TRACING-HEADERS] failed to load script",t),e()})}},{key:"startIfEnabledOrStop",value:function(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((e=this._restoreXHRPatch)===null||e===void 0||e.call(this),(t=this._restoreFetchPatch)===null||t===void 0||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}]),n}();(function(n){n[n.PENDING=-1]="PENDING",n[n.DENIED=0]="DENIED",n[n.GRANTED=1]="GRANTED"})(Nt||(Nt={}));var Rh=function(){function n(e){W(this,n),this.instance=e}return V(n,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?Nt.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===Nt.DENIED||this.consent===Nt.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return e==="1"?Nt.GRANTED:e==="0"?Nt.DENIED:Nt.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage=e==="localStorage"?fe:bt;var t=e==="localStorage"?bt:fe;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(t.get(this.storageKey)==="1"),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!Vu([_t?.doNotTrack,_t?.msDoNotTrack,he.doNotTrack],function(e){return U([!0,1,"1","yes"],e)})}}]),n}(),Ri={},Nu=function(){},On="posthog",Ec=!ph&&ae?.indexOf("MSIE")===-1&&ae?.indexOf("Mozilla")===-1,ju=function(){var n,e,t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(e=R?.location,t=e?.hostname,!!Pe(t)&&t.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:Nu,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:De&&Pe(De?.search)&&De.search.indexOf("__posthog_debug=true")!==-1||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(m==null||(n=m.location)===null||n===void 0?void 0:n.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:function(i){var r="Bad HTTP status: "+i.statusCode+" "+i.text;k.error(r)},get_device_id:function(i){return i},_onCapture:Nu,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},qu=function(n){var e={};F(n.process_person)||(e.person_profiles=n.process_person),F(n.xhr_headers)||(e.request_headers=n.xhr_headers),F(n.cookie_name)||(e.persistence_name=n.cookie_name),F(n.disable_cookie)||(e.disable_persistence=n.disable_cookie);var t=Re({},e,n);return de(n.property_blacklist)&&(F(n.property_denylist)?t.property_denylist=n.property_blacklist:de(n.property_denylist)?t.property_denylist=[].concat(ln(n.property_blacklist),ln(n.property_denylist)):k.error("Invalid value for property_denylist config: "+n.property_denylist)),t},Ph=function(){function n(){W(this,n),y(this,"__forceAllowLocalhost",!1)}return V(n,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){k.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),n}(),$c=function(){function n(){var e=this;W(this,n),y(this,"webPerformance",new Ph),y(this,"_debugEventEmitter",new Ah),this.config=ju(),this.decideEndpointWasHit=!1,this.SentryIntegration=mh,this.sentryIntegration=function(t){return function(i,r){var s=kc(i,r);return{name:xc,processEvent:function(o){return s(o)}}}(e,t)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new uf(this),this.toolbar=new eh(this),this.scrollManager=new Ch(this),this.pageViewManager=new _h(this),this.surveys=new wh(this),this.rateLimiter=new xh(this),this.requestRouter=new vh(this),this.consent=new Rh(this),this.people={set:function(t,i,r){var s=Pe(t)?y({},t,i):t;e.setPersonProperties(s),r?.({})},set_once:function(t,i,r){var s=Pe(t)?y({},t,i):t;e.setPersonProperties(void 0,s),r?.({})}},this.on("eventCaptured",function(t){return k.info("send",t)})}return V(n,[{key:"init",value:function(e,t,i){if(i&&i!==On){var r,s=(r=Ri[i])!==null&&r!==void 0?r:new n;return s._init(e,t,i),Ri[i]=s,Ri[On][i]=s,s}return this._init(e,t,i)}},{key:"_init",value:function(e){var t,i,r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(F(e)||function(w){return Pe(w)&&w.trim().length===0}(e))return k.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return k.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(Re({},ju(),qu(s),{name:o,token:e})),this.compression=s.disable_compression?void 0:tt.Base64,this.persistence=new go(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new go(T(T({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new th(function(w){return r._send_retriable_request(w)}),this._retryQueue=new dh(this),this.__request_queue=[],this.sessionManager=new gh(this.config,this.persistence),this.sessionPropsManager=new Sh(this.sessionManager,this.persistence),new Th(this).startIfEnabledOrStop(),this.sessionRecording=new Kf(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Ih(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new $h(this),this.heatmaps.startIfEnabled(),jt.DEBUG=jt.DEBUG||this.config.debug,this._sync_opt_out_with_persistence(),((t=s.bootstrap)===null||t===void 0?void 0:t.distinctID)!==void 0){var a,l,u=this.config.get_device_id(qt()),c=(a=s.bootstrap)!==null&&a!==void 0&&a.isIdentifiedID?u:s.bootstrap.distinctID;this.persistence.set_property(vt,(l=s.bootstrap)!==null&&l!==void 0&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:c})}if(this._hasBootstrappedFeatureFlags()){var p,f,d=Object.keys(((p=s.bootstrap)===null||p===void 0?void 0:p.featureFlags)||{}).filter(function(w){var D,A;return!((D=s.bootstrap)===null||D===void 0||(A=D.featureFlags)===null||A===void 0||!A[w])}).reduce(function(w,D){var A,M;return w[D]=((A=s.bootstrap)===null||A===void 0||(M=A.featureFlags)===null||M===void 0?void 0:M[D])||!1,w},{}),g=Object.keys(((f=s.bootstrap)===null||f===void 0?void 0:f.featureFlagPayloads)||{}).filter(function(w){return d[w]}).reduce(function(w,D){var A,M,q,H;return(A=s.bootstrap)!==null&&A!==void 0&&(M=A.featureFlagPayloads)!==null&&M!==void 0&&M[D]&&(w[D]=(q=s.bootstrap)===null||q===void 0||(H=q.featureFlagPayloads)===null||H===void 0?void 0:H[D]),w},{});this.featureFlags.receivedFeatureFlags({featureFlags:d,featureFlagPayloads:g})}if(!this.get_distinct_id()){var v=this.config.get_device_id(qt());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(vt,"anonymous")}return m==null||(i=m.addEventListener)===null||i===void 0||i.call(m,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?yh(this,function(){return r._loaded()}):this._loaded(),it(this.config._onCapture)&&this.on("eventCaptured",function(w){return r.config._onCapture(w.event,w)}),this}},{key:"_afterDecideResponse",value:function(e){var t,i,r,s,o;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=U(e.supportedCompression,tt.GZipJS)?tt.GZipJS:U(e.supportedCompression,tt.Base64)?tt.Base64:void 0),(t=e.analytics)!==null&&t!==void 0&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),(i=this.sessionRecording)===null||i===void 0||i.afterDecideResponse(e),(r=this.autocapture)===null||r===void 0||r.afterDecideResponse(e),(s=this.heatmaps)===null||s===void 0||s.afterDecideResponse(e),(o=this.surveys)===null||o===void 0||o.afterDecideResponse(e)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(i){k.critical("`loaded` function failed",i)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(function(){R&&e.capture("$pageview",{title:R.title},{send_instantly:!0})},1),t||(new Qf(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this._requestQueue)===null||e===void 0||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Dn(this.__request_queue,function(t){return e._send_retriable_request(t)}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(e=this._requestQueue)===null||e===void 0||e.unload(),(t=this._retryQueue)===null||t===void 0||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var t=this;this.__loaded&&(Ec?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Yr(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression=e.compression==="best-available"?this.compression:e.compression,function(i){var r,s,o,a=T({},i);a.timeout=a.timeout||6e4,a.url=Yr(a.url,{_:new Date().getTime().toString(),ver:jt.LIB_VERSION,compression:a.compression});var l=(r=a.transport)!==null&&r!==void 0?r:"XHR",u=(s=(o=Vu(Ti,function(c){return c.transport===l}))===null||o===void 0?void 0:o.method)!==null&&s!==void 0?s:Ti[0].method;if(!u)throw new Error("No available transport method");u(a)}(T(T({},e),{},{callback:function(i){var r,s,o;t.rateLimiter.checkForLimiting(i),i.statusCode>=400&&((s=(o=t.config).on_request_error)===null||s===void 0||s.call(o,i)),(r=e.callback)===null||r===void 0||r.call(e,i)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,i=this,r=[],s=[],o=[];Dn(e,function(l){l&&(t=l[0],de(t)?o.push(l):it(l)?l.call(i):de(l)&&t==="alias"?r.push(l):de(l)&&t.indexOf("capture")!==-1&&it(i[t])?o.push(l):s.push(l))});var a=function(l,u){Dn(l,function(c){if(de(c[0])){var p=u;Y(c,function(f){p=p[f[0]].apply(p,f.slice(1))})}else this[c[0]].apply(this,c.slice(1))},u)};a(r,this),a(s,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return((e=this.config.bootstrap)===null||e===void 0?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t,i){var r;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return k.uninitializedWarning("posthog.capture");if(!this.consent.isOptedOut())if(!F(e)&&Pe(e)){if(!ae||this.config.opt_out_useragent_filter||!Du(ae,this.config.custom_blocked_useragents)){var s=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o={uuid:qt(),event:e,properties:this._calculate_event_properties(e,t||{},i)};s&&(o.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),i?.$set&&(o.$set=i?.$set);var a=this._calculate_set_once_properties(i?.$set_once);a&&(o.$set_once=a),(o=of(o,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=i?.timestamp||new Date,F(i?.timestamp)||(o.properties.$event_time_override_provided=!0,o.properties.$event_time_override_system_time=new Date);var l=T(T({},o.properties.$set),o.$set);uo(l)||this.setPersonPropertiesForFlags(l),this._debugEventEmitter.emit("eventCaptured",o);var u={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:o,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this._send_retriable_request(u):this._requestQueue.enqueue(u),o}k.critical("This capture call is ignored due to client rate limiting.")}}else k.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.on("eventCaptured",function(t){return e(t.event)})}},{key:"_calculate_event_properties",value:function(e,t,i){if(!this.persistence||!this.sessionPersistence)return t;var r=this.persistence.remove_event_timer(e),s=T({},t);if(s.token=this.config.token,e==="$snapshot"){var o=T(T({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,s}var a=be.properties();if(this.sessionManager){var l=this.sessionManager.checkAndGetSessionAndWindowId(),u=l.sessionId,c=l.windowId;s.$session_id=u,s.$window_id=c}if(this.requestRouter.region===on.CUSTOM&&(s.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(e==="$pageview"||e==="$pageleave"||e==="$autocapture")){var p=this.sessionPropsManager.getSessionProps();s=Re(s,p)}if(!this.config.disable_scroll_properties){var f={};e==="$pageview"?f=this.pageViewManager.doPageView():e==="$pageleave"&&(f=this.pageViewManager.doPageLeave()),s=Re(s,f)}if(e==="$pageview"&&R&&(s.title=R.title),!F(r)){var d=new Date().getTime()-r;s.$duration=parseFloat((d/1e3).toFixed(3))}if(ae&&this.config.opt_out_useragent_filter&&(s.$browser_type=Du(ae,this.config.custom_blocked_useragents)?"bot":"browser"),(s=Re({},a,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),i==null||!i._noHeatmaps){var g,v=(g=this.heatmaps)===null||g===void 0?void 0:g.getAndClearBuffer();v&&(s.$heatmap_data=v)}de(this.config.property_denylist)?Y(this.config.property_denylist,function(D){delete s[D]}):k.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var w=this.config.sanitize_properties;return w&&(s=w(s,e)),s.$process_person_profile=this._hasPersonProcessing(),s}},{key:"_calculate_set_once_properties",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=Re({},this.persistence.get_initial_props(),e||{});return uo(t)?void 0:t}},{key:"register",value:function(e,t){var i;(i=this.persistence)===null||i===void 0||i.register(e,t)}},{key:"register_once",value:function(e,t,i){var r;(r=this.persistence)===null||r===void 0||r.register_once(e,t,i)}},{key:"register_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.register(e)}},{key:"unregister",value:function(e){var t;(t=this.persistence)===null||t===void 0||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;(t=this.sessionPersistence)===null||t===void 0||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(y({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"on",value:function(e,t){return this._debugEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,i;return(t=(i=this.sessionManager)===null||i===void 0?void 0:i.onSessionId(e))!==null&&t!==void 0?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"getNextSurveyStep",value:function(e,t,i){return this.surveys.getNextSurveyStep(e,t,i)}},{key:"identify",value:function(e,t,i){if(!this.__loaded||!this.persistence)return k.uninitializedWarning("posthog.identify");if(lt(e)&&(e=e.toString(),k.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))k.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var s=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}e!==r&&e!==this.get_property(Si)&&(this.unregister(Si),this.register({distinct_id:e}));var o=(this.persistence.get_property(vt)||"anonymous")==="anonymous";e!==r&&o?(this.persistence.set_property(vt,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(Br))}}else k.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,t,i){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:T(T({},r),{},y({},e,t))}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags(y({},e,i))),r[e]===t||i||this.reloadFeatureFlags()}}else k.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,i,r,s;if(!this.__loaded)return k.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");this.consent.reset(),(t=this.persistence)===null||t===void 0||t.clear(),(i=this.sessionPersistence)===null||i===void 0||i.clear(),(r=this.persistence)===null||r===void 0||r.set_property(vt,"anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var a=this.config.get_device_id(qt());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return(e=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionId,r=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(i));if(e!=null&&e.withTimestamp&&r){var o,a=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return s;var l=Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0);s+="?t=".concat(l)}return s}},{key:"alias",value:function(e,t){return e===this.get_property(Gu)?(k.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(F(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(Si,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(k.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var t,i,r,s,o=T({},this.config);nt(e)&&(Re(this.config,qu(e)),(t=this.persistence)===null||t===void 0||t.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new go(T(T({},this.config),{},{persistence:"sessionStorage"})),fe.is_supported()&&fe.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(jt.DEBUG=!0),(i=this.sessionRecording)===null||i===void 0||i.startIfEnabledOrStop(),(r=this.autocapture)===null||r===void 0||r.startIfEnabled(),(s=this.heatmaps)===null||s===void 0||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){if(e!=null&&e.sampling){var t,i,r=(t=this.sessionManager)===null||t===void 0?void 0:t.checkAndGetSessionAndWindowId();(i=this.persistence)===null||i===void 0||i.register(y({},Ci,!0)),k.info("Session recording started with sampling override for session: ",r?.sessionId)}this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!((e=this.sessionRecording)===null||e===void 0||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return(t=this.persistence)===null||t===void 0?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return(t=this.sessionPersistence)===null||t===void 0?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:On;return t!==On&&(t=On+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return((e=this.persistence)===null||e===void 0?void 0:e.get_property(vt))==="identified"||((t=this.sessionPersistence)===null||t===void 0?void 0:t.get_property(vt))==="identified"}},{key:"_hasPersonProcessing",value:function(){var e,t,i,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&uo(this.getGroups())&&((e=this.persistence)===null||e===void 0||(t=e.props)===null||t===void 0||!t[Si])&&((i=this.persistence)===null||i===void 0||(r=i.props)===null||r===void 0||!r[zr]))}},{key:"_shouldCapturePageleave",value:function(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return this.config.person_profiles==="never"?(k.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(zr,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,i,r,s=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,a=this.config.disable_persistence||s&&!!o;((e=this.persistence)===null||e===void 0?void 0:e.disabled)!==a&&((i=this.persistence)===null||i===void 0||i.set_disabled(a)),((t=this.sessionPersistence)===null||t===void 0?void 0:t.disabled)!==a&&((r=this.sessionPersistence)===null||r===void 0||r.set_disabled(a))}},{key:"opt_in_capturing",value:function(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(F(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e?.captureEventName)!==null&&t!==void 0?t:"$opt_in",e?.captureProperties,{send_instantly:!0})}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"debug",value:function(e){e===!1?(m?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(m?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),n}();(function(n,e){for(var t=0;t<e.length;t++)n.prototype[e[t]]=sf(n.prototype[e[t]])})($c,["identify"]);var Uu,Cc=(Uu=Ri[On]=new $c,function(){function n(){n.done||(n.done=!0,Ec=!1,Y(Ri,function(e){e._dom_loaded()}))}R!=null&&R.addEventListener&&(R.readyState==="complete"?n():R.addEventListener("DOMContentLoaded",n,!1)),m&&yt(m,"load",n,!0)}(),Uu);var Ac=Cc.init("phc_OTZ3wJ6VemgVupCRKS5Sbqb9Ks0JYe0hMYZPtLwl0nu",{api_host:"https://pheu.molin.ai",ui_host:"https://eu.posthog.com",secure_cookie:document.location.protocol==="https:",persistence:"cookie",autocapture:!1,rageclick:!1,capture_pageview:!1,capture_pageleave:!1,disable_session_recording:!0,advanced_disable_decide:!0},"MolinShopAI");function ue(n,e){if(!Ac)throw new Error("Failed to initialize PostHog");Ac.capture(n,e)}var ts,Ni,ns,zt,Tc,es,is=class is extends z(j){constructor(){super();_(this,zt);_(this,ts,new Mt(this,{onError:console.error}));_(this,Ni);_(this,ns,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),ue("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>ue("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>ue("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>ue("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>ue("ShopAssistant: user clicked link",t),onUserSentInput:t=>ue("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1}get config(){return h(this,Ni)||h(this,ts).data}render(){return this.config?O`
317
321
  <!-- embed our chat component forwarding props -->
318
- <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${d(this,Zr)}" ?show-close="${this.showClose}" @mw:close-click="${R(this,Bt,Sc)}">
322
+ <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${h(this,ns)}" ?show-close="${this.showClose}" @mw:close-click="${$(this,zt,Tc)}">
319
323
  <slot name="banner" slot="banner"></slot>
320
324
  </mw-chat>
321
- `:L}injectConfig(t){A(this,Di,t),this.requestUpdate()}reloadConfig(){d(this,Bt,Kr)?.reloadConfig()}get conversationId(){return d(this,Bt,Kr)?.conversationId??""}get messages(){return d(this,Bt,Kr)?.messages??[]}};Qr=new WeakMap,Di=new WeakMap,Zr=new WeakMap,Bt=new WeakSet,Sc=function(){this.dispatchEvent(new es.CloseClickEvent)},Kr=function(){return this.renderRoot.querySelector("mw-chat")||null},S(es,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"}});var Mi=es;customElements.define("molin-shop-ai-chat",Mi);var Ko;Mi.CloseClickEvent=(Ko=class extends CustomEvent{constructor(e={}){super(Mi.CloseClickEvent.type,{...e})}},S(Ko,"type","mw:close-click"),Ko);var Ec=n=>n??L;var ns,ts=class extends z(N){constructor(){super();b(this,ns,new Ft(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return d(this,ns).data}render(){return this.config?O`
325
+ `:L}injectConfig(t){C(this,Ni,t),this.requestUpdate()}reloadConfig(){h(this,zt,es)?.reloadConfig()}get conversationId(){return h(this,zt,es)?.conversationId??""}get messages(){return h(this,zt,es)?.messages??[]}};ts=new WeakMap,Ni=new WeakMap,ns=new WeakMap,zt=new WeakSet,Tc=function(){this.dispatchEvent(new is.CloseClickEvent)},es=function(){return this.renderRoot.querySelector("mw-chat")||null},S(is,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"}});var Li=is;customElements.define("molin-shop-ai-chat",Li);var ea;Li.CloseClickEvent=(ea=class extends CustomEvent{constructor(e={}){super(Li.CloseClickEvent.type,{...e})}},S(ea,"type","mw:close-click"),ea);var Rc=n=>n??L;var ss,rs=class extends z(j){constructor(){super();_(this,ss,new Mt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return h(this,ss).data}render(){return this.config?O`
322
326
  <!-- embed our bubble component forwarding props -->
323
327
  <!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
324
- <mw-bubble state="${this.state}" src="${Ec(this.config?.bubble?.imageUrl)}"></mw-bubble>
325
- `:L}};ns=new WeakMap,S(ts,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",ts);var rs,Un,Bn,ln,Li,ji,is=class{constructor(e,t,i,r=window.history){b(this,rs);b(this,Un);b(this,Bn);b(this,ln);b(this,Li,!1);b(this,ji,()=>{d(this,Un).test(window.location.pathname)&&d(this,Bn).navigated()});A(this,rs,e),A(this,Un,t),A(this,Bn,i),A(this,ln,r),e.addController(this)}hostConnected(){window.addEventListener("pageshow",d(this,ji));let e=d(this,ln).pushState;d(this,ln).pushState=(...t)=>{if(e.call(d(this,ln),...t),!d(this,Li))try{let i=new URL(t[2],window.location.origin);d(this,Un).test(i.pathname)&&d(this,Bn).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",d(this,ji)),A(this,Li,!0)}};rs=new WeakMap,Un=new WeakMap,Bn=new WeakMap,ln=new WeakMap,Li=new WeakMap,ji=new WeakMap;function ss(n,e=""){return Object.entries(n).filter(([t,i])=>i).map(([t,i])=>`${e}${t}-[${i}]`).join(" ")}var as,Qo,ge,ls,Oe,Ni,$c,Cc,Ac,Ic,os=class extends z(N){constructor(){super();b(this,Oe);b(this,as,new Ft(this,{onError:console.error}));b(this,Qo,new is(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=d(this,Oe,$c);t&&ue("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));b(this,ge,!1);b(this,ls,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),ue("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>ue("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>ue("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>ue("ShopAssistant: user canceled streaming",t),onUserClickedLink:t=>ue("ShopAssistant: user clicked link",t),onUserSentInput:t=>ue("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this._dialogAlreadyShown=!1}get config(){return d(this,as).data}render(){if(!this.config)return L;let t=[ss(this.config.bubble.position),ss(this.config.bubble.mobilePosition||{},"max-sm:")].join(" "),i=ss(this.config.bubble.position),r={bottom:"72px"},s=Object.entries(this.config.bubble.position).filter(([a,l])=>l).map(([a,l])=>{let u=`sm:${a}-[calc(${[r[a],l].filter(c=>!!c).join("+")})]`;return a==="left"&&(u+=" sm:right-auto"),a==="right"&&(u+=" sm:left-auto"),u}).join(" "),o=s;return this.config.hidden?L:O`
326
- <mw-bubble class="${t} fixed z-[2147483647]" @click=${R(this,Oe,Ac)} state="${d(this,ge)?"close":"open"}" src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
328
+ <mw-bubble state="${this.state}" src="${Rc(this.config?.bubble?.imageUrl)}"></mw-bubble>
329
+ `:L}};ss=new WeakMap,S(rs,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.define("molin-shop-ai-launcher",rs);var as,zn,Hn,cn,ji,qi,os=class{constructor(e,t,i,r=window.history){_(this,as);_(this,zn);_(this,Hn);_(this,cn);_(this,ji,!1);_(this,qi,()=>{h(this,zn).test(window.location.pathname)&&h(this,Hn).navigated()});C(this,as,e),C(this,zn,t),C(this,Hn,i),C(this,cn,r),e.addController(this)}hostConnected(){window.addEventListener("pageshow",h(this,qi));let e=h(this,cn).pushState;h(this,cn).pushState=(...t)=>{if(e.call(h(this,cn),...t),!h(this,ji))try{let i=new URL(t[2],window.location.origin);h(this,zn).test(i.pathname)&&h(this,Hn).navigated()}catch{}}}hostDisconnected(){window.removeEventListener("pageshow",h(this,qi)),C(this,ji,!0)}};as=new WeakMap,zn=new WeakMap,Hn=new WeakMap,cn=new WeakMap,ji=new WeakMap,qi=new WeakMap;var Ht,pt,na,Ui,ta=class{constructor(e=window.localStorage){_(this,pt);_(this,Ht);C(this,Ht,e)}setex(e,t,i){return h(this,Ht).setItem(e,$(this,pt,Ui).call(this,{value:$(this,pt,Ui).call(this,t),expiresAt:Date.now()+i*1e3})||"")}set(e,t){return h(this,Ht).setItem(e,$(this,pt,Ui).call(this,{value:$(this,pt,Ui).call(this,t)})||"")}get(e){let t=h(this,Ht).getItem(e);if(!t)return;let i=$(this,pt,na).call(this,t);if(i){if(i.expiresAt&&i.expiresAt<Date.now()){h(this,Ht).removeItem(e);return}return $(this,pt,na).call(this,i.value)}}};Ht=new WeakMap,pt=new WeakSet,na=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},Ui=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var ia=new ta;function ls(n,e=""){return Object.entries(n).filter(([t,i])=>i).map(([t,i])=>`${e}${t}-[${i}]`).join(" ")}var Pc="molin-shop-ai-last-url",cs,ra,ge,ps,Se,Bi,Oc,Fc,Mc,Dc,Lc,us=class extends z(j){constructor(){super();_(this,Se);_(this,cs,new Mt(this,{onError:console.error}));_(this,ra,new os(this,/checkout|order|thank-you|thank_you/i,{navigated:()=>{let t=h(this,Se,Oc);t&&ue("ShopAssistant: user visited checkout page",{widgetId:this.widgetId,conversationId:t.conversationId,hasSentMessage:t.messages.length>0})}}));_(this,ge,!1);_(this,ps,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),ue("ShopAssistant: error",t)},onNewMessageStartedStreaming:t=>ue("ShopAssistant: user received bot message (streaming started)",t),onMessageEndedStreaming:t=>ue("ShopAssistant: user received bot message (streaming ended)",t),onUserCanceledStreaming:t=>ue("ShopAssistant: user canceled streaming",t),onUserClickedLink:$(this,Se,Lc),onUserSentInput:t=>ue("ShopAssistant: user sent input",t)});this.cdn="https://widget.molin.ai",this.widgetId="",this._dialogAlreadyShown=!1}get config(){return h(this,cs).data}render(){if(!this.config)return L;let t=[ls(this.config.bubble.position),ls(this.config.bubble.mobilePosition||{},"max-sm:")].join(" "),i=ls(this.config.bubble.position),r={bottom:"72px"},s=Object.entries(this.config.bubble.position).filter(([a,l])=>l).map(([a,l])=>{let u=`sm:${a}-[calc(${[r[a],l].filter(c=>!!c).join("+")})]`;return a==="left"&&(u+=" sm:right-auto"),a==="right"&&(u+=" sm:left-auto"),u}).join(" "),o=s;return this.config.hidden?L:O`
330
+ <mw-bubble class="${t} fixed z-[2147483647]" @click=${$(this,Se,Mc)} state="${h(this,ge)?"close":"open"}" src="${this.config.bubble?.imageUrl||""}"></mw-bubble>
327
331
 
328
332
  <!-- only load the component if enabled on any platform -->
329
333
  ${this.isPopupEnabled?O`<mw-popup
@@ -331,20 +335,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
331
335
  delay="${this.config.popup?.delayMs||0}"
332
336
  sound="https://molin.ai/sounds/widget/popup.aac"
333
337
  .content="${{desktop:{text:this.config.popup?.text||"Hello there. How can we help?"},mobile:{title:this.config.popup?.mobileTitleText||`Chat with ${this.config.title}`,text:this.config.popup?.text||"Hello there. How can we help?",button:this.config.popup?.mobileButtonText||`Chat with ${this.config.title}`,color:this.config.color,poweredBy:!this.config.removePoweredBy}}}"
334
- @mw:click="${R(this,Oe,Cc)}"></mw-popup>`:L}
338
+ @mw:click="${$(this,Se,Fc)}"></mw-popup>`:L}
335
339
 
336
340
  <!-- show "Try it out" if enabled (even if the chat window is showing) -->
337
341
  ${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?O`<mw-try-it-out class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}" position="${i}" text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:L}
338
342
 
339
343
  <!-- On first render, do not render the dialog, so it does not connect to backend. Once it's rendered once, it's never removed from the DOM. -->
340
344
  ${this._dialogAlreadyShown?O`
341
- <div class="${d(this,ge)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${s} fixed inset-0 z-[2147483647] overflow-hidden bg-white font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:top-auto sm:h-4/5 sm:max-h-[800px] sm:w-[calc(100dvh*0.45)] sm:min-w-[300px] sm:max-w-[400px] sm:rounded-2xl 2xl:max-w-[420px]">
342
- <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${d(this,ls)}" ?show-close="${!0}" @mw:close-click="${R(this,Oe,Ic)}">
345
+ <div class="${h(this,ge)?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${s} fixed inset-0 z-[2147483647] overflow-hidden bg-white font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:top-auto sm:h-4/5 sm:max-h-[800px] sm:w-[calc(100dvh*0.45)] sm:min-w-[300px] sm:max-w-[400px] sm:rounded-2xl 2xl:max-w-[420px]">
346
+ <mw-chat .config="${{...this.config,widgetId:this.widgetId}}" .callbacks="${h(this,ps)}" ?show-close="${!0}" @mw:close-click="${$(this,Se,Dc)}">
343
347
  <slot name="banner" slot="banner"></slot>
344
348
  </mw-chat>
345
349
  </div>
346
350
  `:L}
347
- `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){d(this,ge)&&d(this,Oe,Ni)?.hide()}openChat(){d(this,ge)||(A(this,ge,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),d(this,Oe,Ni)?.hide(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:d(this,ge)?"open":"close"}))}closeChat(){d(this,ge)&&(A(this,ge,!1),this.requestUpdate(),d(this,Oe,Ni)?.hide(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:d(this,ge)?"open":"close"}))}};as=new WeakMap,Qo=new WeakMap,ge=new WeakMap,ls=new WeakMap,Oe=new WeakSet,Ni=function(){return this.renderRoot.querySelector("mw-popup")||null},$c=function(){return this.renderRoot.querySelector("mw-chat")||null},Cc=function(){A(this,ge,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:d(this,ge)?"open":"close"})},Ac=function(){A(this,ge,!d(this,ge)),this._dialogAlreadyShown=!0,this.requestUpdate(),d(this,Oe,Ni)?.hide(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:d(this,ge)?"open":"close"})},Ic=function(){A(this,ge,!1),this.requestUpdate(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:d(this,ge)?"open":"close"})},S(os,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},_dialogAlreadyShown:{type:Boolean,state:!0}});customElements.define("molin-shop-ai",os);
351
+ `}get isPopupEnabled(){return window.matchMedia("(min-width: 640px)").matches?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){h(this,ge)&&h(this,Se,Bi)?.hide()}firstUpdated(){let t=ia.get(Pc);t?.url&&new URL(t.url).pathname===window.location.pathname&&this.openChat()}openChat(){h(this,ge)||(C(this,ge,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),h(this,Se,Bi)?.hide(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:h(this,ge)?"open":"close"}))}closeChat(){h(this,ge)&&(C(this,ge,!1),this.requestUpdate(),h(this,Se,Bi)?.hide(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:h(this,ge)?"open":"close"}))}};cs=new WeakMap,ra=new WeakMap,ge=new WeakMap,ps=new WeakMap,Se=new WeakSet,Bi=function(){return this.renderRoot.querySelector("mw-popup")||null},Oc=function(){return this.renderRoot.querySelector("mw-chat")||null},Fc=function(){C(this,ge,!0),this._dialogAlreadyShown=!0,this.requestUpdate(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:h(this,ge)?"open":"close"})},Mc=function(){C(this,ge,!h(this,ge)),this._dialogAlreadyShown=!0,this.requestUpdate(),h(this,Se,Bi)?.hide(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:h(this,ge)?"open":"close"})},Dc=function(){C(this,ge,!1),this.requestUpdate(),ue("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:h(this,ge)?"open":"close"})},Lc=function(t){ue("ShopAssistant: user clicked link",t);let i=new URL(t.url);if(i.hostname===window.location.hostname){let r={url:i.toString()};ia.setex(Pc,r,30)}},S(us,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},_dialogAlreadyShown:{type:Boolean,state:!0}});customElements.define("molin-shop-ai",us);
348
352
  /*! Bundled license information:
349
353
 
350
354
  @lit/reactive-element/css-tag.js: