posthog-js 1.158.1 → 1.158.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.js.map +1 -1
- package/dist/exception-autocapture.js.map +1 -1
- package/dist/lib/src/entrypoints/web-vitals.d.ts +4 -4
- package/dist/lib/src/extensions/exception-autocapture/index.d.ts +1 -1
- package/dist/lib/src/extensions/replay/config.d.ts +1 -1
- package/dist/lib/src/extensions/surveys.d.ts +2 -2
- package/dist/lib/src/utils/globals.d.ts +6 -6
- package/dist/lib/src/utils/logger.d.ts +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/module.d.ts +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/dist/recorder-v2.js.map +1 -1
- package/dist/recorder.js.map +1 -1
- package/lib/package.json +14 -9
- package/lib/src/autocapture-utils.js.map +1 -1
- package/lib/src/autocapture.js.map +1 -1
- package/lib/src/consent.js +1 -1
- package/lib/src/consent.js.map +1 -1
- package/lib/src/decide.js.map +1 -1
- package/lib/src/entrypoints/exception-autocapture.js.map +1 -1
- package/lib/src/entrypoints/recorder.js +12 -12
- package/lib/src/entrypoints/recorder.js.map +1 -1
- package/lib/src/entrypoints/surveys.js.map +1 -1
- package/lib/src/entrypoints/tracing-headers.js.map +1 -1
- package/lib/src/entrypoints/web-vitals.d.ts +4 -4
- package/lib/src/extensions/exception-autocapture/error-conversion.js +2 -2
- package/lib/src/extensions/exception-autocapture/error-conversion.js.map +1 -1
- package/lib/src/extensions/exception-autocapture/index.d.ts +1 -1
- package/lib/src/extensions/exception-autocapture/index.js +5 -4
- package/lib/src/extensions/exception-autocapture/index.js.map +1 -1
- package/lib/src/extensions/exception-autocapture/stack-trace.js.map +1 -1
- package/lib/src/extensions/exception-autocapture/type-checking.js +1 -1
- package/lib/src/extensions/exception-autocapture/type-checking.js.map +1 -1
- package/lib/src/extensions/rageclick.js.map +1 -1
- package/lib/src/extensions/replay/config.d.ts +1 -1
- package/lib/src/extensions/replay/config.js.map +1 -1
- package/lib/src/extensions/replay/external/denylist.js.map +1 -1
- package/lib/src/extensions/replay/mutation-rate-limiter.js.map +1 -1
- package/lib/src/extensions/replay/rrweb-plugins/patch.js.map +1 -1
- package/lib/src/extensions/replay/sessionrecording-utils.js.map +1 -1
- package/lib/src/extensions/replay/sessionrecording.js +1 -0
- package/lib/src/extensions/replay/sessionrecording.js.map +1 -1
- package/lib/src/extensions/segment-integration.js.map +1 -1
- package/lib/src/extensions/sentry-integration.js +3 -1
- package/lib/src/extensions/sentry-integration.js.map +1 -1
- package/lib/src/extensions/surveys/action-matcher.js.map +1 -1
- package/lib/src/extensions/surveys/components/BottomSection.jsx.map +1 -1
- package/lib/src/extensions/surveys/components/ConfirmationMessage.jsx.map +1 -1
- package/lib/src/extensions/surveys/components/QuestionTypes.jsx.map +1 -1
- package/lib/src/extensions/surveys/hooks/useContrastingTextColor.js.map +1 -1
- package/lib/src/extensions/surveys/surveys-utils.jsx.map +1 -1
- package/lib/src/extensions/surveys.d.ts +2 -2
- package/lib/src/extensions/surveys.jsx.map +1 -1
- package/lib/src/extensions/toolbar.js +2 -2
- package/lib/src/extensions/toolbar.js.map +1 -1
- package/lib/src/extensions/tracing-headers.js.map +1 -1
- package/lib/src/extensions/web-vitals/index.js.map +1 -1
- package/lib/src/heatmaps.js.map +1 -1
- package/lib/src/page-view.js.map +1 -1
- package/lib/src/posthog-core.js +5 -5
- package/lib/src/posthog-core.js.map +1 -1
- package/lib/src/posthog-featureflags.js.map +1 -1
- package/lib/src/posthog-persistence.js.map +1 -1
- package/lib/src/posthog-surveys.js.map +1 -1
- package/lib/src/rate-limiter.js.map +1 -1
- package/lib/src/request-queue.js.map +1 -1
- package/lib/src/request.js +2 -2
- package/lib/src/request.js.map +1 -1
- package/lib/src/retry-queue.js.map +1 -1
- package/lib/src/scroll-manager.js.map +1 -1
- package/lib/src/session-props.js.map +1 -1
- package/lib/src/sessionid.js.map +1 -1
- package/lib/src/storage.js +10 -10
- package/lib/src/storage.js.map +1 -1
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/blocked-uas.js.map +1 -1
- package/lib/src/utils/event-utils.js +13 -13
- package/lib/src/utils/event-utils.js.map +1 -1
- package/lib/src/utils/globals.d.ts +6 -6
- package/lib/src/utils/index.js +3 -3
- package/lib/src/utils/index.js.map +1 -1
- package/lib/src/utils/logger.d.ts +1 -1
- package/lib/src/utils/logger.js.map +1 -1
- package/lib/src/utils/request-router.js +11 -2
- package/lib/src/utils/request-router.js.map +1 -1
- package/lib/src/utils/request-utils.js +1 -1
- package/lib/src/utils/request-utils.js.map +1 -1
- package/lib/src/utils/simple-event-emitter.js.map +1 -1
- package/lib/src/utils/survey-event-receiver.js.map +1 -1
- package/lib/src/utils/type-utils.js.map +1 -1
- package/lib/src/utils/user-agent-utils.js.map +1 -1
- package/lib/src/uuidv7.js.map +1 -1
- package/package.json +14 -9
package/dist/array.full.js
CHANGED
|
@@ -13,5 +13,5 @@
|
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
15
|
***************************************************************************** */
|
|
16
|
-
function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"]);return t})),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),yt=function(){function e(t){a(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new he,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return u(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var n,r={id:t,styleIds:[]},i=[],o=v(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=void 0;this.styleMirror.has(a)?s=this.styleMirror.getId(a):(s=this.styleMirror.add(a),i.push({styleId:s,rules:Array.from(a.rules||CSSRule,(function(e,t){return{rule:b(e),index:t}}))})),r.styleIds.push(s)}}catch(e){o.e(e)}finally{o.f()}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),bt=function(){function e(){a(this,e),this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}return u(e,[{key:"periodicallyClear",value:function(){var e=this;requestAnimationFrame((function(){e.clear(),e.loop&&e.periodicallyClear()}))}},{key:"inOtherBuffer",value:function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((function(e){return e!==t}))}},{key:"add",value:function(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"clear",value:function(){this.nodeMap=new WeakMap}},{key:"destroy",value:function(){this.loop=!1}}]),e}();function kt(e){return Object.assign(Object.assign({},e),{timestamp:ne()})}var wt=!1,Ct=new k;function It(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,o=void 0===i?"rr-block":i,a=e.blockSelector,s=void 0===a?null:a,u=e.ignoreClass,l=void 0===u?"rr-ignore":u,c=e.ignoreSelector,d=void 0===c?null:c,f=e.maskTextClass,p=void 0===f?"rr-mask":f,h=e.maskTextSelector,g=void 0===h?null:h,m=e.inlineStylesheet,_=void 0===m||m,y=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,C=e.maskInputFn,I=e.maskTextFn,S=e.hooks,x=e.packFn,E=e.sampling,T=void 0===E?{}:E,A=e.dataURLOptions,M=void 0===A?{}:A,R=e.mousemoveWait,F=e.recordDOM,O=void 0===F||F,N=e.recordCanvas,L=void 0!==N&&N,P=e.recordCrossOriginIframes,D=void 0!==P&&P,q=e.recordAfter,B=void 0===q?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":q,H=e.userTriggeredOnInput,$=void 0!==H&&H,U=e.collectFonts,W=void 0!==U&&U,V=e.inlineImages,G=void 0!==V&&V,j=e.plugins,Z=e.keepIframeSrcFn,z=void 0===Z?function(){return!1}:Z,Y=e.ignoreCSSAttributes,J=void 0===Y?new Set([]):Y;Oe(e.errorHandler);var X=!D||window.parent===window,ee=!1;if(!X)try{window.parent.document&&(ee=!1)}catch(e){ee=!0}if(X&&!t)throw new Error("emit function is required");void 0!==R&&void 0===T.mousemove&&(T.mousemove=R),Ct.reset();var te,ne=!0===y?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==b?b:{password:!0},ae=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};!function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===i)return!0}while(i=i&&i.parentNode);return!1})}();var se=0,ue=function(e){var t,n=v(j||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return x&&!ee&&(e=x(e)),e};ht=function(e,i){var o;if(!(null===(o=Pe[0])||void 0===o?void 0:o.isFrozen())||e.type===_e.FullSnapshot||e.type===_e.IncrementalSnapshot&&e.data.source===ye.Mutation||Pe.forEach((function(e){return e.unfreeze()})),X)null==t||t(ue(e),i);else if(ee){var a={type:"rrweb",event:ue(e),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(e.type===_e.FullSnapshot)te=e,se=0;else if(e.type===_e.IncrementalSnapshot){if(e.data.source===ye.Mutation&&e.data.isAttachIframe)return;se++;var s=r&&se>=r,u=n&&e.timestamp-te.timestamp>n;(s||u)&&vt(!0)}};var le,ce=function(e){ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.Mutation},e)}))},he=function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.Scroll},e)}))},ve=function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.CanvasMutation},e)}))},ge=new yt({mutationCb:ce,adoptedStyleSheetCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.AdoptedStyleSheet},e)}))}}),me=new Ke({mirror:Ct,mutationCb:ce,stylesheetManager:ge,recordCrossOriginIframes:D,wrappedEmit:ht}),be=v(j||[]);try{for(be.s();!(le=be.n()).done;){var ke=le.value;ke.getMirror&&ke.getMirror({nodeMirror:Ct,crossOriginIframeMirror:me.crossOriginIframeMirror,crossOriginIframeStyleMirror:me.crossOriginIframeStyleMirror})}}catch(e){be.e(e)}finally{be.f()}var we=new bt;gt=new _t({recordCanvas:L,mutationCb:ve,win:window,blockClass:o,blockSelector:s,mirror:Ct,sampling:T.canvas,dataURLOptions:M});var Ce=new Ye({mutationCb:ce,scrollCb:he,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:p,maskTextSelector:g,inlineStylesheet:_,maskInputOptions:ne,dataURLOptions:M,maskTextFn:I,maskInputFn:C,recordCanvas:L,inlineImages:G,sampling:T,slimDOMOptions:ae,iframeManager:me,stylesheetManager:ge,canvasManager:gt,keepIframeSrcFn:z,processedNodeManager:we},mirror:Ct});vt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(O){ht(kt({type:_e.Meta,data:{href:window.location.href,width:oe(),height:ie()}}),e),ge.reset(),Ce.init(),Pe.forEach((function(e){return e.lock()}));var t=function(e,t){var n=t||{},r=n.mirror,i=void 0===r?new k:r,o=n.blockClass,a=void 0===o?"rr-block":o,s=n.blockSelector,u=void 0===s?null:s,l=n.maskTextClass,c=void 0===l?"rr-mask":l,d=n.maskTextSelector,f=void 0===d?null:d,p=n.inlineStylesheet,h=void 0===p||p,v=n.inlineImages,g=void 0!==v&&v,m=n.recordCanvas,_=void 0!==m&&m,y=n.maskAllInputs,b=void 0!==y&&y,w=n.maskTextFn,C=n.maskInputFn,I=n.slimDOM,S=void 0!==I&&I,x=n.dataURLOptions,E=n.preserveWhiteSpace,T=n.onSerialize,A=n.onIframeLoad,M=n.iframeLoadTimeout,R=n.onStylesheetLoad,F=n.stylesheetLoadTimeout,O=n.keepIframeSrcFn;return Q(e,{doc:e,mirror:i,blockClass:a,blockSelector:u,maskTextClass:c,maskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===b?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===b?{password:!0}:b,maskTextFn:w,maskInputFn:C,slimDOMOptions:!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===S,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===S?{}:S,dataURLOptions:x,inlineImages:g,recordCanvas:_,preserveWhiteSpace:E,onSerialize:T,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:R,stylesheetLoadTimeout:F,keepIframeSrcFn:void 0===O?function(){return!1}:O,newlyAddedElement:!1})}(document,{mirror:Ct,blockClass:o,blockSelector:s,maskTextClass:p,maskTextSelector:g,inlineStylesheet:_,maskAllInputs:ne,maskTextFn:I,slimDOM:ae,dataURLOptions:M,recordCanvas:L,inlineImages:G,onSerialize:function(e){de(e,Ct)&&me.addIframe(e),fe(e,Ct)&&ge.trackLinkElement(e),pe(e)&&Ce.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){me.attachIframe(e,t),Ce.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ge.attachLinkElement(e,t)},keepIframeSrcFn:z});if(!t)return console.warn("Failed to snapshot the document");ht(kt({type:_e.FullSnapshot,data:{node:t,initialOffset:re(window)}}),e),Pe.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ge.adoptStyleSheets(document.adoptedStyleSheets,Ct.getId(document))}};try{var Ie=[],Se=function(e){var t;return Le(je)({mutationCb:ce,mousemoveCb:function(e,t){return ht(kt({type:_e.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.MouseInteraction},e)}))},scrollCb:he,viewportResizeCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.ViewportResize},e)}))},inputCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.Input},e)}))},mediaInteractionCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.StyleDeclaration},e)}))},canvasMutationCb:ve,fontCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.Font},e)}))},selectionCb:function(e){ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.Selection},e)}))},customElementCb:function(e){ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.CustomElement},e)}))},blockClass:o,ignoreClass:l,ignoreSelector:d,maskTextClass:p,maskTextSelector:g,maskInputOptions:ne,inlineStylesheet:_,sampling:T,recordDOM:O,recordCanvas:L,inlineImages:G,userTriggeredOnInput:$,collectFonts:W,doc:e,maskInputFn:C,maskTextFn:I,keepIframeSrcFn:z,blockSelector:s,slimDOMOptions:ae,dataURLOptions:M,mirror:Ct,iframeManager:me,stylesheetManager:ge,shadowDomManager:Ce,processedNodeManager:we,canvasManager:gt,ignoreCSSAttributes:J,plugins:(null===(t=null==j?void 0:j.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return ht(kt({type:_e.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},S)};me.addLoadListener((function(e){try{Ie.push(Se(e.contentDocument))}catch(e){console.warn(e)}}));var xe=function(){vt(),Ie.push(Se(document)),wt=!0};return"interactive"===document.readyState||"complete"===document.readyState?xe():(Ie.push(K("DOMContentLoaded",(function(){ht(kt({type:_e.DomContentLoaded,data:{}})),"DOMContentLoaded"===B&&xe()}))),Ie.push(K("load",(function(){ht(kt({type:_e.Load,data:{}})),"load"===B&&xe()}),window))),function(){Ie.forEach((function(e){return e()})),we.destroy(),wt=!1,Ne()}}catch(e){console.warn(e)}}It.addCustomEvent=function(e,t){if(!wt)throw new Error("please add custom event after start recording");ht(kt({type:_e.Custom,data:{tag:e,payload:t}}))},It.freezePage=function(){Pe.forEach((function(e){return e.freeze()}))},It.takeFullSnapshot=function(e){if(!wt)throw new Error("please take full snapshot after start recording");vt(e)},It.mirror=Ct;var St=function(){function e(t){a(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return u(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),xt=/(^|@)\S+:\d+/,Et=/^\s*at .*(\S+:\d+|\(native\))/m,Tt=/^(eval@)?(\[native code])?$/,At={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Et)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Et)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new St({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Tt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new St({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new St({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new St({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new St({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(xt)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new St({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Mt(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq(".concat(i.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Rt(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ft(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(Rt(e[i])&&Ft(e[i],t-1))return!0}return!1}function Ot(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Rt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Rt(e)&&Ft(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=Mt(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Nt={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Lt(e,t,n){var r,i=n?Object.assign({},Nt,n):Nt,o=i.logger;if(!o)return function(){};r="string"==typeof o?t[o]:o;var a=0,s=!1,u=[];if(i.level.includes("error")){var l=function(t){var n=t.message,r=t.error,o=At.parse(r).map((function(e){return e.toString()})),a=[Ot(n,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};t.addEventListener("error",l),u.push((function(){t.removeEventListener("error",l)}));var c=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Ot("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),i.stringifyOptions)]):(n=new Error,r=[Ot("Uncaught (in promise)",i.stringifyOptions),Ot(t.reason,i.stringifyOptions)]);var o=At.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",c),u.push((function(){t.removeEventListener("unhandledrejection",c)}))}var d,f=v(i.level);try{for(f.s();!(d=f.n()).done;){var p=d.value;u.push(h(r,p))}}catch(e){f.e(e)}finally{f.f()}return function(){u.forEach((function(e){return e()}))};function h(t,n){var r=this;return t[n]?te(t,n,(function(t){return function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(t.apply(r,u),!s){s=!0;try{var c=At.parse(new Error).map((function(e){return e.toString()})).splice(1),d=u.map((function(e){return Ot(e,i.stringifyOptions)}));++a<i.lengthThreshold?e({level:n,trace:c,payload:d}):a===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Ot("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(u))}finally{s=!1}}}})):function(){}}}var Pt=Array.isArray,Dt=Object.prototype,qt=Dt.hasOwnProperty,Bt=Dt.toString,Ht=Pt||function(e){return"[object Array]"===Bt.call(e)},$t=function(e){return"function"==typeof e},Ut=function(e){return e===Object(e)&&!Ht(e)},Wt=function(e){if(Ut(e)){for(var t in e)if(qt.call(e,t))return!1;return!0}return!1},Vt=function(e){return void 0===e},Gt=function(e){return"[object String]"==Bt.call(e)},jt=function(e){return Gt(e)&&0===e.trim().length},Zt=function(e){return null===e},zt=function(e){return Vt(e)||Zt(e)},Qt=function(e){return"[object Number]"==Bt.call(e)},Kt=function(e){return"[object Boolean]"===Bt.call(e)},Yt=function(e){return e instanceof Document},Jt=function(e){return e instanceof FormData},Xt={DEBUG:!1,LIB_VERSION:"1.158.1"},en="undefined"!=typeof window?window:void 0,tn="undefined"!=typeof globalThis?globalThis:en,nn=Array.prototype,rn=nn.forEach,on=nn.indexOf,an=null==tn?void 0:tn.navigator,sn=null==tn?void 0:tn.document,un=null==tn?void 0:tn.location,ln=null==tn?void 0:tn.fetch,cn=null!=tn&&tn.XMLHttpRequest&&"withCredentials"in new tn.XMLHttpRequest?tn.XMLHttpRequest:void 0,dn=null==tn?void 0:tn.AbortController,fn=null==an?void 0:an.userAgent,pn=null!=en?en:{},hn="[PostHog.js]",vn={_log:function(e){if(en&&(Xt.DEBUG||pn.POSTHOG_DEBUG)&&!Vt(en.console)&&en.console){for(var t=("__rrweb_original__"in en.console[e]?en.console[e].__rrweb_original__:en.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,[hn].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];vn._log.apply(vn,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];vn._log.apply(vn,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];vn._log.apply(vn,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[hn].concat(n))},uninitializedWarning:function(e){vn.error("You must initialize PostHog before calling ".concat(e))}},gn={},mn=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function _n(e,t,n){if(Ht(e))if(rn&&e.forEach===rn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===gn)return}function yn(e,t,n){if(!zt(e)){if(Ht(e))return _n(e,t,n);if(Jt(e)){var r,i=v(e.entries());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(t.call(n,o[1],o[0])===gn)return}}catch(e){i.e(e)}finally{i.f()}}else for(var a in e)if(qt.call(e,a)&&t.call(n,e[a],a)===gn)return}}var bn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return _n(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function kn(e,t){return-1!==e.indexOf(t)}function wn(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Cn=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},In=function(e){try{return e()}catch(e){return}},Sn=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){vn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),vn.critical(e)}}},xn=function(e){var t={};return yn(e,(function(e,n){Gt(e)&&e.length>0&&(t[n]=e)})),t},En=function(e){return e.replace(/^\$/,"")};function Tn(e,t){return n=e,r=function(e){return Gt(e)&&!Zt(t)?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),Ht(t)?(o=[],_n(t,(function(t){o.push(e(t))}))):(o={},yn(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}var An=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var a=e.charCodeAt(i),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),Zt(s)||(n>t&&(o+=e.substring(t,n)),o+=s,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},Mn=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var a="on"+n,s=t[a];t[a]=function(t,n,r){return function(i){if(i=i||e(null==en?void 0:en.event)){var o,a=!0;$t(r)&&(o=r(i));var s=n.call(t,i);return!1!==o&&!1!==s||(a=!1),a}}}(t,r,s)}else vn.error("No valid element provided to register_event")}}();function Rn(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}var Fn=["localhost","127.0.0.1"],On=function(e){var t=null==sn?void 0:sn.createElement("a");return Vt(t)?null:(t.href=e,t)},Nn=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},Ln=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return yn(e,(function(e,r){Vt(e)||Vt(r)||"undefined"===r||(t=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)})),i.join(r)},Pn=function(e,t){for(var n,r=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!Ht(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch(e){vn.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Dn=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null};function qn(e){return e?mn(e).split(/\s+/):[]}function Bn(e){var t=null==en?void 0:en.location.href;return!!(t&&e&&e.some((function(e){return t.match(e)})))}function Hn(e){var t="";switch(r(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 qn(t)}function $n(e){return zt(e)?null:mn(e).split(/(\s+)/).filter((function(e){return ir(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Un(e){var t="";return Kn(e)&&!Yn(e)&&e.childNodes&&e.childNodes.length&&yn(e.childNodes,(function(e){var n;Gn(e)&&e.textContent&&(t+=null!==(n=$n(e.textContent))&&void 0!==n?n:"")})),mn(t)}function Wn(e){return!!e&&1===e.nodeType}function Vn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Gn(e){return!!e&&3===e.nodeType}function jn(e){return!!e&&11===e.nodeType}var Zn=["a","button","form","input","select","textarea","label"];function zn(e){var t=e.parentNode;return!(!t||!Wn(t))&&t}function Qn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!en||!e||Vn(e,"html")||!Wn(e))return!1;if(null!=n&&n.url_allowlist&&!Bn(n.url_allowlist))return!1;if(null!=n&&n.url_ignorelist&&Bn(n.url_ignorelist))return!1;if(null!=n&&n.dom_event_allowlist){var a=n.dom_event_allowlist;if(a&&!a.some((function(e){return t.type===e})))return!1}for(var s=!1,u=[e],l=!0,c=e;c.parentNode&&!Vn(c,"body");)if(jn(c.parentNode))u.push(c.parentNode.host),c=c.parentNode.host;else{if(!(l=zn(c)))break;if(i||Zn.indexOf(l.tagName.toLowerCase())>-1)s=!0;else{var d=en.getComputedStyle(l);d&&"pointer"===d.getPropertyValue("cursor")&&(s=!0)}u.push(l),c=l}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Vt(n))return!0;var i,o=v(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.tagName.toLowerCase()===t})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(u,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(Vt(n))return!0;var i,o=v(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.matches(t)})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(u,n))return!1;var f=en.getComputedStyle(e);if(f&&"pointer"===f.getPropertyValue("cursor")&&"click"===t.type)return!0;var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(o||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(o||["change","click"]).indexOf(t.type)>=0;default:return s?(o||["click"]).indexOf(t.type)>=0:(o||["click"]).indexOf(t.type)>=0&&(Zn.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}function Kn(e){for(var t=e;t.parentNode&&!Vn(t,"body");t=t.parentNode){var n=Hn(t);if(kn(n,"ph-sensitive")||kn(n,"ph-no-capture"))return!1}if(kn(Hn(e),"ph-include"))return!0;var r=e.type||"";if(Gt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(Gt(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Yn(e){return!!(Vn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Vn(e,"select")||Vn(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Jn="(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})",Xn=new RegExp("^(?:".concat(Jn,")$")),er=new RegExp(Jn),tr="\\d{3}-?\\d{2}-?\\d{4}",nr=new RegExp("^(".concat(tr,")$")),rr=new RegExp("(".concat(tr,")"));function ir(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(zt(e))return!1;if(Gt(e)){if(e=mn(e),(t?Xn:er).test((e||"").replace(/[- ]/g,"")))return!1;if((t?nr:rr).test(e))return!1}return!0}function or(e){var t=Un(e);return ir(t="".concat(t," ").concat(ar(e)).trim())?t:""}function ar(e){var t="";return e&&e.childNodes&&e.childNodes.length&&yn(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=Un(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(ar(e)).trim())}catch(e){vn.error(e)}})),t}function sr(e){return function(e){var n=e.map((function(e){var n,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();var o,a=v(e.attr_class);try{for(a.s();!(o=a.n()).done;){var s=o.value;i+=".".concat(s.replace(/"/g,""))}}catch(e){a.e(e)}finally{a.f()}}var u=t(t(t(t({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(n=e.nth_child)&&void 0!==n?n:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),l={};return wn(u).sort((function(e,t){var n=d(e,1)[0],r=d(t,1)[0];return n.localeCompare(r)})).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];return l[ur(n.toString())]=ur(r.toString())})),i+=":",i+=wn(u).map((function(e){var t=d(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')})).join("")}));return n.join(";")}(function(e){return e.map((function(e){var t,n,r={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:lr(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return wn(e).filter((function(e){return 0===d(e,1)[0].indexOf("attr__")})).forEach((function(e){var t=d(e,2),n=t[0],i=t[1];return r.attributes[n]=i})),r}))}(e))}function ur(e){return e.replace(/"|\\"/g,'\\"')}function lr(e){var t=e.attr__class;return t?Ht(t)?t:qn(t):void 0}var cr="[SessionRecording]",dr="redacted",fr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},pr=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],hr=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],vr=["/s/","/e/","/i/"];function gr(e,t,n,r){if(zt(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Gt(i)&&(i=parseInt(i)),i>n?cr+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function mr(e,t){if(zt(e))return e;var n=e;return ir(n,!1)||(n=cr+" "+t+" body "+dr),yn(hr,(function(e){var r,i;null!==(r=n)&&void 0!==r&&r.length&&-1!==(null===(i=n)||void 0===i?void 0:i.indexOf(e))&&(n=cr+" "+t+" body "+dr+" as might contain: "+e)})),n}var _r=function(e,n){var r,i,o,a={payloadSizeLimitBytes:fr.payloadSizeLimitBytes,performanceEntryTypeToObserve:f(fr.performanceEntryTypeToObserve),payloadHostDenyList:[].concat(f(n.payloadHostDenyList||[]),f(fr.payloadHostDenyList))},s=!1!==e.session_recording.recordHeaders&&n.recordHeaders,u=!1!==e.session_recording.recordBody&&n.recordBody,l=!1!==e.capture_performance&&n.recordPerformance,c=(r=a,o=Math.min(1e6,null!==(i=r.payloadSizeLimitBytes)&&void 0!==i?i:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=gr(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=gr(e.responseBody,e.responseHeaders,o,"Response")),e}),d=function(e){return c(function(e){var t=On(e.name);if(!(t&&t.pathname&&vr.some((function(e){return 0===t.pathname.indexOf(e)}))))return e}((n=(t=e).requestHeaders,zt(n)||yn(Object.keys(null!=n?n:{}),(function(e){pr.includes(e.toLowerCase())&&(n[e]=dr)})),t)));var t,n},p=$t(e.session_recording.maskNetworkRequestFn);return p&&$t(e.session_recording.maskCapturedNetworkRequestFn)&&vn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),p&&(e.session_recording.maskCapturedNetworkRequestFn=function(n){var r=e.session_recording.maskNetworkRequestFn({url:n.name});return t(t({},n),{},{name:null==r?void 0:r.url})}),a.maskRequestFn=$t(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,r,i,o=d(t);return o&&null!==(n=null===(r=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(i,o))&&void 0!==n?n:void 0}:function(e){return function(e){if(!Vt(e))return e.requestBody=mr(e.requestBody,"Request"),e.responseBody=mr(e.responseBody,"Response"),e}(d(e))},t(t(t({},fr),a),{},{recordHeaders:s,recordBody:u,recordPerformance:l,recordInitialRequests:l})};function yr(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return $t(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function br(e,t){var n,r=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:r,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==r||!r.trim().length)return i;var o,a=v(t.payloadHostDenyList);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(r.endsWith(s))return{hostname:r,isHostDenied:!0}}}catch(e){a.e(e)}finally{a.f()}return i}var kr=function(e){return"navigation"===e.entryType},wr=function(e){return"resource"===e.entryType};function Cr(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function Ir(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((function(e){return kr(e)||wr(e)&&n.initiatorTypes.includes(e.initiatorType)}));e({requests:r.flatMap((function(e){return Rr(e,void 0,void 0,{},!0)})),isInitial:!0})}var i=new t.PerformanceObserver((function(t){var r=t.getEntries().filter((function(e){return kr(e)||wr(e)&&n.initiatorTypes.includes(e.initiatorType)&&function(e){return!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType}(e)}));e({requests:r.flatMap((function(e){return Rr(e,void 0,void 0,{})}))})})),o=PerformanceObserver.supportedEntryTypes.filter((function(e){return n.performanceEntryTypeToObserve.includes(e)}));return i.observe({entryTypes:o}),function(){i.disconnect()}}function Sr(e,t){return!!t&&(Kt(t)||t[e])}function xr(e){var t=e.type,n=e.recordBody,r=e.headers;function i(e){var t=Object.keys(r).find((function(e){return"content-type"===e.toLowerCase()})),n=t&&r[t];return e.some((function(e){return null==n?void 0:n.includes(e)}))}if(!n)return!1;if(Kt(n))return!0;if(Ht(n))return i(n);var o=n[t];return Kt(o)?o:i(o)}function Er(e,t,n,r,i){return Tr.apply(this,arguments)}function Tr(){return Tr=o(n().mark((function e(t,r,i,o,a){var s,u,l,c=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((s=c.length>5&&void 0!==c[5]?c[5]:0)>10)){e.next=4;break}return vn.warn("Failed to get performance entry for request",{url:i,initiatorType:r}),e.abrupt("return",null);case 4:if(u=t.performance.getEntriesByName(i),l=Cr(u,(function(e){return wr(e)&&e.initiatorType===r&&(!o||e.startTime>=o)&&(!a||e.startTime<=a)}))){e.next=10;break}return e.next=9,new Promise((function(e){return setTimeout(e,50*s)}));case 9:return e.abrupt("return",Er(t,r,i,o,a,s+1));case 10:return e.abrupt("return",l);case 11:case"end":return e.stop()}}),e)}))),Tr.apply(this,arguments)}function Ar(e){var t=e.body,n=e.options,r=e.url;if(zt(t))return null;var i=br(r,n),o=i.hostname;if(i.isHostDenied)return o+" is in deny list";if(Gt(t))return t;if(Yt(t))return t.textContent;if(Jt(t))return Ln(t);if(Ut(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Mr=function(e){return"navigation"===e.entryType||"resource"===e.entryType};function Rr(e,n,r,i,o){var a=Math.floor(Date.now()-performance.now()),s=Math.floor(a+e.startTime),u=[t(t({},e.toJSON()),{},{startTime:Math.round(e.startTime),endTime:Math.round(e.responseEnd),timeOrigin:a,timestamp:s,method:n,initiatorType:e.initiatorType,status:r,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:o})];if(Mr(e)){var l,c=v(e.serverTiming||[]);try{for(c.s();!(l=c.n()).done;){var d=l.value;u.push({timeOrigin:a,timestamp:s,startTime:Math.round(e.startTime),name:d.name,duration:d.duration,entryType:"serverTiming"})}}catch(e){c.e(e)}finally{c.f()}}return u}var Fr=["video/","audio/"];function Or(e){var t,n=e.r,r=e.options,i=e.url;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),a=Fr.some((function(e){return null==o?void 0:o.startsWith(e)}));if(o&&a)return"Content-Type ".concat(o," is not supported");var s=br(i,r),u=s.hostname;return s.isHostDenied?u+" is in deny list":null}function Nr(e){return new Promise((function(t,n){var r=setTimeout((function(){return t("[SessionReplay] Timeout while trying to read body")}),500);e.clone().text().then((function(e){return t(e)}),(function(e){return n(e)})).finally((function(){return clearTimeout(r)}))}))}function Lr(e){return Pr.apply(this,arguments)}function Pr(){return Pr=o(n().mark((function e(t){var r,i,o,a,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.r,i=t.options,o=t.url,a=br(o,i),s=a.hostname,!a.isHostDenied){e.next=4;break}return e.abrupt("return",Promise.resolve(s+" is in deny list"));case 4:return e.abrupt("return",Nr(r));case 5:case"end":return e.stop()}}),e)}))),Pr.apply(this,arguments)}function Dr(e){return qr.apply(this,arguments)}function qr(){return qr=o(n().mark((function e(t){var r,i,o,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.r,i=t.options,o=t.url,a=Or({r:r,options:i,url:o}),Zt(a)){e.next=4;break}return e.abrupt("return",Promise.resolve(a));case 4:return e.abrupt("return",Nr(r));case 5:case"end":return e.stop()}}),e)}))),qr.apply(this,arguments)}var Br=null;function Hr(e,r,i){if(!("performance"in r))return function(){};if(Br)return vn.warn("Network observer already initialised, doing nothing"),function(){};var a=i?Object.assign({},fr,i):fr,s=function(n){var r=[];n.requests.forEach((function(e){var t=a.maskRequestFn(e);t&&r.push(t)})),r.length>0&&e(t(t({},n),{},{requests:r}))},u=Ir(s,r,a),l=function(){},c=function(){};return(a.recordHeaders||a.recordBody)&&(l=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return function(){};var r=Sr("request",n.recordHeaders),i=Sr("response",n.recordHeaders),o=yr(t.XMLHttpRequest.prototype,"open",(function(o){return function(a,s){var u,l,c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,f=arguments.length>4?arguments[4]:void 0,p=this,h=new Request(s),v={},g={},m=p.setRequestHeader.bind(p);p.setRequestHeader=function(e,t){return g[e]=t,m(e,t)},r&&(v.requestHeaders=g);var _=p.send.bind(p);p.send=function(e){return xr({type:"request",headers:g,url:s,recordBody:n.recordBody})&&(v.requestBody=Ar({body:e,options:n,url:s})),u=t.performance.now(),_(e)},p.addEventListener("readystatechange",(function(){if(p.readyState===p.DONE){l=t.performance.now();var r={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var t=e.split(": "),n=t.shift(),i=t.join(": ");n&&(r[n]=i)})),i&&(v.responseHeaders=r),xr({type:"response",headers:r,url:s,recordBody:n.recordBody})&&(v.responseBody=Ar({body:p.response,options:n,url:s})),Er(t,"xmlhttprequest",h.url,u,l).then((function(t){if(!Zt(t)){var n=Rr(t,h.method,null==p?void 0:p.status,v);e({requests:n})}})).catch((function(){}))}})),o.call(p,a,s,c,d,f)}}));return function(){o()}}(s,r,a),c=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return function(){};var i=Sr("request",r.recordHeaders),a=Sr("response",r.recordHeaders),s=yr(t,"fetch",(function(s){return function(){var u=o(n().mark((function o(u,l){var c,d,f,p,h,v,g;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(c=new Request(u,l),f={},n.prev=2,v={},c.headers.forEach((function(e,t){v[t]=e})),i&&(f.requestHeaders=v),!xr({type:"request",headers:v,url:u,recordBody:r.recordBody})){n.next=10;break}return n.next=9,Lr({r:c,options:r,url:u});case 9:f.requestBody=n.sent;case 10:return p=t.performance.now(),n.next=13,s(c);case 13:if(d=n.sent,h=t.performance.now(),g={},d.headers.forEach((function(e,t){g[t]=e})),a&&(f.responseHeaders=g),!xr({type:"response",headers:g,url:u,recordBody:r.recordBody})){n.next=22;break}return n.next=21,Dr({r:d,options:r,url:u});case 21:f.responseBody=n.sent;case 22:return n.abrupt("return",d);case 23:return n.prev=23,Er(t,"fetch",c.url,p,h).then((function(t){var n;if(!Zt(t)){var r=Rr(t,c.method,null===(n=d)||void 0===n?void 0:n.status,f);e({requests:r})}})).catch((function(){})),n.finish(23);case 26:case"end":return n.stop()}}),o,null,[[2,,23,26]])})));return function(e,t){return u.apply(this,arguments)}}()}));return function(){s()}}(s,r,a)),Br=function(){u(),l(),c()}}var $r,Ur,Wr;en&&(en.rrweb={record:It,version:"v2",rrwebVersion:"2.0.0-alpha.13"},en.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:Lt,options:e}}},en.getRecordNetworkPlugin=function(e){return{name:"rrweb/network@1",observer:Hr,options:e}}),function(e){e.Popover="popover",e.API="api",e.Widget="widget"}($r||($r={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Ur||(Ur={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Wr||(Wr={}));var Vr,Gr,jr,Zr,zr,Qr,Kr,Yr,Jr={},Xr=[],ei=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ti=Array.isArray;function ni(e,t){for(var n in t)e[n]=t[n];return e}function ri(e){var t=e.parentNode;t&&t.removeChild(e)}function ii(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Vr.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return oi(e,a,r,i,null)}function oi(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++jr:i,__i:-1,__u:0};return null==i&&null!=Gr.vnode&&Gr.vnode(o),o}function ai(e){return e.children}function si(e,t){this.props=e,this.context=t}function ui(e,t){if(null==t)return e.__?ui(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?ui(e):null}function li(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return li(e)}}function ci(e){(!e.__d&&(e.__d=!0)&&Zr.push(e)&&!di.__r++||zr!==Gr.debounceRendering)&&((zr=Gr.debounceRendering)||Qr)(di)}function di(){var e,t,n,r,i,o,a,s,u;for(Zr.sort(Kr);e=Zr.shift();)e.__d&&(t=Zr.length,r=void 0,o=(i=(n=e).__v).__e,s=[],u=[],(a=n.__P)&&((r=ni({},i)).__v=i.__v+1,Gr.vnode&&Gr.vnode(r),yi(a,r,i,n.__n,void 0!==a.ownerSVGElement,32&i.__u?[o]:null,s,null==o?ui(i):o,!!(32&i.__u),u),r.__.__k[r.__i]=r,bi(s,r,u),r.__e!=o&&li(r)),Zr.length>t&&Zr.sort(Kr));di.__r=0}function fi(e,t,n,r,i,o,a,s,u,l,c){var d,f,p,h,v,g=r&&r.__k||Xr,m=t.length;for(n.__d=u,function(e,t,n){var r,i,o,a,s,u=t.length,l=n.length,c=l,d=0;for(e.__k=[],r=0;r<u;r++)null!=(i=e.__k[r]=null==(i=t[r])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?oi(null,i,null,null,i):ti(i)?oi(ai,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?oi(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,s=hi(i,n,a=r+d,c),i.__i=s,o=null,-1!==s&&(c--,(o=n[s])&&(o.__u|=131072)),null==o||null===o.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s===a+1?d++:s>a?c>u-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==r+d&&(i.__u|=65536))):(o=n[r])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=ui(o)),Ci(o,o,!1),n[r]=null,c--);if(c)for(r=0;r<l;r++)null!=(o=n[r])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=ui(o)),Ci(o,o))}(n,t,g),u=n.__d,d=0;d<m;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(f=-1===p.__i?Jr:g[p.__i]||Jr,p.__i=d,yi(e,p,f,i,o,a,s,u,l,c),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&wi(f.ref,null,p),c.push(p.ref,p.__c||h,p)),null==v&&null!=h&&(v=h),65536&p.__u||f.__k===p.__k?u=pi(p,u,e):"function"==typeof p.type&&void 0!==p.__d?u=p.__d:h&&(u=h.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=u,n.__e=v}function pi(e,t,n){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=pi(r[i],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function hi(e,t,n,r){var i=e.key,o=e.type,a=n-1,s=n+1,u=t[n];if(null===u||u&&i==u.key&&o===u.type)return n;if(r>(null!=u&&0==(131072&u.__u)?1:0))for(;a>=0||s<t.length;){if(a>=0){if((u=t[a])&&0==(131072&u.__u)&&i==u.key&&o===u.type)return a;a--}if(s<t.length){if((u=t[s])&&0==(131072&u.__u)&&i==u.key&&o===u.type)return s;s++}}return-1}function vi(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||ei.test(t)?n:n+"px"}function gi(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||vi(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||vi(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?_i:mi,o)):e.removeEventListener(t,o?_i:mi,o);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function mi(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Gr.event?Gr.event(e):e)}function _i(e){return this.l[e.type+!0](Gr.event?Gr.event(e):e)}function yi(e,t,n,r,i,o,a,s,u,l){var c,d,f,p,h,v,g,m,_,y,b,k,w,C,I,S=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),o=[s=t.__e=n.__e]),(c=Gr.__b)&&c(t);e:if("function"==typeof S)try{if(m=t.props,_=(c=S.contextType)&&r[c.__c],y=c?_?_.props.value:c.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:("prototype"in S&&S.prototype.render?t.__c=d=new S(m,y):(t.__c=d=new si(m,y),d.constructor=S,d.render=Ii),_&&_.sub(d),d.props=m,d.state||(d.state={}),d.context=y,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=S.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=ni({},d.__s)),ni(d.__s,S.getDerivedStateFromProps(m,d.__s))),p=d.props,h=d.state,d.__v=t,f)null==S.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==S.getDerivedStateFromProps&&m!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=m,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,h,v)}))}if(d.context=y,d.props=m,d.__P=e,d.__e=!1,k=Gr.__r,w=0,"prototype"in S&&S.prototype.render){for(d.state=d.__s,d.__d=!1,k&&k(t),c=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,k&&k(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++w<25);d.state=d.__s,null!=d.getChildContext&&(r=ni(ni({},r),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(v=d.getSnapshotBeforeUpdate(p,h)),fi(e,ti(I=null!=c&&c.type===ai&&null==c.key?c.props.children:c)?I:[I],t,n,r,i,o,a,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,u||null!=o?(t.__e=s,t.__u|=u?160:32,o[o.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),Gr.__e(e,t,n)}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=ki(n.__e,t,n,r,i,o,a,u,l);(c=Gr.diffed)&&c(t)}function bi(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)wi(n[r],n[++r],n[++r]);Gr.__c&&Gr.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Gr.__e(e,t.__v)}}))}function ki(e,t,n,r,i,o,a,s,u){var l,c,d,f,p,h,v,g=n.props,m=t.props,_=t.type;if("svg"===_&&(i=!0),null!=o)for(l=0;l<o.length;l++)if((p=o[l])&&"setAttribute"in p==!!_&&(_?p.localName===_:3===p.nodeType)){e=p,o[l]=null;break}if(null==e){if(null===_)return document.createTextNode(m);e=i?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,m.is&&m),o=null,s=!1}if(null===_)g===m||s&&e.data===m||(e.data=m);else{if(o=o&&Vr.call(e.childNodes),g=n.props||Jr,!s&&null!=o)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)p=g[l],"children"==l||("dangerouslySetInnerHTML"==l?d=p:"key"===l||l in m||gi(e,l,null,p,i));for(l in m)p=m[l],"children"==l?f=p:"dangerouslySetInnerHTML"==l?c=p:"value"==l?h=p:"checked"==l?v=p:"key"===l||s&&"function"!=typeof p||g[l]===p||gi(e,l,p,g[l],i);if(c)s||d&&(c.__html===d.__html||c.__html===e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),fi(e,ti(f)?f:[f],t,n,r,i&&"foreignObject"!==_,o,a,o?o[0]:n.__k&&ui(n,0),s,u),null!=o)for(l=o.length;l--;)null!=o[l]&&ri(o[l]);s||(l="value",void 0!==h&&(h!==e[l]||"progress"===_&&!h||"option"===_&&h!==g[l])&&gi(e,l,h,g[l],!1),l="checked",void 0!==v&&v!==e[l]&&gi(e,l,v,g[l],!1))}return e}function wi(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Gr.__e(e,n)}}function Ci(e,t,n){var r,i;if(Gr.unmount&&Gr.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||wi(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Gr.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Ci(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||ri(e.__e),e.__=e.__e=e.__d=void 0}function Ii(e,t,n){return this.constructor(e,n)}function Si(e,t,n){var r,i,o,a;Gr.__&&Gr.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],a=[],yi(t,e=(!r&&n||t).__k=ii(ai,null,[e]),i||Jr,Jr,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Vr.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r,a),bi(o,e,a)}function xi(e,t,n){var r,i,o,a,s=ni({},e.props);for(o in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=void 0===t[o]&&void 0!==a?a[o]:t[o];return arguments.length>2&&(s.children=arguments.length>3?Vr.call(arguments,2):n),oi(e.type,s,r||e.key,i||e.ref,null)}Vr=Xr.slice,Gr={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},jr=0,si.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=ni({},this.state),"function"==typeof e&&(e=e(ni({},n),this.props)),e&&ni(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),ci(this))},si.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ci(this))},si.prototype.render=ai,Zr=[],Qr="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Kr=function(e,t){return e.__v.__b-t.__v.__b},di.__r=0,Yr=0;var Ei=en,Ti=sn,Ai=function(e){return'\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: '.concat(parseInt((null==e?void 0:e.maxWidth)||"300"),"px;\n width: 100%;\n z-index: ").concat(parseInt((null==e?void 0:e.zIndex)||"99999"),";\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n border-bottom: 0px;\n ").concat({left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "}[(null==e?void 0:e.position)||"right"]||"right: 30px;","\n flex-direction: column;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",';\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n \n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ').concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ").concat((null==e?void 0:e.submitButtonColor)||"black"," !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n text-decoration: none;\n backgroundColor: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n color: ").concat(Ri((null==e?void 0:e.backgroundColor)||"#eeeded"),";\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n ")};function Mi(e){if("#"===e[0]){var t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function Ri(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Oi;"#"===t[0]&&(e=Mi(t)),t.startsWith("rgb")&&(e=t);var n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(n&&(e=Mi(n)),!e)return"black";var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var i=parseInt(r[1]),o=parseInt(r[2]),a=parseInt(r[3]);return Math.sqrt(i*i*.299+o*o*.587+a*a*.114)>127.5?"black":"white"}return"black"}var Fi={backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:"right"},Oi="#eeeded",Ni=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i&&(localStorage.setItem(Hi(r),"true"),i.capture("survey sent",t(t({$survey_name:r.name,$survey_id:r.id,$survey_iteration:r.current_iteration,$survey_iteration_start_date:r.current_iteration_start_date,$survey_questions:r.questions.map((function(e){return e.question})),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i)},n),{},{$set:l({},$i(r,"responded"),!0)})),Ei.dispatchEvent(new Event("PHSurveySent")))},Li=function(e,t,n){var r;!n&&t&&(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(r=t.get_session_replay_url)||void 0===r?void 0:r.call(t),$set:l({},$i(e,"dismissed"),!0)}),localStorage.setItem(Hi(e),"true"),Ei.dispatchEvent(new Event("PHSurveyClosed")))},Pi=function(e){return e.map((function(e){return{sort:Math.floor(10*Math.random()),value:e}})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.value}))},Di=function(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))?t.reverse():t},qi=function(e){return e.questions.forEach((function(e,t){e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?Di(e.questions,Pi(e.questions)):e.questions},Bi=function(e){var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!function(e){var t,n,r,i,o,a;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r?void 0:r.length)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(a=o.values)||void 0===a?void 0:a.length)>0}(e))},Hi=function(e){var t="seenSurvey_".concat(e.id);return e.current_iteration&&e.current_iteration>0&&(t="seenSurvey_".concat(e.id,"_").concat(e.current_iteration)),t},$i=function(e,t){var n="$survey_".concat(t,"/").concat(e.id);return e.current_iteration&&e.current_iteration>0&&(n="$survey_".concat(t,"/").concat(e.id,"/").concat(e.current_iteration)),n},Ui=function(e,t){var n={__c:t="__cC"+Yr++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,ci(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:function(){},isPopup:!0}),Wi=function(e){var t=e.component,n=e.children,r=e.renderAsHtml,i=e.style;return xi(t,r?{dangerouslySetInnerHTML:{__html:n},style:i}:{children:n,style:i})},Vi=sn;var Gi,ji,Zi,zi,Qi=0,Ki=[],Yi=[],Ji=Gr.__b,Xi=Gr.__r,eo=Gr.diffed,to=Gr.__c,no=Gr.unmount;function ro(e,t){Gr.__h&&Gr.__h(ji,e,Qi||t),Qi=0;var n=ji.__H||(ji.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Yi}),n.__[e]}function io(e){return Qi=1,function(e,t,n){var r=ro(Gi++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):go(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=ji,!ji.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var a=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&r.__c.props===e)&&(!o||o.call(this,e,t,n))};ji.u=!0;var o=ji.shouldComponentUpdate,a=ji.componentWillUpdate;ji.componentWillUpdate=function(e,t,n){if(this.__e){var r=o;o=void 0,i(e,t,n),o=r}a&&a.call(this,e,t,n)},ji.shouldComponentUpdate=i}return r.__N||r.__}(go,e)}function oo(e,t){var n=ro(Gi++,3);!Gr.__s&&vo(n.__H,t)&&(n.__=e,n.i=t,ji.__H.__h.push(n))}function ao(e){return Qi=5,so((function(){return{current:e}}),[])}function so(e,t){var n=ro(Gi++,7);return vo(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function uo(e){var t=ji.context[e.__c],n=ro(Gi++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(ji)),t.props.value):e.__}function lo(){for(var e;e=Ki.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(po),e.__H.__h.forEach(ho),e.__H.__h=[]}catch(t){e.__H.__h=[],Gr.__e(t,e.__v)}}Gr.__b=function(e){ji=null,Ji&&Ji(e)},Gr.__r=function(e){Xi&&Xi(e),Gi=0;var t=(ji=e.__c).__H;t&&(Zi===ji?(t.__h=[],ji.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Yi,e.__N=e.i=void 0}))):(t.__h.forEach(po),t.__h.forEach(ho),t.__h=[],Gi=0)),Zi=ji},Gr.diffed=function(e){eo&&eo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ki.push(t)&&zi===Gr.requestAnimationFrame||((zi=Gr.requestAnimationFrame)||fo)(lo)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Yi&&(e.__=e.__V),e.i=void 0,e.__V=Yi}))),Zi=ji=null},Gr.__c=function(e,t){t.some((function(e){try{e.__h.forEach(po),e.__h=e.__h.filter((function(e){return!e.__||ho(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Gr.__e(n,e.__v)}})),to&&to(e,t)},Gr.unmount=function(e){no&&no(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{po(e)}catch(e){t=e}})),n.__H=void 0,t&&Gr.__e(t,n.__v))};var co="function"==typeof requestAnimationFrame;function fo(e){var t,n=function(){clearTimeout(r),co&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);co&&(t=requestAnimationFrame(n))}function po(e){var t=ji,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),ji=t}function ho(e){var t=ji;e.__c=e.__(),ji=t}function vo(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function go(e,t){return"function"==typeof t?t(e):t}var mo=0;function _o(e,t,n,r,i,o){var a,s,u={};for(s in t)"ref"==s?a=t[s]:u[s]=t[s];var l={type:e,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--mo,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(a=e.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return Gr.vnode&&Gr.vnode(l),l}var yo=_o("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_o("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),bo=_o("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_o("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),ko=_o("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_o("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),wo=_o("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_o("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Co=_o("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_o("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Io=_o("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})}),So=_o("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[_o("g",{"clip-path":"url(#clip0_2415_6911)",children:[_o("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:_o("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),_o("g",{mask:"url(#mask0_2415_6911)",children:[_o("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),_o("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),_o("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),_o("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),_o("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),_o("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),_o("defs",{children:_o("clipPath",{id:"clip0_2415_6911",children:_o("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),xo=_o("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_o("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});function Eo(){return _o("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",So]})}function To(e){var t=e.text,n=e.submitDisabled,r=e.appearance,i=e.onSubmit,o=e.link,a=uo(Ui),s=a.isPreviewMode,u=a.isPopup,l=r.submitButtonTextColor||Ri(r.submitButtonColor||Fi.submitButtonColor);return _o("div",{className:"bottom-section",children:[_o("div",{className:"buttons",children:_o("button",{className:"form-submit",disabled:n&&!s,type:"button",style:u?{color:l}:{},onClick:function(){s||(o&&(null==en||en.open(o)),i())},children:t})}),!r.whiteLabel&&_o(Eo,{})]})}function Ao(e){var t=e.question,n=e.description,r=e.descriptionContentType,i=e.backgroundColor,o=e.forceDisableHtml;return _o("div",{style:uo(Ui).isPopup?{backgroundColor:i||Fi.backgroundColor}:{},children:[_o("div",{className:"survey-question",children:t}),n&&Wi({component:ii("div",{className:"survey-question-description"}),children:n,renderAsHtml:!o&&"text"!==r})]})}function Mo(e){return _o("div",{className:"cancel-btn-wrapper",children:_o("button",{className:"form-cancel",onClick:e.onClick,disabled:uo(Ui).isPreviewMode,children:Io})})}function Ro(e){var n=e.header,r=e.description,i=e.contentType,o=e.forceDisableHtml,a=e.appearance,s=e.onClose,u=e.styleOverrides,l=Ri(a.backgroundColor||Fi.backgroundColor),c=uo(Ui).isPopup;return _o(ai,{children:_o("div",{className:"thank-you-message",style:t({},u),children:_o("div",{className:"thank-you-message-container",children:[c&&_o(Mo,{onClick:function(){return s()}}),_o("h3",{className:"thank-you-message-header",style:{color:l},children:n}),r&&Wi({component:ii("div",{className:"thank-you-message-body"}),children:r,renderAsHtml:!o&&"text"!==i,style:{color:l}}),c&&_o(To,{text:a.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:a,onSubmit:function(){return s()}})]})})})}function Fo(e){var t,n=ao(null),r=d(io(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black"),2),i=r[0],o=r[1];return oo((function(){if(n.current){var e=function(e){var t=Ei.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";var n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";var r=parseInt(n[1]),i=parseInt(n[2]),o=parseInt(n[3]);return Math.sqrt(r*r*.299+i*i*.587+o*o*.114)>127.5?"black":"white"}(n.current);o(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:i}}function Oo(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,i=e.onSubmit,o=ao(null),a=d(io(""),2),s=a[0],u=a[1];return _o("div",{ref:o,children:[_o(Ao,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:r.backgroundColor,forceDisableHtml:n}),_o("textarea",{rows:4,placeholder:null==r?void 0:r.placeholder,onInput:function(e){return u(e.currentTarget.value)}}),_o(To,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:r,onSubmit:function(){return i(s)}})]})}function No(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,i=e.onSubmit;return _o(ai,{children:[_o(Ao,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),_o(To,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:function(){return i("link clicked")}})]})}function Lo(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,i=e.appearance,o=e.onSubmit,a=t.scale,s=10===t.scale?0:1,u=d(io(null),2),l=u[0],c=u[1];return _o(ai,{children:[_o(Ao,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:i.backgroundColor}),_o("div",{className:"rating-section",children:[_o("div",{className:"rating-options",children:["emoji"===t.display&&_o("div",{className:"rating-options-emoji",children:(3===t.scale?qo:Bo).map((function(e,t){var n=t+1===l;return _o("button",{className:"ratings-emoji question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),value:t+1,type:"button",onClick:function(){c(t+1)},style:{fill:n?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:e},t)}))}),"number"===t.display&&_o("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat(".concat(a-s+1,", minmax(0, 1fr))")},children:Wo(t.scale).map((function(e,t){return _o(Po,{displayQuestionIndex:r,active:l===e,appearance:i,num:e,setActiveNumber:function(e){c(e)}},t)}))})]}),_o("div",{className:"rating-text",children:[_o("div",{children:t.lowerBoundLabel}),_o("div",{children:t.upperBoundLabel})]})]}),_o(To,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:Zt(l)&&!t.optional,appearance:i,onSubmit:function(){return o(l)}})]})}function Po(e){var t=e.num,n=e.active,r=e.displayQuestionIndex,i=e.appearance,o=e.setActiveNumber,a=Fo({appearance:i,defaultTextColor:"black",forceUpdate:n}),s=a.textColor;return _o("button",{ref:a.ref,className:"ratings-number question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),type:"button",onClick:function(){o(t)},style:{color:s,backgroundColor:n?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:t})}function Do(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,i=e.appearance,o=e.onSubmit,a=ao(null),s=so((function(){return function(e){if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var r=Di(t,Pi(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r}(t)}),[t]),u=d(io(t.type===Ur.MultipleChoice?[]:null),2),l=u[0],c=u[1],p=d(io(!1),2),h=p[0],v=p[1],g=d(io(""),2),m=g[0],_=g[1],y=t.type===Ur.SingleChoice?"radio":"checkbox";return _o("div",{ref:a,children:[_o(Ao,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:i.backgroundColor}),_o("div",{className:"multiple-choice-options",children:s.map((function(e,n){var i="choice-option",o=e,a=e;return t.hasOpenChoice&&n===t.choices.length-1&&(i+=" choice-option-open"),_o("div",{className:i,children:[_o("input",{type:y,id:"surveyQuestion".concat(r,"Choice").concat(n),name:"question".concat(r),value:o,disabled:!o,onInput:function(){return t.hasOpenChoice&&n===t.choices.length-1?v(!h):t.type===Ur.SingleChoice?c(o):t.type===Ur.MultipleChoice&&Ht(l)?l.includes(o)?c(l.filter((function(e){return e!==o}))):c([].concat(f(l),[o])):void 0}}),_o("label",{htmlFor:"surveyQuestion".concat(r,"Choice").concat(n),style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?_o(ai,{children:[_o("span",{children:[a,":"]}),_o("input",{type:"text",id:"surveyQuestion".concat(r,"Choice").concat(n,"Open"),name:"question".concat(r),onInput:function(e){var n=e.currentTarget.value;return t.type===Ur.SingleChoice?c(n):t.type===Ur.MultipleChoice&&Ht(l)?_(n):void 0}})]}):a}),_o("span",{className:"choice-check",style:{color:"black"},children:xo})]})}))}),_o(To,{text:t.buttonText||"Submit",submitDisabled:(Zt(l)||Ht(l)&&!h&&0===l.length||Ht(l)&&h&&!m&&0===l.length&&!t.optional)&&!t.optional,appearance:i,onSubmit:function(){h&&t.type===Ur.MultipleChoice?Ht(l)&&o([].concat(f(l),[m])):o(l)}})]})}var qo=[ko,bo,yo],Bo=[wo,ko,bo,yo,Co],Ho=[1,2,3,4,5],$o=[1,2,3,4,5,6,7],Uo=[0,1,2,3,4,5,6,7,8,9,10];function Wo(e){switch(e){case 5:default:return Ho;case 7:return $o;case 10:return Uo}}var Vo=en,Go=sn,jo=function(){function e(t){var n=this;a(this,e),l(this,"canShowNextEventBasedSurvey",(function(){var e,t=Go.querySelectorAll("div[class^=PostHogSurvey]");return!(t.length>0)||1===(null===(e=t[t.length-1].shadowRoot)||void 0===e?void 0:e.childElementCount)})),l(this,"handlePopoverSurvey",(function(e){var t,r=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,i=localStorage.getItem("lastSeenSurveyDate");if(r&&i){var o=new Date,a=Math.abs(o.getTime()-new Date(i).getTime());if(Math.ceil(a/864e5)<r)return}var s=function(e){return!!localStorage.getItem(Hi(e))&&!Bi(e)}(e);if(!s){n.addSurveyToFocus(e.id);var u=function(e,t,n){var r=Ti.createElement("div");r.className="PostHogSurvey".concat(t);var i=r.attachShadow({mode:"open"});if(e){var o=Object.assign(Ti.createElement("style"),{innerText:e});i.appendChild(o)}return(n||Ti.body).appendChild(r),i}(Ai(null==e?void 0:e.appearance),e.id);Si(_o(Zo,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!0},"popover-survey"),u)}})),l(this,"handleWidget",(function(e){var t=function(e){var t,n=Vi.createElement("div");n.className="PostHogWidget".concat(e.id);var r,i=n.attachShadow({mode:"open"}),o=(r=null===(t=e.appearance)||void 0===t?void 0:t.widgetColor,"\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ".concat(r||"#e0a045",";\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n "));return i.append(Object.assign(Vi.createElement("style"),{innerText:o})),Vi.body.appendChild(n),i}(e),r=Ai(e.appearance);t.appendChild(Object.assign(Go.createElement("style"),{innerText:r})),Si(_o(Qo,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus},"feedback-survey"),t)})),l(this,"handleWidgetSelector",(function(e){var t,r=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&Go.querySelector(e.appearance.widgetSelector);if(r)if(0===Go.querySelectorAll(".PostHogWidget".concat(e.id)).length)n.handleWidget(e);else if(1===Go.querySelectorAll(".PostHogWidget".concat(e.id)).length&&!r.getAttribute("PHWidgetSurveyClickListener")){var i,o,a=null===(i=Go.querySelector(".PostHogWidget".concat(e.id)))||void 0===i||null===(o=i.shadowRoot)||void 0===o?void 0:o.querySelector(".survey-form");r.addEventListener("click",(function(){a&&(a.style.display="none"===a.style.display?"block":"none",a.addEventListener("PHSurveyClosed",(function(){n.removeSurveyFromFocus(e.id),a.style.display="none"})))})),r.setAttribute("PHWidgetSurveyClickListener","true")}})),l(this,"canRenderSurvey",(function(e){var t={visible:!1};return e.end_date?(t.disabledReason="survey was completed on ".concat(e.end_date),t):e.type!=$r.Popover?(t.disabledReason="Only Popover survey types can be rendered",t):!e.linked_flag_key||n.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)?!e.targeting_flag_key||n.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)?!e.internal_targeting_flag_key||n.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason="internal targeting feature flag ".concat(e.internal_targeting_flag_key," is false"),t):(t.disabledReason="targeting feature flag ".concat(e.targeting_flag_key," is false"),t):(t.disabledReason="linked feature flag ".concat(e.linked_flag_key," is false"),t)})),l(this,"renderSurvey",(function(e,t){Si(_o(Zo,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)})),l(this,"callSurveysAndEvaluateDisplayLogic",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=n.posthog)||void 0===e||e.getActiveMatchingSurveys((function(e){var t=e.filter((function(e){return"api"!==e.type}));n.sortSurveysByAppearanceDelay(t).forEach((function(e){if(Zt(n.surveyInFocus)){var t,r,i;if(e.type===$r.Widget)"tab"===(null===(t=e.appearance)||void 0===t?void 0:t.widgetType)&&0===Go.querySelectorAll(".PostHogWidget".concat(e.id)).length&&n.handleWidget(e),"selector"===(null===(r=e.appearance)||void 0===r?void 0:r.widgetType)&&null!==(i=e.appearance)&&void 0!==i&&i.widgetSelector&&n.handleWidgetSelector(e);e.type===$r.Popover&&n.canShowNextEventBasedSurvey()&&n.handlePopoverSurvey(e)}}))}),t)})),l(this,"addSurveyToFocus",(function(e){Zt(n.surveyInFocus)||vn.error("Survey ".concat(f(n.surveyInFocus)," already in focus. Cannot add survey ").concat(e,".")),n.surveyInFocus=e})),l(this,"removeSurveyFromFocus",(function(e){n.surveyInFocus!==e&&vn.error("Survey ".concat(e," is not in focus. Cannot remove survey ").concat(e,".")),n.surveyInFocus=null})),this.posthog=t,this.surveyInFocus=null}return u(e,[{key:"sortSurveysByAppearanceDelay",value:function(e){return e.sort((function(e,t){var n,r;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(r=t.appearance)||void 0===r?void 0:r.surveyPopupDelaySeconds)||0)}))}},{key:"getTestAPI",value:function(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}]),e}();function Zo(e){var n,r,i,o,a,s,u=e.survey,l=e.forceDisableHtml,c=e.posthog,f=e.style,p=e.previewPageIndex,h=e.removeSurveyFromFocus,v=e.isPopup,g=Number.isInteger(p),m=null!==(n=u.appearance)&&void 0!==n&&n.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,_=function(e,t,n,r,i){var o=d(io(r||0===n),2),a=o[0],s=o[1],u=d(io(!1),2),l=u[0],c=u[1];return oo((function(){if(!r&&t){var o,a=function(){i(e.id),s(!1)},u=function(){var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(c(!0),i(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((function(){s(!1)}),5e3)):(i(e.id),s(!1))},l=function(){var n;s(!0),Vo.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return Vo.addEventListener("PHSurveyClosed",a),Vo.addEventListener("PHSurveySent",u),n>0?(o=setTimeout((function(){l()}),n),function(){clearTimeout(o),Vo.removeEventListener("PHSurveyClosed",a),Vo.removeEventListener("PHSurveySent",u)}):(l(),function(){Vo.removeEventListener("PHSurveyClosed",a),Vo.removeEventListener("PHSurveySent",u)})}}),[]),{isPopupVisible:a,isSurveySent:l,setIsPopupVisible:s}}(u,c,m,g,h),y=_.isPopupVisible,b=_.isSurveySent,k=_.setIsPopupVisible,w=b||p===u.questions.length,C=null!==(r=f)&&void 0!==r&&r.left&&Qt(null===(i=f)||void 0===i?void 0:i.left)?{left:f.left-40}:{};return g&&((f=f||{}).left="unset",f.right="unset",f.transform="unset"),y?_o(Ui.Provider,{value:{isPreviewMode:g,previewPageIndex:p,handleCloseSurveyPopup:function(){return Li(u,c,g)},isPopup:v||!1},children:w?_o(Ro,{header:(null===(o=u.appearance)||void 0===o?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null===(a=u.appearance)||void 0===a?void 0:a.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null===(s=u.appearance)||void 0===s?void 0:s.thankYouMessageDescriptionContentType,appearance:u.appearance||Fi,styleOverrides:t(t({},f),C),onClose:function(){return k(!1)}}):_o(zo,{survey:u,forceDisableHtml:!!l,posthog:c,styleOverrides:f})}):_o(ai,{})}function zo(e){var n,r,i=e.survey,o=e.forceDisableHtml,a=e.posthog,s=e.styleOverrides,u=Ri((null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||Fi.backgroundColor),c=d(io({}),2),f=c[0],p=c[1],h=uo(Ui),v=h.isPreviewMode,g=h.previewPageIndex,m=h.handleCloseSurveyPopup,_=h.isPopup,y=d(io(g||0),2),b=y[0],k=y[1],w=so((function(){return qi(i)}),[i]);oo((function(){k(null!=g?g:0)}),[g]);return _o("form",{className:"survey-form",style:_?t({color:u,borderColor:null===(r=i.appearance)||void 0===r?void 0:r.borderColor},s):{},children:w.map((function(e,n){var r,s=e.originalQuestionIndex;return(v?b===s:b===n)&&_o("div",{className:"survey-box",style:_?{backgroundColor:(null===(r=i.appearance)||void 0===r?void 0:r.backgroundColor)||Fi.backgroundColor}:{},children:[_&&_o(Mo,{onClick:function(){return m()}}),Ko({question:e,forceDisableHtml:o,displayQuestionIndex:n,appearance:i.appearance||Fi,onSubmit:function(e){return function(e){var n=e.res,r=e.originalQuestionIndex,o=e.displayQuestionIndex;if(a){var s=0===r?"$survey_response":"$survey_response_".concat(r);if(p(t(t({},f),{},l({},s,n))),a.getNextSurveyStep){var u=a.getNextSurveyStep(i,o,n);u===Wr.End?Ni(t(t({},f),{},l({},s,n)),i,a):k(u)}else o===i.questions.length-1?Ni(t(t({},f),{},l({},s,n)),i,a):k(o+1)}}({res:e,originalQuestionIndex:s,displayQuestionIndex:n})}})]})}))})}function Qo(e){var t,n,r=e.survey,i=e.forceDisableHtml,o=e.posthog,a=e.readOnly,s=e.removeSurveyFromFocus,u=d(io(!1),2),l=u[0],c=u[1],f=d(io({}),2),p=f[0],h=f[1],v=ao(null);return oo((function(){var e,t;if(!a&&o){if("tab"===(null===(e=r.appearance)||void 0===e?void 0:e.widgetType)&&v.current){var n,i=v.current.getBoundingClientRect(),s={top:"50%",left:parseInt("".concat(i.right-360)),bottom:"auto",borderRadius:10,borderBottom:"1.5px solid ".concat((null===(n=r.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6")};h(s)}if("selector"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)){var u=Go.querySelector(r.appearance.widgetSelector||"");null==u||u.addEventListener("click",(function(){c(!l)})),null==u||u.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),_o(ai,{children:["tab"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)&&_o("div",{className:"ph-survey-widget-tab",ref:v,onClick:function(){return!a&&c(!l)},style:{color:Ri(r.appearance.widgetColor)},children:[_o("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=r.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&_o(Zo,{posthog:o,survey:r,forceDisableHtml:i,style:p,removeSurveyFromFocus:s,isPopup:!0},"feedback-widget-survey")]})}var Ko=function(e){var n,r,i=e.question,o=e.forceDisableHtml,a=e.displayQuestionIndex,s=e.appearance,u=e.onSubmit,c=(l(n={},Ur.Open,Oo),l(n,Ur.Link,No),l(n,Ur.Rating,Lo),l(n,Ur.SingleChoice,Do),l(n,Ur.MultipleChoice,Do),n),d={question:i,forceDisableHtml:o,appearance:s,onSubmit:u},f=(l(r={},Ur.Open,{}),l(r,Ur.Link,{}),l(r,Ur.Rating,{displayQuestionIndex:a}),l(r,Ur.SingleChoice,{displayQuestionIndex:a}),l(r,Ur.MultipleChoice,{displayQuestionIndex:a}),r),p=c[i.type],h=t(t({},d),f[i.type]);return _o(p,t({},h))};function Yo(e){return!Vt(Event)&&Jo(e,Event)}function Jo(e,t){try{return e instanceof t}catch(e){return!1}}function Xo(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function ea(e){return Xo(e,"DOMError")}en&&(en.__PosthogExtensions__=en.__PosthogExtensions__||{},en.__PosthogExtensions__.canActivateRepeatedly=Bi,en.extendPostHogWithSurveys=function(e){if(Go&&Vo){var t=new jo(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((function(){t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}});var ta=/\(error: (.*)\)/,na=50,ra="?";function ia(e,t,n,r){var i={filename:e,function:t,in_app:!0};return Vt(n)||(i.lineno=n),Vt(r)||(i.colno=r),i}var oa=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,aa=/\((\S*)(?::(\d+))(?::(\d+))\)/,sa=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ua=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,la=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var ca,da=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n.sort((function(e,t){return e[0]-t[0]})).map((function(e){return e[1]}));return function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],o=e.split("\n"),a=n;a<o.length;a++){var s=o[a];if(!(s.length>1024)){var u=ta.test(s)?s.replace(ta,"$1"):s;if(!u.match(/\S*Error: /)){var l,c=v(i);try{for(c.s();!(l=c.n()).done;){var d=(0,l.value)(u);if(d){r.push(d);break}}}catch(e){c.e(e)}finally{c.f()}if(r.length>=na)break}}}return function(e){if(!e.length)return[];var n=e.slice(0,na);return n.reverse(),n.map((function(e){return t(t({},e),{},{filename:e.filename||n[n.length-1].filename,function:e.function||"?"})}))}(r)}}.apply(void 0,[[30,function(e){var t=oa.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){var n=aa.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}var r=d(fa(t[1]||ra,t[2]),2),i=r[0];return ia(r[1],i,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,function(e){var t=sa.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=ua.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],i=t[1]||ra,o=d(fa(i,r),2);return i=o[0],ia(r=o[1],i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],[40,function(e){var t=la.exec(e);return t?ia(t[2],t[1]||ra,+t[3],t[4]?+t[4]:void 0):void 0}]]),fa=function(e,t){var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:ra,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]};!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(ca||(ca={}));var pa=["fatal","error","warning","log","info","debug"],ha=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,va=/Minified React error #\d+;/i;function ga(e){var t=e.stacktrace||e.stack||"",n=function(e){if(e){if(Qt(e.framesToPop))return e.framesToPop;if(va.test(e.message))return 1}return 0}(e);try{return da(t,n)}catch(e){}return[]}function ma(e){var t=ga(e);return{$exception_type:e.name,$exception_message:e.message,$exception_stack_trace_raw:JSON.stringify(t),$exception_level:"error"}}function _a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>t))return r===n.length||i.length<=t?i:"".concat(i.slice(0,t),"...")}return""}function ya(e){return Gt(e)&&!jt(e)&&pa.indexOf(e)>=0}function ba(e){var n=d(e,5),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u={};if(Vt(s)&&Gt(r)){var l="Error",c=r,f=r.match(ha);f&&(l=f[1],c=f[2]),u={$exception_type:l,$exception_message:c}}var p=s||r;if(ea(p)||function(e){return Xo(e,"DOMException")}(p)){var h=p;if(function(e){return"stack"in e}(p))u=ma(p);else{var v=h.name||(ea(h)?"DOMError":"DOMException"),g=h.message?"".concat(v,": ").concat(h.message):v;u=function(e){return{$exception_type:"Error",$exception_message:e,$exception_level:"error"}}(g),u.$exception_type=ea(h)?"DOMError":"DOMException",u.$exception_message=u.$exception_message||g}"code"in h&&(u.$exception_DOMException_code="".concat(h.code))}else if(function(e){return Xo(e,"ErrorEvent")}(p)&&p.error)u=ma(p.error);else if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Jo(e,Error)}}(p))u=ma(p);else if(function(e){return Xo(e,"Object")}(p)||Yo(p)){u=function(e){return{$exception_type:Yo(e)?e.constructor.name:"Error",$exception_message:"Non-Error ".concat("exception"," captured with keys: ",_a(e)),$exception_level:ya(e.level)?e.level:"error"}}(p),u.$exception_is_synthetic=!0}else u.$exception_type=u.$exception_type||"Error",u.$exception_message=u.$exception_message||p,u.$exception_is_synthetic=!0;return t(t(t(t({},u),{},{$exception_type:u.$exception_type||"UnknownErrorType",$exception_message:u.$exception_message||"",$exception_level:ya(u.$exception_level)?u.$exception_level:"error"},i?{$exception_source:i}:{}),o?{$exception_lineno:o}:{}),a?{$exception_colno:a}:{})}function ka(e){var n=d(e,1)[0],r=n;try{"reason"in n?r=n.reason:"detail"in n&&"reason"in n.detail&&(r=n.detail.reason)}catch(e){}var i,o={};return(o=Zt(i=r)||!Ut(i)&&!$t(i)?{$exception_message:"Non-Error promise rejection captured with value: ".concat(String(r))}:ba([r])).$exception_handled=!1,t(t({},o),{},{$exception_type:o.$exception_type="UnhandledRejection",$exception_message:o.$exception_message=o.$exception_message||n.reason||String(r),$exception_level:ya(o.$exception_level)?o.$exception_level:"error"})}var wa={wrapOnError:function(e){var t=en;t||vn.info("window not available, cannot wrap onerror");var n=t.onerror;return t.onerror=function(){for(var t,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=ba(i);return e(a),null!==(t=null==n?void 0:n.apply(void 0,i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:function(e){var t=en;t||vn.info("window not available, cannot wrap onUnhandledRejection");var n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=ka(o);return e(s),null!==(r=null==n?void 0:n.apply(t,o))&&void 0!==r&&r},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};en&&(en.posthogErrorWrappingFunctions=wa);var Ca=function(e,t){var n=e.checkAndGetSessionAndWindowId(!0),r=n.sessionId,i=n.windowId;t.headers.set("X-POSTHOG-SESSION-ID",r),t.headers.set("X-POSTHOG-WINDOW-ID",i)};pn&&(pn.postHogTracingHeadersPatchFns={_patchFetch:function(e){return yr(en,"fetch",(function(t){return function(){var r=o(n().mark((function r(i,o){var a;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=new Request(i,o),Ca(e,a),n.abrupt("return",t(a));case 3:case"end":return n.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}()}))},_patchXHR:function(e){return yr(en.XMLHttpRequest.prototype,"open",(function(t){return function(n,r){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,s=new Request(r);return Ca(e,s),t.call(this,n,s.url,i,o,a)}}))}});var Ia,Sa=-1,xa=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Sa=t.timeStamp,e(t))}),!0)},Ea=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Ta=function(){var e=Ea();return e&&e.activationStart||0},Aa=function(e,t){var n=Ea(),r="navigate";return Sa>=0?r="back-forward-cache":n&&(document.prerendering||Ta()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Ma=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Ra=function(e,t,n,r){var i,o;return function(a){t.value>=0&&(a||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Fa=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Oa=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Na=function(e){var t=!1;return function(){t||(e(),t=!0)}},La=-1,Pa=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Da=function(e){"hidden"===document.visibilityState&&La>-1&&(La="visibilitychange"===e.type?e.timeStamp:0,Ba())},qa=function(){addEventListener("visibilitychange",Da,!0),addEventListener("prerenderingchange",Da,!0)},Ba=function(){removeEventListener("visibilitychange",Da,!0),removeEventListener("prerenderingchange",Da,!0)},Ha=function(){return La<0&&(La=Pa(),qa(),xa((function(){setTimeout((function(){La=Pa(),qa()}),0)}))),{get firstHiddenTime(){return La}}},$a=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Ua=[1800,3e3],Wa=function(e,t){t=t||{},$a((function(){var n,r=Ha(),i=Aa("FCP"),o=Ma("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Ta(),0),i.entries.push(e),n(!0)))}))}));o&&(n=Ra(e,i,Ua,t.reportAllChanges),xa((function(r){i=Aa("FCP"),n=Ra(e,i,Ua,t.reportAllChanges),Fa((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},Va=[.1,.25],Ga=0,ja=1/0,Za=0,za=function(e){e.forEach((function(e){e.interactionId&&(ja=Math.min(ja,e.interactionId),Za=Math.max(Za,e.interactionId),Ga=Za?(Za-ja)/7+1:0)}))},Qa=function(){"interactionCount"in performance||Ia||(Ia=Ma("event",za,{type:"event",buffered:!0,durationThreshold:0}))},Ka=[],Ya=new Map,Ja=0,Xa=function(){return(Ia?Ga:performance.interactionCount||0)-Ja},es=[],ts=function(e){if(es.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Ka[Ka.length-1],n=Ya.get(e.interactionId);if(n||Ka.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};Ya.set(r.id,r),Ka.push(r)}Ka.sort((function(e,t){return t.latency-e.latency})),Ka.length>10&&Ka.splice(10).forEach((function(e){return Ya.delete(e.id)}))}}},ns=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Na(e),"hidden"===document.visibilityState?e():(n=t(e),Oa(e)),n},rs=[200,500],is=[2500,4e3],os={},as={onLCP:function(e,t){t=t||{},$a((function(){var n,r=Ha(),i=Aa("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Ta(),0),i.entries=[e],n())}))},a=Ma("largest-contentful-paint",o);if(a){n=Ra(e,i,is,t.reportAllChanges);var s=Na((function(){os[i.id]||(o(a.takeRecords()),a.disconnect(),os[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return ns(s)}),!0)})),Oa(s),xa((function(r){i=Aa("LCP"),n=Ra(e,i,is,t.reportAllChanges),Fa((function(){i.value=performance.now()-r.timeStamp,os[i.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},Wa(Na((function(){var n,r=Aa("CLS",0),i=0,o=[],a=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,n())},s=Ma("layout-shift",a);s&&(n=Ra(e,r,Va,t.reportAllChanges),Oa((function(){a(s.takeRecords()),n(!0)})),xa((function(){i=0,r=Aa("CLS",0),n=Ra(e,r,Va,t.reportAllChanges),Fa((function(){return n()}))})),setTimeout(n,0))})))},onFCP:Wa,onINP:function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},$a((function(){var n;Qa();var r,i=Aa("INP"),o=function(e){ns((function(){e.forEach(ts);var t,n=(t=Math.min(Ka.length-1,Math.floor(Xa()/50)),Ka[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},a=Ma("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=Ra(e,i,rs,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),Oa((function(){o(a.takeRecords()),r(!0)})),xa((function(){Ja=0,Ka.length=0,Ya.clear(),i=Aa("INP"),r=Ra(e,i,rs,t.reportAllChanges)})))})))}};pn.postHogWebVitalsCallbacks=as;var ss="$people_distinct_id",us="__alias",ls="__timers",cs="$autocapture_disabled_server_side",ds="$heatmaps_enabled_server_side",fs="$exception_capture_enabled_server_side",ps="$exception_capture_endpoint",hs="$web_vitals_enabled_server_side",vs="$session_recording_enabled_server_side",gs="$console_log_recording_enabled_server_side",ms="$session_recording_network_payload_capture",_s="$session_recording_canvas_recording",ys="$replay_sample_rate",bs="$replay_minimum_duration",ks="$sesid",ws="$session_is_sampled",Cs="$enabled_feature_flags",Is="$early_access_features",Ss="$stored_person_properties",xs="$stored_group_properties",Es="$surveys",Ts="$surveys_activated",As="$flag_call_reported",Ms="$user_state",Rs="$client_session_props",Fs="$capture_rate_limit",Os="$initial_campaign_params",Ns="$initial_referrer_info",Ls="$initial_person_info",Ps="$epp",Ds="__POSTHOG_TOOLBAR__",qs=[ss,us,"__cmpns",ls,vs,ds,ks,Cs,Ms,Is,xs,Ss,Es,As,Rs,Fs,Os,Ns,Ps],Bs="$active_feature_flags",Hs="$override_feature_flags",$s="$feature_flag_payloads",Us=function(e){var t,n={},r=v(wn(e||{}));try{for(r.s();!(t=r.n()).done;){var i=d(t.value,2),o=i[0],a=i[1];a&&(n[o]=a)}}catch(e){r.e(e)}finally{r.f()}return n},Ws=function(){function e(t){a(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return u(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Cs),t=this.instance.get_property(Hs);if(!t)return e||{};for(var n=bn({},e),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||(vn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property($s)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property(Ss),r=this.instance.get_property(xs),i={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:this.instance.config.disable_compression?void 0:ca.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){var n;e.setReloadingPaused(!1);var r=!0;200===t.statusCode&&(e.$anon_distinct_id=void 0,r=!1),e.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},r),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(As)||{};if(t.send_event||!("send_event"in t))if(!(e in o)||!o[e].includes(i))Ht(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register(l({},As,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r});return r}vn.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);vn.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e,n){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=e.featureFlags,s=e.featureFlagPayloads;if(a)if(Ht(a)){var u,c={};if(a)for(var d=0;d<a.length;d++)c[a[d]]=!0;n&&n.register((l(u={},Bs,a),l(u,Cs,c),u))}else{var f=a,p=s;e.errorsWhileComputingFlags&&(f=t(t({},i),f),p=t(t({},o),p)),n&&n.register((l(r={},Bs,Object.keys(Us(f))),l(r,Cs,f||{}),l(r,$s,p||{}),r))}}(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks(n)}}},{key:"override",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return vn.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(Hs);else if(Ht(e)){for(var n={},r=0;r<e.length;r++)n[e[r]]=!0;this.instance.persistence.register(l({},Hs,n))}else this.instance.persistence.register(l({},Hs,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,n){var r,i,o=l({},"$feature_enrollment/".concat(e),n);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:n,$set:o}),this.setPersonPropertiesForFlags(o,!1);var a=t(t({},this.getFlagVariants()),{},l({},e,n));null===(r=this.instance.persistence)||void 0===r||r.register((l(i={},Bs,Object.keys(Us(a))),l(i,Cs,a),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Is);if(r&&!n)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(n){var r;if(n.json){var i=n.json.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(l({},Is,i)),e(i)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach((function(t){return t(n,r,{errorsLoading:e})}))}},{key:"setPersonPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(Ss)||{};this.instance.register(l({},Ss,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Ss)}},{key:"setGroupPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(xs)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((function(n){r[n]=t(t({},r[n]),e[n]),delete e[n]})),this.instance.register(l({},xs,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var n=this.instance.get_property(xs)||{};this.instance.register(l({},xs,t(t({},n),{},l({},e,{}))))}else this.instance.unregister(xs)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Qt(e)&&isFinite(e)&&Math.floor(e)===e});var Vs="0123456789abcdef",Gs=function(){function e(t){if(a(this,e),this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}return u(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Vs.charAt(this.bytes[t]>>>4)+Vs.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}}]),e}(),js=function(){function e(){a(this,e),l(this,"timestamp",0),l(this,"counter",0),l(this,"random",new Qs)}return u(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(Vt(e)){this.timestamp=0;var t=this.generateOrAbort();if(Vt(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Gs.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),Zs=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};en&&!Vt(en.crypto)&&crypto.getRandomValues&&(Zs=function(e){return crypto.getRandomValues(e)});var zs,Qs=function(){function e(){a(this,e),l(this,"buffer",new Uint32Array(8)),l(this,"cursor",1/0)}return u(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(Zs(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),Ks=function(){return Ys().toString()},Ys=function(){return(zs||(zs=new js)).generate()},Js="Thu, 01 Jan 1970 00:00:00 GMT",Xs="";var eu=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function tu(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sn;if(Xs)return Xs;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+Ks(),o=new RegExp("(^|;)\\s*"+i+"=1");!Xs&&r--;){var a=n.slice(r).join("."),s=i+"=1;domain=."+a;t.cookie=s,o.test(t.cookie)&&(t.cookie=s+";expires="+Js,Xs=a)}return Xs}(e);if(!n){var r=function(e){var t=e.match(eu);return t?t[0]:""}(e);r!==n&&vn.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var nu,ru={is_supported:function(){return!!sn},error:function(e){vn.error("cookieStore error: "+e)},get:function(e){if(sn){try{for(var t=e+"=",n=sn.cookie.split(";").filter((function(e){return e.length})),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(ru.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(sn)try{var o="",a="",s=tu(sn.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),o="; expires="+u.toUTCString()}i&&(a="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+s+a;return l.length>3686.4&&vn.warn("cookieStore warning: large cookie, len="+l.length),sn.cookie=l,l}catch(e){return}},remove:function(e,t){try{ru.set(e,"",-1,t)}catch(e){return}}},iu=null,ou={is_supported:function(){if(!Zt(iu))return iu;var e=!0;if(Vt(en))e=!1;else try{var t="__mplssupport__";ou.set(t,"xyz"),'"xyz"'!==ou.get(t)&&(e=!1),ou.remove(t)}catch(t){e=!1}return e||vn.error("localStorage unsupported; falling back to cookie store"),iu=e,e},error:function(e){vn.error("localStorage error: "+e)},get:function(e){try{return null==en?void 0:en.localStorage.getItem(e)}catch(e){ou.error(e)}return null},parse:function(e){try{return JSON.parse(ou.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==en||en.localStorage.setItem(e,JSON.stringify(t))}catch(e){ou.error(e)}},remove:function(e){try{null==en||en.localStorage.removeItem(e)}catch(e){ou.error(e)}}},au=["distinct_id",ks,ws,Ps],su=t(t({},ou),{},{parse:function(e){try{var t={};try{t=ru.parse(e)||{}}catch(e){}var n=bn(t,JSON.parse(ou.get(e)||"{}"));return ou.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i,o){try{ou.set(e,t,void 0,void 0,o);var a={};au.forEach((function(e){t[e]&&(a[e]=t[e])})),Object.keys(a).length&&ru.set(e,a,n,r,i,o)}catch(e){ou.error(e)}},remove:function(e,t){try{null==en||en.localStorage.removeItem(e),ru.remove(e,t)}catch(e){ou.error(e)}}}),uu={},lu={is_supported:function(){return!0},error:function(e){vn.error("memoryStorage error: "+e)},get:function(e){return uu[e]||null},parse:function(e){return uu[e]||null},set:function(e,t){uu[e]=t},remove:function(e){delete uu[e]}},cu=null,du={is_supported:function(){if(!Zt(cu))return cu;if(cu=!0,Vt(en))cu=!1;else try{var e="__support__";du.set(e,"xyz"),'"xyz"'!==du.get(e)&&(cu=!1),du.remove(e)}catch(e){cu=!1}return cu},error:function(e){vn.error("sessionStorage error: ",e)},get:function(e){try{return null==en?void 0:en.sessionStorage.getItem(e)}catch(e){du.error(e)}return null},parse:function(e){try{return JSON.parse(du.get(e))||null}catch(e){}return null},set:function(e,t){try{null==en||en.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){du.error(e)}},remove:function(e){try{null==en||en.sessionStorage.removeItem(e)}catch(e){du.error(e)}}},fu="Mobile",pu="iOS",hu="Android",vu="Tablet",gu=hu+" "+vu,mu="iPad",_u="Apple",yu=_u+" Watch",bu="Safari",ku="BlackBerry",wu="Samsung",Cu=wu+"Browser",Iu=wu+" Internet",Su="Chrome",xu=Su+" OS",Eu=Su+" "+pu,Tu="Internet Explorer",Au=Tu+" "+fu,Mu="Opera",Ru=Mu+" Mini",Fu="Edge",Ou="Microsoft "+Fu,Nu="Firefox",Lu=Nu+" "+pu,Pu="Nintendo",Du="PlayStation",qu="Xbox",Bu=hu+" "+fu,Hu=fu+" "+bu,$u="Windows",Uu=$u+" Phone",Wu="Nokia",Vu="Ouya",Gu="Generic",ju=Gu+" "+fu.toLowerCase(),Zu=Gu+" "+vu.toLowerCase(),zu="Konqueror",Qu="(\\d+(\\.\\d+)?)",Ku=new RegExp("Version/"+Qu),Yu=new RegExp(qu,"i"),Ju=new RegExp(Du+" \\w+","i"),Xu=new RegExp(Pu+" \\w+","i"),el=new RegExp(ku+"|PlayBook|BB10","i"),tl={"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"};var nl=function(e,t){return t&&kn(t,_u)||function(e){return kn(e,bu)&&!kn(e,Su)&&!kn(e,hu)}(e)},rl=function(e,t){return t=t||"",kn(e," OPR/")&&kn(e,"Mini")?Ru:kn(e," OPR/")?Mu:el.test(e)?ku:kn(e,"IE"+fu)||kn(e,"WPDesktop")?Au:kn(e,Cu)?Iu:kn(e,Fu)||kn(e,"Edg/")?Ou:kn(e,"FBIOS")?"Facebook "+fu:kn(e,"UCWEB")||kn(e,"UCBrowser")?"UC Browser":kn(e,"CriOS")?Eu:kn(e,"CrMo")?Su:kn(e,hu)&&kn(e,bu)?Bu:kn(e,Su)?Su:kn(e,"FxiOS")?Lu:kn(e.toLowerCase(),zu.toLowerCase())?zu:nl(e,t)?kn(e,fu)?Hu:bu:kn(e,Nu)?Nu:kn(e,"MSIE")||kn(e,"Trident/")?Tu:kn(e,"Gecko")?Nu:""},il=(l(nu={},Au,[new RegExp("rv:"+Qu)]),l(nu,Ou,[new RegExp(Fu+"?\\/"+Qu)]),l(nu,Su,[new RegExp("("+Su+"|CrMo)\\/"+Qu)]),l(nu,Eu,[new RegExp("CriOS\\/"+Qu)]),l(nu,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+Qu)]),l(nu,bu,[Ku]),l(nu,Hu,[Ku]),l(nu,Mu,[new RegExp("(Opera|OPR)\\/"+Qu)]),l(nu,Nu,[new RegExp(Nu+"\\/"+Qu)]),l(nu,Lu,[new RegExp("FxiOS\\/"+Qu)]),l(nu,zu,[new RegExp("Konqueror[:/]?"+Qu,"i")]),l(nu,ku,[new RegExp(ku+" "+Qu),Ku]),l(nu,Bu,[new RegExp("android\\s"+Qu,"i")]),l(nu,Iu,[new RegExp(Cu+"\\/"+Qu)]),l(nu,Tu,[new RegExp("(rv:|MSIE )"+Qu)]),l(nu,"Mozilla",[new RegExp("rv:"+Qu)]),nu),ol=[[new RegExp(qu+"; "+qu+" (.*?)[);]","i"),function(e){return[qu,e&&e[1]||""]}],[new RegExp(Pu,"i"),[Pu,""]],[new RegExp(Du,"i"),[Du,""]],[el,[ku,""]],[new RegExp($u,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[Uu,""];if(new RegExp(fu).test(t)&&!/IEMobile\b/.test(t))return[$u+" "+fu,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=tl[r]||"";return/arm/i.test(t)&&(i="RT"),[$u,i]}return[$u,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[pu,t.join(".")]}return[pu,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=Vt(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+hu+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+hu+")","i"),function(e){if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[hu,t.join(".")]}return[hu,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[xu,""]],[/Linux|debian/i,["Linux",""]]],al=function(e){return Xu.test(e)?Pu:Ju.test(e)?Du:Yu.test(e)?qu:new RegExp(Vu,"i").test(e)?Vu:new RegExp("("+Uu+"|WPDesktop)","i").test(e)?Uu:/iPad/.test(e)?mu:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?yu:el.test(e)?ku:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Wu,"i").test(e)?Wu:/(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(fu).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)?hu:gu:hu:new RegExp("(pda|"+fu+")","i").test(e)?ju:new RegExp(vu,"i").test(e)&&!new RegExp(vu+" pc","i").test(e)?Zu:""},sl="https?://(.*)",ul=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],ll={campaignParams:function(e){return sn?this._campaignParamsFromUrl(sn.URL,e):{}},_campaignParamsFromUrl:function(e,t){var n=ul.concat(t||[]),r={};return yn(n,(function(t){var n=Pn(e,t);n&&(r[t]=n)})),r},_searchEngine:function(e){return e?0===e.search(sl+"google.([^/?]*)")?"google":0===e.search(sl+"bing.com")?"bing":0===e.search(sl+"yahoo.com")?"yahoo":0===e.search(sl+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=ll._searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(!Zt(t)){r.$search_engine=t;var i=sn?Pn(sn.referrer,n):"";i.length&&(r.ph_keyword=i)}return r},searchInfo:function(){var e=null==sn?void 0:sn.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:rl,browserVersion:function(e,t){var n=rl(e,t),r=il[n];if(Vt(r))return null;for(var i=0;i<r.length;i++){var o=r[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(var t=0;t<ol.length;t++){var n=d(ol[t],2),r=n[0],i=n[1],o=r.exec(e),a=o&&($t(i)?i(o,e):i);if(a)return a}return["",""]},device:al,deviceType:function(e){var t=al(e);return t===mu||t===gu||"Kobo"===t||"Kindle Fire"===t||t===Zu?vu:t===Pu||t===qu||t===Du||t===Vu?"Console":t===yu?"Wearable":t?fu:"Desktop"},referrer:function(){return(null==sn?void 0:sn.referrer)||"$direct"},referringDomain:function(){var e;return null!=sn&&sn.referrer&&(null===(e=On(sn.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:null==un?void 0:un.href}},initialPersonPropsFromInfo:function(e){var t,n=e.r,r=e.u,i={$initial_referrer:n,$initial_referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(t=On(n))||void 0===t?void 0:t.host};if(r){i.$initial_current_url=r;var o=On(r);i.$initial_host=null==o?void 0:o.host,i.$initial_pathname=null==o?void 0:o.pathname,yn(this._campaignParamsFromUrl(r),(function(e,t){i["$initial_"+En(t)]=e}))}n&&yn(this._searchInfoFromReferrer(n),(function(e,t){i["$initial_"+En(t)]=e}));return i},properties:function(){if(!fn)return{};var e=d(ll.os(fn),2),t=e[0],n=e[1];return bn(xn({$os:t,$os_version:n,$browser:ll.browser(fn,navigator.vendor),$device:ll.device(fn),$device_type:ll.deviceType(fn)}),{$current_url:null==un?void 0:un.href,$host:null==un?void 0:un.host,$pathname:null==un?void 0:un.pathname,$raw_user_agent:fn.length>1e3?fn.substring(0,997)+"...":fn,$browser_version:ll.browserVersion(fn,navigator.vendor),$browser_language:ll.browserLanguage(),$screen_height:null==en?void 0:en.screen.height,$screen_width:null==en?void 0:en.screen.width,$viewport_height:null==en?void 0:en.innerHeight,$viewport_width:null==en?void 0:en.innerWidth,$lib:"web",$lib_version:Xt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Cn()/1e3})},people_properties:function(){if(!fn)return{};var e=d(ll.os(fn),2),t=e[0],n=e[1];return bn(xn({$os:t,$os_version:n,$browser:ll.browser(fn,navigator.vendor)}),{$browser_version:ll.browserVersion(fn,navigator.vendor)})}},cl=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],dl=function(){function e(n){a(this,e),this.config=n,this.props={},this.campaign_params_saved=!1,this.name=function(e){var 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"}(n),this.storage=this.buildStorage(n),this.load(),n.debug&&vn.info("Persistence loaded",n.persistence,t({},this.props)),this.update_config(n,n),this.save()}return u(e,[{key:"buildStorage",value:function(e){-1===cl.indexOf(e.persistence.toLowerCase())&&(vn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&ou.is_supported()?ou:"localstorage+cookie"===t&&su.is_supported()?su:"sessionstorage"===t&&du.is_supported()?du:"memory"===t?lu:"cookie"===t?ru:su.is_supported()?su:ru}},{key:"properties",value:function(){var e={};return yn(this.props,(function(t,n){if(n===Cs&&Ut(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/".concat(r[i])]=t[r[i]];else a=n,s=!1,(Zt(o=qs)?s:on&&o.indexOf===on?-1!=o.indexOf(a):(yn(o,(function(e){if(s||(s=e===a))return gn})),s))||(e[n]=t);var o,a,s})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=bn({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(Ut(e)){Vt(t)&&(t="None"),this.expire_days=Vt(n)?this.default_expiry:n;var i=!1;if(yn(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(Ut(e)){this.expire_days=Vt(t)?this.default_expiry:t;var r=!1;if(yn(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(ll.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(ll.searchInfo())}},{key:"update_referrer_info",value:function(){this.register_once(ll.referrerInfo(),void 0)}},{key:"set_initial_person_info",value:function(){this.props[Os]||this.props[Ns]||this.register_once(l({},Ls,ll.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return xn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};yn([Ns,Os],(function(n){var r=e.props[n];r&&yn(r,(function(e,n){t["$initial_"+En(n)]=e}))}));var n=this.props[Ls];if(n){var r=ll.initialPersonPropsFromInfo(n);bn(t,r)}return t}},{key:"safe_merge",value:function(e){return yn(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[ls]||{};n[e]=t,this.props[ls]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[ls]||{})[e];return Vt(t)||(delete this.props[ls][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),e}();function fl(e){return JSON.stringify(e,(t=[],function(e,n){if(Ut(n)){for(;t.length>0&&t.at(-1)!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n})).length;var t}var pl=2,hl=4;function vl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),i=e.data.slice(n);return[vl({size:fl(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),vl({size:fl(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((function(e){return e}))}return[e]}var gl,ml=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(ml||{}),_l=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(_l||{}),yl=u((function e(t){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),l(this,"bucketSize",100),l(this,"refillRate",10),l(this,"mutationBuckets",{}),l(this,"loggedTracker",{}),l(this,"refillBuckets",(function(){Object.keys(i.mutationBuckets).forEach((function(e){i.mutationBuckets[e]=i.mutationBuckets[e]+i.refillRate,i.mutationBuckets[e]>=i.bucketSize&&delete i.mutationBuckets[e]}))})),l(this,"getNodeOrRelevantParent",(function(e){var t=i.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[i.rrweb.mirror.getId(n),n]}return[e,t]})),l(this,"numberOfChanges",(function(e){var t,n,r,i,o,a,s,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(a=e.texts)||void 0===a?void 0:a.length)&&void 0!==o?o:0)+(null!==(s=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==s?s:0)})),l(this,"throttleMutations",(function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=i.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,r,o=d(i.getNodeOrRelevantParent(e.id),2),a=o[0],s=o[1];if(0===i.mutationBuckets[a])return!1;(i.mutationBuckets[a]=null!==(t=i.mutationBuckets[a])&&void 0!==t?t:i.bucketSize,i.mutationBuckets[a]=Math.max(i.mutationBuckets[a]-1,0),0===i.mutationBuckets[a])&&(i.loggedTracker[a]||(i.loggedTracker[a]=!0,null===(n=(r=i.options).onBlockedNode)||void 0===n||n.call(r,a,s)));return e})));var r=i.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=t,this.options=o,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,setInterval((function(){i.refillBuckets()}),1e3)})),bl=3e5,kl=[_l.MouseMove,_l.MouseInteraction,_l.Scroll,_l.ViewportResize,_l.Input,_l.TouchMove,_l.MediaInteraction,_l.Drag],wl=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}},Cl="[SessionRecording]",Il=function(){function e(t){var n=this;if(a(this,e),l(this,"queuedRRWebEvents",[]),l(this,"isIdle",!1),l(this,"_linkedFlagSeen",!1),l(this,"_lastActivityTimestamp",Date.now()),l(this,"_linkedFlag",null),l(this,"_forceAllowLocalhostNetworkCapture",!1),l(this,"_onBeforeUnload",(function(){n._flushBuffer()})),l(this,"_onOffline",(function(){n._tryAddCustomEvent("browser offline",{})})),l(this,"_onOnline",(function(){n._tryAddCustomEvent("browser online",{})})),l(this,"_onVisibilityChange",(function(){if(null!=sn&&sn.visibilityState){var e="window "+sn.visibilityState;n._tryAddCustomEvent(e,{})}})),l(this,"_samplingSessionListener",null),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw vn.error(Cl+" started without valid sessionManager"),new Error(Cl+" started without valid sessionManager. This is a bug.");var r=this.sessionManager.checkAndGetSessionAndWindowId(),i=r.sessionId,o=r.windowId;this.sessionId=i,this.windowId=o,this.buffer=this.clearBuffer(),this._setupSampling()}return u(e,[{key:"rrwebRecord",get:function(){var e;return null==pn||null===(e=pn.rrweb)||void 0===e?void 0:e.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw new Error(Cl+" must be started with a valid sessionManager.");return this.instance.sessionManager}},{key:"fullSnapshotIntervalMillis",get:function(){var e;return(null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.full_snapshot_interval_millis)||bl}},{key:"isSampled",get:function(){var e=this.instance.get_property(ws);return Kt(e)?e:null}},{key:"sessionDuration",get:function(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(vs),t=!this.instance.config.disable_session_recording;return en&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(gs),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(_s);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(ms),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),a=Ut(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,s=!!(Kt(a)?a:null==n?void 0:n.capturePerformance);return i||o||s?{recordHeaders:i,recordBody:o,recordPerformance:s}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(ys);return Qt(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(bs);return Qt(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?zt(this._linkedFlag)||this._linkedFlagSeen?Kt(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),null==en||en.addEventListener("beforeunload",this._onBeforeUnload),null==en||en.addEventListener("offline",this._onOffline),null==en||en.addEventListener("online",this._onOnline),null==en||en.addEventListener("visibilitychange",this._onVisibilityChange),vn.info(Cl+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==en||en.removeEventListener("beforeunload",this._onBeforeUnload),null==en||en.removeEventListener("offline",this._onOffline),null==en||en.removeEventListener("online",this._onOnline),null==en||en.removeEventListener("visibilitychange",this._onVisibilityChange),vn.info(Cl+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,n=this.sessionId!==e,r=this.sampleRate;if(Qt(r)){var i,o=this.isSampled,a=n||!Kt(o);if(a)i=Math.random()<r;else i=o;!i&&a&&vn.warn(Cl+" Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r}),null===(t=this.instance.persistence)||void 0===t||t.register(l({},ws,i))}else{var s;null===(s=this.instance.persistence)||void 0===s||s.register(l({},ws,null))}}},{key:"afterDecideResponse",value:function(e){var t,n,r,i=this;(this._persistDecideResponse(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint)&&(this._endpoint=null===(r=e.sessionRecording)||void 0===r?void 0:r.endpoint);if(this._setupSampling(),!zt(this._linkedFlag)&&!this._linkedFlagSeen){var o=Gt(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=Gt(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((function(e,t){var n=Ut(t)&&o in t,r=a?t[o]===a:n;if(r){var s={linkedFlag:o,linkedVariant:a},u="linked flag matched";vn.info(Cl+" "+u,s),i._tryAddCustomEvent(u,s)}i._linkedFlagSeen=r}))}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;Qt(this.sampleRate)&&Zt(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((function(t){e.makeSamplingDecision(t)})))}},{key:"_persistDecideResponse",value:function(e){if(this.instance.persistence){var n=this.instance.persistence,r=function(){var r,i,o,a,s,u,c,d,f=null===(r=e.sessionRecording)||void 0===r?void 0:r.sampleRate,p=zt(f)?null:parseFloat(f),h=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;n.register((l(d={},vs,!!e.sessionRecording),l(d,gs,null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled),l(d,ms,t({capturePerformance:e.capturePerformance},null===(a=e.sessionRecording)||void 0===a?void 0:a.networkPayloadCapture)),l(d,_s,{enabled:null===(s=e.sessionRecording)||void 0===s?void 0:s.recordCanvas,fps:null===(u=e.sessionRecording)||void 0===u?void 0:u.canvasFps,quality:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasQuality}),l(d,ys,p),l(d,bs,Vt(h)?null:h),d))};r(),this.sessionManager.onSessionId(r)}}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Cn()})}},{key:"_startCapture",value:function(){var e=this;Vt(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():this.instance.requestRouter.loadScript("/static/recorder.js?v=".concat(Xt.LIB_VERSION),(function(t){if(t)return vn.error(Cl+" could not load recorder.js",t);e._onScriptLoaded()})))}},{key:"isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==kl.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0,clearTimeout(this._fullSnapshotTimer),this._flushBuffer());var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),i=r.windowId,o=r.sessionId,a=this.sessionId!==o,s=this.windowId!==i;this.windowId=i,this.sessionId=o,(n||-1===[pl,hl].indexOf(e.type)&&(s||a||Vt(this._fullSnapshotTimer)))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):vn.warn(Cl+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var n=this;return this._tryRRWebMethod(wl((function(){return n.rrwebRecord.addCustomEvent(e,t)})))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(wl((function(){return e.rrwebRecord.takeFullSnapshot()})))}},{key:"_onScriptLoaded",value:function(){for(var e,n=this,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},i=this.instance.config.session_recording,o=0,a=Object.entries(i||{});o<a.length;o++){var s=d(a[o],2),u=s[0],l=s[1];u in r&&("maskInputOptions"===u?r.maskInputOptions=t({password:!0},l):r[u]=l)}if(this.canvasRecording&&this.canvasRecording.enabled&&(r.recordCanvas=!0,r.sampling={canvas:this.canvasRecording.fps},r.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new yl(this.rrwebRecord,{onBlockedNode:function(e,t){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");vn.info(r,{node:t}),n.log(Cl+" "+r,"warn")}});var c=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(t({emit:function(e){n.onRRwebEmit(e)},plugins:c},r)),this.instance._addCaptureHook((function(e){try{if("$pageview"===e){var t=en?n._maskUrl(en.location.href):"";if(!t)return;n._tryAddCustomEvent("$pageview",{href:t})}}catch(e){vn.error("Could not add $pageview to rrweb session",e)}})),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:r,activePlugins:c.map((function(e){return null==e?void 0:e.name}))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else vn.error(Cl+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval((function(){e._tryTakeFullSnapshot()}),t))}}},{key:"_gatherRRWebPlugins",value:function(){var e=[];(pn.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(pn.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&$t(pn.getRecordNetworkPlugin))&&(!Fn.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(pn.getRecordNetworkPlugin(_r(this.instance.config,this.networkPayloadCapture))):vn.info(Cl+" NetworkCapture not started because we are on localhost."));return e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&Ut(e)){if(e.type===ml.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===ml.FullSnapshot&&this._scheduleFullSnapshot();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var r=function(e){var t=e;if(t&&Ut(t)&&6===t.type&&Ut(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(n),i=fl(r);if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===ml.Custom){var o={$snapshot_bytes:i,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&en){var e=this._maskUrl(en.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=f(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach((function(t){Date.now()-t.enqueuedAt<=2e3&&e._tryRRWebMethod(t)}))}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}},{key:"clearBuffer",value:function(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,n=this.sessionDuration,r=Qt(n)&&n>=0,i=Qt(t)&&r&&n<t;if("buffering"===this.status||i)return this.flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this.buffer;this.buffer.data.length>0&&vl(this.buffer).forEach((function(t){e._captureSnapshot({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId})}));return this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings"})}},{key:"overrideLinkedFlag",value:function(){this._linkedFlagSeen=!0}}]),e}(),Sl=function(){function e(t){a(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return u(e,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Ss),group_properties:this.instance.get_property(xs),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:ca.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){return e.parseDecideResponse(t.json)}})}},{key:"parseDecideResponse",value:function(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var n=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},n),n)vn.error("Failed to fetch feature flags from PostHog.");else{if(!sn||!sn.body)return vn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){t.parseDecideResponse(e)}),500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps){var r,i=v(e.siteApps);try{var o=function(){var e=r.value,n=e.id,i=e.url,o=t.instance.requestRouter.endpointFor("api",i);pn["__$$ph_site_app_".concat(n)]=t.instance,t.instance.requestRouter.loadScript(o,(function(e){if(e)return vn.error("Error while initializing PostHog app with config id ".concat(n),e)}))};for(i.s();!(r=i.n()).done;)o()}catch(e){i.e(e)}finally{i.f()}}else e.siteApps.length>0&&vn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),e}(),xl=null!=en&&en.location?Dn(en.location.hash,"__posthog")||Dn(location.hash,"state"):null,El="_postHogToolbarParams";!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(gl||(gl={}));var Tl=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"setToolbarState",value:function(e){pn.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return null!==(e=pn.ph_toolbar_state)&&void 0!==e?e:gl.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!en||!sn)return!1;n=null!==(e=n)&&void 0!==e?e:en.location,i=null!==(t=i)&&void 0!==t?t:en.history;try{if(!r){try{en.localStorage.setItem("test","test"),en.localStorage.removeItem("test")}catch(e){return!1}r=null==en?void 0:en.localStorage}var o,a=xl||Dn(n.hash,"__posthog")||Dn(n.hash,"state"),s=a?In((function(){return JSON.parse(atob(decodeURIComponent(a)))}))||In((function(){return JSON.parse(decodeURIComponent(a))})):null;return s&&"ph_authorize"===s.action?((o=s).source="url",o&&Object.keys(o).length>0&&(s.desiredHash?n.hash=s.desiredHash:i?i.replaceState(i.state,"",n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem(El)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}},{key:"_callLoadToolbar",value:function(e){(pn.ph_load_toolbar||pn.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var n=this,r=!(null==sn||!sn.getElementById(Ds));if(!en||r)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,o=t(t({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(en.localStorage.setItem(El,JSON.stringify(t(t({},o),{},{source:void 0}))),this.getToolbarState()===gl.LOADED)this._callLoadToolbar(o);else if(this.getToolbarState()===gl.UNINITIALIZED){this.setToolbarState(gl.LOADING);var a=3e5,s=Math.floor(Date.now()/a)*a;this.instance.requestRouter.loadScript("/static/toolbar.js?t=".concat(s),(function(e){if(e)return vn.error("Failed to load toolbar",e),void n.setToolbarState(gl.UNINITIALIZED);n.setToolbarState(gl.LOADED),n._callLoadToolbar(o)})),Mn(en,"turbolinks:load",(function(){n.setToolbarState(gl.UNINITIALIZED),n.loadToolbar(o)}))}return!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}]),e}(),Al=function(){function e(t){a(this,e),l(this,"isPaused",!0),l(this,"queue",[]),l(this,"flushTimeoutMs",3e3),this.sendRequest=t}return u(e,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var n=this.queue.length>0?this.formatQueue():{},r=Object.values(n),i=[].concat(f(r.filter((function(e){return 0===e.url.indexOf("/e")}))),f(r.filter((function(e){return 0!==e.url.indexOf("/e")}))));i.map((function(n){e.sendRequest(t(t({},n),{},{transport:"sendBeacon"}))}))}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=(new Date).getTime();r.data&&Ht(r.data)&&yn(r.data,(function(e){e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(r)};for(var r in t)n(r)}}),this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return yn(this.queue,(function(n){var r,i=n,o=(i?i.batchKey:null)||i.url;Vt(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(r=e[o].data)||void 0===r||r.push(i.data)})),this.queue=[],e}}]),e}(),Ml=Uint8Array,Rl=Uint16Array,Fl=Uint32Array,Ol=new Ml([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]),Nl=new Ml([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]),Ll=new Ml([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pl=function(e,t){for(var n=new Rl(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Fl(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},Dl=Pl(Ol,2),ql=Dl[0],Bl=Dl[1];ql[28]=258,Bl[258]=28;for(var Hl=Pl(Nl,0)[1],$l=new Rl(32768),Ul=0;Ul<32768;++Ul){var Wl=(43690&Ul)>>>1|(21845&Ul)<<1;Wl=(61680&(Wl=(52428&Wl)>>>2|(13107&Wl)<<2))>>>4|(3855&Wl)<<4,$l[Ul]=((65280&Wl)>>>8|(255&Wl)<<8)>>>1}var Vl=function(e,t,n){for(var r=e.length,i=0,o=new Rl(t);i<r;++i)++o[e[i]-1];var a,s=new Rl(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new Rl(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],c=t-e[i],d=s[e[i]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)a[$l[d]>>>u]=l}else for(a=new Rl(r),i=0;i<r;++i)a[i]=$l[s[e[i]-1]++]>>>15-e[i];return a},Gl=new Ml(288);for(Ul=0;Ul<144;++Ul)Gl[Ul]=8;for(Ul=144;Ul<256;++Ul)Gl[Ul]=9;for(Ul=256;Ul<280;++Ul)Gl[Ul]=7;for(Ul=280;Ul<288;++Ul)Gl[Ul]=8;var jl=new Ml(32);for(Ul=0;Ul<32;++Ul)jl[Ul]=5;var Zl=Vl(Gl,9,0),zl=Vl(jl,5,0),Ql=function(e){return(e/8>>0)+(7&e&&1)},Kl=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Rl?Rl:e instanceof Fl?Fl:Ml)(n-t);return r.set(e.subarray(t,n)),r},Yl=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Jl=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Xl=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new Ml(0),0];if(1==i){var a=new Ml(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],u=n[1],l=0,c=1,d=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};c!=i-1;)s=n[n[l].f<n[d].f?l++:d++],u=n[l!=c&&n[l].f<n[d].f?l++:d++],n[c++]={s:-1,f:s.f+u.f,l:s,r:u};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var p=new Rl(f+1),h=ec(n[c-1],p,0);if(h>t){r=0;var v=0,g=h-t,m=1<<g;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var _=o[r].s;if(!(p[_]>t))break;v+=m-(1<<h-p[_]),p[_]=t}for(v>>>=g;v>0;){var y=o[r].s;p[y]<t?v-=1<<t-p[y]++-1:++r}for(;r>=0&&v;--r){var b=o[r].s;p[b]==t&&(--p[b],++v)}h=t}return[new Ml(p),h]},ec=function e(t,n,r){return-1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},tc=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Rl(++t),r=0,i=e[0],o=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[s]}return[n.subarray(0,r),t]},nc=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},rc=function(e,t,n){var r=n.length,i=Ql(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},ic=function(e,t,n,r,i,o,a,s,u,l,c){Yl(t,c++,n),++i[256];for(var d=Xl(i,15),f=d[0],p=d[1],h=Xl(o,15),v=h[0],g=h[1],m=tc(f),_=m[0],y=m[1],b=tc(v),k=b[0],w=b[1],C=new Rl(19),I=0;I<_.length;++I)C[31&_[I]]++;for(I=0;I<k.length;++I)C[31&k[I]]++;for(var S=Xl(C,7),x=S[0],E=S[1],T=19;T>4&&!x[Ll[T-1]];--T);var A,M,R,F,O=l+5<<3,N=nc(i,Gl)+nc(o,jl)+a,L=nc(i,f)+nc(o,v)+a+14+3*T+nc(C,x)+(2*C[16]+3*C[17]+7*C[18]);if(O<=N&&O<=L)return rc(t,c,e.subarray(u,u+l));if(Yl(t,c,1+(L<N)),c+=2,L<N){A=Vl(f,p,0),M=f,R=Vl(v,g,0),F=v;var P=Vl(x,E,0);Yl(t,c,y-257),Yl(t,c+5,w-1),Yl(t,c+10,T-4),c+=14;for(I=0;I<T;++I)Yl(t,c+3*I,x[Ll[I]]);c+=3*T;for(var D=[_,k],q=0;q<2;++q){var B=D[q];for(I=0;I<B.length;++I){var H=31&B[I];Yl(t,c,P[H]),c+=x[H],H>15&&(Yl(t,c,B[I]>>>5&127),c+=B[I]>>>12)}}}else A=Zl,M=Gl,R=zl,F=jl;for(I=0;I<s;++I)if(r[I]>255){H=r[I]>>>18&31;Jl(t,c,A[H+257]),c+=M[H+257],H>7&&(Yl(t,c,r[I]>>>23&31),c+=Ol[H]);var $=31&r[I];Jl(t,c,R[$]),c+=F[$],$>3&&(Jl(t,c,r[I]>>>5&8191),c+=Nl[$])}else Jl(t,c,A[r[I]]),c+=M[r[I]];return Jl(t,c,A[256]),c+M[256]},oc=new Fl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ac=new Ml(0),sc=function(){for(var e=new Fl(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),uc=function(e,t,n,r,i){return function(e,t,n,r,i,o){var a=e.length,s=new Ml(r+a+5*(1+Math.floor(a/7e3))+i),u=s.subarray(r,s.length-i),l=0;if(!t||a<8)for(var c=0;c<=a;c+=65535){var d=c+65535;d<a?l=rc(u,l,e.subarray(c,d)):(u[c]=o,l=rc(u,l,e.subarray(c,a)))}else{for(var f=oc[t-1],p=f>>>13,h=8191&f,v=(1<<n)-1,g=new Rl(32768),m=new Rl(v+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&v},k=new Fl(25e3),w=new Rl(288),C=new Rl(32),I=0,S=0,x=(c=0,0),E=0,T=0;c<a;++c){var A=b(c),M=32767&c,R=m[A];if(g[M]=R,m[A]=M,E<=c){var F=a-c;if((I>7e3||x>24576)&&F>423){l=ic(e,u,0,k,w,C,S,x,T,c-T,l),x=I=S=0,T=c;for(var O=0;O<286;++O)w[O]=0;for(O=0;O<30;++O)C[O]=0}var N=2,L=0,P=h,D=M-R&32767;if(F>2&&A==b(c-D))for(var q=Math.min(p,F)-1,B=Math.min(32767,c),H=Math.min(258,F);D<=B&&--P&&M!=R;){if(e[c+N]==e[c+N-D]){for(var $=0;$<H&&e[c+$]==e[c+$-D];++$);if($>N){if(N=$,L=D,$>q)break;var U=Math.min(D,$-2),W=0;for(O=0;O<U;++O){var V=c-D+O+32768&32767,G=V-g[V]+32768&32767;G>W&&(W=G,R=V)}}}D+=(M=R)-(R=g[M])+32768&32767}if(L){k[x++]=268435456|Bl[N]<<18|Hl[L];var j=31&Bl[N],Z=31&Hl[L];S+=Ol[j]+Nl[Z],++w[257+j],++C[Z],E=c+N,++I}else k[x++]=e[c],++w[e[c]]}}l=ic(e,u,o,k,w,C,S,x,T,c-T,l),o||(l=rc(u,l,ac))}return Kl(s,0,r+Ql(l)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},lc=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function cc(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=sc[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i=uc(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),o=i.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&lc(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}}(i,t),lc(i,o-8,n.d()),lc(i,o-4,r),i}var dc=!!cn||!!ln,fc="text/plain",pc=function(e,n){var r=d(e.split("?"),2),i=r[0],o=r[1],a=t({},n);null==o||o.split("&").forEach((function(e){var t=d(e.split("="),1)[0];delete a[t]}));var s=Ln(a);return s=s?(o?o+"&":"")+s:o,"".concat(i,"?").concat(s)},hc=function(e){return"data="+encodeURIComponent("string"==typeof e?e:JSON.stringify(e))},vc=function(e){var t=e.data,n=e.compression;if(t){if(n===ca.GZipJS){var r=cc(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Ml(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},a=0;a<n;++a){if(i+5>r.length){var s=new Ml(i+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return Kl(r,0,i)}(JSON.stringify(t)),{mtime:0});return{contentType:fc,body:new Blob([r],{type:fc})}}if(n===ca.Base64){var i=function(e){var t,n,r,i,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,l="",c=[];if(!e)return e;e=An(e);do{t=(o=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,c[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(i)}while(s<e.length);switch(l=c.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}(JSON.stringify(t));return{contentType:"application/x-www-form-urlencoded",body:hc(i)}}return{contentType:"application/json",body:JSON.stringify(t)}}},gc=[];cn&&gc.push({transport:"XHR",method:function(e){var t,n=new cn;n.open(e.method||"GET",e.url,!0);var r=null!==(t=vc(e))&&void 0!==t?t:{},i=r.contentType,o=r.body;yn(e.headers,(function(e,t){n.setRequestHeader(t,e)})),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=function(){if(4===n.readyState){var t,r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,r)}},n.send(o)}}),ln&&gc.push({transport:"fetch",method:function(e){var t,n,r=null!==(t=vc(e))&&void 0!==t?t:{},i=r.contentType,o=r.body,a=new Headers;yn(e.headers,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var s=e.url,u=null;if(dn){var l=new dn;u={signal:l.signal,timeout:setTimeout((function(){return l.abort()}),e.timeout)}}ln(s,{method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method,body:o,signal:null===(n=u)||void 0===n?void 0:n.signal}).then((function(t){return t.text().then((function(n){var r,i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){vn.error(e)}null===(r=e.callback)||void 0===r||r.call(e,i)}))})).catch((function(t){var n;vn.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((function(){return u?clearTimeout(u.timeout):null}))}}),null!=an&&an.sendBeacon&&gc.push({transport:"sendBeacon",method:function(e){var t=pc(e.url,{beacon:"1"});try{var n,r=null!==(n=vc(e))&&void 0!==n?n:{},i=r.contentType,o=r.body,a="string"==typeof o?new Blob([o],{type:i}):o;an.sendBeacon(t,a)}catch(e){}}});var mc=["retriesPerformedSoFar"];var _c,yc=function(){function e(t){var n=this;a(this,e),l(this,"isPolling",!1),l(this,"pollIntervalMs",3e3),l(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!Vt(en)&&"onLine"in en.navigator&&(this.areWeOnline=en.navigator.onLine,en.addEventListener("online",(function(){n.areWeOnline=!0,n.flush()})),en.addEventListener("offline",(function(){n.areWeOnline=!1})))}return u(e,[{key:"retriableRequest",value:function(e){var n=this,r=e.retriesPerformedSoFar,i=c(e,mc);Qt(r)&&r>0&&(i.url=pc(i.url,{retry_count:r})),this.instance._send_request(t(t({},i),{},{callback:function(e){var o;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=r?r:0)<10?n.enqueue(t({retriesPerformedSoFar:r},i)):null===(o=i.callback)||void 0===o||o.call(i,e)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=Date.now()+n;this.queue.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in ".concat(n);navigator.onLine||(i+=" (Browser is offline)"),vn.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],n=this.queue.filter((function(n){return n.retryAt<e||(t.push(n),!1)}));if(this.queue=t,n.length>0){var r,i=v(n);try{for(i.s();!(r=i.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,n=v(this.queue);try{for(n.s();!(e=n.n()).done;){var r=e.value.requestOptions;try{this.instance._send_request(t(t({},r),{},{transport:"sendBeacon"}))}catch(e){vn.error(e)}}}catch(e){n.e(e)}finally{n.f()}this.queue=[]}}]),e}(),bc=1800,kc=function(){function e(t,n,r,i){var o;a(this,e),l(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||Ks,this._windowIdGenerator=i||Ks;var s=t.persistence_name||t.token,u=t.session_idle_timeout_seconds||bc;if(Qt(u)?u>bc?vn.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):u<60&&vn.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(vn.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),u=bc),this._sessionTimeoutMs=1e3*Math.min(Math.max(u,60),bc),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var c=du.parse(this._window_id_storage_key),d=du.parse(this._primary_window_exists_storage_key);c&&!d?this._windowId=c:du.remove(this._window_id_storage_key),du.set(this._primary_window_exists_storage_key,!0)}if(null!==(o=this.config.bootstrap)&&void 0!==o&&o.sessionID)try{var f=function(e){var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)}(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),f)}catch(e){vn.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}return u(e,[{key:"onSessionId",value:function(e){var t=this;return Vt(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter((function(t){return t!==e}))}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&du.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&du.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?du.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(l({},ks,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[ks];return Ht(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;null==en||en.addEventListener("beforeunload",(function(){e._canUseSessionStorage()&&du.remove(e._primary_window_exists_storage_key)}))}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=d(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],a=this._getWindowId(),s=o&&o>0&&Math.abs(t-o)>864e5,u=!1,l=!i,c=!e&&Math.abs(t-r)>this._sessionTimeoutMs;l||c||s?(i=this._sessionIdGenerator(),a=this._windowIdGenerator(),vn.info("[SessionId] new session ID generated",{sessionId:i,windowId:a,changeReason:{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:s}}),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var f=0===r||!e||s?t:r,p=0===o?(new Date).getTime():o;return this._setWindowId(a),this._setSessionId(i,f,p),u&&this._sessionIdChangedHandlers.forEach((function(e){return e(i,a)})),{sessionId:i,windowId:a,sessionStartTimestamp:p}}}]),e}();!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(_c||(_c={}));var wc="i.posthog.com",Cc=function(){function e(t){a(this,e),l(this,"_regionCache",{}),this.instance=t}return u(e,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=_c.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=_c.EU:this._regionCache[this.apiHost]=_c.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return(this.uiHost||this.apiHost.replace(".".concat(wc),".posthog.com"))+t;if(this.region===_c.CUSTOM)return this.apiHost+t;var n=wc+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}},{key:"loadScript",value:function(e,t){if(this.instance.config.disable_external_dependency_loading)return vn.warn("".concat(e," was requested but loading of external scripts is disabled.")),t("Loading of external scripts is disabled");var n="/"===e[0]?this.endpointFor("assets",e):e,r=function(){if(!sn)return t("document not found");var e=sn.createElement("script");e.type="text/javascript",e.src=n,e.onload=function(e){return t(void 0,e)},e.onerror=function(e){return t(e)};var r,i=sn.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(e,i[0]):sn.body.appendChild(e)};null!=sn&&sn.body?r():null==sn||sn.addEventListener("DOMContentLoaded",r)}}]),e}(),Ic="/e/",Sc="[Exception Capture]",xc=function(){function e(t){var n,r,i=this;a(this,e),l(this,"originalOnUnhandledRejectionHandler",void 0),l(this,"startCapturing",(function(){var e;if(en&&i.isEnabled&&!i.hasHandlers&&(null===(e=en.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)){var t=en.posthogErrorWrappingFunctions.wrapOnError,n=en.posthogErrorWrappingFunctions.wrapUnhandledRejection;if(t&&n)try{i.unwrapOnError=t(i.captureException.bind(i)),i.unwrapUnhandledRejection=n(i.captureException.bind(i))}catch(e){vn.error(Sc+" failed to start",e),i.stopCapturing()}else vn.error(Sc+" failed to load error wrapping functions - cannot start")}})),this.instance=t,this.remoteEnabled=!(null===(n=this.instance.persistence)||void 0===n||!n.props[fs]),this._endpoint=(null===(r=this.instance.persistence)||void 0===r?void 0:r.props[ps])||Ic,this.startIfEnabled()}return u(e,[{key:"endpoint",get:function(){return this._endpoint}},{key:"isEnabled",get:function(){var e;return null!==(e=this.remoteEnabled)&&void 0!==e&&e}},{key:"isCapturing",get:function(){var e;return!(null==en||null===(e=en.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)}},{key:"hasHandlers",get:function(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this.isCapturing&&(vn.info(Sc+" enabled, starting..."),this.loadScript(this.startCapturing))}},{key:"loadScript",value:function(e){this.hasHandlers&&e(),this.instance.requestRouter.loadScript("/static/exception-autocapture.js?v=".concat(Xt.LIB_VERSION),(function(t){if(t)return vn.error(Sc+" failed to load script",t);e()}))}},{key:"stopCapturing",value:function(){var e,t;null===(e=this.unwrapOnError)||void 0===e||e.call(this),null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this)}},{key:"afterDecideResponse",value:function(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this._endpoint=Ut(t)&&t.endpoint||Ic,this.instance.persistence&&(this.instance.persistence.register(l({},fs,this.remoteEnabled)),this.instance.persistence.register(l({},ps,this._endpoint))),this.startIfEnabled()}},{key:"captureException",value:function(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.sendExceptionEvent(e)}},{key:"sendExceptionEvent",value:function(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_url:this.endpoint})}}]),e}(),Ec="posthog-js";function Tc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.organization,r=t.projectId,i=t.prefix,o=t.severityAllowList,a=void 0===o?["error"]:o;return function(t){var o,s,u,l,c,d;if(!("*"===a||a.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var f=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));t.tags["PostHog Person URL"]=f,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=(null===(o=t.exception)||void 0===o?void 0:o.values)||[],h={$exception_message:(null===(s=p[0])||void 0===s?void 0:s.value)||t.message,$exception_type:null===(u=p[0])||void 0===u?void 0:u.type,$exception_personURL:f,$exception_level:t.level,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null===(l=p[0])||void 0===l?void 0:l.value)||t.message,$sentry_exception_type:null===(c=p[0])||void 0===c?void 0:c.type,$sentry_tags:t.tags,$level:t.level};return n&&r&&(h.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+t.event_id),e.capture("$exception",h,{_url:(null===(d=e.exceptionObserver)||void 0===d?void 0:d.endpoint)||Ic}),t}}var Ac=u((function e(t,n,r,i,o){a(this,e),this.name=Ec,this.setupOnce=function(e){e(Tc(t,{organization:n,projectId:r,prefix:i,severityAllowList:o}))}}));function Mc(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var r=function(n){var r=function(){return n.anonymousId()||Ks()};e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(Ms,"identified")),t()},i=n.user();"then"in i&&$t(i.then)?i.then((function(e){return r(e)})):r(i)}(e,(function(){n.register(function(e){Promise&&Promise.resolve||vn.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(t,n){var r;if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(vn.info("Segment integration does not have a userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(vn.info("Segment integration has a userId set, identifying with PostHog"),e.identify(t.event.userId));var i=e._calculate_event_properties(n,null!==(r=t.event.properties)&&void 0!==r?r:{},new Date);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}}(e)).then((function(){t()}))}))}var Rc=function(){function e(t){a(this,e),this._instance=t}return u(e,[{key:"doPageView",value:function(e){var t,n=this._previousPageViewProperties(e);return this._currentPath=null!==(t=null==en?void 0:en.location.pathname)&&void 0!==t?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,n}},{key:"doPageLeave",value:function(e){return this._previousPageViewProperties(e)}},{key:"_previousPageViewProperties",value:function(e){var t=this._currentPath,n=this._prevPageviewTimestamp,r=this._instance.scrollManager.getContext();if(!n)return{};var i={};if(r){var o=r.maxScrollHeight,a=r.lastScrollY,s=r.maxScrollY,u=r.maxContentHeight,l=r.lastContentY,c=r.maxContentY;if(!(Vt(o)||Vt(a)||Vt(s)||Vt(u)||Vt(l)||Vt(c)))o=Math.ceil(o),a=Math.ceil(a),s=Math.ceil(s),u=Math.ceil(u),l=Math.ceil(l),c=Math.ceil(c),i={$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:o<=1?1:Fc(a/o,0,1),$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:o<=1?1:Fc(s/o,0,1),$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:u<=1?1:Fc(l/u,0,1),$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:u<=1?1:Fc(c/u,0,1)}}return t&&(i.$prev_pageview_pathname=t),n&&(i.$prev_pageview_duration=(e.getTime()-n.getTime())/1e3),i}}]),e}();function Fc(e,t,n){return Math.max(t,Math.min(e,n))}var Oc=function(){function e(){a(this,e),l(this,"events",{}),this.events={}}return u(e,[{key:"on",value:function(e,t){var n=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){n.events[e]=n.events[e].filter((function(e){return e!==t}))}}},{key:"emit",value:function(e,t){var n,r=v(this.events[e]||[]);try{for(r.s();!(n=r.n()).done;){(0,n.value)(t)}}catch(e){r.e(e)}finally{r.f()}var i,o=v(this.events["*"]||[]);try{for(o.s();!(i=o.n()).done;){(0,i.value)(e,t)}}catch(e){o.e(e)}finally{o.f()}}}]),e}(),Nc=function(){function e(t){var n=this;a(this,e),l(this,"_debugEventEmitter",new Oc),l(this,"checkStep",(function(e,t){return n.checkStepEvent(e,t)&&n.checkStepUrl(e,t)&&n.checkStepElement(e,t)})),l(this,"checkStepEvent",(function(e,t){return null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)})),this.instance=t,this.actionEvents=new Set,this.actionRegistry=new Set}return u(e,[{key:"init",value:function(){var e,t=this;if(!Vt(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)){var n;null===(n=this.instance)||void 0===n||n._addCaptureHook((function(e,n){t.on(e,n)}))}}},{key:"register",value:function(e){var t,n,r=this;if(!Vt(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach((function(e){var t,n;null===(t=r.actionRegistry)||void 0===t||t.add(e),null===(n=e.steps)||void 0===n||n.forEach((function(e){var t;null===(t=r.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")}))})),null!==(n=this.instance)&&void 0!==n&&n.autocapture)){var i,o=new Set;e.forEach((function(e){var t;null===(t=e.steps)||void 0===t||t.forEach((function(e){null!=e&&e.selector&&o.add(null==e?void 0:e.selector)}))})),null===(i=this.instance)||void 0===i||i.autocapture.setElementSelectors(o)}}},{key:"on",value:function(e,t){var n,r=this;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(n=this.actionRegistry)||void 0===n?void 0:n.size)>0&&this.actionRegistry.forEach((function(e){r.checkAction(t,e)&&r._debugEventEmitter.emit("actionCaptured",e.name)}))}},{key:"_addActionHook",value:function(e){this.onAction("actionCaptured",(function(t){return e(t)}))}},{key:"checkAction",value:function(e,t){if(null==(null==t?void 0:t.steps))return!1;var n,r=v(t.steps);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(this.checkStep(e,i))return!0}}catch(e){r.e(e)}finally{r.f()}return!1}},{key:"onAction",value:function(e,t){return this._debugEventEmitter.on(e,t)}},{key:"checkStepUrl",value:function(t,n){if(null!=n&&n.url){var r,i=null==t||null===(r=t.properties)||void 0===r?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!e.matchString(i,null==n?void 0:n.url,(null==n?void 0:n.url_matching)||"contains"))return!1}return!0}},{key:"checkStepElement",value:function(t,n){if((null!=n&&n.href||null!=n&&n.tag_name||null!=n&&n.text)&&!this.getElementsList(t).some((function(t){return!(null!=n&&n.href&&!e.matchString(t.href||"",null==n?void 0:n.href,(null==n?void 0:n.href_matching)||"exact"))&&((null==n||!n.tag_name||t.tag_name===(null==n?void 0:n.tag_name))&&!(null!=n&&n.text&&!e.matchString(t.text||"",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||"exact")&&!e.matchString(t.$el_text||"",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||"exact")))})))return!1;if(null!=n&&n.selector){var r,i=null==t||null===(r=t.properties)||void 0===r?void 0:r.$element_selectors;if(!i)return!1;if(!i.includes(null==n?void 0:n.selector))return!1}return!0}},{key:"getElementsList",value:function(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}],[{key:"matchString",value:function(t,n,r){switch(r){case"regex":return!!en&&Nn(t,n);case"exact":return n===t;case"contains":var i=e.escapeStringRegexp(n).replace(/_/g,".").replace(/%/g,".*");return Nn(t,i);default:return!1}}},{key:"escapeStringRegexp",value:function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}}]),e}(),Lc=function(){function e(t){a(this,e),this.instance=t,this.eventToSurveys=new Map,this.actionToSurveys=new Map}return u(e,[{key:"register",value:function(e){var t;Vt(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}},{key:"setupActionBasedSurveys",value:function(e){var t=this,n=e.filter((function(e){var t,n,r,i;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(n=e.conditions)||void 0===n||null===(r=n.actions)||void 0===r||null===(i=r.values)||void 0===i?void 0:i.length)>0}));if(0!==n.length){if(null==this.actionMatcher){this.actionMatcher=new Nc(this.instance),this.actionMatcher.init();this.actionMatcher._addActionHook((function(e){t.onAction(e)}))}n.forEach((function(e){var n,r,i,o,a,s,u,l,c,d;e.conditions&&null!==(n=e.conditions)&&void 0!==n&&n.actions&&null!==(r=e.conditions)&&void 0!==r&&null!==(i=r.actions)&&void 0!==i&&i.values&&(null===(o=e.conditions)||void 0===o||null===(a=o.actions)||void 0===a||null===(s=a.values)||void 0===s?void 0:s.length)>0&&(null===(u=t.actionMatcher)||void 0===u||u.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(d=c.values)||void 0===d||d.forEach((function(n){if(n&&n.name){var r=t.actionToSurveys.get(n.name);r&&r.push(e.id),t.actionToSurveys.set(n.name,r||[e.id])}})))}))}}},{key:"setupEventBasedSurveys",value:function(e){var t,n=this;if(0!==e.filter((function(e){var t,n,r,i;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r||null===(i=r.values)||void 0===i?void 0:i.length)>0})).length){null===(t=this.instance)||void 0===t||t._addCaptureHook((function(e,t){n.onEvent(e,t)})),e.forEach((function(e){var t,r,i;null===(t=e.conditions)||void 0===t||null===(r=t.events)||void 0===r||null===(i=r.values)||void 0===i||i.forEach((function(t){if(t&&t.name){var r=n.eventToSurveys.get(t.name);r&&r.push(e.id),n.eventToSurveys.set(t.name,r||[e.id])}}))}))}}},{key:"onEvent",value:function(t,n){var r,i,o=(null===(r=this.instance)||void 0===r||null===(i=r.persistence)||void 0===i?void 0:i.props[Ts])||[];if(e.SURVEY_SHOWN_EVENT_NAME==t&&n&&o.length>0){var a,s=null==n||null===(a=n.properties)||void 0===a?void 0:a.$survey_id;if(s){var u=o.indexOf(s);u>=0&&(o.splice(u,1),this._updateActivatedSurveys(o))}}else this.eventToSurveys.has(t)&&this._updateActivatedSurveys(o.concat(this.eventToSurveys.get(t)||[]))}},{key:"onAction",value:function(e){var t,n,r=(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n?void 0:n.props[Ts])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(r.concat(this.actionToSurveys.get(e)||[]))}},{key:"_updateActivatedSurveys",value:function(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register(l({},Ts,f(new Set(e))))}},{key:"getSurveys",value:function(){var e,t,n=null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[Ts];return n||[]}},{key:"getEventToSurveys",value:function(){return this.eventToSurveys}},{key:"_getActionMatcher",value:function(){return this.actionMatcher}}]),e}();l(Lc,"SURVEY_SHOWN_EVENT_NAME","survey shown");var Pc="[Surveys]",Dc={icontains:function(e){return!!en&&en.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e){return!!en&&-1===en.location.href.toLowerCase().indexOf(e.toLowerCase())},regex:function(e){return!!en&&Nn(en.location.href,e)},not_regex:function(e){return!!en&&!Nn(en.location.href,e)},exact:function(e){return(null==en?void 0:en.location.href)===e},is_not:function(e){return(null==en?void 0:en.location.href)!==e}};var qc=function(){function e(t){a(this,e),this.instance=t,this._surveyEventReceiver=null}return u(e,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,t=null==pn?void 0:pn.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new Lc(this.instance)),this.instance.requestRouter.loadScript("/static/surveys.js",(function(t){if(t)return vn.error(Pc,"Could not load surveys script",t);e._surveyManager=pn.extendPostHogWithSurveys(e.instance)})))}},{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new Lc(this.instance));var r=this.instance.get_property(Es);if(r&&!n)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(n){var r;if(200!==n.statusCode||!n.json)return e([]);var i,o=n.json.surveys||[],a=o.filter((function(e){var t,n,r,i,o,a,s,u,l,c,d,f;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r?void 0:r.values)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(a=o.values)||void 0===a?void 0:a.length)>0||(null===(s=e.conditions)||void 0===s?void 0:s.actions)&&(null===(u=e.conditions)||void 0===u||null===(l=u.actions)||void 0===l?void 0:l.values)&&(null===(c=e.conditions)||void 0===c||null===(d=c.actions)||void 0===d||null===(f=d.values)||void 0===f?void 0:f.length)>0}));a.length>0&&(null===(i=t._surveyEventReceiver)||void 0===i||i.register(a));return null===(r=t.instance.persistence)||void 0===r||r.register(l({},Es,o)),e(o)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var r,i=n.filter((function(e){return!(!e.start_date||e.end_date)})).filter((function(e){var t,n,r,i;if(!e.conditions)return!0;var o=null===(t=e.conditions)||void 0===t||!t.url||Dc[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),a=null===(i=e.conditions)||void 0===i||!i.selector||(null==sn?void 0:sn.querySelector(e.conditions.selector));return o&&a})),o=null===(r=t._surveyEventReceiver)||void 0===r?void 0:r.getSurveys(),a=i.filter((function(e){var n,r,i,a,s,u,l,c,d,f;if(!e.linked_flag_key&&!e.targeting_flag_key&&!e.internal_targeting_flag_key)return!0;var p=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),h=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),v=(null===(n=e.conditions)||void 0===n?void 0:n.events)&&(null===(r=e.conditions)||void 0===r||null===(i=r.events)||void 0===i?void 0:i.values)&&(null===(a=e.conditions)||void 0===a||null===(s=a.events)||void 0===s?void 0:s.values.length)>0,g=(null===(u=e.conditions)||void 0===u?void 0:u.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(d=e.conditions)||void 0===d||null===(f=d.actions)||void 0===f?void 0:f.values.length)>0,m=!v&&!g||(null==o?void 0:o.includes(e.id)),_=t._canActivateRepeatedly(e),y=!(e.internal_targeting_flag_key&&!_)||t.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key);return p&&h&&y&&m}));return e(a)}),n)}},{key:"getNextSurveyStep",value:function(e,t,n){var r,i=e.questions[t],o=t+1;if(null===(r=i.branching)||void 0===r||!r.type)return t===e.questions.length-1?Wr.End:o;if(i.branching.type===Wr.End)return Wr.End;if(i.branching.type===Wr.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===Wr.ResponseBased){if(i.type===Ur.SingleChoice){var a,s,u=i.choices.indexOf("".concat(n));if(null!==(a=i.branching)&&void 0!==a&&null!==(s=a.responseValues)&&void 0!==s&&s.hasOwnProperty(u)){var l=i.branching.responseValues[u];return Number.isInteger(l)?l:l===Wr.End?Wr.End:o}}else if(i.type===Ur.Rating){var c,d;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");var f=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 10")}(n,i.scale);if(null!==(c=i.branching)&&void 0!==c&&null!==(d=c.responseValues)&&void 0!==d&&d.hasOwnProperty(f)){var p=i.branching.responseValues[f];return Number.isInteger(p)?p:p===Wr.End?Wr.End:o}}return o}return vn.warn(Pc,"Falling back to next question index due to unexpected branching type"),o}},{key:"_canActivateRepeatedly",value:function(e){return zt(pn.__PosthogExtensions__.canActivateRepeatedly)&&vn.warn(Pc,"canActivateRepeatedly is not defined, must init before calling"),pn.__PosthogExtensions__.canActivateRepeatedly(e)}},{key:"canRenderSurvey",value:function(e){var t=this;zt(this._surveyManager)?vn.warn(Pc,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys((function(n){var r=n.filter((function(t){return t.id===e}))[0];t._surveyManager.canRenderSurvey(r)}))}},{key:"renderSurvey",value:function(e,t){var n=this;zt(this._surveyManager)?vn.warn(Pc,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys((function(r){var i=r.filter((function(t){return t.id===e}))[0];n._surveyManager.renderSurvey(i,null==sn?void 0:sn.querySelector(t))}))}}]),e}(),Bc=function(){function e(t){var n,r,i=this;a(this,e),l(this,"serverLimits",{}),l(this,"lastEventRateLimited",!1),l(this,"checkForLimiting",(function(e){var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((function(e){vn.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),i.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void vn.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:t})}})),this.instance=t,this.captureEventsPerSecond=(null===(n=t.config.rate_limiting)||void 0===n?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(r=t.config.rate_limiting)||void 0===r?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return u(e,[{key:"clientRateLimitContext",value:function(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(new Date).getTime(),o=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(Fs))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:i};o.tokens+=(i-o.last)/1e3*this.captureEventsPerSecond,o.last=i,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var a=o.tokens<1;return a||r||(o.tokens=Math.max(0,o.tokens-1)),!a||this.lastEventRateLimited||r||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,null===(n=this.instance.persistence)||void 0===n||n.set_property(Fs,o),{isRateLimited:a,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),Hc=function(){return t({initialPathName:(null==un?void 0:un.pathname)||"",referringDomain:ll.referringDomain()},ll.campaignParams())},$c=function(){function e(t,n,r){var i=this;a(this,e),l(this,"_onSessionIdCallback",(function(e){var t=i._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:i._sessionSourceParamGenerator()};i._persistence.register(l({},Rs,n))}})),this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||Hc,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return u(e,[{key:"_getStoredProps",value:function(){return this._persistence.props[Rs]}},{key:"getSessionProps",value:function(){var e,t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}]),e}(),Uc=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Wc=function(e,t){if(!e)return!1;var n=e.toLowerCase();return Uc.concat(t||[]).some((function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)}))},Vc=function(){function e(){a(this,e),this.clicks=[]}return u(e,[{key:"isRageClick",value:function(e,t,n){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}();function Gc(e){var t;return e.id===Ds||!(null===(t=e.closest)||void 0===t||!t.call(e,"#"+Ds))}var jc=function(){function e(t){var n,r=this;a(this,e),l(this,"rageclicks",new Vc),l(this,"_enabledServerSide",!1),l(this,"_initialized",!1),l(this,"_flushInterval",null),this.instance=t,this._enabledServerSide=!(null===(n=this.instance.persistence)||void 0===n||!n.props[ds]),null==en||en.addEventListener("beforeunload",(function(){r.flush()}))}return u(e,[{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return Ut(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){return Vt(this.instance.config.capture_heatmaps)?Vt(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}},{key:"startIfEnabled",value:function(){if(this.isEnabled){if(this._initialized)return;vn.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this.getAndClearBuffer()}}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(l({},ds,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_setupListeners",value:function(){var e=this;en&&sn&&(Mn(sn,"click",(function(t){return e._onClick(t||(null==en?void 0:en.event))}),!1,!0),Mn(sn,"mousemove",(function(t){return e._onMouseMove(t||(null==en?void 0:en.event))}),!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),o=function(e,t,n){for(var r=e;r&&!Vn(r,"body");){if(r===n)return!1;if(kn(t,null==en?void 0:en.getComputedStyle(r).position))return!0;r=zn(r)}return!1}(e.target,["fixed","sticky"],i);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:n),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var n;if(!Gc(e.target)){var r=this._getProperties(e,"click");null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(t(t({},r),{},{type:"rageclick"})),this._capture(r)}}},{key:"_onMouseMove",value:function(e){var t=this;Gc(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((function(){t._capture(t._getProperties(e,"mousemove"))}),500))}},{key:"_capture",value:function(e){if(en){var t=en.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}},{key:"flush",value:function(){this.buffer&&!Wt(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}]),e}(),Zc=function(){function e(t){var n=this;a(this,e),l(this,"_updateScrollData",(function(){var e,t,r,i;n.context||(n.context={});var o=n.scrollElement(),a=n.scrollY(),s=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((null==o?void 0:o.clientHeight)||0),l=(null==o?void 0:o.scrollHeight)||0;n.context.lastScrollY=Math.ceil(a),n.context.maxScrollY=Math.max(a,null!==(e=n.context.maxScrollY)&&void 0!==e?e:0),n.context.maxScrollHeight=Math.max(s,null!==(t=n.context.maxScrollHeight)&&void 0!==t?t:0),n.context.lastContentY=u,n.context.maxContentY=Math.max(u,null!==(r=n.context.maxContentY)&&void 0!==r?r:0),n.context.maxContentHeight=Math.max(l,null!==(i=n.context.maxContentHeight)&&void 0!==i?i:0)})),this.instance=t}return u(e,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){null==en||en.addEventListener("scroll",this._updateScrollData,!0),null==en||en.addEventListener("scrollend",this._updateScrollData,!0),null==en||en.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return null==en?void 0:en.document.documentElement;var e,t=v(Ht(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var n=e.value,r=null==en?void 0:en.document.querySelector(n);if(r)return r}}catch(e){t.e(e)}finally{t.f()}}},{key:"scrollY",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return en&&(en.scrollY||en.pageYOffset||en.document.documentElement.scrollTop)||0}},{key:"scrollX",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return en&&(en.scrollX||en.pageXOffset||en.document.documentElement.scrollLeft)||0}}]),e}(),zc="$copy_autocapture";function Qc(e,t){return t.length>e?t.slice(0,e)+"...":t}var Kc,Yc=function(){function e(t){a(this,e),l(this,"_initialized",!1),l(this,"_isDisabledServerSide",null),l(this,"rageclicks",new Vc),l(this,"_elementsChainAsString",!1),this.instance=t,this._elementSelectors=null}return u(e,[{key:"config",get:function(){var e,t,n=Ut(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map((function(e){return new RegExp(e)})),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map((function(e){return new RegExp(e)})),n}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(en&&sn){var t=function(t){t=t||(null==en?void 0:en.event);try{e._captureEvent(t)}catch(e){vn.error("Failed to capture event",e)}},n=function(t){t=t||(null==en?void 0:en.event),e._captureEvent(t,zc)};Mn(sn,"submit",t,!1,!0),Mn(sn,"change",t,!1,!0),Mn(sn,"click",t,!1,!0),this.config.capture_copied_text&&(Mn(sn,"copy",n,!1,!0),Mn(sn,"cut",n,!1,!0))}}else vn.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(l({},cs,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"setElementSelectors",value:function(e){this._elementSelectors=e}},{key:"getElementSelectors",value:function(e){var t,n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((function(t){var r=null==sn?void 0:sn.querySelectorAll(t);null==r||r.forEach((function(r){e===r&&n.push(t)}))})),n}},{key:"isEnabled",get:function(){var e,t,n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[cs],r=this._isDisabledServerSide;if(Zt(r)&&!Kt(n)&&!this.instance.config.advanced_disable_decide)return!1;var i=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!i}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Wn(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!Kn(e))return{};var t={};return yn(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&ir(r)&&(t[n]=r)}})),t}},{key:"_getPropertiesFromElement",value:function(e,t,n){var r,i=e.tagName.toLowerCase(),o={tag_name:i};Zn.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Qc(1024,or(e)):o.$el_text=Qc(1024,Un(e)));var a=Hn(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e})));var s=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;yn(e.attributes,(function(n){var r;if((!Yn(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==s||!s.includes(n.name))&&!t&&ir(n.value)&&(r=n.name,!Gt(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){var i=n.value;"class"===n.name&&(i=qn(i).join(" ")),o["attr__"+n.name]=Qc(1024,i)}}));for(var u=1,l=1,c=e;c=this._previousElementSibling(c);)u++,c.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){return Vt(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}},{key:"_captureEvent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var r,i=this._getEventTarget(e);if(Gn(i)&&(i=i.parentNode||null),"$autocapture"===n&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!==(r=this.rageclicks)&&void 0!==r&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var o=n===zc;if(i&&Qn(i,e,this.config,o,o?["copy","cut"]:void 0)){for(var a,s,u=[i],l=i;l.parentNode&&!Vn(l,"body");)jn(l.parentNode)?(u.push(l.parentNode.host),l=l.parentNode.host):(u.push(l.parentNode),l=l.parentNode);var c,d,f=[],p={},h=!1;if(yn(u,(function(e){var n=Kn(e);"a"===e.tagName.toLowerCase()&&(c=e.getAttribute("href"),c=n&&ir(c)&&c),kn(Hn(e),"ph-no-capture")&&(h=!0),f.push(t._getPropertiesFromElement(e,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var r=t._getAugmentPropertiesFromElement(e);bn(p,r)})),this.instance.config.mask_all_text||("a"===i.tagName.toLowerCase()||"button"===i.tagName.toLowerCase()?f[0].$el_text=or(i):f[0].$el_text=Un(i)),c){var v,g;f[0].attr__href=c;var m=null===(v=On(c))||void 0===v?void 0:v.host,_=null==en||null===(g=en.location)||void 0===g?void 0:g.host;m&&_&&m!==_&&(d=c)}if(h)return!1;var y=bn(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:sr(f)}:{$elements:f},null!==(a=f[0])&&void 0!==a&&a.$el_text?{$el_text:null===(s=f[0])||void 0===s?void 0:s.$el_text}:{},d&&"click"===e.type?{$external_click_url:d}:{},p),b=this.getElementSelectors(i);if(b&&b.length>0&&(y.$element_selectors=b),n===zc){var k,w=$n(null==en||null===(k=en.getSelection())||void 0===k?void 0:k.toString()),C=e.type||"clipboard";if(!w)return!1;y.$selected_content=w,y.$copy_type=C}return this.instance.capture(n,y),!0}}}},{key:"isBrowserSupported",value:function(){return $t(null==sn?void 0:sn.querySelectorAll)}}]),e}(),Jc=function(){function e(t){var n=this;a(this,e),l(this,"_restoreXHRPatch",void 0),l(this,"_restoreFetchPatch",void 0),l(this,"_startCapturing",(function(){Vt(n._restoreXHRPatch)&&pn.postHogTracingHeadersPatchFns._patchXHR(n.instance.sessionManager),Vt(n._restoreFetchPatch)&&pn.postHogTracingHeadersPatchFns._patchFetch(n.instance.sessionManager)})),this.instance=t}return u(e,[{key:"_loadScript",value:function(e){pn.postHogTracingHeadersPatchFns&&e(),this.instance.requestRouter.loadScript("/static/tracing-headers.js?v=".concat(Xt.LIB_VERSION),(function(t){if(t)return vn.error("[TRACING-HEADERS] failed to load script",t);e()}))}},{key:"startIfEnabledOrStop",value:function(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}]),e}();!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(Kc||(Kc={}));var Xc=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?Kc.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===Kc.DENIED||this.consent===Kc.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return"1"===e?Kc.GRANTED:"0"===e?Kc.DENIED:Kc.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?ou:ru;var t="localStorage"===e?ru:ou;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!Rn([null==an?void 0:an.doNotTrack,null==an?void 0:an.msDoNotTrack,pn.doNotTrack],(function(e){return kn([!0,1,"1","yes"],e)}))}}]),e}(),ed=9e5,td="[Web Vitals]",nd=function(){function e(n){var r,i=this;a(this,e),l(this,"_enabledServerSide",!1),l(this,"_initialized",!1),l(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),l(this,"_flushToCapture",(function(){clearTimeout(i._delayedFlushTimer),0!==i.buffer.metrics.length&&(i.instance.capture("$web_vitals",i.buffer.metrics.reduce((function(e,n){var r;return t(t({},e),{},(l(r={},"$web_vitals_".concat(n.name,"_event"),t({},n)),l(r,"$web_vitals_".concat(n.name,"_value"),n.value),r))}),{})),i.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})})),l(this,"_addToBuffer",(function(e){var n,r=null===(n=i.instance.sessionManager)||void 0===n?void 0:n.checkAndGetSessionAndWindowId(!0);if(Vt(r))vn.error(td+"Could not read session ID. Dropping metrics!");else{i.buffer=i.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=i._currentURL();if(!Vt(o))if(zt(null==e?void 0:e.name)||zt(null==e?void 0:e.value))vn.error(td+"Invalid metric received",e);else if(i._maxAllowedValue&&e.value>=i._maxAllowedValue)vn.error(td+"Ignoring metric with value >= "+i._maxAllowedValue,e);else i.buffer.url!==o&&(i._flushToCapture(),i._delayedFlushTimer=setTimeout(i._flushToCapture,8e3)),Vt(i.buffer.url)&&(i.buffer.url=o),i.buffer.firstMetricTimestamp=Vt(i.buffer.firstMetricTimestamp)?Date.now():i.buffer.firstMetricTimestamp,i.buffer.metrics.push(t(t({},e),{},{$current_url:o,$session_id:r.sessionId,$window_id:r.windowId,timestamp:Date.now()})),4===i.buffer.metrics.length&&i._flushToCapture()}})),l(this,"_startCapturing",(function(){var e=pn.postHogWebVitalsCallbacks,t=e.onLCP,n=e.onCLS,r=e.onFCP,o=e.onINP;t&&n&&r&&o?(t(i._addToBuffer),n(i._addToBuffer),r(i._addToBuffer),o(i._addToBuffer),i._initialized=!0):vn.error(td+"web vitals callbacks not loaded - not starting")})),this.instance=n,this._enabledServerSide=!(null===(r=this.instance.persistence)||void 0===r||!r.props[hs]),this.startIfEnabled()}return u(e,[{key:"_maxAllowedValue",get:function(){var e=Ut(this.instance.config.capture_performance)&&Qt(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:ed;return 0<e&&e<=6e4?ed:e}},{key:"isEnabled",get:function(){var e=Ut(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Kt(e)?e:this._enabledServerSide}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(vn.info(td+" enabled, starting..."),this.loadScript(this._startCapturing))}},{key:"afterDecideResponse",value:function(e){var t=Ut(e.capturePerformance)&&!!e.capturePerformance.web_vitals;this.instance.persistence&&this.instance.persistence.register(l({},hs,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"loadScript",value:function(e){en.postHogWebVitalsCallbacks&&e(),this.instance.requestRouter.loadScript("/static/web-vitals.js?v=".concat(Xt.LIB_VERSION),(function(t){t?vn.error(td+" failed to load script",t):e()}))}},{key:"_currentURL",value:function(){var e=en?en.location.href:void 0;return e||vn.error(td+"Could not determine current URL"),e}}]),e}(),rd={},id=function(){},od="posthog",ad=!dc&&-1===(null==fn?void 0:fn.indexOf("MSIE"))&&-1===(null==fn?void 0:fn.indexOf("Mozilla")),sd=function(){var e,t,n;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(t=null==sn?void 0:sn.location,n=null==t?void 0:t.hostname,!!Gt(n)&&"herokuapp.com"!==n.split(".").slice(-2).join(".")),persistence:"localStorage+cookie",persistence_name:"",loaded:id,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:un&&Gt(null==un?void 0:un.search)&&-1!==un.search.indexOf("__posthog_debug=true")||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==en||null===(e=en.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.text;vn.error(t)},get_device_id:function(e){return e},_onCapture:id,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},ud=function(e){var t={};Vt(e.process_person)||(t.person_profiles=e.process_person),Vt(e.xhr_headers)||(t.request_headers=e.xhr_headers),Vt(e.cookie_name)||(t.persistence_name=e.cookie_name),Vt(e.disable_cookie)||(t.disable_persistence=e.disable_cookie);var n=bn({},t,e);return Ht(e.property_blacklist)&&(Vt(e.property_denylist)?n.property_denylist=e.property_blacklist:Ht(e.property_denylist)?n.property_denylist=[].concat(f(e.property_blacklist),f(e.property_denylist)):vn.error("Invalid value for property_denylist config: "+e.property_denylist)),n},ld=function(){function e(){a(this,e),l(this,"__forceAllowLocalhost",!1)}return u(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){vn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),cd=function(){function e(){var t=this;a(this,e),l(this,"webPerformance",new ld),l(this,"version",Xt.LIB_VERSION),l(this,"_internalEventEmitter",new Oc),this.config=sd(),this.decideEndpointWasHit=!1,this.SentryIntegration=Ac,this.sentryIntegration=function(e){return function(e,t){var n=Tc(e,t);return{name:Ec,processEvent:function(e){return n(e)}}}(t,e)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new Ws(this),this.toolbar=new Tl(this),this.scrollManager=new Zc(this),this.pageViewManager=new Rc(this),this.surveys=new qc(this),this.rateLimiter=new Bc(this),this.requestRouter=new Cc(this),this.consent=new Xc(this),this.people={set:function(e,n,r){var i=Gt(e)?l({},e,n):e;t.setPersonProperties(i),null==r||r({})},set_once:function(e,n,r){var i=Gt(e)?l({},e,n):e;t.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(function(e){return vn.info("send",e)}))}return u(e,[{key:"init",value:function(t,n,r){if(r&&r!==od){var i,o=null!==(i=rd[r])&&void 0!==i?i:new e;return o._init(t,n,r),rd[r]=o,rd[od][r]=o,o}return this._init(t,n,r)}},{key:"_init",value:function(e){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;if(Vt(e)||jt(e))return vn.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 vn.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(bn({},sd(),ud(o),{name:a,token:e})),this.config.on_xhr_error&&vn.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=o.disable_compression?void 0:ca.GZipJS,this.persistence=new dl(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new dl(t(t({},this.config),{},{persistence:"sessionStorage"}));var s=t({},this.persistence.props),u=t({},this.sessionPersistence.props);if(this._requestQueue=new Al((function(e){return i._send_retriable_request(e)})),this._retryQueue=new yc(this),this.__request_queue=[],this.sessionManager=new kc(this.config,this.persistence),this.sessionPropsManager=new $c(this.sessionManager,this.persistence),new Jc(this).startIfEnabledOrStop(),this.sessionRecording=new Il(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Yc(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new jc(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new nd(this),this.exceptionObserver=new xc(this),this.exceptionObserver.startIfEnabled(),Xt.DEBUG=Xt.DEBUG||this.config.debug,Xt.DEBUG&&vn.info("Starting in debug mode",{this:this,config:o,thisC:t({},this.config),p:s,s:u}),this._sync_opt_out_with_persistence(),void 0!==(null===(n=o.bootstrap)||void 0===n?void 0:n.distinctID)){var l,c,d=this.config.get_device_id(Ks()),f=null!==(l=o.bootstrap)&&void 0!==l&&l.isIdentifiedID?d:o.bootstrap.distinctID;this.persistence.set_property(Ms,null!==(c=o.bootstrap)&&void 0!==c&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:f})}if(this._hasBootstrappedFeatureFlags()){var p,h,v=Object.keys((null===(p=o.bootstrap)||void 0===p?void 0:p.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,r;return e[t]=(null===(n=o.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),g=Object.keys((null===(h=o.bootstrap)||void 0===h?void 0:h.featureFlagPayloads)||{}).filter((function(e){return v[e]})).reduce((function(e,t){var n,r,i,a;null!==(n=o.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=o.bootstrap)||void 0===i||null===(a=i.featureFlagPayloads)||void 0===a?void 0:a[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:g})}if(!this.get_distinct_id()){var m=this.config.get_device_id(Ks());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(Ms,"anonymous")}return null==en||null===(r=en.addEventListener)||void 0===r||r.call(en,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),o.segment?Mc(this,(function(){return i._loaded()})):this._loaded(),$t(this.config._onCapture)&&this.on("eventCaptured",(function(e){return i.config._onCapture(e.event,e)})),this}},{key:"_afterDecideResponse",value:function(e){var t,n,r,i,o,a,s;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=kn(e.supportedCompression,ca.GZipJS)?ca.GZipJS:kn(e.supportedCompression,ca.Base64)?ca.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),null===(n=this.sessionRecording)||void 0===n||n.afterDecideResponse(e),null===(r=this.autocapture)||void 0===r||r.afterDecideResponse(e),null===(i=this.heatmaps)||void 0===i||i.afterDecideResponse(e),null===(o=this.surveys)||void 0===o||o.afterDecideResponse(e),null===(a=this.webVitalsAutocapture)||void 0===a||a.afterDecideResponse(e),null===(s=this.exceptionObserver)||void 0===s||s.afterDecideResponse(e)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){vn.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((function(){sn&&e.capture("$pageview",{title:sn.title},{send_instantly:!0})}),1),t||(new Sl(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||_n(this.__request_queue,(function(t){return e._send_retriable_request(t)})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var n=this;this.__loaded&&(ad?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=pc(e.url,{ip:this.config.ip?1:0}),e.headers=t({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,function(e){var n,r,i,o=t({},e);o.timeout=o.timeout||6e4,o.url=pc(o.url,{_:(new Date).getTime().toString(),ver:Xt.LIB_VERSION,compression:o.compression});var a=null!==(n=o.transport)&&void 0!==n?n:"XHR",s=null!==(r=null===(i=Rn(gc,(function(e){return e.transport===a})))||void 0===i?void 0:i.method)&&void 0!==r?r:gc[0].method;if(!s)throw new Error("No available transport method");s(o)}(t(t({},e),{},{callback:function(t){var r,i,o;(n.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(i=(o=n.config).on_request_error)||void 0===i||i.call(o,t));null===(r=e.callback)||void 0===r||r.call(e,t)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];_n(e,(function(e){e&&(t=e[0],Ht(t)?o.push(e):$t(e)?e.call(n):Ht(e)&&"alias"===t?r.push(e):Ht(e)&&-1!==t.indexOf("capture")&&$t(n[t])?o.push(e):i.push(e))}));var a=function(e,t){_n(e,(function(e){if(Ht(e[0])){var n=t;yn(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};a(r,this),a(i,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!Vt(e)&&Gt(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,s=(null==r?void 0:r.timestamp)||a,u={uuid:Ks(),event:e,properties:this._calculate_event_properties(e,n||{},s)};o&&(u.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==r?void 0:r.$set)&&(u.$set=null==r?void 0:r.$set);var l=this._calculate_set_once_properties(null==r?void 0:r.$set_once);l&&(u.$set_once=l),(u=Tn(u,null!=r&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=s,Vt(null==r?void 0:r.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=a);var c=t(t({},u.properties.$set),u.$set);Wt(c)||this.setPersonPropertiesForFlags(c),this._internalEventEmitter.emit("eventCaptured",u);var d={method:"POST",url:null!==(i=null==r?void 0:r._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:null==r?void 0:r._batchKey};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this._send_retriable_request(d):this._requestQueue.enqueue(d),u}vn.critical("This capture call is ignored due to client rate limiting.")}}else vn.error("No event name provided to posthog.capture")}else vn.uninitializedWarning("posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.on("eventCaptured",(function(t){return e(t.event,t)}))}},{key:"_calculate_event_properties",value:function(e,n,r){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var i=this.persistence.remove_event_timer(e),o=t({},n);if(o.token=this.config.token,"$snapshot"===e){var a=t(t({},this.persistence.properties()),this.sessionPersistence.properties());return o.distinct_id=a.distinct_id,(!Gt(o.distinct_id)&&!Qt(o.distinct_id)||jt(o.distinct_id))&&vn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var s=ll.properties();if(this.sessionManager){var u=this.sessionManager.checkAndGetSessionAndWindowId(),l=u.sessionId,c=u.windowId;o.$session_id=l,o.$window_id=c}if(this.requestRouter.region===_c.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var d=this.sessionPropsManager.getSessionProps();o=bn(o,d)}if(!this.config.disable_scroll_properties){var f={};"$pageview"===e?f=this.pageViewManager.doPageView(r):"$pageleave"===e&&(f=this.pageViewManager.doPageLeave(r)),o=bn(o,f)}if("$pageview"===e&&sn&&(o.title=sn.title),!Vt(i)){var p=r.getTime()-i;o.$duration=parseFloat((p/1e3).toFixed(3))}fn&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=bn({},s,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),Ht(this.config.property_denylist)?yn(this.config.property_denylist,(function(e){delete o[e]})):vn.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var h=this.config.sanitize_properties;return h&&(o=h(o,e)),o.$process_person_profile=this._hasPersonProcessing(),o}},{key:"_calculate_set_once_properties",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=bn({},this.persistence.get_initial_props(),e||{});return Wt(t)?void 0:t}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(l({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"on",value:function(e,t){return this._internalEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"renderSurvey",value:function(e,t){this.surveys.renderSurvey(e,t)}},{key:"canRenderSurvey",value:function(e){this.surveys.canRenderSurvey(e)}},{key:"getNextSurveyStep",value:function(e,t,n){return this.surveys.getNextSurveyStep(e,t,n)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return vn.uninitializedWarning("posthog.identify");if(Qt(e)&&(e=e.toString(),vn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))vn.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(us)&&(this.unregister(us),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(Ms)||"anonymous");e!==r&&o?(this.persistence.set_property(Ms,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(As))}}else vn.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,n,r){if(e&&n){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:t(t({},i),{},l({},e,n))}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags(l({},e,r))),i[e]===n||r||this.reloadFeatureFlags()}}else vn.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,n,r,i;if(vn.info("reset"),!this.__loaded)return vn.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.persistence)||void 0===r||r.set_property(Ms,"anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId();var a=this.config.get_device_id(Ks());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(n));if(null!=e&&e.withTimestamp&&r){var o,a=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!r)return i;var s=Math.max(Math.floor(((new Date).getTime()-r)/1e3)-a,0);i+="?t=".concat(s)}return i}},{key:"alias",value:function(e,t){return e===this.get_property(ss)?(vn.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Vt(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(us,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(vn.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var n,r,i,o,a=t({},this.config);Ut(e)&&(bn(this.config,ud(e)),null===(n=this.persistence)||void 0===n||n.update_config(this.config,a),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new dl(t(t({},this.config),{},{persistence:"sessionStorage"})),ou.is_supported()&&"true"===ou.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(Xt.DEBUG=!0,vn.info("set_config",{config:e,oldConfig:a,newConfig:t({},this.config)})),null===(r=this.sessionRecording)||void 0===r||r.startIfEnabledOrStop(),null===(i=this.autocapture)||void 0===i||i.startIfEnabled(),null===(o=this.heatmaps)||void 0===o||o.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){var t,n=Kt(e)&&e;if(n||null!=e&&e.sampling){var r,i,o=null===(r=this.sessionManager)||void 0===r?void 0:r.checkAndGetSessionAndWindowId();null===(i=this.persistence)||void 0===i||i.register(l({},ws,!0)),vn.info("Session recording started with sampling override for session: ",null==o?void 0:o.sessionId)}(n||null!=e&&e.linked_flag)&&(null===(t=this.sessionRecording)||void 0===t||t.overrideLinkedFlag(),vn.info("Session recording started with linked_flags override"));this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:od;return t!==od&&(t=od+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(Ms))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(Ms))}},{key:"_hasPersonProcessing",value:function(){var e,t,n,r;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Wt(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[us])&&(null===(n=this.persistence)||void 0===n||null===(r=n.props)||void 0===r||!r[Ps]))}},{key:"_shouldCapturePageleave",value:function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return"never"===this.config.person_profiles?(vn.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Ps,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,n,r,i=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,a=this.config.disable_persistence||i&&!!o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==a&&(null===(n=this.persistence)||void 0===n||n.set_disabled(a));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==a&&(null===(r=this.sessionPersistence)||void 0===r||r.set_disabled(a))}},{key:"opt_in_capturing",value:function(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(Vt(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0})}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"_is_bot",value:function(){return an?function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&Wc(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some((function(e){return Wc(null==e?void 0:e.brand,t)})))return!0}catch(e){}return!!e.webdriver}(an,this.config.custom_blocked_useragents):void 0}},{key:"debug",value:function(e){!1===e?(null==en||en.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==en||en.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Sn(e.prototype[t[n]])}(cd,["identify"]);var dd,fd;dd=rd[od]=new cd,(fd=pn.posthog)&&yn(fd._i,(function(e){if(e&&Ht(e)){var t=dd.init(e[0],e[1],e[2]),n=fd[e[2]]||fd;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),pn.posthog=dd,function(){function e(){e.done||(e.done=!0,ad=!1,yn(rd,(function(e){e._dom_loaded()})))}null!=sn&&sn.addEventListener&&("complete"===sn.readyState?e():sn.addEventListener("DOMContentLoaded",e,!1)),en&&Mn(en,"load",e,!0)}()}();
|
|
16
|
+
function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["type"]);return t})),i=n[0].type;this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),yt=function(){function e(t){a(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new he,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return u(e,[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){if(0!==e.length){var n,r={id:t,styleIds:[]},i=[],o=v(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=void 0;this.styleMirror.has(a)?s=this.styleMirror.getId(a):(s=this.styleMirror.add(a),i.push({styleId:s,rules:Array.from(a.rules||CSSRule,(function(e,t){return{rule:b(e),index:t}}))})),r.styleIds.push(s)}}catch(e){o.e(e)}finally{o.f()}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),bt=function(){function e(){a(this,e),this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}return u(e,[{key:"periodicallyClear",value:function(){var e=this;requestAnimationFrame((function(){e.clear(),e.loop&&e.periodicallyClear()}))}},{key:"inOtherBuffer",value:function(e,t){var n=this.nodeMap.get(e);return n&&Array.from(n).some((function(e){return e!==t}))}},{key:"add",value:function(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"clear",value:function(){this.nodeMap=new WeakMap}},{key:"destroy",value:function(){this.loop=!1}}]),e}();function kt(e){return Object.assign(Object.assign({},e),{timestamp:ne()})}var wt=!1,Ct=new k;function It(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,i=e.blockClass,o=void 0===i?"rr-block":i,a=e.blockSelector,s=void 0===a?null:a,u=e.ignoreClass,l=void 0===u?"rr-ignore":u,c=e.ignoreSelector,d=void 0===c?null:c,f=e.maskTextClass,p=void 0===f?"rr-mask":f,h=e.maskTextSelector,g=void 0===h?null:h,m=e.inlineStylesheet,_=void 0===m||m,y=e.maskAllInputs,b=e.maskInputOptions,w=e.slimDOMOptions,C=e.maskInputFn,I=e.maskTextFn,S=e.hooks,x=e.packFn,E=e.sampling,T=void 0===E?{}:E,A=e.dataURLOptions,M=void 0===A?{}:A,R=e.mousemoveWait,F=e.recordDOM,O=void 0===F||F,N=e.recordCanvas,L=void 0!==N&&N,P=e.recordCrossOriginIframes,D=void 0!==P&&P,q=e.recordAfter,B=void 0===q?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":q,H=e.userTriggeredOnInput,$=void 0!==H&&H,U=e.collectFonts,W=void 0!==U&&U,V=e.inlineImages,G=void 0!==V&&V,j=e.plugins,Z=e.keepIframeSrcFn,z=void 0===Z?function(){return!1}:Z,Y=e.ignoreCSSAttributes,J=void 0===Y?new Set([]):Y;Oe(e.errorHandler);var X=!D||window.parent===window,ee=!1;if(!X)try{window.parent.document&&(ee=!1)}catch(e){ee=!0}if(X&&!t)throw new Error("emit function is required");void 0!==R&&void 0===T.mousemove&&(T.mousemove=R),Ct.reset();var te,ne=!0===y?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==b?b:{password:!0},ae=!0===w||"all"===w?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===w,headMetaDescKeywords:"all"===w}:w||{};!function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===i)return!0}while(i=i&&i.parentNode);return!1})}();var se=0,ue=function(e){var t,n=v(j||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return x&&!ee&&(e=x(e)),e};ht=function(e,i){var o;if(!(null===(o=Pe[0])||void 0===o?void 0:o.isFrozen())||e.type===_e.FullSnapshot||e.type===_e.IncrementalSnapshot&&e.data.source===ye.Mutation||Pe.forEach((function(e){return e.unfreeze()})),X)null==t||t(ue(e),i);else if(ee){var a={type:"rrweb",event:ue(e),origin:window.location.origin,isCheckout:i};window.parent.postMessage(a,"*")}if(e.type===_e.FullSnapshot)te=e,se=0;else if(e.type===_e.IncrementalSnapshot){if(e.data.source===ye.Mutation&&e.data.isAttachIframe)return;se++;var s=r&&se>=r,u=n&&e.timestamp-te.timestamp>n;(s||u)&&vt(!0)}};var le,ce=function(e){ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.Mutation},e)}))},he=function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.Scroll},e)}))},ve=function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.CanvasMutation},e)}))},ge=new yt({mutationCb:ce,adoptedStyleSheetCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.AdoptedStyleSheet},e)}))}}),me=new Ke({mirror:Ct,mutationCb:ce,stylesheetManager:ge,recordCrossOriginIframes:D,wrappedEmit:ht}),be=v(j||[]);try{for(be.s();!(le=be.n()).done;){var ke=le.value;ke.getMirror&&ke.getMirror({nodeMirror:Ct,crossOriginIframeMirror:me.crossOriginIframeMirror,crossOriginIframeStyleMirror:me.crossOriginIframeStyleMirror})}}catch(e){be.e(e)}finally{be.f()}var we=new bt;gt=new _t({recordCanvas:L,mutationCb:ve,win:window,blockClass:o,blockSelector:s,mirror:Ct,sampling:T.canvas,dataURLOptions:M});var Ce=new Ye({mutationCb:ce,scrollCb:he,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:p,maskTextSelector:g,inlineStylesheet:_,maskInputOptions:ne,dataURLOptions:M,maskTextFn:I,maskInputFn:C,recordCanvas:L,inlineImages:G,sampling:T,slimDOMOptions:ae,iframeManager:me,stylesheetManager:ge,canvasManager:gt,keepIframeSrcFn:z,processedNodeManager:we},mirror:Ct});vt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(O){ht(kt({type:_e.Meta,data:{href:window.location.href,width:oe(),height:ie()}}),e),ge.reset(),Ce.init(),Pe.forEach((function(e){return e.lock()}));var t=function(e,t){var n=t||{},r=n.mirror,i=void 0===r?new k:r,o=n.blockClass,a=void 0===o?"rr-block":o,s=n.blockSelector,u=void 0===s?null:s,l=n.maskTextClass,c=void 0===l?"rr-mask":l,d=n.maskTextSelector,f=void 0===d?null:d,p=n.inlineStylesheet,h=void 0===p||p,v=n.inlineImages,g=void 0!==v&&v,m=n.recordCanvas,_=void 0!==m&&m,y=n.maskAllInputs,b=void 0!==y&&y,w=n.maskTextFn,C=n.maskInputFn,I=n.slimDOM,S=void 0!==I&&I,x=n.dataURLOptions,E=n.preserveWhiteSpace,T=n.onSerialize,A=n.onIframeLoad,M=n.iframeLoadTimeout,R=n.onStylesheetLoad,F=n.stylesheetLoadTimeout,O=n.keepIframeSrcFn;return Q(e,{doc:e,mirror:i,blockClass:a,blockSelector:u,maskTextClass:c,maskTextSelector:f,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===b?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===b?{password:!0}:b,maskTextFn:w,maskInputFn:C,slimDOMOptions:!0===S||"all"===S?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===S,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===S?{}:S,dataURLOptions:x,inlineImages:g,recordCanvas:_,preserveWhiteSpace:E,onSerialize:T,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:R,stylesheetLoadTimeout:F,keepIframeSrcFn:void 0===O?function(){return!1}:O,newlyAddedElement:!1})}(document,{mirror:Ct,blockClass:o,blockSelector:s,maskTextClass:p,maskTextSelector:g,inlineStylesheet:_,maskAllInputs:ne,maskTextFn:I,slimDOM:ae,dataURLOptions:M,recordCanvas:L,inlineImages:G,onSerialize:function(e){de(e,Ct)&&me.addIframe(e),fe(e,Ct)&&ge.trackLinkElement(e),pe(e)&&Ce.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){me.attachIframe(e,t),Ce.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ge.attachLinkElement(e,t)},keepIframeSrcFn:z});if(!t)return console.warn("Failed to snapshot the document");ht(kt({type:_e.FullSnapshot,data:{node:t,initialOffset:re(window)}}),e),Pe.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ge.adoptStyleSheets(document.adoptedStyleSheets,Ct.getId(document))}};try{var Ie=[],Se=function(e){var t;return Le(je)({mutationCb:ce,mousemoveCb:function(e,t){return ht(kt({type:_e.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.MouseInteraction},e)}))},scrollCb:he,viewportResizeCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.ViewportResize},e)}))},inputCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.Input},e)}))},mediaInteractionCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.StyleDeclaration},e)}))},canvasMutationCb:ve,fontCb:function(e){return ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.Font},e)}))},selectionCb:function(e){ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.Selection},e)}))},customElementCb:function(e){ht(kt({type:_e.IncrementalSnapshot,data:Object.assign({source:ye.CustomElement},e)}))},blockClass:o,ignoreClass:l,ignoreSelector:d,maskTextClass:p,maskTextSelector:g,maskInputOptions:ne,inlineStylesheet:_,sampling:T,recordDOM:O,recordCanvas:L,inlineImages:G,userTriggeredOnInput:$,collectFonts:W,doc:e,maskInputFn:C,maskTextFn:I,keepIframeSrcFn:z,blockSelector:s,slimDOMOptions:ae,dataURLOptions:M,mirror:Ct,iframeManager:me,stylesheetManager:ge,shadowDomManager:Ce,processedNodeManager:we,canvasManager:gt,ignoreCSSAttributes:J,plugins:(null===(t=null==j?void 0:j.filter((function(e){return e.observer})))||void 0===t?void 0:t.map((function(e){return{observer:e.observer,options:e.options,callback:function(t){return ht(kt({type:_e.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},S)};me.addLoadListener((function(e){try{Ie.push(Se(e.contentDocument))}catch(e){console.warn(e)}}));var xe=function(){vt(),Ie.push(Se(document)),wt=!0};return"interactive"===document.readyState||"complete"===document.readyState?xe():(Ie.push(K("DOMContentLoaded",(function(){ht(kt({type:_e.DomContentLoaded,data:{}})),"DOMContentLoaded"===B&&xe()}))),Ie.push(K("load",(function(){ht(kt({type:_e.Load,data:{}})),"load"===B&&xe()}),window))),function(){Ie.forEach((function(e){return e()})),we.destroy(),wt=!1,Ne()}}catch(e){console.warn(e)}}It.addCustomEvent=function(e,t){if(!wt)throw new Error("please add custom event after start recording");ht(kt({type:_e.Custom,data:{tag:e,payload:t}}))},It.freezePage=function(){Pe.forEach((function(e){return e.freeze()}))},It.takeFullSnapshot=function(e){if(!wt)throw new Error("please take full snapshot after start recording");vt(e)},It.mirror=Ct;var St=function(){function e(t){a(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return u(e,[{key:"toString",value:function(){var e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?"".concat(this.functionName," (").concat(this.fileName,":").concat(e,":").concat(t,")"):"".concat(this.fileName,":").concat(e,":").concat(t)}}]),e}(),xt=/(^|@)\S+:\d+/,Et=/^\s*at .*(\S+:\d+|\(native\))/m,Tt=/^(eval@)?(\[native code])?$/,At={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Et)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error("Cannot parse given url: ".concat(e));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(Et)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/),r=(t=n?t.replace(n[0],""):t).split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new St({functionName:o,fileName:a,lineNumber:i[1],columnNumber:i[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(Tt)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new St({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new St({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}),this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new St({fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera10:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[],i=0,o=n.length;i<o;i+=2){var a=t.exec(n[i]);a&&r.push(new St({functionName:a[3]||void 0,fileName:a[2],lineNumber:parseFloat(a[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(xt)&&!e.match(/^Error created at/)}),this).map((function(e){var t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new St({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Mt(e){if(!e||!e.outerHTML)return"";for(var t="";e.parentElement;){var n=e.localName;if(!n)break;n=n.toLowerCase();var r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(var o=0;o<r.children.length;o++){var a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq(".concat(i.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Rt(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ft(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];if(Rt(e[i])&&Ft(e[i],t-1))return!0}return!1}function Ot(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],i=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?i.splice(o,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Rt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Rt(e)&&Ft(e,n.depthOfLimit))return!0;return!1}(t))return function(e){var t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t="".concat(t.slice(0,n.stringLengthLimit),"..."));return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){var a={};for(var s in t){var u=t[s];Array.isArray(u)?a[s]=Mt(u.length?u[0]:null):a[s]=u}return a}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t}))}var Nt={level:["assert","clear","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],lengthThreshold:1e3,logger:"console"};function Lt(e,t,n){var r,i=n?Object.assign({},Nt,n):Nt,o=i.logger;if(!o)return function(){};r="string"==typeof o?t[o]:o;var a=0,s=!1,u=[];if(i.level.includes("error")){var l=function(t){var n=t.message,r=t.error,o=At.parse(r).map((function(e){return e.toString()})),a=[Ot(n,i.stringifyOptions)];e({level:"error",trace:o,payload:a})};t.addEventListener("error",l),u.push((function(){t.removeEventListener("error",l)}));var c=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Ot("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),i.stringifyOptions)]):(n=new Error,r=[Ot("Uncaught (in promise)",i.stringifyOptions),Ot(t.reason,i.stringifyOptions)]);var o=At.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:o,payload:r})};t.addEventListener("unhandledrejection",c),u.push((function(){t.removeEventListener("unhandledrejection",c)}))}var d,f=v(i.level);try{for(f.s();!(d=f.n()).done;){var p=d.value;u.push(h(r,p))}}catch(e){f.e(e)}finally{f.f()}return function(){u.forEach((function(e){return e()}))};function h(t,n){var r=this;return t[n]?te(t,n,(function(t){return function(){for(var o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(t.apply(r,u),!s){s=!0;try{var c=At.parse(new Error).map((function(e){return e.toString()})).splice(1),d=u.map((function(e){return Ot(e,i.stringifyOptions)}));++a<i.lengthThreshold?e({level:n,trace:c,payload:d}):a===i.lengthThreshold&&e({level:"warn",trace:[],payload:[Ot("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(u))}finally{s=!1}}}})):function(){}}}var Pt=Array.isArray,Dt=Object.prototype,qt=Dt.hasOwnProperty,Bt=Dt.toString,Ht=Pt||function(e){return"[object Array]"===Bt.call(e)},$t=function(e){return"function"==typeof e},Ut=function(e){return e===Object(e)&&!Ht(e)},Wt=function(e){if(Ut(e)){for(var t in e)if(qt.call(e,t))return!1;return!0}return!1},Vt=function(e){return void 0===e},Gt=function(e){return"[object String]"==Bt.call(e)},jt=function(e){return Gt(e)&&0===e.trim().length},Zt=function(e){return null===e},zt=function(e){return Vt(e)||Zt(e)},Qt=function(e){return"[object Number]"==Bt.call(e)},Kt=function(e){return"[object Boolean]"===Bt.call(e)},Yt=function(e){return e instanceof Document},Jt=function(e){return e instanceof FormData},Xt={DEBUG:!1,LIB_VERSION:"1.158.3"},en="undefined"!=typeof window?window:void 0,tn="undefined"!=typeof globalThis?globalThis:en,nn=Array.prototype,rn=nn.forEach,on=nn.indexOf,an=null==tn?void 0:tn.navigator,sn=null==tn?void 0:tn.document,un=null==tn?void 0:tn.location,ln=null==tn?void 0:tn.fetch,cn=null!=tn&&tn.XMLHttpRequest&&"withCredentials"in new tn.XMLHttpRequest?tn.XMLHttpRequest:void 0,dn=null==tn?void 0:tn.AbortController,fn=null==an?void 0:an.userAgent,pn=null!=en?en:{},hn="[PostHog.js]",vn={_log:function(e){if(en&&(Xt.DEBUG||pn.POSTHOG_DEBUG)&&!Vt(en.console)&&en.console){for(var t=("__rrweb_original__"in en.console[e]?en.console[e].__rrweb_original__:en.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,[hn].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];vn._log.apply(vn,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];vn._log.apply(vn,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];vn._log.apply(vn,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[hn].concat(n))},uninitializedWarning:function(e){vn.error("You must initialize PostHog before calling ".concat(e))}},gn={},mn=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function _n(e,t,n){if(Ht(e))if(rn&&e.forEach===rn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===gn)return}function yn(e,t,n){if(!zt(e)){if(Ht(e))return _n(e,t,n);if(Jt(e)){var r,i=v(e.entries());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(t.call(n,o[1],o[0])===gn)return}}catch(e){i.e(e)}finally{i.f()}}else for(var a in e)if(qt.call(e,a)&&t.call(n,e[a],a)===gn)return}}var bn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return _n(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e};function kn(e,t){return-1!==e.indexOf(t)}function wn(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Cn=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},In=function(e){try{return e()}catch(e){return}},Sn=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){vn.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),vn.critical(e)}}},xn=function(e){var t={};return yn(e,(function(e,n){Gt(e)&&e.length>0&&(t[n]=e)})),t},En=function(e){return e.replace(/^\$/,"")};function Tn(e,t){return n=e,r=function(e){return Gt(e)&&!Zt(t)?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),Ht(t)?(o=[],_n(t,(function(t){o.push(e(t))}))):(o={},yn(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}var An=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var a=e.charCodeAt(i),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),Zt(s)||(n>t&&(o+=e.substring(t,n)),o+=s,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},Mn=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var a="on"+n,s=t[a];t[a]=function(t,n,r){return function(i){if(i=i||e(null==en?void 0:en.event)){var o,a=!0;$t(r)&&(o=r(i));var s=n.call(t,i);return!1!==o&&!1!==s||(a=!1),a}}}(t,r,s)}else vn.error("No valid element provided to register_event")}}();function Rn(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}var Fn=["localhost","127.0.0.1"],On=function(e){var t=null==sn?void 0:sn.createElement("a");return Vt(t)?null:(t.href=e,t)},Nn=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},Ln=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return yn(e,(function(e,r){Vt(e)||Vt(r)||"undefined"===r||(t=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)})),i.join(r)},Pn=function(e,t){for(var n,r=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!Ht(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch(e){vn.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Dn=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null};function qn(e){return e?mn(e).split(/\s+/):[]}function Bn(e){var t=null==en?void 0:en.location.href;return!!(t&&e&&e.some((function(e){return t.match(e)})))}function Hn(e){var t="";switch(r(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 qn(t)}function $n(e){return zt(e)?null:mn(e).split(/(\s+)/).filter((function(e){return ir(e)})).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Un(e){var t="";return Kn(e)&&!Yn(e)&&e.childNodes&&e.childNodes.length&&yn(e.childNodes,(function(e){var n;Gn(e)&&e.textContent&&(t+=null!==(n=$n(e.textContent))&&void 0!==n?n:"")})),mn(t)}function Wn(e){return!!e&&1===e.nodeType}function Vn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Gn(e){return!!e&&3===e.nodeType}function jn(e){return!!e&&11===e.nodeType}var Zn=["a","button","form","input","select","textarea","label"];function zn(e){var t=e.parentNode;return!(!t||!Wn(t))&&t}function Qn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!en||!e||Vn(e,"html")||!Wn(e))return!1;if(null!=n&&n.url_allowlist&&!Bn(n.url_allowlist))return!1;if(null!=n&&n.url_ignorelist&&Bn(n.url_ignorelist))return!1;if(null!=n&&n.dom_event_allowlist){var a=n.dom_event_allowlist;if(a&&!a.some((function(e){return t.type===e})))return!1}for(var s=!1,u=[e],l=!0,c=e;c.parentNode&&!Vn(c,"body");)if(jn(c.parentNode))u.push(c.parentNode.host),c=c.parentNode.host;else{if(!(l=zn(c)))break;if(i||Zn.indexOf(l.tagName.toLowerCase())>-1)s=!0;else{var d=en.getComputedStyle(l);d&&"pointer"===d.getPropertyValue("cursor")&&(s=!0)}u.push(l),c=l}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(Vt(n))return!0;var i,o=v(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.tagName.toLowerCase()===t})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(u,n))return!1;if(!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(Vt(n))return!0;var i,o=v(e);try{var a=function(){var e=i.value;if(n.some((function(t){return e.matches(t)})))return{v:!0}};for(o.s();!(i=o.n()).done;){var s=a();if("object"===r(s))return s.v}}catch(e){o.e(e)}finally{o.f()}return!1}(u,n))return!1;var f=en.getComputedStyle(e);if(f&&"pointer"===f.getPropertyValue("cursor")&&"click"===t.type)return!0;var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(o||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(o||["change","click"]).indexOf(t.type)>=0;default:return s?(o||["click"]).indexOf(t.type)>=0:(o||["click"]).indexOf(t.type)>=0&&(Zn.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}function Kn(e){for(var t=e;t.parentNode&&!Vn(t,"body");t=t.parentNode){var n=Hn(t);if(kn(n,"ph-sensitive")||kn(n,"ph-no-capture"))return!1}if(kn(Hn(e),"ph-include"))return!0;var r=e.type||"";if(Gt(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";if(Gt(i)){if(/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))return!1}return!0}function Yn(e){return!!(Vn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Vn(e,"select")||Vn(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var Jn="(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})",Xn=new RegExp("^(?:".concat(Jn,")$")),er=new RegExp(Jn),tr="\\d{3}-?\\d{2}-?\\d{4}",nr=new RegExp("^(".concat(tr,")$")),rr=new RegExp("(".concat(tr,")"));function ir(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(zt(e))return!1;if(Gt(e)){if(e=mn(e),(t?Xn:er).test((e||"").replace(/[- ]/g,"")))return!1;if((t?nr:rr).test(e))return!1}return!0}function or(e){var t=Un(e);return ir(t="".concat(t," ").concat(ar(e)).trim())?t:""}function ar(e){var t="";return e&&e.childNodes&&e.childNodes.length&&yn(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=Un(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(ar(e)).trim())}catch(e){vn.error(e)}})),t}function sr(e){return function(e){var n=e.map((function(e){var n,r,i="";if(e.tag_name&&(i+=e.tag_name),e.attr_class){e.attr_class.sort();var o,a=v(e.attr_class);try{for(a.s();!(o=a.n()).done;){var s=o.value;i+=".".concat(s.replace(/"/g,""))}}catch(e){a.e(e)}finally{a.f()}}var u=t(t(t(t({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(n=e.nth_child)&&void 0!==n?n:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),l={};return wn(u).sort((function(e,t){var n=d(e,1)[0],r=d(t,1)[0];return n.localeCompare(r)})).forEach((function(e){var t=d(e,2),n=t[0],r=t[1];return l[ur(n.toString())]=ur(r.toString())})),i+=":",i+=wn(u).map((function(e){var t=d(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')})).join("")}));return n.join(";")}(function(e){return e.map((function(e){var t,n,r={text:null===(t=e.$el_text)||void 0===t?void 0:t.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:lr(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return wn(e).filter((function(e){return 0===d(e,1)[0].indexOf("attr__")})).forEach((function(e){var t=d(e,2),n=t[0],i=t[1];return r.attributes[n]=i})),r}))}(e))}function ur(e){return e.replace(/"|\\"/g,'\\"')}function lr(e){var t=e.attr__class;return t?Ht(t)?t:qn(t):void 0}var cr="[SessionRecording]",dr="redacted",fr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},pr=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],hr=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],vr=["/s/","/e/","/i/"];function gr(e,t,n,r){if(zt(e))return e;var i=(null==t?void 0:t["content-length"])||function(e){return new Blob([e]).size}(e);return Gt(i)&&(i=parseInt(i)),i>n?cr+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function mr(e,t){if(zt(e))return e;var n=e;return ir(n,!1)||(n=cr+" "+t+" body "+dr),yn(hr,(function(e){var r,i;null!==(r=n)&&void 0!==r&&r.length&&-1!==(null===(i=n)||void 0===i?void 0:i.indexOf(e))&&(n=cr+" "+t+" body "+dr+" as might contain: "+e)})),n}var _r=function(e,n){var r,i,o,a={payloadSizeLimitBytes:fr.payloadSizeLimitBytes,performanceEntryTypeToObserve:f(fr.performanceEntryTypeToObserve),payloadHostDenyList:[].concat(f(n.payloadHostDenyList||[]),f(fr.payloadHostDenyList))},s=!1!==e.session_recording.recordHeaders&&n.recordHeaders,u=!1!==e.session_recording.recordBody&&n.recordBody,l=!1!==e.capture_performance&&n.recordPerformance,c=(r=a,o=Math.min(1e6,null!==(i=r.payloadSizeLimitBytes)&&void 0!==i?i:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=gr(e.requestBody,e.requestHeaders,o,"Request")),null!=e&&e.responseBody&&(e.responseBody=gr(e.responseBody,e.responseHeaders,o,"Response")),e}),d=function(e){return c(function(e){var t=On(e.name);if(!(t&&t.pathname&&vr.some((function(e){return 0===t.pathname.indexOf(e)}))))return e}((n=(t=e).requestHeaders,zt(n)||yn(Object.keys(null!=n?n:{}),(function(e){pr.includes(e.toLowerCase())&&(n[e]=dr)})),t)));var t,n},p=$t(e.session_recording.maskNetworkRequestFn);return p&&$t(e.session_recording.maskCapturedNetworkRequestFn)&&vn.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),p&&(e.session_recording.maskCapturedNetworkRequestFn=function(n){var r=e.session_recording.maskNetworkRequestFn({url:n.name});return t(t({},n),{},{name:null==r?void 0:r.url})}),a.maskRequestFn=$t(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,r,i,o=d(t);return o&&null!==(n=null===(r=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(i,o))&&void 0!==n?n:void 0}:function(e){return function(e){if(!Vt(e))return e.requestBody=mr(e.requestBody,"Request"),e.responseBody=mr(e.responseBody,"Response"),e}(d(e))},t(t(t({},fr),a),{},{recordHeaders:s,recordBody:u,recordPerformance:l,recordInitialRequests:l})};function yr(e,t,n){try{if(!(t in e))return function(){};var r=e[t],i=n(r);return $t(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,function(){e[t]=r}}catch(e){return function(){}}}function br(e,t){var n,r=function(e){try{return"string"==typeof e?new URL(e).hostname:"url"in e?new URL(e.url).hostname:e.hostname}catch(e){return null}}(e),i={hostname:r,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==r||!r.trim().length)return i;var o,a=v(t.payloadHostDenyList);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(r.endsWith(s))return{hostname:r,isHostDenied:!0}}}catch(e){a.e(e)}finally{a.f()}return i}var kr=function(e){return"navigation"===e.entryType},wr=function(e){return"resource"===e.entryType};function Cr(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function Ir(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((function(e){return kr(e)||wr(e)&&n.initiatorTypes.includes(e.initiatorType)}));e({requests:r.flatMap((function(e){return Rr(e,void 0,void 0,{},!0)})),isInitial:!0})}var i=new t.PerformanceObserver((function(t){var r=t.getEntries().filter((function(e){return kr(e)||wr(e)&&n.initiatorTypes.includes(e.initiatorType)&&function(e){return!n.recordBody&&!n.recordHeaders||"xmlhttprequest"!==e.initiatorType&&"fetch"!==e.initiatorType}(e)}));e({requests:r.flatMap((function(e){return Rr(e,void 0,void 0,{})}))})})),o=PerformanceObserver.supportedEntryTypes.filter((function(e){return n.performanceEntryTypeToObserve.includes(e)}));return i.observe({entryTypes:o}),function(){i.disconnect()}}function Sr(e,t){return!!t&&(Kt(t)||t[e])}function xr(e){var t=e.type,n=e.recordBody,r=e.headers;function i(e){var t=Object.keys(r).find((function(e){return"content-type"===e.toLowerCase()})),n=t&&r[t];return e.some((function(e){return null==n?void 0:n.includes(e)}))}if(!n)return!1;if(Kt(n))return!0;if(Ht(n))return i(n);var o=n[t];return Kt(o)?o:i(o)}function Er(e,t,n,r,i){return Tr.apply(this,arguments)}function Tr(){return Tr=o(n().mark((function e(t,r,i,o,a){var s,u,l,c=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((s=c.length>5&&void 0!==c[5]?c[5]:0)>10)){e.next=4;break}return vn.warn("Failed to get performance entry for request",{url:i,initiatorType:r}),e.abrupt("return",null);case 4:if(u=t.performance.getEntriesByName(i),l=Cr(u,(function(e){return wr(e)&&e.initiatorType===r&&(!o||e.startTime>=o)&&(!a||e.startTime<=a)}))){e.next=10;break}return e.next=9,new Promise((function(e){return setTimeout(e,50*s)}));case 9:return e.abrupt("return",Er(t,r,i,o,a,s+1));case 10:return e.abrupt("return",l);case 11:case"end":return e.stop()}}),e)}))),Tr.apply(this,arguments)}function Ar(e){var t=e.body,n=e.options,r=e.url;if(zt(t))return null;var i=br(r,n),o=i.hostname;if(i.isHostDenied)return o+" is in deny list";if(Gt(t))return t;if(Yt(t))return t.textContent;if(Jt(t))return Ln(t);if(Ut(t))try{return JSON.stringify(t)}catch(e){return"[SessionReplay] Failed to stringify response object"}return"[SessionReplay] Cannot read body of type "+toString.call(t)}var Mr=function(e){return"navigation"===e.entryType||"resource"===e.entryType};function Rr(e,n,r,i,o){var a=Math.floor(Date.now()-performance.now()),s=Math.floor(a+e.startTime),u=[t(t({},e.toJSON()),{},{startTime:Math.round(e.startTime),endTime:Math.round(e.responseEnd),timeOrigin:a,timestamp:s,method:n,initiatorType:e.initiatorType,status:r,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:o})];if(Mr(e)){var l,c=v(e.serverTiming||[]);try{for(c.s();!(l=c.n()).done;){var d=l.value;u.push({timeOrigin:a,timestamp:s,startTime:Math.round(e.startTime),name:d.name,duration:d.duration,entryType:"serverTiming"})}}catch(e){c.e(e)}finally{c.f()}}return u}var Fr=["video/","audio/"];function Or(e){var t,n=e.r,r=e.options,i=e.url;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var o=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),a=Fr.some((function(e){return null==o?void 0:o.startsWith(e)}));if(o&&a)return"Content-Type ".concat(o," is not supported");var s=br(i,r),u=s.hostname;return s.isHostDenied?u+" is in deny list":null}function Nr(e){return new Promise((function(t,n){var r=setTimeout((function(){return t("[SessionReplay] Timeout while trying to read body")}),500);e.clone().text().then((function(e){return t(e)}),(function(e){return n(e)})).finally((function(){return clearTimeout(r)}))}))}function Lr(e){return Pr.apply(this,arguments)}function Pr(){return Pr=o(n().mark((function e(t){var r,i,o,a,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.r,i=t.options,o=t.url,a=br(o,i),s=a.hostname,!a.isHostDenied){e.next=4;break}return e.abrupt("return",Promise.resolve(s+" is in deny list"));case 4:return e.abrupt("return",Nr(r));case 5:case"end":return e.stop()}}),e)}))),Pr.apply(this,arguments)}function Dr(e){return qr.apply(this,arguments)}function qr(){return qr=o(n().mark((function e(t){var r,i,o,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.r,i=t.options,o=t.url,a=Or({r:r,options:i,url:o}),Zt(a)){e.next=4;break}return e.abrupt("return",Promise.resolve(a));case 4:return e.abrupt("return",Nr(r));case 5:case"end":return e.stop()}}),e)}))),qr.apply(this,arguments)}var Br=null;function Hr(e,r,i){if(!("performance"in r))return function(){};if(Br)return vn.warn("Network observer already initialised, doing nothing"),function(){};var a=i?Object.assign({},fr,i):fr,s=function(n){var r=[];n.requests.forEach((function(e){var t=a.maskRequestFn(e);t&&r.push(t)})),r.length>0&&e(t(t({},n),{},{requests:r}))},u=Ir(s,r,a),l=function(){},c=function(){};return(a.recordHeaders||a.recordBody)&&(l=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return function(){};var r=Sr("request",n.recordHeaders),i=Sr("response",n.recordHeaders),o=yr(t.XMLHttpRequest.prototype,"open",(function(o){return function(a,s){var u,l,c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,f=arguments.length>4?arguments[4]:void 0,p=this,h=new Request(s),v={},g={},m=p.setRequestHeader.bind(p);p.setRequestHeader=function(e,t){return g[e]=t,m(e,t)},r&&(v.requestHeaders=g);var _=p.send.bind(p);p.send=function(e){return xr({type:"request",headers:g,url:s,recordBody:n.recordBody})&&(v.requestBody=Ar({body:e,options:n,url:s})),u=t.performance.now(),_(e)},p.addEventListener("readystatechange",(function(){if(p.readyState===p.DONE){l=t.performance.now();var r={};p.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var t=e.split(": "),n=t.shift(),i=t.join(": ");n&&(r[n]=i)})),i&&(v.responseHeaders=r),xr({type:"response",headers:r,url:s,recordBody:n.recordBody})&&(v.responseBody=Ar({body:p.response,options:n,url:s})),Er(t,"xmlhttprequest",h.url,u,l).then((function(t){if(!Zt(t)){var n=Rr(t,h.method,null==p?void 0:p.status,v);e({requests:n})}})).catch((function(){}))}})),o.call(p,a,s,c,d,f)}}));return function(){o()}}(s,r,a),c=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return function(){};var i=Sr("request",r.recordHeaders),a=Sr("response",r.recordHeaders),s=yr(t,"fetch",(function(s){return function(){var u=o(n().mark((function o(u,l){var c,d,f,p,h,v,g;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(c=new Request(u,l),f={},n.prev=2,v={},c.headers.forEach((function(e,t){v[t]=e})),i&&(f.requestHeaders=v),!xr({type:"request",headers:v,url:u,recordBody:r.recordBody})){n.next=10;break}return n.next=9,Lr({r:c,options:r,url:u});case 9:f.requestBody=n.sent;case 10:return p=t.performance.now(),n.next=13,s(c);case 13:if(d=n.sent,h=t.performance.now(),g={},d.headers.forEach((function(e,t){g[t]=e})),a&&(f.responseHeaders=g),!xr({type:"response",headers:g,url:u,recordBody:r.recordBody})){n.next=22;break}return n.next=21,Dr({r:d,options:r,url:u});case 21:f.responseBody=n.sent;case 22:return n.abrupt("return",d);case 23:return n.prev=23,Er(t,"fetch",c.url,p,h).then((function(t){var n;if(!Zt(t)){var r=Rr(t,c.method,null===(n=d)||void 0===n?void 0:n.status,f);e({requests:r})}})).catch((function(){})),n.finish(23);case 26:case"end":return n.stop()}}),o,null,[[2,,23,26]])})));return function(e,t){return u.apply(this,arguments)}}()}));return function(){s()}}(s,r,a)),Br=function(){u(),l(),c()}}var $r,Ur,Wr;en&&(en.rrweb={record:It,version:"v2",rrwebVersion:"2.0.0-alpha.13"},en.rrwebConsoleRecord={getRecordConsolePlugin:function(e){return{name:"rrweb/console@1",observer:Lt,options:e}}},en.getRecordNetworkPlugin=function(e){return{name:"rrweb/network@1",observer:Hr,options:e}}),function(e){e.Popover="popover",e.API="api",e.Widget="widget"}($r||($r={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Ur||(Ur={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Wr||(Wr={}));var Vr,Gr,jr,Zr,zr,Qr,Kr,Yr,Jr={},Xr=[],ei=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ti=Array.isArray;function ni(e,t){for(var n in t)e[n]=t[n];return e}function ri(e){var t=e.parentNode;t&&t.removeChild(e)}function ii(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Vr.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return oi(e,a,r,i,null)}function oi(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++jr:i,__i:-1,__u:0};return null==i&&null!=Gr.vnode&&Gr.vnode(o),o}function ai(e){return e.children}function si(e,t){this.props=e,this.context=t}function ui(e,t){if(null==t)return e.__?ui(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?ui(e):null}function li(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return li(e)}}function ci(e){(!e.__d&&(e.__d=!0)&&Zr.push(e)&&!di.__r++||zr!==Gr.debounceRendering)&&((zr=Gr.debounceRendering)||Qr)(di)}function di(){var e,t,n,r,i,o,a,s,u;for(Zr.sort(Kr);e=Zr.shift();)e.__d&&(t=Zr.length,r=void 0,o=(i=(n=e).__v).__e,s=[],u=[],(a=n.__P)&&((r=ni({},i)).__v=i.__v+1,Gr.vnode&&Gr.vnode(r),yi(a,r,i,n.__n,void 0!==a.ownerSVGElement,32&i.__u?[o]:null,s,null==o?ui(i):o,!!(32&i.__u),u),r.__.__k[r.__i]=r,bi(s,r,u),r.__e!=o&&li(r)),Zr.length>t&&Zr.sort(Kr));di.__r=0}function fi(e,t,n,r,i,o,a,s,u,l,c){var d,f,p,h,v,g=r&&r.__k||Xr,m=t.length;for(n.__d=u,function(e,t,n){var r,i,o,a,s,u=t.length,l=n.length,c=l,d=0;for(e.__k=[],r=0;r<u;r++)null!=(i=e.__k[r]=null==(i=t[r])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?oi(null,i,null,null,i):ti(i)?oi(ai,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?oi(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,s=hi(i,n,a=r+d,c),i.__i=s,o=null,-1!==s&&(c--,(o=n[s])&&(o.__u|=131072)),null==o||null===o.__v?(-1==s&&d--,"function"!=typeof i.type&&(i.__u|=65536)):s!==a&&(s===a+1?d++:s>a?c>u-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==r+d&&(i.__u|=65536))):(o=n[r])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=ui(o)),Ci(o,o,!1),n[r]=null,c--);if(c)for(r=0;r<l;r++)null!=(o=n[r])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=ui(o)),Ci(o,o))}(n,t,g),u=n.__d,d=0;d<m;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(f=-1===p.__i?Jr:g[p.__i]||Jr,p.__i=d,yi(e,p,f,i,o,a,s,u,l,c),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&wi(f.ref,null,p),c.push(p.ref,p.__c||h,p)),null==v&&null!=h&&(v=h),65536&p.__u||f.__k===p.__k?u=pi(p,u,e):"function"==typeof p.type&&void 0!==p.__d?u=p.__d:h&&(u=h.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=u,n.__e=v}function pi(e,t,n){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=pi(r[i],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function hi(e,t,n,r){var i=e.key,o=e.type,a=n-1,s=n+1,u=t[n];if(null===u||u&&i==u.key&&o===u.type)return n;if(r>(null!=u&&0==(131072&u.__u)?1:0))for(;a>=0||s<t.length;){if(a>=0){if((u=t[a])&&0==(131072&u.__u)&&i==u.key&&o===u.type)return a;a--}if(s<t.length){if((u=t[s])&&0==(131072&u.__u)&&i==u.key&&o===u.type)return s;s++}}return-1}function vi(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||ei.test(t)?n:n+"px"}function gi(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||vi(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||vi(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?_i:mi,o)):e.removeEventListener(t,o?_i:mi,o);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function mi(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Gr.event?Gr.event(e):e)}function _i(e){return this.l[e.type+!0](Gr.event?Gr.event(e):e)}function yi(e,t,n,r,i,o,a,s,u,l){var c,d,f,p,h,v,g,m,_,y,b,k,w,C,I,S=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(u=!!(32&n.__u),o=[s=t.__e=n.__e]),(c=Gr.__b)&&c(t);e:if("function"==typeof S)try{if(m=t.props,_=(c=S.contextType)&&r[c.__c],y=c?_?_.props.value:c.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:("prototype"in S&&S.prototype.render?t.__c=d=new S(m,y):(t.__c=d=new si(m,y),d.constructor=S,d.render=Ii),_&&_.sub(d),d.props=m,d.state||(d.state={}),d.context=y,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=S.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=ni({},d.__s)),ni(d.__s,S.getDerivedStateFromProps(m,d.__s))),p=d.props,h=d.state,d.__v=t,f)null==S.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==S.getDerivedStateFromProps&&m!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=m,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,y),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(p,h,v)}))}if(d.context=y,d.props=m,d.__P=e,d.__e=!1,k=Gr.__r,w=0,"prototype"in S&&S.prototype.render){for(d.state=d.__s,d.__d=!1,k&&k(t),c=d.render(d.props,d.state,d.context),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[]}else do{d.__d=!1,k&&k(t),c=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++w<25);d.state=d.__s,null!=d.getChildContext&&(r=ni(ni({},r),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(v=d.getSnapshotBeforeUpdate(p,h)),fi(e,ti(I=null!=c&&c.type===ai&&null==c.key?c.props.children:c)?I:[I],t,n,r,i,o,a,s,u,l),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,u||null!=o?(t.__e=s,t.__u|=u?160:32,o[o.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),Gr.__e(e,t,n)}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=ki(n.__e,t,n,r,i,o,a,u,l);(c=Gr.diffed)&&c(t)}function bi(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)wi(n[r],n[++r],n[++r]);Gr.__c&&Gr.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Gr.__e(e,t.__v)}}))}function ki(e,t,n,r,i,o,a,s,u){var l,c,d,f,p,h,v,g=n.props,m=t.props,_=t.type;if("svg"===_&&(i=!0),null!=o)for(l=0;l<o.length;l++)if((p=o[l])&&"setAttribute"in p==!!_&&(_?p.localName===_:3===p.nodeType)){e=p,o[l]=null;break}if(null==e){if(null===_)return document.createTextNode(m);e=i?document.createElementNS("http://www.w3.org/2000/svg",_):document.createElement(_,m.is&&m),o=null,s=!1}if(null===_)g===m||s&&e.data===m||(e.data=m);else{if(o=o&&Vr.call(e.childNodes),g=n.props||Jr,!s&&null!=o)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)p=g[l],"children"==l||("dangerouslySetInnerHTML"==l?d=p:"key"===l||l in m||gi(e,l,null,p,i));for(l in m)p=m[l],"children"==l?f=p:"dangerouslySetInnerHTML"==l?c=p:"value"==l?h=p:"checked"==l?v=p:"key"===l||s&&"function"!=typeof p||g[l]===p||gi(e,l,p,g[l],i);if(c)s||d&&(c.__html===d.__html||c.__html===e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),fi(e,ti(f)?f:[f],t,n,r,i&&"foreignObject"!==_,o,a,o?o[0]:n.__k&&ui(n,0),s,u),null!=o)for(l=o.length;l--;)null!=o[l]&&ri(o[l]);s||(l="value",void 0!==h&&(h!==e[l]||"progress"===_&&!h||"option"===_&&h!==g[l])&&gi(e,l,h,g[l],!1),l="checked",void 0!==v&&v!==e[l]&&gi(e,l,v,g[l],!1))}return e}function wi(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Gr.__e(e,n)}}function Ci(e,t,n){var r,i;if(Gr.unmount&&Gr.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||wi(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Gr.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Ci(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||ri(e.__e),e.__=e.__e=e.__d=void 0}function Ii(e,t,n){return this.constructor(e,n)}function Si(e,t,n){var r,i,o,a;Gr.__&&Gr.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],a=[],yi(t,e=(!r&&n||t).__k=ii(ai,null,[e]),i||Jr,Jr,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Vr.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r,a),bi(o,e,a)}function xi(e,t,n){var r,i,o,a,s=ni({},e.props);for(o in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==o?r=t[o]:"ref"==o?i=t[o]:s[o]=void 0===t[o]&&void 0!==a?a[o]:t[o];return arguments.length>2&&(s.children=arguments.length>3?Vr.call(arguments,2):n),oi(e.type,s,r||e.key,i||e.ref,null)}Vr=Xr.slice,Gr={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},jr=0,si.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=ni({},this.state),"function"==typeof e&&(e=e(ni({},n),this.props)),e&&ni(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),ci(this))},si.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ci(this))},si.prototype.render=ai,Zr=[],Qr="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Kr=function(e,t){return e.__v.__b-t.__v.__b},di.__r=0,Yr=0;var Ei=en,Ti=sn,Ai=function(e){return'\n .survey-form, .thank-you-message {\n position: fixed;\n margin: 0px;\n bottom: 0px;\n color: black;\n font-weight: normal;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n text-align: left;\n max-width: '.concat(parseInt((null==e?void 0:e.maxWidth)||"300"),"px;\n width: 100%;\n z-index: ").concat(parseInt((null==e?void 0:e.zIndex)||"99999"),";\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n border-bottom: 0px;\n ").concat({left:"left: 30px;",right:"right: 30px;",center:"\n left: 50%;\n transform: translateX(-50%);\n "}[(null==e?void 0:e.position)||"right"]||"right: 30px;","\n flex-direction: column;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",';\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n box-shadow: -6px 0 16px -8px rgb(0 0 0 / 8%), -9px 0 28px 0 rgb(0 0 0 / 5%), -12px 0 48px 16px rgb(0 0 0 / 3%);\n }\n \n .survey-box, .thank-you-message-container {\n padding: 20px 25px 10px;\n display: flex;\n flex-direction: column;\n border-radius: 10px;\n }\n\n .thank-you-message {\n text-align: center;\n }\n\n .form-submit[disabled] {\n opacity: 0.6;\n filter: grayscale(50%);\n cursor: not-allowed;\n }\n .survey-form textarea {\n color: #2d2d2d;\n font-size: 14px;\n font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";\n background: white;\n color: black;\n outline: none;\n padding-left: 10px;\n padding-right: 10px;\n padding-top: 10px;\n border-radius: 6px;\n border-color: ').concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n margin-top: 14px;\n width: 100%;\n box-sizing: border-box;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) textarea {\n margin-top: 0;\n }\n .form-submit {\n box-sizing: border-box;\n margin: 0;\n font-family: inherit;\n overflow: visible;\n text-transform: none;\n position: relative;\n display: inline-block;\n font-weight: 700;\n white-space: nowrap;\n text-align: center;\n border: 1.5px solid transparent;\n cursor: pointer;\n user-select: none;\n touch-action: manipulation;\n padding: 12px;\n font-size: 14px;\n border-radius: 6px;\n outline: 0;\n background: ").concat((null==e?void 0:e.submitButtonColor)||"black"," !important;\n text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 0 rgba(0, 0, 0, 0.045);\n width: 100%;\n }\n .form-cancel {\n display: flex;\n float: right;\n border: none;\n background: none;\n cursor: pointer;\n }\n .cancel-btn-wrapper {\n position: absolute;\n width: 35px;\n height: 35px;\n border-radius: 100%;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n background: white;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .bolded { font-weight: 600; }\n .buttons {\n display: flex;\n justify-content: center;\n }\n .footer-branding {\n font-size: 11px;\n margin-top: 10px;\n text-align: center;\n display: flex;\n justify-content: center;\n gap: 4px;\n align-items: center;\n font-weight: 500;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n text-decoration: none;\n backgroundColor: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n color: ").concat(Ri((null==e?void 0:e.backgroundColor)||"#eeeded"),";\n }\n .survey-question {\n font-weight: 500;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .question-textarea-wrapper {\n display: flex;\n flex-direction: column;\n }\n .survey-question-description {\n font-size: 13px;\n padding-top: 5px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .ratings-number {\n font-size: 16px;\n font-weight: 600;\n padding: 8px 0px;\n border: none;\n }\n .ratings-number:hover {\n cursor: pointer;\n }\n .rating-options {\n margin-top: 14px;\n }\n .rating-options-number {\n display: grid;\n border-radius: 6px;\n overflow: hidden;\n border: 1.5px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number {\n border-right: 1px solid ").concat((null==e?void 0:e.borderColor)||"#c9c6c6",";\n }\n .rating-options-number > .ratings-number:last-of-type {\n border-right: 0px;\n }\n .rating-options-number .rating-active {\n background: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .rating-options-emoji {\n display: flex;\n justify-content: space-between;\n }\n .ratings-emoji {\n font-size: 16px;\n background-color: transparent;\n border: none;\n padding: 0px;\n }\n .ratings-emoji:hover {\n cursor: pointer;\n }\n .ratings-emoji.rating-active svg {\n fill: ").concat((null==e?void 0:e.ratingButtonActiveColor)||"black",";\n }\n .emoji-svg {\n fill: '#939393';\n }\n .rating-text {\n display: flex;\n flex-direction: row;\n font-size: 11px;\n justify-content: space-between;\n margin-top: 6px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n opacity: .60;\n }\n .multiple-choice-options {\n margin-top: 13px;\n font-size: 14px;\n }\n .survey-box:has(.survey-question:empty):not(:has(.survey-question-description)) .multiple-choice-options {\n margin-top: 0;\n }\n .multiple-choice-options .choice-option {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 13px;\n cursor: pointer;\n margin-bottom: 5px;\n position: relative;\n }\n .multiple-choice-options > .choice-option:last-of-type {\n margin-bottom: 0px;\n }\n .multiple-choice-options input {\n cursor: pointer;\n position: absolute;\n opacity: 0;\n }\n .choice-check {\n position: absolute;\n right: 10px;\n background: white;\n }\n .choice-check svg {\n display: none;\n }\n .multiple-choice-options .choice-option:hover .choice-check svg {\n display: inline-block;\n opacity: .25;\n }\n .multiple-choice-options input:checked + label + .choice-check svg {\n display: inline-block;\n opacity: 100% !important;\n }\n .multiple-choice-options input:checked + label {\n font-weight: bold;\n border: 1.5px solid rgba(0,0,0);\n }\n .multiple-choice-options input:checked + label input {\n font-weight: bold;\n }\n .multiple-choice-options label {\n width: 100%;\n cursor: pointer;\n padding: 10px;\n border: 1.5px solid rgba(0,0,0,.25);\n border-radius: 4px;\n background: white;\n }\n .multiple-choice-options .choice-option-open label {\n padding-right: 30px;\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-width: 100%;\n }\n .multiple-choice-options .choice-option-open label span {\n width: 100%;\n }\n .multiple-choice-options .choice-option-open input:disabled + label {\n opacity: 0.6;\n }\n .multiple-choice-options .choice-option-open label input {\n position: relative;\n opacity: 1;\n flex-grow: 1;\n border: 0;\n outline: 0;\n }\n .thank-you-message-body {\n margin-top: 6px;\n font-size: 14px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-header {\n margin: 10px 0px 0px;\n background: ").concat((null==e?void 0:e.backgroundColor)||"#eeeded",";\n }\n .thank-you-message-container .form-submit {\n margin-top: 20px;\n margin-bottom: 10px;\n }\n .thank-you-message-countdown {\n margin-left: 6px;\n }\n .bottom-section {\n margin-top: 14px;\n }\n ")};function Mi(e){if("#"===e[0]){var t=e.replace(/^#/,"");return"rgb("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+")"}return"rgb(255, 255, 255)"}function Ri(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Oi;"#"===t[0]&&(e=Mi(t)),t.startsWith("rgb")&&(e=t);var n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(n&&(e=Mi(n)),!e)return"black";var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var i=parseInt(r[1]),o=parseInt(r[2]),a=parseInt(r[3]);return Math.sqrt(i*i*.299+o*o*.587+a*a*.114)>127.5?"black":"white"}return"black"}var Fi={backgroundColor:"#eeeded",submitButtonColor:"black",submitButtonTextColor:"white",ratingButtonColor:"white",ratingButtonActiveColor:"black",borderColor:"#c9c6c6",placeholder:"Start typing...",whiteLabel:!1,displayThankYouMessage:!0,thankYouMessageHeader:"Thank you for your feedback!",position:"right"},Oi="#eeeded",Ni=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0;i&&(localStorage.setItem(Hi(r),"true"),i.capture("survey sent",t(t({$survey_name:r.name,$survey_id:r.id,$survey_iteration:r.current_iteration,$survey_iteration_start_date:r.current_iteration_start_date,$survey_questions:r.questions.map((function(e){return e.question})),sessionRecordingUrl:null===(e=i.get_session_replay_url)||void 0===e?void 0:e.call(i)},n),{},{$set:l({},$i(r,"responded"),!0)})),Ei.dispatchEvent(new Event("PHSurveySent")))},Li=function(e,t,n){var r;!n&&t&&(t.capture("survey dismissed",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(r=t.get_session_replay_url)||void 0===r?void 0:r.call(t),$set:l({},$i(e,"dismissed"),!0)}),localStorage.setItem(Hi(e),"true"),Ei.dispatchEvent(new Event("PHSurveyClosed")))},Pi=function(e){return e.map((function(e){return{sort:Math.floor(10*Math.random()),value:e}})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.value}))},Di=function(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))?t.reverse():t},qi=function(e){return e.questions.forEach((function(e,t){e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?Di(e.questions,Pi(e.questions)):e.questions},Bi=function(e){var t,n;return!(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||!n.repeatedActivation||!function(e){var t,n,r,i,o,a;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r?void 0:r.length)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(a=o.values)||void 0===a?void 0:a.length)>0}(e))},Hi=function(e){var t="seenSurvey_".concat(e.id);return e.current_iteration&&e.current_iteration>0&&(t="seenSurvey_".concat(e.id,"_").concat(e.current_iteration)),t},$i=function(e,t){var n="$survey_".concat(t,"/").concat(e.id);return e.current_iteration&&e.current_iteration>0&&(n="$survey_".concat(t,"/").concat(e.id,"/").concat(e.current_iteration)),n},Ui=function(e,t){var n={__c:t="__cC"+Yr++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,ci(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}({isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:function(){},isPopup:!0}),Wi=function(e){var t=e.component,n=e.children,r=e.renderAsHtml,i=e.style;return xi(t,r?{dangerouslySetInnerHTML:{__html:n},style:i}:{children:n,style:i})},Vi=sn;var Gi,ji,Zi,zi,Qi=0,Ki=[],Yi=[],Ji=Gr.__b,Xi=Gr.__r,eo=Gr.diffed,to=Gr.__c,no=Gr.unmount;function ro(e,t){Gr.__h&&Gr.__h(ji,e,Qi||t),Qi=0;var n=ji.__H||(ji.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Yi}),n.__[e]}function io(e){return Qi=1,function(e,t,n){var r=ro(Gi++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):go(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=ji,!ji.u)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var a=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&r.__c.props===e)&&(!o||o.call(this,e,t,n))};ji.u=!0;var o=ji.shouldComponentUpdate,a=ji.componentWillUpdate;ji.componentWillUpdate=function(e,t,n){if(this.__e){var r=o;o=void 0,i(e,t,n),o=r}a&&a.call(this,e,t,n)},ji.shouldComponentUpdate=i}return r.__N||r.__}(go,e)}function oo(e,t){var n=ro(Gi++,3);!Gr.__s&&vo(n.__H,t)&&(n.__=e,n.i=t,ji.__H.__h.push(n))}function ao(e){return Qi=5,so((function(){return{current:e}}),[])}function so(e,t){var n=ro(Gi++,7);return vo(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function uo(e){var t=ji.context[e.__c],n=ro(Gi++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(ji)),t.props.value):e.__}function lo(){for(var e;e=Ki.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(po),e.__H.__h.forEach(ho),e.__H.__h=[]}catch(t){e.__H.__h=[],Gr.__e(t,e.__v)}}Gr.__b=function(e){ji=null,Ji&&Ji(e)},Gr.__r=function(e){Xi&&Xi(e),Gi=0;var t=(ji=e.__c).__H;t&&(Zi===ji?(t.__h=[],ji.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Yi,e.__N=e.i=void 0}))):(t.__h.forEach(po),t.__h.forEach(ho),t.__h=[],Gi=0)),Zi=ji},Gr.diffed=function(e){eo&&eo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Ki.push(t)&&zi===Gr.requestAnimationFrame||((zi=Gr.requestAnimationFrame)||fo)(lo)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Yi&&(e.__=e.__V),e.i=void 0,e.__V=Yi}))),Zi=ji=null},Gr.__c=function(e,t){t.some((function(e){try{e.__h.forEach(po),e.__h=e.__h.filter((function(e){return!e.__||ho(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Gr.__e(n,e.__v)}})),to&&to(e,t)},Gr.unmount=function(e){no&&no(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{po(e)}catch(e){t=e}})),n.__H=void 0,t&&Gr.__e(t,n.__v))};var co="function"==typeof requestAnimationFrame;function fo(e){var t,n=function(){clearTimeout(r),co&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);co&&(t=requestAnimationFrame(n))}function po(e){var t=ji,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),ji=t}function ho(e){var t=ji;e.__c=e.__(),ji=t}function vo(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function go(e,t){return"function"==typeof t?t(e):t}var mo=0;function _o(e,t,n,r,i,o){var a,s,u={};for(s in t)"ref"==s?a=t[s]:u[s]=t[s];var l={type:e,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--mo,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(a=e.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return Gr.vnode&&Gr.vnode(l),l}var yo=_o("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_o("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),bo=_o("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_o("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),ko=_o("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_o("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),wo=_o("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_o("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Co=_o("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:_o("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Io=_o("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_o("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:"black"})}),So=_o("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[_o("g",{"clip-path":"url(#clip0_2415_6911)",children:[_o("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:_o("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),_o("g",{mask:"url(#mask0_2415_6911)",children:[_o("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),_o("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),_o("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),_o("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),_o("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),_o("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),_o("defs",{children:_o("clipPath",{id:"clip0_2415_6911",children:_o("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),xo=_o("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_o("path",{d:"M5.30769 10.6923L4.77736 11.2226C4.91801 11.3633 5.10878 11.4423 5.30769 11.4423C5.5066 11.4423 5.69737 11.3633 5.83802 11.2226L5.30769 10.6923ZM15.5303 1.53033C15.8232 1.23744 15.8232 0.762563 15.5303 0.46967C15.2374 0.176777 14.7626 0.176777 14.4697 0.46967L15.5303 1.53033ZM1.53033 5.85429C1.23744 5.56139 0.762563 5.56139 0.46967 5.85429C0.176777 6.14718 0.176777 6.62205 0.46967 6.91495L1.53033 5.85429ZM5.83802 11.2226L15.5303 1.53033L14.4697 0.46967L4.77736 10.162L5.83802 11.2226ZM0.46967 6.91495L4.77736 11.2226L5.83802 10.162L1.53033 5.85429L0.46967 6.91495Z",fill:"currentColor"})});function Eo(){return _o("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",So]})}function To(e){var t=e.text,n=e.submitDisabled,r=e.appearance,i=e.onSubmit,o=e.link,a=uo(Ui),s=a.isPreviewMode,u=a.isPopup,l=r.submitButtonTextColor||Ri(r.submitButtonColor||Fi.submitButtonColor);return _o("div",{className:"bottom-section",children:[_o("div",{className:"buttons",children:_o("button",{className:"form-submit",disabled:n&&!s,type:"button",style:u?{color:l}:{},onClick:function(){s||(o&&(null==en||en.open(o)),i())},children:t})}),!r.whiteLabel&&_o(Eo,{})]})}function Ao(e){var t=e.question,n=e.description,r=e.descriptionContentType,i=e.backgroundColor,o=e.forceDisableHtml;return _o("div",{style:uo(Ui).isPopup?{backgroundColor:i||Fi.backgroundColor}:{},children:[_o("div",{className:"survey-question",children:t}),n&&Wi({component:ii("div",{className:"survey-question-description"}),children:n,renderAsHtml:!o&&"text"!==r})]})}function Mo(e){return _o("div",{className:"cancel-btn-wrapper",children:_o("button",{className:"form-cancel",onClick:e.onClick,disabled:uo(Ui).isPreviewMode,children:Io})})}function Ro(e){var n=e.header,r=e.description,i=e.contentType,o=e.forceDisableHtml,a=e.appearance,s=e.onClose,u=e.styleOverrides,l=Ri(a.backgroundColor||Fi.backgroundColor),c=uo(Ui).isPopup;return _o(ai,{children:_o("div",{className:"thank-you-message",style:t({},u),children:_o("div",{className:"thank-you-message-container",children:[c&&_o(Mo,{onClick:function(){return s()}}),_o("h3",{className:"thank-you-message-header",style:{color:l},children:n}),r&&Wi({component:ii("div",{className:"thank-you-message-body"}),children:r,renderAsHtml:!o&&"text"!==i,style:{color:l}}),c&&_o(To,{text:a.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:a,onSubmit:function(){return s()}})]})})})}function Fo(e){var t,n=ao(null),r=d(io(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black"),2),i=r[0],o=r[1];return oo((function(){if(n.current){var e=function(e){var t=Ei.getComputedStyle(e).backgroundColor;if("rgba(0, 0, 0, 0)"===t)return"black";var n=t.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(!n)return"black";var r=parseInt(n[1]),i=parseInt(n[2]),o=parseInt(n[3]);return Math.sqrt(r*r*.299+i*i*.587+o*o*.114)>127.5?"black":"white"}(n.current);o(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:i}}function Oo(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,i=e.onSubmit,o=ao(null),a=d(io(""),2),s=a[0],u=a[1];return _o("div",{ref:o,children:[_o(Ao,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:r.backgroundColor,forceDisableHtml:n}),_o("textarea",{rows:4,placeholder:null==r?void 0:r.placeholder,onInput:function(e){return u(e.currentTarget.value)}}),_o(To,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:r,onSubmit:function(){return i(s)}})]})}function No(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,i=e.onSubmit;return _o(ai,{children:[_o(Ao,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),_o(To,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:function(){return i("link clicked")}})]})}function Lo(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,i=e.appearance,o=e.onSubmit,a=t.scale,s=10===t.scale?0:1,u=d(io(null),2),l=u[0],c=u[1];return _o(ai,{children:[_o(Ao,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:i.backgroundColor}),_o("div",{className:"rating-section",children:[_o("div",{className:"rating-options",children:["emoji"===t.display&&_o("div",{className:"rating-options-emoji",children:(3===t.scale?qo:Bo).map((function(e,t){var n=t+1===l;return _o("button",{className:"ratings-emoji question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),value:t+1,type:"button",onClick:function(){c(t+1)},style:{fill:n?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:e},t)}))}),"number"===t.display&&_o("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat(".concat(a-s+1,", minmax(0, 1fr))")},children:Wo(t.scale).map((function(e,t){return _o(Po,{displayQuestionIndex:r,active:l===e,appearance:i,num:e,setActiveNumber:function(e){c(e)}},t)}))})]}),_o("div",{className:"rating-text",children:[_o("div",{children:t.lowerBoundLabel}),_o("div",{children:t.upperBoundLabel})]})]}),_o(To,{text:t.buttonText||(null==i?void 0:i.submitButtonText)||"Submit",submitDisabled:Zt(l)&&!t.optional,appearance:i,onSubmit:function(){return o(l)}})]})}function Po(e){var t=e.num,n=e.active,r=e.displayQuestionIndex,i=e.appearance,o=e.setActiveNumber,a=Fo({appearance:i,defaultTextColor:"black",forceUpdate:n}),s=a.textColor;return _o("button",{ref:a.ref,className:"ratings-number question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),type:"button",onClick:function(){o(t)},style:{color:s,backgroundColor:n?i.ratingButtonActiveColor:i.ratingButtonColor,borderColor:i.borderColor},children:t})}function Do(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,i=e.appearance,o=e.onSubmit,a=ao(null),s=so((function(){return function(e){if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var r=Di(t,Pi(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r}(t)}),[t]),u=d(io(t.type===Ur.MultipleChoice?[]:null),2),l=u[0],c=u[1],p=d(io(!1),2),h=p[0],v=p[1],g=d(io(""),2),m=g[0],_=g[1],y=t.type===Ur.SingleChoice?"radio":"checkbox";return _o("div",{ref:a,children:[_o(Ao,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:i.backgroundColor}),_o("div",{className:"multiple-choice-options",children:s.map((function(e,n){var i="choice-option",o=e,a=e;return t.hasOpenChoice&&n===t.choices.length-1&&(i+=" choice-option-open"),_o("div",{className:i,children:[_o("input",{type:y,id:"surveyQuestion".concat(r,"Choice").concat(n),name:"question".concat(r),value:o,disabled:!o,onInput:function(){return t.hasOpenChoice&&n===t.choices.length-1?v(!h):t.type===Ur.SingleChoice?c(o):t.type===Ur.MultipleChoice&&Ht(l)?l.includes(o)?c(l.filter((function(e){return e!==o}))):c([].concat(f(l),[o])):void 0}}),_o("label",{htmlFor:"surveyQuestion".concat(r,"Choice").concat(n),style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?_o(ai,{children:[_o("span",{children:[a,":"]}),_o("input",{type:"text",id:"surveyQuestion".concat(r,"Choice").concat(n,"Open"),name:"question".concat(r),onInput:function(e){var n=e.currentTarget.value;return t.type===Ur.SingleChoice?c(n):t.type===Ur.MultipleChoice&&Ht(l)?_(n):void 0}})]}):a}),_o("span",{className:"choice-check",style:{color:"black"},children:xo})]})}))}),_o(To,{text:t.buttonText||"Submit",submitDisabled:(Zt(l)||Ht(l)&&!h&&0===l.length||Ht(l)&&h&&!m&&0===l.length&&!t.optional)&&!t.optional,appearance:i,onSubmit:function(){h&&t.type===Ur.MultipleChoice?Ht(l)&&o([].concat(f(l),[m])):o(l)}})]})}var qo=[ko,bo,yo],Bo=[wo,ko,bo,yo,Co],Ho=[1,2,3,4,5],$o=[1,2,3,4,5,6,7],Uo=[0,1,2,3,4,5,6,7,8,9,10];function Wo(e){switch(e){case 5:default:return Ho;case 7:return $o;case 10:return Uo}}var Vo=en,Go=sn,jo=function(){function e(t){var n=this;a(this,e),l(this,"canShowNextEventBasedSurvey",(function(){var e,t=Go.querySelectorAll("div[class^=PostHogSurvey]");return!(t.length>0)||1===(null===(e=t[t.length-1].shadowRoot)||void 0===e?void 0:e.childElementCount)})),l(this,"handlePopoverSurvey",(function(e){var t,r=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,i=localStorage.getItem("lastSeenSurveyDate");if(r&&i){var o=new Date,a=Math.abs(o.getTime()-new Date(i).getTime());if(Math.ceil(a/864e5)<r)return}var s=function(e){return!!localStorage.getItem(Hi(e))&&!Bi(e)}(e);if(!s){n.addSurveyToFocus(e.id);var u=function(e,t,n){var r=Ti.createElement("div");r.className="PostHogSurvey".concat(t);var i=r.attachShadow({mode:"open"});if(e){var o=Object.assign(Ti.createElement("style"),{innerText:e});i.appendChild(o)}return(n||Ti.body).appendChild(r),i}(Ai(null==e?void 0:e.appearance),e.id);Si(_o(Zo,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!0},"popover-survey"),u)}})),l(this,"handleWidget",(function(e){var t=function(e){var t,n=Vi.createElement("div");n.className="PostHogWidget".concat(e.id);var r,i=n.attachShadow({mode:"open"}),o=(r=null===(t=e.appearance)||void 0===t?void 0:t.widgetColor,"\n .ph-survey-widget-tab {\n position: fixed;\n top: 50%;\n right: 0;\n background: ".concat(r||"#e0a045",";\n color: white;\n transform: rotate(-90deg) translate(0, -100%);\n transform-origin: right top;\n min-width: 40px;\n padding: 8px 12px;\n font-weight: 500;\n border-radius: 3px 3px 0 0;\n text-align: center;\n cursor: pointer;\n z-index: 9999999;\n }\n .ph-survey-widget-tab:hover {\n padding-bottom: 13px;\n }\n .ph-survey-widget-button {\n position: fixed;\n }\n "));return i.append(Object.assign(Vi.createElement("style"),{innerText:o})),Vi.body.appendChild(n),i}(e),r=Ai(e.appearance);t.appendChild(Object.assign(Go.createElement("style"),{innerText:r})),Si(_o(Qo,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus},"feedback-survey"),t)})),l(this,"handleWidgetSelector",(function(e){var t,r=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&Go.querySelector(e.appearance.widgetSelector);if(r)if(0===Go.querySelectorAll(".PostHogWidget".concat(e.id)).length)n.handleWidget(e);else if(1===Go.querySelectorAll(".PostHogWidget".concat(e.id)).length&&!r.getAttribute("PHWidgetSurveyClickListener")){var i,o,a=null===(i=Go.querySelector(".PostHogWidget".concat(e.id)))||void 0===i||null===(o=i.shadowRoot)||void 0===o?void 0:o.querySelector(".survey-form");r.addEventListener("click",(function(){a&&(a.style.display="none"===a.style.display?"block":"none",a.addEventListener("PHSurveyClosed",(function(){n.removeSurveyFromFocus(e.id),a.style.display="none"})))})),r.setAttribute("PHWidgetSurveyClickListener","true")}})),l(this,"canRenderSurvey",(function(e){var t={visible:!1};return e.end_date?(t.disabledReason="survey was completed on ".concat(e.end_date),t):e.type!=$r.Popover?(t.disabledReason="Only Popover survey types can be rendered",t):!e.linked_flag_key||n.posthog.featureFlags.isFeatureEnabled(e.linked_flag_key)?!e.targeting_flag_key||n.posthog.featureFlags.isFeatureEnabled(e.targeting_flag_key)?!e.internal_targeting_flag_key||n.posthog.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key)?(t.visible=!0,t):(t.disabledReason="internal targeting feature flag ".concat(e.internal_targeting_flag_key," is false"),t):(t.disabledReason="targeting feature flag ".concat(e.targeting_flag_key," is false"),t):(t.disabledReason="linked feature flag ".concat(e.linked_flag_key," is false"),t)})),l(this,"renderSurvey",(function(e,t){Si(_o(Zo,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)})),l(this,"callSurveysAndEvaluateDisplayLogic",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=n.posthog)||void 0===e||e.getActiveMatchingSurveys((function(e){var t=e.filter((function(e){return"api"!==e.type}));n.sortSurveysByAppearanceDelay(t).forEach((function(e){if(Zt(n.surveyInFocus)){var t,r,i;if(e.type===$r.Widget)"tab"===(null===(t=e.appearance)||void 0===t?void 0:t.widgetType)&&0===Go.querySelectorAll(".PostHogWidget".concat(e.id)).length&&n.handleWidget(e),"selector"===(null===(r=e.appearance)||void 0===r?void 0:r.widgetType)&&null!==(i=e.appearance)&&void 0!==i&&i.widgetSelector&&n.handleWidgetSelector(e);e.type===$r.Popover&&n.canShowNextEventBasedSurvey()&&n.handlePopoverSurvey(e)}}))}),t)})),l(this,"addSurveyToFocus",(function(e){Zt(n.surveyInFocus)||vn.error("Survey ".concat(f(n.surveyInFocus)," already in focus. Cannot add survey ").concat(e,".")),n.surveyInFocus=e})),l(this,"removeSurveyFromFocus",(function(e){n.surveyInFocus!==e&&vn.error("Survey ".concat(e," is not in focus. Cannot remove survey ").concat(e,".")),n.surveyInFocus=null})),this.posthog=t,this.surveyInFocus=null}return u(e,[{key:"sortSurveysByAppearanceDelay",value:function(e){return e.sort((function(e,t){var n,r;return((null===(n=e.appearance)||void 0===n?void 0:n.surveyPopupDelaySeconds)||0)-((null===(r=t.appearance)||void 0===r?void 0:r.surveyPopupDelaySeconds)||0)}))}},{key:"getTestAPI",value:function(){return{addSurveyToFocus:this.addSurveyToFocus,removeSurveyFromFocus:this.removeSurveyFromFocus,surveyInFocus:this.surveyInFocus,canShowNextEventBasedSurvey:this.canShowNextEventBasedSurvey,handleWidget:this.handleWidget,handlePopoverSurvey:this.handlePopoverSurvey,handleWidgetSelector:this.handleWidgetSelector,sortSurveysByAppearanceDelay:this.sortSurveysByAppearanceDelay}}}]),e}();function Zo(e){var n,r,i,o,a,s,u=e.survey,l=e.forceDisableHtml,c=e.posthog,f=e.style,p=e.previewPageIndex,h=e.removeSurveyFromFocus,v=e.isPopup,g=Number.isInteger(p),m=null!==(n=u.appearance)&&void 0!==n&&n.surveyPopupDelaySeconds?1e3*u.appearance.surveyPopupDelaySeconds:0,_=function(e,t,n,r,i){var o=d(io(r||0===n),2),a=o[0],s=o[1],u=d(io(!1),2),l=u[0],c=u[1];return oo((function(){if(!r&&t){var o,a=function(){i(e.id),s(!1)},u=function(){var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(c(!0),i(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((function(){s(!1)}),5e3)):(i(e.id),s(!1))},l=function(){var n;s(!0),Vo.dispatchEvent(new Event("PHSurveyShown")),t.capture("survey shown",{$survey_name:e.name,$survey_id:e.id,$survey_iteration:e.current_iteration,$survey_iteration_start_date:e.current_iteration_start_date,sessionRecordingUrl:null===(n=t.get_session_replay_url)||void 0===n?void 0:n.call(t)}),localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())};return Vo.addEventListener("PHSurveyClosed",a),Vo.addEventListener("PHSurveySent",u),n>0?(o=setTimeout((function(){l()}),n),function(){clearTimeout(o),Vo.removeEventListener("PHSurveyClosed",a),Vo.removeEventListener("PHSurveySent",u)}):(l(),function(){Vo.removeEventListener("PHSurveyClosed",a),Vo.removeEventListener("PHSurveySent",u)})}}),[]),{isPopupVisible:a,isSurveySent:l,setIsPopupVisible:s}}(u,c,m,g,h),y=_.isPopupVisible,b=_.isSurveySent,k=_.setIsPopupVisible,w=b||p===u.questions.length,C=null!==(r=f)&&void 0!==r&&r.left&&Qt(null===(i=f)||void 0===i?void 0:i.left)?{left:f.left-40}:{};return g&&((f=f||{}).left="unset",f.right="unset",f.transform="unset"),y?_o(Ui.Provider,{value:{isPreviewMode:g,previewPageIndex:p,handleCloseSurveyPopup:function(){return Li(u,c,g)},isPopup:v||!1},children:w?_o(Ro,{header:(null===(o=u.appearance)||void 0===o?void 0:o.thankYouMessageHeader)||"Thank you!",description:(null===(a=u.appearance)||void 0===a?void 0:a.thankYouMessageDescription)||"",forceDisableHtml:!!l,contentType:null===(s=u.appearance)||void 0===s?void 0:s.thankYouMessageDescriptionContentType,appearance:u.appearance||Fi,styleOverrides:t(t({},f),C),onClose:function(){return k(!1)}}):_o(zo,{survey:u,forceDisableHtml:!!l,posthog:c,styleOverrides:f})}):_o(ai,{})}function zo(e){var n,r,i=e.survey,o=e.forceDisableHtml,a=e.posthog,s=e.styleOverrides,u=Ri((null===(n=i.appearance)||void 0===n?void 0:n.backgroundColor)||Fi.backgroundColor),c=d(io({}),2),f=c[0],p=c[1],h=uo(Ui),v=h.isPreviewMode,g=h.previewPageIndex,m=h.handleCloseSurveyPopup,_=h.isPopup,y=d(io(g||0),2),b=y[0],k=y[1],w=so((function(){return qi(i)}),[i]);oo((function(){k(null!=g?g:0)}),[g]);return _o("form",{className:"survey-form",style:_?t({color:u,borderColor:null===(r=i.appearance)||void 0===r?void 0:r.borderColor},s):{},children:w.map((function(e,n){var r,s=e.originalQuestionIndex;return(v?b===s:b===n)&&_o("div",{className:"survey-box",style:_?{backgroundColor:(null===(r=i.appearance)||void 0===r?void 0:r.backgroundColor)||Fi.backgroundColor}:{},children:[_&&_o(Mo,{onClick:function(){return m()}}),Ko({question:e,forceDisableHtml:o,displayQuestionIndex:n,appearance:i.appearance||Fi,onSubmit:function(e){return function(e){var n=e.res,r=e.originalQuestionIndex,o=e.displayQuestionIndex;if(a){var s=0===r?"$survey_response":"$survey_response_".concat(r);if(p(t(t({},f),{},l({},s,n))),a.getNextSurveyStep){var u=a.getNextSurveyStep(i,o,n);u===Wr.End?Ni(t(t({},f),{},l({},s,n)),i,a):k(u)}else o===i.questions.length-1?Ni(t(t({},f),{},l({},s,n)),i,a):k(o+1)}}({res:e,originalQuestionIndex:s,displayQuestionIndex:n})}})]})}))})}function Qo(e){var t,n,r=e.survey,i=e.forceDisableHtml,o=e.posthog,a=e.readOnly,s=e.removeSurveyFromFocus,u=d(io(!1),2),l=u[0],c=u[1],f=d(io({}),2),p=f[0],h=f[1],v=ao(null);return oo((function(){var e,t;if(!a&&o){if("tab"===(null===(e=r.appearance)||void 0===e?void 0:e.widgetType)&&v.current){var n,i=v.current.getBoundingClientRect(),s={top:"50%",left:parseInt("".concat(i.right-360)),bottom:"auto",borderRadius:10,borderBottom:"1.5px solid ".concat((null===(n=r.appearance)||void 0===n?void 0:n.borderColor)||"#c9c6c6")};h(s)}if("selector"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)){var u=Go.querySelector(r.appearance.widgetSelector||"");null==u||u.addEventListener("click",(function(){c(!l)})),null==u||u.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),_o(ai,{children:["tab"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)&&_o("div",{className:"ph-survey-widget-tab",ref:v,onClick:function(){return!a&&c(!l)},style:{color:Ri(r.appearance.widgetColor)},children:[_o("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=r.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),l&&_o(Zo,{posthog:o,survey:r,forceDisableHtml:i,style:p,removeSurveyFromFocus:s,isPopup:!0},"feedback-widget-survey")]})}var Ko=function(e){var n,r,i=e.question,o=e.forceDisableHtml,a=e.displayQuestionIndex,s=e.appearance,u=e.onSubmit,c=(l(n={},Ur.Open,Oo),l(n,Ur.Link,No),l(n,Ur.Rating,Lo),l(n,Ur.SingleChoice,Do),l(n,Ur.MultipleChoice,Do),n),d={question:i,forceDisableHtml:o,appearance:s,onSubmit:u},f=(l(r={},Ur.Open,{}),l(r,Ur.Link,{}),l(r,Ur.Rating,{displayQuestionIndex:a}),l(r,Ur.SingleChoice,{displayQuestionIndex:a}),l(r,Ur.MultipleChoice,{displayQuestionIndex:a}),r),p=c[i.type],h=t(t({},d),f[i.type]);return _o(p,t({},h))};function Yo(e){return!Vt(Event)&&Jo(e,Event)}function Jo(e,t){try{return e instanceof t}catch(e){return!1}}function Xo(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function ea(e){return Xo(e,"DOMError")}en&&(en.__PosthogExtensions__=en.__PosthogExtensions__||{},en.__PosthogExtensions__.canActivateRepeatedly=Bi,en.extendPostHogWithSurveys=function(e){if(Go&&Vo){var t=new jo(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((function(){t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}});var ta=/\(error: (.*)\)/,na=50,ra="?";function ia(e,t,n,r){var i={filename:e,function:t,in_app:!0};return Vt(n)||(i.lineno=n),Vt(r)||(i.colno=r),i}var oa=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,aa=/\((\S*)(?::(\d+))(?::(\d+))\)/,sa=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ua=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,la=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var ca,da=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n.sort((function(e,t){return e[0]-t[0]})).map((function(e){return e[1]}));return function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],o=e.split("\n"),a=n;a<o.length;a++){var s=o[a];if(!(s.length>1024)){var u=ta.test(s)?s.replace(ta,"$1"):s;if(!u.match(/\S*Error: /)){var l,c=v(i);try{for(c.s();!(l=c.n()).done;){var d=(0,l.value)(u);if(d){r.push(d);break}}}catch(e){c.e(e)}finally{c.f()}if(r.length>=na)break}}}return function(e){if(!e.length)return[];var n=e.slice(0,na);return n.reverse(),n.map((function(e){return t(t({},e),{},{filename:e.filename||n[n.length-1].filename,function:e.function||"?"})}))}(r)}}.apply(void 0,[[30,function(e){var t=oa.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){var n=aa.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}var r=d(fa(t[1]||ra,t[2]),2),i=r[0];return ia(r[1],i,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,function(e){var t=sa.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=ua.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],i=t[1]||ra,o=d(fa(i,r),2);return i=o[0],ia(r=o[1],i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],[40,function(e){var t=la.exec(e);return t?ia(t[2],t[1]||ra,+t[3],t[4]?+t[4]:void 0):void 0}]]),fa=function(e,t){var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:ra,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]};!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(ca||(ca={}));var pa=["fatal","error","warning","log","info","debug"],ha=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,va=/Minified React error #\d+;/i;function ga(e){var t=e.stacktrace||e.stack||"",n=function(e){if(e){if(Qt(e.framesToPop))return e.framesToPop;if(va.test(e.message))return 1}return 0}(e);try{return da(t,n)}catch(e){}return[]}function ma(e){var t=ga(e);return{$exception_type:e.name,$exception_message:e.message,$exception_stack_trace_raw:JSON.stringify(t),$exception_level:"error"}}function _a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>t))return r===n.length||i.length<=t?i:"".concat(i.slice(0,t),"...")}return""}function ya(e){return Gt(e)&&!jt(e)&&pa.indexOf(e)>=0}function ba(e){var n=d(e,5),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u={};if(Vt(s)&&Gt(r)){var l="Error",c=r,f=r.match(ha);f&&(l=f[1],c=f[2]),u={$exception_type:l,$exception_message:c}}var p=s||r;if(ea(p)||function(e){return Xo(e,"DOMException")}(p)){var h=p;if(function(e){return"stack"in e}(p))u=ma(p);else{var v=h.name||(ea(h)?"DOMError":"DOMException"),g=h.message?"".concat(v,": ").concat(h.message):v;u=function(e){return{$exception_type:"Error",$exception_message:e,$exception_level:"error"}}(g),u.$exception_type=ea(h)?"DOMError":"DOMException",u.$exception_message=u.$exception_message||g}"code"in h&&(u.$exception_DOMException_code="".concat(h.code))}else if(function(e){return Xo(e,"ErrorEvent")}(p)&&p.error)u=ma(p.error);else if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Jo(e,Error)}}(p))u=ma(p);else if(function(e){return Xo(e,"Object")}(p)||Yo(p)){u=function(e){return{$exception_type:Yo(e)?e.constructor.name:"Error",$exception_message:"Non-Error ".concat("exception"," captured with keys: ",_a(e)),$exception_level:ya(e.level)?e.level:"error"}}(p),u.$exception_is_synthetic=!0}else u.$exception_type=u.$exception_type||"Error",u.$exception_message=u.$exception_message||p,u.$exception_is_synthetic=!0;return t(t(t(t({},u),{},{$exception_type:u.$exception_type||"UnknownErrorType",$exception_message:u.$exception_message||"",$exception_level:ya(u.$exception_level)?u.$exception_level:"error"},i?{$exception_source:i}:{}),o?{$exception_lineno:o}:{}),a?{$exception_colno:a}:{})}function ka(e){var n=d(e,1)[0],r=n;try{"reason"in n?r=n.reason:"detail"in n&&"reason"in n.detail&&(r=n.detail.reason)}catch(e){}var i,o={};return(o=Zt(i=r)||!Ut(i)&&!$t(i)?{$exception_message:"Non-Error promise rejection captured with value: ".concat(String(r))}:ba([r])).$exception_handled=!1,t(t({},o),{},{$exception_type:o.$exception_type="UnhandledRejection",$exception_message:o.$exception_message=o.$exception_message||n.reason||String(r),$exception_level:ya(o.$exception_level)?o.$exception_level:"error"})}var wa={wrapOnError:function(e){var t=en;t||vn.info("window not available, cannot wrap onerror");var n=t.onerror;return t.onerror=function(){for(var t,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=ba(i);return e(a),null!==(t=null==n?void 0:n.apply(void 0,i))&&void 0!==t&&t},t.onerror.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null===(e=t.onerror)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onerror=n}},wrapUnhandledRejection:function(e){var t=en;t||vn.info("window not available, cannot wrap onUnhandledRejection");var n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var s=ka(o);return e(s),null!==(r=null==n?void 0:n.apply(t,o))&&void 0!==r&&r},t.onunhandledrejection.__POSTHOG_INSTRUMENTED__=!0,function(){var e;null===(e=t.onunhandledrejection)||void 0===e||delete e.__POSTHOG_INSTRUMENTED__,t.onunhandledrejection=n}}};en&&(en.posthogErrorWrappingFunctions=wa);var Ca=function(e,t){var n=e.checkAndGetSessionAndWindowId(!0),r=n.sessionId,i=n.windowId;t.headers.set("X-POSTHOG-SESSION-ID",r),t.headers.set("X-POSTHOG-WINDOW-ID",i)};pn&&(pn.postHogTracingHeadersPatchFns={_patchFetch:function(e){return yr(en,"fetch",(function(t){return function(){var r=o(n().mark((function r(i,o){var a;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=new Request(i,o),Ca(e,a),n.abrupt("return",t(a));case 3:case"end":return n.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}()}))},_patchXHR:function(e){return yr(en.XMLHttpRequest.prototype,"open",(function(t){return function(n,r){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,s=new Request(r);return Ca(e,s),t.call(this,n,s.url,i,o,a)}}))}});var Ia,Sa=-1,xa=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Sa=t.timeStamp,e(t))}),!0)},Ea=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Ta=function(){var e=Ea();return e&&e.activationStart||0},Aa=function(e,t){var n=Ea(),r="navigate";return Sa>=0?r="back-forward-cache":n&&(document.prerendering||Ta()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},Ma=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},Ra=function(e,t,n,r){var i,o;return function(a){t.value>=0&&(a||r)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Fa=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Oa=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Na=function(e){var t=!1;return function(){t||(e(),t=!0)}},La=-1,Pa=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Da=function(e){"hidden"===document.visibilityState&&La>-1&&(La="visibilitychange"===e.type?e.timeStamp:0,Ba())},qa=function(){addEventListener("visibilitychange",Da,!0),addEventListener("prerenderingchange",Da,!0)},Ba=function(){removeEventListener("visibilitychange",Da,!0),removeEventListener("prerenderingchange",Da,!0)},Ha=function(){return La<0&&(La=Pa(),qa(),xa((function(){setTimeout((function(){La=Pa(),qa()}),0)}))),{get firstHiddenTime(){return La}}},$a=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Ua=[1800,3e3],Wa=function(e,t){t=t||{},$a((function(){var n,r=Ha(),i=Aa("FCP"),o=Ma("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Ta(),0),i.entries.push(e),n(!0)))}))}));o&&(n=Ra(e,i,Ua,t.reportAllChanges),xa((function(r){i=Aa("FCP"),n=Ra(e,i,Ua,t.reportAllChanges),Fa((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},Va=[.1,.25],Ga=0,ja=1/0,Za=0,za=function(e){e.forEach((function(e){e.interactionId&&(ja=Math.min(ja,e.interactionId),Za=Math.max(Za,e.interactionId),Ga=Za?(Za-ja)/7+1:0)}))},Qa=function(){"interactionCount"in performance||Ia||(Ia=Ma("event",za,{type:"event",buffered:!0,durationThreshold:0}))},Ka=[],Ya=new Map,Ja=0,Xa=function(){return(Ia?Ga:performance.interactionCount||0)-Ja},es=[],ts=function(e){if(es.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Ka[Ka.length-1],n=Ya.get(e.interactionId);if(n||Ka.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};Ya.set(r.id,r),Ka.push(r)}Ka.sort((function(e,t){return t.latency-e.latency})),Ka.length>10&&Ka.splice(10).forEach((function(e){return Ya.delete(e.id)}))}}},ns=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Na(e),"hidden"===document.visibilityState?e():(n=t(e),Oa(e)),n},rs=[200,500],is=[2500,4e3],os={},as={onLCP:function(e,t){t=t||{},$a((function(){var n,r=Ha(),i=Aa("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Ta(),0),i.entries=[e],n())}))},a=Ma("largest-contentful-paint",o);if(a){n=Ra(e,i,is,t.reportAllChanges);var s=Na((function(){os[i.id]||(o(a.takeRecords()),a.disconnect(),os[i.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return ns(s)}),!0)})),Oa(s),xa((function(r){i=Aa("LCP"),n=Ra(e,i,is,t.reportAllChanges),Fa((function(){i.value=performance.now()-r.timeStamp,os[i.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},Wa(Na((function(){var n,r=Aa("CLS",0),i=0,o=[],a=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}})),i>r.value&&(r.value=i,r.entries=o,n())},s=Ma("layout-shift",a);s&&(n=Ra(e,r,Va,t.reportAllChanges),Oa((function(){a(s.takeRecords()),n(!0)})),xa((function(){i=0,r=Aa("CLS",0),n=Ra(e,r,Va,t.reportAllChanges),Fa((function(){return n()}))})),setTimeout(n,0))})))},onFCP:Wa,onINP:function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},$a((function(){var n;Qa();var r,i=Aa("INP"),o=function(e){ns((function(){e.forEach(ts);var t,n=(t=Math.min(Ka.length-1,Math.floor(Xa()/50)),Ka[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())}))},a=Ma("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=Ra(e,i,rs,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),Oa((function(){o(a.takeRecords()),r(!0)})),xa((function(){Ja=0,Ka.length=0,Ya.clear(),i=Aa("INP"),r=Ra(e,i,rs,t.reportAllChanges)})))})))}};pn.postHogWebVitalsCallbacks=as;var ss="$people_distinct_id",us="__alias",ls="__timers",cs="$autocapture_disabled_server_side",ds="$heatmaps_enabled_server_side",fs="$exception_capture_enabled_server_side",ps="$exception_capture_endpoint",hs="$web_vitals_enabled_server_side",vs="$session_recording_enabled_server_side",gs="$console_log_recording_enabled_server_side",ms="$session_recording_network_payload_capture",_s="$session_recording_canvas_recording",ys="$replay_sample_rate",bs="$replay_minimum_duration",ks="$sesid",ws="$session_is_sampled",Cs="$enabled_feature_flags",Is="$early_access_features",Ss="$stored_person_properties",xs="$stored_group_properties",Es="$surveys",Ts="$surveys_activated",As="$flag_call_reported",Ms="$user_state",Rs="$client_session_props",Fs="$capture_rate_limit",Os="$initial_campaign_params",Ns="$initial_referrer_info",Ls="$initial_person_info",Ps="$epp",Ds="__POSTHOG_TOOLBAR__",qs=[ss,us,"__cmpns",ls,vs,ds,ks,Cs,Ms,Is,xs,Ss,Es,As,Rs,Fs,Os,Ns,Ps],Bs="$active_feature_flags",Hs="$override_feature_flags",$s="$feature_flag_payloads",Us=function(e){var t,n={},r=v(wn(e||{}));try{for(r.s();!(t=r.n()).done;){var i=d(t.value,2),o=i[0],a=i[1];a&&(n[o]=a)}}catch(e){r.e(e)}finally{r.f()}return n},Ws=function(){function e(t){a(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return u(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(Cs),t=this.instance.get_property(Hs);if(!t)return e||{};for(var n=bn({},e),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||(vn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property($s)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property(Ss),r=this.instance.get_property(xs),i={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:this.instance.config.disable_compression?void 0:ca.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){var n;e.setReloadingPaused(!1);var r=!0;200===t.statusCode&&(e.$anon_distinct_id=void 0,r=!1),e.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},r),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(As)||{};if(t.send_event||!("send_event"in t))if(!(e in o)||!o[e].includes(i))Ht(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register(l({},As,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r});return r}vn.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);vn.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e,n){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads();!function(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=e.featureFlags,s=e.featureFlagPayloads;if(a)if(Ht(a)){var u,c={};if(a)for(var d=0;d<a.length;d++)c[a[d]]=!0;n&&n.register((l(u={},Bs,a),l(u,Cs,c),u))}else{var f=a,p=s;e.errorsWhileComputingFlags&&(f=t(t({},i),f),p=t(t({},o),p)),n&&n.register((l(r={},Bs,Object.keys(Us(f))),l(r,Cs,f||{}),l(r,$s,p||{}),r))}}(e,this.instance.persistence,r,i),this._fireFeatureFlagsCallbacks(n)}}},{key:"override",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return vn.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(Hs);else if(Ht(e)){for(var n={},r=0;r<e.length;r++)n[e[r]]=!0;this.instance.persistence.register(l({},Hs,n))}else this.instance.persistence.register(l({},Hs,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,n){var r,i,o=l({},"$feature_enrollment/".concat(e),n);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:n,$set:o}),this.setPersonPropertiesForFlags(o,!1);var a=t(t({},this.getFlagVariants()),{},l({},e,n));null===(r=this.instance.persistence)||void 0===r||r.register((l(i={},Bs,Object.keys(Us(a))),l(i,Cs,a),i)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(Is);if(r&&!n)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(n){var r;if(n.json){var i=n.json.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(l({},Is,i)),e(i)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach((function(t){return t(n,r,{errorsLoading:e})}))}},{key:"setPersonPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(Ss)||{};this.instance.register(l({},Ss,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(Ss)}},{key:"setGroupPropertiesForFlags",value:function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.instance.get_property(xs)||{};0!==Object.keys(r).length&&Object.keys(r).forEach((function(n){r[n]=t(t({},r[n]),e[n]),delete e[n]})),this.instance.register(l({},xs,t(t({},r),e))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var n=this.instance.get_property(xs)||{};this.instance.register(l({},xs,t(t({},n),{},l({},e,{}))))}else this.instance.unregister(xs)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Qt(e)&&isFinite(e)&&Math.floor(e)===e});var Vs="0123456789abcdef",Gs=function(){function e(t){if(a(this,e),this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}return u(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Vs.charAt(this.bytes[t]>>>4)+Vs.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}}]),e}(),js=function(){function e(){a(this,e),l(this,"timestamp",0),l(this,"counter",0),l(this,"random",new Qs)}return u(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(Vt(e)){this.timestamp=0;var t=this.generateOrAbort();if(Vt(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return Gs.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),Zs=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};en&&!Vt(en.crypto)&&crypto.getRandomValues&&(Zs=function(e){return crypto.getRandomValues(e)});var zs,Qs=function(){function e(){a(this,e),l(this,"buffer",new Uint32Array(8)),l(this,"cursor",1/0)}return u(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(Zs(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),Ks=function(){return Ys().toString()},Ys=function(){return(zs||(zs=new js)).generate()},Js="Thu, 01 Jan 1970 00:00:00 GMT",Xs="";var eu=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function tu(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sn;if(Xs)return Xs;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+Ks(),o=new RegExp("(^|;)\\s*"+i+"=1");!Xs&&r--;){var a=n.slice(r).join("."),s=i+"=1;domain=."+a;t.cookie=s,o.test(t.cookie)&&(t.cookie=s+";expires="+Js,Xs=a)}return Xs}(e);if(!n){var r=function(e){var t=e.match(eu);return t?t[0]:""}(e);r!==n&&vn.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var nu,ru={is_supported:function(){return!!sn},error:function(e){vn.error("cookieStore error: "+e)},get:function(e){if(sn){try{for(var t=e+"=",n=sn.cookie.split(";").filter((function(e){return e.length})),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(ru.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(sn)try{var o="",a="",s=tu(sn.location.hostname,r);if(n){var u=new Date;u.setTime(u.getTime()+24*n*60*60*1e3),o="; expires="+u.toUTCString()}i&&(a="; secure");var l=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+s+a;return l.length>3686.4&&vn.warn("cookieStore warning: large cookie, len="+l.length),sn.cookie=l,l}catch(e){return}},remove:function(e,t){try{ru.set(e,"",-1,t)}catch(e){return}}},iu=null,ou={is_supported:function(){if(!Zt(iu))return iu;var e=!0;if(Vt(en))e=!1;else try{var t="__mplssupport__";ou.set(t,"xyz"),'"xyz"'!==ou.get(t)&&(e=!1),ou.remove(t)}catch(t){e=!1}return e||vn.error("localStorage unsupported; falling back to cookie store"),iu=e,e},error:function(e){vn.error("localStorage error: "+e)},get:function(e){try{return null==en?void 0:en.localStorage.getItem(e)}catch(e){ou.error(e)}return null},parse:function(e){try{return JSON.parse(ou.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==en||en.localStorage.setItem(e,JSON.stringify(t))}catch(e){ou.error(e)}},remove:function(e){try{null==en||en.localStorage.removeItem(e)}catch(e){ou.error(e)}}},au=["distinct_id",ks,ws,Ps],su=t(t({},ou),{},{parse:function(e){try{var t={};try{t=ru.parse(e)||{}}catch(e){}var n=bn(t,JSON.parse(ou.get(e)||"{}"));return ou.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i,o){try{ou.set(e,t,void 0,void 0,o);var a={};au.forEach((function(e){t[e]&&(a[e]=t[e])})),Object.keys(a).length&&ru.set(e,a,n,r,i,o)}catch(e){ou.error(e)}},remove:function(e,t){try{null==en||en.localStorage.removeItem(e),ru.remove(e,t)}catch(e){ou.error(e)}}}),uu={},lu={is_supported:function(){return!0},error:function(e){vn.error("memoryStorage error: "+e)},get:function(e){return uu[e]||null},parse:function(e){return uu[e]||null},set:function(e,t){uu[e]=t},remove:function(e){delete uu[e]}},cu=null,du={is_supported:function(){if(!Zt(cu))return cu;if(cu=!0,Vt(en))cu=!1;else try{var e="__support__";du.set(e,"xyz"),'"xyz"'!==du.get(e)&&(cu=!1),du.remove(e)}catch(e){cu=!1}return cu},error:function(e){vn.error("sessionStorage error: ",e)},get:function(e){try{return null==en?void 0:en.sessionStorage.getItem(e)}catch(e){du.error(e)}return null},parse:function(e){try{return JSON.parse(du.get(e))||null}catch(e){}return null},set:function(e,t){try{null==en||en.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){du.error(e)}},remove:function(e){try{null==en||en.sessionStorage.removeItem(e)}catch(e){du.error(e)}}},fu="Mobile",pu="iOS",hu="Android",vu="Tablet",gu=hu+" "+vu,mu="iPad",_u="Apple",yu=_u+" Watch",bu="Safari",ku="BlackBerry",wu="Samsung",Cu=wu+"Browser",Iu=wu+" Internet",Su="Chrome",xu=Su+" OS",Eu=Su+" "+pu,Tu="Internet Explorer",Au=Tu+" "+fu,Mu="Opera",Ru=Mu+" Mini",Fu="Edge",Ou="Microsoft "+Fu,Nu="Firefox",Lu=Nu+" "+pu,Pu="Nintendo",Du="PlayStation",qu="Xbox",Bu=hu+" "+fu,Hu=fu+" "+bu,$u="Windows",Uu=$u+" Phone",Wu="Nokia",Vu="Ouya",Gu="Generic",ju=Gu+" "+fu.toLowerCase(),Zu=Gu+" "+vu.toLowerCase(),zu="Konqueror",Qu="(\\d+(\\.\\d+)?)",Ku=new RegExp("Version/"+Qu),Yu=new RegExp(qu,"i"),Ju=new RegExp(Du+" \\w+","i"),Xu=new RegExp(Pu+" \\w+","i"),el=new RegExp(ku+"|PlayBook|BB10","i"),tl={"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"};var nl=function(e,t){return t&&kn(t,_u)||function(e){return kn(e,bu)&&!kn(e,Su)&&!kn(e,hu)}(e)},rl=function(e,t){return t=t||"",kn(e," OPR/")&&kn(e,"Mini")?Ru:kn(e," OPR/")?Mu:el.test(e)?ku:kn(e,"IE"+fu)||kn(e,"WPDesktop")?Au:kn(e,Cu)?Iu:kn(e,Fu)||kn(e,"Edg/")?Ou:kn(e,"FBIOS")?"Facebook "+fu:kn(e,"UCWEB")||kn(e,"UCBrowser")?"UC Browser":kn(e,"CriOS")?Eu:kn(e,"CrMo")?Su:kn(e,hu)&&kn(e,bu)?Bu:kn(e,Su)?Su:kn(e,"FxiOS")?Lu:kn(e.toLowerCase(),zu.toLowerCase())?zu:nl(e,t)?kn(e,fu)?Hu:bu:kn(e,Nu)?Nu:kn(e,"MSIE")||kn(e,"Trident/")?Tu:kn(e,"Gecko")?Nu:""},il=(l(nu={},Au,[new RegExp("rv:"+Qu)]),l(nu,Ou,[new RegExp(Fu+"?\\/"+Qu)]),l(nu,Su,[new RegExp("("+Su+"|CrMo)\\/"+Qu)]),l(nu,Eu,[new RegExp("CriOS\\/"+Qu)]),l(nu,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+Qu)]),l(nu,bu,[Ku]),l(nu,Hu,[Ku]),l(nu,Mu,[new RegExp("(Opera|OPR)\\/"+Qu)]),l(nu,Nu,[new RegExp(Nu+"\\/"+Qu)]),l(nu,Lu,[new RegExp("FxiOS\\/"+Qu)]),l(nu,zu,[new RegExp("Konqueror[:/]?"+Qu,"i")]),l(nu,ku,[new RegExp(ku+" "+Qu),Ku]),l(nu,Bu,[new RegExp("android\\s"+Qu,"i")]),l(nu,Iu,[new RegExp(Cu+"\\/"+Qu)]),l(nu,Tu,[new RegExp("(rv:|MSIE )"+Qu)]),l(nu,"Mozilla",[new RegExp("rv:"+Qu)]),nu),ol=[[new RegExp(qu+"; "+qu+" (.*?)[);]","i"),function(e){return[qu,e&&e[1]||""]}],[new RegExp(Pu,"i"),[Pu,""]],[new RegExp(Du,"i"),[Du,""]],[el,[ku,""]],[new RegExp($u,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[Uu,""];if(new RegExp(fu).test(t)&&!/IEMobile\b/.test(t))return[$u+" "+fu,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=tl[r]||"";return/arm/i.test(t)&&(i="RT"),[$u,i]}return[$u,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[pu,t.join(".")]}return[pu,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=Vt(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+hu+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+hu+")","i"),function(e){if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[hu,t.join(".")]}return[hu,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[xu,""]],[/Linux|debian/i,["Linux",""]]],al=function(e){return Xu.test(e)?Pu:Ju.test(e)?Du:Yu.test(e)?qu:new RegExp(Vu,"i").test(e)?Vu:new RegExp("("+Uu+"|WPDesktop)","i").test(e)?Uu:/iPad/.test(e)?mu:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?yu:el.test(e)?ku:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Wu,"i").test(e)?Wu:/(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(fu).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)?hu:gu:hu:new RegExp("(pda|"+fu+")","i").test(e)?ju:new RegExp(vu,"i").test(e)&&!new RegExp(vu+" pc","i").test(e)?Zu:""},sl="https?://(.*)",ul=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],ll={campaignParams:function(e){return sn?this._campaignParamsFromUrl(sn.URL,e):{}},_campaignParamsFromUrl:function(e,t){var n=ul.concat(t||[]),r={};return yn(n,(function(t){var n=Pn(e,t);n&&(r[t]=n)})),r},_searchEngine:function(e){return e?0===e.search(sl+"google.([^/?]*)")?"google":0===e.search(sl+"bing.com")?"bing":0===e.search(sl+"yahoo.com")?"yahoo":0===e.search(sl+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=ll._searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(!Zt(t)){r.$search_engine=t;var i=sn?Pn(sn.referrer,n):"";i.length&&(r.ph_keyword=i)}return r},searchInfo:function(){var e=null==sn?void 0:sn.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:rl,browserVersion:function(e,t){var n=rl(e,t),r=il[n];if(Vt(r))return null;for(var i=0;i<r.length;i++){var o=r[i],a=e.match(o);if(a)return parseFloat(a[a.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(var t=0;t<ol.length;t++){var n=d(ol[t],2),r=n[0],i=n[1],o=r.exec(e),a=o&&($t(i)?i(o,e):i);if(a)return a}return["",""]},device:al,deviceType:function(e){var t=al(e);return t===mu||t===gu||"Kobo"===t||"Kindle Fire"===t||t===Zu?vu:t===Pu||t===qu||t===Du||t===Vu?"Console":t===yu?"Wearable":t?fu:"Desktop"},referrer:function(){return(null==sn?void 0:sn.referrer)||"$direct"},referringDomain:function(){var e;return null!=sn&&sn.referrer&&(null===(e=On(sn.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:null==un?void 0:un.href}},initialPersonPropsFromInfo:function(e){var t,n=e.r,r=e.u,i={$initial_referrer:n,$initial_referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(t=On(n))||void 0===t?void 0:t.host};if(r){i.$initial_current_url=r;var o=On(r);i.$initial_host=null==o?void 0:o.host,i.$initial_pathname=null==o?void 0:o.pathname,yn(this._campaignParamsFromUrl(r),(function(e,t){i["$initial_"+En(t)]=e}))}n&&yn(this._searchInfoFromReferrer(n),(function(e,t){i["$initial_"+En(t)]=e}));return i},properties:function(){if(!fn)return{};var e=d(ll.os(fn),2),t=e[0],n=e[1];return bn(xn({$os:t,$os_version:n,$browser:ll.browser(fn,navigator.vendor),$device:ll.device(fn),$device_type:ll.deviceType(fn)}),{$current_url:null==un?void 0:un.href,$host:null==un?void 0:un.host,$pathname:null==un?void 0:un.pathname,$raw_user_agent:fn.length>1e3?fn.substring(0,997)+"...":fn,$browser_version:ll.browserVersion(fn,navigator.vendor),$browser_language:ll.browserLanguage(),$screen_height:null==en?void 0:en.screen.height,$screen_width:null==en?void 0:en.screen.width,$viewport_height:null==en?void 0:en.innerHeight,$viewport_width:null==en?void 0:en.innerWidth,$lib:"web",$lib_version:Xt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Cn()/1e3})},people_properties:function(){if(!fn)return{};var e=d(ll.os(fn),2),t=e[0],n=e[1];return bn(xn({$os:t,$os_version:n,$browser:ll.browser(fn,navigator.vendor)}),{$browser_version:ll.browserVersion(fn,navigator.vendor)})}},cl=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],dl=function(){function e(n){a(this,e),this.config=n,this.props={},this.campaign_params_saved=!1,this.name=function(e){var 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"}(n),this.storage=this.buildStorage(n),this.load(),n.debug&&vn.info("Persistence loaded",n.persistence,t({},this.props)),this.update_config(n,n),this.save()}return u(e,[{key:"buildStorage",value:function(e){-1===cl.indexOf(e.persistence.toLowerCase())&&(vn.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&ou.is_supported()?ou:"localstorage+cookie"===t&&su.is_supported()?su:"sessionstorage"===t&&du.is_supported()?du:"memory"===t?lu:"cookie"===t?ru:su.is_supported()?su:ru}},{key:"properties",value:function(){var e={};return yn(this.props,(function(t,n){if(n===Cs&&Ut(t))for(var r=Object.keys(t),i=0;i<r.length;i++)e["$feature/".concat(r[i])]=t[r[i]];else a=n,s=!1,(Zt(o=qs)?s:on&&o.indexOf===on?-1!=o.indexOf(a):(yn(o,(function(e){if(s||(s=e===a))return gn})),s))||(e[n]=t);var o,a,s})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=bn({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(Ut(e)){Vt(t)&&(t="None"),this.expire_days=Vt(n)?this.default_expiry:n;var i=!1;if(yn(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(Ut(e)){this.expire_days=Vt(t)?this.default_expiry:t;var r=!1;if(yn(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(ll.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(ll.searchInfo())}},{key:"update_referrer_info",value:function(){this.register_once(ll.referrerInfo(),void 0)}},{key:"set_initial_person_info",value:function(){this.props[Os]||this.props[Ns]||this.register_once(l({},Ls,ll.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return xn({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};yn([Ns,Os],(function(n){var r=e.props[n];r&&yn(r,(function(e,n){t["$initial_"+En(n)]=e}))}));var n=this.props[Ls];if(n){var r=ll.initialPersonPropsFromInfo(n);bn(t,r)}return t}},{key:"safe_merge",value:function(e){return yn(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[ls]||{};n[e]=t,this.props[ls]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[ls]||{})[e];return Vt(t)||(delete this.props[ls][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),e}();function fl(e){return JSON.stringify(e,(t=[],function(e,n){if(Ut(n)){for(;t.length>0&&t.at(-1)!==this;)t.pop();return t.includes(n)?"[Circular]":(t.push(n),n)}return n})).length;var t}var pl=2,hl=4;function vl(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),i=e.data.slice(n);return[vl({size:fl(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),vl({size:fl(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((function(e){return e}))}return[e]}var gl,ml=function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e}(ml||{}),_l=function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e}(_l||{}),yl=u((function e(t){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),l(this,"bucketSize",100),l(this,"refillRate",10),l(this,"mutationBuckets",{}),l(this,"loggedTracker",{}),l(this,"refillBuckets",(function(){Object.keys(i.mutationBuckets).forEach((function(e){i.mutationBuckets[e]=i.mutationBuckets[e]+i.refillRate,i.mutationBuckets[e]>=i.bucketSize&&delete i.mutationBuckets[e]}))})),l(this,"getNodeOrRelevantParent",(function(e){var t=i.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[i.rrweb.mirror.getId(n),n]}return[e,t]})),l(this,"numberOfChanges",(function(e){var t,n,r,i,o,a,s,u;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(a=e.texts)||void 0===a?void 0:a.length)&&void 0!==o?o:0)+(null!==(s=null===(u=e.adds)||void 0===u?void 0:u.length)&&void 0!==s?s:0)})),l(this,"throttleMutations",(function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=i.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter((function(e){var t,n,r,o=d(i.getNodeOrRelevantParent(e.id),2),a=o[0],s=o[1];if(0===i.mutationBuckets[a])return!1;(i.mutationBuckets[a]=null!==(t=i.mutationBuckets[a])&&void 0!==t?t:i.bucketSize,i.mutationBuckets[a]=Math.max(i.mutationBuckets[a]-1,0),0===i.mutationBuckets[a])&&(i.loggedTracker[a]||(i.loggedTracker[a]=!0,null===(n=(r=i.options).onBlockedNode)||void 0===n||n.call(r,a,s)));return e})));var r=i.numberOfChanges(t);return 0!==r||n===r?e:void 0})),this.rrweb=t,this.options=o,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,setInterval((function(){i.refillBuckets()}),1e3)})),bl=3e5,kl=[_l.MouseMove,_l.MouseInteraction,_l.Scroll,_l.ViewportResize,_l.Input,_l.TouchMove,_l.MediaInteraction,_l.Drag],wl=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}},Cl="[SessionRecording]",Il=function(){function e(t){var n=this;if(a(this,e),l(this,"queuedRRWebEvents",[]),l(this,"isIdle",!1),l(this,"_linkedFlagSeen",!1),l(this,"_lastActivityTimestamp",Date.now()),l(this,"_linkedFlag",null),l(this,"_forceAllowLocalhostNetworkCapture",!1),l(this,"_onBeforeUnload",(function(){n._flushBuffer()})),l(this,"_onOffline",(function(){n._tryAddCustomEvent("browser offline",{})})),l(this,"_onOnline",(function(){n._tryAddCustomEvent("browser online",{})})),l(this,"_onVisibilityChange",(function(){if(null!=sn&&sn.visibilityState){var e="window "+sn.visibilityState;n._tryAddCustomEvent(e,{})}})),l(this,"_samplingSessionListener",null),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw vn.error(Cl+" started without valid sessionManager"),new Error(Cl+" started without valid sessionManager. This is a bug.");var r=this.sessionManager.checkAndGetSessionAndWindowId(),i=r.sessionId,o=r.windowId;this.sessionId=i,this.windowId=o,this.buffer=this.clearBuffer(),this._setupSampling()}return u(e,[{key:"rrwebRecord",get:function(){var e;return null==pn||null===(e=pn.rrweb)||void 0===e?void 0:e.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw new Error(Cl+" must be started with a valid sessionManager.");return this.instance.sessionManager}},{key:"fullSnapshotIntervalMillis",get:function(){var e;return(null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.full_snapshot_interval_millis)||bl}},{key:"isSampled",get:function(){var e=this.instance.get_property(ws);return Kt(e)?e:null}},{key:"sessionDuration",get:function(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(vs),t=!this.instance.config.disable_session_recording;return en&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(gs),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(_s);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(ms),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),a=Ut(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,s=!!(Kt(a)?a:null==n?void 0:n.capturePerformance);return i||o||s?{recordHeaders:i,recordBody:o,recordPerformance:s}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(ys);return Qt(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(bs);return Qt(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?zt(this._linkedFlag)||this._linkedFlagSeen?Kt(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),null==en||en.addEventListener("beforeunload",this._onBeforeUnload),null==en||en.addEventListener("offline",this._onOffline),null==en||en.addEventListener("online",this._onOnline),null==en||en.addEventListener("visibilitychange",this._onVisibilityChange),vn.info(Cl+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==en||en.removeEventListener("beforeunload",this._onBeforeUnload),null==en||en.removeEventListener("offline",this._onOffline),null==en||en.removeEventListener("online",this._onOnline),null==en||en.removeEventListener("visibilitychange",this._onVisibilityChange),vn.info(Cl+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,n=this.sessionId!==e,r=this.sampleRate;if(Qt(r)){var i,o=this.isSampled,a=n||!Kt(o);if(a)i=Math.random()<r;else i=o;!i&&a&&vn.warn(Cl+" Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r}),null===(t=this.instance.persistence)||void 0===t||t.register(l({},ws,i))}else{var s;null===(s=this.instance.persistence)||void 0===s||s.register(l({},ws,null))}}},{key:"afterDecideResponse",value:function(e){var t,n,r,i=this;(this._persistDecideResponse(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint)&&(this._endpoint=null===(r=e.sessionRecording)||void 0===r?void 0:r.endpoint);if(this._setupSampling(),!zt(this._linkedFlag)&&!this._linkedFlagSeen){var o=Gt(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,a=Gt(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags((function(e,t){var n=Ut(t)&&o in t,r=a?t[o]===a:n;if(r){var s={linkedFlag:o,linkedVariant:a},u="linked flag matched";vn.info(Cl+" "+u,s),i._tryAddCustomEvent(u,s)}i._linkedFlagSeen=r}))}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;Qt(this.sampleRate)&&Zt(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((function(t){e.makeSamplingDecision(t)})))}},{key:"_persistDecideResponse",value:function(e){if(this.instance.persistence){var n=this.instance.persistence,r=function(){var r,i,o,a,s,u,c,d,f=null===(r=e.sessionRecording)||void 0===r?void 0:r.sampleRate,p=zt(f)?null:parseFloat(f),h=null===(i=e.sessionRecording)||void 0===i?void 0:i.minimumDurationMilliseconds;n.register((l(d={},vs,!!e.sessionRecording),l(d,gs,null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled),l(d,ms,t({capturePerformance:e.capturePerformance},null===(a=e.sessionRecording)||void 0===a?void 0:a.networkPayloadCapture)),l(d,_s,{enabled:null===(s=e.sessionRecording)||void 0===s?void 0:s.recordCanvas,fps:null===(u=e.sessionRecording)||void 0===u?void 0:u.canvasFps,quality:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasQuality}),l(d,ys,p),l(d,bs,Vt(h)?null:h),d))};r(),this.sessionManager.onSessionId(r)}}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:Cn()})}},{key:"_startCapture",value:function(){var e=this;Vt(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():this.instance.requestRouter.loadScript("/static/recorder.js?v=".concat(Xt.LIB_VERSION),(function(t){if(t)return vn.error(Cl+" could not load recorder.js",t);e._onScriptLoaded()})))}},{key:"isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==kl.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0,clearTimeout(this._fullSnapshotTimer),this._flushBuffer());var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),i=r.windowId,o=r.sessionId,a=this.sessionId!==o,s=this.windowId!==i;this.windowId=i,this.sessionId=o,(n||-1===[pl,hl].indexOf(e.type)&&(s||a||Vt(this._fullSnapshotTimer)))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):vn.warn(Cl+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var n=this;return this._tryRRWebMethod(wl((function(){return n.rrwebRecord.addCustomEvent(e,t)})))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(wl((function(){return e.rrwebRecord.takeFullSnapshot()})))}},{key:"_onScriptLoaded",value:function(){for(var e,n=this,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},i=this.instance.config.session_recording,o=0,a=Object.entries(i||{});o<a.length;o++){var s=d(a[o],2),u=s[0],l=s[1];u in r&&("maskInputOptions"===u?r.maskInputOptions=t({password:!0},l):r[u]=l)}if(this.canvasRecording&&this.canvasRecording.enabled&&(r.recordCanvas=!0,r.sampling={canvas:this.canvasRecording.fps},r.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new yl(this.rrwebRecord,{onBlockedNode:function(e,t){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");vn.info(r,{node:t}),n.log(Cl+" "+r,"warn")}});var c=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(t({emit:function(e){n.onRRwebEmit(e)},plugins:c},r)),this.instance._addCaptureHook((function(e){try{if("$pageview"===e){var t=en?n._maskUrl(en.location.href):"";if(!t)return;n._tryAddCustomEvent("$pageview",{href:t})}}catch(e){vn.error("Could not add $pageview to rrweb session",e)}})),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:r,activePlugins:c.map((function(e){return null==e?void 0:e.name}))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else vn.error(Cl+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval((function(){e._tryTakeFullSnapshot()}),t))}}},{key:"_gatherRRWebPlugins",value:function(){var e=[];(pn.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(pn.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&$t(pn.getRecordNetworkPlugin))&&(!Fn.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(pn.getRecordNetworkPlugin(_r(this.instance.config,this.networkPayloadCapture))):vn.info(Cl+" NetworkCapture not started because we are on localhost."));return e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&Ut(e)){if(e.type===ml.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===ml.FullSnapshot&&this._scheduleFullSnapshot();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var r=function(e){var t=e;if(t&&Ut(t)&&6===t.type&&Ut(t.data)&&"rrweb/console@1"===t.data.plugin){t.data.payload.payload.length>10&&(t.data.payload.payload=t.data.payload.payload.slice(0,10),t.data.payload.payload.push("...[truncated]"));for(var n=[],r=0;r<t.data.payload.payload.length;r++)t.data.payload.payload[r]&&t.data.payload.payload[r].length>2e3?n.push(t.data.payload.payload[r].slice(0,2e3)+"...[truncated]"):n.push(t.data.payload.payload[r]);return t.data.payload.payload=n,e}return e}(n),i=fl(r);if(this._updateWindowAndSessionIds(r),!this.isIdle||r.type===ml.Custom){var o={$snapshot_bytes:i,$snapshot_data:r,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&en){var e=this._maskUrl(en.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=f(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach((function(t){Date.now()-t.enqueuedAt<=2e3&&e._tryRRWebMethod(t)}))}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}},{key:"clearBuffer",value:function(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,n=this.sessionDuration,r=Qt(n)&&n>=0,i=Qt(t)&&r&&n<t;if("buffering"===this.status||i)return this.flushBufferTimer=setTimeout((function(){e._flushBuffer()}),2e3),this.buffer;this.buffer.data.length>0&&vl(this.buffer).forEach((function(t){e._captureSnapshot({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId})}));return this.clearBuffer()}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout((function(){n._flushBuffer()}),2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}},{key:"overrideLinkedFlag",value:function(){this._linkedFlagSeen=!0}}]),e}(),Sl=function(){function e(t){a(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return u(e,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(Ss),group_properties:this.instance.get_property(xs),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:ca.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){return e.parseDecideResponse(t.json)}})}},{key:"parseDecideResponse",value:function(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var n=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},n),n)vn.error("Failed to fetch feature flags from PostHog.");else{if(!sn||!sn.body)return vn.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){t.parseDecideResponse(e)}),500);if(this.instance._afterDecideResponse(e),e.siteApps)if(this.instance.config.opt_in_site_apps){var r,i=v(e.siteApps);try{var o=function(){var e=r.value,n=e.id,i=e.url,o=t.instance.requestRouter.endpointFor("api",i);pn["__$$ph_site_app_".concat(n)]=t.instance,t.instance.requestRouter.loadScript(o,(function(e){if(e)return vn.error("Error while initializing PostHog app with config id ".concat(n),e)}))};for(i.s();!(r=i.n()).done;)o()}catch(e){i.e(e)}finally{i.f()}}else e.siteApps.length>0&&vn.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),e}(),xl=null!=en&&en.location?Dn(en.location.hash,"__posthog")||Dn(location.hash,"state"):null,El="_postHogToolbarParams";!function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"}(gl||(gl={}));var Tl=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"setToolbarState",value:function(e){pn.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return null!==(e=pn.ph_toolbar_state)&&void 0!==e?e:gl.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!en||!sn)return!1;n=null!==(e=n)&&void 0!==e?e:en.location,i=null!==(t=i)&&void 0!==t?t:en.history;try{if(!r){try{en.localStorage.setItem("test","test"),en.localStorage.removeItem("test")}catch(e){return!1}r=null==en?void 0:en.localStorage}var o,a=xl||Dn(n.hash,"__posthog")||Dn(n.hash,"state"),s=a?In((function(){return JSON.parse(atob(decodeURIComponent(a)))}))||In((function(){return JSON.parse(decodeURIComponent(a))})):null;return s&&"ph_authorize"===s.action?((o=s).source="url",o&&Object.keys(o).length>0&&(s.desiredHash?n.hash=s.desiredHash:i?i.replaceState(i.state,"",n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem(El)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}},{key:"_callLoadToolbar",value:function(e){(pn.ph_load_toolbar||pn.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var n=this,r=!(null==sn||!sn.getElementById(Ds));if(!en||r)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,o=t(t({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(en.localStorage.setItem(El,JSON.stringify(t(t({},o),{},{source:void 0}))),this.getToolbarState()===gl.LOADED)this._callLoadToolbar(o);else if(this.getToolbarState()===gl.UNINITIALIZED){this.setToolbarState(gl.LOADING);var a=3e5,s=Math.floor(Date.now()/a)*a;this.instance.requestRouter.loadScript("/static/toolbar.js?t=".concat(s),(function(e){if(e)return vn.error("Failed to load toolbar",e),void n.setToolbarState(gl.UNINITIALIZED);n.setToolbarState(gl.LOADED),n._callLoadToolbar(o)})),Mn(en,"turbolinks:load",(function(){n.setToolbarState(gl.UNINITIALIZED),n.loadToolbar(o)}))}return!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}]),e}(),Al=function(){function e(t){a(this,e),l(this,"isPaused",!0),l(this,"queue",[]),l(this,"flushTimeoutMs",3e3),this.sendRequest=t}return u(e,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var n=this.queue.length>0?this.formatQueue():{},r=Object.values(n),i=[].concat(f(r.filter((function(e){return 0===e.url.indexOf("/e")}))),f(r.filter((function(e){return 0!==e.url.indexOf("/e")}))));i.map((function(n){e.sendRequest(t(t({},n),{},{transport:"sendBeacon"}))}))}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout((function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=(new Date).getTime();r.data&&Ht(r.data)&&yn(r.data,(function(e){e.offset=Math.abs(e.timestamp-i),delete e.timestamp})),e.sendRequest(r)};for(var r in t)n(r)}}),this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return yn(this.queue,(function(n){var r,i=n,o=(i?i.batchKey:null)||i.url;Vt(e[o])&&(e[o]=t(t({},i),{},{data:[]})),null===(r=e[o].data)||void 0===r||r.push(i.data)})),this.queue=[],e}}]),e}(),Ml=Uint8Array,Rl=Uint16Array,Fl=Uint32Array,Ol=new Ml([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]),Nl=new Ml([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]),Ll=new Ml([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Pl=function(e,t){for(var n=new Rl(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Fl(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},Dl=Pl(Ol,2),ql=Dl[0],Bl=Dl[1];ql[28]=258,Bl[258]=28;for(var Hl=Pl(Nl,0)[1],$l=new Rl(32768),Ul=0;Ul<32768;++Ul){var Wl=(43690&Ul)>>>1|(21845&Ul)<<1;Wl=(61680&(Wl=(52428&Wl)>>>2|(13107&Wl)<<2))>>>4|(3855&Wl)<<4,$l[Ul]=((65280&Wl)>>>8|(255&Wl)<<8)>>>1}var Vl=function(e,t,n){for(var r=e.length,i=0,o=new Rl(t);i<r;++i)++o[e[i]-1];var a,s=new Rl(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;if(n){a=new Rl(1<<t);var u=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],c=t-e[i],d=s[e[i]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)a[$l[d]>>>u]=l}else for(a=new Rl(r),i=0;i<r;++i)a[i]=$l[s[e[i]-1]++]>>>15-e[i];return a},Gl=new Ml(288);for(Ul=0;Ul<144;++Ul)Gl[Ul]=8;for(Ul=144;Ul<256;++Ul)Gl[Ul]=9;for(Ul=256;Ul<280;++Ul)Gl[Ul]=7;for(Ul=280;Ul<288;++Ul)Gl[Ul]=8;var jl=new Ml(32);for(Ul=0;Ul<32;++Ul)jl[Ul]=5;var Zl=Vl(Gl,9,0),zl=Vl(jl,5,0),Ql=function(e){return(e/8>>0)+(7&e&&1)},Kl=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Rl?Rl:e instanceof Fl?Fl:Ml)(n-t);return r.set(e.subarray(t,n)),r},Yl=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Jl=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Xl=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new Ml(0),0];if(1==i){var a=new Ml(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var s=n[0],u=n[1],l=0,c=1,d=2;for(n[0]={s:-1,f:s.f+u.f,l:s,r:u};c!=i-1;)s=n[n[l].f<n[d].f?l++:d++],u=n[l!=c&&n[l].f<n[d].f?l++:d++],n[c++]={s:-1,f:s.f+u.f,l:s,r:u};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var p=new Rl(f+1),h=ec(n[c-1],p,0);if(h>t){r=0;var v=0,g=h-t,m=1<<g;for(o.sort((function(e,t){return p[t.s]-p[e.s]||e.f-t.f}));r<i;++r){var _=o[r].s;if(!(p[_]>t))break;v+=m-(1<<h-p[_]),p[_]=t}for(v>>>=g;v>0;){var y=o[r].s;p[y]<t?v-=1<<t-p[y]++-1:++r}for(;r>=0&&v;--r){var b=o[r].s;p[b]==t&&(--p[b],++v)}h=t}return[new Ml(p),h]},ec=function e(t,n,r){return-1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},tc=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Rl(++t),r=0,i=e[0],o=1,a=function(e){n[r++]=e},s=1;s<=t;++s)if(e[s]==i&&s!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)a(32754);o>2&&(a(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(a(i),--o;o>6;o-=6)a(8304);o>2&&(a(o-3<<5|8208),o=0)}for(;o--;)a(i);o=1,i=e[s]}return[n.subarray(0,r),t]},nc=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},rc=function(e,t,n){var r=n.length,i=Ql(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},ic=function(e,t,n,r,i,o,a,s,u,l,c){Yl(t,c++,n),++i[256];for(var d=Xl(i,15),f=d[0],p=d[1],h=Xl(o,15),v=h[0],g=h[1],m=tc(f),_=m[0],y=m[1],b=tc(v),k=b[0],w=b[1],C=new Rl(19),I=0;I<_.length;++I)C[31&_[I]]++;for(I=0;I<k.length;++I)C[31&k[I]]++;for(var S=Xl(C,7),x=S[0],E=S[1],T=19;T>4&&!x[Ll[T-1]];--T);var A,M,R,F,O=l+5<<3,N=nc(i,Gl)+nc(o,jl)+a,L=nc(i,f)+nc(o,v)+a+14+3*T+nc(C,x)+(2*C[16]+3*C[17]+7*C[18]);if(O<=N&&O<=L)return rc(t,c,e.subarray(u,u+l));if(Yl(t,c,1+(L<N)),c+=2,L<N){A=Vl(f,p,0),M=f,R=Vl(v,g,0),F=v;var P=Vl(x,E,0);Yl(t,c,y-257),Yl(t,c+5,w-1),Yl(t,c+10,T-4),c+=14;for(I=0;I<T;++I)Yl(t,c+3*I,x[Ll[I]]);c+=3*T;for(var D=[_,k],q=0;q<2;++q){var B=D[q];for(I=0;I<B.length;++I){var H=31&B[I];Yl(t,c,P[H]),c+=x[H],H>15&&(Yl(t,c,B[I]>>>5&127),c+=B[I]>>>12)}}}else A=Zl,M=Gl,R=zl,F=jl;for(I=0;I<s;++I)if(r[I]>255){H=r[I]>>>18&31;Jl(t,c,A[H+257]),c+=M[H+257],H>7&&(Yl(t,c,r[I]>>>23&31),c+=Ol[H]);var $=31&r[I];Jl(t,c,R[$]),c+=F[$],$>3&&(Jl(t,c,r[I]>>>5&8191),c+=Nl[$])}else Jl(t,c,A[r[I]]),c+=M[r[I]];return Jl(t,c,A[256]),c+M[256]},oc=new Fl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ac=new Ml(0),sc=function(){for(var e=new Fl(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),uc=function(e,t,n,r,i){return function(e,t,n,r,i,o){var a=e.length,s=new Ml(r+a+5*(1+Math.floor(a/7e3))+i),u=s.subarray(r,s.length-i),l=0;if(!t||a<8)for(var c=0;c<=a;c+=65535){var d=c+65535;d<a?l=rc(u,l,e.subarray(c,d)):(u[c]=o,l=rc(u,l,e.subarray(c,a)))}else{for(var f=oc[t-1],p=f>>>13,h=8191&f,v=(1<<n)-1,g=new Rl(32768),m=new Rl(v+1),_=Math.ceil(n/3),y=2*_,b=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<y)&v},k=new Fl(25e3),w=new Rl(288),C=new Rl(32),I=0,S=0,x=(c=0,0),E=0,T=0;c<a;++c){var A=b(c),M=32767&c,R=m[A];if(g[M]=R,m[A]=M,E<=c){var F=a-c;if((I>7e3||x>24576)&&F>423){l=ic(e,u,0,k,w,C,S,x,T,c-T,l),x=I=S=0,T=c;for(var O=0;O<286;++O)w[O]=0;for(O=0;O<30;++O)C[O]=0}var N=2,L=0,P=h,D=M-R&32767;if(F>2&&A==b(c-D))for(var q=Math.min(p,F)-1,B=Math.min(32767,c),H=Math.min(258,F);D<=B&&--P&&M!=R;){if(e[c+N]==e[c+N-D]){for(var $=0;$<H&&e[c+$]==e[c+$-D];++$);if($>N){if(N=$,L=D,$>q)break;var U=Math.min(D,$-2),W=0;for(O=0;O<U;++O){var V=c-D+O+32768&32767,G=V-g[V]+32768&32767;G>W&&(W=G,R=V)}}}D+=(M=R)-(R=g[M])+32768&32767}if(L){k[x++]=268435456|Bl[N]<<18|Hl[L];var j=31&Bl[N],Z=31&Hl[L];S+=Ol[j]+Nl[Z],++w[257+j],++C[Z],E=c+N,++I}else k[x++]=e[c],++w[e[c]]}}l=ic(e,u,o,k,w,C,S,x,T,c-T,l),o||(l=rc(u,l,ac))}return Kl(s,0,r+Ql(l)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},lc=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function cc(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=sc[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i=uc(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),o=i.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&lc(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}}(i,t),lc(i,o-8,n.d()),lc(i,o-4,r),i}var dc=!!cn||!!ln,fc="text/plain",pc=function(e,n){var r=d(e.split("?"),2),i=r[0],o=r[1],a=t({},n);null==o||o.split("&").forEach((function(e){var t=d(e.split("="),1)[0];delete a[t]}));var s=Ln(a);return s=s?(o?o+"&":"")+s:o,"".concat(i,"?").concat(s)},hc=function(e){return"data="+encodeURIComponent("string"==typeof e?e:JSON.stringify(e))},vc=function(e){var t=e.data,n=e.compression;if(t){if(n===ca.GZipJS){var r=cc(function(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Ml(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},a=0;a<n;++a){if(i+5>r.length){var s=new Ml(i+8+(n-a<<1));s.set(r),r=s}var u=e.charCodeAt(a);u<128||t?o(u):u<2048?(o(192|u>>>6),o(128|63&u)):u>55295&&u<57344?(o(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++a))>>>18),o(128|u>>>12&63),o(128|u>>>6&63),o(128|63&u)):(o(224|u>>>12),o(128|u>>>6&63),o(128|63&u))}return Kl(r,0,i)}(JSON.stringify(t)),{mtime:0});return{contentType:fc,body:new Blob([r],{type:fc})}}if(n===ca.Base64){var i=function(e){var t,n,r,i,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,l="",c=[];if(!e)return e;e=An(e);do{t=(o=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,c[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(i)}while(s<e.length);switch(l=c.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l}(JSON.stringify(t));return{contentType:"application/x-www-form-urlencoded",body:hc(i)}}return{contentType:"application/json",body:JSON.stringify(t)}}},gc=[];cn&&gc.push({transport:"XHR",method:function(e){var t,n=new cn;n.open(e.method||"GET",e.url,!0);var r=null!==(t=vc(e))&&void 0!==t?t:{},i=r.contentType,o=r.body;yn(e.headers,(function(e,t){n.setRequestHeader(t,e)})),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=function(){if(4===n.readyState){var t,r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,r)}},n.send(o)}}),ln&&gc.push({transport:"fetch",method:function(e){var t,n,r=null!==(t=vc(e))&&void 0!==t?t:{},i=r.contentType,o=r.body,a=new Headers;yn(e.headers,(function(e,t){a.append(t,e)})),i&&a.append("Content-Type",i);var s=e.url,u=null;if(dn){var l=new dn;u={signal:l.signal,timeout:setTimeout((function(){return l.abort()}),e.timeout)}}ln(s,{method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method,body:o,signal:null===(n=u)||void 0===n?void 0:n.signal}).then((function(t){return t.text().then((function(n){var r,i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){vn.error(e)}null===(r=e.callback)||void 0===r||r.call(e,i)}))})).catch((function(t){var n;vn.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})})).finally((function(){return u?clearTimeout(u.timeout):null}))}}),null!=an&&an.sendBeacon&&gc.push({transport:"sendBeacon",method:function(e){var t=pc(e.url,{beacon:"1"});try{var n,r=null!==(n=vc(e))&&void 0!==n?n:{},i=r.contentType,o=r.body,a="string"==typeof o?new Blob([o],{type:i}):o;an.sendBeacon(t,a)}catch(e){}}});var mc=["retriesPerformedSoFar"];var _c,yc=function(){function e(t){var n=this;a(this,e),l(this,"isPolling",!1),l(this,"pollIntervalMs",3e3),l(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!Vt(en)&&"onLine"in en.navigator&&(this.areWeOnline=en.navigator.onLine,en.addEventListener("online",(function(){n.areWeOnline=!0,n.flush()})),en.addEventListener("offline",(function(){n.areWeOnline=!1})))}return u(e,[{key:"retriableRequest",value:function(e){var n=this,r=e.retriesPerformedSoFar,i=c(e,mc);Qt(r)&&r>0&&(i.url=pc(i.url,{retry_count:r})),this.instance._send_request(t(t({},i),{},{callback:function(e){var o;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=r?r:0)<10?n.enqueue(t({retriesPerformedSoFar:r},i)):null===(o=i.callback)||void 0===o||o.call(i,e)}}))}},{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var n=function(e){var t=3e3*Math.pow(2,e),n=t/2,r=Math.min(18e5,t),i=(Math.random()-.5)*(r-n);return Math.ceil(r+i)}(t),r=Date.now()+n;this.queue.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in ".concat(n);navigator.onLine||(i+=" (Browser is offline)"),vn.warn(i),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],n=this.queue.filter((function(n){return n.retryAt<e||(t.push(n),!1)}));if(this.queue=t,n.length>0){var r,i=v(n);try{for(i.s();!(r=i.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,n=v(this.queue);try{for(n.s();!(e=n.n()).done;){var r=e.value.requestOptions;try{this.instance._send_request(t(t({},r),{},{transport:"sendBeacon"}))}catch(e){vn.error(e)}}}catch(e){n.e(e)}finally{n.f()}this.queue=[]}}]),e}(),bc=1800,kc=function(){function e(t,n,r,i){var o;a(this,e),l(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||Ks,this._windowIdGenerator=i||Ks;var s=t.persistence_name||t.token,u=t.session_idle_timeout_seconds||bc;if(Qt(u)?u>bc?vn.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):u<60&&vn.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(vn.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),u=bc),this._sessionTimeoutMs=1e3*Math.min(Math.max(u,60),bc),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var c=du.parse(this._window_id_storage_key),d=du.parse(this._primary_window_exists_storage_key);c&&!d?this._windowId=c:du.remove(this._window_id_storage_key),du.set(this._primary_window_exists_storage_key,!0)}if(null!==(o=this.config.bootstrap)&&void 0!==o&&o.sessionID)try{var f=function(e){var t=e.replace(/-/g,"");if(32!==t.length)throw new Error("Not a valid UUID");if("7"!==t[12])throw new Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)}(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),f)}catch(e){vn.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}return u(e,[{key:"onSessionId",value:function(e){var t=this;return Vt(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter((function(t){return t!==e}))}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&du.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&du.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?du.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(l({},ks,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[ks];return Ht(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;null==en||en.addEventListener("beforeunload",(function(){e._canUseSessionStorage()&&du.remove(e._primary_window_exists_storage_key)}))}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=d(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],a=this._getWindowId(),s=o&&o>0&&Math.abs(t-o)>864e5,u=!1,l=!i,c=!e&&Math.abs(t-r)>this._sessionTimeoutMs;l||c||s?(i=this._sessionIdGenerator(),a=this._windowIdGenerator(),vn.info("[SessionId] new session ID generated",{sessionId:i,windowId:a,changeReason:{noSessionId:l,activityTimeout:c,sessionPastMaximumLength:s}}),o=t,u=!0):a||(a=this._windowIdGenerator(),u=!0);var f=0===r||!e||s?t:r,p=0===o?(new Date).getTime():o;return this._setWindowId(a),this._setSessionId(i,f,p),u&&this._sessionIdChangedHandlers.forEach((function(e){return e(i,a)})),{sessionId:i,windowId:a,sessionStartTimestamp:p}}}]),e}();!function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"}(_c||(_c={}));var wc="i.posthog.com",Cc=function(){function e(t){a(this,e),l(this,"_regionCache",{}),this.instance=t}return u(e,[{key:"apiHost",get:function(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}},{key:"uiHost",get:function(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(wc),".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=_c.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=_c.EU:this._regionCache[this.apiHost]=_c.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return this.uiHost+t;if(this.region===_c.CUSTOM)return this.apiHost+t;var n=wc+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}},{key:"loadScript",value:function(e,t){if(this.instance.config.disable_external_dependency_loading)return vn.warn("".concat(e," was requested but loading of external scripts is disabled.")),t("Loading of external scripts is disabled");var n="/"===e[0]?this.endpointFor("assets",e):e,r=function(){if(!sn)return t("document not found");var e=sn.createElement("script");e.type="text/javascript",e.src=n,e.onload=function(e){return t(void 0,e)},e.onerror=function(e){return t(e)};var r,i=sn.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(e,i[0]):sn.body.appendChild(e)};null!=sn&&sn.body?r():null==sn||sn.addEventListener("DOMContentLoaded",r)}}]),e}(),Ic="/e/",Sc="[Exception Capture]",xc=function(){function e(t){var n,r,i=this;a(this,e),l(this,"originalOnUnhandledRejectionHandler",void 0),l(this,"startCapturing",(function(){var e;if(en&&i.isEnabled&&!i.hasHandlers&&(null===(e=en.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)){var t=en.posthogErrorWrappingFunctions.wrapOnError,n=en.posthogErrorWrappingFunctions.wrapUnhandledRejection;if(t&&n)try{i.unwrapOnError=t(i.captureException.bind(i)),i.unwrapUnhandledRejection=n(i.captureException.bind(i))}catch(e){vn.error(Sc+" failed to start",e),i.stopCapturing()}else vn.error(Sc+" failed to load error wrapping functions - cannot start")}})),this.instance=t,this.remoteEnabled=!(null===(n=this.instance.persistence)||void 0===n||!n.props[fs]),this._endpointSuffix=(null===(r=this.instance.persistence)||void 0===r?void 0:r.props[ps])||Ic,this.startIfEnabled()}return u(e,[{key:"endpoint",get:function(){return this.instance.requestRouter.endpointFor("api",this._endpointSuffix)}},{key:"isEnabled",get:function(){var e;return null!==(e=this.remoteEnabled)&&void 0!==e&&e}},{key:"isCapturing",get:function(){var e;return!(null==en||null===(e=en.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)}},{key:"hasHandlers",get:function(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this.isCapturing&&(vn.info(Sc+" enabled, starting..."),this.loadScript(this.startCapturing))}},{key:"loadScript",value:function(e){this.hasHandlers&&e(),this.instance.requestRouter.loadScript("/static/exception-autocapture.js?v=".concat(Xt.LIB_VERSION),(function(t){if(t)return vn.error(Sc+" failed to load script",t);e()}))}},{key:"stopCapturing",value:function(){var e,t;null===(e=this.unwrapOnError)||void 0===e||e.call(this),null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this)}},{key:"afterDecideResponse",value:function(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t||!1,this._endpointSuffix=Ut(t)&&t.endpoint||Ic,this.instance.persistence&&(this.instance.persistence.register(l({},fs,this.remoteEnabled)),this.instance.persistence.register(l({},ps,this._endpointSuffix))),this.startIfEnabled()}},{key:"captureException",value:function(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.sendExceptionEvent(e)}},{key:"sendExceptionEvent",value:function(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_url:this.endpoint})}}]),e}(),Ec="posthog-js";function Tc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.organization,r=t.projectId,i=t.prefix,o=t.severityAllowList,a=void 0===o?["error"]:o;return function(t){var o,s,u,l,c,d;if(!("*"===a||a.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var f=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));t.tags["PostHog Person URL"]=f,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=(null===(o=t.exception)||void 0===o?void 0:o.values)||[],h={$exception_message:(null===(s=p[0])||void 0===s?void 0:s.value)||t.message,$exception_type:null===(u=p[0])||void 0===u?void 0:u.type,$exception_personURL:f,$exception_level:t.level,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null===(l=p[0])||void 0===l?void 0:l.value)||t.message,$sentry_exception_type:null===(c=p[0])||void 0===c?void 0:c.type,$sentry_tags:t.tags,$level:t.level};return n&&r&&(h.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+t.event_id),e.capture("$exception",h,{_url:(null===(d=e.exceptionObserver)||void 0===d?void 0:d.endpoint)||e.requestRouter.endpointFor("api",Ic)}),t}}var Ac=u((function e(t,n,r,i,o){a(this,e),this.name=Ec,this.setupOnce=function(e){e(Tc(t,{organization:n,projectId:r,prefix:i,severityAllowList:o}))}}));function Mc(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var r=function(n){var r=function(){return n.anonymousId()||Ks()};e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(Ms,"identified")),t()},i=n.user();"then"in i&&$t(i.then)?i.then((function(e){return r(e)})):r(i)}(e,(function(){n.register(function(e){Promise&&Promise.resolve||vn.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(t,n){var r;if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(vn.info("Segment integration does not have a userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(vn.info("Segment integration has a userId set, identifying with PostHog"),e.identify(t.event.userId));var i=e._calculate_event_properties(n,null!==(r=t.event.properties)&&void 0!==r?r:{},new Date);return t.event.properties=Object.assign({},i,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}}(e)).then((function(){t()}))}))}var Rc=function(){function e(t){a(this,e),this._instance=t}return u(e,[{key:"doPageView",value:function(e){var t,n=this._previousPageViewProperties(e);return this._currentPath=null!==(t=null==en?void 0:en.location.pathname)&&void 0!==t?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,n}},{key:"doPageLeave",value:function(e){return this._previousPageViewProperties(e)}},{key:"_previousPageViewProperties",value:function(e){var t=this._currentPath,n=this._prevPageviewTimestamp,r=this._instance.scrollManager.getContext();if(!n)return{};var i={};if(r){var o=r.maxScrollHeight,a=r.lastScrollY,s=r.maxScrollY,u=r.maxContentHeight,l=r.lastContentY,c=r.maxContentY;if(!(Vt(o)||Vt(a)||Vt(s)||Vt(u)||Vt(l)||Vt(c)))o=Math.ceil(o),a=Math.ceil(a),s=Math.ceil(s),u=Math.ceil(u),l=Math.ceil(l),c=Math.ceil(c),i={$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:o<=1?1:Fc(a/o,0,1),$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:o<=1?1:Fc(s/o,0,1),$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:u<=1?1:Fc(l/u,0,1),$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:u<=1?1:Fc(c/u,0,1)}}return t&&(i.$prev_pageview_pathname=t),n&&(i.$prev_pageview_duration=(e.getTime()-n.getTime())/1e3),i}}]),e}();function Fc(e,t,n){return Math.max(t,Math.min(e,n))}var Oc=function(){function e(){a(this,e),l(this,"events",{}),this.events={}}return u(e,[{key:"on",value:function(e,t){var n=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){n.events[e]=n.events[e].filter((function(e){return e!==t}))}}},{key:"emit",value:function(e,t){var n,r=v(this.events[e]||[]);try{for(r.s();!(n=r.n()).done;){(0,n.value)(t)}}catch(e){r.e(e)}finally{r.f()}var i,o=v(this.events["*"]||[]);try{for(o.s();!(i=o.n()).done;){(0,i.value)(e,t)}}catch(e){o.e(e)}finally{o.f()}}}]),e}(),Nc=function(){function e(t){var n=this;a(this,e),l(this,"_debugEventEmitter",new Oc),l(this,"checkStep",(function(e,t){return n.checkStepEvent(e,t)&&n.checkStepUrl(e,t)&&n.checkStepElement(e,t)})),l(this,"checkStepEvent",(function(e,t){return null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)})),this.instance=t,this.actionEvents=new Set,this.actionRegistry=new Set}return u(e,[{key:"init",value:function(){var e,t=this;if(!Vt(null===(e=this.instance)||void 0===e?void 0:e._addCaptureHook)){var n;null===(n=this.instance)||void 0===n||n._addCaptureHook((function(e,n){t.on(e,n)}))}}},{key:"register",value:function(e){var t,n,r=this;if(!Vt(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach((function(e){var t,n;null===(t=r.actionRegistry)||void 0===t||t.add(e),null===(n=e.steps)||void 0===n||n.forEach((function(e){var t;null===(t=r.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")}))})),null!==(n=this.instance)&&void 0!==n&&n.autocapture)){var i,o=new Set;e.forEach((function(e){var t;null===(t=e.steps)||void 0===t||t.forEach((function(e){null!=e&&e.selector&&o.add(null==e?void 0:e.selector)}))})),null===(i=this.instance)||void 0===i||i.autocapture.setElementSelectors(o)}}},{key:"on",value:function(e,t){var n,r=this;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(n=this.actionRegistry)||void 0===n?void 0:n.size)>0&&this.actionRegistry.forEach((function(e){r.checkAction(t,e)&&r._debugEventEmitter.emit("actionCaptured",e.name)}))}},{key:"_addActionHook",value:function(e){this.onAction("actionCaptured",(function(t){return e(t)}))}},{key:"checkAction",value:function(e,t){if(null==(null==t?void 0:t.steps))return!1;var n,r=v(t.steps);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(this.checkStep(e,i))return!0}}catch(e){r.e(e)}finally{r.f()}return!1}},{key:"onAction",value:function(e,t){return this._debugEventEmitter.on(e,t)}},{key:"checkStepUrl",value:function(t,n){if(null!=n&&n.url){var r,i=null==t||null===(r=t.properties)||void 0===r?void 0:r.$current_url;if(!i||"string"!=typeof i)return!1;if(!e.matchString(i,null==n?void 0:n.url,(null==n?void 0:n.url_matching)||"contains"))return!1}return!0}},{key:"checkStepElement",value:function(t,n){if((null!=n&&n.href||null!=n&&n.tag_name||null!=n&&n.text)&&!this.getElementsList(t).some((function(t){return!(null!=n&&n.href&&!e.matchString(t.href||"",null==n?void 0:n.href,(null==n?void 0:n.href_matching)||"exact"))&&((null==n||!n.tag_name||t.tag_name===(null==n?void 0:n.tag_name))&&!(null!=n&&n.text&&!e.matchString(t.text||"",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||"exact")&&!e.matchString(t.$el_text||"",null==n?void 0:n.text,(null==n?void 0:n.text_matching)||"exact")))})))return!1;if(null!=n&&n.selector){var r,i=null==t||null===(r=t.properties)||void 0===r?void 0:r.$element_selectors;if(!i)return!1;if(!i.includes(null==n?void 0:n.selector))return!1}return!0}},{key:"getElementsList",value:function(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}],[{key:"matchString",value:function(t,n,r){switch(r){case"regex":return!!en&&Nn(t,n);case"exact":return n===t;case"contains":var i=e.escapeStringRegexp(n).replace(/_/g,".").replace(/%/g,".*");return Nn(t,i);default:return!1}}},{key:"escapeStringRegexp",value:function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}}]),e}(),Lc=function(){function e(t){a(this,e),this.instance=t,this.eventToSurveys=new Map,this.actionToSurveys=new Map}return u(e,[{key:"register",value:function(e){var t;Vt(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}},{key:"setupActionBasedSurveys",value:function(e){var t=this,n=e.filter((function(e){var t,n,r,i;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(n=e.conditions)||void 0===n||null===(r=n.actions)||void 0===r||null===(i=r.values)||void 0===i?void 0:i.length)>0}));if(0!==n.length){if(null==this.actionMatcher){this.actionMatcher=new Nc(this.instance),this.actionMatcher.init();this.actionMatcher._addActionHook((function(e){t.onAction(e)}))}n.forEach((function(e){var n,r,i,o,a,s,u,l,c,d;e.conditions&&null!==(n=e.conditions)&&void 0!==n&&n.actions&&null!==(r=e.conditions)&&void 0!==r&&null!==(i=r.actions)&&void 0!==i&&i.values&&(null===(o=e.conditions)||void 0===o||null===(a=o.actions)||void 0===a||null===(s=a.values)||void 0===s?void 0:s.length)>0&&(null===(u=t.actionMatcher)||void 0===u||u.register(e.conditions.actions.values),null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c||null===(d=c.values)||void 0===d||d.forEach((function(n){if(n&&n.name){var r=t.actionToSurveys.get(n.name);r&&r.push(e.id),t.actionToSurveys.set(n.name,r||[e.id])}})))}))}}},{key:"setupEventBasedSurveys",value:function(e){var t,n=this;if(0!==e.filter((function(e){var t,n,r,i;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r||null===(i=r.values)||void 0===i?void 0:i.length)>0})).length){null===(t=this.instance)||void 0===t||t._addCaptureHook((function(e,t){n.onEvent(e,t)})),e.forEach((function(e){var t,r,i;null===(t=e.conditions)||void 0===t||null===(r=t.events)||void 0===r||null===(i=r.values)||void 0===i||i.forEach((function(t){if(t&&t.name){var r=n.eventToSurveys.get(t.name);r&&r.push(e.id),n.eventToSurveys.set(t.name,r||[e.id])}}))}))}}},{key:"onEvent",value:function(t,n){var r,i,o=(null===(r=this.instance)||void 0===r||null===(i=r.persistence)||void 0===i?void 0:i.props[Ts])||[];if(e.SURVEY_SHOWN_EVENT_NAME==t&&n&&o.length>0){var a,s=null==n||null===(a=n.properties)||void 0===a?void 0:a.$survey_id;if(s){var u=o.indexOf(s);u>=0&&(o.splice(u,1),this._updateActivatedSurveys(o))}}else this.eventToSurveys.has(t)&&this._updateActivatedSurveys(o.concat(this.eventToSurveys.get(t)||[]))}},{key:"onAction",value:function(e){var t,n,r=(null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n?void 0:n.props[Ts])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(r.concat(this.actionToSurveys.get(e)||[]))}},{key:"_updateActivatedSurveys",value:function(e){var t,n;null===(t=this.instance)||void 0===t||null===(n=t.persistence)||void 0===n||n.register(l({},Ts,f(new Set(e))))}},{key:"getSurveys",value:function(){var e,t,n=null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[Ts];return n||[]}},{key:"getEventToSurveys",value:function(){return this.eventToSurveys}},{key:"_getActionMatcher",value:function(){return this.actionMatcher}}]),e}();l(Lc,"SURVEY_SHOWN_EVENT_NAME","survey shown");var Pc="[Surveys]",Dc={icontains:function(e){return!!en&&en.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e){return!!en&&-1===en.location.href.toLowerCase().indexOf(e.toLowerCase())},regex:function(e){return!!en&&Nn(en.location.href,e)},not_regex:function(e){return!!en&&!Nn(en.location.href,e)},exact:function(e){return(null==en?void 0:en.location.href)===e},is_not:function(e){return(null==en?void 0:en.location.href)!==e}};var qc=function(){function e(t){a(this,e),this.instance=t,this._surveyEventReceiver=null}return u(e,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,t=null==pn?void 0:pn.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new Lc(this.instance)),this.instance.requestRouter.loadScript("/static/surveys.js",(function(t){if(t)return vn.error(Pc,"Could not load surveys script",t);e._surveyManager=pn.extendPostHogWithSurveys(e.instance)})))}},{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new Lc(this.instance));var r=this.instance.get_property(Es);if(r&&!n)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(n){var r;if(200!==n.statusCode||!n.json)return e([]);var i,o=n.json.surveys||[],a=o.filter((function(e){var t,n,r,i,o,a,s,u,l,c,d,f;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r?void 0:r.values)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(a=o.values)||void 0===a?void 0:a.length)>0||(null===(s=e.conditions)||void 0===s?void 0:s.actions)&&(null===(u=e.conditions)||void 0===u||null===(l=u.actions)||void 0===l?void 0:l.values)&&(null===(c=e.conditions)||void 0===c||null===(d=c.actions)||void 0===d||null===(f=d.values)||void 0===f?void 0:f.length)>0}));a.length>0&&(null===(i=t._surveyEventReceiver)||void 0===i||i.register(a));return null===(r=t.instance.persistence)||void 0===r||r.register(l({},Es,o)),e(o)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys((function(n){var r,i=n.filter((function(e){return!(!e.start_date||e.end_date)})).filter((function(e){var t,n,r,i;if(!e.conditions)return!0;var o=null===(t=e.conditions)||void 0===t||!t.url||Dc[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),a=null===(i=e.conditions)||void 0===i||!i.selector||(null==sn?void 0:sn.querySelector(e.conditions.selector));return o&&a})),o=null===(r=t._surveyEventReceiver)||void 0===r?void 0:r.getSurveys(),a=i.filter((function(e){var n,r,i,a,s,u,l,c,d,f;if(!e.linked_flag_key&&!e.targeting_flag_key&&!e.internal_targeting_flag_key)return!0;var p=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),h=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),v=(null===(n=e.conditions)||void 0===n?void 0:n.events)&&(null===(r=e.conditions)||void 0===r||null===(i=r.events)||void 0===i?void 0:i.values)&&(null===(a=e.conditions)||void 0===a||null===(s=a.events)||void 0===s?void 0:s.values.length)>0,g=(null===(u=e.conditions)||void 0===u?void 0:u.actions)&&(null===(l=e.conditions)||void 0===l||null===(c=l.actions)||void 0===c?void 0:c.values)&&(null===(d=e.conditions)||void 0===d||null===(f=d.actions)||void 0===f?void 0:f.values.length)>0,m=!v&&!g||(null==o?void 0:o.includes(e.id)),_=t._canActivateRepeatedly(e),y=!(e.internal_targeting_flag_key&&!_)||t.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key);return p&&h&&y&&m}));return e(a)}),n)}},{key:"getNextSurveyStep",value:function(e,t,n){var r,i=e.questions[t],o=t+1;if(null===(r=i.branching)||void 0===r||!r.type)return t===e.questions.length-1?Wr.End:o;if(i.branching.type===Wr.End)return Wr.End;if(i.branching.type===Wr.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===Wr.ResponseBased){if(i.type===Ur.SingleChoice){var a,s,u=i.choices.indexOf("".concat(n));if(null!==(a=i.branching)&&void 0!==a&&null!==(s=a.responseValues)&&void 0!==s&&s.hasOwnProperty(u)){var l=i.branching.responseValues[u];return Number.isInteger(l)?l:l===Wr.End?Wr.End:o}}else if(i.type===Ur.Rating){var c,d;if("number"!=typeof n||!Number.isInteger(n))throw new Error("The response type must be an integer");var f=function(e,t){if(3===t){if(e<1||e>3)throw new Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw new Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw new Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 10")}(n,i.scale);if(null!==(c=i.branching)&&void 0!==c&&null!==(d=c.responseValues)&&void 0!==d&&d.hasOwnProperty(f)){var p=i.branching.responseValues[f];return Number.isInteger(p)?p:p===Wr.End?Wr.End:o}}return o}return vn.warn(Pc,"Falling back to next question index due to unexpected branching type"),o}},{key:"_canActivateRepeatedly",value:function(e){return zt(pn.__PosthogExtensions__.canActivateRepeatedly)&&vn.warn(Pc,"canActivateRepeatedly is not defined, must init before calling"),pn.__PosthogExtensions__.canActivateRepeatedly(e)}},{key:"canRenderSurvey",value:function(e){var t=this;zt(this._surveyManager)?vn.warn(Pc,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys((function(n){var r=n.filter((function(t){return t.id===e}))[0];t._surveyManager.canRenderSurvey(r)}))}},{key:"renderSurvey",value:function(e,t){var n=this;zt(this._surveyManager)?vn.warn(Pc,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys((function(r){var i=r.filter((function(t){return t.id===e}))[0];n._surveyManager.renderSurvey(i,null==sn?void 0:sn.querySelector(t))}))}}]),e}(),Bc=function(){function e(t){var n,r,i=this;a(this,e),l(this,"serverLimits",{}),l(this,"lastEventRateLimited",!1),l(this,"checkForLimiting",(function(e){var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach((function(e){vn.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),i.serverLimits[e]=(new Date).getTime()+6e4}))}catch(e){return void vn.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:t})}})),this.instance=t,this.captureEventsPerSecond=(null===(n=t.config.rate_limiting)||void 0===n?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(r=t.config.rate_limiting)||void 0===r?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return u(e,[{key:"clientRateLimitContext",value:function(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(new Date).getTime(),o=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(Fs))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:i};o.tokens+=(i-o.last)/1e3*this.captureEventsPerSecond,o.last=i,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var a=o.tokens<1;return a||r||(o.tokens=Math.max(0,o.tokens-1)),!a||this.lastEventRateLimited||r||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,null===(n=this.instance.persistence)||void 0===n||n.set_property(Fs,o),{isRateLimited:a,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),Hc=function(){return t({initialPathName:(null==un?void 0:un.pathname)||"",referringDomain:ll.referringDomain()},ll.campaignParams())},$c=function(){function e(t,n,r){var i=this;a(this,e),l(this,"_onSessionIdCallback",(function(e){var t=i._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:i._sessionSourceParamGenerator()};i._persistence.register(l({},Rs,n))}})),this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||Hc,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return u(e,[{key:"_getStoredProps",value:function(){return this._persistence.props[Rs]}},{key:"getSessionProps",value:function(){var e,t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}]),e}(),Uc=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Wc=function(e,t){if(!e)return!1;var n=e.toLowerCase();return Uc.concat(t||[]).some((function(e){var t=e.toLowerCase();return-1!==n.indexOf(t)}))},Vc=function(){function e(){a(this,e),this.clicks=[]}return u(e,[{key:"isRageClick",value:function(e,t,n){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}();function Gc(e){var t;return e.id===Ds||!(null===(t=e.closest)||void 0===t||!t.call(e,"#"+Ds))}var jc=function(){function e(t){var n,r=this;a(this,e),l(this,"rageclicks",new Vc),l(this,"_enabledServerSide",!1),l(this,"_initialized",!1),l(this,"_flushInterval",null),this.instance=t,this._enabledServerSide=!(null===(n=this.instance.persistence)||void 0===n||!n.props[ds]),null==en||en.addEventListener("beforeunload",(function(){r.flush()}))}return u(e,[{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return Ut(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){return Vt(this.instance.config.capture_heatmaps)?Vt(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}},{key:"startIfEnabled",value:function(){if(this.isEnabled){if(this._initialized)return;vn.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this.getAndClearBuffer()}}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(l({},ds,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_setupListeners",value:function(){var e=this;en&&sn&&(Mn(sn,"click",(function(t){return e._onClick(t||(null==en?void 0:en.event))}),!1,!0),Mn(sn,"mousemove",(function(t){return e._onMouseMove(t||(null==en?void 0:en.event))}),!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),o=function(e,t,n){for(var r=e;r&&!Vn(r,"body");){if(r===n)return!1;if(kn(t,null==en?void 0:en.getComputedStyle(r).position))return!0;r=zn(r)}return!1}(e.target,["fixed","sticky"],i);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:n),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var n;if(!Gc(e.target)){var r=this._getProperties(e,"click");null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(t(t({},r),{},{type:"rageclick"})),this._capture(r)}}},{key:"_onMouseMove",value:function(e){var t=this;Gc(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((function(){t._capture(t._getProperties(e,"mousemove"))}),500))}},{key:"_capture",value:function(e){if(en){var t=en.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}},{key:"flush",value:function(){this.buffer&&!Wt(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}]),e}(),Zc=function(){function e(t){var n=this;a(this,e),l(this,"_updateScrollData",(function(){var e,t,r,i;n.context||(n.context={});var o=n.scrollElement(),a=n.scrollY(),s=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+((null==o?void 0:o.clientHeight)||0),l=(null==o?void 0:o.scrollHeight)||0;n.context.lastScrollY=Math.ceil(a),n.context.maxScrollY=Math.max(a,null!==(e=n.context.maxScrollY)&&void 0!==e?e:0),n.context.maxScrollHeight=Math.max(s,null!==(t=n.context.maxScrollHeight)&&void 0!==t?t:0),n.context.lastContentY=u,n.context.maxContentY=Math.max(u,null!==(r=n.context.maxContentY)&&void 0!==r?r:0),n.context.maxContentHeight=Math.max(l,null!==(i=n.context.maxContentHeight)&&void 0!==i?i:0)})),this.instance=t}return u(e,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){null==en||en.addEventListener("scroll",this._updateScrollData,!0),null==en||en.addEventListener("scrollend",this._updateScrollData,!0),null==en||en.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return null==en?void 0:en.document.documentElement;var e,t=v(Ht(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var n=e.value,r=null==en?void 0:en.document.querySelector(n);if(r)return r}}catch(e){t.e(e)}finally{t.f()}}},{key:"scrollY",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return en&&(en.scrollY||en.pageYOffset||en.document.documentElement.scrollTop)||0}},{key:"scrollX",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return en&&(en.scrollX||en.pageXOffset||en.document.documentElement.scrollLeft)||0}}]),e}(),zc="$copy_autocapture";function Qc(e,t){return t.length>e?t.slice(0,e)+"...":t}var Kc,Yc=function(){function e(t){a(this,e),l(this,"_initialized",!1),l(this,"_isDisabledServerSide",null),l(this,"rageclicks",new Vc),l(this,"_elementsChainAsString",!1),this.instance=t,this._elementSelectors=null}return u(e,[{key:"config",get:function(){var e,t,n=Ut(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=null===(e=n.url_allowlist)||void 0===e?void 0:e.map((function(e){return new RegExp(e)})),n.url_ignorelist=null===(t=n.url_ignorelist)||void 0===t?void 0:t.map((function(e){return new RegExp(e)})),n}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(en&&sn){var t=function(t){t=t||(null==en?void 0:en.event);try{e._captureEvent(t)}catch(e){vn.error("Failed to capture event",e)}},n=function(t){t=t||(null==en?void 0:en.event),e._captureEvent(t,zc)};Mn(sn,"submit",t,!1,!0),Mn(sn,"change",t,!1,!0),Mn(sn,"click",t,!1,!0),this.config.capture_copied_text&&(Mn(sn,"copy",n,!1,!0),Mn(sn,"cut",n,!1,!0))}}else vn.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(l({},cs,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"setElementSelectors",value:function(e){this._elementSelectors=e}},{key:"getElementSelectors",value:function(e){var t,n=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach((function(t){var r=null==sn?void 0:sn.querySelectorAll(t);null==r||r.forEach((function(r){e===r&&n.push(t)}))})),n}},{key:"isEnabled",get:function(){var e,t,n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[cs],r=this._isDisabledServerSide;if(Zt(r)&&!Kt(n)&&!this.instance.config.advanced_disable_decide)return!1;var i=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!i}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Wn(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!Kn(e))return{};var t={};return yn(e.attributes,(function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&ir(r)&&(t[n]=r)}})),t}},{key:"_getPropertiesFromElement",value:function(e,t,n){var r,i=e.tagName.toLowerCase(),o={tag_name:i};Zn.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=Qc(1024,or(e)):o.$el_text=Qc(1024,Un(e)));var a=Hn(e);a.length>0&&(o.classes=a.filter((function(e){return""!==e})));var s=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;yn(e.attributes,(function(n){var r;if((!Yn(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&((null==s||!s.includes(n.name))&&!t&&ir(n.value)&&(r=n.name,!Gt(r)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7)))){var i=n.value;"class"===n.name&&(i=qn(i).join(" ")),o["attr__"+n.name]=Qc(1024,i)}}));for(var u=1,l=1,c=e;c=this._previousElementSibling(c);)u++,c.tagName===e.tagName&&l++;return o.nth_child=u,o.nth_of_type=l,o}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){return Vt(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}},{key:"_captureEvent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var r,i=this._getEventTarget(e);if(Gn(i)&&(i=i.parentNode||null),"$autocapture"===n&&"click"===e.type&&e instanceof MouseEvent)this.instance.config.rageclick&&null!==(r=this.rageclicks)&&void 0!==r&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var o=n===zc;if(i&&Qn(i,e,this.config,o,o?["copy","cut"]:void 0)){for(var a,s,u=[i],l=i;l.parentNode&&!Vn(l,"body");)jn(l.parentNode)?(u.push(l.parentNode.host),l=l.parentNode.host):(u.push(l.parentNode),l=l.parentNode);var c,d,f=[],p={},h=!1;if(yn(u,(function(e){var n=Kn(e);"a"===e.tagName.toLowerCase()&&(c=e.getAttribute("href"),c=n&&ir(c)&&c),kn(Hn(e),"ph-no-capture")&&(h=!0),f.push(t._getPropertiesFromElement(e,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text));var r=t._getAugmentPropertiesFromElement(e);bn(p,r)})),this.instance.config.mask_all_text||("a"===i.tagName.toLowerCase()||"button"===i.tagName.toLowerCase()?f[0].$el_text=or(i):f[0].$el_text=Un(i)),c){var v,g;f[0].attr__href=c;var m=null===(v=On(c))||void 0===v?void 0:v.host,_=null==en||null===(g=en.location)||void 0===g?void 0:g.host;m&&_&&m!==_&&(d=c)}if(h)return!1;var y=bn(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:sr(f)}:{$elements:f},null!==(a=f[0])&&void 0!==a&&a.$el_text?{$el_text:null===(s=f[0])||void 0===s?void 0:s.$el_text}:{},d&&"click"===e.type?{$external_click_url:d}:{},p),b=this.getElementSelectors(i);if(b&&b.length>0&&(y.$element_selectors=b),n===zc){var k,w=$n(null==en||null===(k=en.getSelection())||void 0===k?void 0:k.toString()),C=e.type||"clipboard";if(!w)return!1;y.$selected_content=w,y.$copy_type=C}return this.instance.capture(n,y),!0}}}},{key:"isBrowserSupported",value:function(){return $t(null==sn?void 0:sn.querySelectorAll)}}]),e}(),Jc=function(){function e(t){var n=this;a(this,e),l(this,"_restoreXHRPatch",void 0),l(this,"_restoreFetchPatch",void 0),l(this,"_startCapturing",(function(){Vt(n._restoreXHRPatch)&&pn.postHogTracingHeadersPatchFns._patchXHR(n.instance.sessionManager),Vt(n._restoreFetchPatch)&&pn.postHogTracingHeadersPatchFns._patchFetch(n.instance.sessionManager)})),this.instance=t}return u(e,[{key:"_loadScript",value:function(e){pn.postHogTracingHeadersPatchFns&&e(),this.instance.requestRouter.loadScript("/static/tracing-headers.js?v=".concat(Xt.LIB_VERSION),(function(t){if(t)return vn.error("[TRACING-HEADERS] failed to load script",t);e()}))}},{key:"startIfEnabledOrStop",value:function(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}]),e}();!function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"}(Kc||(Kc={}));var Xc=function(){function e(t){a(this,e),this.instance=t}return u(e,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?Kc.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===Kc.DENIED||this.consent===Kc.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return"1"===e?Kc.GRANTED:"0"===e?Kc.DENIED:Kc.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?ou:ru;var t="localStorage"===e?ru:ou;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!Rn([null==an?void 0:an.doNotTrack,null==an?void 0:an.msDoNotTrack,pn.doNotTrack],(function(e){return kn([!0,1,"1","yes"],e)}))}}]),e}(),ed=9e5,td="[Web Vitals]",nd=function(){function e(n){var r,i=this;a(this,e),l(this,"_enabledServerSide",!1),l(this,"_initialized",!1),l(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),l(this,"_flushToCapture",(function(){clearTimeout(i._delayedFlushTimer),0!==i.buffer.metrics.length&&(i.instance.capture("$web_vitals",i.buffer.metrics.reduce((function(e,n){var r;return t(t({},e),{},(l(r={},"$web_vitals_".concat(n.name,"_event"),t({},n)),l(r,"$web_vitals_".concat(n.name,"_value"),n.value),r))}),{})),i.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})})),l(this,"_addToBuffer",(function(e){var n,r=null===(n=i.instance.sessionManager)||void 0===n?void 0:n.checkAndGetSessionAndWindowId(!0);if(Vt(r))vn.error(td+"Could not read session ID. Dropping metrics!");else{i.buffer=i.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=i._currentURL();if(!Vt(o))if(zt(null==e?void 0:e.name)||zt(null==e?void 0:e.value))vn.error(td+"Invalid metric received",e);else if(i._maxAllowedValue&&e.value>=i._maxAllowedValue)vn.error(td+"Ignoring metric with value >= "+i._maxAllowedValue,e);else i.buffer.url!==o&&(i._flushToCapture(),i._delayedFlushTimer=setTimeout(i._flushToCapture,8e3)),Vt(i.buffer.url)&&(i.buffer.url=o),i.buffer.firstMetricTimestamp=Vt(i.buffer.firstMetricTimestamp)?Date.now():i.buffer.firstMetricTimestamp,i.buffer.metrics.push(t(t({},e),{},{$current_url:o,$session_id:r.sessionId,$window_id:r.windowId,timestamp:Date.now()})),4===i.buffer.metrics.length&&i._flushToCapture()}})),l(this,"_startCapturing",(function(){var e=pn.postHogWebVitalsCallbacks,t=e.onLCP,n=e.onCLS,r=e.onFCP,o=e.onINP;t&&n&&r&&o?(t(i._addToBuffer),n(i._addToBuffer),r(i._addToBuffer),o(i._addToBuffer),i._initialized=!0):vn.error(td+"web vitals callbacks not loaded - not starting")})),this.instance=n,this._enabledServerSide=!(null===(r=this.instance.persistence)||void 0===r||!r.props[hs]),this.startIfEnabled()}return u(e,[{key:"_maxAllowedValue",get:function(){var e=Ut(this.instance.config.capture_performance)&&Qt(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:ed;return 0<e&&e<=6e4?ed:e}},{key:"isEnabled",get:function(){var e=Ut(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Kt(e)?e:this._enabledServerSide}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(vn.info(td+" enabled, starting..."),this.loadScript(this._startCapturing))}},{key:"afterDecideResponse",value:function(e){var t=Ut(e.capturePerformance)&&!!e.capturePerformance.web_vitals;this.instance.persistence&&this.instance.persistence.register(l({},hs,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"loadScript",value:function(e){en.postHogWebVitalsCallbacks&&e(),this.instance.requestRouter.loadScript("/static/web-vitals.js?v=".concat(Xt.LIB_VERSION),(function(t){t?vn.error(td+" failed to load script",t):e()}))}},{key:"_currentURL",value:function(){var e=en?en.location.href:void 0;return e||vn.error(td+"Could not determine current URL"),e}}]),e}(),rd={},id=function(){},od="posthog",ad=!dc&&-1===(null==fn?void 0:fn.indexOf("MSIE"))&&-1===(null==fn?void 0:fn.indexOf("Mozilla")),sd=function(){var e,t,n;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(t=null==sn?void 0:sn.location,n=null==t?void 0:t.hostname,!!Gt(n)&&"herokuapp.com"!==n.split(".").slice(-2).join(".")),persistence:"localStorage+cookie",persistence_name:"",loaded:id,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:un&&Gt(null==un?void 0:un.search)&&-1!==un.search.indexOf("__posthog_debug=true")||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==en||null===(e=en.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.text;vn.error(t)},get_device_id:function(e){return e},_onCapture:id,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},ud=function(e){var t={};Vt(e.process_person)||(t.person_profiles=e.process_person),Vt(e.xhr_headers)||(t.request_headers=e.xhr_headers),Vt(e.cookie_name)||(t.persistence_name=e.cookie_name),Vt(e.disable_cookie)||(t.disable_persistence=e.disable_cookie);var n=bn({},t,e);return Ht(e.property_blacklist)&&(Vt(e.property_denylist)?n.property_denylist=e.property_blacklist:Ht(e.property_denylist)?n.property_denylist=[].concat(f(e.property_blacklist),f(e.property_denylist)):vn.error("Invalid value for property_denylist config: "+e.property_denylist)),n},ld=function(){function e(){a(this,e),l(this,"__forceAllowLocalhost",!1)}return u(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){vn.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),cd=function(){function e(){var t=this;a(this,e),l(this,"webPerformance",new ld),l(this,"version",Xt.LIB_VERSION),l(this,"_internalEventEmitter",new Oc),this.config=sd(),this.decideEndpointWasHit=!1,this.SentryIntegration=Ac,this.sentryIntegration=function(e){return function(e,t){var n=Tc(e,t);return{name:Ec,processEvent:function(e){return n(e)}}}(t,e)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new Ws(this),this.toolbar=new Tl(this),this.scrollManager=new Zc(this),this.pageViewManager=new Rc(this),this.surveys=new qc(this),this.rateLimiter=new Bc(this),this.requestRouter=new Cc(this),this.consent=new Xc(this),this.people={set:function(e,n,r){var i=Gt(e)?l({},e,n):e;t.setPersonProperties(i),null==r||r({})},set_once:function(e,n,r){var i=Gt(e)?l({},e,n):e;t.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",(function(e){return vn.info("send",e)}))}return u(e,[{key:"init",value:function(t,n,r){if(r&&r!==od){var i,o=null!==(i=rd[r])&&void 0!==i?i:new e;return o._init(t,n,r),rd[r]=o,rd[od][r]=o,o}return this._init(t,n,r)}},{key:"_init",value:function(e){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0;if(Vt(e)||jt(e))return vn.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 vn.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(bn({},sd(),ud(o),{name:a,token:e})),this.config.on_xhr_error&&vn.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=o.disable_compression?void 0:ca.GZipJS,this.persistence=new dl(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new dl(t(t({},this.config),{},{persistence:"sessionStorage"}));var s=t({},this.persistence.props),u=t({},this.sessionPersistence.props);if(this._requestQueue=new Al((function(e){return i._send_retriable_request(e)})),this._retryQueue=new yc(this),this.__request_queue=[],this.sessionManager=new kc(this.config,this.persistence),this.sessionPropsManager=new $c(this.sessionManager,this.persistence),new Jc(this).startIfEnabledOrStop(),this.sessionRecording=new Il(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Yc(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new jc(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new nd(this),this.exceptionObserver=new xc(this),this.exceptionObserver.startIfEnabled(),Xt.DEBUG=Xt.DEBUG||this.config.debug,Xt.DEBUG&&vn.info("Starting in debug mode",{this:this,config:o,thisC:t({},this.config),p:s,s:u}),this._sync_opt_out_with_persistence(),void 0!==(null===(n=o.bootstrap)||void 0===n?void 0:n.distinctID)){var l,c,d=this.config.get_device_id(Ks()),f=null!==(l=o.bootstrap)&&void 0!==l&&l.isIdentifiedID?d:o.bootstrap.distinctID;this.persistence.set_property(Ms,null!==(c=o.bootstrap)&&void 0!==c&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:f})}if(this._hasBootstrappedFeatureFlags()){var p,h,v=Object.keys((null===(p=o.bootstrap)||void 0===p?void 0:p.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,r;return e[t]=(null===(n=o.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),g=Object.keys((null===(h=o.bootstrap)||void 0===h?void 0:h.featureFlagPayloads)||{}).filter((function(e){return v[e]})).reduce((function(e,t){var n,r,i,a;null!==(n=o.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=o.bootstrap)||void 0===i||null===(a=i.featureFlagPayloads)||void 0===a?void 0:a[t]);return e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:g})}if(!this.get_distinct_id()){var m=this.config.get_device_id(Ks());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(Ms,"anonymous")}return null==en||null===(r=en.addEventListener)||void 0===r||r.call(en,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),o.segment?Mc(this,(function(){return i._loaded()})):this._loaded(),$t(this.config._onCapture)&&this.on("eventCaptured",(function(e){return i.config._onCapture(e.event,e)})),this}},{key:"_afterDecideResponse",value:function(e){var t,n,r,i,o,a,s;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=kn(e.supportedCompression,ca.GZipJS)?ca.GZipJS:kn(e.supportedCompression,ca.Base64)?ca.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),null===(n=this.sessionRecording)||void 0===n||n.afterDecideResponse(e),null===(r=this.autocapture)||void 0===r||r.afterDecideResponse(e),null===(i=this.heatmaps)||void 0===i||i.afterDecideResponse(e),null===(o=this.surveys)||void 0===o||o.afterDecideResponse(e),null===(a=this.webVitalsAutocapture)||void 0===a||a.afterDecideResponse(e),null===(s=this.exceptionObserver)||void 0===s||s.afterDecideResponse(e)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){vn.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((function(){sn&&e.capture("$pageview",{title:sn.title},{send_instantly:!0})}),1),t||(new Sl(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||_n(this.__request_queue,(function(t){return e._send_retriable_request(t)})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var n=this;this.__loaded&&(ad?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=pc(e.url,{ip:this.config.ip?1:0}),e.headers=t({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,function(e){var n,r,i,o=t({},e);o.timeout=o.timeout||6e4,o.url=pc(o.url,{_:(new Date).getTime().toString(),ver:Xt.LIB_VERSION,compression:o.compression});var a=null!==(n=o.transport)&&void 0!==n?n:"XHR",s=null!==(r=null===(i=Rn(gc,(function(e){return e.transport===a})))||void 0===i?void 0:i.method)&&void 0!==r?r:gc[0].method;if(!s)throw new Error("No available transport method");s(o)}(t(t({},e),{},{callback:function(t){var r,i,o;(n.rateLimiter.checkForLimiting(t),t.statusCode>=400)&&(null===(i=(o=n.config).on_request_error)||void 0===i||i.call(o,t));null===(r=e.callback)||void 0===r||r.call(e,t)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];_n(e,(function(e){e&&(t=e[0],Ht(t)?o.push(e):$t(e)?e.call(n):Ht(e)&&"alias"===t?r.push(e):Ht(e)&&-1!==t.indexOf("capture")&&$t(n[t])?o.push(e):i.push(e))}));var a=function(e,t){_n(e,(function(e){if(Ht(e[0])){var n=t;yn(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};a(r,this),a(i,this),a(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!Vt(e)&&Gt(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,s=(null==r?void 0:r.timestamp)||a,u={uuid:Ks(),event:e,properties:this._calculate_event_properties(e,n||{},s)};o&&(u.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==r?void 0:r.$set)&&(u.$set=null==r?void 0:r.$set);var l=this._calculate_set_once_properties(null==r?void 0:r.$set_once);l&&(u.$set_once=l),(u=Tn(u,null!=r&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=s,Vt(null==r?void 0:r.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=a);var c=t(t({},u.properties.$set),u.$set);Wt(c)||this.setPersonPropertiesForFlags(c),this._internalEventEmitter.emit("eventCaptured",u);var d={method:"POST",url:null!==(i=null==r?void 0:r._url)&&void 0!==i?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:null==r?void 0:r._batchKey};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this._send_retriable_request(d):this._requestQueue.enqueue(d),u}vn.critical("This capture call is ignored due to client rate limiting.")}}else vn.error("No event name provided to posthog.capture")}else vn.uninitializedWarning("posthog.capture")}},{key:"_addCaptureHook",value:function(e){this.on("eventCaptured",(function(t){return e(t.event,t)}))}},{key:"_calculate_event_properties",value:function(e,n,r){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var i=this.persistence.remove_event_timer(e),o=t({},n);if(o.token=this.config.token,"$snapshot"===e){var a=t(t({},this.persistence.properties()),this.sessionPersistence.properties());return o.distinct_id=a.distinct_id,(!Gt(o.distinct_id)&&!Qt(o.distinct_id)||jt(o.distinct_id))&&vn.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var s=ll.properties();if(this.sessionManager){var u=this.sessionManager.checkAndGetSessionAndWindowId(),l=u.sessionId,c=u.windowId;o.$session_id=l,o.$window_id=c}if(this.requestRouter.region===_c.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var d=this.sessionPropsManager.getSessionProps();o=bn(o,d)}if(!this.config.disable_scroll_properties){var f={};"$pageview"===e?f=this.pageViewManager.doPageView(r):"$pageleave"===e&&(f=this.pageViewManager.doPageLeave(r)),o=bn(o,f)}if("$pageview"===e&&sn&&(o.title=sn.title),!Vt(i)){var p=r.getTime()-i;o.$duration=parseFloat((p/1e3).toFixed(3))}fn&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=bn({},s,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),Ht(this.config.property_denylist)?yn(this.config.property_denylist,(function(e){delete o[e]})):vn.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var h=this.config.sanitize_properties;return h&&(o=h(o,e)),o.$process_person_profile=this._hasPersonProcessing(),o}},{key:"_calculate_set_once_properties",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=bn({},this.persistence.get_initial_props(),e||{});return Wt(t)?void 0:t}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(l({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"on",value:function(e,t){return this._internalEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"renderSurvey",value:function(e,t){this.surveys.renderSurvey(e,t)}},{key:"canRenderSurvey",value:function(e){this.surveys.canRenderSurvey(e)}},{key:"getNextSurveyStep",value:function(e,t,n){return this.surveys.getNextSurveyStep(e,t,n)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return vn.uninitializedWarning("posthog.identify");if(Qt(e)&&(e=e.toString(),vn.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))vn.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(us)&&(this.unregister(us),this.register({distinct_id:e}));var o="anonymous"===(this.persistence.get_property(Ms)||"anonymous");e!==r&&o?(this.persistence.set_property(Ms,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(As))}}else vn.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,n,r){if(e&&n){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:t(t({},i),{},l({},e,n))}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags(l({},e,r))),i[e]===n||r||this.reloadFeatureFlags()}}else vn.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){var t,n,r,i;if(vn.info("reset"),!this.__loaded)return vn.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.persistence)||void 0===r||r.set_property(Ms,"anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId();var a=this.config.get_device_id(Ks());this.register_once({distinct_id:a,$device_id:e?a:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(n));if(null!=e&&e.withTimestamp&&r){var o,a=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!r)return i;var s=Math.max(Math.floor(((new Date).getTime()-r)/1e3)-a,0);i+="?t=".concat(s)}return i}},{key:"alias",value:function(e,t){return e===this.get_property(ss)?(vn.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Vt(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(us,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(vn.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var n,r,i,o,a=t({},this.config);Ut(e)&&(bn(this.config,ud(e)),null===(n=this.persistence)||void 0===n||n.update_config(this.config,a),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new dl(t(t({},this.config),{},{persistence:"sessionStorage"})),ou.is_supported()&&"true"===ou.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(Xt.DEBUG=!0,vn.info("set_config",{config:e,oldConfig:a,newConfig:t({},this.config)})),null===(r=this.sessionRecording)||void 0===r||r.startIfEnabledOrStop(),null===(i=this.autocapture)||void 0===i||i.startIfEnabled(),null===(o=this.heatmaps)||void 0===o||o.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){var t,n=Kt(e)&&e;if(n||null!=e&&e.sampling){var r,i,o=null===(r=this.sessionManager)||void 0===r?void 0:r.checkAndGetSessionAndWindowId();null===(i=this.persistence)||void 0===i||i.register(l({},ws,!0)),vn.info("Session recording started with sampling override for session: ",null==o?void 0:o.sessionId)}(n||null!=e&&e.linked_flag)&&(null===(t=this.sessionRecording)||void 0===t||t.overrideLinkedFlag(),vn.info("Session recording started with linked_flags override"));this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:od;return t!==od&&(t=od+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(Ms))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(Ms))}},{key:"_hasPersonProcessing",value:function(){var e,t,n,r;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&Wt(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[us])&&(null===(n=this.persistence)||void 0===n||null===(r=n.props)||void 0===r||!r[Ps]))}},{key:"_shouldCapturePageleave",value:function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return"never"===this.config.person_profiles?(vn.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(Ps,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,n,r,i=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,a=this.config.disable_persistence||i&&!!o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==a&&(null===(n=this.persistence)||void 0===n||n.set_disabled(a));(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==a&&(null===(r=this.sessionPersistence)||void 0===r||r.set_disabled(a))}},{key:"opt_in_capturing",value:function(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(Vt(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0})}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"_is_bot",value:function(){return an?function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&Wc(n,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some((function(e){return Wc(null==e?void 0:e.brand,t)})))return!0}catch(e){}return!!e.webdriver}(an,this.config.custom_blocked_useragents):void 0}},{key:"debug",value:function(e){!1===e?(null==en||en.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==en||en.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Sn(e.prototype[t[n]])}(cd,["identify"]);var dd,fd;dd=rd[od]=new cd,(fd=pn.posthog)&&yn(fd._i,(function(e){if(e&&Ht(e)){var t=dd.init(e[0],e[1],e[2]),n=fd[e[2]]||fd;t&&(t._execute_array.call(t.people,n.people),t._execute_array(n))}})),pn.posthog=dd,function(){function e(){e.done||(e.done=!0,ad=!1,yn(rd,(function(e){e._dom_loaded()})))}null!=sn&&sn.addEventListener&&("complete"===sn.readyState?e():sn.addEventListener("DOMContentLoaded",e,!1)),en&&Mn(en,"load",e,!0)}()}();
|
|
17
17
|
//# sourceMappingURL=array.full.js.map
|