PageSourceSearch

https://www.poper.ai/_next/static/chunks/0au-w-f1m..2c.js

js poper.ai collected 2026-10-02 02:31:06 UTC 375,931 bytes, 2 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,918031,e=>{e.v({className:"archivo_black_ba83495b-module__Ah5NvW__className"})},739616,e=>{e.v({className:"inter_ff246574-module__kPUeMW__className",variable:"inter_ff246574-module__kPUeMW__variable"})},726487,(e,t,i)=>{var r=Math.ceil,s=Math.max;t.exports=function(e,t,i,n){for(var o=-1,a=s(r((t-e)/(i||1)),0),l=Array(a);a--;)l[n?a:++o]=e,e+=i;return l}},432939,(e,t,i)=>{var r=e.r(96380),s=e.r(443240),n=e.r(258211),o=e.r(424);t.exports=function(e,t,i){if(!o(i))return!1;var a=typeof t;return("number"==a?!!(s(i)&&n(t,i.length)):"string"==a&&t in i)&&r(i[t],e)}},752234,(e,t,i)=>{var r=/\s/;t.exports=function(e){for(var t=e.length;t--&&r.test(e.charAt(t)););return t}},393556,(e,t,i)=>{var r=e.r(752234),s=/^\s+/;t.exports=function(e){return e?e.slice(0,r(e)+1).replace(s,""):e}},722875,(e,t,i)=>{var r=e.r(250799),s=e.r(678310);t.exports=function(e){return"symbol"==typeof e||s(e)&&"[object Symbol]"==r(e)}},938740,(e,t,i)=>{var r=e.r(393556),s=e.r(424),n=e.r(722875),o=0/0,a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,h=parseInt;t.exports=function(e){if("number"==typeof e)return e;if(n(e))return o;if(s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var i=l.test(e);return i||u.test(e)?h(e.slice(2),i?2:8):a.test(e)?o:+e}},357229,(e,t,i)=>{var r=e.r(938740),s=1/0;t.exports=function(e){return e?(e=r(e))===s||e===-s?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}},519363,(e,t,i)=>{var r=e.r(726487),s=e.r(432939),n=e.r(357229);t.exports=function(e){return function(t,i,o){return o&&"number"!=typeof o&&s(t,i,o)&&(i=o=void 0),t=n(t),void 0===i?(i=t,t=0):i=n(i),o=void 0===o?t<i?1:-1:n(o),r(t,i,o,e)}}},835240,(e,t,i)=>{t.exports=e.r(519363)()},211967,(e,t,i)=>{"use strict";var r="function"==typeof Symbol&&Symbol.for,s=r?Symbol.for("react.element"):60103,n=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,h=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,g=r?Symbol.for("react.suspense_list"):60120,v=r?Symbol.for("react.memo"):60115,_=r?Symbol.for("react.lazy"):60116,m=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case s:switch(e=e.type){case c:case d:case o:case l:case a:case f:return e;default:switch(e=e&&e.$$typeof){case h:case p:case _:case v:case u:return e;default:return t}}case n:return t}}}function k(e){return x(e)===d}i.AsyncMode=c,i.ConcurrentMode=d,i.ContextConsumer=h,i.ContextProvider=u,i.Element=s,i.ForwardRef=p,i.Fragment=o,i.Lazy=_,i.Memo=v,i.Portal=n,i.Profiler=l,i.StrictMode=a,i.Suspense=f,i.isAsyncMode=function(e){return k(e)||x(e)===c},i.isConcurrentMode=k,i.isContextConsumer=function(e){return x(e)===h},i.isContextProvider=function(e){return x(e)===u},i.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===s},i.isForwardRef=function(e){return x(e)===p},i.isFragment=function(e){return x(e)===o},i.isLazy=function(e){return x(e)===_},i.isMemo=function(e){return x(e)===v},i.isPortal=function(e){return x(e)===n},i.isProfiler=function(e){return x(e)===l},i.isStrictMode=function(e){return x(e)===a},i.isSuspense=function(e){return x(e)===f},i.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===l||e===a||e===f||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===_||e.$$typeof===v||e.$$typeof===u||e.$$typeof===h||e.$$typeof===p||e.$$typeof===y||e.$$typeof===b||e.$$typeof===w||e.$$typeof===m)},i.typeOf=x},374231,(e,t,i)=>{"use strict";t.exports=e.r(211967)},6800,(e,t,i)=>{"use strict";var r=e.r(374231),s={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return r.isMemo(e)?o:a[e.$$typeof]||s}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=o;var u=Object.defineProperty,h=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;
1t.exports=function e(t,i,r){if("string"!=typeof i){if(f){var s=p(i);s&&s!==f&&e(t,s,r)}var o=h(i);c&&(o=o.concat(c(i)));for(var a=l(t),g=l(i),v=0;v<o.length;++v){var _=o[v];if(!n[_]&&!(r&&r[_])&&!(g&&g[_])&&!(a&&a[_])){var m=d(i,_);try{u(t,_,m)}catch(e){}}}}return t}},256450,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=function(e){return e.displayName||e.name||("string"==typeof e&&e.length>0?e:"Unknown")}},437045,(e,t,i)=>{var r=e.r(357229);t.exports=function(e){var t=r(e),i=t%1;return t==t?i?t-i:t:0}},998703,(e,t,i)=>{t.exports=function(e,t){for(var i=-1,r=null==e?0:e.length,s=Array(r);++i<r;)s[i]=t(e[i],i,e);return s}},96604,(e,t,i)=>{var r=e.r(689358),s=e.r(998703),n=e.r(378704),o=e.r(722875),a=1/0,l=r?r.prototype:void 0,u=l?l.toString:void 0;t.exports=function e(t){if("string"==typeof t)return t;if(n(t))return s(t,e)+"";if(o(t))return u?u.call(t):"";var i=t+"";return"0"==i&&1/t==-a?"-0":i}},496607,(e,t,i)=>{var r=e.r(96604);t.exports=function(e){return null==e?"":r(e)}},845101,(e,t,i)=>{var r=e.r(326797),s=e.r(437045),n=e.r(938740),o=e.r(496607),a=r.isFinite,l=Math.min;t.exports=function(e){var t=Math[e];return function(e,i){if(e=n(e),(i=null==i?0:l(s(i),292))&&a(e)){var r=(o(e)+"e").split("e");return+((r=(o(t(r[0]+"e"+(+r[1]+i)))+"e").split("e"))[0]+"e"+(r[1]-i))}return t(e)}}},220284,(e,t,i)=>{t.exports=e.r(845101)("round")},800709,(e,t,i)=>{var r=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var i=arguments[e];for(var r in i)t[r]=i[r]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2}
1)+/g,decodeURIComponent)}return function i(r){function s(){}function n(t,i,n){if("u">typeof document){"number"==typeof(n=e({path:"/"},s.defaults,n)).expires&&(n.expires=new Date(new Date*1+864e5*n.expires)),n.expires=n.expires?n.expires.toUTCString():"";try{var o=JSON.stringify(i);/^[\{\[]/.test(o)&&(i=o)}catch(e){}i=r.write?r.write(i,t):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var l in n)n[l]&&(a+="; "+l,!0!==n[l]&&(a+="="+n[l].split(";")[0]));return document.cookie=t+"="+i+a}}function o(e,i){if("u">typeof document){for(var s={},n=document.cookie?document.cookie.split("; "):[],o=0;o<n.length;o++){var a=n[o].split("="),l=a.slice(1).join("=");i||'"'!==l.charAt(0)||(l=l.slice(1,-1));try{var u=t(a[0]);if(l=(r.read||r)(l,u)||t(l),i)try{l=JSON.parse(l)}catch(e){}if(s[u]=l,e===u)break}catch(e){}}return e?s[e]:s}}return s.set=n,s.get=function(e){return o(e,!1)},s.getJSON=function(e){return o(e,!0)},s.remove=function(t,i){n(t,"",e(i,{expires:-1}))},s.defaults={},s.withConverter=i,s}(function(){})};if("function"==typeof define&&define.amd){let s;void 0!==(s=r(e.r,i,t))&&e.v(s)}t.exports=r()},720409,(e,t,i)=>{var r,s;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t.exports=s={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 0xff00ff&s.rotl(e,8)|0xff00ff00&s.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=s.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],i=0,r=0;i<e.length;i++,r+=8)t[r>>>5]|=e[i]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],i=0;i<32*e.length;i+=8)t.push(e[i>>>5]>>>24-i%32&255);return t},bytesToHex:function(e){for(var t=[],i=0;i<e.length;i++)t.push((e[i]>>>4).toString(16)),t.push((15&e[i]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],i=0;i<e.length;i+=2)t.push(parseInt(e.substr(i,2),16));return t},bytesToBase64:function(e){for(var t=[],i=0;i<e.length;i+=3)for(var s=e[i]<<16|e[i+1]<<8|e[i+2],n=0;n<4;n++)8*i+6*n<=8*e.length?t.push(r.charAt(s>>>6*(3-n)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/ig,"");for(var t=[],i=0,s=0;i<e.length;s=++i%4)0!=s&&t.push((r.indexOf(e.charAt(i-1))&Math.pow(2,-2*s+8)-1)<<2*s|r.indexOf(e.charAt(i))>>>6-2*s);return t}}},21238,(e,t,i)=>{var r={utf8:{stringToBytes:function(e){return r.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(r.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],i=0;i<e.length;i++)t.push(255&e.charCodeAt(i));return t},bytesToString:function(e){for(var t=[],i=0;i<e.length;i++)t.push(String.fromCharCode(e[i]));return t.join("")}}};t.exports=r},470230,(e,t,i)=>{function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){var t;return null!=e&&(r(e)||"function"==typeof(t=e).readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))||!!e._isBuffer)}},917582,(e,t,i)=>{var r,s,n,o,a;r=e.r(720409),s=e.r(21238).utf8,n=e.r(470230),o=e.r(21238).bin,(a=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?o.stringToBytes(e):s.stringToBytes(e):n(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var i=r.bytesToWords(e),l=8*e.length,u=0x67452301,h=-0x10325477,c=-0x67452302,d=0x10325476,p=0;p<i.length;p++)i[p]=(i[p]<<8|i[p]>>>24)&0xff00ff|(i[p]<<24|i[p]>>>8)&0xff00ff00;i[l>>>5]|=128<<l%32,i[(l+64>>>9<<4)+14]=l;for(var f=a._ff,g=a._gg,v=a._hh,_=a._ii,p=0;p<i.length;p+=16){var m=u,y=h,b=c,w=d;u=f(u,h,c,d,i[p+0],7,-0x28955b88),d=f(d,u,h,c,i[p+1],12,-0x173848aa),c=f(c,d,u,h,i[p+2],17,0x242070db),h=f(h,c,d,u,i[p+3],22,-0x3e423112),u=f(u,h,c,d,i[p+4],7,-0xa83f051),d=f(d,u,h,c,i[p+5],12,0x4787c62a),c=f(c,d,u,h,i[p+6],17,-0x57cfb9ed),h=f(h,c,d,u,i[p+7],22,-0x2b96aff),u=f(u,h,c,d,i[p+8],7,0x698098d8),d=f(d,u,h,c,i[p+9],12,-0x74bb0851),c=f(c,d,u,h,i[p+10],17,-42063),h=f(h,c,d,u,i[p+11],22,-0x76a32842),u=f(u,h,c,d,i[p+12],7,0x6b901122),d=f(d,u,h,c,i[p+13],12,-0x2678e6d),c=f(c,d,u,h,i[p+14],17,-0x5986bc72),h=f(h,c,d,u,i[p+15],22,0x49b40821),u=g(u,h,c,d,i[p+1],5,-0x9e1da9e),d=g(d,u,h,c,i[p+6],9,-0x3fbf4cc0),c=g(c,d,u,h,i[p+11],14,0x265e5a51),h=g(h,c,d,u,i[p+0],20,-0x16493856),u=g(u,h,c,d,i[p+5],5,-0x29d0efa3),d=g(d,u,h,c,i[p+10],9,0x2441453),c=g(c,d,u,h,i[p+15],14,-0x275e197f),h=g(h,c,d,u,i[p+4],20,-0x182c0438),u=g(u,h,c,d,i[p+9],5,0x21e1cde6),d=g(d,u,h,c,i[p+14],9,-0x3cc8f82a),c=g(c,d,u,h,i[p+3],14,-0xb2af279),h=g(h,c,d,u,i[p+8],20,0x455a14ed),u=g(u,h,c,d,i[p+13],5,-0x561c16fb),d=g(d,u,h,c,i[p+2],9,-0x3105c08),c=g(c,d,u,h,i[p+7],14,0x676f02d9),h=g(h,c,d,u,i[p+12],20,-0x72d5b376),u=v(u,h,c,d,i[p+5],4,-378558),d=v(d,u,h,c,i[p+8],11,-0x788e097f),c=v(c,d,u,h,i[p+11],16,0x6d9d6122),h=v(h,c,d,u,i[p+14],23,-0x21ac7f4),u=v(u,h,c,d,i[p+1],4,-0x5b4115bc),d=v(d,u,h,c,i[p+4],11,0x4bdecfa9),c=v(c,d,u,h,i[p+7],16,-0x944b4a0),h=v(h,c,d,u,i[p+10],23,-0x41404390),u=v(u,h,c,d,i[p+13],4,0x289b7ec6),d=v(d,u,h,c,i[p+0],11,-0x155ed806),c=v(c,d,u,h,i[p+3],16,-0x2b10cf7b),h=v(h,c,d,u,i[p+6],23,0x4881d05
1),u=v(u,h,c,d,i[p+9],4,-0x262b2fc7),d=v(d,u,h,c,i[p+12],11,-0x1924661b),c=v(c,d,u,h,i[p+15],16,0x1fa27cf8),h=v(h,c,d,u,i[p+2],23,-0x3b53a99b),u=_(u,h,c,d,i[p+0],6,-0xbd6ddbc),d=_(d,u,h,c,i[p+7],10,0x432aff97),c=_(c,d,u,h,i[p+14],15,-0x546bdc59),h=_(h,c,d,u,i[p+5],21,-0x36c5fc7),u=_(u,h,c,d,i[p+12],6,0x655b59c3),d=_(d,u,h,c,i[p+3],10,-0x70f3336e),c=_(c,d,u,h,i[p+10],15,-1051523),h=_(h,c,d,u,i[p+1],21,-0x7a7ba22f),u=_(u,h,c,d,i[p+8],6,0x6fa87e4f),d=_(d,u,h,c,i[p+15],10,-0x1d31920),c=_(c,d,u,h,i[p+6],15,-0x5cfebcec),h=_(h,c,d,u,i[p+13],21,0x4e0811a1),u=_(u,h,c,d,i[p+4],6,-0x8ac817e),d=_(d,u,h,c,i[p+11],10,-0x42c50dcb),c=_(c,d,u,h,i[p+2],15,0x2ad7d2bb),h=_(h,c,d,u,i[p+9],21,-0x14792c6f),u=u+m>>>0,h=h+y>>>0,c=c+b>>>0,d=d+w>>>0}return r.endian([u,h,c,d])})._ff=function(e,t,i,r,s,n,o){var a=e+(t&i|~t&r)+(s>>>0)+o;return(a<<n|a>>>32-n)+t},a._gg=function(e,t,i,r,s,n,o){var a=e+(t&r|i&~r)+(s>>>0)+o;return(a<<n|a>>>32-n)+t},a._hh=function(e,t,i,r,s,n,o){var a=e+(t^i^r)+(s>>>0)+o;return(a<<n|a>>>32-n)+t},a._ii=function(e,t,i,r,s,n,o){var a=e+(i^(t|~r))+(s>>>0)+o;return(a<<n|a>>>32-n)+t},a._blocksize=16,a._digestsize=16,t.exports=function(e,t){if(null==e)throw Error("Illegal argument "+e);var i=r.wordsToBytes(a(e,t));return t&&t.asBytes?i:t&&t.asString?o.bytesToString(i):r.bytesToHex(i)}},444183,158221,926375,e=>{"use strict";let t,i,r,s,n,o,a,l;e.i(758915);var u,h,c,d,p,f,g,v,_,m,y,b,w=e.i(282916),x=e.i(227259),k=e.i(409113),S=e.i(597895),$=e.i(971997),E=e.i(549760),P=e.i(545812);function R({title:e=P.APP_NAME,description:t="",OGImage:i="/fav-icon/apple-touch-icon.png"}){return(0,w.jsxs)(E.default,{children:[(0,w.jsx)("link",{rel:"apple-touch-icon",sizes:"180x180",href:"/fav-icon/apple-touch-icon.png"}),(0,w.jsx)("link",{rel:"icon",type:"image/png",sizes:"32x32",href:"/fav-icon/favicon-32x32.png"}),(0,w.jsx)("link",{rel:"icon",type:"image/png",sizes:"16x16",href:"/fav-icon/favicon-16x16.png"}),(0,w.jsx)("link",{rel:"manifest",href:"/fav-icon/site.webmanifest"}),(0,w.jsx)("link",{rel:"shortcut icon",href:"/favicon.ico"}),(0,w.jsx)("meta",{name:"msapplication-TileColor",content:"#000000"}),(0,w.jsx)("meta",{name:"theme-color",content:"#000"}),(0,w.jsx)("meta",{name:"description",content:t})]})}var C=e.i(984637),O=e.i(918031);let M={className:O.default.className,style:{fontFamily:"'Archivo Black', 'Archivo Black Fallback'",fontWeight:400,fontStyle:"normal"}};null!=O.default.variable&&(M.variable=O.default.variable);var F=e.i(739616);let I={className:F.default.className,style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"}};null!=F.default.variable&&(I.variable=F.default.variable);var T=e.i(738117);e.i(26372),e.i(101700);var A=e.i(855665),L=e.i(676278),j=e.i(681913);function D(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)e[r]=i[r]}return e}e.i(505291),Object.freeze({wheel:{borderColor:"#000",borderWidth:1,debug:!1,image:null,isInteractive:!0,itemBackgroun
1dColors:["#fff"],itemLabelAlign:Object.freeze({left:"left",right:"right",center:"center"}).right,itemLabelBaselineOffset:0,itemLabelColors:["#000"],itemLabelFont:"sans-serif",itemLabelFontSizeMax:500,itemLabelRadius:.85,itemLabelRadiusMax:.2,itemLabelRotation:0,itemLabelStrokeColor:"#fff",itemLabelStrokeWidth:0,items:[],lineColor:"#000",lineWidth:1,pixelRatio:0,radius:.95,rotation:0,rotationResistance:-35,rotationSpeedMax:300,offset:{w:0,h:0},onCurrentIndexChange:null,onRest:null,onSpin:null,overlayImage:null,pointerAngle:0},item:{backgroundColor:null,image:null,imageOpacity:1,imageRadius:.5,imageRotation:0,imageScale:1,label:"",labelColor:null,value:null,weight:1}}),Object.freeze({pointerLineColor:"#ff00ff",labelOutlineColor:"#ff00ff",labelRadiusColor:"#00ff00",dragPointHue:300}),!function e(t,i){function r(e,r,s){if(!(typeof document>"u")){"number"==typeof(s=D({},i,s)).expires&&(s.expires=new Date(Date.now()+864e5*s.expires)),s.expires&&(s.expires=s.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var n="";for(var o in s)s[o]&&(n+="; "+o,!0!==s[o]&&(n+="="+s[o].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+n}}return Object.create({set:r,get:function(e){if(!(typeof document>"u"||arguments.length&&!e)){for(var i=document.cookie?document.cookie.split("; "):[],r={},s=0;s<i.length;s++){var n=i[s].split("="),o=n.slice(1).join("=");try{var a=decodeURIComponent(n[0]);if(r[a]=t.read(o,a),e===a)break}catch{}}return e?r[e]:r}},remove:function(e,t){r(e,"",D({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,D({},this.attributes,t))},withConverter:function(t){return e(D({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,e.i(835240);var N=e.i(700980),B=e.i(326179),q=e.i(6800);function z(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function U(){return(U=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}function H(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}e.i(256450);var W=function(e){return{context:e,withTheme:function(t){var i=k.default.forwardRef(function(i,r){return k.default.createElement(e.Consumer,null,function(e){return k.default.createElement(t,U({theme:e,ref:r},i))})});return(0,q.default)(i,t),i},useTheme:function(){return k.default.useContext(e)},ThemeProvider:function(t){function i(){for(var i,r=arguments.length,s=Array(r),n=0;n<r;n++)s[n]=arguments[n];return z(H(H(i=t.call.apply(t,[this].concat(s))||this)),"cachedTheme",void 0),z(H(H(i)),"lastOuterTheme",void 0),z(H(H(i)),"lastTheme",void 0),z(H(H(i)),"renderProvider",function(t){var r=i.props.children;return k.default.createElement(e.Provider,{value:i.getTheme(t)},r)}),i}i.prototype=Object.create(t.prototype),i.prototype.constructor=i,i.__proto__=t;var r=i.prototype;return r.getTheme=function(e){if(this.props.theme!==this.lastTheme||e!==this.lastOuterTheme||!this.cachedTheme)if(this.lastOuterTheme=e,this.lastTheme=this.props.theme,"function"==typeof this.lastTheme){var t=this.props.theme;this.cachedTheme=t(e)}else{var i=this.props.theme;this.cachedTheme=e?U({},e,i):i}return this.cachedTheme},r.render=function(){return this.props.children?k.default.createElement(e.Consumer,null,this.renderProvider):null},i}(k.default.Component)}}((0,k.createContext)());W.withTheme,W.ThemeProvider,W.useTheme;var V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},G=("u"<typeof window?"undefined":V(window))==="object"&&("u"<typeof document?"undefined":V(document))==="object"&&9===document.nodeType,K=e.i(469388),J=e.i(858351);function X(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,J.default)(e,t)}var Y=e.i(781751),Q={}.constructor;function Z(e,t,i){void 0===e&&(e="unnamed");var r=i.jss,s=function e(t){if(null==t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(e);
1if(t.constructor!==Q)return t;var i={};for(var r in t)i[r]=e(t[r]);return i}(t),n=r.plugins.onCreateRule(e,s,i);return n||(e[0],null)}var ee=function(e,t){for(var i="",r=0;r<e.length&&"!important"!==e[r];r++)i&&(i+=t),i+=e[r];return i},et=function(e){if(!Array.isArray(e))return e;var t="";if(Array.isArray(e[0]))for(var i=0;i<e.length&&"!important"!==e[i];i++)t&&(t+=", "),t+=ee(e[i]," ");else t=ee(e,", ");return"!important"===e[e.length-1]&&(t+=" !important"),t};function ei(e){return e&&!1===e.format?{linebreak:"",space:""}:{linebreak:"\n",space:" "}}function er(e,t){for(var i="",r=0;r<t;r++)i+="  ";return i+e}function es(e,t,i){void 0===i&&(i={});var r="";if(!t)return r;var s=i.indent,n=void 0===s?0:s,o=t.fallbacks;!1===i.format&&(n=-1/0);var a=ei(i),l=a.linebreak,u=a.space;if(e&&n++,o)if(Array.isArray(o))for(var h=0;h<o.length;h++){var c=o[h];for(var d in c){var p=c[d];null!=p&&(r&&(r+=l),r+=er(d+":"+u+et(p)+";",n))}}else for(var f in o){var g=o[f];null!=g&&(r&&(r+=l),r+=er(f+":"+u+et(g)+";",n))}for(var v in t){var _=t[v];null!=_&&"fallbacks"!==v&&(r&&(r+=l),r+=er(v+":"+u+et(_)+";",n))}return(r||i.allowEmpty)&&e?(n--,r&&(r=""+l+r+l),er(""+e+u+"{"+r,n)+er("}",n)):r}var en=/([[\].#*$><+~=|^:(),"'`\s])/g,eo="u">typeof CSS&&CSS.escape,ea=function(e){return eo?eo(e):e.replace(en,"\\$1")},el=function(){function e(e,t,i){this.type="style",this.isProcessed=!1;var r=i.sheet,s=i.Renderer;this.key=e,this.options=i,this.style=t,r?this.renderer=r.renderer:s&&(this.renderer=new s)}return e.prototype.prop=function(e,t,i){if(void 0===t)return this.style[e];var r=!!i&&i.force;if(!r&&this.style[e]===t)return this;var s=t;i&&!1===i.process||(s=this.options.jss.plugins.onChangeValue(t,e,this));var n=null==s||!1===s,o=e in this.style;if(n&&!o&&!r)return this;var a=n&&o;if(a?delete this.style[e]:this.style[e]=s,this.renderable&&this.renderer)return a?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,s),this;var l=this.options.sheet;return l&&l.attached,this},e}(),eu=function(e){function t(t,i,r){var s=e.call(this,t,i,r)||this,n=r.selector,o=r.scoped,a=r.sheet,l=r.generateId;return n?s.selectorText=n:!1!==o&&(s.id=l((0,Y.default)((0,Y.default)(s)),a),s.selectorText="."+ea(s.id)),s}X(t,e);var i=t.prototype;return i.applyTo=function(e){var t=this.renderer;if(t){var i=this.toJSON();for(var r in i)t.setProperty(e,r,i[r])}return this},i.toJSON=function(){var e={};for(var t in this.style){var i=this.style[t];"object"!=typeof i?e[t]=i:Array.isArray(i)&&(e[t]=et(i))}return e},i.toString=function(e){var t=this.options.sheet,i=t&&t.options.link?(0,N.default)({},e,{allowEmpty:!0}):e;return es(this.selectorText,this.style,i)},(0,K.default)(t,[{key:"selector",set:function(e){if(e!==this.selectorText){this.selectorText=e;var t=this.renderer,i=this.renderable;i&&t&&(t.setSelector(i,e)||t.replaceRule(i,this))}},get:function(){return this.selectorText}}]),t}(el),eh={indent:1,children:!0},ec=/@([\w-]+)/,ed=function(){function e(e,t,i){this.type="conditional",this.isProcessed=!1,this.key=e;var r=e.match(ec);for(var s in this.at=r?r[1]:"unknown",this.query=i.name||"@"+this.at,this.options=i,this.rules=new eO((0,N.default)({},i,{parent:this})),t)this.rules.add(s,t[s]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,i){var r=this.rules.add(e,t,i);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.replaceRule=function(e,t,i){var r=this.rules.replace(e,t,i);return r&&this.options.jss.plugins.onProcessRule(r),r},t.toString=function(e){void 0===e&&(e=eh);var t=ei(e).linebreak;if(null==e.indent&&(e.indent=eh.indent),null==e.children&&(e.children=eh.children),!1===e.children)return this.query+" {}";var i=this.rules.toString(e);return i?this.query+" {"+t+i+t+"}":""},e}(),ep=/@container|@media|@supports\s+/,ef={indent:1,children:!0},eg=/@keyframes\s+([\w-]+)/,ev=function(){function e(e,t,i){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var r=e.match(eg);r&&r[1]?this.name=r[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=i;var s=i.scoped,n=i.sheet,o=i.generateId;for(var a in this.id=!1===s?this.name:ea(o(this,n)),this.rules=new eO((0,N.default)({},i,{parent:this})),t)this.rules.add(a,t[a],(0,N.default)({},i,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){void 0===e&&(e=ef);var t=ei(e).linebreak;if(null==e.indent&&(e.indent=ef.indent),null==e.children&&(e.children=ef.children),!1===e.children)return this.at+" "+this.id+" {}";var i=this.rules.toString(e);return i&&(i=""+t+i+t),this.at+" "+this.id+" {"+i+"}"},e}(),e_=/@keyframes\s+/,em=/\$([\w-]+)/g,ey=function(e,t){return"string"==typeof e?e.replace(em,function(e,i){return i in t?t[i]:e}):e},eb=function(e,t,i){var r=e[t],s=ey(r,i);s!==r&&(e[t]=s)},ew=function(e){function t(){return e.apply(this,arguments)||this}return X(t,e),t.prototype.toString=function(e){var t=this.options.sheet,i=t&&t.options.link?(0,N.default)({},e,{allowEmpty:!0}):e;return es(this.key,this.style,i)},t}(el),ex=function(){function e(e,t,i){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=e,this.style=t,this.options=i}return e.prototype.toString=function(e){var t=ei(e).linebreak;if(Array.isArray(this.style)){for(var i="",r=0;r<this.style.length;r++)i+=es(this.at,this.style[r]),this.style[r+1]&&(i+=t);return i}return es(this.at,this.style,e)},e}(),ek=/@font-face/,eS=function(){function e(e,t,i){this.type="viewport",this.at="@viewport",this.isProcessed=!1,this.key=e,this.style=t,this.options=i}return e.prototype.toString=function(e){return es(this.key,this.style,e)},e}(),e$=function(){function e(e,t,i){this.type="simple",this.isProcessed=!1,this.key=e,this.value=t,this.options=i}return e.prototype.toString=function(e){if(Array.isArray(this.value)){for(var t="",i=0;i<this.value.length;i++)t+=this.key+" "+this.value[i]+";",this.value[i+1]&&(t+="\n");return t}return this.key+" "+this.value+";"},e}(),eE={"@charset":!0,"@import":!0,"@namespace":!0},eP=[{onCreateRule:function(e,t,i){return"@"===e[0]||i.parent&&"keyframes"===i.parent.type?null:new eu(e,t,i)}},{onCreateRule:function(e,t,i){return ep.test(e)?new ed(e,t,i):null}},{onCreateRule:function(e,t,i){return"string"==typeof e&&e_.test(e)?new ev(e,t,i):null},onProcessStyle:function(e,t,i){return"style"===t.type&&i&&("animation-name"in e&&eb(e,"animation-name",i.keyframes),"animation"in e&&eb(e,"animation",i.keyframes)),e},onChangeValue:function(e,t,i){var r=i.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return ey(e,r.keyframes);default:return e}}},{onCreateRule:function(e,t,i){return i.parent&&"keyframes"===i.parent.type?new ew(e,t,i):null}},{onCreateRule:function(e,t,i){return ek.test(e)?new ex(e,t,i):null}}
1,{onCreateRule:function(e,t,i){return"@viewport"===e||"@-ms-viewport"===e?new eS(e,t,i):null}},{onCreateRule:function(e,t,i){return e in eE?new e$(e,t,i):null}}],eR={process:!0},eC={force:!0,process:!0},eO=function(){function e(e){this.map={},this.raw={},this.index=[],this.counter=0,this.options=e,this.classes=e.classes,this.keyframes=e.keyframes}var t=e.prototype;return t.add=function(e,t,i){var r=this.options,s=r.parent,n=r.sheet,o=r.jss,a=r.Renderer,l=r.generateId,u=r.scoped,h=(0,N.default)({classes:this.classes,parent:s,sheet:n,jss:o,Renderer:a,generateId:l,scoped:u,name:e,keyframes:this.keyframes,selector:void 0},i),c=e;e in this.raw&&(c=e+"-d"+this.counter++),this.raw[c]=t,c in this.classes&&(h.selector="."+ea(this.classes[c]));var d=Z(c,t,h);if(!d)return null;this.register(d);var p=void 0===h.index?this.index.length:h.index;return this.index.splice(p,0,d),d},t.replace=function(e,t,i){var r=this.get(e),s=this.index.indexOf(r);r&&this.remove(r);var n=i;return -1!==s&&(n=(0,N.default)({},i,{index:s})),this.add(e,t,n)},t.get=function(e){return this.map[e]},t.remove=function(e){this.unregister(e),delete this.raw[e.key],this.index.splice(this.index.indexOf(e),1)},t.indexOf=function(e){return this.index.indexOf(e)},t.process=function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)},t.register=function(e){this.map[e.key]=e,e instanceof eu?(this.map[e.selector]=e,e.id&&(this.classes[e.key]=e.id)):e instanceof ev&&this.keyframes&&(this.keyframes[e.name]=e.id)},t.unregister=function(e){delete this.map[e.key],e instanceof eu?(delete this.map[e.selector],delete this.classes[e.key]):e instanceof ev&&delete this.keyframes[e.name]},t.update=function(){if("string"==typeof(arguments.length<=0?void 0:arguments[0])?(e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],i=arguments.length<=2?void 0:arguments[2]):(t=arguments.length<=0?void 0:arguments[0],i=arguments.length<=1?void 0:arguments[1],e=null),e)this.updateOne(this.get(e),t,i);else for(var e,t,i,r=0;r<this.index.length;r++)this.updateOne(this.index[r],t,i)},t.updateOne=function(t,i,r){void 0===r&&(r=eR);var s=this.options,n=s.jss.plugins,o=s.sheet;if(t.rules instanceof e)return void t.rules.update(i,r);var a=t.style;if(n.onUpdate(i,t,o,r),r.process&&a&&a!==t.style){for(var l in n.onProcessStyle(t.style,t,o),t.style){var u=t.style[l];u!==a[l]&&t.prop(l,u,eC)}for(var h in a){var c=t.style[h],d=a[h];null==c&&c!==d&&t.prop(h,null,eC)}}},t.toString=function(e){for(var t="",i=this.options.sheet,r=!!i&&i.options.link,s=ei(e).linebreak,n=0;n<this.index.length;n++){var o=this.index[n].toString(e);(o||r)&&(t&&(t+=s),t+=o)}return t},e}(),eM=function(){function e(e,t){for(var i in this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=(0,N.default)({},t,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),t.Renderer&&(this.renderer=new t.Renderer(this)),this.rules=new eO(this.options),e)this.rules.add(i,e[i]);this.rules.process()}var t=e.prototype;return t.attach=function(){return this.attached||(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},t.detach=function(){return this.attached&&(this.renderer&&this.renderer.detach(),this.attached=!1),this},t.addRule=function(e,t,i){var r=this.queue;this.attached&&!r&&(this.queue=[]);var s=this.rules.add(e,t,i);return s?(this.options.jss.plugins.onProcessRule(s),this.attached)?(this.deployed&&(r?r.push(s):(this.insertRule(s),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0))),s):(this.deployed=!1,s):null},t.replaceRule=function(e,t,i){var r=this.rules.get(e);if(!r)return this.addRule(e,t,i);var s=this.rules.replace(e,t,i);return(s&&this.options.jss.plugins.onProcessRule(s),this.attached)?(this.deployed&&this.renderer&&(s?r.renderable&&this.renderer.replaceRule(r.renderable,s):this.renderer.deleteRule(r)),s):(this.deployed=!1,s)},t.insertRule=function(e){this.renderer&&this.renderer.insertRule(e)},t.addRules=function(e,t){var i=[];for(var r in e){var s=this.addRule(r,e[r],t);s&&i.push(s)}return i},t.getRule=function(e){return this.rules.get(e)},t.deleteRule=function(e){var t="object"==typeof e?e:this.rules.get(e);return!!t&&(!this.attached||!!t.renderable)&&(this.rules.remove(t),!this.attached||!t.renderable||!this.renderer||this.renderer.deleteRule(t.renderable))},t.indexOf=function(e){return this.rules.indexOf(e)},t.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},t.update=function(){var e;return(e=this.rules).update.apply(e,arguments),this},t.updateOne=function(e,t,i){return this.rules.updateOne(e,t,i),this},t.toString=function(e){return this.rules.toString(e)},e}(),eF=function(){function e(){this.plugins={internal:[],external:[]},this.registry={}}var t=e.prototype;return t.onCreateRule=function(e,t,i){for(var r=0;r<this.registry.onCreateRule.length;r++){var s=this.registry.onCreateRule[r](e,t,i);if(s)return s}return null},t.onProcessRule=function(e){if(!e.isProcessed){for(var t=e.options.sheet,i=0;i<this.registry.onProcessRule.length;i++)this.registry.onProcessRule[i](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}},t.onProcessStyle=function(e,t,i){for(var r=0;r<this.registry.onProcessStyle.length;r++)t.style=this.registry.onProcessStyle[r](t.style,t,i)},t.onProcessSheet=function(e){for(var t=0;t<this.registry.onProcessSheet.length;t++)this.registry.onProcessSheet[t](e)},t.onUpdate=function(e,t,i,r){for(var s=0;s<this.registry.onUpdate.length;s++)this.registry.onUpdate[s](e,t,i,r)},t.onChangeValue=function(e,t,i){for(var r=e,s=0;s<this.registry.onChangeValue.length;s++)r=this.registry.onChangeValue[s](r,t,i);return r},t.use=function(e,t){void 0===t&&(t={queue:"external"});var i=this.plugins[t.queue];-1===i.indexOf(e)&&(i.push(e),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce(function(e,t){for(var i in t)i in e&&e[i].push(t[i]);return e},{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),eI=new(function(){function e(){this.registry=[]}var t=e.prototype;return t.add=function(e){var t=this.registry,i=e.options.index;if(-1===t.indexOf(e)){if(0===t.length||i>=this.index)return void t.push(e);for(var r=0;r<t.length;r++)if(t[r].options.index>i)return void t.splice(r,0,e)}},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(e){for(var t=void 0===e?{}:e,i=t.attached,r=(0,B.default)(t,["attached"]),s=ei(r).linebreak,n="",o=0;o<this.registry.length;o++){var a=this.registry[o];(null==i||a.attached===i)&&(n&&(n+=s),n+=a.toString(r))}return n},(0,K.default)(e,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}()),eT="u">typeof globalThis?globalThis:"u">typeof window&&window.Math===Math?window:"u">typeof self&&self.Math===Math?self:Function("return this")(),eA="2f1acc6c3a606b082e5eef5e54414ffb";null==eT[eA]&&(eT[eA]=0);var eL=eT[eA]++,ej=function(e){void 0===e&&(e={});var t=0;return function(i,r){t+=1;var s="",n="";return(r&&(r.options.classNamePrefix&&(n=r.options.classNamePrefix),null!=r.options.jss.id&&(s=String(r.options.jss.id))),e.minify)?""+(n||"c")+eL+s+t:n+i.key+"-"+eL+(s?"-"+s:"")+"-"+t}},eD=function(e){var t;return function(){return t||(t=e()),t}},eN=function(e,t){try{if(e.attributeStyleMap)return e.attributeStyleMap.get(t);return e.style.getPropertyValue(t)}catch(e){return""}},eB=function(e,t,i){try{var r=i;if(Array.isArray(i)&&(r=et(i)),e.attributeStyleMap)e.attributeStyleMap.set(t,r);else{var s=r?r.indexOf("!important"):-1,n=s>-1?r.substr(0,s-1):r;e.style.setProperty(t,n,s>-1?"important":"")}}catch(e){return!1}return!0},eq=function(e,t){try{e.attributeStyleMap?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(e){}},ez=function(e,t){return e.selectorText=t,e.selectorText===t},eU=eD(function(){return document.querySelector("head")}),eH=eD(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),eW=function(e,t,i){try{"insertRule"in e?e.insertRule(t,i):"appendRule"in e&&e.append
1Rule(t)}catch(e){return!1}return e.cssRules[i]},eV=function(e,t){var i=e.cssRules.length;return void 0===t||t>i?i:t},eG=function(){var e=document.createElement("style");return e.textContent="\n",e},eK=function(){function e(e){this.getPropertyValue=eN,this.setProperty=eB,this.removeProperty=eq,this.setSelector=ez,this.hasInsertedRules=!1,this.cssRules=[],e&&eI.add(e),this.sheet=e;var t=this.sheet?this.sheet.options:{},i=t.media,r=t.meta,s=t.element;this.element=s||eG(),this.element.setAttribute("data-jss",""),i&&this.element.setAttribute("media",i),r&&this.element.setAttribute("data-meta",r);var n=eH();n&&this.element.setAttribute("nonce",n)}var t=e.prototype;return t.attach=function(){if(!this.element.parentNode&&this.sheet){!function(e,t){var i=t.insertionPoint,r=function(e){var t=eI.registry;if(t.length>0){var i=function(e,t){for(var i=0;i<e.length;i++){var r=e[i];if(r.attached&&r.options.index>t.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(i&&i.renderer)return{parent:i.renderer.element.parentNode,node:i.renderer.element};if((i=function(e,t){for(var i=e.length-1;i>=0;i--){var r=e[i];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))&&i.renderer)return{parent:i.renderer.element.parentNode,node:i.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"==typeof r){var s=function(e){for(var t=eU(),i=0;i<t.childNodes.length;i++){var r=t.childNodes[i];if(8===r.nodeType&&r.nodeValue.trim()===e)return r}return null}(r);if(s)return{parent:s.parentNode,node:s.nextSibling}}return!1}(t);if(!1!==r&&r.parent)return r.parent.insertBefore(e,r.node);
1if(i&&"number"==typeof i.nodeType){var s=i.parentNode;s&&s.insertBefore(e,i.nextSibling);return}eU().appendChild(e)}(this.element,this.sheet.options);var e=!!(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&e&&(this.hasInsertedRules=!1,this.deploy())}},t.detach=function(){if(this.sheet){var e=this.element.parentNode;e&&e.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},t.deploy=function(){var e=this.sheet;if(e){if(e.options.link)return void this.insertRules(e.rules);this.element.textContent="\n"+e.toString()+"\n"}},t.insertRules=function(e,t){for(var i=0;i<e.index.length;i++)this.insertRule(e.index[i],i,t)},t.insertRule=function(e,t,i){if(void 0===i&&(i=this.element.sheet),e.rules){var r=i;if("conditional"===e.type||"keyframes"===e.type){var s=eV(i,t);if(!1===(r=eW(i,e.toString({children:!1}),s)))return!1;this.refCssRule(e,s,r)}return this.insertRules(e.rules,r),r}var n=e.toString();if(!n)return!1;var o=eV(i,t),a=eW(i,n,o);return!1!==a&&(this.hasInsertedRules=!0,this.refCssRule(e,o,a),a)},t.refCssRule=function(e,t,i){e.renderable=i,e.options.parent instanceof eM&&this.cssRules.splice(t,0,i)},t.deleteRule=function(e){var t=this.element.sheet,i=this.indexOf(e);return -1!==i&&(t.deleteRule(i),this.cssRules.splice(i,1),!0)},t.indexOf=function(e){return this.cssRules.indexOf(e)},t.replaceRule=function(e,t){var i=this.indexOf(e);return -1!==i&&(this.element.sheet.deleteRule(i),this.cssRules.splice(i,1),this.insertRule(t,i))},t.getRules=function(){return this.element.sheet.cssRules},e}(),eJ=0,eX=function(){function e(e){this.id=eJ++,this.version="10.10.0",this.plugins=new eF,this.options={id:{minify:!1},createGenerateId:ej,Renderer:G?eK:null,plugins:[]},this.generateId=ej({minify:!1});for(var t=0;t<eP.length;t++)this.plugins.use(eP[t],{queue:"internal"});this.setup(e)}var t=e.prototype;return t.setup=function(e){return void 0===e&&(e={}),e.createGenerateId&&(this.options.createGenerateId=e.createGenerateId),e.id&&(this.options.id=(0,N.default)({},this.options.id,e.id)),(e.createGenerateId||e.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),"Renderer"in e&&(this.options.Renderer=e.Renderer),e.plugins&&this.use.apply(this,e.plugins),this},t.createStyleSheet=function(e,t){void 0===t&&(t={});var i=t.index;"number"!=typeof i&&(i=0===eI.index?0:eI.index+1);var r=new eM(e,(0,N.default)({},t,{jss:this,generateId:t.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:i}));return this.plugins.onProcessSheet(r),r},t.removeStyleSheet=function(e){return e.detach(),eI.remove(e),this},t.createRule=function(e,t,i){if(void 0===t&&(t={}),void 0===i&&(i={}),"object"==typeof e)return this.createRule(void 0,e,t);var r=(0,N.default)({},i,{name:e,jss:this,Renderer:this.options.Renderer});r.generateId||(r.generateId=this.generateId),r.classes||(r.classes={}),r.keyframes||(r.keyframes={});var s=Z(e,t,r);return s&&this.plugins.onProcessRule(s),s},t.use=function(){for(var e=this,t=arguments.length,i=Array(t),r=0;r<t;r++)i[r]=arguments[r];return i.forEach(function(t){e.plugins.use(t)}),this},e}(),eY=function(e){return new eX(e)},eQ="object"==typeof CSS&&null!=CSS&&"number"in CSS;eY();var eZ=Date.now(),e0="fnValues"+eZ,e1="fnStyle"+ ++eZ,e2=("function"==typeof(h=(v="u">typeof self?self:"u">typeof window?window:e.g).Symbol)?h.observable?u=h.observable:(u=h("observable"),h.observable=u):u="@@observable",u),e3=function(e){return e&&e[e2]&&e===e[e2]()},e5=/;\n/,e6=function(e){for(var t={},i=e.split(e5),r=0;r<i.length;r++){var s=(i[r]||"").trim();if(s){var n=s.indexOf(":");if(-1!==n){var o=s.substr(0,n).trim(),a=s.substr(n+1).trim();t[o]=a}}}return t},e4=function(e){"string"==typeof e.style&&(e.style=e6(e.style))},e8="@global",e7="@global ",e9=function(){function e(e,t,i){for(var r in this.type="global",this.at=e8,this.isProcessed=!1,this.key=e,this.options=i,this.rules=new eO((0,N.default)({},i,{parent:this})),t)this.rules.add(r,t[r]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.addRule=function(e,t,i){var r=this.rules.add(e,t,i);return r&&this.options.jss.plugins.onProcessRule(r),r},t.replaceRule=function(e,t,i){var r=this.rules.replace(e,t,i);return r&&this.options.jss.plugins.onProcessRule(r),r},t.indexOf=function(e){return this.rules.indexOf(e)},t.toString=function(e){return this.rules.toString(e)},e}(),te=function(){function e(e,t,i){this.type="global",this.at=e8,this.isProcessed=!1,this.key=e,this.options=i;var r=e.substr(e7.length);this.rule=i.jss.createRule(r,t,(0,N.default)({},i,{parent:this}))}return e.prototype.toString=function(e){return this.rule?this.rule.toString(e):""},e}(),tt=/\s*,\s*/g;function ti(e,t){for(var i=e.split(tt),r="",s=0;s<i.length;s++)r+=t+" "+i[s].trim(),i[s+1]&&(r+=", ");return r}var tr=function(e){return e&&"object"==typeof e&&!Array.isArray(e)},ts="extendCurrValue"+Date.now(),tn=/\s*,\s*/g,to=/&/g,ta=/\$([\w-]+)/g,tl=/[A-Z]/g,tu=/^ms-/,th={};function tc(e){return"-"+e.toLowerCase()}let td=function(e){if(th.hasOwnProperty(e))return th[e];var t=e.replace(tl,tc);return th[e]=tu.test(t)?"-"+t:t};function tp(e){var t={};for(var i in e)t[0===i.indexOf("--")?i:td(i)]=e[i];return e.fallbacks&&(Array.isArray(e.fallbacks)?t.fallbacks=e.fallbacks.map(tp):t.fallbacks=tp(e.fallbacks)),t}var tf=eQ&&CSS?CSS.px:"px",tg=eQ&&CSS?CSS.ms:"ms",tv=eQ&&CSS?CSS.percent:"%";function t_(e){var t=/(-[a-z])/g,i=function(e){return e[1].toUpperCase()},r={};for(var s in e)r[s]=e[s],r[s.replace(t,i)]=e[s];return r}var tm=t_({"animation-delay":tg,"animation-duration":tg,"background-position":tf,"background-position-x":tf,"background-position-y":tf,"background-size":tf,border:tf,"border-bottom":tf,"border-bottom-left-radius":tf,"border-bottom-right-radius":tf,"border-bottom-width":tf,"border-left":tf,"border-left-width":tf,"border-radius":tf,"border-right":tf,"border-right-width":tf,"border-top":tf,"border-top-left-radius":tf,"border-top-right-radius":tf,"border-top-width":tf,"border-width":tf,"border-block":tf,"border-block-end":tf,"border-block-end-width":tf,"border-block-start":tf,"border-block-start-width":tf,"border-block-width":tf,"border-inline":tf,"border-inline-end":tf,"border-inline-end-width":tf,"border-inline-start":tf,"border-inline-start-width":tf,"border-inline-width":tf,"border-start-start-radius":tf,"border-start-end-radius":tf,"border-end-start-radius":tf,"border-end-end-radius":tf,margin:tf,"margin-bottom":tf,"margin-left":tf,"margin-right":tf,"margin-top":tf,"margin-block":tf,"margin-block-end":tf,"margin-block-start":tf,"margin-inline":tf,"margin-inline-end":tf,"margin-inline-start":tf,padding:tf,"padding-bottom":tf,"padding-left":tf,"padding-right":tf,"padding-top":tf,"padding-block":tf,"padding-block-end":tf,"padding-block-start":tf,"padding-inline":tf,"padding-inline-end":tf,"padding-inline-start":tf,"mask-
1position-x":tf,"mask-position-y":tf,"mask-size":tf,height:tf,width:tf,"min-height":tf,"max-height":tf,"min-width":tf,"max-width":tf,bottom:tf,left:tf,top:tf,right:tf,inset:tf,"inset-block":tf,"inset-block-end":tf,"inset-block-start":tf,"inset-inline":tf,"inset-inline-end":tf,"inset-inline-start":tf,"box-shadow":tf,"text-shadow":tf,"column-gap":tf,"column-rule":tf,"column-rule-width":tf,"column-width":tf,"font-size":tf,"font-size-delta":tf,"letter-spacing":tf,"text-decoration-thickness":tf,"text-indent":tf,"text-stroke":tf,"text-stroke-width":tf,"word-spacing":tf,motion:tf,"motion-offset":tf,outline:tf,"outline-offset":tf,"outline-width":tf,perspective:tf,"perspective-origin-x":tv,"perspective-origin-y":tv,"transform-origin":tv,"transform-origin-x":tv,"transform-origin-y":tv,"transform-origin-z":tv,"transition-delay":tg,"transition-duration":tg,"vertical-align":tf,"flex-basis":tf,"shape-margin":tf,size:tf,gap:tf,grid:tf,"grid-gap":tf,"row-gap":tf,"grid-row-gap":tf,"grid-column-gap":tf,"grid-template-rows":tf,"grid-template-columns":tf,"grid-auto-rows":tf,"grid-auto-columns":tf,"box-shadow-x":tf,"box-shadow-y":tf,"box-shadow-blur":tf,"box-shadow-spread":tf,"font-line-height":tf,"text-shadow-x":tf,"text-shadow-y":tf,"text-shadow-blur":tf});function ty(e,t,i){if(null==t)return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]=ty(e,t[r],i);else if("object"==typeof t)if("fallbacks"===e)for(var s in t)t[s]=ty(s,t[s],i);else for(var n in t)t[n]=ty(e+"-"+n,t[n],i);else if("number"==typeof t&&!1===isNaN(t)){var o=i[e]||tm[e];return o&&(0!==t||o!==tf)?"function"==typeof o?o(t).toString():""+t+o:t.toString()}return t}let tb=function(e){void 0===e&&(e={});var t=t_(e);return{onProcessStyle:function(e,i){if("style"!==i.type)return e;for(var r in e)e[r]=ty(r,e[r],t);return e},onChangeValue:function(e,i){return ty(i,e,t)}}};var tw={"background-size":!0,"background-position":!0,border:!0,"border-bottom":!0,"border-left":!0,"border-top":!0,"border-right":!0,"border-radius":!0,"border-image":!0,"border-width":!0,"border-style":!0,"border-color":!0,"box-shadow":!0,flex:!0,margin:!0,padding:!0,outline:!0,"transform-origin":!0,transform:!0,transition:!0},tx={position:!0,size:!0},tk={padding:{top:0,right:0,bottom:0,left:0},margin:{top:0,right:0,bottom:0,left:0},background:{attachment:null,color:null,image:null,position:null,repeat:null},border:{width:null,style:null,color:null},"border-top":{width:null,style:null,color:null},"border-right":{width:null,style:null,color:null},"border-bottom":{width:null,style:null,color:null},"border-left":{width:null,style:null,color:null},outline:{width:null,style:null,color:null},"list-style":{type:null,position:null,image:null},transition:{property:null,duration:null,"timing-function":null,timingFunction:null,delay:null},animation:{name:null,duration:null,"timing-function":null,timingFunction:null,delay:null,"iteration-count":null,iterationCount:null,direction:null,"fill-mode":null,fillMode:null,"play-state":null,playState:null},"box-shadow":{x:0,y:0,blur:0,spread:0,color:null,inset:null},"text-shadow":{x:0,y:0,blur:null,color:null}},tS={border:{radius:"border-radius",image:"border-image",width:"border-width",style:"border-style",color:"border-color"},"border-bottom":{width:"border-bottom-width",style:"border-bottom-style",color:"border-bottom-color"},"border-top":{width:"border-top-width",style:"border-top-style",color:"border-top-color"},"border-left":{width:"border-left-width",style:"border-left-style",color:"border-left-color"},"border-right":{width:"border-right-width",style:"border-right-style",color:"border-right-color"},background:{size:"background-size",image:"background-image"},font:{style:"font-style",variant:"font-variant",weight:"font-weight",stretch:"font-stretch",size:"font-size",family:"font-family",lineHeight:"line-height","line-height":"line-height"},flex:{grow:"flex-grow",basis:"flex-basis",direction:"flex-direction",wrap:"flex-wrap",flow:"flex-flow",shrink:"flex-shrink"},align:{self:"align-self",items:"align-items",content:"align-content"},grid:{"template-columns":"grid-template-columns",templateColumns:"grid-template-columns","template-rows":"grid-template-rows",templateRows:"grid-template-rows","template-areas":"grid-template-areas",templateAreas:"grid-template-areas",template:"grid-template","auto-columns":"grid-auto-columns",autoColumns:"grid-auto-columns","auto-rows":"grid-auto-rows",autoRows:"grid-auto-rows","auto-flow":"grid-auto-flow",autoFlow:"grid-auto-flow",row:"grid-row",column:"grid-column","row-start":"grid-row-start",rowStart:"grid-row-start","row-end":"grid-row-end",rowEnd:"grid-row-end","column-start":"grid-column-start",columnStart:"grid-column-start","column-end":"grid-column-end",columnEnd:"grid-column-end",area:"grid-area",gap:"grid-gap","row-gap":"grid-row-gap",rowGap:"grid-row-gap","column-gap":"grid-column-gap",columnGap:"grid-column-gap"}};function t$(e,t,i,r,s){if(!(tk[t]||tS[t]))return[];var n=[];if(tS[t]&&(e=function(e,t,i,r){for(var s in i){var n=i[s];if(void 0!==e[s]&&(r||!t.prop(n))){var o,a=tE(((o={})[n]=e[s],o),t)[n];r?t.style.fallbacks[n]=a:t.style[n]=a}delete e[s]}return e}
1(e,i,tS[t],r)),Object.keys(e).length)for(var o in tk[t]){if(e[o]){Array.isArray(e[o])?n.push(null===tx[o]?e[o]:e[o].join(" ")):n.push(e[o]);continue}null!=tk[t][o]&&n.push(tk[t][o])}return!n.length||s?n:[n]}function tE(e,t,i){for(var r in e){var s=e[r];if(Array.isArray(s)){if(!Array.isArray(s[0])){if("fallbacks"===r){for(var n=0;n<e.fallbacks.length;n++)e.fallbacks[n]=tE(e.fallbacks[n],t,!0);continue}e[r]=function e(t,i,r,s){if(null==r[i])return t;if(0===t.length)return[];if(Array.isArray(t[0]))return e(t[0],i,r,s);if("object"==typeof t[0])return t.map(function(e){return t$(e,i,s,!1,!0)});return[t]}(s,r,tw,t),e[r].length||delete e[r]}}else if("object"==typeof s){if("fallbacks"===r){e.fallbacks=tE(e.fallbacks,t,!0);continue}e[r]=t$(s,r,t,i),e[r].length||delete e[r]}else""===e[r]&&delete e[r]}return e}var tP=e.i(978824),tR="",tC="",tO="",tM="",tF=G&&"ontouchstart"in document.documentElement;if(G){var tI={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},tT=document.createElement("p").style;for(var tA in tI)if(tA+"Transform"in tT){tR=tA,tC=tI[tA];break}"Webkit"===tR&&"msHyphens"in tT&&(tR="ms",tC=tI.ms,tM="edge"),"Webkit"===tR&&"-apple-trailing-word"in tT&&(tO="apple")}var tL=tR,tj=tC,tD=tO,tN=tM,tB=/[-\s]+(.)?/g;function tq(e,t){return t?t.toUpperCase():""}function tz(e){return e.replace(tB,tq)}function tU(e){return tz("-"+e)}var tH={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},tW={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},tV=Object.keys(tW),tG=function(e){return tj+e},tK=[{noPrefill:["appearance"],supportedProperty:function(e){return"appearance"===e&&("ms"===tL?"-webkit-"+e:tj+e)}},{noPrefill:["color-adjust"],supportedProperty:function(e){return"color-adjust"===e&&("Webkit"===tL?tj+"print-"+e:e)}},{noPrefill:["mask"],supportedProperty:function(e,t){if(!/^mask/.test(e))return!1;if("Webkit"===tL){var i="mask-image";if(tz(i)in t)return e;if(tL+tU(i)in t)return tj+e}return e}},{noPrefill:["text-orientation"],supportedProperty:function(e){return"text-orientation"===e&&("apple"!==tD||tF?e:tj+e)}},{noPrefill:["transform"],supportedProperty:function(e,t,i){return"transform"===e&&(i.transform?e:tj+e)}},{noPrefill:["transition"],supportedProperty:function(e,t,i){return"transition"===e&&(i.transition?e:tj+e)}},{noPrefill:["writing-mode"],supportedProperty:function(e){return"writing-mode"===e&&("Webkit"===tL||"ms"===tL&&"edge"!==tN?tj+e:e)}},{noPrefill:["user-select"],supportedProperty:function(e){return"user-select"===e&&("Moz"===tL||"ms"===tL||"apple"===tD?tj+e:e)}},{supportedProperty:function(e,t){return!!/^break-/.test(e)&&("Webkit"===tL?"WebkitColumn"+tU(e)in t&&tj+"column-"+e:"Moz"===tL&&"page"+tU(e)in t&&"page-"+e)}},{supportedProperty:function(e,t){if(!/^(border|margin|padding)-inline/.test(e))return!1;if("Moz"===tL)return e;var i=e.replace("-inline","");return tL+tU(i)in t&&tj+i}},{supportedProperty:function(e,t){return tz(e)in t&&e}},{supportedProperty:function(e,t){var i=tU(e);return"-"===e[0]||"-"===e[0]&&"-"===e[1]?e:tL+i in t?tj+e:"Webkit"!==tL&&"Webkit"+i in t&&"-webkit-"+e}},{supportedProperty:function(e){return"scroll-snap"===e.substring(0,11)&&("ms"===tL?""+tj+e:e)}},{supportedProperty:function(e){return"overscroll-behavior"===e&&("ms"===tL?tj+"scroll-chaining":e)}},{supportedProperty:function(e,t){var i=tH[e];return!!i&&tL+tU(i)in t&&tj+i}},{supportedProperty:function(e,t,i){var r=i.multiple;if(tV.indexOf(e)>-1){var s=tW[e];if(!Array.isArray(s))return tL+tU(s)in t&&tj+s;if(!r)return!1;for(var n=0;n<s.length;n++)if(!(tL+tU(s[0])in t))return!1;return s.map(tG)}return!1}}],tJ=tK.filter(function(e){return e.supportedProperty}).map(function(e){return e.supportedProperty}),tX=tK.filter(function(e){return e.noPrefill}).reduce(function(e,t){return e.push.apply(e,(0,tP.default)(t.noPrefill)),e},[]),tY={};if(G){_=document.createElement("p");var tQ=window.getComputedStyle(document.documentElement,"");for(var tZ in tQ)isNaN(tZ)||(tY[tQ[tZ]]=tQ[tZ]);
1tX.forEach(function(e){return delete tY[e]})}function t0(e,t){if(void 0===t&&(t={}),!_)return e;if(null!=tY[e])return tY[e];("transition"===e||"transform"===e)&&(t[e]=e in _.style);for(var i=0;i<tJ.length&&(tY[e]=tJ[i](e,_.style,t),!tY[e]);i++);try{_.style[e]=""}catch(e){return!1}return tY[e]}var t1={},t2={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},t3=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function t5(e,t,i){if("var"===t)return"var";if("all"===t)return"all";if("all"===i)return", all";var r=t?t0(t):", "+t0(i);return r||t||i}function t6(e,t){var i=t;if(!m||"content"===e)return t;if("string"!=typeof i||!isNaN(parseInt(i,10)))return i;var r=e+i;if(null!=t1[r])return t1[r];try{m.style[e]=i}catch(e){return t1[r]=!1,!1}if(t2[e])i=i.replace(t3,t5);else if(""===m.style[e]&&("-ms-flex"===(i=tj+i)&&(m.style[e]="-ms-flexbox"),m.style[e]=i,""===m.style[e]))return t1[r]=!1,!1;return m.style[e]="",t1[r]=i,t1[r]}G&&(m=document.createElement("p"));let t4=function(){var e=function(e,t){return e.length===t.length?e>t?1:-1:e.length-t.length};return{onProcessStyle:function(t,i){if("style"!==i.type)return t;for(var r={},s=Object.keys(t).sort(e),n=0;n<s.length;n++)r[s[n]]=t[s[n]];return r}}},t8=function(e){var t;return void 0===e&&(e={}),{plugins:[{onCreateRule:function(e,t,i){if("function"!=typeof t)return null;var r=Z(e,{},i);return r[e1]=t,r},onProcessStyle:function(e,t){if(e0 in t||e1 in t)return e;var i={};for(var r in e){var s=e[r];"function"==typeof s&&(delete e[r],i[r]=s)}return t[e0]=i,e},onUpdate:function(e,t,i,r){var s=t[e1];s&&(t.style=s(e)||{});var n=t[e0];if(n)for(var o in n)t.prop(o,n[o](e),r)}},(t=e.observable,{onCreateRule:function(e,i,r){if(!e3(i))return null;var s=Z(e,{},r);return i.subscribe(function(e){for(var i in e)s.prop(i,e[i],t)}),s},onProcessRule:function(e){if(!e||"style"===e.type){var i=e.style,r=function(r){var s=i[r];if(!e3(s))return"continue";delete i[r],s.subscribe({next:function(i){e.prop(r,i,t)}})};for(var s in i)if("continue"===r(s))continue}}}),{onProcessRule:e4},{onCreateRule:function(e,t,i){if(!e)return null;if(e===e8)return new e9(e,t,i);if("@"===e[0]&&e.substr(0,e7.length)===e7)return new te(e,t,i);var r=i.parent;return r&&("global"===r.type||r.options.parent&&"global"===r.options.parent.type)&&(i.scoped=!1),i.selector||!1!==i.scoped||(i.selector=e),null},onProcessRule:function(e,t){if("style"===e.type&&t){var i=e.options,r=e.style,s=r?r[e8]:null;if(s){for(var n in s)t.addRule(n,s[n],(0,N.default)({},i,{selector:ti(n,e.selector)}));delete r[e8]}var o=e.options,a=e.style;for(var l in a)if("@"===l[0]&&l.substr(0,e8.length)===e8){var u=ti(l.substr(e8.length),e.selector);t.addRule(u,a[l],(0,N.default)({},o,{selector:u})),delete a[l]}}}},{onProcessStyle:function(e,t,i){return"extend"in e?function e(t,i,r,s){void 0===s&&(s={}),function(t,i,r,s){if("string"==typeof t.extend){if(!r)return;var n=r.getRule(t.extend);if(!n||n===i)return;var o=n.options.parent;o&&e(o.rules.raw[t.extend],i,r,s);return}if(Array.isArray(t.extend)){for(var a=0;a<t.extend.length;a++){var l=t.extend[a];e("string"==typeof l?(0,N.default)({},t,{extend:l}):t.extend[a],i,r,s)}return}for(var u in t.extend){if("extend"===u){e(t.extend.extend,i,r,s);continue}if(tr(t.extend[u])){u in s||(s[u]={}),e(t.extend[u],i,r,s[u]);continue}s[u]=t.extend[u]}}(t,i,r,s);var n=s;for(var o in t)if("extend"!==o){if(tr(n[o])&&tr(t[o])){e(t[o],i,r,n[o]);continue}if(tr(t[o])){n[o]=e(t[o],i,r);continue}n[o]=t[o]}return s}(e,t,i):e},onChangeValue:function(e,t,i){if("extend"!==t)return e;if(null==e||!1===e){for(var r in i[ts])i.prop(r,null);return i[ts]=null,null}if("object"==typeof e){for(var s in e)i.prop(s,e[s]);i[ts]=e}return null}},{onProcessStyle:function(e,t,i){if("style"!==t.type)return e;var r,s,n=t.options.parent;for(var o in e){var a=-1!==o.indexOf("&"),l="@"===o[0];if(a||l){if(r=function(e,t,i){if(i)return(0,N.default)({},i,{index:i.index+1});var r=e.options.nestingLevel;r=void 0===r?1:r+1;var s=(0,N.default)({},e.options,{nestingLevel:r,index:t.indexOf(e)+1});return delete s.name,s}
1(t,n,r),a){var u=function(e,t){for(var i=t.split(tn),r=e.split(tn),s="",n=0;n<i.length;n++)for(var o=i[n],a=0;a<r.length;a++){var l=r[a];s&&(s+=", "),s+=-1!==l.indexOf("&")?l.replace(to,o):o+" "+l}return s}(o,t.selector);s||(s=function(e,t){return function(i,r){var s=e.getRule(r)||t&&t.getRule(r);return s?s.selector:r}}(n,i)),u=u.replace(ta,s);var h=t.key+"-"+o;"replaceRule"in n?n.replaceRule(h,e[o],(0,N.default)({},r,{selector:u})):n.addRule(h,e[o],(0,N.default)({},r,{selector:u}))}else l&&n.addRule(o,{},r).addRule(t.key,e[o],{selector:t.selector});delete e[o]}}return e}},{onProcessStyle:function(e,t){return"composes"in e&&(!function e(t,i){if(!i)return!0;if(Array.isArray(i)){for(var r=0;r<i.length;r++)if(!e(t,i[r]))return!1;return!0}if(i.indexOf(" ")>-1)return e(t,i.split(" "));var s=t.options.parent;if("$"===i[0]){var n=s.getRule(i.substr(1));return!!n&&n!==t&&(s.classes[t.key]+=" "+s.classes[n.key],!0)}return s.classes[t.key]+=" "+i,!0}(t,e.composes),delete e.composes),e}},{onProcessStyle:function(e){if(Array.isArray(e)){for(var t=0;t<e.length;t++)e[t]=tp(e[t]);return e}return tp(e)},onChangeValue:function(e,t,i){if(0===t.indexOf("--"))return e;var r=td(t);return t===r?e:(i.prop(r,e),null)}},tb(e.defaultUnit),{onProcessStyle:function(e,t){if(!e||"style"!==t.type)return e;if(Array.isArray(e)){for(var i=0;i<e.length;i++)e[i]=tE(e[i],t);return e}return tE(e,t)}},{onProcessRule:function(e){if("keyframes"===e.type){var t;e.at="-"===(t=e.at)[1]||"ms"===tL?t:"@"+tj+"keyframes"+t.substr(10)}},onProcessStyle:function(e,t){return"style"!==t.type?e:function e(t){for(var i in t){var r=t[i];if("fallbacks"===i&&Array.isArray(r)){t[i]=r.map(e);continue}var s=!1,n=t0(i);n&&n!==i&&(s=!0);var o=!1,a=t6(n,et(r));a&&a!==r&&(o=!0),(s||o)&&(s&&delete t[i],t[n||i]=a||r)}return t}(e)},onChangeValue:function(e,t){return t6(t,et(e))||e}},t4()]}};var t7=eY(t8()),t9=function(e){void 0===e&&(e=t7);var t,i=new Map,r=0,s=function(){return(!t||t.rules.index.length>1e4)&&(t=e.createStyleSheet().attach()),t};function n(){var e=arguments,t=JSON.stringify(e),n=i.get(t);if(n)return n.className;var o=[];for(var a in e){var l=e[a];if(!Array.isArray(l)){o.push(l);continue}for(var u=0;u<l.length;u++)o.push(l[u])}for(var h={},c=[],d=0;d<o.length;d++){var p=o[d];if(p){var f=p;if("string"==typeof p){var g=i.get(p);g&&(g.labels.length&&c.push.apply(c,g.labels),f=g.style)}f.label&&-1===c.indexOf(f.label)&&c.push(f.label),Object.assign(h,f)}}delete h.label;var v=(0===c.length?"css":c.join("-"))+"-"+r++;s().addRule(v,h);var _=s().classes[v],m={style:h,labels:c,className:_};return i.set(t,m),i.set(_,m),_}return n.getSheet=s,n}();(0,k.createContext)({classNamePrefix:"",disableStylesGeneration:!1,isSSR:!G}),eY(t8()),new WeakMap,Symbol("react-jss-styled"),void 0===c&&(c=t9),e.i(220284),e.i(17040);var ie=function(){return(ie=Object.assign||function(e){for(var t,i=1,r=arguments.length;i<r;i++)for(var s in t=arguments[i])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)};[[1,1,0],[1,0,1],[0,1,1],[1,0,0],[0,1,0],[0,0,1]].reduce(function(e,t,i){var r;return ie(ie({},e),((r={})["@keyframes rotation-".concat(i)]={"50%":{transform:"rotate3d(".concat(t.map(function(e){return e/2}).join(),", 180deg)")},"100%":{transform:"rotate3d(".concat(t.join(),", 360deg)")}},r))},{});var it=e.i(800709),ii=function(e){var t=e.condition,i=e.wrapper,r=e.children;return t?i(r):r};function ir(){return(ir=Object.assign.bind()).apply(this,arguments)}function is(e,t){return(is=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var io="bottom";(d=y||(y={})).STRICT="strict",d.LAX="lax",d.NONE="none";var ia="byCookieValue",il="CookieConsent",iu=["children"],ih={disableStyles:!1,hideOnAccept:!0,hideOnDecline:!0,location:io,visible:ia,onAccept:function(e){},onDecline:function(){},cookieName:il,cookieValue:"true",declineCookieValue:"false",setDeclineCookie:!0,buttonText:"I understand",declineButtonText:"I decline",debug:!1,expires:365,containerClasses:"CookieConsent",contentClasses:"",buttonClasses:"",buttonWrapperClasses:"",declineButtonClasse
1s:"",buttonId:"rcc-confirm-button",declineButtonId:"rcc-decline-button",extraCookieOptions:{},disableButtonStyles:!1,enableDeclineButton:!1,flipButtons:!1,sameSite:y.LAX,ButtonComponent:function(e){var t=e.children,i=function(e,t){if(null==e)return{};var i,r,s={},n=Object.keys(e);for(r=0;r<n.length;r++)i=n[r],t.indexOf(i)>=0||(s[i]=e[i]);return s}(e,iu);return k.default.createElement("button",Object.assign({},i),t)},overlay:!1,overlayClasses:"",onOverlayClick:function(){},acceptOnOverlayClick:!1,ariaAcceptLabel:"Accept cookies",ariaDeclineLabel:"Decline cookies",acceptOnScroll:!1,acceptOnScrollPercentage:25,customContentAttributes:{},customContainerAttributes:{},customButtonProps:{},customDeclineButtonProps:{},customButtonWrapperAttributes:{},style:{},buttonStyle:{},declineButtonStyle:{},contentStyle:{},overlayStyle:{}},ic={visible:!1,style:{alignItems:"baseline",background:"#353535",color:"white",display:"flex",flexWrap:"wrap",justifyContent:"space-between",left:"0",position:"fixed",width:"100%",zIndex:"999"},buttonStyle:{background:"#ffd42d",border:"0",borderRadius:"0px",boxShadow:"none",color:"black",cursor:"pointer",flex:"0 0 auto",padding:"5px 10px",margin:"15px"},declineButtonStyle:{background:"#c12a2a",border:"0",borderRadius:"0px",boxShadow:"none",color:"#e5e5e5",cursor:"pointer",flex:"0 0 auto",padding:"5px 10px",margin:"15px"},contentStyle:{flex:"1 0 300px",margin:"15px"},overlayStyle:{position:"fixed",left:0,top:0,width:"100%",height:"100%",zIndex:"999",backgroundColor:"rgba(0,0,0,0.3)"}},id=function(e){void 0===e&&(e=il);var t=it.default.get(e);return void 0===t?it.default.get(ip(e)):t},ip=function(e){return e+"-legacy"},ig=function(e){function t(){var t;return t=e.apply(this,arguments)||this,t.state=ic,t.handleScroll=function(){var e=ir({},ih,t.props).acceptOnScrollPercentage,i=document.documentElement,r=document.body,s="scrollTop",n="scrollHeight";(i[s]||r[s])/((i[n]||r[n])-i.clientHeight)*100>e&&t.accept(!0)},t.removeScrollListener=function(){t.props.acceptOnScroll&&window.removeEventListener("scroll",t.handleScroll)},t}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,is(t,e);var i=t.prototype;return i.componentDidMount=function(){var e=this.props.debug;(void 0===this.getCookieValue()||e)&&(this.setState({visible:!0}),this.props.acceptOnScroll&&window.addEventListener("scroll",this.handleScroll,{passive:!0}))},i.componentWillUnmount=function(){this.removeScrollListener()},i.accept=function(e){void 0===e&&(e=!1);var t,i=ir({},ih,this.props),r=i.cookieName,s=i.cookieValue,n=i.hideOnAccept,o=i.onAccept;this.setCookie(r,s),o(null!=(t=e)&&t),n&&(this.setState({visible:!1}),this.removeScrollListener())},i.overlayClick=function(){var e=ir({},ih,this.props),t=e.acceptOnOverlayClick,i=e.onOverlayClick;t&&this.accept(),i()},i.decline=function(){var e=ir({},ih,this.props),t=e.cookieName,i=e.declineCookieValue,r=e.hideOnDecline,s=e.onDecline;e.setDeclineCookie&&this.setCookie(t,i),s(),r&&this.setState({visible:!1})},i.setCookie=function(e,t){var i=this.props,r=i.extraCookieOptions,s=i.expires,n=i.sameSite,o=this.props.cookieSecurity;void 0===o&&(o=!window.location||"https:"===window.location.protocol);var a=ir({expires:s},r,{sameSite:n,secure:o});n===y.NONE&&it.default.set(ip(e),t,a),it.default.set(e,t,a)},i.getCookieValue=function(){return id(this.props.cookieName)},i.render=function(){var e=this;switch(this.props.visible){case"hidden":return null;case ia:if(!this.state.visible)return null}var t=this.props,i=t.location,r=t.style,s=t.buttonStyle,n=t.declineButtonStyle,o=t.contentStyle,a=t.disableStyles,l=t.buttonText,u=t.declineButtonText,h=t.containerClasses,c=t.contentClasses,d=t.buttonClasses,p=t.buttonWrapperClasses,f=t.declineButtonClasses,g=t.buttonId,v=t.declineButtonId,_=t.disableButtonStyles,m=t.enableDeclineButton,y=t.flipButtons,b=t.ButtonComponent,w=t.overlay,x=t.overlayClasses,S=t.overlayStyle,$=t.ariaAcceptLabel,E=t.ariaDeclineLabel,P=t.customContainerAttributes,R=t.customContentAttributes,C=t.customButtonProps,O=t.customDeclineButtonProps,M=t.customButtonWrapperAttributes,F={},I={},T={},A={},L={};switch(a?(F=Object.assign({},r),I=Object.assign({},s),T=Object.assign({},n),A=Object.assign({},o),L=Object.assign({},S)):(F=Object.assign({},ir({},this.state.style,r)),A=Object.assign({},ir({},this.state.contentStyle,o)),L=Object.assign({},ir({},this.state.overlayStyle,S)),_?(I=Object.assign({},s),T=Object.assign({},n)):(I=Object.assign({},ir({},this.state.buttonStyle,s)),T=Object.assign({},ir({},this.state.declineButtonStyle,n)))),i){case"top":F.top="0";break;case io:F.bottom="0"}var j=[];return m&&j.push(k.default.createElement(b,Object.assign({key:"declineButton",style:T,className:f,id:v,"aria-label":E,onClick:function(){e.decline()}},O),u)),j.push(k.default.createElement(b,Object.assign({key:"acceptButton",style:I,className:d,id:g,"aria-label":$,onClick:function(){e.accept()}},C),l)),y&&j.reverse(),k.default.createElement(ii,{condition:w,wrapper:function(t){return k.default.createElement("div",{style:L,className:x,onClick:function(){e.overlayClick()}},t)}},k.default.createElement("div",Object.assign({className:""+h,style:F},P),k.default.createElement("div",Object.assign({style:A,className:c},R),this.props.children),k.default.createElement("div",Object.assign({className:""+p},M),j.map(function(e){return e}))))},t}(k.Component);ig.defaultProps=ih,e.s(["default",0,ig],158221);var iv=e.i(48196),i_=e.i(415907),im=e.i(799050),iy=e.i(953705),ib=e.i(268621),iw=e.i(177737);let ix=()=>`poper-sale-dismissed:${iy.SALE.name}`;function ik(){let{sessionLoaded:e,currentUser:t}=(0,k.useContext)(T.LayoutContext)||{},i=(0,iv.usePathname)(),[r,s]=(0,k.useState)(!0),[n,o]=(0,k.useState)(!1),a=(0,iy.useSaleTimeLeft)(iy.SALE.endsAt);(0,k.useEffect)(()=>{try{s("1"===window.localStorage.getItem(ix()))}catch(e){s(!1)}},[]),(0,k.useEffect)(()=>{let e=setTimeout(()=>
1o(!0),(iy.SALE.floating?.delaySeconds??0)*1e3);return()=>clearTimeout(e)},[]);let l=()=>{s(!0);try{window.localStorage.setItem(ix(),"1")}catch(e){}},u=iy.SALE.floating??{},h=u.theme??{},c=iy.SALE.active&&u.enabled&&a>0,d=(u.hideOnPaths??[]).some(e=>(i??"").startsWith(e));return(0,w.jsx)(A.AnimatePresence,{children:c&&e&&!t&&n&&!r&&!d&&(0,w.jsx)(L.motion.div,{initial:{opacity:0,y:24,scale:.96},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:24,scale:.96},transition:{duration:.3,ease:[.4,0,.2,1]},className:"fixed bottom-4 left-4 z-[9999] pointer-events-none",children:(0,w.jsx)("div",{className:`w-[min(320px,calc(100vw-2rem))] origin-bottom-left scale-[0.62] sm:scale-[0.72] pointer-events-auto ${iw.anton.className}`,children:(0,w.jsxs)("div",{className:"relative",children:[(0,w.jsx)("button",{onClick:l,"aria-label":"Dismiss sale banner",className:"absolute top-2 right-2 z-30 flex items-center justify-center w-6 h-6 rounded-full border-0 p-0 cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{backgroundColor:h.magenta,color:"#fff"},children:(0,w.jsx)(im.X,{size:13,strokeWidth:3})}),(0,w.jsxs)(j.default,{href:u.ctaHref,onClick:l,"aria-label":`${u.percent}% off — ${u.tagline}`,className:"block relative overflow-hidden rounded-2xl shadow-2xl ring-1 ring-black/10 no-underline transition-transform hover:scale-[1.02]",style:{backgroundColor:h.cream},children:[(0,w.jsx)(ib.PosterBackdrop,{theme:h}),(0,w.jsxs)("div",{className:"relative z-10 flex flex-col items-center px-5 pt-6 pb-5",children:[(0,w.jsx)("div",{className:"relative z-20 rounded-md px-4 py-1.5 -mb-3 text-white uppercase leading-none tracking-[0.02em] text-[26px]",style:{backgroundColor:h.magenta},children:u.eyebrow}),(0,w.jsxs)("div",{className:"relative z-10 w-full rounded-lg px-5 pt-5 pb-6 flex items-stretch justify-center gap-1.5",style:{backgroundColor:h.pink,color:h.ink},children:[(0,w.jsx)("span",{className:"text-[86px] leading-[0.76] tracking-[-0.02em]",children:u.percent}),(0,w.jsxs)("div",{className:"flex flex-col justify-between py-[3px]",children:[(0,w.jsx)("span",{className:"text-[34px] leading-[0.7]",children:"%"}),(0,w.jsx)("span",{className:"text-[30px] leading-[0.7] uppercase",children:u.offLabel})]})]}),(0,w.jsx)("div",{className:"relative z-20 rounded-md px-4 py-1.5 -mt-3 text-white uppercase leading-none tracking-[0.02em] text-[20px]",style:{backgroundColor:h.magenta},children:u.tagline}),(0,w.jsxs)("span",{className:"mt-3 flex items-center gap-2.5 rounded-full pl-1 pr-6 py-1",style:{backgroundColor:h.pink,color:h.ink},children:[(0,w.jsx)("span",{className:"flex items-center justify-center w-8 h-8 rounded-full shrink-0",style:{backgroundColor:h.magenta,color:"#fff"},children:(0,w.jsx)(i_.ShoppingCart,{size:16,strokeWidth:2.5})}),(0,w.jsx)("span",{className:"text-[19px] leading-none uppercase pt-[2px]",children:u.cta})]}),(0,w.jsxs)("div",{className:"mt-1.5 flex items-center gap-1 tabular-nums text-[16px] leading-none rounded-full px-2.5 py-1",style:{color:h.magenta,backgroundColor:h.cream},children:[(0,w.jsx)("span",{className:"uppercase opacity-70 mr-0.5",children:"Ends in"}),(0,iy.splitDuration)(a).map(e=>(0,w.jsxs)("span",{children:[String(e.value).padStart(2,"0"),e.label]},e.label))]})]})]})]})})})})}var iS=e.i(631499),iS=iS,i$=e.i(988745),iE=e.i(557515),iP=e.i(217297),iR=e.i(856817),iC=e.i(25071);let iO="u">typeof window?window:void 0,iM="u">typeof globalThis?globalThis:iO,iF=null==iM?void 0:iM.navigator,iI=null==iM?void 0:iM.document,iT=null==iM?void 0:iM.location,iA=null==iM?void 0:iM.fetch,iL=(null==iM?void 0:iM.XMLHttpRequest)&&"withCredentials"in new iM.XMLHttpRequest?iM.XMLHttpRequest:void 0,ij=null==iM?void 0:iM.AbortController,iD=null==iM?void 0:iM.CompressionStream,iN=null==iF?void 0:iF.userAgent;function iB(){return!(!iO||!1===iO.navigator.onLine)}let iq="u">typeof globalThis?globalThis:iO;iq&&"u"<typeof self&&(iq.self=iq),iq&&"u"<typeof File&&(iq.File=function(){});let iz=null!=iO?iO:{},iU="0.9.0",iH={DEBUG:!1,LIB_VERSION:iU,LIB_NAME:"browser-common",JS_SDK_VERSION:iU};var iW=((p={}).AnonymousId="anonymous_id",p.DistinctId="distinct_id",p.Props="props",p.EnablePersonProcessing="enable_person_processing",p.PersonMode="person_mode",p.FeatureFlagDetails="feature_flag_details",p.FeatureFlags="feature_flags",p.FeatureFlagPayloads="feature_flag_payloads",p.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",p.BootstrapFeatureFlags="bootstrap_feature_flags",p.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",p.OverrideFeatureFlags="override_feature_flags",p.Queue="queue",p.AiQueue="ai_queue",p.AiCaptureQueue="ai_capture_queue",p.LogsQueue="logs_queue",p.OptedOut="opted_out",p.SessionId="session_id",p.SessionStartTimestamp="session_start_timestamp",p.SessionLastTimestamp="session_timestamp",p.PersonProperties="person_properties",p.GroupProperties="group_properties",p.InstalledAppBuild="installed_app_build",p.InstalledAppVersion="installed_app_version",p.SessionReplay="session_replay",p.PushRegistered="push_registered",p.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",p.SurveyLastSeenDate="survey_last_seen_date",p.SurveysInProgress="surveys_in_progress",p.SurveysSeen="surveys_seen",p.Surveys="surveys",p.RemoteConfig="remote_config",p.FlagsEndpointWasHit="flags_endpoint_was_hit",p.DeviceId="device_id",p),iV=((f={}).GZipJS="gzip-js",f.Base64="base64",f);let iG=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],iK=["token"];function iJ(e,t){return -1!==e.indexOf(t)}let iX=function(e){return e.trim()},iY=function(e){return e.replace(/^\$/,"")};function iQ(e){var t;let i=[];return null!=(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(t))return"[Circular]";i.push(t)}return t}}))?t:"null"}let iZ=Object.prototype,i0=iZ.hasOwnProperty,i1=iZ.toString,i2=Array.isArray||function(e){return"[object Array]"===i1.call(e)},i3=e=>"function"==typeof e,i5=e=>e===Object(e)&&!i2(e),i6=e=>{if(i5(e)){for(let t in e)if(i0.call(e,t))return!1;return!0}return!1},i4=e=>void 0===e,i8=e=>"[object String]"==i1.call(e),i7=e=>i8(e)&&0===e.trim().length,i9=e=>null===e,re=e=>i4(e)||i9(e),rt=e=>"[object Number]"==i1.call(e)&&e==e,ri=e=>rt(e)&&e>0,rr=e=>"[object Boolean]"===i1.call(e),rs=e=>iJ(iG,e),rn=e=>iJ(iK,e);function ro(e){return null===e||"object"!=typeof e}function ra(e,t){return({}).toString.call(e)===`[object ${t}]`}function rl(e){switch(({}
1).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return rh(e,Error)}}function ru(e){return"u">typeof Event&&rh(e,Event)}function rh(e,t){try{return e instanceof t}catch(e){return!1}}let rc=[!0,"true",1,"1","yes"],rd=[!1,"false",0,"0","no"];function rp(e,t,i,r,s,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(r,s)}function rf(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function o(e){rp(n,r,s,o,a,"next",e)}function a(e){rp(n,r,s,o,a,"throw",e)}o(void 0)})}}let rg=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],rv=function(e,t=[]){if(!e)return!1;let i=e.toLowerCase();return rg.concat(t).some(e=>{let t=e.toLowerCase();return -1!==i.indexOf(t)})};function r_(e,t,i,r,s){return t>i&&(r.warn("min cannot be greater than max."),t=i),rt(e)?e>i?(r.warn(" cannot be  greater than max: "+i+". Using max value instead."),i):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+s),r_(null!=s?s:i,t,i,r))}var rm=class{constructor(e){this.C={},this.I=e.I,this.R=r_(e.bucketSize,0,100,e.$),this.A=r_(e.refillRate,0,this.R,e.$),this.O=r_(e.refillInterval,0,864e5,e.$)}F(e,t){let i=Math.floor((t-e.lastAccess)/this.O);i>0&&(e.tokens=Math.min(e.tokens+i*this.A,this.R),e.lastAccess=e.lastAccess+i*this.O)}consumeRateLimit(e){var t;let i=Date.now(),r=String(e),s=this.C[r];return s?this.F(s,i):(s={tokens:this.R,lastAccess:i},this.C[r]=s),0===s.tokens||(s.tokens--,0===s.tokens&&(null==(t=this.I)||t.call(this,e)),0===s.tokens)}stop(){this.C={}}};let ry="Mobile",rb="Android",rw="Tablet",rx="Android Tablet",rk="iPad",rS="Apple Watch",r$="Safari",rE="BlackBerry",rP="Samsung Internet",rR="Chrome",rC="Chrome iOS",rO="Internet Explorer",rM="Internet Explorer Mobile",rF="Opera",rI="Microsoft Edge",rT="Firefox",rA="Firefox iOS",rL="Nintendo",rj="PlayStation",rD="Xbox",rN="Android Mobile",rB="Mobile Safari",rq="Windows",rz="Windows Phone",rU="Nokia",rH="Ouya",rW="Generic "+ry.toLowerCase(),rV="Generic "+rw.toLowerCase(),rG="Konqueror",rK="Oculus Browser",rJ="Vivaldi",rX="Yandex",rY="Whale",rQ="DuckDuckGo",rZ="Pale Moon",r0="Waterfox",r1="Brave",r2="Claude",r3="Codex",r5="ChatGPT",r6="Google Search App",r4=RegExp("Version/(\\d+(\\.\\d+)?)"),r8=RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),r7=RegExp(rD,"i"),r9=RegExp("PlayStation \\w+","i"),se=RegExp("Nintendo \\w+","i"),st=RegExp("BlackBerry|PlayBook|BB10","i"),si={"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"},sr=function(e,t,i,r){var s;return t=t||"",((null==i?void 0:i.brave)?r1:null)||((null==r?void 0:r.detectGoogleSearchApp)&&iJ(e,"GSA/")?r6:iJ(e," OPR/")&&iJ(e,"Mini")?"Opera Mini":iJ(e," OPR/")?rF:st.test(e)?rE:iJ(e,"IEMobile")||iJ(e,"WPDesktop")?rM:iJ(e,"OculusBrowser")?rK:iJ(e,"SamsungBrowser")?rP:iJ(e,"Edge")||iJ(e,"Edg/")?rI:iJ(e,"Vivaldi/")?rJ:iJ(e,"YaBrowser/")?rX:iJ(e,"Whale/")?rY:iJ(e,"DuckDuckGo/")||iJ(e,"Ddg/")?rQ:iJ(e,"Claude/")?r2:iJ(e,"Codex/")?r3:iJ(e,"ChatGPT/")?r5:iJ(e,"FBIOS")?"Facebook Mobile":iJ(e,"UCWEB")||iJ(e,"UCBrowser")?"UC Browser":iJ(e,"CriOS")?rC:iJ(e,"CrMo")||iJ(e,rR)?rR:iJ(e,rb)&&iJ(e,r$)?rN:iJ(e,"FxiOS")?rA:iJ(e.toLowerCase(),rG.toLowerCase())?rG:iJ(e,"Brave/")?r1:(s=t)&&iJ(s,"Apple")||iJ(e,r$)&&!iJ(e,rR)&&!iJ(e,rb)?iJ(e,ry)?rB:r$:iJ(e,"PaleMoon/")?rZ:iJ(e,"Waterfox/")?r0:iJ(e,rT)?rT:iJ(e,"MSIE")||iJ(e,"Trident/")?rO:iJ(e,"Gecko")?rT:"")},ss={[rM]:[RegExp("rv:(\\d+(\\.\\d+)?)")],[rI]:[RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[rR]:[RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[rC]:[RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[r$]:[r4],[rB]:[r4],[rF]:[RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[rT]:[RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[rA]:[RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[rG]:[RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[rE]:[RegExp("BlackBerry (\\d+(\\.\\d+)?)"),r4],[rN]:[RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[rP]:[RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[rK]:[RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[rJ]:[RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[rX]:[RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[rY]:[RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[r1]:[RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[r2]:[r8],[r3]:[r8],[r5]:[r8],[rQ]:[RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[rZ]:[RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[r0]:[RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[r6]:[RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[rO]:[RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[RegExp("rv:(\\d+(\\.\\d+)?)")]},sn=function(e,t,i,r){let s=ss[sr(e,t,i,r)];if(i4(s))return null;for(let t=0;s.length>t;t++){let i=e.match(s[t]);if(i)return parseFloat(i[i.length-2])}return null},so=[[RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[rD,e&&e[1]||""]],[RegExp(rL,"i"),[rL,""]],[RegExp(rj,"i"),[rj,""]],[st,[rE,""]],[RegExp(rq,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[rz,""];if(new RegExp(ry).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];let i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){let e=si[i[1]]||"";return/arm/i.test(t)&&(e="RT"),[rq,e]}return[rq,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=i4(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[rb,[e[2],e[3],e[4]||"0"].join(".")]:[rb,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{let t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],sa=function(e){for(let t=0;so.length>t;t++){let[i,r]=so[t],s=i.exec(e),n=s&&(i3(r)?r(s,e):r);if(n)return n}return["",""]},sl=function(e){return se.test(e)?rL:r9.test(e)?rj:r7.test(e)?rD:RegExp(rH,"i").test(e)?rH:RegExp("(Windows Phone|WPDesktop)","i").test(e)?rz:/iPad/.test(e)?rk:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?rS:st.test(e)?rE:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(rU,"i").test(e)?rU:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(ry).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?rb:rx:RegExp("(pda|Mobile)","i").test(e)?rW:
1RegExp(rw,"i").test(e)&&!RegExp("Tablet pc","i").test(e)?rV:""},su=function(e,t){var i,r,s,n;let o=sl(e);return o===rk||o===rx||"Kobo"===o||"Kindle Fire"===o||o===rV?rw:o===rL||o===rD||o===rj||o===rH?"Console":o===rS?"Wearable":o?ry:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!=(n=null==t?void 0:t.maxTouchPoints)?n:0)>0?600>Math.min(null!=(i=null==t?void 0:t.screenWidth)?i:0,null!=(r=null==t?void 0:t.screenHeight)?r:0)/(null!=(s=null==t?void 0:t.devicePixelRatio)?s:1)?ry:rw:"Desktop"},sh=/\bFBAV\/(\d+(?:\.\d+)*)/i,sc=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",sh],[/\bFBAN\/EMA\b/i,"Facebook Lite",sh],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",sh],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],sd="[Truncated]",sp="[Unserializable]";function sf(e){let t="";for(let i=0;e.length>i;i++){let r=e.charCodeAt(i);if(55296>r||r>56319)t+=56320>r||r>57343?e[i]:"�";else{let r=e.charCodeAt(i+1);56320>r||r>57343?t+="�":(t+=e[i]+e[i+1],i++)}}return t}function sg(e,t){if(!t)return e;let i=[];try{i=Object.keys(t)}catch(e){i=[]}for(let r of i){let i;try{i=t[r]}catch(e){i=sp}Object.defineProperty(e,r,{value:i,enumerable:!0,writable:!0,configurable:!0})}return e}var sv=class{record(e){if("too-large"===e.kind)return;if("retry-later"!==e.kind)return void this.reset();if(!e.retryAfterMs)return;let t=this.isOpen(),i=Date.now(),r=Math.min(e.retryAfterMs,3e5);t?this.es=Math.max(this.es,Math.min(i+r,this.ts+3e5)):(this.ts=i,this.es=i+r)}remainingMs(){let e=Date.now();if(this.ts-5e3>e)return this.reset(),0;let t=Math.min(3e5,Math.max(0,this.es-e));return 0===t&&this.reset(),t}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};let s_=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function sm(e,t){return"string"==typeof e&&s_.test(e)?e:t()}function sy(e,t){let i=Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return i}function sb(e){return e?e.split("#")[0]:e}function sw(e){try{return e()}catch(e){return}}function sx(e,t){let i=setTimeout(e,t);return null!=i&&i.unref&&(null==i||i.unref()),i}function sk(e,t,i){return sS.apply(this,arguments)}function sS(){return(sS=rf(function*(e,t,i){let r;try{return yield Promise.race([e,new Promise((e,s)=>{r=sx(()=>{try{null==i||i(),e()}catch(e){s(e)}},t)})])}finally{clearTimeout(r)}})).apply(this,arguments)}function s$(e){return(s$="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sE(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function sP(e){for(var t=1;arguments.length>t;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?sE(Object(i),!0).forEach(function(t){!function(e,t,i){var r;(r=function(e){if("object"!=s$(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=s$(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==s$(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):sE(Object(i)).forEac
1h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}var sR=class{constructor(e,t,i=[]){this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t={}){let i=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,t,0).apply(e),s=this.buildParsingContext(t),n=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return rf(function*(){for(let i of e)i.stacktrace&&i.stacktrace.frames&&i2(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i;let r,s;if(null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack)try{s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)}catch(e){}return sP(sP({},e),{},{cause:r,stack:s,errors:null==(i=e.errors)?void 0:i.map(e=>this.parseStacktrace(e,t))})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(let i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return rf(function*(){let i=e;for(let e of t.modifiers)i=yield e(i);return i})()}convertToExceptionList(e,t){let i=[],r=(e,s,n)=>{var o;let a=i.length,l=void 0===s?sP(sP({type:"string"==typeof t.type&&t.type.length>0?t.type:"generic"},"boolean"==typeof t.handled?{handled:t.handled}:void 0===t.handled?{handled:!0}:{}),{},{synthetic:"boolean"==typeof t.synthetic?t.synthetic:e.synthetic,exception_id:a}):{type:"chained",source:n,synthetic:e.synthetic,exception_id:a,parent_id:s},u={type:e.type,value:e.value,mechanism:l};for(let t of(e.stack&&(u.stacktrace={type:"raw",frames:e.stack}),i.push(u),e.cause&&r(e.cause,a,"cause"),null!=(o=e.errors)?o:[]))r(t,a,"member")};return r(e),i}buildParsingContext(e){var s;return{chunkIdMap:function(e){let s=globalThis._posthogChunkIds;if(!s)return;let n=Object.keys(s);return r&&n.length===i||(i=n.length,r=n.reduce((i,r)=>{t||(t={});let n=t[r];if(n)i[n[0]]=n[1];else{let n=e(r);for(let e=n.length-1;e>=0;e--){let o=n[e],a=null==o?void 0:o.filename,l=s[r];if(a&&l){i[a]=l,t[r]=[a,l];break}}}return i},{})),r}(this.stackParser),skipFirstLines:null!=(s=e.skipFirstLines)?s:1}}getAggregateErrors(e){try{if(rl(e)){let i=Object.getPrototypeOf(e);for(let r=0;i&&100>r;r++){var t;let r=null==(t=Object.getOwnPropertyDescriptor(i,"constructor"))?void 0:t.value;if("function"==typeof r&&"AggregateError"===r.name){let t=e.errors;return i2(t)?t:void 0}i=Object.getPrototypeOf(i)}}}catch(e){}}buildCoercingContext(e,t,i=0){let r=0,s=0,n=!1,o=new Set,a=[],l={},u=(e,t,i=0)=>{let u,c,d=h(t,i),p=d.apply;if(d.apply=t=>{a.push(e);try{return p(t)}finally{a.pop()}},i>4||i>0&&-1!==a.indexOf(e))return this.coerceFallback(d);let f="object"==typeof e&&null!==e||"function"==typeof e;if(0===i&&r>=50||f&&o.has(e))return;f&&o.add(e),0===i&&r++;let g=this.getAggregateErrors(e);n||(n=!!g);try{if(!(u=this.applyCoercers(e,d)))throw l}catch(e){if(e===l)return void(0===i&&r--);if(!n)throw e;u=this.coerceFallback(d)}if(!g||r>=50)return u;try{c=g.length}catch(e){return u}if(!Number.isInteger(c)||0>c||c>0xffffffff)return u;let v=[];for(let e=0;50>r&&1e3>s&&c>e;e++){let i;s++;try{i=d.next(g[e])}catch(e){r++,i=this.coerceFallback(h(t+1))}i&&v.push(i)}return sP(sP({},u),{},{errors:v})},h=(i,r=0)=>sP(sP({},t),{},{syntheticException:0==i?t.syntheticException:void 0,mechanism:0==i?e:{},apply(e){let t=u(e,i,r+1);if(!t)throw l;return t},next:e=>u(e,i+1)}),c=h(i);return sP(sP({},c),{},{apply:e=>{var t;return null!=(t=u(e,i))?t:this.coerceFallback(c)}})}};let sC=/^([a-z][a-z0-9.+-]+):/i,sO=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function sM(e,t,i,r,s){let n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:function(e){if(!e||"<anonymous>"===e)return!1;let t=sC.exec(e);return!t||sO.includes(t[1].toLowerCase())}(t)};return i4(r)||(n.lineno=r),i4(s)||(n.colno=s),n}let sF=(e,t)=>{let i=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return i||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]}
1,sI=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,sT=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,sA=/\((\S*)(?::(\d+))(?::(\d+))\)/,sL=(e,t)=>{let i=sI.exec(e);if(i){let[,e,r,s]=i;return sM(t,e,"?",+r,+s)}let r=sT.exec(e);if(r){if(r[2]&&0===r[2].indexOf("eval")){let e=sA.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,i]=sF(r[1]||"?",r[2]);return sM(t,i,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},sj=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,sD=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,sN=(e,t)=>{let i=sj.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){let e=sD.exec(i[3]);e&&(i[1]=i[1]||"eval",i[3]=e[1],i[4]=e[2],i[5]="")}let e=i[3],r=i[1]||"?";return[r,e]=sF(r,e),sM(t,e,r,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},sB=/\(error: (.*)\)/;function sq(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function sz(e,t){let i=t.start;for(;i>0&&sq(e[i-1],e[i-1+t.length]);)i--;return t.start-i}function sU(e,t){let i=t.start+t.length,r=i;for(;e.length>r&&sq(e[r],e[r-t.length]);)r++;return r-i}var sH=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){let i=i8(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){let t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${t}: ${e.message}`:t}isDOMException(e){return ra(e,"DOMException")}isDOMError(e){return ra(e,"DOMError")}},sW=class{match(e){return rl(e)}coerce(e,t){var i;let r=this.getStack(e),s=void 0===r?null==(i=t.syntheticException)?void 0:i.stack:void 0;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=r?r:s,cause:e.cause?t.next(e.cause):void 0,synthetic:!!s}}getType(e){return e.name||e.constructor.name}getMessage(e,t){let i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){try{let t=e.stacktrace;if("string"==typeof t&&t.length>0)return t;let i=e.stack;return"string"==typeof i&&i.length>0?i:void 0}catch(e){return}}},sV=class{match(e){return!!ra(e,"ErrorEvent")&&(null!=e.error||this.ur(e))}coerce(e,t){var i;if(null!=e.error)return t.apply(e.error);let r=t.apply(e.message);return sP(sP({},r),{},{stack:null!=(i=this.cr(e))?i:r.stack,synthetic:!0})}ur(e){return i8(e.message)&&e.message.length>0}cr(e){var t,i;let r=null!=(t=e.lineno)?t:0,s=null!=(i=e.colno)?i:0;if(i8(e.filename)&&0!==e.filename.length&&0!==r)return`Error
2    at ${e.filename}:${r}:${s}`}};let sG=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var sK=class{match(e){return"string"==typeof e}coerce(e,t){var i;let[r,s]=this.getInfos(e);return{type:null!=r?r:"Error",value:null!=s?s:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){let t="Error",i=e,r=e.match(sG);return r&&(t=r[1],i=r[2]),[t,i]}};let sJ=["fatal","error","warning","log","info","debug"];function sX(e,t=40){let i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(let e=i.length;e>0;e--){let r=i.slice(0,e).join(", ");if(t>=r.length)return e===i.length?r:r.length>t?`${r.slice(0,t)}...`:r}return""}var sY=class{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,r;let s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:null!=(i=this.getStack(e))?i:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(ru(e))return e.constructor.name;let t="name"in e?e.name:void 0;return i8(t)&&!i7(t)?t:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){let t=`'${e.name}' captured as exception`;return"message"in e&&"string"==typeof e.message&&(t+=` with message: '${e.message}'`),t}if("message"in e&&"string"==typeof e.message)return e.message;let t=this.getObjectClassName(e);return`${t&&"Object"!==t?`'${t}'`:"Object"} captured as exception with keys: ${sX(e)}`}isSeverityLevel(e){return i8(e)&&!i7(e)&&sJ.indexOf(e)>=0}getStack(e){try{return i8(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:i8(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(let t in e)if(({}).hasOwnProperty.call(e,t)){let i=e[t];if(rl(i))return i}}getObjectClassName(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}},sQ=class{match(e){return ru(e)}coerce(e,t){var i;let r=e.constructor.name;return{type:r,value:`${r} captured as exception with keys: ${sX(e)}`,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}},sZ=class{match(e){return ro(e)}coerce(e,t){var i;return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}},s0=class{match(e){return ra(e,"PromiseRejectionEvent")||this.isCu
2stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ru(e))return!1;try{let t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var i;let r=this.getUnhandledRejectionReason(e);return ro(r)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(r)}`,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}};let s1="$message",s2="$timestamp",s3=new Set([s1,s2]),s5={enabled:!0,max_bytes:32768};function s6(e){var t;return e?{enabled:null!=(t=e.enabled)?t:s5.enabled,max_bytes:function(e,t){if(!rt(e)||1/0===e||-1/0===e)return t;let i=Math.floor(e);return 0>i?t:i}(e.max_bytes,s5.max_bytes)}:sP({},s5)}var s4=class{constructor(e){this.ns=[],this.ss=0,this.Rr=s6(e)}setConfig(e){this.Rr=s6(e),this.rs()}add(e){let t=function(e){let t;try{t=iQ(e)}catch(e){return}try{let e=JSON.parse(t);if(!i5(e))return;let i=e[s1],r=e[s2];if(!i8(i)||0===i.trim().length||!i8(r)&&!rt(r))return;return{step:e,json:t}}catch(e){return}}(e);if(!t)return;let i=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;let t=encodeURIComponent(e),i=0;for(let e=0;t.length>e;e++)"%"===t[e]?(i+=1,e+=2):i+=1;return i}(t.json);i>this.Rr.max_bytes||(this.ns.push({step:t.step,bytes:i}),this.ss+=i,this.rs())}getAttachable(){return this.ns.map(e=>e.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Rr.max_bytes&&this.ns.length>0;){let e=this.ns.shift();e&&(this.ss-=e.bytes)}}};let s8=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function s7(e){return"string"==typeof e||e}function s9(e){return"string"==typeof e?e:void 0}let ne=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],nt="NativeGzipValidationError",ni=e=>e.length>=2&&31===e[0]&&139===e[1],nr=(e,t)=>e===iV.GZipJS||t===iV.GZipJS||"gzip"===t,ns=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),nn=e=>{throw sy(nt,`Native gzip produced invalid output: ${e}`)},no=(b=rf(function*(e,t){18>e.size&&nn("too-short");let i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));ni(i)&&8===i[2]||nn("invalid-header");let r=new DataView((yield e.slice(e.size-8).arrayBuffer()));r.getUint32(0,!0)!==(e=>{let t=(()=>{if(s)return s;s=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)t=1&t?0xedb88320^t>>>1:t>>>1;s[e]=t>>>0}return s})(),i=0xffffffff;for(let r=0;e.length>r;r++)i=t[255&(i^e[r])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&nn("invalid-crc");let n=t.length>>>0;r.getUint32(4,!0)!==n&&nn("invalid-size")}),function(e,t){return b.apply(this,arguments)});function na(){return(na=rf(function*(e,t=!0,i){var r;try{let t=(new TextEncoder).encode(e),i=new globalThis.CompressionStream("gzip"),s=i.writable.getWriter(),n=s.write(t).then(()=>s.close()).catch((r=rf(function*(e){try{yield s.abort(e)}catch(e){}throw e}),function(e){return r.apply(this,arguments)})),o=new Response(i.readable).blob(),[a]=yield Promise.all([o,n]);return yield no(a,t),a}catch(e){if(null==i?void 0:i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}function nl(e,t){if(null==e)return{};var i,r,s=function(e,t){if(null==e)return{};var i={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(t.includes(r))continue;i[r]=e[r]}return i}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;n.length>r;r++)t.includes(i=n[r])||({}).propertyIsEnumerable.call(e,i)&&(s[i]=e[i])}return s}let nu={}.propertyIsEnumerable;function nh(e,t){try{return nc(e,t,{ancestors:new WeakSet,remainingNodes:1e4}
2,0)}catch(e){return[]}}function nc(e,t,i,r){let s=[];for(let n in e)if(nu.call(e,n)){if(!n){null==t||t.debug("Dropping an attribute with an empty key");continue}if(s.length>=1e3||0>=i.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{let o=e[n];if(i9(o)||i4(o))continue;s.push({key:sf(n),value:function e(t,i,r,s){if(0>=r.remainingNodes)return{stringValue:sd};if(r.remainingNodes--,rr(t))return{boolValue:t};if("bigint"==typeof t){let e,r;return e=t.toString(),t>=(r=BigInt("9223372036854775808"))||-r>t?(null==i||i.debug(`Attribute ${e} is outside the int64 range; encoding it as a string`),{stringValue:e}):{intValue:e}}if("number"==typeof t){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};let e=BigInt(t).toString();return t>=0x8000000000000000||-0x8000000000000000>t?(null==i||i.debug(`Attribute ${e} is outside the int64 range; encoding it as a string`),{stringValue:e}):{intValue:e}}return{doubleValue:t}}if("string"==typeof t)return{stringValue:sf(t)};if("function"==typeof t)return{stringValue:"[Function]"};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(r.ancestors.has(t))return{stringValue:"[Circular]"};if(s>=20)return{stringValue:sd};if(t instanceof Date){let e=Number.isFinite(t.getTime())?t.toISOString():String(t);return{stringValue:"string"==typeof e?sf(e):String(e)}}r.ancestors.add(t);try{try{let n=t.toJSON;if("function"==typeof n)return e(n.call(t),i,r,s+1)}catch(e){}return i2(t)?{arrayValue:{values:function(t,i,r,s){let n=[],o=Math.min(t.length,1e3),a=0;for(;o>a&&r.remainingNodes>0;a++)try{let o=a in t?t[a]:void 0;if(re(o))continue;n.push(e(o,i,r,s))}catch(e){n.push({stringValue:sp})}return t.length>a&&n.push({stringValue:sd}),n}(t,i,r,s+1)}}:{kvlistValue:{values:nc(t,i,r,s+1)}}}finally{r.ancestors.delete(t)}}return{stringValue:sf(String(t))}}(o,t,i,r)})}catch(e){s.push({key:sf(n),value:{stringValue:sp}})}}return s}function nd(e,t,i){return sP(sP(sP(sP({},sg({},e.resourceAttributes)),{},{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment}),e.serviceVersion&&{"service.version":e.serviceVersion}),{},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}let np=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function nf(e,t){let i=sg({},e),r={};for(let e of np)({}).hasOwnProperty.call(i,e)&&(r[e]=i[e],delete i[e]);return[...nh(i,t),...nh(r,t)]}let ng={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},nv={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},n_=nv.info;function nm(e,t,i,r){return{resourceLogs:[{resource:{attributes:nf(t)}
2,scopeLogs:[{scope:{name:i,version:r},logRecords:e}]}]}}var ny=class{constructor(e){this.ls=e,this.us=0}get pending(){return!!this.hs}arm(e){this.clear(),this.us=Date.now()+e,this.hs=sx(()=>{this.hs=void 0,this.ls()},e)}armNoEarlierThan(e){this.hs&&Date.now()+e<=this.us||this.arm(e)}clear(){this.hs&&(clearTimeout(this.hs),this.hs=void 0)}};function nb(){return .75+.5*Math.random()}function nw(e,t,i,r){let s=e*Math.pow(2,Math.min(Math.max(0,t-1),6));return Math.round((void 0===r?s:Math.min(s,Math.max(r,e)))*i)}var nx=class{constructor(e,t,i,r,s,n=()=>Promise.resolve(),o){var a;this._instance=e,this.Rr=t,this.$=i,this.cs=r,this.ds=s,this.vs=n,this.fs=o,this.ps=new ny(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new sv,this.ks=0,this.Ss=1,this.xs=0,this.Cs=0,this.$s=!1,this.Ts=t.maxBufferSize,this.Is=Math.max(null!=(a=t.maxQueueSize)?a:t.maxBufferSize,t.maxBufferSize),this.Ms=t.flushIntervalMs,this.Es=t.maxBatchRecordsPerPost,this.Ps=t.rateCapWindowMs,this.Rs=t.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(iW.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.Cs=0,this.$s=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Rr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(e,t){var i;if(this._instance.isDisabled||this._instance.optedOut||!(null==e?void 0:e.body))return;let r=this.Os(e);if(null===r)return;if(!r.body)return void this.$.info("Log was rejected in beforeSend function");if(!this.Ds())return;let s={record:function(e,t,i,r){let{text:s,number:n}=nv[e.level||"info"]||n_,o=function(e=Date.now()){return String(e)+"000000"}(rt(r)?r:void 0),a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a["window.id"]=t.windowId),re(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),re(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);let l=sP({},a),u=e.attributes;if(u){let e=[];try{e=Object.keys(u)}catch(t){e=[]}for(let t of e){let e;try{e=u[t]}catch(t){e=sp}Object.defineProperty(l,t,{value:e,enumerable:!0,writable:!0,configurable:!0})}}let h={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:n,severityText:s,body:{stringValue:function(e){try{return sf(String(e))}catch(e){return sp}}(e.body)},attributes:nh(l,i)};return e.trace_id&&(h.traceId=e.trace_id),e.span_id&&(h.spanId=e.span_id),i4(e.trace_flags)||(h.flags=e.trace_flags),h}(r,null!=(i=null==t?void 0:t.context)?i:this.cs(),this.$,null==t?void 0:t.occurredAtMs)};this.ds(()=>this.Ls(s))}Os(e){let t=this.Rr.beforeSend;if(!t)return e;let i=i2(t)?t:[t],r=e;for(let e of i)try{let t=e(r);if(!t)return this.$.info("Log was rejected in beforeSend function"),null;r=t}catch(e){return this.$.error("Error in beforeSend function for log:",e),null}return r}Ds(){if(void 0===this.Rs)return!0;let e=Date.now(),t=e-this.xs;return this.Ps>t&&t>=0||(this.xs=e,this.Cs=0,this.$s=!1),this.Rs>this.Cs?(this.Cs++,!0):(this.$s||(this.$.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.$s=!0),!1)}flush(){var e=this;return rf(function*(){if(!e._instance.isDisabled)return e.ys||(e.ys=e.Ns().finally(()=>{e.ys=null})),e.ys})()}Ns(){var e=this;return rf(function*(){var t,i,r;e.ps.clear();let s=null!=(t=e._instance.getPersistedProperty(iW.LogsQueue))?t:[];if(0===s.length)return;let n=s.length,o=0;for(;s.length>0&&n>o;){let t=e._s;e.bs=0;let n=Math.min(s.length,e.Es),a=s.slice(0,n),l=nm(a.map(e=>e.record),e.qs(),null!=(i=e.fs)?i:e._instance.getLibraryId(),e._instance.getLibraryVersion()),u=yield e._instance.js(l);if(e._s!==t)return;if("too-large"===u.kind&&a.length>1)e.Es=Math.max(1,Math.floor(a.length/2)),e.$.warn(`Logs batch of size ${a.length} was too large for the ingestion endpoint, reducing batch size to ${e.Es}`);else if(e.ws.record(u),e.ps.pending&&e.ps.arm(Math.max(e.Ms,e.ws.remainingMs())),"retry-later"===u.kind||("too-large"===u.kind?e.$.warn("Dropping a single log record with batch size 1 — the record 
2is larger than the server cap and cannot be split further."):"ok"===u.kind&&e.Rr.maxBatchRecordsPerPost>e.Es&&(e.Es=Math.min(e.Rr.maxBatchRecordsPerPost,e.Es+1)),yield e.Bs(a.length),s=null!=(r=e._instance.getPersistedProperty(iW.LogsQueue))?r:[],o+=a.length,"fatal"===u.kind))throw u.error}})()}Bs(e){var t=this;return rf(function*(){var i;let r=Math.max(0,e-t.bs),s=null!=(i=t._instance.getPersistedProperty(iW.LogsQueue))?i:[];t._instance.setPersistedProperty(iW.LogsQueue,s.slice(r)),yield t.vs()})()}qs(){var e;return e=this.Rr,nd(e,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(e){var t;if(this._instance.optedOut)return;let i=null!=(t=this._instance.getPersistedProperty(iW.LogsQueue))?t:[];this.Is>i.length||(i.shift(),this.bs++,this.$.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(iW.LogsQueue,i),this.Ts>i.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}Hs(){return Math.max(nw(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){let e=this._instance.getPersistedProperty(iW.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return rf(function*(){t.ps.clear();let i=t.flush().catch(()=>{});void 0!==e?yield sk(i,e):yield i})()}flushWithTimeout(e){var t=this;return rf(function*(){let i=t.flush();yield sk(i,e,()=>{i.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},e=>{this.ks++,this.Ss=nb(),this.$.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.Hs())})}};let nk=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function nS(e){return String(e)+"000000"}function n$(e,t,i,r){let s="";return r&&(s=Object.keys(r).sort().map(e=>`${JSON.stringify(e)}:${JSON.stringify(r[e])}`).join(",")),`${e}\0${t}\0${null!=i?i:""}\0${s}`}var nE=class{constructor(e,t,i){this._instance=e,this.Rr=t,this.$=i,this.zs=new Map,this.ps=new ny(()=>this.flush().catch(e=>{this.$.error("Metrics flush failed:",e)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new sv,this.ks=0,this.Ss=1,this.Gs=0}count(e,t=1,i){this.Zs({name:e,type:"count",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(e,t,i){this.Zs({name:e,type:"gauge",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(e,t,i){this.Zs({name:e,type:"histogram",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var e,t=this;let i=this.ys,r=(e=rf(function*(){i&&(yield i.catch(()=>{})),yield t.Qs()}),function(){return e.apply(this,arguments)})().finally(()=>{this.ys===r&&(this.ys=null)});return this.ys=r,r}drainWindow(){if(0===this.zs.size)return null;let e=this.zs;return this.zs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(e)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.zs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Zs(e){let t,i;if(this._instance.isDisabled||this._instance.optedOut)return;let r=this.Os(e);if(null===r)return;if(!r.name||"string"!=typeof r.name)return void this.$.warn("Dropping metric with empty name");if("number"!=typeof r.value||!Number.isFinite(r.value))return void this.$.warn(`Dropping metric '${r.name}': value must be a finite number`);if("count"===r.type&&0>r.value)return void this.$.warn(`Dropping count '${r.name}': counters are monotonic, value must be >= 0`);try{t=r.attributes?sP({},r.attributes):void 0,i=n$(r.type,r.name,r.unit,t)}catch(e){return void this.$.warn(`Dropping metric '${r.name}': attributes could not be serialized`,e)}let s=this.zs.get(i);if(!s){if(!this.Ks())return;s={name:r.name,type:r.type,unit:r.unit,attributes:t,windowStartMs:Date.now()},this.zs.set(i,s)}let n=this.Ws.get(r.name);void 0===n?this.Ws.set(r.name,r.type):n===r.type||this.Vs.has(r.name)||(this.Vs.add(r.name),this.$.warn(`Metric name '${r.name}' is already used as a ${n}; recording it as a ${r.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(s,r.value),this.Fs()}Ks(){return this.Rr.maxSeriesPerFlush>this.zs.size||(this.Us||(this.Us=!0,this.$.warn(`Metric series cap reached (${this.Rr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(e,t){switch(e.type){case"count":var i;e.total=(null!=(i=e.total)?i:0)+t;break;case"gauge":e.last=t;break;case"histogram":{e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:Array(nk.length+1).fill(0)});let i=e.hist;i.count+=1,i.sum+=t,i.min=Math.min(i.min,t),i.max=Math.max(i.max,t),i.bucketCounts[function(e,t){for(let i=0;t.length>i;i++)if(t[i]>=e)return i;return t.length}(t,nk)]+=1}}}Os(e){let t=this.Rr.beforeSend;if(!t)return e;let i=i2(t)?t:[t],r=e;for(let e of i)try{let t=e(r);if(!t)return this.$.info("Metric was rejected in beforeSend function"),null;r=t}catch(e){return this.$.error("Error in beforeSend function for metric:",e),null}return r}Fs(){this.ps.pending||this.ps.arm(this.Hs())}Hs(){return Math.max(nw(this.Rr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Qs(){var e=this;return rf(function*(){if(e.ps.clear(),0===e.zs.size)return;let t=e.zs;e.zs=new Map,e.Us=!1,e.Ws=new Map,e.Vs=new Set;let i=e.Gs,r=yield e._instance.Ys(e.Js(t));if(i===e.Gs)switch(e.ws.record(r),"retry-later"===r.kind?(e.ks++,e.Ss=nb()):(e.ks=0,e.Ss=1),e.ps.pending&&e.ps.arm(e.Hs()),r.kind){case"ok":return;case"retry-later":return e.ho(t),void e.ps.armNoEarlierThan(e.Hs());case"too-large":return void e.$.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.$.error("Failed to send metrics batch:",r.error)}})()}Js(e){var t,i,r,s;return t=this.vo(e),i=nd(this.Rr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r
2=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:nf(i)},scopeMetrics:[{scope:{name:r,version:s},metrics:t}]}]}}vo(e){let t=nS(Date.now()),i=new Map;for(let o of e.values()){var r,s,n;let e=n$(o.type,o.name,o.unit,void 0),a=i.get(e);a||(a=sP({name:o.name},o.unit&&{unit:o.unit}),"count"===o.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===o.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(e,a));let l=nh(null!=(r=o.attributes)?r:{},this.$),u=nS(o.windowStartMs);if("count"===o.type){let e={attributes:l,startTimeUnixNano:u,timeUnixNano:t,asDouble:null!=(s=o.total)?s:0};a.sum.dataPoints.push(e)}else if("gauge"===o.type){let e={attributes:l,timeUnixNano:t,asDouble:null!=(n=o.last)?n:0};a.gauge.dataPoints.push(e)}else o.hist&&a.histogram.dataPoints.push({attributes:l,startTimeUnixNano:u,timeUnixNano:t,count:o.hist.count,sum:o.hist.sum,min:o.hist.min,max:o.hist.max,bucketCounts:o.hist.bucketCounts,explicitBounds:nk})}return Array.from(i.values())}ho(e){for(let[r,s]of e){let e=this.zs.get(r);if(e)switch(e.windowStartMs=Math.min(e.windowStartMs,s.windowStartMs),e.type){case"count":var t,i;e.total=(null!=(t=e.total)?t:0)+(null!=(i=s.total)?i:0);break;case"gauge":break;case"histogram":if(s.hist)if(e.hist){e.hist.count+=s.hist.count,e.hist.sum+=s.hist.sum,e.hist.min=Math.min(e.hist.min,s.hist.min),e.hist.max=Math.max(e.hist.max,s.hist.max);for(let t=0;e.hist.bucketCounts.length>t;t++)e.hist.bucketCounts[t]+=s.hist.bucketCounts[t]}else e.hist=s.hist}else this.Ks()&&this.zs.set(r,s)}}};let nP=(e,{debugEnabled:t}={})=>{let i={N(i,...r){iO&&(iH.DEBUG||iO.POSTHOG_DEBUG||t)&&!i4(iO.console)&&iO.console&&("__rrweb_original__"in iO.console[i]?iO.console[i].__rrweb_original__:iO.console[i])(e,...r)},debug(...e){i.N("debug",...e)},info(...e){i.N("log",...e)},warn(...e){i.N("warn",...e)},error(...e){i.N("error",...e)},critical(...t){console.error(e,...t)},uninitializedWarning(e){i.error(`You must initialize PostHog before calling ${e}`)},createLogger:(t,i)=>nP(`${e} ${t}`,i)};return i},nR=nP("[PostHog.js]"),nC=nR.createLogger,nO=nC("[ExternalScriptsLoader]"),nM=e=>{let t=null==iI?void 0:iI.querySelectorAll("script");if(t){for(let i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]}},nF=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return nO.warn(`${t} was requested but loading of external scripts is disabled.`),i("Loading of external scripts is disabled");let r=nM(t);if(r){if(r.__posthog_loading_callback_fired)return i();let e=r.__posthog_loading_error;return e?i(e):(r.addEventListener("load",e=>{r.__posthog_loading_callback_fired=!0,i(void 0,e)}),void r.addEventListener("error",e=>{r.__posthog_loading_error=e,i(e)}))}let s=()=>{if(!iI)return i("document not found");if(nM(t))return nF(e,t,i);let r=iI.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,i(void 0,e)},r.onerror=e=>{r.__posthog_loading_error=e,i(e)},e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)iI.head.appendChild(r);else{var s;let e=iI.querySelectorAll("body > script");e.length>0?null==(s=e[0].parentNode)||s.insertBefore(r,e[0]):iI.body.appendChild(r)}};(null==iI?void 0:iI.body)?s():null==iI||iI.addEventListener("DOMContentLoaded",s)},nI={},nT=(e,t)=>{let i=`/static/${t}.js?v=${e.version}`;return"toolbar"===t&&(i=`${i}&t=${3e5*Math.floor(Date.now()/3e5)}`),e.requestRouter.endpointFor("assets",i)};iz.__PosthogExtensions__=iz.__PosthogExtensions__||{},iz.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"===t){let t=e.requestRouter.endpointFor("assets",`/array/${e.config.token}/config.js`);return void nF(e,t,i)}let r=e.config.strict_script_versioning;if(r){let s=e.requestRouter.endpointFor("assets",`/static/${e.version}/${t}.js`),n=nI[s];if("fallback"===r&&n){if(nM(n))return void nF(e,n,i);delete nI[s]}return void nF(e,s,"fallback"===r?(r,n)=>{if(r)if("string"==typeof r)i(r);else{var o;let r=nT(e,t);nI[s]=r;let n=nM(s);null==n||null==(o=n.parentNode)||o.removeChild(n),nF(e,r,i)}else i(void 0,n)}:i)}nF(e,nT(e,t),i)},iz.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{let r=e.requestRouter.endpointFor("api",t);nF(e,r,i)}
2,iH.DEBUG=!1,iH.LIB_VERSION="1.435.1",iH.LIB_NAME="web";let nA="distinct_id",nL="$device_id",nj="$device_model",nD="__alias",nN="$fbc",nB="$fbc_persistence",nq="$fbp",nz="$fbp_persistence",nU="__timers",nH="$autocapture_disabled_server_side",nW="$heatmaps_enabled_server_side",nV="$exception_capture_enabled_server_side",nG="$error_tracking_suppression_rules",nK="$error_tracking_capture_extension_exceptions",nJ="$web_vitals_enabled_server_side",nX="$dead_clicks_enabled_server_side",nY="$product_tours_enabled_server_side",nQ="$logs_capture_enabled_server_side",nZ="$web_vitals_allowed_metrics",n0="$session_recording_remote_config",n1="$sesid",n2="$session_is_sampled",n3="$enabled_feature_flags",n5="$active_feature_flags",n6="$early_access_features",n4="$feature_flag_details",n8="$feature_flag_payloads",n7="$feature_flag_request_id",n9="$minimal_flag_called_events",oe="$override_feature_flags",ot="$override_feature_flag_payloads",oi="$stored_person_properties",or="$stored_group_properties",os="$groups",on="$surveys",oo="$surveys_loaded_at",oa="$surveys_activated",ol="$surveys_activated_session",ou="$surveys_activated_timestamps",oh="ph_product_tours",oc="$flag_call_reported",od="$flag_call_reported_session_id",op="$feature_flag_errors",of="$feature_flag_evaluated_at",og="$user_state",ov="$client_session_props",o_="$initial_campaign_params",om="$initial_referrer_info",oy="$initial_person_info",ob="$epp",ow="$posthog_cookieless",ox="$cookieless_mode",ok="$sdk_debug_extensions_init_method",oS="$sdk_debug_extensions_init_time_ms",o$="$sdk_debug_recording_script_not_loaded",oE="$sdk_debug_replay_stale_config",oP="PostHog loadExternalDependency extension not found.",oR="anonymous",oC="identified",oO="identified_only",oM="visibilitychange",oF="beforeunload",oI="$pageview",oT="$pageleave",oA="$identify",oL="$groupidentify";function oj(e,t){i2(e)&&e.forEach(t)}function oD(e,t){if(!re(e))if(i2(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(let i in e)i0.call(e,i)&&t(e[i],i)}let oN=function(e,...t){for(let i of t)for(let t in i)void 0!==i[t]&&(e[t]=i[t]);return e};function oB(e){let t=Object.keys(e),i=t.length,r=Array(i);for(;i--;)r[i]=[t[i],e[t[i]]];return r}let oq=function(e){return function(...t){try{return e.apply(this,t)}catch(e){nR.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),nR.critical(e)}}},oz=function(e){let t={};return oD(e,function(e,i){(i8(e)&&e.length>0||rt(e))&&(t[i]=e)}),t};function oU(e){let t=sP({},e);for(let i of["name","message","stack","cause","errors"])try{i in e&&(t[i]=e[i])}catch(e){}return t}let oH=["herokuapp.com","vercel.app","netlify.app"];function oW(e,t,i,r){let{capture:s=!1,passive:n=!0}=null!=r?r:{};null==e||e.addEventListener(t,i,{capture:s,passive:n})}function oV(e){return"ph_toolbar_internal"===e.name}let oG=e=>{if(iI){try{let t=e+"=",i=iI.cookie.split(";").filter(e=>e.length);for(let e=0;i.length>e;e++){let r=i[e];for(;" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return rt(e)&&isFinite(e)&&Math.floor(e)===e});var oK=class e{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(t,i,r,s){if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||!Number.isInteger(s)||0>t||0>i||0>r||0>s||t>0xffffffffffff||i>4095||r>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");let n=new Uint8Array(16);return n[0]=t/0x10000000000,n[1]=t/0x100000000,n[2]=t/0x1000000,n[3]=t/65536,n[4]=t/256,n[5]=t,n[6]=112|i>>>8,n[7]=i,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s,new e(n)}toString(){let e="";for(let t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new e(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(let t=0;16>t;t++){let i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}},oJ=class{generate(){let e=this.generateOrAbort();if(!i4(e))return e;{this.Ct=0;let e=this.generateOrAbort();if(i4(e))throw Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){let e,t=rt(e=Date.now())&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0;if(t>this.Ct)this.Ct=t,this.Mt();else{if(this.Ct>=t+1e4)return;this.It++,this.It>0x3ffffffffff&&(this.Ct++,this.Mt())}return oK.fromFieldsV7(this.Ct,Math.trunc(this.It/0x40000000),0x3fffffff&this.It,this.Tt.nextUint32())}Mt(){this.It=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.It=0,this.Tt=new oY}};let oX=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(let t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};iO&&!i4(iO.crypto)&&crypto.getRandomValues&&(oX=e=>crypto.getRandomValues(e));var oY=class{nextUint32(){return this.Rt.length>
2this.$t||(oX(this.Rt),this.$t=0),this.Rt[this.$t++]}constructor(){this.Rt=new Uint32Array(8),this.$t=1/0}};let oQ=()=>oZ().toString(),oZ=()=>(n||(n=new oJ)).generate(),o0="",o1=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,o2=null,o3={Et(){if(!i9(o2))return o2;if(o2=!1,iI)try{let e=`__ph_cookie_support_${oQ()}`;o3.At(e,"xyz"),o2='"xyz"'===oG(e),o3.Lt(e)}catch(e){o2=!1}return o2},Pt(e){nR.error("cookieStore error: "+e)},Ot:oG,Dt(e){let t;try{t=JSON.parse(o3.Ot(e))||{}}catch(e){}return t},At(e,t,i,r,s){if(!iI)return!1;try{let n="",o="",a=function(e,t){if(t){let t=function(e,t=iI){if(o0)return o0;if(!t||["localhost","127.0.0.1"].includes(e))return"";let i=e.split("."),r=Math.min(i.length,8),s="dmn_chk_"+oQ();for(;!o0&&r--;){let e=i.slice(r).join("."),n=s+"=1;domain=."+e+";path=/";t.cookie=n+";max-age=3",t.cookie.includes(s)&&(t.cookie=n+";max-age=0",o0=e)}return o0}(e);if(!t){let i,r=(i=e.match(o1))?i[0]:"";r!==t&&nR.info("Warning: cookie subdomain discovery mismatch",r,t),t=r}return t?"; domain=."+t:""}return""}(iI.location.hostname,r);if(i){let e=new Date;e.setTime(e.getTime()+864e5*i),n="; expires="+e.toUTCString()}s&&(o="; secure");let l=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&nR.warn("cookieStore warning: large cookie, len="+l.length),iI.cookie=l,!0}catch(e){return!1}},Lt(e,t){if((null==iI?void 0:iI.cookie)&&(!t||!i9(oG(e))))try{o3.At(e,"",-1,t)}catch(e){return}}},o5=null,o6={Et(){if(!i9(o5))return o5;let e=!0;if(i4(iO))e=!1;else try{let t="__mplssupport__";o6.At(t,"xyz"),'"xyz"'!==o6.Ot(t)&&(e=!1),o6.Lt(t)}catch(t){e=!1}return e||nR.error("localStorage unsupported; falling back to cookie store"),o5=e,e},Pt(e){nR.error("localStorage error: "+e)},Ot(e){try{return null==iO?void 0:iO.localStorage.getItem(e)}catch(e){o6.Pt(e)}return null},Dt(e){try{return JSON.parse(o6.Ot(e))||{}}catch(e){}return null},At(e,t){try{return null==iO||iO.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){o6.Pt(e)}return!1},Lt(e){try{null==iO||iO.localStorage.removeItem(e)}catch(e){o6.Pt(e)}}},o4=[oi,n5,n3,n4,n8,n7,of,op,oc],o8=[nL,nA,n1,n2,ob,oy,nB,og],o7=["__proto__","constructor","prototype"],o9=e=>{if(!i5(e))return{};let t={};return Object.keys(e).forEach(i=>{-1===o7.indexOf(i)&&(t[i]=e[i])}),t},ae=(e,t=[])=>{let i={};return[...o8,...t].forEach(t=>{let r=e[t];i4(r)||i9(r)||""===r||(i[t]=r)}),i},at=e=>{let t=5381,i=0x811c9dc5;for(let r=0;e.length>r;r++){let s=e.charCodeAt(r);t=33*t^s,i=Math.imul(i^s,0x1000193)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},ai=(e,t)=>({p:t,f:at(JSON.stringify(e))}),ar=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{let i=o3.Dt(e+"_cpm"),r=(null==i?void 0:i.f)===at(t)&&i2(i.p);return{properties:r?i.p:[],isValid:r}}catch(e){return{properties:[],isValid:!1}}},as=(e,t)=>t+"|"+(o3.Ot(e+"_cpm")||""),an={},ao={Et:()=>!0,Pt(e){nR.error("memoryStorage error: "+e)},Ot:e=>e in an?an[e]:null,Dt:e=>e in an?an[e]:null,At:(e,t)=>(an[e]=t,!0),Lt(e){delete an[e]}},aa=null,al={Et(){if(!i9(aa))return aa;if(aa=!0,i4(iO))aa=!1;else try{let e="__support__";al.At(e,"xyz"),'"xyz"'!==al.Ot(e)&&(aa=!1),al.Lt(e)}catch(e){aa=!1}return aa},Pt(e){nR.error("sessionStorage error: ",e)},Ot(e){try{return null==iO?void 0:iO.sessionStorage.getItem(e)}catch(e){al.Pt(e)}return null},Dt(e){try{return JSON.parse(al.Ot(e))||null}catch(e){}return null},At(e,t){try{return null==iO||iO.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){al.Pt(e)}return!1},Lt(e){try{null==iO||iO.sessionStorage.removeItem(e)}catch(e){al.Pt(e)}}};var au=class{constructor(e){this._instance=e}get Rr(){return this._instance.config}get consent(){return this.No()?0:this.qo}isOptedOut(){return"always"===this.Rr.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Rr.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Rr.opt_out_capturing_by_default}optInOut(e){this.jo.At(this.Bo,+!!e,this.Rr.cookie_expiration,this.Rr.cross_subdomain_cookie,this.Rr.secure_cookie)}reset(){this.jo.Lt(this.Bo,this.Rr.cross_subdomain_cookie)}get Bo(){let{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;
2return i||(t?t+e:"__ph_opt_in_out_"+e)}get qo(){let e=this.jo.Ot(this.Bo);return iJ(rc,e)?1:iJ(rd,e)?0:-1}get jo(){let e=this.Rr.opt_out_capturing_persistence_type,t="localStorage"===e?o6:o3,i=t.Et()?t:ao;if(!this.Ho||this.Ho!==i){this.Ho=i;let t="localStorage"===e?o3:o6;t.Ot(this.Bo)&&(this.Ho.Ot(this.Bo)||this.optInOut(iJ(rc,t.Ot(this.Bo))),t.Lt(this.Bo,this.Rr.cross_subdomain_cookie))}return this.Ho}No(){return!!this.Rr.respect_dnt&&[null==iF?void 0:iF.doNotTrack,null==iF?void 0:iF.msDoNotTrack,iz.doNotTrack,null==iF?void 0:iF.globalPrivacyControl].some(e=>iJ(rc,e))}};function ah(e,t){var i;let r=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!i3(r))return t;try{let e=r(t);return i8(e)&&e?e:t}catch(e){return nR.error("Error in get_current_url, falling back to window.location.href",e),t}}function ac(e){var t;return e instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||!!(null==(t=e.closest)?void 0:t.call(e,".toolbar-global-fade-container")))}function ad(e){return!!e&&1===e.nodeType}function ap(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function af(e){return!!e&&3===e.nodeType}function ag(e){return!!e&&11===e.nodeType&&ad(e.host)}function av(e){return e?iX(e).split(/\s+/):[]}function a_(e,t){var i;let r,s=i4(r=null==iO||null==(i=iO.location)?void 0:i.href)?void 0:ah(t,r);return!!(s&&e&&e.some(e=>s.match(e)))}function am(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return av(t)}function ay(e){return re(e)?null:iX(e).split(/(\s+)/).filter(e=>aU(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ab(e){let t="";return aA(e)&&!aL(e)&&e.childNodes&&e.childNodes.length&&oD(e.childNodes,function(e){var i;af(e)&&e.textContent&&(t+=null!=(i=ay(e.textContent))?i:"")}),iX(t)}function aw(e){var t;return i4(e.target)?e.srcElement||null:(null==(t=e.target)?void 0:t.shadowRoot)?e.composedPath()[0]||null:e.target||null}let ax=["a","button","form","input","select","textarea","label"];function ak(e,t){let i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!i&&i.call(e,t)}catch(e){return!1}}function aS(e,t){if(i4(t))return!0;for(let i of e)if(t.some(e=>ak(i,e)))return!0;return!1}function a$(e){let t=e.parentNode;return!(!t||!ad(t))&&t}let aE=[".ph-no-autocapture","[data-ph-no-autocapture]"],aP=["next","previous","prev",">","<"],aR=[...aP,"+","-","−","–"],aC=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,aO=[".ph-no-rageclick",".ph-no-capture"],aM=["","text","search","email","password","url","tel","number"];function aF(e,t){var i,r,s;let n,o,a;if(!iO||aI(e)||(rr(t)?(n=!!t&&aO,o=void 0,a=!1):(n=null!=(i=null==t?void 0:t.css_selector_ignorelist)?i:aO,o=null==t?void 0:t.content_ignorelist,a=null!=(r=null==t?void 0:t.ignore_text_selection)&&r),!1===n)||a&&!(!(s=e)||!ad(s))&&(ap(s,"textarea")||(ap(s,"input")?iJ(aM,(s.getAttribute("type")||"").toLowerCase()):function(e){var t;if(e.isContentEditable)return!0;let i=null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return"true"===i||""===i}(s))))return!1;let{targetElementList:l}=aT(e,!1);return!function(e,t){let i;if(!1===e||i4(e))return!1;if(!0===e)i=aP;else{if(!i2(e))return!1;if(e.length>10)return nR.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(({safeText:e,ariaLabel:t})=>i.some(i=>aC(e,i)||aC(t,i)))}(o,l.map(e=>{var t;return{safeText:ab(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!aS(l,n)}let aI=e=>!e||ap(e,"html")||!ad(e),aT=(e,t)=>{if(!iO||aI(e))return{parentIsUsefulElement:!1,targetElementList:[]};let i=!1,r=[e],s=e;for(;s.parentNode&&!ap(s,"body");){if(ag(s.parentNode)){r.push(s.parentNode.host),s=s.parentNode.host;continue}let e=a$(s);if(!e)break;if(t||ax.indexOf(e.tagName.toLowerCase())>-1)i=!0;else try{let t=iO.getComputedStyle(e);t&&"pointer"===t.getPropertyValue("cursor")&&(i=!0)}catch(e){}r.push(e),s=e}return{parentIsUsefulElement:i,targetElementList:r}};function aA(e){let t=new Set,i=0;for(let r=e;r.parentNode&&!ap(r,"body");r=r.parentNode){if(i++>=1e3||t.has(r))return!1;t.add(r);let e=am(r);if(iJ(e,"ph-sensitive")||iJ(e,"ph-no-capture"))return!1}if(iJ(am(e),"ph-include"))return!0;let r=e.type||"";if(i8(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}
2let s=e.name||e.id||"";return!i8(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function aL(e){return!!(ap(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ap(e,"select")||ap(e,"textarea")||"true"===e.getAttribute("contenteditable"))}let aj=RegExp("^(?:(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}))$"),aD=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,aN=[16,15,14,13],aB=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),aq=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),az=/[0-9A-Za-z_]/;function aU(e,t=!0){return!(re(e)||i8(e)&&(e=iX(e),(t?aj.test((e||"").replace(/[- ]/g,"")):function(e){let t;for(aD.lastIndex=0;t=aD.exec(e);){let e=t[2];if(!e)continue;let i=e.replace(/[- ]/g,"");for(let e=0;i.length>e;e++)for(let t of aN){let r=e+t;if(i.length>=r){let t=i.slice(e,r);if(aj.test(t)&&function(e){let t=0,i=!1;for(let r=e.length-1;r>=0;r--){let s=e.charCodeAt(r)-48;i&&(s*=2)>9&&(s-=9),t+=s,i=!i}return t%10==0}(t))return!0}}}return!1}(e))||(t?aB.test(e):function(e){let t;for(aq.lastIndex=0;t=aq.exec(e);){let e=t[1],i=t[3];if(!(e&&i&&az.test(e)&&az.test(i)))return!0}return!1}(e))))&&!0}function aH(e){let t=ab(e);return aU(t=`${t} ${(function e(t){let i="";return t&&t.childNodes&&t.childNodes.length&&oD(t.childNodes,function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{let r=ab(t);i=`${i} ${r}`.trim(),t.childNodes&&t.childNodes.length&&(i=`${i} ${e(t)}`.trim())}catch(e){nR.error("[AutoCapture]",e)}}),i})(e)}`.trim())?t:""}function aW(e){return e.replace(/"|\\"/g,'\\"')}let aV=nC("[Dead Clicks]"),aG=()=>!0,aK=e=>{var t;let i=!!(null==(t=e.instance.persistence)?void 0:t.get_property(nX)),r=e.instance.config.capture_dead_clicks;return rr(r)?r:!!i5(r)||i};var aJ=class{get lazyLoadedDeadClicksAutocapture(){return this.zo}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(!e.ok)return;let t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[nX]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Uo(()=>{this.Wo()}):this.stop()}Uo(e){var t,i,r;(null==(t=iz.__PosthogExtensions__)?void 0:t.initDeadClicksAutocapture)?e():null==(i=iz.__PosthogExtensions__)||null==(r=i.loadExternalDependency)||r.call(i,this.instance,"dead-clicks-autocapture",t=>{t?aV.error("failed to load script",t):e()})}Wo(){var e;if(iI){if(!this.zo&&(null==(e=iz.__PosthogExtensions__)?void 0:e.initDeadClicksAutocapture)){let e=i5(this.instance.config.capture_dead_clicks)?sP({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.zo=iz.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.zo.start(iI),aV.info("starting...")}}else aV.error("`document` not found. Cannot start.")}stop(){this.zo&&(this.zo.stop(),this.zo=void 0,aV.info("stopping..."))}};let aX=nC("[SegmentIntegration]");function aY(e,t,i=!0){let r,s,n=e.config.segment;if(!n)return t();let{analytics:o,filterProperties:a}=i3(n.register)?{analytics:n}:n;r=r=>{let s=()=>r.anonymousId()||oQ();e.config.get_device_id=s,i&&r.id()&&(e.register({distinct_id:r.id(),$device_id:s()}),e.persistence.set_property(og,oC)),(i=>{o.register(((e,t,{filterProperties:i}={})=>{"u">typeof Promise&&Promise.resolve||aX.warn("This browser does not have Promise support, and can not use the segment integration");let r=(r,s)=>{if(!s)return r;let n=!!t&&r.event.anonymousId===t&&!r.event.userId;n||r.event.userId||r.event.anonymousId===e.get_distinct_id()||(aX.info("No userId set, resetting PostHog"),e.reset()),n||(t=void 0),r.event.userId&&r.event.userId!==e.get_distinct_id()&&(aX.info("UserId set, identifying with PostHog"),e.identify(r.event.userId));let o=e.calculateEventProperties(s,r.event.properties);if(!re(i)){let e=r.event.properties||{},t={};for(let i of Object.keys(o))i0.call(e,i)||(t[i]=o[i]);let s=((e,t)=>{let i=i2(e)?e:[e],r=sP({},t);
2for(let e of i)try{if(r=e(r),re(r))return null}catch(e){return aX.error("Error in Segment filterProperties:",e),null}return r})(i,t);if(re(s))return r;o=s}return r.event.properties=Object.assign({},o,r.event.properties),r};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>r(e,e.event.event),page:e=>r(e,oI),identify:e=>r(e,oA),screen:e=>r(e,"$screen")}})(e,i,{filterProperties:a})).then(()=>{t()},e=>{aX.error("Failed to register the Segment integration",e),t()})})(i?void 0:r.anonymousId()||void 0)},"then"in(s=o.user())&&i3(s.then)?s.then(r):r(s)}let aQ="posthog-js";function aZ(e,{organization:t,projectId:i,prefix:r,severityAllowList:s=["error"],sendExceptionsToPostHog:n=!0}={}){return o=>{var a,l,u,h,c,d;if("*"!==s&&!s.includes(o.level)||!e.__loaded)return o;o.tags||(o.tags={});let p=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);o.tags["PostHog Person URL"]=p,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));let f=(null==(a=o.exception)?void 0:a.values)||[],g=f.map(e=>sP(sP({},e),{},{stacktrace:e.stacktrace?sP(sP({},e.stacktrace),{},{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>sP(sP({},e),{},{platform:"web:javascript"}))}):void 0})),v={$exception_message:(null==(l=f[0])?void 0:l.value)||o.message,$exception_type:null==(u=f[0])?void 0:u.type,$exception_level:o.level,$exception_list:g,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(null==(h=f[0])?void 0:h.value)||o.message,$sentry_exception_type:null==(c=f[0])?void 0:c.type,$sentry_tags:o.tags};return t&&i&&(v.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+o.event_id),n&&(null==(d=e.exceptions)||d.sendExceptionEvent(v)),o}}var a0=class{constructor(e,t,i,r,s,n){this.name=aQ,this.setupOnce=function(o){o(aZ(e,{organization:t,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}},a1=class{constructor(e){this.Vo=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(nR.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Go=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Zo()}Zo(){var e;this.Qo=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Vo)}destroy(){var e;null==(e=this.Qo)||e.call(this),this.Qo=void 0}doPageView(e,t){var i;let r=this.Jo(e,t);return this.Go={pathname:null!=(i=null==iO?void 0:iO.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.Jo(e,null==(t=this.Go)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Go)?void 0:e.pageViewId}}Jo(e,t){let i=this.Go;if(!i)return{$pageview_id:t};let r={$pageview_id:t,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:e,lastScrollY:t,maxScrollY:i,maxContentHeight:n,lastContentY:o,maxContentY:a}=s;if(!(i4(e)||i4(t)||i4(i)||i4(n)||i4(o)||i4(a))){e=Math.ceil(e),t=Math.ceil(t),i=Math.ceil(i),n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a);let s=e>1?r_(t/e,0,1,nR):1,l=e>1?r_(i/e,0,1,nR):1,u=n>1?r_(o/n,0,1,nR):1,h=n>1?r_(a/n,0,1,nR):1;r=oN(r,{$prev_pageview_last_scroll:t,$prev_pageview_last_scroll_percentage:s,$prev_pageview_max_scroll:i,$prev_pageview_max_scroll_percentage:l,$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:u,$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:h})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}};let a2=["flags","surveys"],a3={$people_distinct_id:{exposure:"hidden"},[nD]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[nU]:{exposure:"hidden"},[nB]:{exposure:"hidden"},[nz]:{exposure:"hidden"},[nH]:{exposure:"event"},[nW]:{exposure:"hidden"}
2,[nQ]:{exposure:"hidden"},[nV]:{exposure:"event"},[nG]:{exposure:"hidden"},[nK]:{exposure:"event"},[nJ]:{exposure:"event"},[nX]:{exposure:"event"},[nY]:{exposure:"hidden"},[nZ]:{exposure:"event"},[n0]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[n1]:{exposure:"hidden"},[n2]:{exposure:"event"},$replay_sample_rate:{exposure:"event",shouldSkipFromEventProperties:e=>i9(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[n3]:{exposure:"hidden",storageGroup:"flags"},[n5]:{exposure:"hidden",storageGroup:"flags"},[n6]:{exposure:"hidden"},[n4]:{exposure:"hidden",storageGroup:"flags"},[n8]:{exposure:"hidden",storageGroup:"flags"},[n7]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[n9]:{exposure:"hidden",storageGroup:"flags"},[oe]:{exposure:"hidden"},[ot]:{exposure:"hidden"},[oi]:{exposure:"hidden"},[or]:{exposure:"hidden"},[on]:{exposure:"hidden",storageGroup:"surveys"},[oo]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[oa]:{exposure:"event"},[ol]:{exposure:"hidden"},[ou]:{exposure:"hidden"},[oh]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[oc]:{exposure:"hidden"},[od]:{exposure:"hidden"},[os]:{exposure:"event"},[op]:{exposure:"hidden"},[of]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[og]:{exposure:"hidden"},[ov]:{exposure:"hidden"},$capture_rate_limit:{exposure:"hidden"},[o_]:{exposure:"hidden"},[om]:{exposure:"hidden"},[oy]:{exposure:"hidden"},[ob]:{exposure:"hidden"},$replay_override_sampling:{exposure:"event"},$replay_override_linked_flag:{exposure:"event"},$replay_override_url_trigger:{exposure:"event"},$replay_override_event_trigger:{exposure:"event"},[ok]:{exposure:"event"},[oS]:{exposure:"event"},[o$]:{exposure:"event"},[oE]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"}
2,$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},a5=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],a6=e=>{let t=a3[e];if(t)return t;for(let[t,i]of a5)if(0===e.indexOf(t))return i},a4=(e,t)=>{try{let i;return JSON.stringify(e,(e,t)=>rl(t)?(null!=i||(i=new WeakMap),i.has(t)||i.set(t,oU(t)),i.get(t)):"bigint"==typeof t?t.toString():t,t)}catch(t){return iQ(e)}},a8=e=>{let t=null==iI?void 0:iI.createElement("a");return i4(t)?null:(t.href=e,t)},a7=function(e,t){let i,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");for(let e=0;r.length>e;e++){let s=r[e].split("=");if(s[0]===t){i=s;break}}if(!i2(i)||2>i.length)return"";{let e=i[1];try{e=decodeURIComponent(e)}catch(t){nR.error("Skipping decoding for malformed query param: "+e)}return e.replace(/\+/g," ")}},a9=function(e,t,i){if(!e||!t||!t.length)return e;let r=e.split("#"),s=r[1],n=(r[0]||"").split("?"),o=n[1],a=n[0],l=(o||"").split("&"),u=[];for(let e=0;l.length>e;e++){let r=l[e].split("=");i2(r)&&(t.includes(r[0])?u.push(r[0]+"="+i):u.push(l[e]))}let h=a;return null!=o&&(h+="?"+u.join("&")),null!=s&&(h+="#"+s),h},le=function(e,t){let i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},lt=(e,t)=>e>=t&&iB(),li=(e,t,i,r)=>{if(0===e){if(iB()){let e=t+1;return e===i&&r(),e}return t}return 0},lr=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ls=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...lr],ln="<masked>",lo=["li_fat_id"];function la(e,t,i){let r;if(!iI)return{};let s=t?[...lr,...i||[]]:[],n=ll(a9(iI.URL,s,ln),e);return oN((r={},oD(lo,function(e){let t=oG(e);r[e]=t||null}),r),n)}function ll(e,t){let i=ls.concat(t||[]),r={};return oD(i,function(t){let i=a7(e,t);r[t]=i||null}),r}function lu(e){let t=e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null,i={};if(!i9(t)){i.$search_engine=t;let e=iI?a7(iI.referrer,"yahoo"!=t?"q":"p"):"";e.length&&(i.ph_keyword=e)}return i}function lh(){return navigator.language||navigator.userLanguage}let lc="$direct";function ld(){return(null==iI?void 0:iI.referrer)||lc}function lp(e,t,i=!1){let r=e?[...lr,...t||[]]:[],s=i?sb(null==iT?void 0:iT.href):null==iT?void 0:iT.href,n=null==s?void 0:s.substring(0,1e3);return{r:ld().substring(0,1e3),u:n?a9(n,r,ln):void 0}}function lf(e,t=!1){var i;let{r:r,u:s}=e,n=t?sb(s):s,o={$referrer:r,$referring_domain:null==r?void 0:r==lc?lc:null==(i=a8(r))?void 0:i.host};
2if(n){o.$current_url=n;let e=a8(n);o.$host=null==e?void 0:e.host,o.$pathname=null==e?void 0:e.pathname,oN(o,ll(n))}return r&&oN(o,lu(r)),o}function lg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}let lv={flags:of,surveys:oo},l_=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],lm=e=>`${e}_cookie_identity_change_pending`,ly=e=>{let t="",i=0;for(let r of e){let e=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(i+e>1e3)break;t+=r,i+=e}return t},lb="main",lw=[n3,n5,n4,n8,n7,of,n9,oi],lx=e=>-1!==lw.indexOf(e),lk=[nB,nz],lS=e=>-1!==lk.indexOf(e),l$=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch(i){return e===t}},lE=e=>{if(!e)return{};let t=JSON.parse(e);return i5(t)?t:{}},lP=(e,t)=>{oD(e,(i,r)=>{let s=a6(r);s&&"event"!==s.exposure||({}).hasOwnProperty.call(t,r)||delete e[r]})};var lR=class{constructor(e,t,i=!0){if(this.Ko={},this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=!1,this.ia=!1,this.na=new Map,this.sa=!1,this.ra=!1,this.oa=!1,this.aa=new Set,this.la=new Set,this.Rr=e,this.ua=i,this.props={},this.ha=void 0,this.ca=(e=>{let t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.mi=e.disable_persistence||!!t,this.jo=this.da(e),this.ta=this.va(e),this.load(),this.fa(),e.debug&&nR.info("Persistence loaded",e.persistence,sP({},this.props)),this.update_config(e,e,t),this.save(),iO){const e=()=>this.flush();oW(iO,"beforeunload",e,{capture:!1}),oW(iO,"pagehide",e,{capture:!1}),this.pa=e=>{if(this.Xo&&(!e.storageArea||e.storageArea===(null==iO?void 0:iO.localStorage))&&e.key)if(e.key!==this.ca){if(this.ta){let t=a2.find(t=>e.key===this.ga(t));t&&this.ma(e.key,t)}}else this.ma(e.key,lb)},oW(iO,"storage",this.pa)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(([e,t])=>{let i=this.na.get(e);if(!lx(e)||!0===i)return;if(!0===t)return void this.ya(e,!0);let r=new Set(i||[]);t.forEach(e=>r.add(e)),r.size&&this.ya(e,r)})}onCrossTabFeatureFlagChange(e){return this.la.add(e),()=>this.la.delete(e)}destroy(){this.pa&&iO&&(iO.removeEventListener("storage",this.pa),this.pa=void 0),this.la.clear()}ma(e,t,i=!0){let r,s;if(this.mi)return!1;try{if(s=o6.Ot(e),i9(s)){let e=this.ba(t);return e.storageValue=null,t!==lb&&(e.persisted=!1),!1}r=lE(s)}catch(e){return!1}let n=t===lb?r:o6.Dt(this.ca);if(n&&this._a(n))return!1;let o=this.wa(r,t,i);return t===lb&&this.ta&&!l$(this.ka().main,r)||this.Sa(r,t,!0,s),o}_a(e){let t=this.props[nA],i=e[nA];return!i4(t)&&!i4(i)&&t!==i}Sa(e,t,i,r){let s=this.ba(t);s.storageValue=r,t!==lb&&(s.persisted=i);try{s.fingerprint=this.xa(e,t)}catch(e){s.fingerprint=void 0}}wa(e,t,i){let r=!1;return lw.forEach(i=>{var s;let n=null==(s=a6(i))?void 0:s.storageGroup;if(t===lb&&this.ta&&n||t!==lb&&n!==t)return;let o=i in e,a=this.Ca(i,o?e[i]:void 0),l=this.na.has(i)?i in this.props:o;l===i in this.props&&l$(a,this.props[i])||(l?this.$a(i,a,!1):this.Ta(i,!1),r=!0)}),r&&i&&this.la.forEach(e=>e()),r}Ia(){if(!this.Xo)return!1;try{this.oa=!1;let e=o6.Ot(this.ca),t=this.ba(lb),i,r=!1,s=!1;if(e!==t.storageValue)if(i9(e))t.storageValue=null;else{if(i=lE(e),this.oa=!this.ra&&this._a(i),this.oa)return!1;s=this.wa(i,lb,!1),!this.ta||l$(this.ka().main,i)?this.Sa(i,lb,!0,e):t.storageValue=e,r=!0}return this.ta&&a2.forEach(e=>{let t=o6.Ot(this.ga(e)),n=this.ba(e),o=i||{},a=r&&lw.some(t=>{var i;return(null==(i=a6(t))?void 0:i.storageGroup)===e&&t in o});if(t===n.storageValue&&!a)return;if(i9(t))return n.storageValue=null,n.persisted=!1,void(a&&(s=this.wa(o,e,!1)||s));let l=lE(t);s=this.wa(l,e,!1)||s,this.Sa(l,e,!0,t)}),s}catch(e){return!1}}ya(e,t){this.na.set(e,t);let i=a6(e);(null==i?void 0:i.volatile)||(this.ba((this.ta?null==i?void 0:i.storageGroup:void 0)||lb).fingerprint=void 0,this.Ma(e))}Ea(){lw.forEach(e=>this.na.set(e,!0))}fa(){if(this.Xo)try{let e=o6.Ot(this.ca),t=lE(e);this.ba(lb).storageValue=e,lw.forEach(e=>{var i;let r=this.ta?null==(i=a6(e))?void 0:i.storageGroup:void 0,s=r?o6.Ot(this.ga(r)):null;if(r){let e=this.ba(r);e.storageValue=s,e.persisted=!i9(s)}let n=r&&!i9(s)?lE(s):t;e in this.props?this.Pa(e,n[e],this.props[e]):e in n&&this.ya(e,!0)})}catch(e){}}Ca(e,t){let i=this.na.get(e);if(!i)return t;if(!0===i)return this.props[e];if("$active_feature_flags"===e){let r=new Set(i2(t)?t:[]),s=new Set(i2(this.props[e])?this.props[e]:[]);
2return i.forEach(e=>s.has(e)?r.add(e):r.delete(e)),Array.from(r)}let r=i5(t)?sP({},t):{},s=i5(this.props[e])?this.props[e]:{};return i.forEach(e=>{e in s?r[e]=s[e]:delete r[e]}),r}Pa(e,t,i){if(!lx(e))return;let r=this.na.get(e);if(!0===r)return;let s=t;if(this.Xo)try{var n;let t=this.ta?null==(n=a6(e))?void 0:n.storageGroup:void 0,i=t?this.ga(t):this.ca;s=lE(o6.Ot(i))[e]}catch(e){}let o=new Set(r||[]);if("$active_feature_flags"===e){if(!i4(t)&&!i2(t)||!i4(s)&&!i2(s)||!i2(i))return void this.ya(e,!0);let r=new Set(t||[]),n=new Set(s||[]),a=new Set(i);new Set([...r,...a]).forEach(e=>{r.has(e)!==a.has(e)&&o.add(e)}),o.forEach(e=>{n.has(e)===a.has(e)&&o.delete(e)})}else{if(!i5(i))return void(l$(s,i)?this.na.delete(e):this.ya(e,!0));{if(!i4(t)&&!i5(t)||i4(t)&&i6(i)&&i4(s))return void this.ya(e,!0);let r=i5(t)?t:{},n=i5(s)?s:{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(e=>{e in r==e in i&&l$(r[e],i[e])||o.add(e)}),o.forEach(e=>{e in n==e in i&&l$(n[e],i[e])&&o.delete(e)})}}o.size?this.ya(e,o):this.na.delete(e)}Ra(){var e;let t=null==(e=this.Rr)?void 0:e.persistence_save_debounce_ms;return rt(t)&&t>0?t:0}Aa(e){if(this.Rr.cookieWinsOnConflict&&"localstorage+cookie"===this.Rr.persistence.toLowerCase())if(e)try{let t=ae(e,this.Rr.cookie_persisted_properties||[]),i=ai(t,this.Rr.cookie_persisted_properties||[]),r=JSON.stringify(t)+"|"+JSON.stringify(i),s=o3.Ot(this.ca)||void 0;s&&as(this.ca,s)===r&&(this.Fa=r,this.Oa=s)}catch(e){}else try{let e=o3.Ot(this.ca)||void 0;this.Fa=e?as(this.ca,e):void 0,this.Oa=e}catch(e){}}syncCookieProperties(){return this.Da(this.Rr)}Da(e,t=!1){let i,r;if(this.mi&&!t||this.ia||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{i=o3.Ot(this.ca)||void 0}catch(e){}if(!i||i===this.Oa)return!1;let s=as(this.ca,i);try{r=o9(JSON.parse(i))}catch(e){return!1}if((o3.Ot(this.ca)||void 0)!==i)return!1;this.Fa=s,this.Oa=i;let n=ar(this.ca,i),o=[...o8,...n.properties],a={};if(Object.keys(r).forEach(e=>{let t=r[e];(i4(t)||i9(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(a[e]=!0,delete r[e])}),i6(r))return!1;let l="distinct_id"in r||"anonymous"===r.$user_state||"identified"===r.$user_state,u=this.props,h=u[nA],c=u[og],d=oN({},u);[...o8,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==o.indexOf(e)&&!(e in r)&&!a[e]&&(l||"distinct_id"!==e&&"$user_state"!==e)){let t=d[e];(n.isValid||-1===o8.indexOf(e)||!1!==t&&0!==t)&&delete d[e]}}
2),this.props=oN(d,r),lw.forEach(e=>{let t=e in this.props;e in u===t&&l$(u[e],this.props[e])||(t?this.Pa(e,u[e],this.props[e]):this.ya(e,!0))}),!l||"$user_state"in r||"$user_state"in this.props||this.$a(og,oR);let p=this.props[nA],f=this.props[og];return l&&(p!==h||f!==c)&&(this.ra=!0,this.ea=!0,al.At(lm(this.ca),!0),this.Ta(oi),this.Ta(n5),this.Ta(n3),this.Ta(n4),this.Ta(n8),this.Ta(n7),this.Ta(of),this.Ta(op),this.Ta(oc),"anonymous"!==f||"identified"!==c&&"anonymous"!==r.$user_state&&(i4(h)||p===h)||(lP(this.props,r),this.Ta(or)),"identified"===f?this.props.$user_id=p:delete this.props.$user_id,this.Ta(nD)),!0}consumeCookieIdentityChange(){let e=lm(this.ca),t=this.ea||!!al.Ot(e);return this.ea=!1,t&&al.Lt(e),t}La(e=!1){return!(this.ia||this.mi&&!e||!this.Rr.cookieWinsOnConflict||"localstorage+cookie"!==this.Rr.persistence.toLowerCase()||(this.ia=!0,0))}Na(){this.ia&&(i4(this.qa)||(clearTimeout(this.qa),this.qa=void 0),delete this.Ko[lb],this.ja(!0))}Ba(e=!0){if(this.ia)try{e?this.Na():i4(this.qa)||(clearTimeout(this.qa),this.qa=void 0)}finally{this.ia=!1}}isDisabled(){return!!this.mi}da(e){-1===l_.indexOf(e.persistence.toLowerCase())&&(nR.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");let t=((e=[],t=!1)=>{let i=[...o8,...e];return sP(sP({},o6),{},{Dt(e){try{let s,n,o={};try{o=(n=o3.Ot(e)||void 0)?o9(JSON.parse(n)):{}}catch(e){}let a=JSON.parse(o6.Ot(e)||"{}");if(t){let t=ar(e,n),l=[...o8,...t.properties],u={};Object.keys(o).forEach(e=>{let t=o[e];i9(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t||(u[e]=t)});let h="distinct_id"in u||"anonymous"===u.$user_state||"identified"===u.$user_state;if(Object.keys(u).length>0){var r;let e=a[nA],s=null!=(r=a.$user_state)?r:oR;i.forEach(e=>{if(-1!==l.indexOf(e)&&!(e in o)&&(h||"distinct_id"!==e&&"$user_state"!==e)){let i=a[e];(t.isValid||-1===o8.indexOf(e)||!1!==i&&0!==i)&&delete a[e]}}),!h||"$user_state"in o||"$user_state"in a||(a[og]=oR),h&&(("distinct_id"in u?u[nA]:a[nA])!==e||("$user_state"in u?u[og]:a[og])!==s)&&(o4.forEach(e=>delete a[e]),"identified"===u.$user_state&&"distinct_id"in u?a.$user_id=u[nA]:delete a.$user_id,"identified"!==u.$user_state&&(delete a[os],delete a[or]),delete a.__alias)}s=oN(a,u)}else s=oN(o,a);return o6.At(e,s),s}catch(e){}return null},At(i,r,s,n,o,a){let l=o6.At(i,r,void 0,void 0,a);try{let u=ae(r,e);if(Object.keys(u).length){if(t){let t=i+"_cpm",h=ai(u,e);if(o3.At(t,h,s,n,o,a),o3.Ot(t)!==JSON.stringify(h)){o3.Lt(t,n);let e=ae(r);return o3.At(i,e,s,n,o,a),l}}o3.At(i,u,s,n,o,a)}}catch(e){o6.Pt(e)}return l},Lt(e,t){try{null==iO||iO.localStorage.removeItem(e),o3.Lt(e,t),o3.Lt(e+"_cpm",t)}catch(e){o6.Pt(e)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),i,r=!1,s=!1,n=e.persistence.toLowerCase();return"localstorage"===n&&o6.Et()?(i=o6,s=!0):"localstorage+cookie"===n&&t.Et()?(i=t,s=!0,r=!0):"sessionstorage"===n&&al.Et()?i=al:"memory"===n?i=ao:"cookie"===n&&o3.Et()?(i=o3,r=!0):t.Et()?(i=t,s=!0,r=!0):o3.Et()?(i=o3,r=!0):i=ao,this.Xo=s,this.Yo=r,i}ga(e){return`${this.ca}__${e}`}va(e){return this.Xo&&!!e.split_storage}properties(){let e={};return oD(this.props,(t,i)=>{let r=a6(i);if(!r||"event"===r.exposure){var s;if(null==r||null==(s=r.shouldSkipFromEventProperties)?void 0:s.call(r,t))return;e[i]=t}}),e}load(e=!1){if(this.mi&&!e)return;let t=this.Rr.cookieWinsOnConflict&&"localstorage+cookie"===this.Rr.persistence.toLowerCase(),i=t?o6.Dt(this.ca):null,r={};if(t)try{r=o9(o3.Dt(this.ca)),oD(r,(e,t)=>{(i4(e)||i9(e)||""===e)&&delete r[t]})}catch(e){}let s=this.jo.Dt(this.ca);if(s&&(this.props=oN({},s)),this.ta&&this.Ha(),t&&s){var n,o;let e=null==i?void 0:i[nA],t=null!=(n=null==i?void 0:i.$user_state)?n:oR,a=s[nA],l=null!=(o=s.$user_state)?o:oR;if(a!==e||l!==t){this.ea=!0,al.At(lm(this.ca),!0);let i=oN({},this.props);o4.forEach(e=>delete i[e]),"anonymous"!==l||"identified"!==t&&"anonymous"!==r.$user_state&&(i4(e)||a===e)||(lP(i,r),delete i[or]),this.props=i;let s=new Set;o4.forEach(e=>{var t;let i=null==(t=a6(e))?void 0:t.storageGroup;i&&s.add(i)}
2),s.forEach(e=>{let t={};oD(this.props,(i,r)=>{var s;(null==(s=a6(r))?void 0:s.storageGroup)===e&&(t[r]=i)}),i6(t)?(o6.Lt(this.ga(e)),this.Ko[e]={}):o6.At(this.ga(e),t)&&(this.Ko[e]={persisted:!0,fingerprint:this.xa(t,e)})})}}al.Ot(lm(this.ca))&&(this.ea=!0)}Ha(){for(let e of a2){let t=o6.Dt(this.ga(e));if(t&&!i6(t)){let i=this.ba(e);i.persisted=!0,this.za(e)||(i.fingerprint=this.xa(t,e)),this.Ua(e,t)||oN(this.props,t)}}}za(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=a6(t))?void 0:i.storageGroup)===e})}Ua(e,t){let i=lv[e];if(!i)return!1;let r=t[i],s=this.props[i];return rt(r)&&rt(s)&&s>r}refreshKey(e){var t;if(this.mi||this.aa.has(e))return;let i=this.ta?null==(t=a6(e))?void 0:t.storageGroup:void 0,r=i?o6.Dt(this.ga(i)):this.jo.Dt(this.ca);if(r&&e in r)this.$a(e,r[e],!1);else{if(i){let t=this.jo.Dt(this.ca);if(t&&e in t)return void this.$a(e,t[e],!1)}this.Ta(e,!1)}}save(){if(this.mi)return;let e=this.Ra();e>0?i4(this.qa)&&(this.qa=setTimeout(()=>{this.qa=void 0,this.ja()},e)):this.ja()}flush(){i4(this.qa)||(clearTimeout(this.qa),this.qa=void 0,this.ja())}ja(e=!1){if(this.mi||this.ia&&!e)return;e||(this.syncCookieProperties(),this.Rr.cookieWinsOnConflict&&"localstorage+cookie"===this.Rr.persistence.toLowerCase()||lk.forEach(e=>this.refreshKey(e)));let t=!e&&!this.sa;t||(this.oa=!1);let i=!!t&&this.Ia();if(this.oa)return void(this.Rr.debug&&nR.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.ta)return this.Wa(),void(i&&this.la.forEach(e=>e()));let r=this.Va(this.jo,this.ca,this.props,lb);"written"===r&&this.Aa(this.props),"failed"!==r&&(this.na.clear(),this.ra=!1,this.aa.clear()),i&&this.la.forEach(e=>e())}Wa(){let{main:e,groups:t}=this.ka(),i=this.Va(this.jo,this.ca,e,lb);for(let s of("written"===i&&this.Aa(e),"failed"!==i&&(this.ra=!1,this.aa.clear(),lw.forEach(e=>{var t;(null==(t=a6(e))?void 0:t.storageGroup)||this.na.delete(e)})),a2)){var r;let e=t[s];if(i6(e)&&!(null==(r=this.Ko[s])?void 0:r.persisted)){lw.forEach(e=>{var t;(null==(t=a6(e))?void 0:t.storageGroup)===s&&this.na.delete(e)});continue}let i=this.Va(o6,this.ga(s),e,s);"failed"!==i&&lw.forEach(e=>{let t=a6(e);(null==t?void 0:t.storageGroup)!==s||"written"!==i&&t.volatile||this.na.delete(e)})}}ka(){let e={},t={flags:{},surveys:{}};return oD(this.props,(i,r)=>{var s;let n=null==(s=a6(r))?void 0:s.storageGroup;n?t[n][r]=i:e[r]=i}),{main:e,groups:t}}xa(e,t){if(t===lb)return JSON.stringify(e)+"|"+this.Ga+"|"+this.Za+"|"+this.Qa;let i={};return oD(e,(e,t)=>{var r;i[t]=(null==(r=a6(t))?void 0:r.volatile)?"__volatile__":e}),JSON.stringify(i)}Va(e,t,i,r){let s,n=this.ba(r);if(r!==lb&&!n.dirty&&!i4(n.fingerprint))return"skipped";try{if((s=this.xa(i,r))===n.fingerprint)return n.dirty=!1,"skipped"}catch(e){s=void 0}return e.At(t,i,this.Ga,this.Za,this.Qa,this.Rr.debug)?(n.dirty=!1,r!==lb&&(n.persisted=!0),i4(s)||(n.fingerprint=s),this.Xo&&(n.storageValue=o6.Ot(t)),"written"):(this.Rr.debug&&nR.warn(`failed to persist storage entry "${t}"; will retry on next save`),"failed")}remove({keepGroupEntries:e=!1}={}){if(this.Ea(),i4(this.qa)||(clearTimeout(this.qa),this.qa=void 0),this.jo.Lt(this.ca,!1),this.jo.Lt(this.ca,!0),!e&&this.ua)for(let e of a2)o6.Lt(this.ga(e));e?delete this.Ko[lb]:this.Ko={},this.Fa=void 0,this.Oa=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(i5(e)){this.syncCookieProperties(),i4(t)&&(t="None"),this.Ga=i4(i)?this.Ja:i;let r=!1;if(oD(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.$a(i,e),r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(i5(e)){this.syncCookieProperties(),this.Ga=i4(t)?this.Ja:t;let i=!1;if(oD(e,(t,r)=>{e.hasOwnProperty(r)&&(this.props[r]!==t||i5(t)||i2(t))&&(this.$a(r,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();let t=!1;for(let i of"string"==typeof e?[e]:e)i in this.props&&(this.Ta(i),t=!0);t&&this.save()}update_campaign_params(){let e=null==iI?void 0:iI.URL;if(e===this.ha)return;let t=la(this.Rr.custom_campaign_params,this.Rr.mask_personal_data_properties,this.Rr.custom_personal_data_properties),i=!i6(oz(t));return i&&this.register(t),this.ha=e,i?t:void 0}update_search_keyword(){let e;this.register((e=null==iI?void 0:iI.referrer)?lu(e):{})}update_referrer_info(){var e;this.register_once({$referrer:ld(),$referring_domain:(null==iI?void 0:iI.referrer)&&(null==(e=a8(iI.referrer))?void 0:e.host)||lc},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;let e=lp(this.Rr.mask_personal_data_properties,this.Rr.custom_personal_data_properties,this.Rr.disable_capture_url_hashes
2);this.register_once({[oy]:this.Yo?{r:ly(e.r),u:e.u?ly(e.u):void 0}:e},void 0)}get_initial_props(){let e={};oD([om,o_],t=>{let i=this.props[t];i&&oD(i,function(t,i){e["$initial_"+iY(i)]=t})});let t=this.props[oy];return t&&oN(e,function(e,t=!1){let i=lf(e,t),r={};return oD(i,function(e,t){r[`$initial_${iY(t)}`]=e}),r}(t,this.Rr.disable_capture_url_hashes)),e}safe_merge(e){return oD(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){let r=e.persistence!==t.persistence,s=!((e,t)=>{if(e.length!==t.length)return!1;let i=[...e].sort(),r=[...t].sort();return i.every((e,t)=>e===r[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=r||s,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!i,l=!!this.mi&&!a;a||this.Da(t,l),this.Rr=e,!a&&(r||s||o)&&(this.Fa=void 0,this.Oa=void 0,this.Da(sP(sP({},e),{},{cookie_persisted_properties:t.cookie_persisted_properties}),l));let u=n||o?this.da(e):this.jo;this.Ka();let h=this.va(e),c=n||h!==this.ta,d=!a&&(c||e.cross_subdomain_cookie!==this.Za||e.secure_cookie!==this.Qa)&&this.La(l);this.sa=c;try{if(this.Ja=this.Ga=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),c){let e=this.props;this.clear(),this.jo=u,this.ta=h,this.props=e,this.save()}else o&&(this.jo=u,a||(delete this.Ko[lb],this.ja()))}finally{this.sa=!1,d&&this.Ba()}}Ka(){let e=this.props[oy];if(!this.Yo||!i5(e)||"string"!=typeof e.r)return;let t=ly(e.r),i="string"==typeof e.u?ly(e.u):e.u;t===e.r&&i===e.u||this.$a(oy,sP(sP({},e),{},{r:t,u:i}))}set_disabled(e){this.mi=e,this.mi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Za&&(this.Za=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Qa&&(this.Qa=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){let i=this.props.__timers||{};i[e]=t,this.$a(nU,i),this.save()}remove_event_timer(e){let t=this.props.__timers||{},i=t[e];return i4(i)||(delete t[e],this.$a(nU,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.$a(e,t),this.save()}$a(e,t,i=!0){var r;let s=this.props[e];this.props[e]=t,i&&("distinct_id"!==e&&"$user_state"!==e||s===t||(this.ra=!0),lS(e)&&!l$(s,t)&&this.aa.add(e),this.Pa(e,s,t),(null==(r=a6(e))?void 0:r.volatile)||this.Ma(e))}Ta(e,t=!0){delete this.props[e],t&&(lx(e)&&this.ya(e,!0),lS(e)&&this.aa.add(e),this.Ma(e))}Ma(e){var t;let i=null==(t=a6(e))?void 0:t.storageGroup;i&&(this.ba(i).dirty=!0)}ba(e){return this.Ko[e]||(this.Ko[e]={})}};let lC="gzip-js",lO="base64",lM="events",lF="cancelEvents",lI="survey shown",lT="survey dismissed",lA="survey sent",lL="popover";function lj(e){let t=!0;return{dispose(){if(t){t=!1;let i=e();i&&i3(i.then)&&i.then(void 0,()=>{})}}}}let lD=nC("[RateLimiter]");var lN=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{let t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{lD.info(`${e||"events"} is quota limited.`),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void lD.warn(`could not rate limit - continuing. Error: "${null==e?void 0:e.message}"`,{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e=!1){var t,i,r;let{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,o=(new Date).getTime(),a=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property("$capture_rate_limit"))?t:{tokens:s,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>s&&(a.tokens=s);let l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){let e=(rt(a.dropped)?a.dropped:0)+1;a.dropped=e,!this.lastEventRateLimited&&this.Xa(e)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property("$capture_rate_limit",a),{isRateLimited:l,remainingTokens:a.tokens}}Ya(e){let t=this.instance.config.property_denylist;return!i2(t)||!t.includes(e)}tl(){var e;if(this.Ya("$current_url")&&this.Ya("$pathname")&&(null==iT?void 0:iT.pathname))return`${null!=(e=iT.origin)?e:""}${iT.pathname}`}Xa(e){var t,i;let{captureEventsBurstLimit:r,captureEventsPerSecond:s}=this,n=this.tl(),o=this.Ya("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,a=[`${e} event(s) dropped since the last warning`,n?`triggered on ${n}`:void 0,o?`session ${o}
vendor: 9,461 bytes, line 2
2`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${a}. Config is set to ${s} events per second and ${r} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){let t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}};let lB=nC("[RemoteConfig]");var lq=class{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=iz._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}el(e){var t,i,r;(null==(t=iz.__PosthogExtensions__)?void 0:t.loadExternalDependency)?null==(i=iz.__PosthogExtensions__)||null==(r=i.loadExternalDependency)||r.call(i,this._instance,"remote-config",()=>e(this.remoteConfig)):e()}il(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:e})}load(){try{if(this.remoteConfig)return lB.info("Using preloaded remote config",this.remoteConfig),void this.nl(this.remoteConfig);if(this._instance.sl())return void lB.warn("Remote config is disabled. Falling back to local config.");this.el(e=>{e?this.nl(e):(lB.info("No config found after loading remote JS config. Falling back to JSON."),this.il(e=>{this.nl(e.json,e)}))})}catch(e){lB.error("Error loading remote config",e),this.nl()}}nl(e,t){!e&&t&&(0===t.statusCode?t.error||lB.warn("Failed to fetch remote config from PostHog."):lB.error("Failed to fetch remote config from PostHog."));try{this._instance.nl(e?{ok:!0,config:e}:{ok:!1})}catch(e){lB.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){lB.error("Error loading feature flags",e)}}},lz=Uint8Array,lU=Uint16Array,lH=Uint32Array,lW=new lz([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]),lV=new lz([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]),lG=new lz([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),lK=function(e,t){for(var i=new lU(31),r=0;31>r;++r)i[r]=t+=1<<e[r-1];var s=new lH(i[30]);for(r=1;30>r;++r)for(var n=i[r];i[r+1]>n;++n)s[n]=n-i[r]<<5|r;return[i,s]},lJ=lK(lW,2),lX=lJ[1];lJ[0][28]=258,lX[258]=28;for(var lY=lK(lV,0)[1],lQ=new lU(32768),lZ=0;32768>lZ;++lZ){var l0=(43690&lZ)>>>1|(21845&lZ)<<1;lQ[lZ]=((65280&(l0=(61680&(l0=(52428&l0)>>>2|(13107&l0)<<2))>>>4|(3855&l0)<<4))>>>8|(255&l0)<<8)>>>1}var l1=function(e,t,i){for(var r=e.length,s=0,n=new lU(t);r>s;++s)++n[e[s]-1];var o,a=new lU(t);for(s=0;t>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new lU(1<<t);var l=15-t;for(s=0;r>s;++s)if(e[s])for(var u=s<<4|e[s],h=t-e[s],c=a[e[s]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[lQ[c]>>>l]=u}else for(o=new lU(r),s=0;r>s;++s)o[s]=lQ[a[e[s]-1]++]>>>15-e[s];return o},l2=new lz(288);for(lZ=0;144>lZ;++lZ)l2[lZ]=8;for(lZ=144;256>lZ;++lZ)l2[lZ]=9;for(lZ=256;280>lZ;++lZ)l2[lZ]=7;for(lZ=280;288>lZ;++lZ)l2[lZ]=8;var l3=new lz(32);for(lZ=0;32>lZ;++lZ)l3[lZ]=5;var l5=l1(l2,9,0),l6=l1(l3,5,0),l4=function(e){return(e/8|0)+(7&e&&1)},l8=function(e,t,i){(null==t||0>t)&&(t=0),(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof lU?lU:e instanceof lH?lH:lz)(i-t);return r.set(e.subarray(t,i)),r},l7=function(e,t,i){var r=t/8|0;e[r]|=i<<=7&t,e[r+1]|=i>>>8},l9=function(e,t,i){var r=t/8|0;e[r]|=i<<=7&t,e[r+1]|=i>>>8,e[r+2]|=i>>>16},ue=function(e,t){for(var i=[],r=0;e.length>r;++r)e[r]&&i.push({s:r,f:e[r]});var s=i.length,n=i.slice();if(!s)return[new lz(0),0];if(1==s){var o=new lz(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,c=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=s-1;)a=i[i[c].f>i[u].f?u++:c++],l=i[u!=h&&i[c].f>i[u].f?u++:c++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(r=1;s>r;++r)n[r].s>d&&(d=n[r].s);var p=new lU(d+1),f=ut(i[h-1],p,0);if(f>t){r=0;var g=0,v=f-t,_=1<<v;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});s>r;++r){var m=n[r].s;if(t>=p[m])break;g+=_-(1<<f-p[m]),p[m]=t}for(g>>>=v;g>0;){var y=n[r].s;t>p[y]?g-=1<<t-p[y]++-1:++r}for(;r>=0&&g;--r){var b=n[r].s;p[b]==t&&(--p[b],++g)}f=t}return[new lz(p),f]},ut=function(e,t,i){return -1==e.s?Math.max(ut(e.l,t,i+1),ut(e.r,t,i+1)):t[e.s]=i},ui=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new lU(++t),r=0,s=e[0],n=1,o=function(e){i[r++]=e},a=1;t>=a;++a)if(e[a]==s&&a!=t)++n;else{if(!s&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=e[a]}return[i.subarray(0,r),t]},ur=function(e,t){for(var i=0,r=0;t.length>r;++r)i+=e[r]*t[r];return i},us=function(e,t,i){var r=i.length,s=l4(t+2);e[s]=255&r,e[s+1]=r>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var n=0;r>n;++n)e[s+n+4]=i[n];return 8*(s+4+r)},un=function(e,t,i,r,s,n,o,a,l,u,h){l7(t,h++,i),++s[256];for(var c=ue(s,15),d=c[0],p=c[1],f=ue(n,15),g=f[0],v=f[1],_=ui(d),m=_[0],y=_[1],b=ui(g),w=b[0],x=b[1],k=new lU(19),S=0;m.length>S;++S)k[31&m[S]]++;for(S=0;w.length>S;++S)k[31&w[S]]++;for(var $=ue(k,7),E=$[0],P=$[1],R=19;R>4&&!E[lG[R-1]];--R);var C,O,M,F,I=u+5<<3,T=ur(s,l2)+ur(n,l3)+o,A=ur(s,d)+ur(n,g)+o+14+3*R+ur(k,E)+(2*k[16]+3*k[17]+7*k[18]);if(T>=I&&A>=I)return us(t,h,e.subarray(l,l+u));if(l7(t,h,1+(T>A)),h+=2,T>A){C=l1(d,p,0),O=d,M=l1(g,v,0),F=g;var L=l1(E,P,0);for(l7(t,h,y-257),l7(t,h+5,x-1),l7(t,h+10,R-4),h+=14,S=0;R>S;++S)l7(t,h+3*S,E[lG[S]]);h+=3*R;for(var j=[m,w],D=0;2>D;++D){var N=j[D];for(S=0;N.length>S;++S)l7(t,h,L[B=31&N[S]]),h+=E[B],B>15&&(l7(t,h,N[S]>>>5&127),h+=N[S]>>>12)}}else C=l5,O=l2,M=l6,F=l3;for(S=0;a>S;++S)if(r[S]>255){l9(t,h,C[257+(B=r[S]>>>18&31)]),h+=O[B+257],B>7&&(l7(t,h,r[S]>>>23&31),h+=lW[B]);var B,q=31&r[S];l9(t,h,M[q]),h+=F[q],q>3&&(l9(t,h,r[S]>>>5&8191),h+=lV[q])}else l9(t,h,C[r[S]]),h+=O[r[S]];return l9(t,h,C[256]),h+O[256]},uo=new lH([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ua=new lz(0),ul=function(){for(var e=new lH(256),t=0;256>t;++t){for(var i=t,r=9;--r;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),uu=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};let uh=!!iL||!!iA,uc=new WeakMap,ud="text/plain",up=0,uf=!1,ug=(e,t)=>{let[i,r]=e.split("#"),[s,n]=i.split("?");if(!n)return e;let o=n.split("&").filter(e=>e.split("=")[0]!==t).join("&");return`${s}${o?`?${o}`:""}${r?`#${r}`:""}`},uv=(e,t,i=!0)=>{var r;let[s,n]=e.split("?"),o=sP({},t),a=null!=(r=null==n?void 0:n.split("&").map(e=>{var t;let[r,s]=e.split("="),n=i&&null!=(t=o[r])?t:s;return delete o[r],`${r}=${n}`}))?r:[],l=function(e,t="&"){let i,r,s=[];return oD(e,function(e,t){i4(e)||i4(t)||"undefined"===t||(i=encodeURIComponent(e instanceof File?e.name:e.toString()),r=encodeURIComponent(t),s[s.length]=r+"="+i)}),s.join(t)}(o);return l&&a.push(l),a.length>0?`${s}?${a.join("&")}`:s},u_=e=>{var t,i,r,s,n,o,a,l,u,h;if(e.rl)return e.rl;let{data:c,compression:d}=e;if(!c)return;if(d===lC){let e=(t=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new lz(e.length+(e.length>>>1)),r=0,s=function(e){i[r++]=e},n=0;t>n;++n){if(r+5>i.length){var o=new lz(r+8+(t-n<<1));o.set(i),i=o}var a=e.charCodeAt(n);128>a?s(a):(2048>a?s(192|a>>>6):(a>55295&&57344>a?(s(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++n))>>>18),s(128|a>>>12&63)):s(224|a>>>12),s(128|a>>>6&63)),s(128|63&a))}return l8(i,0,r)}(a4(c)),i={mtime:0},r=0xffffffff,s={p(e){for(var t=r,i=0;e.length>i;++i)t=ul[255&t^e[i]]^t>>>8;r=t},d:()=>0xffffffff^r},n=t.length,s.p(t),u=(o=10+(i.filename&&i.filename.length+1||0),l=function(e,t,i,r,s){var n=e.length,o=new lz(r+n+5*(1+Math.floor(n/7e3))+8),a=o.subarray(r,o.length-8),l=0;if(!t||8>n)for(var u=0;n>=u;u+=65535){var h=u+65535;n>h?l=us(a,l,e.subarray(u,h)):(a[u]=s,l=us(a,l,e.subarray(u,n)))}else{for(var c=uo[t-1],d=c>>>13,p=8191&c,f=(1<<i)-1,g=new lU(32768),v=new lU(f+1),_=Math.ceil(i/3),m=2*_,y=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<m)&f},b=new lH(25e3),w=new lU(288),x=new lU(32),k=0,S=0,$=(u=0,0),E=0,P=0;n>u;++u){var R=y(u),C=32767&u,O=v[R];if(g[C]=O,v[R]=C,u>=E){var M=n-u;if((k>7e3||$>24576)&&M>423){l=un(e,a,0,b,w,x,S,$,P,u-P,l),$=k=S=0,P=u;for(var F=0;286>F;++F)w[F]=0;for(F=0;30>F;++F)x[F]=0}var I=2,T=0,A=p,L=C-O&32767;if(M>2&&R==y(u-L))for(var j=Math.min(d,M)-1,D=Math.min(32767,u),N=Math.min(258,M);D>=L&&--A&&C!=O;){if(e[u+I]==e[u+I-L]){for(var B=0;N>B&&e[u+B]==e[u+B-L];++B);if(B>I){if(I=B,T=L,B>j)break;var q=Math.min(L,B-2),z=0;for(F=0;q>F;++F){var U=u-L+F+32768&32767,H=U-g[U]+32768&32767;H>z&&(z=H,O=U)}}}L+=(C=O)-(O=g[C])+32768&32767}if(T){b[$++]=0x10000000|lX[I]<<18|lY[T];var W=31&lX[I],V=31&lY[T];S+=lW[W]+lV[V],++w[257+W],++x[V],E=u+I,++k}else b[$++]=e[u],++w[e[u]]}}l=un(e,a,s,b,w,x,S,$,P,u-P,l),s||(l=us(a,l,ua))}return l8(o,0,r+l4(l)+8)}(t,null==i.level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+i.mem,o,!a)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&uu(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;i.length>=r;++r)e[r+10]=i.charCodeAt(r)}}(l,i),uu(l,u-8,s.d()),uu(l,u-4,n),l);return{contentType:ud,body:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),estimatedSize:e.byteLength}}if(d===lO){let e,t="data="+encodeURIComponent("string"==typeof(e=(h=a4(c))?btoa(encodeURIComponent(h).replace(/%([0-9A-F]{2})/g,(e,t)=>
2String.fromCharCode(parseInt(t,16)))):h)?e:a4(e));return{contentType:"application/x-www-form-urlencoded",body:t,estimatedSize:new Blob([t]).size}}let p=a4(c);return{contentType:"application/json",body:p,estimatedSize:new Blob([p]).size}},um=e=>{var t;let i,r=()=>"sendBeacon"===e.transport?{url:uv(e.url,{compression:lO}),encodedBody:u_(sP(sP({},e),{},{compression:lO,rl:void 0}))}:{url:ug(e.url,"compression"),encodedBody:u_(sP(sP({},e),{},{compression:void 0,rl:void 0}))};try{i=u_(e)}catch(t){if(nr(e.compression,a7(e.url,"compression")))return nR.error("Failed to gzip request body, sending uncompressed payload",t),r();throw t}return!(i&&nr(e.compression,a7(e.url,"compression")))||((t=i.body)instanceof ArrayBuffer?ni(new Uint8Array(t)):ArrayBuffer.isView(t)&&ni(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)))?{url:e.url,encodedBody:i}:(uf=!0,r())},uy=e=>{try{return um(e)}catch(i){var t;return nR.error(i),void(null==(t=e.callback)||t.call(e,{statusCode:0,error:i}))}},ub=(g=rf(function*(e){let t=yield function(e){return na.apply(this,arguments)}(a4(e.data),iH.DEBUG,{rethrow:!0});if(!t)return e;let i=yield t.arrayBuffer();return sP(sP({},e),{},{rl:{contentType:ud,body:i,estimatedSize:i.byteLength}})}),function(e){return g.apply(this,arguments)}),uw=/Failed to fetch|NetworkError|Load failed/i,ux=e=>"TypeError"===(null==e?void 0:e.name)&&uw.test((null==e?void 0:e.message)||""),uk=e=>{try{let t=function(e,t=Date.now()){if("string"!=typeof e||!e)return;let i=e.trim(),r=/^\d+\s*,/.test(i)?i.slice(0,i.indexOf(",")).trim():i;if(/^\d+$/.test(r)){let e=1e3*Math.min(Number(r),300);return e>0?e:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(r))return;let s=/^\w{3} \w{3} /.test(r)?r+" GMT":r,n=Date.parse(s)-t;return Number.isFinite(n)&&n>0?Math.min(n,3e5):void 0}(e());return i4(t)?void 0:Math.min(t,3e4)}catch(e){return}},uS=e=>{let t=uy(e);if(!t)return;let i=new iL;uc.set(i,!0);let{url:r,encodedBody:s}=t;i.open(e.method||"GET",r,!0);let{contentType:n,body:o}=null!=s?s:{};oD(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t;let r={statusCode:i.status,text:i.responseText};if(200===i.status)try{r.json=JSON.parse(i.responseText)}catch(e){}null==(t=e.callback)||t.call(e,r,uk(()=>i.getResponseHeader("Retry-After")))}},i.send(o)},u$=e=>{let t=uy(e);if(!t)return;let{url:i,encodedBody:r}=t,{contentType:s,body:n,estimatedSize:o}=null!=r?r:{},a=new Headers;oD(e.headers,function(e,t){a.append(t,e)}),s&&a.append("Content-Type",s);let l=null,u=!1;if(ij){let t=new ij;l={signal:t.signal,timeout:setTimeout(()=>{var i;u=!0;try{t.abort(sy("AbortError","PostHog request timed out"+((i=e.timeout)?` after ${i}ms`:"")))}catch(e){c(e)}},e.timeout)}}let h=!1,c=t=>{var i;h||(h=!0,u&&"AbortError"===(null==t?void 0:t.name)||ux(t)?nR.warn(t):nR.error(t),null==(i=e.callback)||i.call(e,{statusCode:0,error:t}))},d=0,p=()=>{up-=d,d=0,l&&clearTimeout(l.timeout)};try{let t=sP({method:(null==e?void 0:e.method)||"GET",headers:a,referrerPolicy:"strict-origin",body:n,signal:null==l?void 0:l.signal},e.fetchOptions),r=null!=o?o:i4(n)?0:void 0;t.keepalive="POST"===t.method&&!e.ol&&!1!==t.keepalive&&t.body===n&&!i4(r)&&r>=0&&52428.8>up+r,t.keepalive&&(d=r,up+=d),iA(i,t).then(t=>t.text().then(i=>{var r;if(h)return;let s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){nR.error(e)}h=!0,p(),null==(r=e.callback)||r.call(e,s,uk(()=>t.headers.get("Retry-After")))})).catch(e=>{p(),c(e)}).finally(p)}catch(e){p(),c(e)}},uE=e=>{try{var t;let{url:i,encodedBody:r}=um(e),{contentType:s,body:n,estimatedSize:o}=null!=r?r:{};if(!n)return;let a=n instanceof Blob?n:new Blob([n],{type:s});if(iF.sendBeacon(i,a))return;let l=i2(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(i2(l)&&l.length>1&&(null!=o?o:0)>16384){let t=Math.ceil(l.length/2),i=t=>i2(e.data)?t:sP(sP({},e.data),{},{batch:t});return uE(sP(sP({},e),{},{data:i(l.slice(0,t))})),void uE(sP(sP({},e),{},{data:i(l.slice(t))}))}nR.warn(`Beacon of ~${null!=o?o:0} bytes was rejected by the browser, falling back to ${iA?"fetch":"XHR"}`),iA?u$(sP(sP({},e),{},{ol:!0})):uS(e)}catch(e){nR.warn("Beacon send failed",e)}},uP=(e,t,i,r)=>{let s="query"===r?"POST"===t?"sent_at":"_":void 0;return uv(i===lC?ug(e,"compression"):e,sP(sP({},s?{[s]:Date.now().toString()}:{}),i===lC?{}:{compression:i}))},uR=(o=[],iA&&o.push({transport:"fetch",method:u$}),iL&&o.push({transport:"XHR",method:uS}),(null==iF?void 0:iF.sendBeacon)&&o.push({transport:"sendBeacon",method:uE}),o),uC=!uh&&-1===(null==iN?void 0:iN.indexOf("MSIE"))&&-1===(null==iN?void 0:iN.indexOf("Mozilla"));function uO(e,t,i){var r,s,n;i&&(t=sP(sP({},t),{},{callback:e=>i(e)})),e.__loaded?uC?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==(s=t.callback)||s.call(t,{statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=sP(sP({},e.config.request_headers),t.headers),t.compression="best-available"===t.compression?null!=(r=e.compression)?r:t.compressionFallback:t.compression,(i4(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,
2((e,t)=>{var i,r,s,n,o,a;let l,u,h=sP(sP({},e),{},{callback:null!=t?t:t=>{var i;return null==(i=e.callback)?void 0:i.call(e,t)}});h.timeout=h.timeout||6e4;let c=null!=(i=h.transport)?i:"fetch";"sendBeacon"===c&&i4(h.compression)&&h.data&&(h.compression=lO),"POST"===h.method&&h.data&&("capture-body"===h.timestampMode?(u=(l=(i2(n=h.data)?n:[n]).map(e=>sP(sP({},e),e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})))[0],h.data={api_key:null!=(o=null==u||null==(a=u.properties)?void 0:a.token)?o:null==u?void 0:u.token,batch:l,sent_at:(new Date).toISOString()}):"body"===h.timestampMode&&(h.data=((e,t=(new Date).toISOString())=>i2(e)?e.map(e=>sP(sP({},e),{},{sent_at:t})):sP(sP({},e),{},{sent_at:t}))(h.data))),h.url=uP(h.url,h.method,h.compression,h.timestampMode);let d=uR.filter(e=>!h.disableTransport||!e.transport||!h.disableTransport.includes(e.transport)),p=null!=(r=null==(s=function(e,t){for(let i=0;e.length>i;i++)if(t(e[i]))return e[i]}(d,e=>e.transport===c))?void 0:s.method)?r:d[0].method;if(!p)throw Error("No available transport method");let f=e=>{try{p(e)}catch(e){var t;ux(e)?nR.warn(e):nR.error(e),null==(t=h.callback)||t.call(h,{statusCode:0,error:e})}};"sendBeacon"!==c&&!h.preferSyncCompression&&h.data&&h.compression===lC&&iD&&"u">typeof Promise&&!uf?ub(h).then(e=>{f(e)}).catch(t=>{ns(t)?(uf=!0,f(sP(sP({},h),{},{compression:void 0,url:uP(e.url,e.method,void 0,e.timestampMode)}))):((e=>{if(!e||"object"!=typeof e)return!1;let t="name"in e?String(e.name):"";return ns(e)||t===nt})(t)&&(uf=!0),f(h))}):f(h)})(t,(r,s)=>{var n,o,a;e.rateLimiter.checkForLimiting(r),400>r.statusCode||null==(n=(o=e.config).on_request_error)||n.call(o,r),i?i(r,s):null==(a=t.callback)||a.call(t,r)})):t.fireCallbackOnDrop&&(null==(n=t.callback)||n.call(t,{statusCode:0}))}var uM=class{constructor(e,t){this.al=!0,this.ll=[],this.ul=r_((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,nR.createLogger("flush interval"),3e3),this.hl=e}enqueue(e){this.ll.push(e),this.cl||this.dl()}unload(){this.vl();let e=Object.values(this.ll.length>0?this.fl():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.pl(e,"sendBeacon")})}enable(){this.al=!1,this.dl()}dl(){this.al||(this.cl=setTimeout(()=>{if(this.vl(),this.ll.length>0){let e=this.fl();for(let t in e)this.pl(e[t])}},this.ul))}pl(e,t){try{this.hl(e,t)}catch(e){nR.error(e)}}vl(){clearTimeout(this.cl),this.cl=void 0}fl(){let e={};return oD(this.ll,t=>{var i;let r=((t?t.batchKey:null)||t.url)+(t.batchGroup?`:${t.batchGroup}`:"");i4(e[r])&&(e[r]=sP(sP({},t),{},{data:[]})),null==(i=e[r].data)||i.push(t.data)}),this.ll=[],e}};let uF=["retriesPerformedSoFar"];var uI=class{constructor(e){this._instance=e,this.gl=!1,this.ml=3e3,this.ll=[],this.ll=[],this.yl=!0,this.resume()}resume(){!i4(iO)&&"onLine"in iO.navigator&&(this.yl=iO.navigator.onLine,this.bl||(this.bl=()=>{this.yl=!0,this._l()},this.wl=()=>{this.yl=!1},oW(iO,"online",this.bl),oW(iO,"offline",this.wl)))}get length(){return this.ll.length}retriableRequest(e,t){let{retriesPerformedSoFar:i}=e,r=nl(e,uF);ri(i)&&(r.url=uv(r.url,{retry_count:i})),uO(this._instance,t?sP(sP({},r),{},{transport:t}):r,(e,t)=>{var s;if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=i?i:0))return void this.Ls(sP({retriesPerformedSoFar:i},r),t);0===e.statusCode&&nR.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${null!=i?i:0} retries.`)}null==(s=r.callback)||s.call(r,e)})}Ls(e,t){let i,r,s,n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;let o=Math.max((s=(Math.random()-.5)*((r=Math.min(18e5,i=3e3*Math.pow(2,n)))-i/2),Math.ceil(r+s)),null!=t?t:0),a=Date.now()+o;this.ll.push({retryAt:a,requestOptions:e});let l=`Enqueued failed request for retry in ${o}`;navigator.onLine||(l+=" (Browser is offline)"),nR.warn(l),this.gl||(this.gl=!0,this.kl())}kl(){(this.Sl&&clearTimeout(this.Sl),0===this.ll.length)?(this.gl=!1,this.Sl=void 0):this.Sl=setTimeout(()=>{this.yl&&this.ll.length>0&&this._l(),this.kl()},this.ml)}_l(){let e=Date.now(),t=[],i=this.ll.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.ll=t,i.length>0)for(let{requestOptions:e}of i)this.retriableRequest(e)}unload(){for(let{requestOptions:e}of(this.Sl&&(clearTimeout(this.Sl),this.Sl=void 0),this.gl=!1,i4(iO)||(this.bl&&(iO.removeEventListener("online",this.bl),this.bl=void 0),this.wl&&(iO.removeEventListener("offline",this.wl),this.wl=void 0)),this.ll))try{this._instance._send_request(sP(sP({},e),{},{transport:"sendBeacon"}))}catch(e){nR.error(e)}this.ll=[]}},uT=class{constructor(e){this._instance=e,this.xl=()=>{var e,t,i,r;this.Cl||(this.Cl={});let s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this.Cl.lastScrollY=Math.ceil(n),this.Cl.maxScrollY=Math.max(n,null!=(e=this.Cl.maxScrollY)?e:0),this.Cl.maxScrollHeight=Math.max(o,null!=(t=this.Cl.maxScrollHeight)?t:0),this.Cl.lastContentY=a,this.Cl.maxContentY=Math.max(a,null!=(i=this.Cl.maxContentY)?i:0),this.Cl.maxContentHeight=Math.max(l,null!=(r=this.Cl.maxContentHeight)?r:0)}}get $l(){return this._instance.config.scroll_root_selector}getContext(){return this.Cl}resetContext(){let e=this.Cl;return this.Cl=void 0,setTimeout(this.xl,0),e}startMeasuringScrollPosition(){oW(iO,"scroll",this.xl,{capture:!0}),oW(iO,"scrollend",this.xl,{capture:!0}),oW(iO,"resize",this.xl)}scrollElement(){var e,t;if(this.$l){for(let t of i2(this.$l)?this.$l:[this.$l]){let i=null==iO||null==(e=iO.document)?void 0:e.querySelector(t);if(i)return i}return}return null==iO||null==(t=iO.document)?void 0:t.documentElement}Tl(e){var t,i;if(this.$l){let t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return iO?"y"===e?iO.scrollY||iO.pageYOffset||(null==(t=iO.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:iO.scrollX||iO.pageXOffset||(null==(i=iO.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.Tl("y")}scrollX(){return this.Tl("x")}};let uA=e=>lp(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes
2);var uL=class{constructor(e,t,i,r){this.Be=e=>{let t=this.Il();if(t&&t.sessionId===e)return;let i={sessionId:e,props:this.Ml(this._instance)};this.El.register({[ov]:i})},this._instance=e,this.Pl=t,this.El=i,this.Ml=r||uA,this.Pl.onSessionId(this.Be)}Il(){return this.El.props[ov]}getSetOnceProps(){var e;let t=null==(e=this.Il())?void 0:e.props;return t?"r"in t?lf(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){let e={};return oD(oz(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e[`$session_entry_${iY(i)}`]=t}),e}},uj=class{on(e,t){return this.Rl[e]||(this.Rl[e]=[]),this.Rl[e].push(t),()=>{this.Rl[e]=this.Rl[e].filter(e=>e!==t)}}emit(e,t){for(let i of this.Rl[e]||[])i(t);for(let i of this.Rl["*"]||[])i(e,t)}constructor(){this.Rl={}}};let uD=nC("[SessionId]");var uN=class{on(e,t){return this.Al.on(e,t)}constructor(e,t,i){var r;if(this.Fl=null,this.Ol=null,this.Dl=[],this.Ll=void 0,this.Nl=!1,this.Al=new uj,this.ql=(e,t)=>!(!ri(e)||!ri(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Rr=e.config,this.El=e.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.jl=void 0,this._sessionActivityTimestamp=null,this.Bl=t||oQ,this.Hl=i||oQ;const s=this.Rr.persistence_name||this.Rr.token;if(this._sessionTimeoutMs=1e3*r_(this.Rr.session_idle_timeout_seconds||1800,60,36e3,uD.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.zl(),this.Ul="ph_"+s+"_window_id",this.Wl="ph_"+s+"_primary_window_exists",this.Vl()){const e=al.Dt(this.Ul),t=al.Dt(this.Wl);e&&!t?this.He=e:al.Lt(this.Ul),al.At(this.Wl,!0)}(null==(r=this.Rr.bootstrap)?void 0:r.sessionID)&&this.setBootstrapSessionId(this.Rr.bootstrap.sessionID),this.Gl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return i4(this.Dl)&&(this.Dl=[]),this.Dl.push(e),this.Xt&&e(this.Xt,this.He),()=>{this.Dl=this.Dl.filter(t=>t!==e)}}Vl(){return"memory"!==this.Rr.persistence&&!this.El.mi&&al.Et()}Zl(e){e!==this.He&&(this.He=e,this.Vl()&&al.At(this.Ul,e))}Ql(){return this.He?this.He:this.Vl()?al.Dt(this.Ul):null}Jl(e){let t=this.Fl;return!i9(t)&&!i9(e)&&5e3>Math.abs(e-t)}Kl(e,t,i){let r=t!==this._sessionActivityTimestamp,s=e===this.Xt&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Xt=e,s&&!r||s&&this.Jl(t)||(this.Fl=t,this.El.register({[n1]:[t,e,i]}))}Xl(){var e;let t=null==(e=this.Rr)?void 0:e.persistence_save_debounce_ms;return ri(t)&&t>0}Yl(){this.Xl()?this.El.refreshKey(n1):(this.El.flush(),this.El.load())}tu(){var e;if(i9(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Fl)return;this.Yl();let[,t,i]=this.eu();t===this.Xt&&i===this._sessionStartTimestamp&&(this.Fl=this._sessionActivityTimestamp,this.El.register({[n1]:[this._sessionActivityTimestamp,null!=(e=this.Xt)?e:null,this._sessionStartTimestamp]}),this.El.flush())}iu(){let[e]=this.eu();return Math.max(ri(e)?e:0,ri(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}nu(e){return this.Yl(),this.ql(e,this.iu())}eu(){let e=this.El.props[n1];return i2(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Fl=null,this.jl=void 0,clearTimeout(this.su),this.su=void 0,this.Kl(null,null,null)}setBootstrapSessionId(e,t=!1){let i=((e,t=(new Date).getTime())=>{try{let i=(e=>{let t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(e);return i>t+6e4?void uD.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void uD.error("Invalid sessionID in bootstrap",e)}})(e);return!i4(i)&&(t?this.jl={sessionId:e,sessionStartTimestamp:i}:this.Kl(e,(new Date).getTime(),i),!0)}destroy(){this.Nl=!0,this.tu(),clearTimeout(this.su),this.su=void 0,this.Ll&&iO&&(iO.removeEventListener(oF,this.Ll,{capture:!1}),this.Ll=void 0),this.Dl=[]}Gl(){this.Ll=()=>{this.tu(),this.Vl()&&al.Lt(this.Wl)},oW(iO,oF,this.Ll,{capture:!1})}
2checkAndGetSessionAndWindowId(e=!1,t=null,i=!1){if("always"===this.Rr.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');let r=t||(new Date).getTime(),s=this.Xt;if(i)this.Ol=r;else if(i9(this.Ol)||this.Ol>r||r-this.Ol>=1e3){var n,o;null==(n=(o=this.El).syncCookieProperties)||n.call(o),this.Ol=r}let[,a,l]=this.eu(),u=!i4(s)&&a!==s,h=this.iu(),c=this.Ql(),d=this.jl,p=!!d&&(d.sessionStartTimestamp>r+6e4||r-d.sessionStartTimestamp>864e5),f=d?p:ri(l)&&Math.abs(r-l)>864e5,g=!1,v=u,_=!a||!!d,m=a,y=!_&&!e&&this.ql(r,h);if(y&&((y=this.nu(r))||uD.info("cross-tab refresh kept the session alive",{sessionId:a}),[,a,l]=this.eu(),y||(_=!a||!!d)),_||y||f){v=!1;let e=d&&!p;a=e?d.sessionId:this.Bl(),c=this.Hl(),uD.info("new session ID assigned",{sessionId:a,windowId:c,bootstrapped:!!e,changeReason:{noSessionId:_,activityTimeout:y,sessionPastMaximumLength:f}}),l=e?d.sessionStartTimestamp:r,this.jl=void 0,g=!0}else c||(c=this.Hl(),g=!0),(v=v||a!==m)&&(uD.info("adopted cross-tab session id",{sessionId:a,windowId:c}),g=!0);let b=ri(h)&&e&&!f?h:r,w=ri(l)?l:(new Date).getTime();this.Zl(c),this.Kl(a,b,w),e||this.zl();let x={noSessionId:_,activityTimeout:y,sessionPastMaximumLength:f,crossTabAdoption:v};return g&&this.Dl.forEach(e=>e(a,c,x)),{sessionId:a,windowId:c,sessionStartTimestamp:w,changeReason:g?x:void 0,lastActivityTimestamp:h}}zl(){this.Nl||(clearTimeout(this.su),this.su=setTimeout(()=>{if(!this.Nl)if(this.nu((new Date).getTime())){let e=this.Xt;this.resetSessionId(),this.Al.emit("forcedIdleReset",{idleSessionId:e})}else this.zl()},1.1*this.sessionTimeoutMs))}};let uB=function(e,t){if(!e)return!1;let i=e.userAgent;if(i&&rv(i,t))return!0;try{let i=null==e?void 0:e.userAgentData;if((null==i?void 0:i.brands)&&i.brands.some(e=>rv(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function uq(){return(uq=rf(function*(){let e=null==iF?void 0:iF.userAgentData;if(null==e?void 0:e.getHighEntropyValues)try{let t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return i8(i)&&i.length>0?i:void 0}catch(e){return void nR.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function uz(e){var t;return!!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)}let uU=(e,t)=>{if(!(e=>{try{new RegExp(e)}catch(e){return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},uH=e=>e.toLowerCase(),uW={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>uU(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!uU(t,e))),icontains:(e,t)=>t.map(uH).some(t=>e.map(uH).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(uH).every(t=>e.map(uH).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{let i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{let i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})};function uV(e,t){return!e||Object.entries(e).every(([e,i])=>{let r=null==t?void 0:t[e];if(null==r)return!1;let s=uW[i.operator];return!!s&&s(i.values.map(String),[String(r)])})}function uG(e,t,i){return a4({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}let uK="custom",uJ="i.posthog.com",uX=/^\/static\//,uY=["/s/","/e/","/i/"];var uQ=class{constructor(e){this.ru={},this.instance=e}get apiHost(){let e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){let e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e;let t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${uJ}`,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.ru[this.apiHost]||(this.ru[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":uK),this.ru[this.apiHost]}ou(e){if(!uX.test(e))return;let t=this.instance.config.asset_host;return"string"==typeof t&&t.trim().replace(/\/$/,"")||void 0}au(e){let t=a8(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}lu(e,t,i){if("ui"===e)return i;let r=i,s=this.instance.config.rewriteRequestPath;if(s){var n;r=s(new URL((null==(n=a8(i))?void 0:n.href)||i)).toString()}if(s&&"api"===e&&uY.some(e=>0===t.indexOf(e))){let e=this.au(r);if(e){let t=this.apiHost,i=this.uu;(null==i?void 0:i.apiHost)===t&&i.rewriteRequestPath===s||(i={apiHost:t,rewriteRequestPath:s,urls:new Set},this.uu=i),i.urls.add(e)}}return r}isIngestionEndpoint(e){let t=this.uu,i=this.au(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t=""){if(t&&(t="/"===t[0]?t:`/${t}`),"ui"===e)return this.lu(e,t,this.uiHost+t);if("flags"===e)return this.lu(e,t,this.flagsApiHost+t);if("assets"===e){let i=this.ou(t);if(i)return this.lu(e,t,`${i}${t}`)}if(this.region===uK)return this.lu(e,t,this.apiHost+t);let i=uJ+t;switch(e){case"assets":return this.lu(e,t,`https://${this.region}-assets.${i}`);case"api":return this.lu(e,t,`https://${this.region}.${i}`)}}};let uZ=nC("[Surveys]"),u0=e=>{try{let t=`seenSurvey_${e.current_iteration&&e.current_iteration>0?`${e.id}_${e.current_iteration}`:e.id}`;if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){uZ.error("Failed to persist survey seen state",e)}}
2,u1=["popover","widget","api"],u2={ignoreConditions:!1,ignoreDelay:!1,displayType:lL},u3=nC("[PostHog ExternalIntegrations]"),u5={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var u6=class{constructor(e){this._instance=e}Uo(e,t){var i,r;null==(i=iz.__PosthogExtensions__)||null==(r=i.loadExternalDependency)||r.call(i,this._instance,e,e=>{if(e)return u3.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t,i,r;for(let[s,n]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))!n||(null==(t=iz.__PosthogExtensions__)||null==(t=t.integrations)?void 0:t[s])||this.Uo(u5[s],()=>{var e;null==(e=iz.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[s])||e.start(this._instance)}),!n&&(null==(i=iz.__PosthogExtensions__)||null==(i=i.integrations)?void 0:i[s])&&(null==(r=iz.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[s])||r.stop())}},u4=class{constructor(e,t){this.$=e,this.wo=t,this.hu=new Map,this.Mo=!1}add(e){var t=this;return rf(function*(){if(t.Mo)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.hu.has(e.name))throw Error(`Browser extension "${e.name}" is already registered`);t.hu.set(e.name,e);try{let i=e.setup(t.wo);i&&(yield i)}catch(r){let i=t.hu.get(e.name)===e;i&&t.hu.delete(e.name),t.$.error(`Failed to set up browser extension "${e.name}"`,r),i&&t.cu(e)}})()}getExtension(e){return this.hu.get(e)}dispose(){if(this.Mo)return;this.Mo=!0;let e=Array.from(this.hu.values()).reverse();for(let t of(this.hu.clear(),e))this.cu(t)}cu(e){try{var t;let i=null==(t=e.dispose)?void 0:t.call(e);i&&i3(i.then)&&i.then(void 0,t=>{this.$.error(`Failed to dispose browser extension "${e.name}"`,t)})}catch(t){this.$.error(`Failed to dispose browser extension "${e.name}"`,t)}}},u8=class{constructor(e){this._instance=e}initialize(){}get(e){let t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);let i={};for(let r of e){let e=null==t?void 0:t.get_property(r);i4(e)||(i[r]=e)}return i}set(e,t){var i;null==(i=this._instance.persistence)||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}};let u7="extensionsRemoteConfig";var u9=class{constructor(e){this.instance=e,this.Mo=!1,this.$=nR,this.du=e.vu,this.kv=new u8(e),this.onEvent=e=>lj(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.$.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.Mo)return lj(()=>{});let t=t=>{try{e(t)}catch(e){this.$.error("Browser extension remote config listener failed",e)}},i=this.instance.fu.on(u7,t);return this.du&&t(this.du),lj(i)},this.pu=new u4(nR.createLogger("[BrowserExtensions]"),this)}get logger(){return this.$}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!=(e=this.instance.get_property("$device_id"))?e:this.distinctId}get deviceId(){let e=this.instance.get_property(nL);return"string"==typeof e?e:void 0}get library(){return{name:iH.LIB_NAME,version:iH.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!=(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,r;let s=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!=(t=null==s?void 0:s.sessionId)?t:"",windowId:null!=(i=null==s?void 0:s.windowId)?i:"",sessionStartTimestamp:null!=(r=null==s?void 0:s.sessionStartTimestamp)?r:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.pu.add(e)}getExtension(e){return this.pu.getExtension(e)}capture(e,t,i){i?this.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):this.instance.capture(e,t)}registerDynamicEventProperties(e){return lj(this.instance.gu(e))}handleRemoteConfig(e){this.Mo||(this.du=e,this.instance.fu.emit(u7,e))}sendRequest(e){var t=this;return rf(function*(e,i={}){var r;let s=t.instance.requestRouter.endpointFor(null!=(r=i.target)?r:"api",e),n={method:i.method,url:i.query?uv(s,i.query):s,data:i.body,headers:i.headers,timeout:i.timeoutMs,fireCallbackOnDrop:!0,transport:i.transport,compression:i.compression,compressionFallback:"flags"===i.target&&"best-available"===i.compression?iV.Base64:void 0,timestampMode:i.sentAt};return"sendBeacon"===i.transport?(t.instance._send_request(n),{statusCode:202}):new Promise(e=>{n.callback=e,t.instance._send_request(n)})}).apply(this,arguments)}dispose(){this.Mo||(this.Mo=!0,this.pu.dispose())}};let he={},ht=0,hi=()=>{}
2,hr='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',hs="Surveys module not available",hn="sanitize_properties is deprecated. Use before_send instead",ho="Invalid value for property_denylist config: ",ha=/^[A-Za-z0-9_-]{1,400}$/,hl=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,hu=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,hh=["token","distinct_id",ox],hc="posthog",hd=e=>{var t;let i;return sP({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){let t=null==e?void 0:e.hostname;if(!i8(t))return!1;let i=t.split(".").slice(-2).join(".");for(let e of oH)if(i===e)return!1;return!0}(null==iI?void 0:iI.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:hi,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:iT&&i8(null==iT?void 0:iT.search)&&-1!==iT.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==iO||null==(t=iO.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(e){nR.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:oO,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:hi},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:aR,ignore_text_selection:!0}
2:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:(i={},e&&"unset"!==e&&("2025-11-30">e||(i.strictMinimumDuration=!0),"2026-05-30">e||(i.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(i.streamNetworkBody=!0),"2026-08-30">e||(i.captureJsonLd=!0)),i),external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)})},hp=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],hf=e=>{let t={};for(let[i,r]of hp)i4(e[i])||(t[r]=e[i]);let i=oN({},t,e),r=e.__preview_external_dependency_versioned_paths;return i4(r)||(i4(e.strict_script_versioning)&&(i.strict_script_versioning=!!r),i8(r)&&i4(e.asset_host)&&(i.asset_host=r)),i2(e.property_blacklist)&&(i4(e.property_denylist)?i.property_denylist=e.property_blacklist:i2(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:nR.error(ho+e.property_denylist)),i};var hg=class{constructor(){this.__forceAllowLocalhost=!1}get mu(){return this.__forceAllowLocalhost}set mu(e){nR.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},hv=class e{yu(e){if(!e)return;let t=this.hu.indexOf(e);-1!==t&&this.hu.splice(t,1)}bu(e,t){var i;return this.yu(e),this.hu.push(t),null==(i=t.initialize)||i.call(t),t}_u(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}wu(){let e,t,i;if(this.ku||this.config.reuseAnonymousId||this.config.segment||this._u())return;let r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.Su||(r?(e=`persistence is set to '${this.config.persistence}'`,t="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.ku=!0,console.warn("[PostHog.js]",`${e} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${t}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${i}`)))}xu(){if(this._u()||"$posthog_cookieless"!==this.get_distinct_id())return;let e=this.persistence;if(!e)return;this.Cu()||e.load(!0);let t=this.get_distinct_id();if(!t||"$posthog_cookieless"===t){let t=this.config.get_device_id(oQ());this.register({distinct_id:t,$device_id:t}),e.set_property(og,oR)}this.$u()}get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){var t;this.Tu=!1,this.Iu=!1,this.webPerformance=new hg,this.Mu=!1,this.version=iH.LIB_VERSION,this.Eu=new Set,this.Pu="",this.fu=new uj,this.hu=[],this.Ru=[],this.Su=!1,this.ku=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=hd(),this.SentryIntegration=a0,this.sentryIntegration=e=>{let t;return t=aZ(this,e),{name:aQ,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Au=!1,this.Fu=null,this.Ou=null,this.Du=null,this.scrollManager=new uT(this),this.pageViewM
2anager=new a1(this),this.rateLimiter=new lN(this),this.requestRouter=new uQ(this),this.consent=new au(this),this.externalIntegrations=new u6(this);const i=null!=(t=e.__defaultExtensionClasses)?t:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(e,t,i)=>{let r=i8(e)?{[e]:t}:e;this.setPersonProperties(r),null==i||i({})},set_once:(e,t,i)=>{let r=i8(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",e=>nR.info(`send "${null==e?void 0:e.event}"`,e))}init(t,i,r){if(r&&r!==hc){var s;let n=null!=(s=he[r])?s:new e;return n._init(t,i,r),he[r]=n,he[hc][r]=n,n}return this._init(t,i,r)}_init(e,t={},i){var r,s,n,o;let a=i8(e)?e.trim():"";if(!a)return nR.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 a!==(null==(o=this.config)?void 0:o.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${a}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=hd(t.defaults),t.debug=this.Lu(t.debug),this.Nu=t,this.qu=[],t.person_profiles?this.Ou=t.person_profiles:t.process_person&&(this.Ou=t.process_person);let l=hd(t.defaults),u=hf(t),h=oN({},l,u,{name:i,token:a});i5(l.rageclick)&&i5(u.rageclick)&&(h.rageclick=oN({},l.rageclick,u.rageclick)),i5(l.session_recording)&&i5(u.session_recording)&&(h.session_recording=oN({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&nR.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:lC;let c=this.Cu();if(this.persistence=new lR(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new lR(sP(sP({},this.config),{},{persistence:"sessionStorage"}),c,!1),this.Pu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&al.Et()){let e=al.Dt(this.Pu);i2(e)&&e.forEach(e=>{i8(e)&&this.Eu.add(e)})}else al.Lt(this.Pu);let d=sP({},this.persistence.props),p=sP({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.ju=new uM((e,t)=>this.Bu(e,t),this.config.request_queue_config),this.Hu=new uI(this),this.__request_queue=[];let f=this._u();f||(this.sessionManager=new uN(this),this.sessionPropsManager=new uL(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{((null==i?void 0:i.activityTimeout)||(null==i?void 0:i.sessionPastMaximumLength)||(null==i?void 0:i.crossTabAdoption))&&this.zu()})),this.Uu(),this.config.__preview_deferred_init_extensions?(nR.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Wu(f)},0)):(nR.info("Initializing extensions synchronously"),this.Wu(f)),iH.DEBUG=iH.DEBUG||this.config.debug,iH.DEBUG&&nR.info("Starting in debug mode",{this:this,config:t,thisC:sP({},this.config),p:d,s:p}),!this.config.identity_distinct_id||(null==(r=t.bootstrap)?void 0:r.distinctID)||(t.bootstrap=sP(sP({},t.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));let g=null==(s=t.bootstrap)?void 0:s.distinctID;if(this.Su=!!g&&!i7(g),null==(n=t.bootstrap)?void 0:n.distinctID){let e=t.bootstrap.distinctID,i=this.get_distinct_id(),r=this.persistence.get_property(og);if(t.bootstrap.isIdentifiedID&&null!=i&&i!==e&&"anonymous"===r)this.identify(e);else if(t.bootstrap.isIdentifiedID&&null!=i&&i!==e&&"identified"===r)nR.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{let i=this.config.get_device_id(oQ()),r=t.bootstrap.isIdentifiedID?i:e;this.persistence.set_property(og,t.bootstrap.isIdentifiedID?oC:oR),this.register({distinct_id:e,$device_id:r})}}if(f)this.register_once({distinct_id:ow,$device_id:null},"");else if(!this.get_distinct_id()){let e=this.config.get_device_id(oQ());this.register_once({distinct_id:e,$device_id:e},""),this.persistence.set_property(og,oR)}return oW(iO,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),oW(iO,"pageshow",()=>{var e;this.Tu=!1,this.Iu||null==(e=this.Hu)||e.resume()}),t.segment?aY(this,()=>this.Vu()):this.Vu(),i3(this.config._onCapture)&&this.config._onCapture!==hi&&(nR.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&nR.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return uq.apply(this,arguments)})().then(e=>{e&&this.register({[nj]:e})}).catch(hi),this}
2Gu(e){return i8(e.name)&&i3(e.setup)}Zu(e,t){this.Gu(e)?t.push(()=>{this.Qu().add(e).catch(()=>{var t;return null==(t=e.dispose)?void 0:t.call(e)}).catch(t=>{nR.error(`Failed to dispose browser extension "${e.name}"`,t)})}):this.hu.push(e)}Uu(){var t,i,r,s,n,o;let a=null!=(t=null==(i=this.config.__extensionClasses)?void 0:i.featureFlags)?t:null==(r=e.__defaultExtensionClasses)?void 0:r.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(s=this.Ju)||s.call(this),this.Ju=void 0,this.featureFlags=new a(this)),i3(this.featureFlags.onReloading)&&i3(this.featureFlags.setup)?this.Ju||(this.Ju=this.featureFlags.onReloading(()=>{this.fu.emit("featureFlagsReloading",!0)}),this.Qu().add(this.featureFlags)):null==(n=(o=this.featureFlags).initialize)||n.call(o))}Wu(t){var i,r,s,n,o,a,l;let u=performance.now(),h=sP(sP({},e.__defaultExtensionClasses),this.config.__extensionClasses),c=[];h.exceptions&&this.hu.push(this.exceptions=null!=(i=this.exceptions)?i:new h.exceptions(this)),h.historyAutocapture&&this.hu.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.hu.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.hu.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!t&&this.hu.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||c.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),h.autocapture&&this.Zu(this.autocapture=new h.autocapture(this),c),h.surveys&&this.Zu(this.surveys=null!=(r=this.surveys)?r:new h.surveys(this),c),h.logs&&this.Zu(this.logs=null!=(s=this.logs)?s:new h.logs(this),c),h.metrics&&this.hu.push(this.metrics=null!=(n=this.metrics)?n:new h.metrics(this)),h.conversations&&this.hu.push(this.conversations=null!=(o=this.conversations)?o:new h.conversations(this)),h.productTours&&this.hu.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.hu.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.hu.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.hu.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.hu.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,aK)),h.toolbar&&this.hu.push(this.toolbar=null!=(a=this.toolbar)?a:new h.toolbar(this)),h.experiments&&this.hu.push(this.experiments=null!=(l=this.experiments)?l:new h.experiments(this)),this.hu.forEach(e=>{e.initialize&&c.push(()=>{var t;null==(t=e.initialize)||t.call(e)})}),c.push(()=>{if(this.Ku){let e=this.Ku;this.Ku=void 0,this.hu.forEach(t=>{var i;return null==(i=t.onRemoteConfig)?void 0:i.call(t,e)})}}),this.Xu(c,u)}Xu(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Xu(e,t)},0);let i=e.shift();if(i)try{i()}catch(e){nR.error("Error initializing extension:",e)}}let i=Math.round(performance.now()-t);this.register_for_session({[ok]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[oS]:i}),this.config.__preview_deferred_init_extensions&&nR.info(`PostHog extensions initialized (${i}ms)`)}nl(e){var t,i;if(!iI||!iI.body)return nR.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.nl(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Ku=e),this.vu=e,this.compression=void 0,e.ok){let t=e.config;t.supportedCompression&&!this.config.disable_compression&&(this.compression=iJ(t.supportedCompression,lC)?lC:iJ(t.supportedCompression,lO)?lO:void 0),(null==(i=t.analytics)?void 0:i.endpoint)&&(this.analyticsDefaultEndpoint=t.analytics.endpoint)}this.set_config({person_profiles:this.Ou?this.Ou:oO}),null==(t=this.Yu)||t.handleRemoteConfig(e),this.hu.forEach(t=>{var i;return null==(i=t.onRemoteConfig)?void 0:i.call(t,e)})}Vu(){try{this.config.loaded(this)}catch(e){nR.critical("`loaded` function failed",e)}if(this.th(),this.config.internal_or_test_user_hostname&&(null==iT?void 0:iT.hostname)){let e=iT.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this._u())&&this.eh()}
2,1),this.ih=new lq(this),this.ih.load()}th(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.ju)||e.enable())}_dom_loaded(){this.is_capturing()&&oj(this.__request_queue,e=>this.Bu(e)),this.__request_queue=[],this.th()}_handle_unload(){var e,t,i,r,s,n;this.Tu=!0,null==(e=this.surveys)||null==(t=e.handlePageUnload)||t.call(e),null==(i=this.metrics)||i.flush("sendBeacon"),this.config.request_batching?(this.nh()&&this.capture(oT),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(s=this.ju)||s.unload(),null==(n=this.Hu)||n.unload()):this.nh()&&this.capture(oT,null,{transport:"sendBeacon"})}_send_request(e){uO(this,e)}Bu(e,t){this.Hu?this.Hu.retriableRequest(e,t):this._send_request(t?sP(sP({},e),{},{transport:t}):e)}_execute_array(e){ht++;try{let t,i=[],r=[],s=[];oj(e,e=>{if(e)if(t=e[0],i2(t))s.push(e);else if(i3(e))try{e.call(this)}catch(t){nR.error("Error executing queued PostHog call",e,t)}else i2(e)&&"alias"===t?i.push(e):i2(e)&&-1!==t.indexOf("capture")&&i3(this[t])?s.push(e):r.push(e)});let n=function(e,t){oj(e,function(e){try{if(i2(e[0])){let i=t;oD(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){nR.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(r,this),n(s,this)}finally{ht--}}push(t){if(ht>0&&i2(t)&&i8(t[0])){let i=e.prototype[t[0]];return void(i3(i)&&i.apply(this,t.slice(1)))}this._execute_array([t])}get sh(){return{property:nN,persistenceKey:nB,cookieName:"_fbc",pattern:hl,register:(e,t)=>{var i;return null==(i=this.persistence)?void 0:i.register({[nB]:{value:e,delivered:t}})},unregister:()=>{var e;return null==(e=this.persistence)?void 0:e.unregister(nB)}}}get rh(){return{property:nq,persistenceKey:nz,cookieName:"_fbp",pattern:hu,register:(e,t)=>{var i;return null==(i=this.persistence)?void 0:i.register({[nz]:{value:e,delivered:t}})},unregister:()=>{var e;return null==(e=this.persistence)?void 0:e.unregister(nz)}}}oh(e){var t;let i=null==(t=this.persistence)?void 0:t.get_property(e.persistenceKey);return i8(i)&&e.pattern.test(i)?{value:i,delivered:!1}:i5(i)&&i8(i.value)&&e.pattern.test(i.value)?{value:i.value,delivered:!0===i.delivered}:void 0}ah(e,t,i){return t===(null==i?void 0:i.value)?{value:t,pending:!i.delivered}:(e.register(t,!1),{value:t,pending:!0})}uh(e){if(!this.config.save_campaign_params||this._u())return;let t=oG(e.cookieName);return i8(t)&&e.pattern.test(t)?t:void 0}hh(e,t,i,r){if(!this.persistence)return;let s=this.sh;this.persistence.refreshKey(s.persistenceKey);let n=this.oh(s);if(r)return void s.unregister();if(i)return i8(t)&&hl.test(t)?this.ah(s,t,n):void s.unregister();let o=i8(e)&&ha.test(e)?e:void 0,a=this.uh(s);return a&&((e,t,i)=>{let r=e.split(".");if(t)return r[3]===t;if(!i)return!0;let s=i.value.split(".");return r[3]===s[3]||Number(r[2])>Number(s[2])})(a,o,n)?this.ah(s,a,n):o?(null==n?void 0:n.value.split(".")[3])===o?{value:n.value,pending:!n.delivered}:this.ah(s,`fb.1.${Date.now()}.${o}`,n):n?{value:n.value,pending:!n.delivered}:void 0}dh(e,t,i){if(!this.persistence)return;let r=this.rh;this.persistence.refreshKey(r.persistenceKey);let s=this.oh(r);if(i)return void r.unregister();if(t)return i8(e)&&hu.test(e)?this.ah(r,e,s):void r.unregister();let n=this.uh(r);return n?this.ah(r,n,s):s?{value:s.value,pending:!s.delivered}:void 0}fh(e,t){if(!this.persistence)return;this.persistence.refreshKey(e.persistenceKey);let i=this.oh(e);(null==i?void 0:i.value)!==t||i.delivered||e.register(t,!0)}capture(e,t,i){var r,s,n,o,a,l,u,h;let c,d;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.ju))return void nR.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(i4(e)||!i8(e))return void nR.error("No event name provided to posthog.capture");this.xu();let p=!this.config.opt_out_useragent_filter&&this._is_bot();if(p&&!this.config.__preview_capture_bot_pageviews)return;let f=(null==i?void 0:i.skip_client_rate_limiting)?void 0:this.rateLimiter.clientRateLimitContext();if(null==f?void 0:f.isRateLimited)return void nR.critical("This capture call is ignored due to client rate limiting.");(null==t?void 0:t.$current_url)&&!i8(null==t?void 0:t.$current_url)&&(nR.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||(null==i?void 0:i.ph)||nR.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(c=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();let g=new Date,v=(null==i?void 0:i.timestamp)||g,_=sm(null==i?void 0:i.uuid,oQ),m={uuid:_,event:e,properties:this.calculateEventProperties(e,t||{},v,_)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&p&&(m.event="$bot_pageview",m.properties.$browser_type="bot"),f&&(m.properties.$lib_rate_limit_remaining_tokens=f.remainingTokens);let y="$feature_flag_called"===e&&!1===m.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");(null==i?void 0:i.$set)&&!y&&(m.$set=null==i?void 0:i.$set);let b=i5(null==t?void 0:t.$set)?t.$set:void 0,w=i2(null==t?void 0:t.$unset)?t.$unset:[],x=(null==i?void 0:i.$unset)||[],k=e=>{var t;let r=!!(null==i?void 0:i.$set)&&e in i.$set;return{hasProvided:r||!!b&&e in b,provided:r?null==i||null==(t=i.$set)?void 0:t[e]:null==b?void 0:b[e],unset:-1!==w.indexOf(e)||-1!==x.indexOf(e)}},S=k(nN),$=k(nq),E=[{channel:this.sh,hasProvided:S.hasProvided,update:this.hh(null==c?void 0:c.fbclid,S.provided,S.hasProvided,S.unset)},{channel:this.rh,hasProvided:$.hasProvided,update:this.dh($.provided,$.hasProvided,$.unset)}];for(let{channel:e,hasProvided:t,update:i}of E)i&&!0===m.properties.$process_person_profile&&i.pending&&!t&&!y&&(m.$set=sP({[e.property]:i.value},m.$set));let P=null==i?void 0:i.$unset;P&&(m.$unset=P);let R=y?void 0:this.gh(null==i?void 0:i.$set_once,e!==oL,e===oA);
2if(R&&(m.$set_once=R),(null==i?void 0:i._noTruncate)||(n=this.config.properties_string_max_length,a=m,l=e=>i8(e)?e.slice(0,n):e,d=new Set,m=function e(t,i){let r;if(t!==Object(t))return l(t);if(!d.has(t)){if(d.add(t),i2(t))r=[],oj(t,t=>{r.push(e(t))});else{let i={};oD(rl(t)?oU(t):t,(t,r)=>{d.has(t)||(i[r]=e(t,r))}),r=i}return r}}(a)),m.timestamp=v,i4(null==i?void 0:i.timestamp)||(m.properties.$event_time_override_provided=!0,m.properties.$event_time_override_system_time=g),y&&(m.properties=((e,t=[])=>{let i={},r=t=>{void 0!==e[t]&&(i[t]=e[t])};return ne.forEach(r),t.forEach(r),i})(m.properties,hh)),e===lT||e===lA){let i,r=null==t?void 0:t.$survey_id,s=null==t?void 0:t.$survey_iteration;u0({id:r,current_iteration:s}),m.$set=sP(sP({},m.$set),{},{[(u={id:r,current_iteration:s},h=e===lA?"responded":"dismissed",i=`$survey_${h}/${u.id}`,u.current_iteration&&u.current_iteration>0&&(i=`$survey_${h}/${u.id}/${u.current_iteration}`),i)]:!0})}else e===lI&&(m.$set=sP(sP({},m.$set),{},{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){let e=null==t?void 0:t.$product_tour_type;e&&(m.$set=sP(sP({},m.$set),{},{[`$product_tour_last_seen_date/${e}`]:(new Date).toISOString()}))}let C=sP(sP({},m.properties.$set),m.$set);if(i6(C)||this.setPersonPropertiesForFlags(C),!re(this.config.before_send)){let e=this.Os(m);if(!e)return;(m=e).uuid=sm(m.uuid,oQ)}let O=E.filter(({channel:e,update:t})=>{var i,r,s;let n=null!=(i=null==(r=m.$set)?void 0:r[e.property])?i:i5(null==(s=m.properties)?void 0:s.$set)?m.properties.$set[e.property]:void 0;return(null==t?void 0:t.pending)&&n===t.value});this.fu.emit("eventCaptured",m);let M=null!=(r=null==i?void 0:i._url)?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),F="recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(M),I=sP(sP(sP({method:"POST",url:M,data:m,compression:"best-available",preferSyncCompression:null==i?void 0:i.send_instantly,timestampMode:F?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},F&&(null==(s=m.properties)?void 0:s.$session_id)?{batchGroup:m.properties.$session_id+(m.properties.$window_id?`-${m.properties.$window_id}`:"")}:{}),(null==i?void 0:i.transport)?{transport:i.transport}:{}),O.length?{fireCallbackOnDrop:!0,callback:e=>{if(e.statusCode>=200&&300>e.statusCode)for(let{channel:e,update:t}of O)this.fh(e,t.value)}}:{});if(!this.config.request_batching||i&&!(null==i?void 0:i._batchKey)||(null==i?void 0:i.send_instantly)||O.length){let e;!I.transport&&!I.callback&&i6(null!=(o=this.config.request_headers)?o:{})&&this.Tu&&(e="sendBeacon"),this.Bu(I,e)}else this.ju.enqueue(I);return m}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}getExtension(e){var t;return null==(t=this.Yu)?void 0:t.getExtension(e)}Qu(){var e;return null!=(e=this.Yu)?e:this.Yu=new u9(this)}gu(e){this.Ru.push(e);let t=!0;return()=>{if(!t)return;t=!1;let i=this.Ru.indexOf(e);-1!==i&&this.Ru.splice(i,1)}}mh(e=!0){var t,i,r;return!!(null==(t=this.persistence)?void 0:t.consumeCookieIdentityChange())&&(this.Du=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(r=this.sessionPersistence)||r.clear(),this.Eu.clear(),this.yh()),null==(i=this.featureFlags)||i.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,t,i,r,s){let n;if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this.mh();let o=s?void 0:this.persistence.remove_event_timer(e),a=sP({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this._u()&&(a[ox]=!0),"$snapshot"===e){let e=sP(sP({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=e.distinct_id,(!i8(a.distinct_id)&&!rt(a.distinct_id)||i7(a.distinct_id))&&nR.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}let l=function(e,t,i,r=!1){var s,n,o,a;let l,u;if(!iN)return{};let h=e?[...lr,...t||[]]:[],[c,d]=sa(iN),[p,f]=function(e){for(let t=0;sc.length>t;t++){let[i,r,s]=sc[t],n=e.match(i);if(n){let t=s&&e.match(s)||n;return[r,(null==t?void 0:t[1])||""]}
2}return["",""]}(iN),g=(null==(l="u">typeof navigator?navigator:void 0)?void 0:l.brave)?{brave:!0}:{},v={};i4(i)||(v.detectGoogleSearchApp=i);let _={},m=null==(s=navigator)||null==(s=s.userAgentData)?void 0:s.platform,y=null==(n=navigator)?void 0:n.maxTouchPoints,b=null==iO||null==(o=iO.screen)?void 0:o.width,w=null==iO||null==(a=iO.screen)?void 0:a.height,x=null==iO?void 0:iO.devicePixelRatio;i4(m)||(_.userAgentDataPlatform=m),i4(y)||(_.maxTouchPoints=y),i4(b)||(_.screenWidth=b),i4(w)||(_.screenHeight=w),i4(x)||(_.devicePixelRatio=x);let k=oN(oz({$os:c,$os_version:d,$browser:sr(iN,navigator.vendor,g,v),$webview_app:p,$webview_app_version:f,$device:sl(iN),$device_type:su(iN,_),$timezone:lg(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:a9(r?sb(null==iT?void 0:iT.href):null==iT?void 0:iT.href,h,ln),$host:null==iT?void 0:iT.host,$pathname:null==iT?void 0:iT.pathname,$raw_user_agent:iN.length>1e3?iN.substring(0,997)+"...":iN,$browser_version:sn(iN,navigator.vendor,g,v),$browser_language:lh(),$browser_language_prefix:"string"==typeof(u=lh())?u.split("-")[0]:void 0,$screen_height:null==iO?void 0:iO.screen.height,$screen_width:null==iO?void 0:iO.screen.width,$viewport_height:null==iO?void 0:iO.innerHeight,$viewport_width:null==iO?void 0:iO.innerWidth,$lib:iH.LIB_NAME,$lib_version:iH.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return iH.SDK_DIST_CHANNEL&&(k.$sdk_dist_channel=iH.SDK_DIST_CHANNEL),k}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){let{sessionId:e,windowId:t}=this.sessionManager.checkAndGetSessionAndWindowId(s,i.getTime(),!0);a.$session_id=e,a.$window_id=t}this.sessionPropsManager&&oN(a,this.sessionPropsManager.getSessionProps());try{var u;this.sessionRecording&&oN(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(u=this.Hu)?void 0:u.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===uK&&(a.$lib_custom_api_host=this.config.api_host),n="$pageview"!==e||s?"$pageleave"!==e||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),a=oN(a,n),"$pageview"===e&&iI&&(a.title=iI.title),!i4(o)){let e=i.getTime()-o;a.$duration=parseFloat((e/1e3).toFixed(3))}iN&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");let h=this.persistence.properties(),c=this.sessionPersistence.properties(),d=a.$groups,p=h.$groups;i5(d)&&!i6(d)&&(a.$groups=sP(sP({},i5(p)?p:{}),d)),oD(["$referrer","$referring_domain"],e=>{e in h&&delete c[e]});let f={};if(this.Ru.length>0)for(let e of this.Ru.slice())try{oN(f,e())}catch(e){nR.error("Failed to produce browser extension event properties",e)}(a=oN({},l,h,c,sP(sP({},f),a))).$is_identified=this._isIdentified(),i2(this.config.property_denylist)?oD(this.config.property_denylist,function(e){delete a[e]}):nR.error(ho+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);let g=this.config.sanitize_properties;g&&(nR.error(hn),a=g(a,e));let v=this.bh();return a.$process_person_profile=v,v&&!s&&this._h("_calculate_event_properties"),a}gh(e,t=!0,i=!1){var r;if(!this.persistence||!this.bh()||this.Mu&&!i)return e;let s=oN({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(nR.error(hn),s=n(s,"$set_once")),t&&(this.Mu=!0),i6(s)?void 0:s}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var r;null==(r=this.persistence)||r.register_once(e,t,i)}register_for_session(e){var t,i;null==(t=this.persistence)||t.syncCookieProperties(),this.mh(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach(e=>this.Eu.add(e)),this.yh()}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this.Eu.delete(e),this.yh()}wh(e,t){this.register({[e]:t})}
2zu(){this.Eu.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.Eu.clear(),this.yh()}yh(){var e;if(!this.Pu)return;if("memory"===this.config.persistence||(null==(e=this.sessionPersistence)?void 0:e.mi)||!al.Et())return void al.Lt(this.Pu);let t=[];this.Eu.forEach(e=>t.push(e)),t.length>0?al.At(this.Pu,t):al.Lt(this.Pu)}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())?e:[]}isFeatureEnabled(e,t){var i,r;return null!=(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t))?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var r;null==(r=this.featureFlags)||r.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t=!1,i){var r;return null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.fu.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:hs}),()=>{})}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t=!1){this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:hs})}getActiveMatchingSurveys(e,t=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:hs})}onActiveMatchingSurveysChanged(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:hs}),()=>{})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t=u2){var i;null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!=(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))?t:{visible:!1,disabledReason:hs}}canRenderSurveyAsync(e,t=!1){var i,r;return null!=(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(e,t))?i:Promise.resolve({visible:!1,disabledReason:hs})}kh(e){return!e||i7(e)?(nR.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(nR.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(nR.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return nR.uninitializedWarning("posthog.identify");if(rt(e)&&(e=e.toString(),nR.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.kh(e)||!this._h("posthog.identify"))return;this.xu();let r=this.get_distinct_id(),s=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,n=this.mh(!1),o=this.persistence.La(),a=!1;try{let r=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property("__alias")&&(this.unregister(nD),this.register({distinct_id:e}));let o=(this.persistence.get_property("$user_state")||"anonymous")===oR,u=e!==r,h=!u&&o;if(u&&o){var l;let s=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:r};this.persistence.set_property(og,oC),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Na(),this.capture("$identify",s,{$set:t||{},$set_once:i||{}})&&(this.Du=uG(e,t,i)),null==(l=this.featureFlags)||l.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:r)}else if(h){this.persistence.set_property(og,oC);let r=t||{},s=i||{};this.setPersonPropertiesForFlags({$set:r,$set_once:s},!1),this.config.cookieWinsOnConflict&&this.persistence.Na(),this.capture("$set",{$set:r,$set_once:s}
2)&&(this.Du=uG(e,t,i))}else(t||i)&&this.setPersonProperties(t,i);u||s||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(oc)):h&&(t||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.Ba(a)}}setPersonProperties(e,t){if(!e&&!t||!this._h("posthog.setPersonProperties"))return;let i=uG(this.get_distinct_id(),e,t);this.Du!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}})&&(this.Du=i)):nR.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var t;let i=(i2(e)?e:[e]).filter(e=>i8(e)&&e.length>0);0!==i.length&&this._h("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Du=null)}group(e,t,i){var r;if(!e||!t)return void nR.error("posthog.group requires a group type and group key");null==(r=this.persistence)||r.syncCookieProperties(),this.mh();let s=this.getGroups(),n=s[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:sP(sP({},s),{},{[e]:t})}),(n||i)&&this.bh()){let r={$group_type:e,$group_key:t};i&&(r.$group_set=i),this.capture(oL,r)}i&&this.setGroupPropertiesForFlags({[e]:i}),n&&!i&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t=!0){var i;null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e=!0){var t;null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t=!0){var i;this._h("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){let t=rr(e)?e:null==e?void 0:e.resetDeviceID,i=rr(e)||null==e?void 0:e.bootstrap;this.Sh(t,!1,i)}Sh(e,t=!1,i){var r,s,n,o,a,l,u,h,c,d,p,f,g,v,_,m,y,b,w,x,k;if(nR.info("reset"),!this.__loaded)return nR.uninitializedWarning("posthog.reset");let S=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.Nu)?void 0:r.bootstrap)||{},null==(s=this.featureFlags)||null==(n=s.updateConfig)||n.call(s,this.config,this.sl());let $=this.get_property(nL),E=this.get_property(nj),P=this.get_property(n0);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();let R=this.is_capturing();this.consent.reset(),t||!R||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");let C=null==(a=this.persistence)||null==(l=a.La)?void 0:l.call(a),O=!1;try{if(null==(u=this.persistence)||u.clear(),null==(h=this.sessionPersistence)||h.clear(),this.Eu.clear(),this.yh(),i4(P)||null==(m=this.persistence)||m.register({$session_recording_remote_config:P}),null==(c=this.surveys)||c.reset(),null==(d=this.featureFlags)||d.reset(),null==(p=this.conversations)||p.reset(),null==(f=this.logs)||f.reset(),null==(g=this.metrics)||g.reset(),null==(v=this.persistence)||v.set_property("$user_state","anonymous"),null==(_=this.sessionManager)||_.resetSessionId(),this.Du=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:ow,$device_id:null},"");else{let t=this.config.get_device_id(oQ());this.register_once({distinct_id:t,$device_id:e?t:$},""),e||i4(E)||this.register({[nj]:E})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(i.distinctID&&!this._u()&&(null==(w=this.persistence)||w.set_property("$user_state",i.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.distinctID})),null==(y=this.featureFlags)||y.initialize(),!re(S)&&!(null==(b=this.sessionManager)?void 0:b.setBootstrapSessionId(S,!0)))){let e=sP({},i);delete e.sessionID,this.config.bootstrap=e}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,O=!0}finally{C&&(null==(x=this.persistence)||null==(k=x.Ba)||k.call(x,O))}this.reloadFeatureFlags()}shutdown(e){var t=this;return rf(function*(){var e,i,r,s,n,o,a,l,u;if(t.__loaded){t.Iu=!0,t.Qu().dispose(),null==(e=t.sessionRecording)||e.dispose(),null==(i=t.logs)||i.flushLogs("sendBeacon"),null==(r=t.metrics)||r.flush("sendBeacon"),null==(s=t.metrics)||s.dispose(),null==(n=t.ju)||n.unload(),null==(o=t.Hu)||o.unload();try{null==(u=t.featureFlags)||u.destroy()}catch(e){nR.error("Error while destroying feature flags",e)}null==(a=t.persistence)||a.destroy(),null==(l=t.sessionPersistence)||l.destroy()}else nR.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.xh()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(e=this.conversations)||e.Ch()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";let{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${t}`);if((null==e?void 0:e.withTimestamp)&&i){var s;let t=null!=(s=e.timestampLookBack)?s:10;if(!i)return r;r+=`?t=${Math.max(Math.floor(((new Date).getTime()-i)/1e3)-t,0)}`}return r}alias(e,t){return e===this.get_property("$people_distinct_id")?(nR.critical("Attempting to create alias for existing People user - aborting."),-2):this._h("posthog.alias")?(i4(t)&&(t=this.get_distinct_id()),e!==t?(this.wh(nD,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(nR.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){let t=sP({},this.config);if(i5(e)){var i,r,s,n,o,a,l,u,h,c,d,p,f,g,v;oN(this.config,hf(e));let _=this.Cu();null==(i=this.persistence)||i.update_config(this.config,t,_),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new lR(sP(sP({},this.config),{},{persistence:"sessionStorage"}),_,!1);let m=this.Lu(this.config.debug);rr(m)&&(this.config.debug=m),rr(this.config.debug)&&(this.config.debug?(iH.DEBUG=!0,o6.Et()&&o6.At("ph_debug",!0),nR.info("set_config",{config:e,oldConfig:t,newConfig:sP({},this.config)})):(iH.DEBUG=!1,o6.Et()&&o6.Lt("ph_debug"))),null==(r=this.featureFlags)||null==(s=r.updateConfig)||s.call(r,this.config,this.sl()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(a=this.metrics)||a.onConfigChange(),null==(l=this.sessionRecording)||l.startIfEnabledOrStop(),null==(u=this.tracingHeaders)||u.startIfEnabledOrStop(),null==(h=this.autocapture)||h.startIfEnabled(),null==(c=this.heatmaps)||c.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(v=this.historyAutocapture)||v.startIfEnabledOrStop()),null==(d=this.exceptionObserver)||d.startIfEnabledOrStop(),null==(p=this.deadClicksAutocapture)||p.startIfEnabledOrStop(),null==(f=this.surveys)||f.loadIfEnabled(),this.$u(),null==(g=this.externalIntegrations)||g.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&aY(this,hi,!1)}}
2_overrideSDKInfo(e,t){iH.LIB_NAME=e,iH.LIB_VERSION=t}startSessionRecording(e){var t,i,r,s,n;let o=!0===e,a={sampling:o||!!(null==e?void 0:e.sampling),linked_flag:o||!!(null==e?void 0:e.linked_flag),url_trigger:o||!!(null==e?void 0:e.url_trigger),event_trigger:o||!!(null==e?void 0:e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!!(null==(e=this.sessionRecording)?void 0:e.started)}captureException(e,t){try{if(!this.exceptions)return;let i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(sP(sP({},i),t))}catch(e){return}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var t,i;return null!=(t=null==(i=this.logs)?void 0:i.logger)?t:e.$h}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!=(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e;let t=null!=(e=this.config.name)?e:hc;return t!==hc&&(t="posthog."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property("$user_state"))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property("$user_state"))}bh(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&i6(this.getGroups())&&!(null==(e=this.persistence)||null==(e=e.props)?void 0:e.__alias)&&!(null==(t=this.persistence)||null==(t=t.props)?void 0:t.$epp))}nh(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.bh()||this._h("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this._h("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}_h(e){return"never"===this.config.person_profiles?(nR.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.wu(),this.wh(ob,!0),!0)}Cu(){if("always"===this.config.cookieless_mode)return!0;let e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)}$u(){var e,t,i,r,s;let n=this.Cu();return this.is_capturing()||null==(i=this.logs)||i.Th(),(null==(e=this.persistence)?void 0:e.mi)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t.mi)!==n&&(null==(s=this.sessionPersistence)||s.set_disabled(n)),n&&(this.Eu.clear(),this.yh()),n}opt_in_capturing(t){var i,r,s,n,o,a,l,u,h,c,d;if("always"!==this.config.cookieless_mode){if(this._u()){null==(r=this.sessionRecording)||r.dispose({discardBufferedEvents:!0}),this.Sh(!0,!0),null==(s=this.sessionManager)||s.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new uN(this),this.pageViewManager=new a1(this),this.persistence&&(this.sessionPropsManager=new uL(this,this.sessionManager,this.persistence));let t=null!=(o=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)?o:null==(l=e.__defaultExtensionClasses)?void 0:l.sessionRecording;t&&(this.sessionRecording=this.bu(this.sessionRecording,new t(this)),this.vu&&(null==(u=this.sessionRecording)||null==(h=u.onRemoteConfig)||h.call(u,this.vu)))}this.consent.optInOut(!0),this.$u(),this.th(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(c=this.surveys)||c.loadIfEnabled()),(i4(null==t?void 0:t.captureEventName)||(null==t?void 0:t.captureEventName))&&this.capture(null!=(d=null==t?void 0:t.captureEventName)?d:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.eh()}else nR.warn(hr)}opt_out_capturing(){var e,t;if("always"===this.config.cookieless_mode)return void nR.warn(hr);let i="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.Sh(!0,!0),this.consent.optInOut(!1),this.$u(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:ow,$device_id:null}),this.yu(i),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewM
2anager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.eh(),this.th())}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){let e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.$u()}_is_bot(){return iF?uB(iF,this.config.custom_blocked_useragents):void 0}eh(){iI&&("visible"===iI.visibilityState?this.Au||(this.Au=!0,this.capture(oI,{title:iI.title},{send_instantly:!0}),this.Fu&&(iI.removeEventListener(oM,this.Fu),this.Fu=null)):this.Fu||(this.Fu=this.eh.bind(this),oW(iI,oM,this.Fu)))}debug(e){!1===e?(null==iO||iO.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==iO||iO.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)`."),this.set_config({debug:!0}))}sl(){var e,t;let i,r,s=this.Nu||{};return"advanced_disable_flags"in s?!!s.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(nR.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in s&&!re(s[e]),r=t in s&&!re(s[t]),i?s[e]:!!r&&(nR&&nR.warn(`Config field '${t}' is deprecated. Please use '${e}' instead. The old field will be removed in a future major version.`),s[t]))}Os(e){var t;if(re(this.config.before_send))return e;let i=Object.keys(null!=(t=e.properties)?t:{}).filter(rn),r=i2(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(let t of r)try{if(s=t(s),re(s)){let t=`Event '${e.event}' was rejected in beforeSend function`;return rs(e.event)?nR.warn(`${t}. This can cause unexpected behavior.`):nR.info(t),null}s.properties&&!i6(s.properties)||nR.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(t){return nR.error(`Error in beforeSend function for event '${e.event}':`,t),null}for(let t of i)if(s.properties&&re(s.properties[t]))return nR.warn(`Event '${e.event}' had its '${t}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return s}getPageViewId(){var e;return null==(e=this.pageViewManager.Go)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}Lu(e){let t=rr(e)&&!e,i=o6.Et()&&"true"===o6.Ot("ph_debug");return!t&&(!!i||e)}};hv.__defaultExtensionClasses={},hv.$h={trace:a=()=>{},debug:a,info:a,warn:a,error:a,fatal:a},function(e,t){for(let i=0;t.length>i;i++)e.prototype[t[i]]=oq(e.prototype[t[i]])}(hv,["identify"]);var h_=class{constructor(e){this.disabled=!1===e;const t=i5(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;let r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}};let hm="$copy_autocapture",hy=nC("[AutoCapture]");function hb(e,t){return t.length>e?t.slice(0,e)+"...":t}var hw=class{fo(){this.po=void 0,clearTimeout(this.mo),this.mo=void 0}yo(e){var t;if(!aA(e))return!0;let i=null!=(t=this.bo().css_selector_ignorelist)?t:aE,r=new Set,s=e;for(;s;){if(r.size>=1e3||r.has(s))return!0;r.add(s);let e=s,t=am(e);if(iJ(t,"ph-no-capture")||iJ(t,"ph-sensitive")||aL(e)||i.some(t=>ak(e,t)))return!0;let n=s.parentNode;s=ag(n)?n.host:n&&ad(n)?n:null}return!1}_o(e){if(!this.isEnabled||"pointercancel"===e.type)return void this.fo();if("pointerdown"===e.type){var t;this.fo();let i=aw(e);return void(e.isPrimary&&0===e.button&&!e.ctrlKey&&i&&ad(i)&&(this.po={target:i,excluded:this.yo(i),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:null==(t=this.wo)?void 0:t.distinctId}))}let i=this.po;i&&(e.pointerId!==i.id||Math.abs(e.clientX-i.x)>5||Math.abs(e.clientY-i.y)>5?this.fo():"pointerup"===e.type&&(i.released=!0,this.mo=setTimeout(()=>this.fo(),0)))}ko(e){var t,i;let r=this.po;this.fo();let s=aw(e);if((null==r?void 0:r.released)&&r.target.isConnected&&r.distinctId===(null==(t=this.wo)?void 0:t.distinctId)&&e.pointerId===r.id&&(e.detail>0||"touch"===e.pointerType||"pen"===e.pointerType)&&0===e.button&&5>=Math.abs(e.clientX-r.x)&&5>=Math.abs(e.clientY-r.y)&&s&&(ap(s,"html")||ap(s,"body"))){if(r.excluded)return null;let e=null!=(i=this.bo().css_selector_ignorelist)?i:aE;return[s,null==iI?void 0:iI.documentElement,null==iI?void 0:iI.body].some(t=>{if(!t)return!1;let i=am(t);return iJ(i,"ph-no-capture")||iJ(i,"ph-sensitive")||!aA(t)||aL(t)||e.some(e=>ak(t,e))})?null:r.target}}constructor(e){this.So=e,this.name="autocapture",this.xo=!1,this.Co=null,this.$o=!1,this.To=new Map,this.Io=!1,this.Rr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Mo=!1,this.So.refresh(this.Rr),this.rageclicks=new h_(this.Rr.rageclick),this.Eo=null}setup(e){this.Po(),this.wo=e;let t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.Mo?t.dispose():(this.Ro=t,this.startIfEnabled())}dispose(){var e;this.Mo||(this.Mo=!0,this.wo=void 0,null==(e=this.Ro)||e.dispose(),this.Ro=void 0,this.To.clear(),this.Eo=null,this.Ao())}bo(){return this.So.refresh(this.Rr),this.Rr}Po(){var e,t;return this.bo(),this.Rr.url_allowlist=null==(e=this.Rr.url_allowlist)?void 0:e.map(e=>new RegExp(e)),this.Rr.url_ignorelist=null==(t=this.Rr.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),this.Rr}
2Fo(){if(!this.isBrowserSupported())return void hy.info("Disabling Automatic Event Collection because this browser is not supported");if(!iO||!iI)return;let e=this.Oo=e=>{e=e||(null==iO?void 0:iO.event);try{if("blur"===e.type)return void this.fo();if(0===e.type.indexOf("pointer"))return void this._o(e);let t="click"===e.type?this.ko(e):void 0;if(i9(t))return;this.Do(e,"$autocapture",t)}catch(e){hy.error("Failed to capture event",e)}};if(oW(iO,"blur",e),oW(iI,"submit",e,{capture:!0}),oW(iI,"change",e,{capture:!0}),oW(iI,"click",e,{capture:!0}),oD(["pointerdown","pointermove","pointerup","pointercancel"],t=>{oW(iI,t,e,{capture:!0})}),this.bo().capture_copied_text){let e=this.Lo=e=>{e=e||(null==iO?void 0:iO.event);try{this.Do(e,hm)}catch(e){hy.error("Failed to capture clipboard event",e)}};oW(iI,"copy",e,{capture:!0}),oW(iI,"cut",e,{capture:!0}),oW(iI,"paste",e,{capture:!0})}}Ao(){this.fo(),this.Oo&&(null==iO||iO.removeEventListener("blur",this.Oo),oD(["pointerdown","pointermove","pointerup","pointercancel"],e=>{null==iI||iI.removeEventListener(e,this.Oo,!0)}),null==iI||iI.removeEventListener("submit",this.Oo,!0),null==iI||iI.removeEventListener("change",this.Oo,!0),null==iI||iI.removeEventListener("click",this.Oo,!0),this.Oo=void 0),this.Lo&&(null==iI||iI.removeEventListener("copy",this.Lo,!0),null==iI||iI.removeEventListener("cut",this.Lo,!0),null==iI||iI.removeEventListener("paste",this.Lo,!0),this.Lo=void 0),this.xo=!1}startIfEnabled(){this.isEnabled||this.fo(),!this.Mo&&this.wo&&this.isEnabled&&!this.xo&&(this.Fo(),this.xo=!0)}onRemoteConfig(e){var t;if(this.Mo)return;if(this.$o=!0,!e.ok)return void this.startIfEnabled();let i=e.config;
2i.elementsChainAsString&&(this.Io=i.elementsChainAsString);let r=i.autocapture_opt_out;rr(r)&&(null==(t=this.wo)||t.kv.set("$autocapture_disabled_server_side",r),this.Co=r),this.startIfEnabled()}setElementSelectors(e,t=this){if(this.Mo)return;e.size?this.To.set(t,new Set(e)):this.To.delete(t);let i=new Set;this.To.forEach(e=>{e.forEach(e=>i.add(e))}),this.Eo=i}getElementSelectors(e,t){var i;let r=[];return null==(i=this.Eo)||i.forEach(i=>{let s=null==iI?void 0:iI.querySelectorAll(i);null==s||s.forEach(s=>{e!==s&&t!==s||iJ(r,i)||r.push(i)})}),r}get isEnabled(){var e,t;if(this.Mo)return!1;let i=null==(e=this.wo)?void 0:e.kv.get(nH),r=this.Co,s=this.bo();if(!s.remoteRequestsDisabled&&!this.$o)return!1;let n=s.remoteRequestsDisabled&&!this.$o;if(i9(r)&&!rr(i)&&!n)return!1;let o=null!=(t=this.Co)?t:!!i;return!!s.enabled&&!o}Do(e,t="$autocapture",i){var r,s,n,o;if(!this.isEnabled)return void this.fo();let a=i||aw(e);af(a)&&(a=a.parentNode||null);let l=this.Po();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&l.rageclick&&(null==(r=this.rageclicks)?void 0:r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime()))&&aF(a,l.rageclick)&&this.Do(e,"$rageclick",i);let u=t===hm,h=u?sP(sP({},l),{},{dom_event_allowlist:void 0}):l;if(a&&function(e,t,i,r,s,n){var o;if(!iO||aI(e)||(null==i?void 0:i.url_allowlist)&&!a_(i.url_allowlist,n)||(null==i?void 0:i.url_ignorelist)&&a_(i.url_ignorelist,n))return!1;if(null==i?void 0:i.dom_event_allowlist){let e=i.dom_event_allowlist;if(e&&!e.some(e=>t.type===e))return!1}let{parentIsUsefulElement:a,targetElementList:l}=aT(e,r);if(!function(e,t){let i=null==t?void 0:t.element_allowlist;if(i4(i))return!0;for(let t of e)if(i.some(e=>t.tagName.toLowerCase()===e))return!0;return!1}(l,i)||!aS(l,null==i?void 0:i.css_selector_allowlist)||aS(l,null!=(o=null==i?void 0:i.css_selector_ignorelist)?o:aE))return!1;try{let i=iO.getComputedStyle(e);if(i&&"pointer"===i.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}let u=e.tagName.toLowerCase();switch(u){case"html":return!1;case"form":return(s||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(t.type)>=0;default:return a?(s||["click"]).indexOf(t.type)>=0:(s||["click"]).indexOf(t.type)>=0&&(ax.indexOf(u)>-1||"true"===e.getAttribute("contenteditable"))}}(a,e,h,u,u?["copy","cut","paste"]:void 0,{config:{get_current_url:l.getCurrentUrl}})){let{props:i,explicitNoCapture:r,target:u}=function(e,{e:t,maskAllElementAttributes:i,maskAllText:r,elementAttributeIgnoreList:s,elementsChainAsString:n,disableCaptureUrlHashes:o}){var a,l,u,h;if(!ad(e))return{props:{}};let c=[e],d=new Set([e]),p=e;for(;p.parentNode&&!ap(p,"body")&&1e3>c.length;){if(ag(p.parentNode)){let e=p.parentNode.host;if(d.has(e))break;d.add(e),c.push(e),p=e;continue}if(!ad(p.parentNode)||d.has(p.parentNode))break;d.add(p.parentNode),c.push(p.parentNode),p=p.parentNode}let f="click"===t.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?c.findIndex(e=>ap(e,"button")||ap(e,"a")):-1;f>0&&(r=r||c.slice(0,f+1).some(e=>!aA(e)||aL(e)));let g=[],v={},_,m=!1,y=!1;if(oD(c,e=>{let t=aA(e);if(ap(e,"a")&&!i&&!(null==s?void 0:s.includes("href"))){let i=e.getAttribute("href");m=!!(t&&i&&aU(i))&&(o?sb(i):i)}iJ(am(e),"ph-no-capture")&&(y=!0),g.push(function(e,t,i,r,s=!1){let n=e.tagName.toLowerCase(),o={tag_name:n};ax.indexOf(n)>-1&&!i&&(o.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?hb(1024,aH(e)):hb(1024,ab(e)));let a=am(e);t||(null==r?void 0:r.includes("class"))||0>=a.length||(o.classes=a.filter(function(e){return""!==e})),oD(e.attributes,function(i){var n;if((!aL(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&!(null==r?void 0:r.includes(i.name))&&!t&&aU(i.value)&&(!i8(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){let e=i.value;"class"===i.name&&(e=av(e).join(" ")),o["attr__"+i.name]=hb(1024,"href"===i.name&&s?sb(e):e)}});let l=1,u=1,h=e;for(;h=function(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do t=t.previousSibling;while(t&&!ad(t))return t}(h);)l++,h.tagName===e.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(e,i,r,s,o)),oD(function(e){if(!aA(e))return{};let t={};return oD(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){let i=e.name.replace("data-ph-capture-attribute-",""),r=e.value;i&&r&&aU(r)&&(t[i]=r)}}),t}(e),(e,t)=>{({}).hasOwnProperty.call(v,t)||(v[t]=e)})}),y)return{props:{},explicitNoCapture:y};if(f>0&&(e=c[f],g.splice(0,f)),r||(g[0].$el_text=ap(e,"a")||ap(e,"button")?aH(e):ab(e)),m){g[0].attr__href=m;let e=null==(u=a8(m))?void 0:u.host,t=null==iO||null==(h=iO.location)?void 0:h.host;e&&t&&e!==t&&(_=m)}return{props:oN({$event_type:t.type,$ce_version:1},n?{}:{$elements:g},{$elements_chain:i2(g)?g.map(e=>{var t,i;let r={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:function(e){let t=e.attr__class;if(t)return i2(t)?t:av(t)}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return oB(e).filter(([e])=>
20===e.indexOf("attr__")).forEach(([e,t])=>r.attributes[e]=t),r}).map(e=>{var t,i;let r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(let t of(e.attr_class.sort(),e.attr_class))r+=`.${t.replace(/"/g,"")}`;let s=sP(sP(sP(sP({},e.text?{text:e.text}:{}),{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),n={};return oB(s).sort(([e],[t])=>t>e?-1:+(e>t)).forEach(([e,t])=>n[aW(e.toString())]=aW(t.toString())),r+=":",r+=oB(n).map(([e,t])=>`${e}="${t}"`).join("")}).join(";"):""},(null==(a=g[0])?void 0:a.$el_text)?{$el_text:null==(l=g[0])?void 0:l.$el_text}:{},_&&"click"===t.type?{$external_click_url:_}:{},v),target:e}}(a,{e:e,maskAllElementAttributes:l.maskAllElementAttributes,maskAllText:l.maskAllText,elementAttributeIgnoreList:l.element_attribute_ignorelist,elementsChainAsString:this.Io,disableCaptureUrlHashes:l.disableCaptureUrlHashes});if(r)return!1;let h=this.getElementSelectors(a,u);if(h&&h.length>0&&(i.$element_selectors=h),t===hm){let t=e.type||"clipboard";if("paste"!==t){let e=null==iO||null==(n=iO.getSelection())?void 0:n.toString(),t=ay(e);if(!t)return!1;i.$selected_content=t,i.$clipboard_text_length=null!=(o=null==e?void 0:e.length)?o:0}i.$copy_type=t}return null==(s=this.wo)||s.capture(t,i),!0}}isBrowserSupported(){return i3(null==iI?void 0:iI.querySelectorAll)}},hx=class{constructor(e){this._instance=e}refresh(e){let t=this._instance.config,i=i5(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance.sl(),e.url_allowlist=null==i?void 0:i.url_allowlist,e.url_ignorelist=null==i?void 0:i.url_ignorelist,e.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,e.element_allowlist=null==i?void 0:i.element_allowlist,e.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,e.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,e.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,e.capture_copied_text=null==i?void 0:i.capture_copied_text}};let hk=nC("[ExceptionAutocapture]"),hS=()=>{},h$=e=>{var t;if(i3(e))return null!=(t=e.__posthog_layer__)?t:e.__rrweb_layer__};function hE(e,t,i){try{if(!(t in e))return hS;let r={next:e[t]},s=i(function(...e){return r.next.apply(this,e)});return i3(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),e[t]=s,()=>{if(e[t]===s)return void(e[t]=r.next);let i=e[t],n=h$(i);for(;n;){if(n.next===s)return void(n.next=r.next);i=n.next,n=h$(i)}}}catch(e){return hS}}let hP=nC("[TracingHeaders]"),hR=nC("[Web Vitals]"),hC=["CLS","FCP","INP","LCP"],hO=["INP","LCP"],hM=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],hF="disabled",hI="lazy_loading",hT=nC("[SessionRecording]"),hA=nC("[Heatmaps]");function hL(e){return i5(e)&&"clientX"in e&&"clientY"in e&&rt(e.clientX)&&rt(e.clientY)}let hj=nC("[Product Tours]"),hD=e=>{var t;return!e.config.disable_product_tours&&!!(null==(t=e.persistence)?void 0:t.get_property(nY))},hN=["$set_once","$set"],hB=nC("[SiteApps]"),hq="Error while initializing PostHog app with config id ",hz=(e,t)=>(null==e?void 0:e.then)?e.then(t):t(e),hU="SDK is not enabled or survey functionality is not yet loaded",hH="Disabled. Not loading surveys.";var hW=class{constructor(e,t){this.So=e,this.Ih=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Mh=!1,this.Eh=!1,this.Ph=[],this.Rh=[],this.Ah=null,this.Fh=null,this.Mo=!1,this.Oh=new Set,this.onRemoteConfig=e=>{if(this.Mo||this.Rr.disableSurveys)return;if(!e.ok)return this.Eh=!0,this.Dh({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),uZ.warn("Remote config unavailable. Not loading surveys.");let t=e.config.surveys;if(re(t))return uZ.warn("Flags not loaded yet. Not loading surveys.");this.Lh=rr(t)?t:t.length>0,uZ.info(`flags response received, isSurveysEnabled: ${this.Lh}`),this.loadIfEnabled()},this.Dh=e=>
2{this.Rh.slice().forEach(t=>this.Nh(t,e))}}setup(e){if(!this.Mo)return this.qh=e,hz(e.kv.initialize(),()=>{if(this.qh!==e||this.Mo)return;this.qh=void 0,this.wo=e;let t=e.onRemoteConfig(this.onRemoteConfig);this.Mo?t.dispose():(this.Ro=t,this.loadIfEnabled())})}dispose(){var e,t,i,r,s;this.Mo||(this.Mo=!0,this.qh=void 0,this.wo=void 0,null==(e=this.Ro)||e.dispose(),this.Ro=void 0,null==(t=this._surveyEventReceiver)||t.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==(r=i.dispose)||r.call(i),this._surveyManager=null,this.Ph=[],this.Rh.forEach(e=>{e.active=!1}),this.Rh=[],null==(s=this.jh)||s.call(this),this.jh=void 0,this.Ah=null,this.Oh.forEach(e=>clearTimeout(e)),this.Oh.clear())}get Rr(){return this.So.get()}initialize(){this.loadIfEnabled()}reset(){var e,t,i;null==(e=this._surveyManager)||null==(t=e.clearInMemoryInProgressSurveyState)||t.call(e);try{null==(i=this._surveyEventReceiver)||i.reset(),localStorage.removeItem("lastSeenSurveyDate");let e=[];for(let t=0;t<localStorage.length;t++){let i=localStorage.key(t);((null==i?void 0:i.startsWith("seenSurvey_"))||(null==i?void 0:i.startsWith("inProgressSurvey_")))&&e.push(i)}e.forEach(e=>localStorage.removeItem(e))}catch(e){}this.Dh()}loadIfEnabled(){if(this.Mo||!this.wo)return;let e=this.Rr;if(this._surveyManager)return;if(this.Mh)return void uZ.info("Already initializing surveys, skipping...");if(e.disableSurveys)return void uZ.info(hH);if(e.cookielessMode&&this.So.isOptedOut())return void uZ.info("Not loading surveys in cookieless mode without consent.");let t=this.So.getExtensions();if(!t)return void this.Bh("PostHog Extensions not found.");if(i4(this.Lh)&&!e.advancedEnableSurveys)return;let i=this.Lh||e.advancedEnableSurveys;this.Mh=!0,this.Eh=!1;try{let e=t.generateSurveys;if(e)return this.Hh(e,i),void(this.Mh=!1);let r=t.loadExternalDependency;if(!r)return this.Bh(oP),void(this.Mh=!1);r(e=>{try{if(this.Mo)return;let t=this.So.getExtensions();!e&&(null==t?void 0:t.generateSurveys)?this.Hh(t.generateSurveys,i):this.Bh("Could not load surveys script",e)}finally{this.Mh=!1}})}catch(e){throw this.Mh=!1,this.Bh("Error initializing surveys",e),e}}Hh(e,t){var i,r;if(this.Mo)return;this._surveyManager=e(t),this._surveyEventReceiver=this.So.createEventReceiver(this.Dh);let s=null==(i=null!=(r=this.wo)?r:this.Ih)?void 0:i.kv.get(on);s&&this.zh(s),uZ.info("Surveys loaded successfully"),this.Uh(),this.Dh(),this.Wh({isLoaded:!0})}Bh(e,t){this.Eh=!0,uZ.error(e,t),this.Dh({isLoaded:!1,error:e}),this.Wh({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Ph.push(e),this._surveyManager&&this.Wh({isLoaded:!0}),()=>{this.Ph=this.Ph.filter(t=>t!==e)}}getSurveys(e,t=!1){var i;let r=null!=(i=this.wo)?i:this.Ih;if(!r||this.Mo)return;if(this.Rr.disableSurveys)return uZ.info(hH),e([]);let s=r.kv.get(on);if(s&&!t)return e(s,{isLoaded:!0}),void(this.Vh()&&this.getSurveys(()=>{},!0));if(this.Ah)return void this.Ah.then(({surveys:t,context:i})=>{this.Mo||e(t,i)}).catch(e=>uZ.error("Error in survey callback",e));let n=this.Gh("/api/surveys/",{method:"GET",query:{token:r.projectToken},sentAt:"query",timeoutMs:this.Rr.requestTimeoutMs}).then(e=>{try{return this.Zh(r,e)}catch(e){return uZ.error("Error processing surveys response",e),this.Zh(r,{statusCode:0,error:e})}},e=>this.Zh(r,{statusCode:0,error:e}));this.Ah=n;let o=()=>{this.Ah===n&&(this.Ah=null)};n.then(t=>{o(),this.Mo||(this.Dh(t.context),e(t.surveys,t.context))},o).catch(e=>uZ.error("Error in survey callback",e))}Gh(e,t){let i=this.wo;return i?i.sendRequest(e,t):new Promise(e=>e({statusCode:0,error:Error(hU)}))}Zh(e,t){if(this.Mo)return{surveys:[],context:{isLoaded:!1,error:hU}};let i=t.statusCode;if(200!==i||!t.json){let e=`Surveys API could not be loaded, status: ${i}`;return 0!==i?uZ.error(e):t.error||uZ.warn(e),this.Fh=Date.now(),{surveys:[],context:{isLoaded:!1,error:e}}}this.Fh=null;let r=t.json.surveys||[];return e.kv.set({[on]:r,[oo]:Date.now()}),this.zh(r),{surveys:r,context:{isLoaded:!0}}}zh(e){var t;let i=e.filter(e=>{var t;return!(!e.start_date||e.end_date)&&(uz(e)||!!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length))});null==(t=this._surveyEventReceiver)||t.replace(i)}Vh(){return this.Qh()&&!this.Ah&&!this.Jh()}Qh(){var e,t;
2let i=null==(e=null!=(t=this.wo)?t:this.Ih)?void 0:e.kv.get(oo);return rt(i)&&Date.now()-i>3e5}Jh(){return rt(this.Fh)&&3e5>Date.now()-this.Fh}markSurveyAsSeen(e,t){var i;u0({id:e,current_iteration:null!=(i=null==t?void 0:t.iteration)?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}this.Dh()}Wh(e){for(let t of this.Ph)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){uZ.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t=!1){if(!re(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);uZ.warn("init was not called")}onActiveMatchingSurveysChanged(e){var t,i;if(this.Mo)return()=>{};let r={callback:e,active:!0,revision:0};this.Rh.push(r),this.Uh();let s=null==(t=null!=(i=this.wo)?i:this.Ih)?void 0:t.kv.get(on);return!this.Rr.disableSurveys&&(this._surveyManager||!this.Eh||this.Mh)&&(s||re(this.Fh)||this.Ah)?this._surveyManager&&this.Nh(r):this.Nh(r,{isLoaded:!1}),()=>{var e;r.active=!1,this.Rh=this.Rh.filter(e=>e!==r),0===this.Rh.length&&(null==(e=this.jh)||e.call(this),this.jh=void 0)}}Uh(){var e,t;this._surveyManager&&this.Rh.length>0&&(null!=this.jh||(this.jh=null==(e=(t=this.So).onMatchingConditionsChanged)?void 0:e.call(t,this.Dh)))}Nh(e,t){if(this.Mo||!e.active)return;let i=++e.revision,r=r=>{if(!this.Mo&&e.active&&i===e.revision)try{let i=null!=t?t:{isLoaded:!0},s=JSON.stringify([r,i]);if(s===e.lastResult)return;e.lastResult=s,e.callback(r,i)}catch(e){uZ.error("Error in active matching surveys callback",e)}};try{t&&!t.isLoaded?r([]):this.getActiveMatchingSurveys(r)}catch(e){uZ.error("Error in active matching surveys callback",e)}}Kh(e){let t=null;return this.getSurveys(i=>{var r;t=null!=(r=i.find(t=>t.id===e))?r:null}),t}Xh(e){if(re(this._surveyManager))return{eligible:!1,reason:hU};let t="string"==typeof e?this.Kh(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Yh(e){if(!this.So.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(re(this._surveyManager))return{eligible:!1,reason:hU};let t="string"==typeof e?this.Kh(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(re(this._surveyManager))return uZ.warn("init was not called"),{visible:!1,disabledReason:hU};let t=this.Yh(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return re(this._surveyManager)?(uZ.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:hU})):new Promise(i=>{this.getSurveys(t=>{var r;let s=null!=(r=t.find(t=>t.id===e))?r:null;if(s){let e=this.Yh(s);i({visible:e.eligible,disabledReason:e.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var r;if(!this.So.isCapturing())return;if(re(this._surveyManager))return void uZ.warn("init was not called");let s="string"==typeof e?this.Kh(e):e;if(!(null==s?void 0:s.id))return void uZ.warn("Survey not found");if(!u1.includes(s.type))return void uZ.warn(`Surveys of type ${s.type} cannot be rendered in the app`);let n=null==iI?void 0:iI.querySelector(t);if(n){if(null==(r=s.appearance)?void 0:r.surveyPopupDelaySeconds){uZ.info(`Rendering survey ${s.id} with delay of ${s.appearance.surveyPopupDelaySeconds} seconds`);let e=setTimeout(()=>{var t,r;this.Oh.delete(e),!this.Mo&&this.So.isCapturing()&&(uZ.info(`Rendering survey ${s.id} with delay of ${null==(t=s.appearance)?void 0:t.surveyPopupDelaySeconds} seconds`),null==(r=this._surveyManager)||r.renderSurvey(s,n,i),uZ.info(`Survey ${s.id} rendered`))},1e3*s.appearance.surveyPopupDelaySeconds);return void this.Oh.add(e)}this._surveyManager.renderSurvey(s,n,i)}else uZ.warn("Survey element not found")}displaySurvey(e,t){var i;if(!this.So.isCapturing())return;if(re(this._surveyManager))return void uZ.warn("init was not called");let r=this.Kh(e);if(!r)return void uZ.warn("Survey not found");let s=r;if((null==(i=r.appearance)?void 0:i.surveyPopupDelaySeconds)&&t.ignoreDelay&&(s=sP(sP({},r),{},{appearance:sP(sP({},r.appearance),{},{surveyPopupDelaySeconds:0})}
2)),t.displayType!==lL&&t.initialResponses&&uZ.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){let e=this.Xh(r);if(!e.eligible)return void uZ.warn("Survey is not eligible to be displayed: ",e.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}cancelPendingSurvey(e){re(this._surveyManager)?uZ.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e,t;null==(e=this._surveyManager)||null==(t=e.handlePageUnload)||t.call(e)}};function hV(e,t,i){if(re(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}var hG=class{constructor(e){this._instance=e,this.tc=new Set,this.ec=new Set,this.nc=new uj,this.sc=(e,t)=>this.rc(e,t)&&this.oc(e,t)&&this.ac(e,t)&&this.lc(e,t),this.rc=(e,t)=>!(null==t?void 0:t.event)||(null==e?void 0:e.event)===(null==t?void 0:t.event)}init(){var e,t;i4(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.uc=null==(t=this._instance)?void 0:t._addCaptureHook((e,t)=>{this.on(e,t)}))}dispose(){var e,t;null==(e=this.uc)||e.call(this),this.uc=void 0,null==(t=this._instance)||null==(t=t.autocapture)||t.setElementSelectors(new Set,this),this.nc=new uj}register(e){var t,i;if(!i4(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t;this.tc.add(e),null==(t=e.steps)||t.forEach(e=>{this.ec.add((null==e?void 0:e.event)||"")})}),null==(i=this._instance)?void 0:i.autocapture)){let e=new Set;this.tc.forEach(t=>{var i;null==(i=t.steps)||i.forEach(t=>{(null==t?void 0:t.selector)&&e.add(t.selector)})}),this._instance.autocapture.setElementSelectors(e,this)}}replace(e){this.tc.clear(),this.ec.clear(),this.register(e)}on(e,t){null!=t&&0!=e.length&&(this.ec.has(e)||this.ec.has(t.event))&&this.tc.forEach(e=>{this.hc(t,e)&&this.nc.emit("actionCaptured",e.name)})}cc(e){this.onAction("actionCaptured",t=>e(t))}hc(e,t){if(null==(null==t?void 0:t.steps))return!1;for(let i of t.steps)if(this.sc(e,i))return!0;return!1}onAction(e,t){return this.nc.on(e,t)}oc(e,t){if(null==t?void 0:t.url){var i;let r=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r||!hV(r,t.url,t.url_matching||"contains"))return!1}return!0}ac(e,t){return!!this.dc(e,t)&&!!this.vc(e,t)&&!!this.fc(e,t)}dc(e,t){var i;let r;if(!(null==t?void 0:t.href))return!0;let s=this.gc(e);if(s.length>0)return s.some(e=>hV(e.href,t.href,t.href_matching||"exact"));let n=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";return!!n&&hV((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}vc(e,t){var i,r,s,n;if(!(null==t?void 0:t.text))return!0;let o=this.gc(e);if(o.length>0)return o.some(e=>hV(e.text,t.text,t.text_matching||"exact")||hV(e.$el_text,t.text,t.text_matching||"exact"));let a=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!a&&(i=function(e){let t,i=[],r=/(?::|")text="(.*?)"/g;for(;!re(t=r.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(a),r=t.text,s=t.text_matching||"exact",i.some(e=>hV(e,r,s)))}fc(e,t){var i,r;if(!(null==t?void 0:t.selector))return!0;let s=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null==s?void 0:s.includes(t.selector))return!0;let n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}gc(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}lc(e,t){return!(null==t?void 0:t.properties)||0===t.properties.length||uV(t.properties.reduce((e,t)=>{let i=i2(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}},hK=class{constructor(e,t){var i,r;this.mc=[],this._instance=e,this.yc=t,this.bc=new Map,this._c=new Map,this.wc=new Map,this.kc=null==(i=this._instance)||null==(r=i.onSessionId)?void 0:r.call(i,e=>this.Sc(e))}xc(e){return!1}Cc(){return null}$c(e){}Tc(){}Ic(e,t){return!!e&&uV(e.propertyFilters,null==t?void 0:t.properties)}Mc(e,t){let i=new Map;
2return e.forEach(e=>{var r;null==(r=e.conditions)||null==(r=r[t])||null==(r=r.values)||r.forEach(t=>{if(null==t?void 0:t.name){let r=i.get(t.name)||[];r.push(e.id),i.set(t.name,r)}})}),i}Ec(e,t,i){let r=(i===lM?this.bc:this._c).get(e),s=[];return this.Pc(e=>{s=e.filter(e=>null==r?void 0:r.includes(e.id))}),s.filter(r=>{var s;let n=null==(s=r.conditions)||null==(s=s[i])||null==(s=s.values)?void 0:s.find(t=>t.name===e);return this.Ic(n,t)})}register(e){this.Rc(e,!1)}replace(e){this.Rc(e,!0)}Rc(e,t){var i;i4(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Ac(e,t),this.Fc(e,t))}Fc(e,t){var i;let r=e.filter(e=>{var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length});if(t&&this.wc.clear(),0===r.length)return void(t&&(null==(i=this.Oc)||i.replace([])));this.Oc||(this.Oc=new hG(this._instance),this.Oc.init(),this.Oc.cc(e=>this.onAction(e)));let s=[];r.forEach(e=>{var t;null==(t=e.conditions)||null==(t=t.actions)||t.values.forEach(t=>{if(s.push(t),t.name){var i;let r=null!=(i=this.wc.get(t.name))?i:[];r.includes(e.id)||r.push(e.id),this.wc.set(t.name,r)}})}),t?this.Oc.replace(s):this.Oc.register(s)}Dc(e,t){t.forEach((t,i)=>{var r;let s=null!=(r=e.get(i))?r:[];t.forEach(e=>{s.includes(e)||s.push(e)}),e.set(i,s)})}Ac(e,t){var i;let r=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),s=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}),n=this.Mc(e,lM),o=this.Mc(e,lF);t?(this.bc=n,this._c=o):(this.Dc(this.bc,n),this.Dc(this._c,o)),(0!==r.length||0!==s.length||e.some(e=>{var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length}))&&(null!=this.uc||(this.uc=null==(i=this._instance)?void 0:i._addCaptureHook((e,t)=>{this.onEvent(e,t)})))}onEvent(e,t){var i,r;let s=this.Lc(),n=(null==t||null==(i=t.properties)?void 0:i.$survey_id)||(null==t||null==(r=t.properties)?void 0:r.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){let i=this.Nc(e,n,t);if("consume"===i)return s.info("event consumed activated item, removing it",{event:e,itemId:n}),void this.qc([n]);if("persist"===i)return s.info("shown item promoted to persisted activation",{event:e,itemId:n}),this.jc(n),void this.Bc([n])}if(this._c.has(e)){let i=this.Ec(e,t,lF);i.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:i.map(e=>e.id)}),this.qc(i.map(e=>e.id)),i.forEach(e=>this.Hc(e.id)))}if(!this.bc.has(e))return;s.info("event name matched",{event:e,eventPayload:t,items:this.bc.get(e)});let o=this.Ec(e,t,lM);this.zc(o.map(e=>e.id))}onAction(e){this.wc.has(e)&&this.zc(this.wc.get(e)||[])}zc(e){var t,i;if(0===e.length)return;let r=!!(null==(t=this._instance)||null==(i=t.get_session_id)?void 0:i.call(t)),s=[];for(let t of e)r&&this.xc(t)?this.jc(t)&&this.Uc(t):s.push(t);s.length>0&&(this.mc=[...new Set([...this.mc,...s])]),this.Lc().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.Wc()}jc(e){this.mc=this.mc.filter(t=>t!==e);let t=this.Vc();return!t.includes(e)&&(this.Gc([...t,e]),this.Zc(),!0)}qc(e){let t=new Set(e);this.mc=this.mc.filter(e=>!t.has(e));let i=this.Qc(),r=i.filter(e=>!t.has(e));r.length!==i.length&&(this.Gc(r),0===r.length&&this.Jc()),this.Bc(e),this.Wc()}Wc(){try{var e;null==(e=this.yc)||e.call(this)}catch(e){this.Lc().error("Error while handling activated items change",e)}}Kc(){var e;let t=this.Cc();if(!t)return{};let i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return i&&"object"==typeof i?i:{}}Uc(e){if(!this.Cc())return;let t=this.Kc();this.$c(sP(sP({},t),{},{[e]:Date.now()}))}Bc(e){if(!this.Cc())return;let t=this.Kc(),i={},r=!1;for(let[s,n]of Object.entries(t))e.includes(s)?r=!0:i[s]=n;r&&(i6(i)?this.Tc():this.$c(i))}Xc(){this.Cc()&&this.Tc()}getActivationTimestamp(e){if(!this.Vc().includes(e))return;let t=this.Kc()[e];return rt(t)?t:void 0}Qc(){var e;let t=this.Yc();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}Vc(){var e,t,i;let r=this.Qc();if(0===r.length)return[];let s=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.td()],n=null==(t=this._instance)||null==(i=t.get_session_id)?void 0:i.call(t);return n&&s===n?r:[]}Zc(){var e,t;let i=null==(e=this._instance)||null==(t=e.get_session_id)?void 0:t.call(e);i&&this.ed(i)}Jc(){this.nd()}Sc(e){var t;let i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.td()];if(i&&i!==e){let e=this.Qc(),t=this.Kc();e.length>0&&(this.Gc([]),e.filter(e=>
2rt(t[e])).forEach(e=>this.Hc(e))),this.Jc(),this.Xc(),e.length>0&&this.Wc()}}getActivatedIds(){return[...new Set([...this.Vc(),...this.mc])].filter(e=>!this.sd(e))}dispose(){var e,t,i;null==(e=this.kc)||e.call(this),this.kc=void 0,null==(t=this.uc)||t.call(this),this.uc=void 0,null==(i=this.Oc)||i.dispose(),this.Oc=void 0}reset(){this.mc=[],this.Qc().length>0&&this.Gc([]),this.Jc(),this.Xc(),this.Wc()}getEventToItemsMap(){return this.bc}rd(){return this.Oc}},hJ=class extends hK{constructor(e,t){super(e,t)}Yc(){return oa}td(){return ol}Cc(){return ou}$c(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({$surveys_activated_timestamps:e})}Tc(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister("$surveys_activated_timestamps")}xc(e){var t;let i;this.Pc(t=>{i=t.find(t=>t.id===e)});let r=null==i||null==(t=i.appearance)?void 0:t.surveyPopupDelaySeconds;return rt(r)&&r>0}od(){return lI}Pc(e){var t;null==(t=this._instance)||t.getSurveys(e)}Hc(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Lc(){return uZ}Gc(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({$surveys_activated:e})}ed(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({$surveys_activated_session:e})}nd(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister("$surveys_activated_session")}sd(){return!1}Nc(e,t,i){var r,s,n;let o;return e===lA&&!1===(null==i||null==(r=i.properties)?void 0:r.$survey_completed)?"ignore":(this.Pc(e=>{o=e.find(e=>e.id===t)}),!o||uz(s=o)&&(null==(n=s.conditions)||null==(n=n.events)?void 0:n.repeatedActivation)||"always"===s.schedule?e===lI?"consume":"ignore":e===lI?"persist":e===lT||e===lA?"consume":"ignore")}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},hX=class{constructor(e){this._instance=e}initialize(){}get(e){if("string"==typeof e)return this._instance.get_property(e);let t={};for(let i of e){let e=this._instance.get_property(i);i4(e)||(t[i]=e)}return t}set(e,t){this._instance.register("string"==typeof e?{[e]:t}:e)}remove(e){"string"!=typeof e?e.forEach(e=>this._instance.unregister(e)):this._instance.unregister(e)}},hY=class{constructor(e){this._instance=e}get(){let e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){let e=null==iz?void 0:iz.__PosthogExtensions__;if(!e)return;let{generateSurveys:t,loadExternalDependency:i}=e;return{generateSurveys:t?e=>t(this._instance,e):void 0,loadExternalDependency:i?e=>i(this._instance,"surveys",e):void 0}}createEventReceiver(e){return new hJ(this._instance,e)}onMatchingConditionsChanged(e){let t=this._instance._addCaptureHook(t=>{"$pageview"!==t&&t!==lI&&t!==lT&&t!==lA||e()}),i=()=>e();oW(iO,"PHSurveyShown",i);let r=!1,s=this._instance.onFeatureFlags(()=>{r&&e()});return r=!0,()=>{r=!1,t(),s(),null==iO||iO.removeEventListener("PHSurveyShown",i)}}};let hQ=(null==iO?void 0:iO.location)?le(iO.location.hash,"__posthog")||le(location.hash,"state"):null,hZ="_postHogToolbarParams",h0=nC("[Toolbar]"),h1=nC("[FeatureFlags]");var h2=class{constructor(e,t=!1){this.ad=!1,this.update(e,t)}update(e,t){var i,r,s,n,o,a,l,u;this.ld={bootstrap:{featureFlags:null!=(i=null==(r=e.bootstrap)?void 0:r.featureFlags)?i:void 0,featureFlagPayloads:null!=(s=null==(n=e.bootstrap)?void 0:n.featureFlagPayloads)?s:void 0},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,refreshIntervalMs:null!=(o=e.remote_config_refresh_interval_ms)?o:3e5,idleRefreshBackoff:i4(e.remote_config_refresh_interval_ms),requestTimeoutMs:e.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,null!=(a=e.feature_flag_request_max_retries)?a:1),compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!=(l=null!=(u=e.evaluation_contexts)?u:e.evaluation_environments)?l:[],flagKeys:i2(e.flag_keys)?e.flag_keys:void 0},!e.evaluation_environments||e.evaluation_contexts||this.ad||(h1.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ad=!0),i4(e.flag_keys)||i2(e.flag_keys)||h1.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.ld}};let h3=nC("[FeatureFlags]"),h5=nC("[FeatureFlags]",{debugEnabled:!0}),h6="\" failed. Feature flags didn't load in time.",h4=[502,504],h8=["click","keydown","wheel","touchstart","pointerdown"],h7="c
2onnection_error",h9=e=>{let t={};for(let i=0;e.length>i;i++)t[e[i]]=!0;return t},ce=e=>{let t={};for(let[i,r]of oB(e||{}))r&&(t[i]=r);return t},ct=e=>rl(e)&&("RangeError"===e.name&&0===e.message.indexOf("Maximum call stack size exceeded")||"InternalError"===e.name&&"too much recursion"===e.message),ci=nC("[Error tracking]"),cr="webkit-masked-url:",cs=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],cn=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",cr],co=["__firefox__","__gCrWeb"],ca="Refusing to render web experiment since the viewer is a likely bot",cl={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>uU(t,e),not_regex:(e,t)=>!uU(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},cu=nC("[Conversations]"),ch="Conversations not available yet.";function cc(e,t){var i,r,s,n,o,a,l;let u=null!=(i=null==e?void 0:e.flushIntervalMs)?i:3e3,h=null!=(r=null==e?void 0:e.maxBufferSize)?r:100,c=(null==t?void 0:t.consoleCapture)?void 0:null!=(s=null==e?void 0:e.maxLogsPerInterval)?s:1e3,d=i4(c)?Math.max(h,2048):Math.max(h,c),p=sP(sP({},function(){var e,t;let i,r="",s="";try{let e=null==iF?void 0:iF.userAgent;e&&([r,s]=sa(e))}catch(e){}return e=r,t=s,sP(sP({},(i=function(e){if(e)return({}).hasOwnProperty.call(ng,e)?ng[e]:e}(e))?{"os.name":i}:{}),t?{"os.version":t}:{})}()),null==e?void 0:e.resourceAttributes);return{serviceName:null!=(n=null!=(o=null==p?void 0:p["service.name"])?o:null==e?void 0:e.serviceName)?n:null==t?void 0:t.serviceNameDefault,serviceVersion:null!=(a=null==p?void 0:p["service.version"])?a:null==e?void 0:e.serviceVersion,environment:null!=(l=null==p?void 0:p["deployment.environment"])?l:null==e?void 0:e.environment,resourceAttributes:p,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:d,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:c,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}let cd=["debug","log","warn","error","info"],cp=e=>{for(;null==e?void 0:e.__rrweb_original__;)e=e.__rrweb_original__;return e},cf="console",cg="__posthogHandledLogsRequestError",cv=(e,t)=>{let i=e instanceof Error?e:Error(t);return i[cg]=!0,i},c_=e=>!!e&&"object"==typeof e&&!0===e[cg],cm=nC("[NetworkMetrics]"),cy=()=>{var e;return(null==iO||null==(e=iO.performance)?void 0:e.now)?iO.performance.now():Date.now()},cb={"http:":80,"https:":443},cw=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),cx=(e,t)=>{var i;let r=String(t);return{method:String(e).toUpperCase(),url:(null==(i=a8(r))?void 0:i.href)||r}},ck=(e,t,i,r,s,n,o=!1)=>{try{var a,l,u;let h,c=s();if(!c)return;let d=i||void 0,p=cy()-r,f=a8(t.url);if(f&&"http:"!==f.protocol&&"https:"!==f.protocol)return;let g={url:(null==f?void 0:f.href)||t.url,method:t.method},v=i3(c.name)?c.name(g):i8(c.name)?c.name:"http.client.request.duration";if(!v)return;let _=o&&!d?void 0:d?400>d?void 0:String(d):(null==n?void 0:n.name)||"_OTHER",m=sP(sP(sP(sP(sP({},(u=g.method,h=cw.has(u)?u:"_OTHER",sP({"http.request.method":h},"_OTHER"===h&&u!==h?{"http.request.method_original":u}:{}))),f?{"server.address":f.hostname.startsWith("[")&&f.hostname.endsWith("]")?f.hostname.slice(1,-1):f.hostname,"server.port":Number(f.port)||cb[f.protocol],"url.scheme":f.protocol.slice(0,-1),"url.template":f.pathname.split("/").map(e=>/^\d+$/.test(e)||e.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(e)?":id":e).join("/")}:{}),d?{"http.response.status_code":d}:{}),_?{"error.type":_}:{}),null==(a=c.attributes)?void 0:a.call(c,g,{status:d,durationMs:p}));null==(l=e.metrics)||l.histogram(v,p,{unit:"ms",attributes:m})}catch(e){cm.error("Failed to record network metric",e)}},cS=()=>{},c$={featureFlags:class{constructor(e){this.name="featureFlags",this.ud=!1,this.featureFlagEventHandlers=[],this.$=h3,this.hd={},this.dd={},this.vd=[],this.fd=!1,this.pd=!1,this.gd=0,this.md=!1,this.yd=!1,this.bd=!1,this._d=!1,this.wd=0,this.kd=!1,this.an=()=>{let e=this.Sd();this.wd=0,e&&this.reloadFeatureFlags()},this.xd=()=>{var e,t;let i=this.Cd,r=null!=(e=this.$d)?e:i;i4(i)||i4(r)||this.Rr.remoteRequestsDisabled||!iI||"hidden"===iI.visibilityState||Date.now()-(null!=(t=this.Td)?t:0)<r||(this.$d=this.kd||!this.Rr.idleRefreshBackoff?i:Math.min(2*r,36e5),this.kd=!1,this.reloadFeatureFlags(),this.Id())},this.Md=()=>{this.kd&&this.$d===this.Cd||this.Ed()},this.ln=()=>{"visible"===(null==iI?void 0:iI.visibilityState)&&this.Ed()},"get"in e?this.So=e:(this._instance=e,this.Pd=new h2(e.config,e.sl()),this.So=this.Pd)}updateConfig(e,t){var i;null==(i=this.Pd)||i.update(e,t),this.wo&&this.Rd()}setup(e){return this.qh=e,this.$=e.logger.createLogger("[FeatureFlags]"),hz(e.kv.initialize(),()=>{this.qh===e&&(this.qh=void 0,this.wo=e,this.Ad(e))})}Ad(e){var t;if(this.wo===e)return iO&&oW(iO,"online",this.an),this.Rd(),this.Fd=e.registerDynamicEventProperties(()=>this.Od()?this.hd:this.dd),this.Dd=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.onCrossTabFeatureFlagChange(()=>{this.Ld(),this.Nd(),this.qd()}),this.Nd(),this.initialize()}Ed(){this.kd=!0,this.$d=this.Cd,this.xd()}Rd(){let e=this.Rr.refreshIntervalMs,t=!this.Rr.remoteRequestsDisabled&&iI&&!i4(e)&&e>0?e:void 0;this.Rr.idleRefreshBackoff||(this.$d=t),t!==this.Cd&&(this.jd(),i4(t)||(this.Cd=t,this.$d=t,this.Id(),(null==iI?void 0:iI.addEventListener)&&(oW(iI,oM,this.ln),oj(h8,e=>{oW(iI,e,this.Md,{capture:!0})}
2))))}Id(){i4(this.Cd)||(i4(this.Bd)||clearInterval(this.Bd),this.Td=Date.now(),this.Bd=setInterval(this.xd,this.Cd))}jd(){var e;i4(this.Bd)||(clearInterval(this.Bd),this.Bd=void 0,null==iI||null==(e=iI.removeEventListener)||e.call(iI,"visibilitychange",this.ln),oj(h8,e=>{var t;null==iI||null==(t=iI.removeEventListener)||t.call(iI,e,this.Md,{capture:!0})})),this.Cd=void 0,this.$d=void 0,this.kd=!1,this.Td=void 0}destroy(){this.Hd()}dispose(){this.Hd()}Hd(){var e,t;this.jd(),this.gd++,this.yd=!1,this.qh=void 0,this.wo&&(this.zd(),null==(e=this.Fd)||e.dispose(),this.Fd=void 0,null==(t=this.Dd)||t.call(this),this.Dd=void 0,this.vd=[],null==iO||iO.removeEventListener("online",this.an),this.wo=void 0)}get Rr(){return this.So.get()}Ud(e){var t;return this.Wd&&e in this.Wd?this.Wd[e]:null==(t=this.wo)?void 0:t.kv.get(e)}Ld(){return!!this.Wd&&(this.Wd=void 0,!0)}Vd(){var e;return!i4(null==(e=this.wo)?void 0:e.kv.get("$enabled_feature_flags"))&&this.Ld()}At(e){this.Gd(()=>{var t;return null==(t=this.wo)?void 0:t.kv.set(e)})}Zd(e,t,i){var r;if(!(null==(r=this._instance)?void 0:r.persistence)||!e.$enabled_feature_flags)return;let s=this.Ud("$enabled_feature_flags")||{},n=e.$enabled_feature_flags||{},o=t.flags||t.featureFlags,a=t.flags?Object.entries(t.flags).filter(([,e])=>!(null==e?void 0:e.failed)).map(([e])=>e):[],l=!!t.errorsWhileComputingFlags&&!!t.flags,u=l?a:i&&!i2(o)?Object.keys(o||{}):Array.from(new Set([...Object.keys(s),...Object.keys(n)])),h=this.Ud("$feature_flag_payloads")||{},c=e.$feature_flag_payloads||{},d=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(c)])),p=!l&&!i,f=!!p||u,g={[n5]:f,[n3]:f,[n8]:!!p||d};for(let t of(e.$feature_flag_details&&(g[n4]=f),[n7,of,n9]))i4(e[t])||(g[t]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(g)}Lt(e){this.Gd(()=>{var t;return null==(t=this.wo)?void 0:t.kv.remove(e)})}Gd(e){try{e()}catch(e){this.$.error("Failed to update feature flag persistence",e)}}Nd(){let e={};for(let t of[n5,n8,n7,oe]){let i=this.Ud(t);i4(i)||(e[t]=i)}this.hd=e;let t=sP({},e),i=this.Ud(n3);if(i)for(let[e,r]of Object.entries(i))t[`$feature/${e}`]=r;this.dd=t}Od(){let e=this.Rr.cacheTtlMs;if(!e||0>=e)return!1;let t=this.Ud(of);return"number"!=typeof t||Date.now()-t>e}Qd(){return!!this.Od()&&(this._d||this.pd||(this._d=!0,this.$.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Jd(){let e=this.Rr.evaluationContexts;return(null==e?void 0:e.length)?e.filter(e=>{let t=e&&"string"==typeof e&&e.trim().length>0;return t||this.$.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}Kd(){let e=this.Rr.flagKeys;if(!i4(e))return e.filter(e=>{let t=e&&"string"==typeof e&&e.trim().length>0;return t||this.$.error("Invalid flag key found:",e,"Expected non-empty string"),t})}initialize(){var e,t,i,r;let s=this.Rr,n=null!=(e=null==(t=s.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(n).length){let e=null!=(i=null==(r=s.bootstrap)?void 0:r.featureFlagPayloads)?i:{},t=Object.keys(n).filter(e=>!i4(n[e])).reduce((e,t)=>(e[t]=n[t],e),{}),o=Object.keys(e).filter(e=>t[e]).reduce((t,i)=>(t[i]=e[i],t),{});return this.Xd({featureFlags:t,featureFlagPayloads:o},void 0,{persist:!1})}}updateFlags(e,t,i){var r,s;let n=(null==i?void 0:i.merge)&&null!=(r=this.Ud("$enabled_feature_flags"))?r:{},o=(null==i?void 0:i.merge)&&null!=(s=this.Ud("$feature_flag_payloads"))?s:{},a=sP(sP({},n),e),l=sP(sP({},o),t),u={};for(let[e,t]of Object.entries(a))u[e]={key:e,enabled:s7(t),variant:s9(t),reason:void 0,metadata:i4(null==l?void 0:l[e])?void 0:{id:0,version:void 0,description:void 0,payload:l[e]}};this.Xd({flags:u})}get hasLoadedFlags(){return this.fd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){let e=this.Ud(n4),t=this.Ud(oe),i=this.Ud(ot);if(!i&&!t)return e||{};let r=oN({},e||{});for(let e of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var s,n;let o=r[e],a=null==t?void 0:t[e],l=i4(a)?null!=(s=null==o?void 0:o.enabled)&&s:!!a,u=i4(a)?null==o?void 0:o.variant:"string"==typeof a?a:void 0,h=null==i?void 0:i[e],c=sP(sP({},o),{},{enabled:l,variant:l?null!=u?u:null==o?void 0:o.variant:void 0});l!==(null==o?void 0:o.enabled)&&(c.original_enabled=null==o?void 0:o.enabled),u!==(null==o?void 0:o.variant)&&(c.original_variant=null==o?void 0:o.variant),h&&(c.metadata=sP(sP({},null==o?void 0:o.metadata),{},{payload:h,original_payload:null==o||null==(n=o.metadata)?void 0:n.payload})),r[e]=c}return this.ud||(this.$.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.ud=!0),r}getAllFeatureFlags(){let e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{let r=e[i];return{key:i,enabled:s7(r),variant:s9(r),payload:s8(t[i])}})}getFlagVariants(){let e=this.Ud(n3),t=this.Ud(oe);if(!t)return e||{};let i=oN({},e||{}),r=Object.keys(t);for(let e=0;r.length>e;e++)i[r[e]]=t[r[e]];return this.ud||(this.$.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ud=!0),i}getFlagPayloads(){let e=this.Ud(n8),t=this.Ud(ot);if(!t)return e||{};let i=oN({},e||{}),r=Object.keys(t);for(let e=0;r.length>e;e++)i[r[e]]=t[r[e]];return this.ud||(this.$.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ud=!0),i}reloadFeatureFlags(){this.md||this.Rr.featureFlagsDisabled||this.Sd()||(this.pd&&(this.yd=!0),this.Yd||(this.vd.slice().forEac
2h(e=>{try{e()}catch(e){this.$.error("Error while running feature flags reloading callback",e)}}),this.Yd=setTimeout(()=>{this.tv()},5)))}zd(){clearTimeout(this.Yd),this.Yd=void 0}onReloading(e){return this.vd.push(e),()=>{this.vd=this.vd.filter(t=>t!==e)}}ensureFlagsLoaded(){this.fd||this.pd||this.Yd||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.md=e}resetFlagCallReported(){this.Lt(oc)}tv(e){this.zd();let t=this.wo;if(!t||this.Rr.remoteRequestsDisabled||this.Sd())return;if(this.pd)return void(this.yd=!0);let i={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:sP(sP(sP({},t.initialPersonProperties),this.Ud("$stored_person_properties")||{}),{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.Ud(or),timezone:lg()};i4(t.deviceId)||(i.$device_id=t.deviceId),((null==e?void 0:e.disableFlags)||this.Rr.featureFlagsDisabled)&&(i.disable_flags=!0);let r=this.Jd();r.length&&(i.evaluation_contexts=r);let s=this.Kd();i4(s)||(i.flag_keys=s);let n=this.Rr.onlyEvaluateSurveyFeatureFlags,o="/flags/?v=2"+(n?"&only_evaluate_survey_feature_flags=true":""),a=this.gd;this.pd=!0;let l=()=>{this.yd&&(this.yd=!1,this.tv())},u=e=>{var t,r;let s=null!=(t=e.json)?t:{},o=200!==e.statusCode;if(this.pd=!1,a!==this.gd)return void l();if(this.ev(e.statusCode),o||this.yd||(this.$anon_distinct_id=void 0),i.disable_flags&&!this.yd)return;this.bd=!o;let u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?h7:"unknown_error"):200!==e.statusCode&&u.push(`api_error_${e.statusCode}`),s.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");let h=!!(null==(r=s.quotaLimited)?void 0:r.includes("feature_flags"));h&&u.push("quota_limited"),this.At({[op]:u}),h?this.$.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):i.disable_flags||this.Xd(s,o,{partialResponse:n}),l()},h=e=>{this.pd=!1,a===this.gd&&(this.At({[op]:[h7]}),this.$.error("Feature flag request failed",e),this.Vd()&&this.qd(!0)),l()},c=this.Rr.requestMaxRetries,d=()=>c>0&&a===this.gd,p=()=>{if(a!==this.gd||!this.wo||this.Rr.remoteRequestsDisabled)return this.pd=!1,void l();try{t.sendRequest(o,{target:"flags",method:"POST",body:i,compression:this.Rr.compression,sentAt:"body",timeoutMs:this.Rr.requestTimeoutMs}).then(e=>{(h4.includes(e.statusCode)||0===e.statusCode&&e.error instanceof Error&&"AbortError"===e.error.name)&&d()?(c--,setTimeout(p,500)):u(e)}).catch(h)}catch(e){h(e)}};p()}Sd(){return lt(this.wd,3)}ev(e){this.wd=li(e,this.wd,3,()=>this.$.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t={}){var i;if(t.fresh&&!this.bd)return;if(!(this.fd||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlag for key "'+e+h6);if(this.Qd())return;let r=this.getFeatureFlagResult(e,t);return null!=(i=null==r?void 0:r.variant)?i:null==r?void 0:r.enabled}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){let t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t={}){var i,r,s,n,o,a,l,u,h,c,d,p,f,g;if(t.fresh&&!this.bd)return;if(!(this.fd||this.getFlags()&&this.getFlags().length>0))return void this.$.warn('getFeatureFlagResult for key "'+e+h6);if(this.Qd())return;let v=this.getFlagVariants(),_=e in v,m=v[e],y=this.getFlagPayloads()[e],b=String(m),w=this.Ud("$feature_flag_request_id")||void 0,x=this.Ud("$feature_flag_evaluated_at")||void 0,k,S=this.Ud("$flag_call_reported")||{};if(this.Rr.deduplicateCallsPerSession){let e=null==(i=this.wo)?void 0:i.session.sessionId,t=this.Ud(od);e&&e!==t&&(S={},k=e)}if(!t.send_event&&"send_event"in t)k&&this.At({[oc]:S,[od]:k});else if(e in S&&S[e].includes(b))k&&this.At({[oc]:S,[od]:k});else{i2(S[e])?S[e].push(b):S[e]=[b],this.At(sP({[oc]:S},k?{[od]:k}:{}));let t=this.getFeatureFlagDetails(e),i=[...null!=(r=this.Ud("$feature_flag_errors"))?r:[]];i4(m)&&i.push("flag_missing");let v={$feature_flag:e,$feature_flag_response:m,$feature_flag_payload:null!=y?y:null,$feature_flag_request_id:w,$feature_flag_evaluated_at:x,$feature_flag_bootstrapped_response:null!=(s=null==(n=this.Rr.bootstrap)||null==(n=n.featureFlags)?void 0:n[e])?s:null,$feature_flag_bootstrapped_payload:null!=(o=null==(a=this.Rr.bootstrap)||null==(a=a.featureFlagPayloads)?void 0:a[e])?o:null,$used_bootstrap_value:!this.bd};i4(null==t||null==(l=t.metadata)?void 0:l.has_experiment)||(v.$feature_flag_has_experiment=t.metadata.has_experiment),i4(null==t||null==(u=t.metadata)?void 0:u.version)||(v.$feature_flag_version=t.metadata.version);let _=null!=(h=null==t||null==(c=t.reason)?void 0:c.description)?h:null==t||null==(d=t.reason)?void 0:d.code;_&&(v.$feature_flag_reason=_),(null==t||null==(p=t.metadata)?void 0:p.id)&&(v.$feature_flag_id=t.metadata.id),i4(null==t?void 0:t.original_variant)&&i4(null==t?void 0:t.original_enabled)||(v.$feature_flag_original_response=i4(t.original_variant)?t.original_enabled:t.original_variant),(null==t||null==(f=t.metadata)?void 0:f.original_payload)&&(v.$feature_flag_original_payload=null==t||null==(g=t.metadata)?void 0:g.original_payload),i.length&&(v.$feature_flag_error=i.join(",")),this.iv(v)}return _?{key:e,enabled:!!m,variant:"string"==typeof m?m:void 0,payload:s8(y)}:void 0}iv(e){try{var t;null==(t=this.wo)||t.capture("$feature_flag_called",e)}catch(e){this.$.error("Failed to capture feature flag call",e)}
2}getRemoteConfigPayload(e,t){this.nv(e,t)}nv(e,t){var i=this;return rf(function*(){let r,s=i.wo;if(!s)return;let n={distinct_id:s.distinctId,token:s.projectToken,person_properties:{$lib:s.library.name,$lib_version:s.library.version}},o=i.Jd();o.length&&(n.evaluation_contexts=o);let a=i.Kd();i4(a)||(n.flag_keys=a);try{var l;let t=null==(l=(yield s.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.Rr.compression,sentAt:"body",timeoutMs:i.Rr.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;r=(null==t?void 0:t[e])||void 0}catch(e){return void i.$.error("Remote config feature flag request failed",e)}try{t(r)}catch(e){i.$.error("Remote config feature flag callback failed",e)}})()}isFeatureEnabled(e,t={}){if(t.fresh&&!this.bd)return t.defaultValue;if(!(this.fd||this.getFlags()&&this.getFlags().length>0))return this.$.warn('isFeatureEnabled for key "'+e+h6),t.defaultValue;let i=this.getFeatureFlag(e,t);return i4(i)?t.defaultValue:!!i}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){this.Xd(e,t,i)}Xd(e,t,i){if(!this.wo)return;this.fd=!0;let r=((e,t={},i={},r={},s,n=h3)=>{let o=((e,t)=>{let i=e.flags;if(i){let t=Object.fromEntries(Object.keys(i).map(e=>{var t;return[e,null!=(t=i[e].variant)?t:i[e].enabled]})),r=Object.fromEntries(Object.keys(i).filter(e=>i[e].enabled).filter(e=>{var t;return!i4(null==(t=i[e].metadata)?void 0:t.payload)}).map(e=>{var t;return[e,null==(t=i[e].metadata)?void 0:t.payload]}));return sP(sP({},e),{},{featureFlags:t,featureFlagPayloads:r})}return e.featureFlags&&t.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e,n),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(!l)return;let h=e.requestId,c=e.evaluatedAt;if(i2(l)){n.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");let e={};if(l)for(let t=0;l.length>t;t++)e[l[t]]=!0;return{[n5]:l,[n3]:e,[n9]:!1}}let d=l,p=u,f=a;if(null==s?void 0:s.partialResponse){let e=Object.keys(d),s=p||{};d=sP(sP({},t),d),p=sP(sP({},i),s),e.forEach(e=>{e in s||null==p||delete p[e]}),f=sP(sP({},r),f)}else if(e.errorsWhileComputingFlags)if(a){let e=new Set(Object.keys(a).filter(e=>{var t;return!(null==(t=a[e])?void 0:t.failed)}));d=sP(sP({},t),Object.fromEntries(Object.entries(d).filter(([t])=>e.has(t))));let s=Object.fromEntries(Object.entries(p||{}).filter(([t])=>e.has(t)));p=sP(sP({},i),s),e.forEach(e=>{e in s||null==p||delete p[e]}),f=sP(sP({},r),Object.fromEntries(Object.entries(f||{}).filter(([t])=>e.has(t))))}else d=sP(sP({},t),d),p=sP(sP({},i),p),f=sP(sP({},r),f);return sP(sP({[n5]:Object.keys(ce(d)),[n3]:d||{},[n8]:p||{},[n4]:f||{},[n9]:!0===e.minimalFlagCalledEvents},h?{[n7]:h}:{}),c?{[of]:c}:{})})(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.$);if(r)if(!1===(null==i?void 0:i.persist)){let e=!i4(this.wo.kv.get(n3));this.Wd=r,e||this.At(r)}else this.Ld(),this.Zd(r,e,!!(null==i?void 0:i.partialResponse)),this.At(r);else t&&this.Vd();t||(this._d=!1),this.qd(t)}override(e,t=!1){this.$.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.sv(e)}sv(e){if(this.wo){if(!1===e)return this.Lt([oe,ot]),this.qd(),void h5.info("All overrides cleared");if(i2(e))return this.At({[oe]:h9(e)}),this.qd(),void h5.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t;this.ud=!!(null!=(t=e.suppressWarning)&&t);let i={},r=e.flags,s=e.payloads;return r&&(i[oe]=i2(r)?h9(r):r),s&&(i[ot]=s),Object.keys(i).length&&this.At(i),!1===r&&!1===s?this.Lt([oe,ot]):!1===r?this.Lt(oe):!1===s&&this.Lt(ot),this.qd(),!1===r?h5.info("Flag overrides cleared"):r&&h5.info("Flag overrides set",{flags:r}),void(!1===s?h5.info("Payload overrides cleared"):s&&h5.info("Payload overrides set",{payloads:s}))}if(e&&"object"==typeof e)return this.At({[oe]:e}),this.qd(),void h5.info("Flag overrides set",{flags:e});this.$.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.$.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.fd){let{flags:t,flagVariants:i}=this.rv();try{e(t,i)}catch(e){this.$.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,s;let n=(this.Ud("$early_access_features")||[]).find(t=>t.flagKey===e),o={[`$feature_enrollment/${e}`]:t},a={$feature_flag:e,$feature_enrollment:t,$set:o};n&&(a.$early_access_feature_name=n.name),i&&(a.$feature_enrollment_stage=i);let l=sP(sP({},this.getFlagVariants()),{},{[e]:t});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({$active_feature_flags:[e],$enabled_feature_flags:[e],$stored_person_properties:Object.keys(o)}),this.At({[n5]:Object.keys(ce(l)),[n3]:l,[oi]:sP(sP({},this.Ud("$stored_person_properties")||{}),o)}),this.qd();try{null==(s=this.wo)||s.capture("$feature_enrollment_update",a)}catch(e){this.$.error("Failed to capture early access feature enrollment",e)}}getEarlyAccessFeatures(e,t=!1,i){let r=this.Ud(n6);
2!r||t?this.ov(e,i):e(r)}ov(e,t){var i=this;return rf(function*(){let r,s=i.wo;if(!s)return;let n=t?`&${t.map(e=>`stage=${e}`).join("&")}`:"";try{let e=yield s.sendRequest(`/api/early_access_features/?token=${s.projectToken}${n}`,{target:"api",method:"GET",sentAt:"query"});if(!e.json)return;r=e.json.earlyAccessFeatures,i.At({[n6]:r})}catch(e){return void i.$.error("Early access feature request failed",e)}try{e(r)}catch(e){i.$.error("Early access feature callback failed",e)}})()}rv(){let e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}qd(e){this.Nd();let{flags:t,flagVariants:i}=this.rv();this.featureFlagEventHandlers.forEach(r=>{try{r(t,i,{errorsLoading:e})}catch(e){this.$.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t=!0){this.av(e,t)}av(e,t=!0){let i=this.Ud("$stored_person_properties")||{},r=(null==e?void 0:e.$set)||((null==e?void 0:e.$set_once)?{}:e),s=null==e?void 0:e.$set_once,n={};if(s)for(let e in s)({}).hasOwnProperty.call(s,e)&&(e in i||(n[e]=s[e]));this.At({[oi]:sP(sP(sP({},i),n),r)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t=!0){let i=sP({},this.Ud("$stored_person_properties")||{});e.forEach(e=>{delete i[e]}),this.At({[oi]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e=!0){this.Lt(oi),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t=!0){let i=this.Ud("$stored_group_properties")||{},r=sP({},i);for(let t of Object.keys(e))r[t]=sP(sP({},i[t]),e[t]);this.At({[or]:r}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){let t=this.Ud("$stored_group_properties")||{};this.At({[or]:sP(sP({},t),{},{[e]:{}})})}else this.Lt(or)}reset(){this.gd++,this.yd=!1,this.hd={},this.dd={},this.Wd=void 0,this.fd=!1,this.md=!1,this.bd=!1,this.$anon_distinct_id=void 0,this.zd(),this.ud=!1,this.wd=0}}},cE=sP({productTours:class{get El(){return this._instance.persistence}constructor(e){this.$f=null,this.Tf=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if("productTours"in t){var i,r;if(this.El&&this.El.register({[nY]:!!t.productTours}),!hD(this._instance))return!this.$f&&re(null==(i=this.El)?void 0:i.props.ph_product_tours)||hj.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.$f)||r.stop(),this.$f=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.$f&&hD(this._instance)&&this.Uo(()=>this.If())}Uo(e){var t,i,r;(null==(t=iz.__PosthogExtensions__)?void 0:t.generateProductTours)?e():null==(i=iz.__PosthogExtensions__)||null==(r=i.loadExternalDependency)||r.call(i,this._instance,"product-tours",t=>{t?hj.error("Could not load product tours script",t):e()})}If(){var e;!this.$f&&(null==(e=iz.__PosthogExtensions__)?void 0:e.generateProductTours)&&(this.$f=iz.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t=!1){if(i2(this.Tf)&&!t)return void e(this.Tf,{isLoaded:!0});let i=this.El;if(i){let r=i.props[oh];if(i2(r)&&!t)return this.Tf=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:t=>{if(!hD(this._instance))return void e([],{isLoaded:!0});let r=t.statusCode;if(200!==r||!t.json){let i=`Product Tours API could not be loaded, status: ${r}`;return 0===r?t.error||hj.warn(i):hj.error(i),void e([],{isLoaded:!1,error:i})}let s=i2(t.json.product_tours)?t.json.product_tours:[];this.Tf=s,i&&i.register({[oh]:s}),e(s,{isLoaded:!0})}})}getActiveProductTours(e){re(this.$f)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.$f.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.$f)||t.showTourById(e)}previewTour(e){this.$f?this.$f.previewTour(e):this.Uo(()=>{var t;this.If(),null==(t=this.$f)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.$f)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.$f)||e.nextStep()}previousStep(){var e;null==(e=this.$f)||e.previousStep()}clearCache(){var e;this.Tf=null,null==(e=this.El)||e.unregister("ph_product_tours")}resetTour(e){var t;null==(t=this.$f)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.$f)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.$f)||t.cancelPendingTour(e)}}},c$),cP=sP({surveys:class extends hW{constructor(e){super(new hY(e),{get projectToken(){return e.config.token},kv:new hX(e)}),this._instance=e}Gh(e,t){let i=t.query?uv(e,t.query):e;return new Promise(e=>{var r;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor(null!=(r=t.target)?r:"api",i),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})})}}},c$),cR=sP({experiments:class e{get Rr(){return this._instance.config}constructor(t){this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=(t=!1)=>{this.getWebExperiments(t=>{e.Qf("retrieved web experiments from the server"),this.Jf=new Map,t.forEach(t=>
2{if(t.feature_flag_key){var i;this.Jf&&(e.Qf("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=this.Jf)||i.set(t.feature_flag_key,t));let r=this._instance.getFeatureFlag(t.feature_flag_key);i8(r)&&t.variants[r]&&this.Kf(t.name,r,t.variants[r].transforms)}else if(t.variants)for(let i in t.variants){let r=t.variants[i];e.Xf(r,this._instance)&&this.Kf(t.name,i,r.transforms)}})},t)},this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(t){if(this._is_bot())e.Qf(ca);else if(!this.Rr.disable_web_experiments){if(re(this.Jf))return this.Jf=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.Qf("applying feature flags",t),t.forEach(e=>{var t,i;if(this.Jf&&(null==(t=this.Jf)?void 0:t.has(e))){let t=this._instance.getFeatureFlag(e),r=null==(i=this.Jf)?void 0:i.get(e);t&&(null==r?void 0:r.variants[t])&&this.Kf(r.name,t,r.variants[t].transforms)}})}}previewWebExperiment(){let t=e.getWindowLocation();if(null==t?void 0:t.search){let i=a7(null==t?void 0:t.search,"__experiment_id"),r=a7(null==t?void 0:t.search,"__experiment_variant");i&&r&&(e.Qf(`previewing web experiments ${i} && ${r}`),this.getWebExperiments(e=>{this.Yf(parseInt(i),r,e)},!1,!0))}}loadIfEnabled(){this.Rr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Rr.disable_web_experiments&&!i)return e([]);let r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Rr.token}`),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Yf(t,i,r){let s=r.filter(e=>e.id===t);s&&s.length>0&&(e.Qf(`Previewing web experiment [${s[0].name}] with variant [${i}]`),this.Kf(s[0].name,i,s[0].variants[i].transforms))}static Xf(t,i){return!re(t.conditions)&&e.tp(t,i)&&e.ep(t)}static tp(t,i){var r,s,n,o;if(re(t.conditions)||re(null==(r=t.conditions)?void 0:r.url))return!0;let a=e.getWindowLocation();if(a){let e=ah(i,a.href);return!(null==(s=t.conditions)?void 0:s.url)||cl[null!=(n=null==(o=t.conditions)?void 0:o.urlMatchType)?n:"icontains"](t.conditions.url,e)}return!1}
2static getWindowLocation(){return null==iO?void 0:iO.location}static ep(e){var t,i,r,s,n,o,a,l,u;if(re(e.conditions)||re(null==(t=e.conditions)?void 0:t.utm))return!0;let h=la();if(h.utm_source){let t=!(null==(i=e.conditions)||null==(i=i.utm)?void 0:i.utm_campaign)||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==h.utm_campaign,c=!(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_source)||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_source)==h.utm_source,d=!(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_medium)||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_medium)==h.utm_medium,p=!(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_term)||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==h.utm_term;return t&&d&&p&&c}return!1}static Qf(e,...t){nR.info(`[WebExperiments] ${e}`,t)}Kf(t,i,r){this._is_bot()?e.Qf(ca):"control"!==i?r.forEach(r=>{if(r.selector){var s;e.Qf(`applying transform of variant ${i} for experiment ${t} `,r);let n=null==(s=document)?void 0:s.querySelectorAll(r.selector);null==n||n.forEach(e=>{r.html&&(e.innerHTML=r.html),r.css&&e.setAttribute("style",r.css)})}}):e.Qf("Control variants leave the page unmodified.")}_is_bot(){return iF&&this._instance?uB(iF,this.Rr.custom_blocked_useragents):void 0}}},c$);hv.__defaultExtensionClasses=sP({},sP(sP(sP(sP(sP(sP(sP(sP(sP(sP(sP(sP(sP({},c$),{sessionRecording:class{get Rr(){return this._instance.config}get El(){return this._instance.persistence}get started(){var e;return!!(null==(e=this.lv)?void 0:e.isStarted)}get status(){var e,t;return"awaiting_config"===this.uv||"missing_config"===this.uv?this.uv:null!=(e=null==(t=this.lv)?void 0:t.status)?e:this.uv}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this.uv=hF,this.hv=void 0,this.dv=!1,this.Xe=(()=>{var e,t;if(!(null==iI?void 0:iI.visibilityState)||"visible"===iI.visibilityState)return!0;let i=null==iO||null==(e=iO.performance)||null==(t=e.getEntriesByType)?void 0:t.call(e,"visibility-state");return!(null==i?void 0:i.length)||i.some(e=>"visible"===e.name)})(),this.ln=()=>{var e,t;"visible"===(null==iI?void 0:iI.visibilityState)&&(this.Xe=!0,null==(e=this.lv)||null==(t=e.setDocumentWasEverVisible)||t.call(e,!0))},!this._instance.sessionManager)throw hT.error("started without valid sessionManager"),Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this.Rr.cookieless_mode)throw Error('[SessionRecording] cannot be used with cookieless_mode="always"');(null==iI?void 0:iI.addEventListener)&&oW(iI,"visibilitychange",this.ln)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:e=!1}={}){var t;this.dv=!0,null==iI||null==(t=iI.removeEventListener)||t.call(iI,"visibilitychange",this.ln),e?this.vv(!0):this.stopRecording()}get fv(){var e;let t=!!(null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.enabled),i=!this.Rr.disable_session_recording,r=this.Rr.disable_session_recording||this._instance.consent.isOptedOut();return iO&&t&&i&&!r}startIfEnabledOrStop(e){var t;if(this.dv||this.fv&&(null==(t=this.lv)?void 0:t.isStarted))return;let i=!i4(Object.assign)&&!i4(Array.from);this.fv&&i?(this.pv(e),hT.info("starting")):(this.uv=hF,this.stopRecording())}pv(e){var t,i,r,s;if(this.fv)if("awaiting_config"!==this.uv&&"missing_config"!==this.uv&&(this.uv=hI),(null==iz||null==(t=iz.__PosthogExtensions__)||null==(t=t.rrweb)?void 0:t.record)&&(null==(i=iz.__PosthogExtensions__)?void 0:i.initSessionRecording))this.gv(e);else{let t=this._instance.sessionManager;null==(r=iz.__PosthogExtensions__)||null==(s=r.loadExternalDependency)||s.call(r,this._instance,this.mv,i=>{if(!this.dv&&this.fv&&this._instance.sessionManager===t)return i?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),hT.error("could not load recorder",i)):void this.gv(e);this.uv="disabled"})}}stopRecording(){var e,t;null==(e=this.hv)||e.call(this),this.hv=void 0,null==(t=this.lv)||t.stop()}vv(e=!1){var t,i;null==(t=this.hv)||t.call(this),this.hv=void 0,null==(i=this.lv)||i.discard({discardProducerEvents:e})}yv(){var e,t;null==(e=this.El)||e.unregister("$session_is_sampled"),null==(t=this.El)||t.unregister("$replay_sample_rate")}bv(e,t){if(re(e))return null;let i=rt(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(hT.warn(`${t} must be between 0 and 1. Ignoring invalid value:`,e),null):i}_v(e){if(this.El){var t,i;let r=this.El,s=()=>{var t;let i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.bv(null==(t=this.Rr.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.bv(null==i?void 0:i.sampleRate,"remote config sampleRate"),o=null!=s?s:n;re(o)&&this.yv();let a=null==i?void 0:i.minimumDurationMilliseconds;r.register({[n0]:sP(sP({cache_timestamp:Date.now(),enabled:!!i},i),{},{networkPayloadCapture:sP({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:o,minimumDurationMilliseconds:i4(a)?null:a,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this.hv)||t.call(this),this.hv=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){let t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this._v(t),void this.vv()):(this._v(t),void this.startIfEnabledOrStop()):("awaiting_config"===this.uv&&(this.uv="missing_config",this._instance.register_for_session({[oE]:!0}),hT.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t="log"){var i;(null==(i=this.lv)?void 0:i.log)?this.lv.log(e,t):hT.warn("log called before recorder was ready")}get mv(){var e,t;let i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(n0);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}wv(){let e,t=this._instance.get_property(n0);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return hT.warn("persisted remote config for session recording is invali
2d and will be ignored",e),!1}return!re(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}gv(e){var t,i,r,s;if(!this.dv&&this.fv&&this._instance.sessionManager){if(!(null==(t=iz.__PosthogExtensions__)?void 0:t.initSessionRecording))return hT.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[o$]:!0});if(this.lv||(this.lv=null==(s=iz.__PosthogExtensions__)?void 0:s.initSessionRecording(this._instance,this.Xe),this.lv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.wv()){if("missing_config"===this.uv||"awaiting_config"===this.uv)return;return this.uv="awaiting_config",hT.info("persisted remote config is stale, requesting fresh config before starting"),void new lq(this._instance).load()}this.uv=hI,null==(i=(r=this.lv).setDocumentWasEverVisible)||i.call(r,this.Xe),this.lv.start(e)}else this.uv=hF}onRRwebEmit(e){var t,i;null==(t=this.lv)||null==(i=t.onRRwebEmit)||i.call(t,e)}overrideLinkedFlag(){var e,t;this.lv||null==(t=this.El)||t.register({$replay_override_linked_flag:!0}),null==(e=this.lv)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.lv||null==(t=this.El)||t.register({$replay_override_sampling:!0}),null==(e=this.lv)||e.overrideSampling()}overrideTrigger(e){var t,i;this.lv||null==(i=this.El)||i.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),null==(t=this.lv)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.lv)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!!(null==(i=this.lv)?void 0:i.tryAddCustomEvent(e,t))}flushBeforeIdentityReset(){var e,t;null==(e=this.lv)||null==(t=e.flushBeforeIdentityReset)||t.call(e)}}}),{autocapture:class extends hw{constructor(e){super(new hx(e)),this.instance=e}},historyAutocapture:class{constructor(e){this.Sv=!1,this._instance=e,this.xv=this.Cv()}initialize(){this.startIfEnabled()}get isEnabled(){let e=this.$v();return!!(e.path||e.search||this.Tv(e))}startIfEnabled(){this.isEnabled&&(nR.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.xv=this.Cv(),this.startIfEnabled()}stop(){this.Iv&&this.Iv(),this.Iv=void 0,this.Mv&&this.Mv(),this.Mv=void 0,nR.info("History API monitoring stopped")}monitorHistoryChanges(){iO&&iO.history&&(this.Ev("pushState"),this.Ev("replaceState"),this.Pv(),this.Tv()&&this.Rv())}Ev(e){var t;if(!iO||(null==(t=iO.history[e])?void 0:t.__posthog_wrapped__))return;let i=this;hE(iO.history,e,t=>function(r,s,n){var o;i.Av(n)&&i.Fv(),t.call(this,r,s,n),i.Ov(e,!i.Sv&&"popstate"!==(null==iO||null==(o=iO.event)?void 0:o.type))})}Cv(){let e=null==iO?void 0:iO.location;if(null==e?void 0:e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}$v(){let e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:i5(e)?e:{}}Tv(e=this.$v()){return!!e.hash&&!this._instance.config.disable_capture_url_hashes}Dv(e){let t=this.$v(),i=this.xv;return!(!i||!(t.path&&e.pathname!==i.pathname||t.search&&e.search!==i.search||this.Tv(t)&&e.hash!==i.hash))}Ov(e,t=!1){try{t||this.Fv();let i=this.Cv();if(!i)return;if(this.Dv(i)){let i=()=>this._instance.capture(oI,{navigation_type:e});t?(this.Lv=i,Promise.resolve().then(()=>this.Fv())):i()}this.xv=i}catch(t){nR.error(`Error capturing ${e} pageview`,t)}}Av(e){var t,i;return!(re(e)||!iO)&&(null==(t=a8(String(e)))?void 0:t.href)!==(null==(i=iO.location)?void 0:i.href)}Fv(){let e=this.Lv;if(e){this.Lv=void 0,this.Sv=!0;try{e()}catch(e){nR.error("Error capturing deferred pageview",e)}finally{this.Sv=!1}this.xv=this.Cv()}}Pv(){if(this.Iv)return;let e=()=>{this.Ov("popstate")};oW(iO,"popstate",e),this.Iv=()=>{iO&&iO.removeEventListener("popstate",e)}}Rv(){if(this.Mv)return;let e=()=>{this.Ov("hashchange")};oW(iO,"hashchange",e),this.Mv=()=>{iO&&iO.removeEventListener("hashchange",e)}}},heatmaps:class{get Rr(){return this.instance.config}constructor(e){var t;this.Nv=!1,this.xo=!1,this.qv=null,this.instance=e,this.Nv=!!(null==(t=this.instance.persistence)?void 0:t.props[nW]),this.rageclicks=new h_(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let e=5e3;return i5(this.Rr.capture_heatmaps)&&this.Rr.capture_heatmaps.flush_interval_milliseconds&&(e=this.Rr.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return re(this.Rr.capture_heatmaps)?re(this.Rr.enable_heatmaps)?this.Nv:this.Rr.enable_heatmaps:!1!==this.Rr.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.xo||(hA.info("starting..."),this.jv(),this.ln());else{var e;clearInterval(null!=(e=this.qv)?e:void 0),this.Bv(),this.getAndClearBuffer()}}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if(!("heatmaps"in t))return;let i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[nW]:i}),this.Nv=i,this.startIfEnabled()}getAndClearBuffer(){let e=this.Rt;return this.Rt=void 0,e}Hv(e){hL(e.originalEvent)&&this.Tr(e.originalEvent,"deadclick")}ln(){this.qv&&clearInterval(this.qv),this.qv="visible"===(null==iI?void 0:iI.visibilityState)?setInterval(this._l.bind(this),this.flushIntervalMilliseconds):null}jv(){iO&&iI&&(this.zv=this._l.bind(this),oW(iO,oF,this.zv),this.Uv=e=>this.Tr(e||(null==iO?void 0:iO.event)),oW(iI,"click",this.Uv,{capture:!0}),this.Wv=e=>this.Vv(e||(null==iO?void 0:iO.event)),oW(iI,"mousemove",this.Wv,{capture:!0}),this.Gv=new aJ(this.instance,aG,this.Hv.bind(this)),this.Gv.startIfEnabledOrStop(),this.Zv=this.ln.bind(this),oW(iI,oM,this.Zv),this.xo=!0)}Bv(){var e;iO&&iI&&(this.zv&&iO.removeEventListener(oF,this.zv),this.Uv&&iI.removeEventListener("click",this.Uv,{capture:!0}),this.Wv&&iI.removeEventListener("mousemove",this.Wv,{capture:!0}),this.Zv&&iI.removeEventListener(oM,this.Zv),clearTimeout(this.Qv),null==(e=this.Gv)||e.stop(),this.xo=!1)}Jv(e,t){let i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),n=function(e,t,i){let r=e;for(;r&&ad(r)&&!ap(r,"body");){let e;if(r===i)break;try{var s,n,o;e=null==(s=null!=(n=null==(o=r.ownerDocument)?void 0:o.defaultView)?n:iO)?void 0:s.getComputedStyle(r).position}catch(e){break}if(iJ(t,e))return!0;r=a$(r)}return!1}(aw(e),["fixed","sticky"],s);return{x:e.clientX+(n?0:r),y:e.clientY+(n?0:i),target_fixed:n,type:t}}Tr(e,t="click"){var i;if(ac(e.target)||!hL(e))return;let r=this.Jv(e,t);(null==(i=this.rageclicks)?void 0:i.isRageClick(e.clientX,e.clientY,(new Date).getTime()))&&aF(aw(e),this.instance.config.rageclick)&&this.Zs(sP(sP({},r),{},{type:"rageclick"})),this.Zs(r)}Vv(e){!ac(e.target)&&hL(e)&&(clearTimeout(this.Qv),this.Qv=setTimeout(()=>{this.Zs(this.Jv(e,"mousemove"))},500))}Zs(e){if(!iO)return;let t=this.Rr.disable_capture_url_hashes?sb(iO.location.href):iO.location.href,i=this.Rr.custom_personal_data_properties,r=a9(t,this.Rr.mask_personal_data_properties?[...lr,...i||[]]:[],ln);this.Rt=this.Rt||{},this.Rt[r]||(this.Rt[r]=[]),this.Rt[r].push(e)}_l(){this.Rt&&!i6(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:aJ,webVitalsAutocapture:class{constructor(e){var t;this._instance=e,this.Nv=!1,this.xo=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Kv=()=>{clearTimeout(this.Xv),this.Xv=void 0,0!==this.Rt.metrics.length&&(this._instance.capture("$web_vitals",sP({$current_url:this.Rt.url},this.Rt.metrics.reduce((e,t)=>
2sP(sP({},e),{},{[`$web_vitals_${t.name}_event`]:sP({},t),[`$web_vitals_${t.name}_value`]:t.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Yv=e=>{var t;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},re(null==e?void 0:e.name)||re(null==e?void 0:e.value))return void hR.error("Invalid metric received",e);let i="string"==typeof e.navigationURL?e.navigationURL:void 0,r=this.tf(i);if(i4(r))return;let s=rt(e.navigationId)||"string"==typeof e.navigationId?`navigation:${e.navigationId}`:`url:${r}`;if(this.ef&&e.value>=this.ef)return void hR.error("Ignoring metric with value >= "+this.ef,e);this.Rt.navigationKey!==s&&(this.Kv(),this.Xv=setTimeout(this.Kv,this.flushToCaptureTimeoutMs)),i4(this.Rt.navigationKey)&&(this.Rt.navigationKey=s,this.Rt.url=r),this.Rt.firstMetricTimestamp=i4(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;let n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),o=sP(sP(sP({},e),i?{navigationURL:r}:{}),{},{$current_url:r,timestamp:Date.now()});if(delete o.entries,i5(e.attribution)&&this.attributionMetrics.indexOf(e.name)>-1){let t={};for(let i of hM){let r="url"===i&&"string"==typeof e.attribution[i]?this.tf(e.attribution[i]):e.attribution[i];i4(r)||(t[i]=r)}o.attribution=t}else delete o.attribution;i4(n)||(o.$session_id=n.sessionId,o.$window_id=n.windowId),this.Rt.metrics.push(o),this.Rt.metrics.length===this.allowedMetrics.length&&this.Kv()},this.if=()=>{if(this.xo)return;let e,t,i,r,s=!1,n=iz.__PosthogExtensions__,o=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor,a=(null==o?void 0:o[this.nf])||("web-vitals"===this.nf&&i4(o)?null==n?void 0:n.postHogWebVitalsCallbacks:void 0);if(!i4(a)){let n=a.withoutAttribution,o=this.attributionMetrics;s=!i4(n),e=o.indexOf("LCP")>-1?a.onLCP:(null==n?void 0:n.onLCP)||a.onLCP,t=o.indexOf("CLS")>-1?a.onCLS:(null==n?void 0:n.onCLS)||a.onCLS,i=o.indexOf("FCP")>-1?a.onFCP:(null==n?void 0:n.onFCP)||a.onFCP,r=o.indexOf("INP")>-1?a.onINP:(null==n?void 0:n.onINP)||a.onINP}if(!(e&&t&&i&&r))return void hR.error("web vitals callbacks not loaded - not starting");let l={reportSoftNavs:this.useSoftNavs},u=s&&this.attributionMetrics.indexOf("INP")>-1?sP(sP({},l),{},{includeProcessedEventEntries:!1}):l;this.allowedMetrics.indexOf("LCP")>-1&&e(this.Yv.bind(this),l),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Yv.bind(this),l),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Yv.bind(this),l),this.allowedMetrics.indexOf("INP")>-1&&r(this.Yv.bind(this),u),this.xo=!0},this.Nv=!!(null==(t=this._instance.persistence)?void 0:t.props[nJ]),this.startIfEnabled()}get sf(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t;let i=i5(this.sf)?null==(e=this.sf)?void 0:e.web_vitals_allowed_metrics:void 0;return re(i)?(null==(t=this._instance.persistence)?void 0:t.props.$web_vitals_allowed_metrics)||hC:i}get flushToCaptureTimeoutMs(){return(i5(this.sf)?this.sf.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){let e=i5(this.sf)?this.sf.web_vitals_attribution:void 0;return rr(e)?e?hC:[]:i2(e)?e:hO}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){let e=i5(this.sf)?this.sf.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}get ef(){let e=i5(this.sf)&&rt(this.sf.__web_vitals_max_value)?this.sf.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){let e=null==iT?void 0:iT.protocol;if("http:"!==e&&"https:"!==e)return hR.info("Web Vitals are disabled on non-http/https protocols"),!1;let t=i5(this.sf)?this.sf.web_vitals:rr(this.sf)?this.sf:void 0;return rr(t)?t:this.Nv}startIfEnabled(){this.isEnabled&&!this.xo&&(hR.info("enabled, starting..."),this.Uo(this.if))}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if(!("capturePerformance"in t))return;let i=i5(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=i5(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[nJ]:i}),this._instance.persistence.register({[nZ]:r})),this.Nv=i,this.startIfEnabled()}get nf(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Uo(e){var t;let i=iz.__PosthogExtensions__,r=this.nf,s=null==i?void 0:i.postHogWebVitalsCallbacksByFlavor;(null==s?void 0:s[r])||"web-vitals"===r&&i4(s)&&(null==i?void 0:i.postHogWebVitalsCallbacks)?e():null==i||null==(t=i.loadExternalDependency)||t.call(i,this._instance,r,t=>{t?hR.error("failed to load script",t):e()})}tf(e){let t=e||(null==iO?void 0:iO.location.href);if(!t)return void hR.error("Could not determine current URL");let i=this._instance.config.disable_capture_url_hashes?sb(t):t,r=this._instance.config.custom_personal_data_properties;return a9(i,this._instance.config.mask_personal_data_properties?[...lr,...r||[]]:[],ln)}}}),{exceptionObserver:class{constructor(e){var t;this.if=()=>{var e;if(!iO||!this.isEnabled||!(null==(e=iz.__PosthogExtensions__)?void 0:e.errorWrappingFunctions))return;let t=iz.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=iz.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=iz.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.rf&&this.Rr.capture_unhandled_errors&&(this.rf=t(this.captureException.bind(this))),!this.af&&this.Rr.capture_unhandled_rejections&&(this.af=i(this.captureException.bind(this))),!this.lf&&this.Rr.capture_console_errors&&(this.lf=r(this.captureException.bind(this)))}catch(e){hk.error("failed to start",e),this.uf()}},this._instance=e,this.hf=!!(null==(t=this._instance.persistence)?void 0:t.props[nV]),this.wt=new rm(sP(sP({},function(e={}){var t,i,r,s;return{refillRate:null!=(t=null!=(i=e.exceptionRateLimiterRefillRate)?i:e.__exceptionRateLimiterRefillRate)?t:1,bucketSize:null!=(r=null!=(s=e.exceptionRateLimiterBucketSize)?s:e.__exceptionRateLimiterBucketSize)?r:10}}(this._instance.config.error_tracking)),{},{refillInterval:1e4,$:hk})),this.Rr=this.cf(),this.startIfEnabledOrStop()}cf(){let e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return i5(e)?t=sP(sP({},t),e):(i4(e)?this.hf:e)&&(t=sP(sP({},t),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Rr.capture_console_errors||this.Rr.capture_unhandled_errors||this.Rr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(hk.info("enabled"),this.uf(),this.Uo(this.if)):this.uf()}Uo(e){var t,i,r;(null==(t=iz.__PosthogExtensions__)?void 0:t.errorWrappingFunctions)?e():null==(i=iz.__PosthogExtensions__)||null==(r=i.loadExternalDependency)||r.call(i,this._instance,"exception-autocapture",t=>{if(t)return hk.error("failed to load script",t);e()})}uf(){var e,t,i;null==(e=this.rf)||e.call(this),this.rf=void 0,null==(t=this.af)||t.call(this),this.af=void 0,null==(i=this.lf)||i.call(this),this.lf=void 0}onRemoteConfig(e){if(!e.ok)return;let t=e.config;"autocaptureExceptions"in t&&(this.hf=!!t.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[nV]:this.hf}),this.Rr=this.cf(),this.startIfEnabledOrStop())}onConfigChange(){this.Rr=this.cf()}captureException(e){try{var t,i,r;let s=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";if(this.wt.consumeRateLimit(s))return void hk.info("Skipping exception capture because of client rate limiting.",{exception:s});null==(r=this._instance.exceptions)||r.sendExceptionEvent(e)}catch(e){}}},exceptions:class{constructor(e){var t,i;this.df=[],this.vf=new sR([new sH,new s0,new sV,new sW,new sQ,new sY,new sK,new sZ],function(e,...t){return(i,r=0)=>{let s=[],n=i.split("\n"),o=Math.min(n.length,r+1e3),a=[];for(let i=r;o>i;i++){let r=n[i];if(r.length>1024)continue;let o=sB.test(r)?r.replace(sB,"$1"):r;if(!o.match(/\S*Error: /)){for(let i of t){let t=i(o,e);if(t){s.push(t);let e=function(e){for(let t=1;10>=t;t++){let i=e.length-2*t;if(0>i)break;let r=!0;for(let s=0;t>s;s++)if(!sq(e[i+s],e[i+t+s])){r=!1;break}if(r){for(let r=0;t>r;r++)e[i+r]=e[i+t+r];return e.length=i+t,{start:i,length:t}}}}(s);if(e){for(let t=a.length-1;t>=0;t--){let i=a[t];if(e.start>=i.start+i.length)break;a.pop()}a.push(e)}break}}if(function(e,t){let i=t[0],r=e.length-(i?sz(e,i):0);for(let i of t)r-=sU(e,i);return r}(s,a)>=50)break}}let l=[...a].sort((e,t)=>
2t.start-e.start),u=l[l.length-1];if(u){let e=sz(s,u);for(let t of(s.splice(u.start-e,e),l))t.start-=e}for(let e of l)!function(e,t){let i=t.start+t.length,r=sU(e,t);r&&e.splice(i+r===e.length?i:t.start,r)}(s,e);return a.some(e=>0===e.start&&s.length===e.length)&&function(e){let t=e.map(e=>`${e.function}|${e.filename}|${e.lineno}|${e.colno}|${e.module}`),i=0;for(let e=1;t.length>e;e++)(function(e,t,i){for(let r=0;e.length>r;r++){let s=e[(t+r)%e.length],n=e[(i+r)%e.length];if(s!==n)return n>s}return!1})(t,e,i)&&(i=e);e.push(...e.splice(0,i))}(s),function(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>sP(sP({},e),{},{filename:e.filename||(t[t.length-1]||{}).filename,function:e.function||"?"}))}(s)}}("web:javascript",sL,sN)),this._instance=e,this.df=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property("$error_tracking_suppression_rules"))?t:[],this.ff=s6(this.pf()),this.gf=new s4(this.ff)}onConfigChange(){this.ff=s6(this.pf()),this.gf.setConfig(this.ff)}onRemoteConfig(e){var t,i,r;if(!e.ok)return;let s=e.config;if(!("errorTracking"in s))return;let n=null!=(t=null==(i=s.errorTracking)?void 0:i.suppressionRules)?t:[],o=null==(r=s.errorTracking)?void 0:r.captureExtensionExceptions;this.df=n,this._instance.persistence&&this._instance.persistence.register({[nG]:this.df,[nK]:o})}get mf(){var e;let t=!!this._instance.get_property(nK),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.vf.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.ff.enabled)try{if(!i8(e)||0===e.trim().length)return void ci.warn("Ignoring exception step because message must be a non-empty string");let{sanitizedProperties:i,droppedKeys:r}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};let t=[];return{sanitizedProperties:Object.keys(e).reduce((i,r)=>(s3.has(r)?t.push(r):i[r]=e[r],i),{}),droppedKeys:t}}(this.yf(t));r.length>0&&ci.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.gf.add(sP({[s1]:e,[s2]:(new Date).toISOString()},i))}catch(e){ci.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{let t,i=e.$exception_list;if(this.bf(i)){if(this._f(i))return this.wf("Exception dropped: matched a suppression rule"),void ci.info("Skipping exception capture because a suppression rule matched");if(!this.mf&&this.kf(i))return this.wf("Exception dropped: thrown by a browser extension"),void ci.info("Skipping exception capture because it was thrown by an extension");if(!this.mf&&this.Sf(i))return this.wf("Exception dropped: thrown by an injected browser script"),void ci.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.xf(i))return this.wf("Exception dropped: thrown by the PostHog SDK"),void ci.info("Skipping exception capture because it was thrown by the PostHog SDK")}let r=this.ff.enabled&&re(e.$exception_steps)?this.Cf(e):e,s=(t=globalThis._posthogReleaseId,"string"==typeof t&&t.length>0?t:void 0);s&&(r.$release_id=s);try{let e=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",ph:!0});return e&&this.gf.clear(),e}catch(e){return ct(e)||ci.error("Failed to capture exception event. Dropping this exception.",e),void this.gf.clear()}}catch(e){return void(ct(e)||ci.error("Failed to process exception event. Ignoring this exception.",e))}}Cf(e){try{let t=this.gf.getAttachable();return 0===t.length?e:sP(sP({},e),{},{$exception_steps:t})}catch(t){return ci.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}wf(e){this.ff.enabled&&this.gf.add({[s1]:e,[s2]:(new Date).toISOString()})}yf(e){return i5(e)?sP({},e):{}}pf(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}_f(e){if(0===e.length)return!1;try{let t=e.reduce((e,{type:t,value:i})=>(i8(t)&&t.length>0&&e.$exception_types.push(t),i8(i)&&i.length>0&&e.$exception_values.push(i),e),{$exception_types:[],$exception_values:[]});return this.df.some(e=>{let i=e.values.map(e=>{let i=uW[e.operator],r=t[e.key];if(!i||!r)return!1;let s=i2(e.value)?e.value:[e.value];return s.length>0&&i(s,r)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}catch(e){return ci.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}kf(e){let t=e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}),i=t.filter(({filename:e})=>!!e&&cn.some(t=>e.startsWith(t)));return 0!==i.length&&(!i.every(({filename:e})=>!!e&&e.startsWith(cr))||e.some(({type:e,value:t})=>"NoResponse"===e||i8(t)&&cs.some(({value:e,exact:i})=>i?t===e:t.includes(e)))&&!t.some(({in_app:e,filename:t})=>e&&!(null==t?void 0:t.startsWith(cr))))}Sf(e){return e.some(({value:e})=>i8(e)&&co.some(t=>e.includes(t)))}xf(e){if(e.length>0){var t,i,r,s;let n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],o=n[n.length-1];return null!=(r=null==o||null==(s=o.filename)?void 0:s.includes("posthog.com/static"))&&r}return!1}bf(e){return!re(e)&&i2(e)}}}),cE),{siteApps:class{constructor(e){this._instance=e,this.Mf=0,this.Ef=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Pf(e,t){if(!t)return;let i=this.globalsForEvent(t);this.Ef.push(i),this.Ef.length>1e3&&(this.Ef=this.Ef.slice(10))}get siteAppLoaders(){var e;return null==(e=iz._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){let e=this._instance._addCaptureHook(this.Pf.bind(this));this.Rf=()=>{e(),this.Ef=[],this.Rf=void 0}}}globalsForEvent(e){var t,i,r,s,n,o,a;if(!e)throw Error("Event payload is required");let l={},u=this._instance.get_property("$groups")||[];for(let[e,t]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[e]={id:u[e],type:e,properties:t};let{$set_once:h,$set:c}=e;return{event:sP(sP({},nl(e,hN)),{},{properties:sP(sP(sP({},e.properties),c?{$set:sP(sP({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{}),c)}:{}),h?{$set_once:sP(sP({},null!=(r=null==(s=e.properties)?void 0:s.$set_once)?r:{}),h)}:{}),elements_chain:null!=(n=null==(o=e.properties)?void 0:o.$elements_chain)?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}Af(e){var t;let i=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(hB.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(hB.error("prepare_external_dependency_script returned null"),null):e}Ff(){var e,t,i,r,s,n,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};let l=null==iI?void 0:iI.defaultView,u=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!u)return()=>{};if(this.Mf++,this.Of)return this.Df();let h=[],c=this,d=new WeakSet,p=(e,t,i)=>{if(!(null==e?void 0:e[t]))return;let r=e[t];e[t]=i(r),h.push(()=>{e[t]=r})},f=e=>{if(d.has(e))return e;let t=c.Af(e);return t&&d.add(t),t},g=e=>e.map(e=>"string"==typeof e?e:f(e)).filter(e=>!i9(e));return p(u,"appendChild",e=>function(t){let i=f(t);return i?e.call(this,i):t}),p(u,"insertBefore",e=>function(t,i){let r=f(t);return r?e.call(this,r,i):t}),p(u,"replaceChild",e=>function(t,i){let r=f(t);return r?e.call(this,r,i):i}),[null==(t=l.Element)?void 0:t.prototype,null==(i=l.Document)?void 0:i.prototype,null==(r=l.DocumentFragment)?void 0:r.prototype].forEach(e
2=>{p(e,"append",e=>function(...t){return e.apply(this,g(t))}),p(e,"prepend",e=>function(...t){return e.apply(this,g(t))})}),[null==(s=l.Element)?void 0:s.prototype,null==(n=l.CharacterData)?void 0:n.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach(e=>{p(e,"before",e=>function(...t){return e.apply(this,g(t))}),p(e,"after",e=>function(...t){return e.apply(this,g(t))}),p(e,"replaceWith",e=>function(...t){let i=g(t);return t.length&&!i.length?void 0:e.apply(this,i)})}),p(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",e=>function(t,i){let r=f(i);return r?e.call(this,t,r):null}),this.Of=()=>{h.forEach(e=>e()),this.Of=void 0},this.Df()}Df(){let e=!1;return()=>{var t;e||(e=!0,this.Mf--,0===this.Mf&&(null==(t=this.Of)||t.call(this)))}}Lf(e,t=!0){let i=this.Ff();try{let r=e(i);return t&&i(),r}catch(e){throw i(),e}}setupSiteApp(e){let t=this.apps[e.id],i=()=>{var i;!t.errored&&this.Ef.length&&(hB.info(`Processing ${this.Ef.length} events for site app with id ${e.id}`),this.Ef.forEach(e=>this.Lf(()=>{var i;return null==(i=t.processEvent)?void 0:i.call(t,e)})),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Rf)||i.call(this))},r=!1,s=s=>{t.errored=!s,t.loaded=!0,hB.info(`Site app with id ${e.id} ${s?"loaded":"errored"}`),r&&i()};try{let{processEvent:i}=this.Lf(t=>e.init({posthog:this._instance,callback(e){t(),s(e)}}),!1);i&&(t.processEvent=i),r=!0}catch(t){hB.error(hq+e.id,t),s(!1)}if(r&&t.loaded)try{i()}catch(i){hB.error(`Error while processing buffered events PostHog app with config id ${e.id}`,i),t.errored=!0}}Nf(){let e=this.siteAppLoaders||[];for(let t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(let t of e)this.setupSiteApp(t)}qf(e){if(0===Object.keys(this.apps).length)return;let t=this.globalsForEvent(e);for(let i of Object.values(this.apps))try{this.Lf(()=>{var e;return null==(e=i.processEvent)?void 0:e.call(i,t)})}catch(t){hB.error(`Error while processing event ${e.event} for site app ${i.id}`,t)}}onRemoteConfig(e){var t,i,r,s,n;if(null==(t=this.siteAppLoaders)?void 0:t.length)return this.isEnabled?(this.Nf(),void this._instance.on("eventCaptured",e=>this.qf(e))):void hB.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Rf)||i.call(this),!e.ok)return;let o=e.config;if(null==(r=o.siteApps)?void 0:r.length)if(this.isEnabled)for(let{id:e,url:t}of o.siteApps)iz[`__$$ph_site_app_${e}`]=this._instance,null==(s=iz.__PosthogExtensions__)||null==(n=s.loadSiteApp)||n.call(s,this._instance,t,t=>{if(t)return hB.error(hq+e,t)});else hB.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}),cP),{tracingHeaders:class{constructor(e){this._instance=e,this.jf=void 0,this.Bf=void 0,this.Hf=void 0,this.if=()=>{var e,t;let i=this.zf();i?(i4(this.jf)&&(this.jf=null==(e=iz.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),i4(this.Bf)&&(this.Bf=null==(t=iz.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.uf()}}initialize(){this.startIfEnabledOrStop()}Uo(e){var t,i,r;(null==(t=iz.__PosthogExtensions__)?void 0:t.tracingHeadersPatchFns)?e():null==(i=iz.__PosthogExtensions__)||null==(r=i.loadExternalDependency)||r.call(i,this._instance,"tracing-headers",t=>{if(t)return hP.error("failed to load script",t);e()})}Uf(){var e,t;return null!=(e=null!=(t=this._instance.config.tracing_headers)?t:this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}zf(){let e=this.Uf();return i2(e)?(i2(this.Hf)?this.Hf.splice(0,this.Hf.length,...e):this.Hf=[...e],e.length>0?this.Hf:void 0):(i2(this.Hf)&&this.Hf.splice(0),this.Hf=e||void 0,this.Hf)}uf(){var e,t;null==(e=this.jf)||e.call(this),null==(t=this.Bf)||t.call(this),this.jf=void 0,this.Bf=void 0}startIfEnabledOrStop(){this.zf()?this.Uo(this.if):this.uf()}}}),{toolbar:class{constructor(e){this.instance=e}Wf(e){iz.ph_toolbar_state=e}Vf(){var e;return null!=(e=iz.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,i){var r,s;if(oV(this.instance.config)||!iO||!iI)return!1;e=null!=(r=e)?r:iO.location,i=null!=(s=i)?s:iO.history;try{let r;if(!t){try{iO.localStorage.setItem("test","test"),iO.localStorage.removeItem("test")}catch(e){return!1}t=null==iO?void 0:iO.localStorage}let s=hQ||le(e.hash,"__posthog")||le(e.hash,"state"),n=s?sw(()=>JSON.parse(atob(decodeURIComponent(s))))||sw(()=>JSON.parse(decodeURIComponent(s))):null;return n&&"ph_authorize"===n.action?((r=n).source="url",r&&Object.keys(r).length>0&&(n.desiredHash?e.hash=n.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(hZ)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}}Gf(e){let t=iz.ph_load_toolbar||iz.ph_load_editor;!re(t)&&i3(t)?t(e,this.instance):h0.warn("No toolbar load function found")}loadToolbar(e){let t=!!(null==iI?void 0:iI.getElementById("__POSTHOG_TOOLBAR__"));if(!iO||t)return!1;let i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=sP(sP({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(iO.localStorage.setItem(hZ,JSON.stringify(sP(sP({},r),{},{source:void 0}))),2===this.Vf())this.Gf(r);else if(0===this.Vf()){var s,n;this.Wf(1),null==(s=iz.__PosthogExtensions__)||null==(n=s.loadExternalDependency)||n.call(s,this.instance,"toolbar",e=>{e?(h0.error("[Toolbar] Failed to load",e),this.Wf(0)):(this.Wf(2),this.Gf(r))}),oW(iO,"turbolinks:load",()=>{this.Wf(0),this.loadToolbar(r)})}return!0}Zf(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return this.maybeLoadToolbar(e,t,i)}}}),cR),{conversations:class{constructor(e){this._instance=e,this.np=void 0,this._conversationsManager=null,this.sp=!1,this.ne=null,this.rp=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(this._instance.config.disable_conversations||(this.op=e.ok,!e.ok))return;let t=e.config.conversations;re(t)||(rr(t)?this.np=t:(this.np=t.enabled,this.ne=t),this.loadIfEnabled())}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.np=void 0,this.ne=null,this.op=void 0,this.rp=!1}loadIfEnabled(){if(this._conversationsManager||this.sp||this._instance.config.disable_conversations||oV(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;let e=null==iz?void 0:iz.__PosthogExtensions__;if(e&&!i4(this.np)&&this.np)if(this.ne&&this.ne.token){this.sp=!0;try{let t=e.initConversations;if(t)return this.ap(t),void(this.sp=!1);let i=e.loadExternalDependency;if(!i)return void this.lp(oP);i(this._instance,"conversations",t=>{t||!e.initConversations?this.lp("Could not load conversations script",t):this.ap(e.initConversations),this.sp=!1})}catch(e){this.lp("Error initializing conversations",e),this.sp=!1}}else cu.error("Conversations enabled but missing token in remote config.")}ap(e){if(this.ne)try{this._conversationsManager=e(this.ne,this._instance),this.rp=!1,cu.info("Conversations loaded successfully")}catch(e){this.lp("Error completing conversations initialization",e)}else cu.error("Cannot complete initialization: remote config is null")}lp(e,t){cu.error(e,t),this._conversationsManager=null,this.sp=!1,this.rp=!0}show(){this._conversationsManager?this._conversationsManager.show():cu.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.np&&!i9(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":oV(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.op?"remote_config_failed":i4(this.np)?this.op?"disabled_in_project":"remote_config_pending":this.np?re(this.ne)||!this.ne.token?"missing_token":(null==iz?void 0:iz.__PosthogExtensions__)?this.sp?"initializing":this.rp?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var r=this;return rf(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,i):(cu.warn(ch),null)})()}getMessages(e,t){var i=this;return rf(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(cu.warn(ch),null)})()}markAsRead(e){var t=this;return rf(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(cu.warn(ch),null)})()}getTickets(e){var t=this;return rf(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(cu.warn(ch),null)})()}requestRestoreLink(e){var t=this;return rf(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(cu.warn(ch),null)})()}restoreFromToken(e){var t=this;return rf(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(cu.warn(ch),null)})()}restoreFromUrlToken(){var e=this;return rf(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(cu.warn(ch),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}xh(){var e;null==(e=this._conversationsManager)||e.setIdentity()}Ch(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}}),{logs:class{constructor(e){var t;this._instance=e,this.name="logs",this.up=!1,this.hp=!1,this.cp=!1,this.$=nC("[logs]"),this.dp=sP(sP({},this.$),{},{error:(...e)=>{e.some(c_)||this.$.error(...e)}}),this.ll=[],this.vp=[],this.wd=0,this.Mo=!1,this.fp=[],this.pp=[],this.gp=!1,this.mp=!1,this.yp=()=>{var e,t;this.Mo||(this.wd=0,null==(e=this.bp)||e.onReconnect(),null==(t=this._p)||t.onReconnect())},this._instance&&(null==(t=this._instance.config.logs)?void 0:t.captureConsoleLogs)&&(this.up=!0),iO&&oW(iO,"online",this.yp)}wp(e,t,i,r){var s;let n=cc(null==(s=this._instance)||null==(s=s.config)?void 0:s.logs,i);return[new nx(this.kp(e,t),n,this.dp,()=>this.Sp(),e=>e(),void 0,r),n]}xp(){var e,t;let i=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.bp&&this.Cp===i||(null==(t=this.bp)||t.reset(),this.Cp=i,[this.bp,this.$p]=this.wp(()=>this.ll,e=>{this.ll=e})),this.bp}Tp(){var e,t;let i=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this._p&&this.Ip===i||(null==(t=this._p)||t.reset(),this.Ip=i,[this._p,this.Mp]=this.wp(()=>this.vp,e=>{this.vp=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},cf)),this._p}setup(e){var t;if(this.Mo)return;this.wo=e,(null==(t=this._instance)||null==(t=t.config)||null==(t=t.logs)?void 0:t.captureConsoleLogs)&&(this.up=!0),(this.up||this.Ep()&&this.Pp())&&this.Rp();let i=!1,r=e.onRemoteConfig(e=>{var t;i=e.ok&&!0===(null==(t=e.config.logs)?void 0:t.captureConsoleLogs),this.onRemoteConfig(e)});this.Mo?r.dispose():(this.Ro=r,i||this.loadIfEnabled())}dispose(){var e,t,i,r;this.Mo||(this.Mo=!0,this.Ap(),null==(e=this.Ro)||e.dispose(),this.Ro=void 0,this.wo=void 0,this.cp=!1,null==iO||iO.removeEventListener("online",this.yp),null==(t=this.Fp)||t.call(this),this.Fp=void 0,null==(i=this.bp)||i.reset(),null==(r=this._p)||r.reset())}onRemoteConfig(e){var t,i;if(this.Mo)return;let r=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;re(r)?this.Op():(null==(i=this._instance)||null==(i=i.persistence)||i.register({$logs_capture_enabled_server_side:!!r}),r?(this.up=!0,this.hp||this.Rp(),this.loadIfEnabled()):this.Op())}reset(){var e,t,i,r;this.Ap(),null==(e=this.bp)||e.clearQueue(),this.ll=[],null==(t=this.bp)||t.reset(),null==(i=this._p)||i.clearQueue(),this.vp=[],null==(r=this._p)||r.reset(),this.wd=0}captureLog(e){this.Mo||this.xp().captureLog(e)}captureConsoleLog(e){this.Mo||this.Tp().captureLog(e)}captureBufferedConsoleLog(e,t,i){this.Mo||this.Tp().captureLog(e,{context:t,occurredAtMs:i})}Pp(){var e;return!!(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.props)?void 0:e[nQ])}Ep(){var e,t,i;return!(null==(e=this._instance)||null==(t=e.sl)?void 0:t.call(e))||!!(null==(i=iz._POSTHOG_REMOTE_CONFIG)||null==(i=i[this._instance.config.token])?void 0:i.config)}Th(){var e;this.Ap(),null==(e=this._p)||e.clearQueue(),this.vp=[]}Op(){this.up||this.Ap()}Rp(){var e;if(this.gp||!(null==iz?void 0:iz.console))return;let t=cc(null==(e=this._instance)||null==(e=e.config)?void 0:e.logs).maxBufferSize,i=!0;for(let e of(this.pp.push(()=>{i=!1}),cd)){let r;try{r=cp(iz.console[e])}catch(e){continue}r&&this.pp.push(hE(iz.console,e,s=>{let n=(...r)=>{try{i&&this.Dp(e,r,t)}catch(e){}return s.apply(iz.console,r)};return n.__rrweb_original__=r,n}))}this.gp=!0,this.Lp=setTimeout(()=>{this.Ap()},3e4)}Dp(e,t,i){var r;if(this.gp&&!this.mp&&0!==t.length)if(null==(r=this._instance)?void 0:r.is_capturing()){if(i>this.fp.length){this.mp=!0;try{this.fp.push({level:e,args:t,occurredAtMs:Date.now(),context:this.Sp()})}finally{this.mp=!1}
2}}else this.Ap()}Ap(){if(this.fp=[],this.gp){for(let e of(this.gp=!1,this.Lp&&(clearTimeout(this.Lp),this.Lp=void 0),this.pp))e();this.pp=[]}}Np(){let e=this.fp;return this.Ap(),e}get logger(){return this.qp||(this.qp={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.qp}flushLogs(e){e?this.jp(e):(this.bp&&this.bp.flush().catch(e=>this.Bp(e)),this._p&&this._p.flush().catch(e=>this.Bp(e)))}Bp(e){c_(e)||this.$.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.Mo||!this.up||this.hp||this.cp)return;let e=null==iz?void 0:iz.__PosthogExtensions__;if(!e)return this.$.error("PostHog Extensions not found."),void this.Ap();let t=e.loadExternalDependency;if(!t)return this.$.error(oP),void this.Ap();this.cp=!0;try{t(this._instance,"logs",t=>{if(this.cp=!1,this.Mo||!this.up)return;let i=e.logs;if(!t&&(null==i?void 0:i.initializeLogs)){var r,s,n;let e=this.Np();this.Fp=i.initializeLogs(null!=(r=this.wo)?r:this._instance),this.hp=!0,e.length>0&&(null==(s=i.replayConsoleBuffer)||s.call(i,null!=(n=this.wo)?n:this._instance,e))}else this.$.error("Could not load logs script",t),this.Ap()})}catch(e){throw this.cp=!1,e}}kp(e,t){let i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===iW.LogsQueue?e():void 0,setPersistedProperty(e,i){e===iW.LogsQueue&&t(null!=i?i:[])},js:e=>this.js(e),getLibraryId:()=>iH.LIB_NAME,getLibraryVersion:()=>iH.LIB_VERSION}}js(e){return new Promise(t=>{if(lt(this.wd,3))return void t({kind:"fatal",error:cv(void 0,"logs endpoint is unreachable, dropping batch")});let i=!1,r=e=>{i||(i=!0,clearTimeout(s),t(e))},s=setTimeout(()=>{this.$.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:cv(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Hp(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{let t=e.statusCode;if(this.zp(t),t>=200&&300>t)r({kind:"ok"});else if(413===t)r({kind:"too-large"});else if(0!==t&&408!==t&&429!==t&&500>t)r({kind:"fatal",error:Error(`logs request failed with status ${t}`)});else{var i;0===t?(e.error||this.$.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:cv(e.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:null!=(i=e.error)?i:Error(`logs request failed with status ${t}`)})}}})})}zp(e){(0!==e||this._instance.__loaded)&&(this.wd=li(e,this.wd,3,()=>this.$.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}jp(e){this.ll.length>0&&this.Up(e,this.ll,this.$p,iH.LIB_NAME,e=>{this.ll=e}),this.vp.length>0&&this.Up(e,this.vp,this.Mp,cf,e=>{this.vp=e})}Up(e,t,i,r,s){if(0===t.length)return;let n=t.map(e=>e.record);s([]);let o=nm(n,nd(i,iH.LIB_NAME,iH.LIB_VERSION),r,iH.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Hp(),data:o,compression:"best-available",batchKey:"logs",transport:e})}Hp(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Sp(){var e;let t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){let{sessionId:e,windowId:i,sessionStartTimestamp:r,lastActivityTimestamp:s}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=e,t.windowId=i,re(r)||(t.sessionStartTimestamp=r),re(s)||(t.lastActivityTimestamp=s)}if((null==iz||null==(e=iz.location)?void 0:e.href)&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?sb(iz.location.href):iz.location.href),this._instance.featureFlags){let e=this._instance.featureFlags.getFlags();e&&e.length>0&&(t.activeFeatureFlags=e)}return t}}}),{metrics:class{constructor(e){this._instance=e,this.$=nC("[metrics]"),this.Mo=!1}initialize(){this.onConfigChange()}onConfigChange(){var e,t;let i,r,s,n;if(this.Mo)return;let o=!!(null==(e=this._instance.config.metrics)?void 0:e.network);o&&!this.Wp?this.Wp=(t=this._instance,i=!0,r=()=>{var e;let r;return i?!0===(r=null==(e=t.config.metrics)?void 0:e.network)?{}:r||void 0:void 0},s=i3(null==iO?void 0:iO.fetch)?hE(iO,"fetch",e=>function(...i){let s=cy(),n=e.apply(this,i);if(!r())return n;try{var o,a,l;let[e,u]=i,h=cx(null!=(o=null!=(a=null==u?void 0:u.method)?a:null==e?void 0:e.method)?o:"GET",null!=(l=null==e?void 0:e.url)?l:e);return n.then(e=>(ck(t,h,null==e?void 0:e.status,s,r,void 0,!0),e),e=>{throw ck(t,h,void 0,s,r,e),e})}catch(e){return cm.error("Failed to observe fetch",e),n}}):cS,n=((e,t)=>{var i;let r=null==iO||null==(i=iO.XMLHttpRequest)?void 0:i.prototype;if(!r)return cS;let s=new WeakMap,n=hE(r,"open",e=>
2function(...t){try{uc.has(this)||s.set(this,cx(t[0],t[1]))}catch(e){cm.error("Failed to observe XHR open",e)}return e.apply(this,t)}),o=hE(r,"send",i=>function(...r){let n;try{let i=s.get(this);if(i&&t()){let r=cy();n=()=>{this.removeEventListener("loadend",n),ck(e,i,this.status,r,t)},oW(this,"loadend",n)}}catch(e){cm.error("Failed to observe XHR send",e)}try{return i.apply(this,r)}catch(e){throw n&&this.removeEventListener("loadend",n),e}});return()=>{n(),o()}})(t,r),()=>{i=!1,s(),n()}):!o&&this.Wp&&(this.Wp(),this.Wp=void 0)}xp(){var e,t,i,r,s,n,o;let a,l=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this.bp&&this.Cp===l||(null==(t=this.bp)||t.reset(),this.Cp=l,this.bp=new nE(this.kp(),{serviceName:null!=(i=null==(a=null==l?void 0:l.resourceAttributes)?void 0:a["service.name"])?i:null==l?void 0:l.serviceName,serviceVersion:null!=(r=null==a?void 0:a["service.version"])?r:null==l?void 0:l.serviceVersion,environment:null!=(s=null==a?void 0:a["deployment.environment"])?s:null==l?void 0:l.environment,resourceAttributes:a,beforeSend:null==l?void 0:l.beforeSend,flushIntervalMs:null!=(n=null==l?void 0:l.flushIntervalMs)?n:1e4,maxSeriesPerFlush:null!=(o=null==l?void 0:l.maxSeriesPerFlush)?o:1e3},this.$)),this.bp}count(e,t=1,i){this.xp().count(e,t,i)}gauge(e,t,i){this.xp().gauge(e,t,i)}histogram(e,t,i){this.xp().histogram(e,t,i)}flush(e){if(!this.bp)return Promise.resolve();if(e){let t=this.bp.drainWindow();return t&&this.Ys(t,e),Promise.resolve()}return this.bp.flush().catch(e=>this.$.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.bp)||e.reset()}dispose(){var e,t;this.Mo=!0,null==(e=this.Wp)||e.call(this),this.Wp=void 0,null==(t=this.bp)||t.reset()}kp(){let e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Ys:e=>t.Ys(e),getLibraryId:()=>iH.LIB_NAME,getLibraryVersion:()=>iH.LIB_VERSION}}Ys(e,t){return new Promise(i=>{let r=!1,s=e=>{r||(r=!0,clearTimeout(n),i(e))},n=setTimeout(()=>s({kind:"retry-later",error:Error("metrics request timed out")}),9e4);this._instance._send_request(sP(sP({method:"POST",url:this.Vp(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t}),{},{fireCallbackOnDrop:!0,callback(e){let t=e.statusCode;if(t>=200&&300>t)s({kind:"ok"});else if(413===t)s({kind:"too-large"});else if(0!==t&&408!==t&&429!==t&&500>t)s({kind:"fatal",error:Error(`metrics request failed with status ${t}`)});else{var i;s({kind:"retry-later",error:null!=(i=e.error)?i:Error(`metrics request failed with status ${t}`)})}}}))})}Vp(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}}));let cC=(iH.SDK_DIST_CHANNEL="npm",l=he[hc]=new hv,function(){function e(){e.done||(e.done=!0,uC=!1,oD(he,function(e){e._dom_loaded()}))}(null==iI?void 0:iI.addEventListener)?"complete"===iI.readyState?e():oW(iI,"DOMContentLoaded",e,{capture:!1}):iO&&nR.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),l);e.s(["default",0,cC],926375);var cO=e.i(917582);e.i(233716),e.s(["default",0,function({preview:e,children:t,hideHeader:i=!1,hideFooter:r=!1,overflowHidden:s=!1}){let[n,o]=(0,k.useState)(!1),[a,l]=(0,k.useState)(!1),[u,h]=(0,k.useState)(null),[c,d]=(0,k.useState)(null),[p,f]=(0,k.useState)(),[g,v]=(0,k.useState)(),_=(0,iv.usePathname)(),m=(0,iC.useRouter)(),y=/^\/templates\/quizzes\/[^/]+\/?$/.test(m.pathname),b=
2async()=>await new Promise((e,t)=>{let i=i$.UserPool.getCurrentUser();i?i.getSession(async(r,s)=>{r?(h(null),t()):s?.idToken?.jwtToken&&s?.accessToken?.jwtToken?(f(s?.idToken?.jwtToken),v(s?.accessToken?.jwtToken),h(i),d({email:s?.idToken?.payload?.email,"custom:family_name":s?.idToken?.payload?.["custom:family_name"],"custom:given_name":s?.idToken?.payload?.["custom:given_name"]}),e(s)):(f(null),v(null),h(null),d(null),t())}):(f(null),v(null),h(null),d(null),t())});function E(){var e;(0,iE.default)({app_id:"k8fjwynl",email:c?.email}),(0,iE.update)({email:c?.email}),c?.email&&cC.identify((e=c.email,e=e?.trim().toLowerCase(),e=(0,cO.default)(e||"")),{email:c.email})}async function P(e,t,i,r="x-www-form-urlencoded"){try{let n="json"===r,o="x-www-form-urlencoded"===r?iR.default?.stringify(i):n?"string"==typeof i?i:JSON.stringify(i??{}):i,a={..."x-www-form-urlencoded"===r?{"Content-Type":"application/x-www-form-urlencoded"}:n?{"Content-Type":"application/json"}:{},Authorization:p?`Bearer ${p}`:""};var s=await fetch(`${"https://api.poper.ai".replace(/\/+$/,"")}${e}`,{method:t,body:o,headers:a});return{status:s?.status,data:await s?.json()}}catch(e){return console.log(e),null}}async function O(e){if(!a)return iP.default.error("Please wait"),!1;var t=await P("/tools/is_available","POST",{key:e});return t?.status!==200?(iP.default.error(t?.data?.message??"Something went wrong"),!1):(t?.data?.is_available||u||iP.default.error("You have exceeded your tool access limit. Please login to continue."),!t?.data?.is_available&&u&&iP.default.error("You have exceeded your tool access limit. Please try again later."),t?.data?.is_available)}async function M(e,t,i,r="x-www-form-urlencoded"){if(!a)return iP.default.error("Please wait"),!1;var s=await P(t,"POST",i,r);return s?.status!==200?(iP.default.error(s?.data?.message??"Something went wrong"),!1):(s?.data?.is_available||u||iP.default.error("You have exceeded your tool access limit. Please login to continue."),!s?.data?.is_available&&u&&iP.default.error("You have exceeded your tool access limit. Please try again later."),s?.data?.is_available&&F(e),s?.data)}async function F(e){if(!a)return iP.default.error("Please wait"),!1;await P("/tools/consume_access","POST",{key:e})}async function A(){u||(window.location.href="https://app.poper.ai/login?return=https://www.poper.ai"+_)}return(0,k.useEffect)(()=>
2{l(!1),b().then(e=>{l(!0),E()}).catch(e=>{l(!0),E()})},[]),(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(iS.default,{theme:{token:{colorPrimary:"#f14a16",fontFamily:"var(--font-inter)"},components:{Select:{zIndex:1e6}}},children:(0,w.jsxs)(T.LayoutContext.Provider,{value:{isWaitlistOpen:n,setIsWaitlistOpen:o,sessionLoaded:a,currentUser:u,currentUserAttributes:c,idToken:p,accessToken:g,makeAPIRequest:P,checkIfUserHasToolAccess:O,checkIfUserHasToolAccessAndConsume:M,redirectToLogin:A,consumeToolAccess:F},children:[(0,w.jsx)(R,{}),(0,w.jsx)(x.default,{id:"377fb8f269b588e7",dynamic:[I.style.fontFamily],children:`:root{--font-inter:${I.style.fontFamily}}body{font-family:var(--font-inter)}`}),(0,w.jsxs)("div",{className:x.default.dynamic([["377fb8f269b588e7",[I.style.fontFamily]]])+" "+((0,C.default)(I.className,"min-h-screen",s?"overflow-x-hidden":"overflow-x-visible")||""),children:[!i&&(0,w.jsx)($.default,{}),t,!r&&(0,w.jsx)(S.default,{}),(0,w.jsx)(ik,{}),!y&&(0,w.jsxs)(ig,{location:"bottom",buttonText:"Got it!",cookieName:"cookie-consent",disableStyles:!0,style:{},buttonStyle:{},expires:150,acceptOnOverlayClick:!0,onAccept:()=>{window?.gtag?.("consent","update",{ad_user_data:"granted",ad_personalization:"granted",ad_storage:"granted",analytics_storage:"granted"})},children:["This website uses cookies to ensure you get the best experience on our website."," ",(0,w.jsx)(j.default,{onClick:()=>{document.cookie="cookie-consent2=true; expires=Fri, 31 Dec 9999 23:59:59 GMT"},className:"underline",target:"_blank",href:"/privacy",children:"Learn more"})]})]})]})})})}],444183)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.