posthog-js 1.166.0 → 1.166.1
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/all-external-dependencies.js +2 -2
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.js +2 -2
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +2 -2
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.js +2 -2
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.js +2 -2
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/recorder-v2.js +1 -1
- package/dist/recorder-v2.js.map +1 -1
- package/dist/recorder.js +2 -2
- package/dist/recorder.js.map +1 -1
- package/lib/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(){n=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),a=new w(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return x()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d={};function p(){}function f(){}function h(){}var g={};c(g,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(k([])));m&&m!==t&&r.call(m,i)&&(g=m);var y=h.prototype=p.prototype=Object.create(g);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,i,a,s){var c=l(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function _(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function k(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return f.prototype=h,c(y,"constructor",h),c(h,"constructor",f),f.displayName=c(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,c(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(C.prototype),c(C.prototype,a,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new C(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),c(y,s,"Generator"),c(y,i,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=k,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,c,"next",e)}function c(e){o(a,r,i,s,c,"throw",e)}s(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=p(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}var g,v="2.0.0-alpha.13";function m(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function y(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function b(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(C).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function C(e){var t,n,r;if(function(e){return"styleSheet"in e}(e))try{t=b(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return n=e.cssText,r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n.replace(r,"$1\\$2");return t||e.cssText}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(g||(g={}));var _=function(){function e(){a(this,e),this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return c(e,[{key:"getId",value:function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}},{key:"getNode",value:function(e){return this.idNodeMap.get(e)||null}},{key:"getIds",value:function(){return Array.from(this.idNodeMap.keys())}},{key:"getMeta",value:function(e){return this.nodeMetaMap.get(e)||null}},{key:"removeNodeFromMap",value:function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))}},{key:"has",value:function(e){return this.idNodeMap.has(e)}},{key:"hasNode",value:function(e){return this.nodeMetaMap.has(e)}},{key:"add",value:function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}},{key:"replace",value:function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}},{key:"reset",value:function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}]),e}();function I(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,o=e.type,i=e.value,a=e.maskInputFn,s=i||"",c=o&&S(o);return(n[r.toLowerCase()]||c&&n[c])&&(s=a?a(s,t):"*".repeat(s.length)),s}function S(e){return e.toLowerCase()}var w="__rrweb_original__";function k(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?S(t):null}function x(e,t){var n,r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==o?void 0:o[1])&&void 0!==n?n:null}var A,T,M=1,E=new RegExp("[^a-z0-9-_:]"),N=-2;function O(){return M++}var L=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,R=/^(?:[a-z+]+:)?\/\//i,F=/^www\..*/i,D=/^(data:)([^,]*),(.*)/i;function q(e,t){return(e||"").replace(L,(function(e,n,r,o,i,a){var s,c=r||i||a,u=n||o||"";if(!c)return e;if(R.test(c)||F.test(c))return"url(".concat(u).concat(c).concat(u,")");if(D.test(c))return"url(".concat(u).concat(c).concat(u,")");if("/"===c[0])return"url(".concat(u).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(u,")");var l=t.split("/"),d=c.split("/");l.pop();var p,f=h(d);try{for(f.s();!(p=f.n()).done;){var g=p.value;"."!==g&&(".."===g?l.pop():l.push(g))}}catch(e){f.e(e)}finally{f.f()}return"url(".concat(u).concat(l.join("/")).concat(u,")")}))}var P=/^[^ \t\n\r\u000c]+/,H=/^[, \t\n\r\u000c]+/;function B(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function Z(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function W(){var e=document.createElement("a");return e.href="",e.href}function V(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?B(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(H),!(n>=t.length);){var i=r(P);if(","===i.slice(-1))i=B(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=B(e,i);for(var s=!1;;){var c=t.charAt(n);if(""===c){o.push((i+a).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){n+=1,o.push((i+a).trim());break}"("===c&&(s=!0)}a+=c,n+=1}}}return o.join(", ")}(e,r):"style"===n?q(r,W()):"object"===t&&"data"===n?B(e,r):r:B(e,r):r}function U(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function j(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&j(e.parentNode,t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&j(e.parentNode,t,n)}function G(e,t,n,r){try{var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(r){if(o.closest(".".concat(t)))return!0}else if(o.classList.contains(t))return!0}else if(j(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(e){}return!1}function K(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.needsMask,s=t.inlineStylesheet,c=t.maskInputOptions,u=void 0===c?{}:c,l=t.maskTextFn,d=t.maskInputFn,p=t.dataURLOptions,f=void 0===p?{}:p,h=t.inlineImages,v=t.recordCanvas,m=t.keepIframeSrcFn,y=t.newlyAddedElement,C=void 0!==y&&y,_=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:g.Document,childNodes:[],compatMode:e.compatMode}:{type:g.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:g.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return function(e,t){for(var n,r=t.doc,o=t.blockClass,i=t.blockSelector,a=t.inlineStylesheet,s=t.maskInputOptions,c=void 0===s?{}:s,u=t.maskInputFn,l=t.dataURLOptions,d=void 0===l?{}:l,p=t.inlineImages,f=t.recordCanvas,h=t.keepIframeSrcFn,v=t.newlyAddedElement,m=void 0!==v&&v,y=t.rootId,C=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,o,i),_=function(e){if(e instanceof HTMLFormElement)return"form";var t=S(e.tagName);return E.test(t)?"div":t}(e),x={},M=e.attributes.length,N=0;N<M;N++){var O=e.attributes[N];U(_,O.name,O.value)||(x[O.name]=V(r,_,S(O.name),O.value))}if("link"===_&&a){var L=e.href,R=Array.from(r.styleSheets).find((function(e){return e.href===L}));if(!R&&L.includes(".css")){var F=window.location.origin+"/"+L.replace(window.location.href,"");R=Array.from(r.styleSheets).find((function(e){return e.href===F}))}var D=null;R&&(D=b(R)),D&&(delete x.rel,delete x.href,x._cssText=q(D,R.href))}if("style"===_&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var P=b(e.sheet);P&&(x._cssText=q(P,W()))}if("input"===_||"textarea"===_||"select"===_){var H=e.value,B=e.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&H?x.value=I({element:e,type:k(e),tagName:_,value:H,maskInputOptions:c,maskInputFn:u}):B&&(x.checked=B)}"option"===_&&(e.selected&&!c.select?x.selected=!0:delete x.selected);if("canvas"===_&&f)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,i=w in o?o[w]:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(x.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var j=e.toDataURL(d.type,d.quality),G=document.createElement("canvas");G.width=e.width,G.height=e.height,j!==G.toDataURL(d.type,d.quality)&&(x.rr_dataURL=j)}if("img"===_&&p){A||(A=r.createElement("canvas"),T=A.getContext("2d"));var K=e,Q=K.crossOrigin;K.crossOrigin="anonymous";var z=function e(){K.removeEventListener("load",e);try{A.width=K.naturalWidth,A.height=K.naturalHeight,T.drawImage(K,0,0),x.rr_dataURL=A.toDataURL(d.type,d.quality)}catch(e){console.warn("Cannot inline img src=".concat(K.currentSrc,"! Error: ").concat(e))}Q?x.crossOrigin=Q:K.removeAttribute("crossorigin")};K.complete&&0!==K.naturalWidth?z():K.addEventListener("load",z)}if("audio"===_||"video"===_){var Y=x;Y.rr_mediaState=e.paused?"paused":"played",Y.rr_mediaCurrentTime=e.currentTime,Y.rr_mediaPlaybackRate=e.playbackRate,Y.rr_mediaMuted=e.muted,Y.rr_mediaLoop=e.loop,Y.rr_mediaVolume=e.volume}m||(e.scrollLeft&&(x.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(x.rr_scrollTop=e.scrollTop));if(C){var J=e.getBoundingClientRect(),X=J.width,$=J.height;x={class:x.class,rr_width:"".concat(X,"px"),rr_height:"".concat($,"px")}}"iframe"!==_||h(x.src)||(e.contentDocument||(x.rr_src=x.src),delete x.src);try{customElements.get(_)&&(n=!0)}catch(e){}return{type:g.Element,tagName:_,attributes:x,childNodes:[],isSVG:Z(e)||void 0,needBlock:C,rootId:y,isCustom:n}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:s,maskInputOptions:u,maskInputFn:d,dataURLOptions:f,inlineImages:h,recordCanvas:v,keepIframeSrcFn:m,newlyAddedElement:C,rootId:_});case e.TEXT_NODE:return function(e,t){var n,r=t.needsMask,o=t.maskTextFn,i=t.rootId,a=e.parentNode&&e.parentNode.tagName,s=e.textContent,c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(c&&s){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(s=b(e.parentNode.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}s=q(s,W())}u&&(s="SCRIPT_PLACEHOLDER");!c&&!u&&s&&r&&(s=o?o(s,e.parentElement):s.replace(/[\S]/g,"*"));return{type:g.Text,textContent:s||"",isStyle:c,rootId:i}}(e,{needsMask:a,maskTextFn:l,rootId:_});case e.CDATA_SECTION_NODE:return{type:g.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:g.Comment,textContent:e.textContent||"",rootId:_};default:return!1}}function Q(e){return null==e?"":e.toLowerCase()}function z(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,c=t.skipChild,u=void 0!==c&&c,l=t.inlineStylesheet,d=void 0===l||l,p=t.maskInputOptions,f=void 0===p?{}:p,h=t.maskTextFn,v=t.maskInputFn,b=t.slimDOMOptions,C=t.dataURLOptions,_=void 0===C?{}:C,I=t.inlineImages,S=void 0!==I&&I,w=t.recordCanvas,k=void 0!==w&&w,A=t.onSerialize,T=t.onIframeLoad,M=t.iframeLoadTimeout,E=void 0===M?5e3:M,L=t.onStylesheetLoad,R=t.stylesheetLoadTimeout,F=void 0===R?5e3:R,D=t.keepIframeSrcFn,q=void 0===D?function(){return!1}:D,P=t.newlyAddedElement,H=void 0!==P&&P,B=t.needsMask,Z=t.preserveWhiteSpace,W=void 0===Z||Z;!B&&e.childNodes&&(B=G(e,a,s,void 0===B));var V,U=K(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:B,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:v,dataURLOptions:_,inlineImages:S,recordCanvas:k,keepIframeSrcFn:q,newlyAddedElement:H});if(!U)return console.warn(e,"not serialized"),null;V=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===g.Comment)return!0;if(e.type===g.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===x(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Q(e.attributes.name)||"icon"===Q(e.attributes.rel)||"apple-touch-icon"===Q(e.attributes.rel)||"shortcut icon"===Q(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Q(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Q(e.attributes.property).match(/^(og|twitter|fb):/)||Q(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Q(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Q(e.attributes.name)||"googlebot"===Q(e.attributes.name)||"bingbot"===Q(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Q(e.attributes.name)||"generator"===Q(e.attributes.name)||"framework"===Q(e.attributes.name)||"publisher"===Q(e.attributes.name)||"progid"===Q(e.attributes.name)||Q(e.attributes.property).match(/^article:/)||Q(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Q(e.attributes.name)||"yandex-verification"===Q(e.attributes.name)||"csrf-token"===Q(e.attributes.name)||"p:domain_verify"===Q(e.attributes.name)||"verify-v1"===Q(e.attributes.name)||"verification"===Q(e.attributes.name)||"shopify-checkout-api-token"===Q(e.attributes.name)))return!0}}return!1}(U,b)&&(W||U.type!==g.Text||U.isStyle||U.textContent.replace(/^\s+|\s+$/gm,"").length)?O():N;var j=Object.assign(U,{id:V});if(r.add(e,j),V===N)return null;A&&A(e);var Y=!u;if(j.type===g.Element){Y=Y&&!j.needBlock,delete j.needBlock;var J=e.shadowRoot;J&&y(J)&&(j.isShadowHost=!0)}if((j.type===g.Document||j.type===g.Element)&&Y){b.headWhitespace&&j.type===g.Element&&"head"===j.tagName&&(W=!1);var X={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:B,maskTextClass:a,maskTextSelector:s,skipChild:u,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:v,slimDOMOptions:b,dataURLOptions:_,inlineImages:S,recordCanvas:k,preserveWhiteSpace:W,onSerialize:A,onIframeLoad:T,iframeLoadTimeout:E,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:q};if(j.type===g.Element&&"textarea"===j.tagName&&void 0!==j.attributes.value);else for(var $=0,ee=Array.from(e.childNodes);$<ee.length;$++){var te=z(ee[$],X);te&&j.childNodes.push(te)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var ne=0,re=Array.from(e.shadowRoot.childNodes);ne<re.length;ne++){var oe=z(re[ne],X);oe&&(y(e.shadowRoot)&&(oe.isShadow=!0),j.childNodes.push(oe))}}return e.parentNode&&m(e.parentNode)&&y(e.parentNode)&&(j.isShadow=!0),j.type===g.Element&&"iframe"===j.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){i||(t(),i=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&T){var n=z(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:B,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:v,slimDOMOptions:b,dataURLOptions:_,inlineImages:S,recordCanvas:k,preserveWhiteSpace:W,onSerialize:A,onIframeLoad:T,iframeLoadTimeout:E,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:q});n&&T(e,n)}}),E),j.type===g.Element&&"link"===j.tagName&&"string"==typeof j.attributes.rel&&("stylesheet"===j.attributes.rel||"preload"===j.attributes.rel&&"string"==typeof j.attributes.href&&"css"===x(j.attributes.href))&&function(e,t,n){var r,o=!1;try{r=e.sheet}catch(e){return}if(!r){var i=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(i),o=!0,t()}))}}(e,(function(){if(L){var t=z(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:B,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:v,slimDOMOptions:b,dataURLOptions:_,inlineImages:S,recordCanvas:k,preserveWhiteSpace:W,onSerialize:A,onIframeLoad:T,iframeLoadTimeout:E,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:q});t&&L(e,t)}}),F),j}function Y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var J="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",X={map:{},getId:function(){return console.error(J),-1},getNode:function(){return console.error(J),null},removeNodeFromMap:function(){console.error(J)},has:function(){return console.error(J),!1},reset:function(){console.error(J)}};function $(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var c=Date.now();o||!1!==n.leading||(o=c);var u=t-(c-o),l=this;u<=0||u>t?(r&&(clearTimeout(r),r=null),o=c,e.apply(l,a)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(l,a)}),u))}}function ee(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),i&&i.set&&i.set.call(this,e)}}),function(){return ee(e,t,i||{},!0)}}function te(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(X=new Proxy(X,{get:function(e,t,n){return"map"===t&&console.error(J),Reflect.get(e,t,n)}}));var ne=Date.now;function re(e){var t,n,r,o,i,a,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==s?void 0:s.documentElement.scrollLeft)||(null===(n=null===(t=null==s?void 0:s.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==s?void 0:s.body)||void 0===r?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null===(i=null===(o=null==s?void 0:s.body)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.scrollTop)||(null===(a=null==s?void 0:s.body)||void 0===a?void 0:a.scrollTop)||0}}function oe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ae(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function se(e,t,n,r){if(!e)return!1;var o=ae(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(j(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function ce(e,t){return t.getId(e)===N}function ue(e,t){if(m(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ue(e.parentNode,t))}function le(e){return Boolean(e.changedTouches)}function de(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function pe(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function fe(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(ne=function(){return(new Date).getTime()});var he=function(){function e(){a(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return c(e,[{key:"getId",value:function(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),e}();function ge(e){var t,n,r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function ve(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=ge(n);)n=t;return n}(e);return t.contains(n)}function me(e){var t=e.ownerDocument;return!!t&&(t.contains(e)||ve(e))}var ye=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}(ye||{}),be=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}(be||{}),Ce=function(e){return e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e}(Ce||{}),_e=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(_e||{}),Ie=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(Ie||{});function Se(e){return"__ln"in e}var we,ke=function(){function e(){a(this,e),this.length=0,this.head=null,this.tail=null}return c(e,[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Se(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Se(e.nextSibling)&&e.nextSibling.__ln.previous){var r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}]),e}(),xe=function(e,t){return"".concat(e,"@").concat(t)},Ae=function(){function e(){var t=this;a(this,e),this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(e){e.forEach(t.processMutation),t.emit()},this.emit=function(){if(!t.frozen&&!t.locked){for(var e=[],n=new Set,r=new ke,o=function(e){for(var n=e,r=N;r===N;)r=(n=n&&n.nextSibling)&&t.mirror.getId(n);return r},i=function(i){if(i.parentNode&&me(i)&&"TEXTAREA"!==i.parentNode.tagName){var a=m(i.parentNode)?t.mirror.getId(ge(i)):t.mirror.getId(i.parentNode),s=o(i);if(-1===a||-1===s)return r.addNode(i);var c=z(i,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(e){de(e,t.mirror)&&t.iframeManager.addIframe(e),pe(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),fe(i)&&t.shadowDomManager.addShadowRoot(i.shadowRoot,t.doc)},onIframeLoad:function(e,n){t.iframeManager.attachIframe(e,n),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,n){t.stylesheetManager.attachLinkElement(e,n)}});c&&(e.push({parentId:a,nextId:s,node:c}),n.add(c.id))}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());var a,s=h(t.movedSet);try{for(s.s();!(a=s.n()).done;){var c=a.value;Me(t.removes,c,t.mirror)&&!t.movedSet.has(c.parentNode)||i(c)}}catch(e){s.e(e)}finally{s.f()}var u,l=h(t.addedSet);try{for(l.s();!(u=l.n()).done;){var d=u.value;Ne(t.droppedSet,d)||Me(t.removes,d,t.mirror)?Ne(t.movedSet,d)?i(d):t.droppedSet.add(d):i(d)}}catch(e){l.e(e)}finally{l.f()}for(var p=null;r.length;){var f=null;if(p){var g=t.mirror.getId(p.value.parentNode),v=o(p.value);-1!==g&&-1!==v&&(f=p)}if(!f)for(var y=r.tail;y;){var b=y;if(y=y.previous,b){var C=t.mirror.getId(b.value.parentNode);if(-1===o(b.value))continue;if(-1!==C){f=b;break}var _=b.value;if(_.parentNode&&_.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var I=_.parentNode.host;if(-1!==t.mirror.getId(I)){f=b;break}}}}if(!f){for(;r.head;)r.removeNode(r.head.value);break}p=f.previous,r.removeNode(f.value),i(f.value)}var S={texts:t.texts.map((function(e){var n=e.node;return n.parentNode&&"TEXTAREA"===n.parentNode.tagName&&t.genTextAreaValueMutation(n.parentNode),{id:t.mirror.getId(n),value:e.value}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){var n=e.attributes;if("string"==typeof n.style){var r=JSON.stringify(e.styleDiff),o=JSON.stringify(e._unchangedStyles);r.length<n.style.length&&(r+o).split("var(").length===n.style.split("var(").length&&(n.style=e.styleDiff)}return{id:t.mirror.getId(e.node),attributes:n}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(S.texts.length||S.attributes.length||S.removes.length||S.adds.length)&&(t.texts=[],t.attributes=[],t.attributeMap=new WeakMap,t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(S))}},this.genTextAreaValueMutation=function(e){var n=t.attributeMap.get(e);n||(n={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(n),t.attributeMap.set(e,n)),n.attributes.value=Array.from(e.childNodes,(function(e){return e.textContent||""})).join("")},this.processMutation=function(e){if(!ce(e.target,t.mirror))switch(e.type){case"characterData":var n=e.target.textContent;se(e.target,t.blockClass,t.blockSelector,!1)||n===e.oldValue||t.texts.push({value:G(e.target,t.maskTextClass,t.maskTextSelector,!0)&&n?t.maskTextFn?t.maskTextFn(n,ae(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break;case"attributes":var r=e.target,o=e.attributeName,i=e.target.getAttribute(o);if("value"===o){var a=k(r);i=I({element:r,maskInputOptions:t.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:t.maskInputFn})}if(se(e.target,t.blockClass,t.blockSelector,!1)||i===e.oldValue)return;var s=t.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===o&&!t.keepIframeSrcFn(i)){if(r.contentDocument)return;o="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(s),t.attributeMap.set(e.target,s)),"type"===o&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!U(r.tagName,o)&&(s.attributes[o]=V(t.doc,S(r.tagName),S(o),i),"style"===o)){if(!t.unattachedDoc)try{t.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){t.unattachedDoc=t.doc}var c=t.unattachedDoc.createElement("span");e.oldValue&&c.setAttribute("style",e.oldValue);for(var u=0,l=Array.from(r.style);u<l.length;u++){var d=l[u],p=r.style.getPropertyValue(d),f=r.style.getPropertyPriority(d);p!==c.style.getPropertyValue(d)||f!==c.style.getPropertyPriority(d)?s.styleDiff[d]=""===f?p:[p,f]:s._unchangedStyles[d]=[p,f]}for(var h=0,g=Array.from(c.style);h<g.length;h++){var v=g[h];""===r.style.getPropertyValue(v)&&(s.styleDiff[v]=!1)}}break;case"childList":if(se(e.target,t.blockClass,t.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void t.genTextAreaValueMutation(e.target);e.addedNodes.forEach((function(n){return t.genAdds(n,e.target)})),e.removedNodes.forEach((function(n){var r=t.mirror.getId(n),o=m(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);se(e.target,t.blockClass,t.blockSelector,!1)||ce(n,t.mirror)||!function(e,t){return-1!==t.getId(e)}(n,t.mirror)||(t.addedSet.has(n)?(Te(t.addedSet,n),t.droppedSet.add(n)):t.addedSet.has(e.target)&&-1===r||ue(e.target,t.mirror)||(t.movedSet.has(n)&&t.movedMap[xe(r,o)]?Te(t.movedSet,n):t.removes.push({parentId:o,id:r,isShadow:!(!m(e.target)||!y(e.target))||void 0})),t.mapRemoves.push(n))}))}},this.genAdds=function(e,n){if(!t.processedNodeManager.inOtherBuffer(e,t)&&!t.addedSet.has(e)&&!t.movedSet.has(e)){if(t.mirror.hasNode(e)){if(ce(e,t.mirror))return;t.movedSet.add(e);var r=null;n&&t.mirror.hasNode(n)&&(r=t.mirror.getId(n)),r&&-1!==r&&(t.movedMap[xe(t.mirror.getId(e),r)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);se(e,t.blockClass,t.blockSelector,!1)||(e.childNodes.forEach((function(e){return t.genAdds(e)})),fe(e)&&e.shadowRoot.childNodes.forEach((function(n){t.processedNodeManager.add(n,t),t.genAdds(n,e)})))}}}return c(e,[{key:"init",value:function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((function(n){t[n]=e[n]}))}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]),e}();function Te(e,t){e.delete(t),t.childNodes.forEach((function(t){return Te(e,t)}))}function Me(e,t,n){return 0!==e.length&&Ee(e,t,n)}function Ee(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||Ee(e,r,n)}function Ne(e,t){return 0!==e.size&&Oe(e,t)}function Oe(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||Oe(e,n))}function Le(e){we=e}function Re(){we=void 0}var Fe=function(e){if(!we)return e;return function(){try{return e.apply(void 0,arguments)}catch(e){if(we&&!0===we(e))return;throw e}}},De=[];function qe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Pe(e,t){var n,r,o=new Ae;De.push(o),o.init(e);var i=window.MutationObserver||window.__rrMutationObserver,a=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);var s=new i(Fe(o.processMutations.bind(o)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function He(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,o=e.blockClass,i=e.blockSelector,a=e.sampling;if(!1===a.mouseInteraction)return function(){};var s=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,c=[],u=null;return Object.keys(Ce).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var a=S(e),s=function(e){return function(n){var a=qe(n);if(!se(a,o,i,!0)){var s=null,c=e;if("pointerType"in n){switch(n.pointerType){case"mouse":s=_e.Mouse;break;case"touch":s=_e.Touch;break;case"pen":s=_e.Pen}s===_e.Touch?Ce[e]===Ce.MouseDown?c="TouchStart":Ce[e]===Ce.MouseUp&&(c="TouchEnd"):_e.Pen}else le(n)&&(s=_e.Touch);null!==s?(u=s,(c.startsWith("Touch")&&s===_e.Touch||c.startsWith("Mouse")&&s===_e.Mouse)&&(s=null)):Ce[e]===Ce.Click&&(s=u,u=null);var l=le(n)?n.changedTouches[0]:n;if(l){var d=r.getId(a),p=l.clientX,f=l.clientY;Fe(t)(Object.assign({type:Ce[c],id:d,x:p,y:f},null!==s&&{pointerType:s}))}}}}(e);if(window.PointerEvent)switch(Ce[e]){case Ce.MouseDown:case Ce.MouseUp:a=a.replace("mouse","pointer");break;case Ce.TouchStart:case Ce.TouchEnd:return}c.push(Y(a,s,n))})),Fe((function(){c.forEach((function(e){return e()}))}))}function Be(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass,i=e.blockSelector,a=e.sampling;return Y("scroll",Fe($(Fe((function(e){var a=qe(e);if(a&&!se(a,o,i,!0)){var s=r.getId(a);if(a===n&&n.defaultView){var c=re(n.defaultView);t({id:s,x:c.left,y:c.top})}else t({id:s,x:a.scrollLeft,y:a.scrollTop})}})),a.scroll||100)),n)}var Ze=["INPUT","TEXTAREA","SELECT"],We=new WeakMap;function Ve(e){return function(e,t){if(Ke("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ke("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ke("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ke("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Ue(e,t,n){var r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function je(e,t){var n,r,o,i=e.mirror,a=e.stylesheetManager,s=null;s="#document"===t.nodeName?i.getId(t):i.getId(t.host);var c="#document"===t.nodeName?null===(n=t.defaultView)||void 0===n?void 0:n.Document:null===(o=null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===o?void 0:o.ShadowRoot,u=(null==c?void 0:c.prototype)?Object.getOwnPropertyDescriptor(null==c?void 0:c.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&c&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:function(){var e;return null===(e=u.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,n=null===(t=u.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return n}}),Fe((function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):function(){}}function Ge(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.doc.defaultView;if(!r)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,o=e.mouseInteractionCb,i=e.scrollCb,a=e.viewportResizeCb,s=e.inputCb,c=e.mediaInteractionCb,u=e.styleSheetRuleCb,l=e.styleDeclarationCb,d=e.canvasMutationCb,p=e.fontCb,f=e.selectionCb,h=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),r.apply(void 0,arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),o.apply(void 0,arguments)},e.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),i.apply(void 0,arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),a.apply(void 0,arguments)},e.inputCb=function(){t.input&&t.input.apply(t,arguments),s.apply(void 0,arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),c.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),u.apply(void 0,arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),l.apply(void 0,arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),d.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),p.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),f.apply(void 0,arguments)},e.customElementCb=function(){t.customElement&&t.customElement.apply(t,arguments),h.apply(void 0,arguments)}}(e,n),e.recordDOM&&(t=Pe(e,e.doc));var o=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,o=e.mirror;if(!1===n.mousemove)return function(){};var i,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,c=[],u=$(Fe((function(e){var n=Date.now()-i;t(c.map((function(e){return e.timeOffset-=n,e})),e),c=[],i=null})),s),l=Fe($(Fe((function(e){var t=qe(e),n=le(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;i||(i=ne()),c.push({x:r,y:a,id:o.getId(t),timeOffset:ne()-i}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?be.Drag:e instanceof MouseEvent?be.MouseMove:be.TouchMove)})),a,{trailing:!1})),d=[Y("mousemove",l,r),Y("touchmove",l,r),Y("drag",l,r)];return Fe((function(){d.forEach((function(e){return e()}))}))}(e),i=He(e),a=Be(e),s=function(e,t){var n=e.viewportResizeCb,r=t.win,o=-1,i=-1;return Y("resize",Fe($(Fe((function(){var e=oe(),t=ie();o===e&&i===t||(n({width:Number(t),height:Number(e)}),o=e,i=t)})),200)),r)}(e,{win:r}),c=function(e){var t=e.inputCb,n=e.doc,r=e.mirror,o=e.blockClass,i=e.blockSelector,a=e.ignoreClass,s=e.ignoreSelector,c=e.maskInputOptions,u=e.maskInputFn,l=e.sampling,p=e.userTriggeredOnInput;function f(e){var t=qe(e),r=e.isTrusted,l=t&&t.tagName;if(t&&"OPTION"===l&&(t=t.parentElement),t&&l&&!(Ze.indexOf(l)<0)&&!se(t,o,i,!0)&&!(t.classList.contains(a)||s&&t.matches(s))){var d=t.value,f=!1,g=k(t)||"";"radio"===g||"checkbox"===g?f=t.checked:(c[l.toLowerCase()]||c[g])&&(d=I({element:t,maskInputOptions:c,tagName:l,type:g,value:d,maskInputFn:u})),h(t,p?{text:d,isChecked:f,userTriggered:r}:{text:d,isChecked:f});var v=t.name;"radio"===g&&v&&f&&n.querySelectorAll('input[type="radio"][name="'.concat(v,'"]')).forEach((function(e){if(e!==t){var n=e.value;h(e,p?{text:n,isChecked:!f,userTriggered:!1}:{text:n,isChecked:!f})}}))}}function h(e,n){var o=We.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){We.set(e,n);var i=r.getId(e);Fe(t)(Object.assign(Object.assign({},n),{id:i}))}}var g=("last"===l.input?["change"]:["input","change"]).map((function(e){return Y(e,Fe(f),n)})),v=n.defaultView;if(!v)return function(){g.forEach((function(e){return e()}))};var m=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value"),y=[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&g.push.apply(g,d(y.map((function(e){return ee(e[0],e[1],{set:function(){Fe(f)({target:this,isTrusted:!1})}},!1,v)})))),Fe((function(){g.forEach((function(e){return e()}))}))}(e),u=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,o=e.mirror,i=e.sampling,a=e.doc,s=Fe((function(e){return $(Fe((function(i){var a=qe(i);if(a&&!se(a,n,r,!0)){var s=a.currentTime,c=a.volume,u=a.muted,l=a.playbackRate,d=a.loop;t({type:e,id:o.getId(a),currentTime:s,volume:c,muted:u,playbackRate:l,loop:d})}})),i.media||500)})),c=[Y("play",s(0),a),Y("pause",s(1),a),Y("seeked",s(2),a),Y("volumechange",s(3),a),Y("ratechange",s(4),a)];return Fe((function(){c.forEach((function(e){return e()}))}))}(e),p=function(){},f=function(){},g=function(){},v=function(){};e.recordDOM&&(p=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,o=e.stylesheetManager,i=t.win;if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return function(){};var a=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Fe((function(e,t,i){var a=l(i,2),s=a[0],c=a[1],u=Ue(t,r,o.styleMirror),d=u.id,p=u.styleId;return(d&&-1!==d||p&&-1!==p)&&n({id:d,styleId:p,adds:[{rule:s,index:c}]}),e.apply(t,i)}))});var s,c,u=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Fe((function(e,t,i){var a=l(i,1)[0],s=Ue(t,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,removes:[{index:a}]}),e.apply(t,i)}))}),i.CSSStyleSheet.prototype.replace&&(s=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Fe((function(e,t,i){var a=l(i,1)[0],s=Ue(t,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,replace:a}),e.apply(t,i)}))})),i.CSSStyleSheet.prototype.replaceSync&&(c=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:Fe((function(e,t,i){var a=l(i,1)[0],s=Ue(t,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,replaceSync:a}),e.apply(t,i)}))}));var p={};Qe("CSSGroupingRule")?p.CSSGroupingRule=i.CSSGroupingRule:(Qe("CSSMediaRule")&&(p.CSSMediaRule=i.CSSMediaRule),Qe("CSSConditionRule")&&(p.CSSConditionRule=i.CSSConditionRule),Qe("CSSSupportsRule")&&(p.CSSSupportsRule=i.CSSSupportsRule));var f={};return Object.entries(p).forEach((function(e){var t=l(e,2),i=t[0],a=t[1];f[i]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(f[i].insertRule,{apply:Fe((function(e,t,i){var a=l(i,2),s=a[0],c=a[1],u=Ue(t.parentStyleSheet,r,o.styleMirror),p=u.id,f=u.styleId;return(p&&-1!==p||f&&-1!==f)&&n({id:p,styleId:f,adds:[{rule:s,index:[].concat(d(Ve(t)),[c||0])}]}),e.apply(t,i)}))}),a.prototype.deleteRule=new Proxy(f[i].deleteRule,{apply:Fe((function(e,t,i){var a=l(i,1)[0],s=Ue(t.parentStyleSheet,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,removes:[{index:[].concat(d(Ve(t)),[a])}]}),e.apply(t,i)}))})})),Fe((function(){i.CSSStyleSheet.prototype.insertRule=a,i.CSSStyleSheet.prototype.deleteRule=u,s&&(i.CSSStyleSheet.prototype.replace=s),c&&(i.CSSStyleSheet.prototype.replaceSync=c),Object.entries(p).forEach((function(e){var t=l(e,2),n=t[0],r=t[1];r.prototype.insertRule=f[n].insertRule,r.prototype.deleteRule=f[n].deleteRule}))}))}(e,{win:r}),f=je(e,e.doc),g=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=e.ignoreCSSAttributes,i=e.stylesheetManager,a=t.win,s=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Fe((function(e,t,a){var c,u=l(a,3),d=u[0],p=u[1],f=u[2];if(o.has(d))return s.apply(t,[d,p,f]);var h=Ue(null===(c=t.parentRule)||void 0===c?void 0:c.parentStyleSheet,r,i.styleMirror),g=h.id,v=h.styleId;return(g&&-1!==g||v&&-1!==v)&&n({id:g,styleId:v,set:{property:d,value:p,priority:f},index:Ve(t.parentRule)}),e.apply(t,a)}))});var c=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(c,{apply:Fe((function(e,t,a){var s,u=l(a,1)[0];if(o.has(u))return c.apply(t,[u]);var d=Ue(null===(s=t.parentRule)||void 0===s?void 0:s.parentStyleSheet,r,i.styleMirror),p=d.id,f=d.styleId;return(p&&-1!==p||f&&-1!==f)&&n({id:p,styleId:f,remove:{property:u},index:Ve(t.parentRule)}),e.apply(t,a)}))}),Fe((function(){a.CSSStyleDeclaration.prototype.setProperty=s,a.CSSStyleDeclaration.prototype.removeProperty=c}))}(e,{win:r}),e.collectFonts&&(v=function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],i=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=te(n.fonts,"add",(function(e){return function(n){return setTimeout(Fe((function(){var e=i.get(n);e&&(t(e),i.delete(n))})),0),e.apply(this,[n])}}));return o.push((function(){r.FontFace=a})),o.push(s),Fe((function(){o.forEach((function(e){return e()}))}))}(e)));var m,y=function(e){var t=e.doc,n=e.mirror,r=e.blockClass,o=e.blockSelector,i=e.selectionCb,a=!0,s=Fe((function(){var e=t.getSelection();if(!(!e||a&&(null==e?void 0:e.isCollapsed))){a=e.isCollapsed||!1;for(var s=[],c=e.rangeCount||0,u=0;u<c;u++){var l=e.getRangeAt(u),d=l.startContainer,p=l.startOffset,f=l.endContainer,h=l.endOffset;se(d,r,o,!0)||se(f,r,o,!0)||s.push({start:n.getId(d),startOffset:p,end:n.getId(f),endOffset:h})}i({ranges:s})}}));return s(),Y("selectionchange",s)}(e),b=function(e){var t=e.doc,n=e.customElementCb,r=t.defaultView;return r&&r.customElements?te(r.customElements,"define",(function(e){return function(t,r,o){try{n({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return e.apply(this,[t,r,o])}})):function(){}}(e),C=[],_=h(e.plugins);try{for(_.s();!(m=_.n()).done;){var S=m.value;C.push(S.observer(S.callback,r,S.options))}}catch(e){_.e(e)}finally{_.f()}return Fe((function(){De.forEach((function(e){return e.reset()})),null==t||t.disconnect(),o(),i(),a(),s(),c(),u(),p(),f(),g(),v(),y(),b(),C.forEach((function(e){return e()}))}))}function Ke(e){return void 0!==window[e]}function Qe(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ze=function(){function e(t){a(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return c(e,[{key:"getId",value:function(e,t,n,r){var o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e),a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),i.set(a,t)),a}},{key:"getIds",value:function(e,t){var n=this,r=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getId(e,t,r,o)}))}},{key:"getRemoteId",value:function(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var o=r.get(t);return o||-1}},{key:"getRemoteIds",value:function(e,t){var n=this,r=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getRemoteId(e,t,r)}))}},{key:"reset",value:function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),e}(),Ye=function(){function e(t){a(this,e),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ze(O),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ze(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return c(e,[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}}},{key:"transformCrossOriginEvent",value:function(e,t){var n,r=this;switch(t.type){case ye.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var o=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,o),this.patchRootIdOnNode(t.data.node,o),{timestamp:t.timestamp,type:ye.IncrementalSnapshot,data:{source:be.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case ye.Meta:case ye.Load:case ye.DomContentLoaded:return!1;case ye.Plugin:return t;case ye.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ye.IncrementalSnapshot:switch(t.data.source){case be.Mutation:return t.data.adds.forEach((function(t){r.replaceIds(t,e,["parentId","nextId","previousId"]),r.replaceIdOnNode(t.node,e);var n=r.crossOriginIframeRootIdMap.get(e);n&&r.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((function(t){r.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){r.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case be.Drag:case be.TouchMove:case be.MouseMove:return t.data.positions.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case be.ViewportResize:return!1;case be.MediaInteraction:case be.MouseInteraction:case be.Scroll:case be.CanvasMutation:case be.Input:return this.replaceIds(t.data,e,["id"]),t;case be.StyleSheetRule:case be.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case be.Font:return t;case be.Selection:return t.data.ranges.forEach((function(t){r.replaceIds(t,e,["start","end"])})),t;case be.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((function(t){r.replaceStyleIds(t,e,["styleId"])})),t}}return!1}},{key:"replace",value:function(e,t,n,r){var o,i=h(r);try{for(i.s();!(o=i.n()).done;){var a=o.value;(Array.isArray(t[a])||"number"==typeof t[a])&&(Array.isArray(t[a])?t[a]=e.getIds(n,t[a]):t[a]=e.getId(n,t[a]))}}catch(e){i.e(e)}finally{i.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((function(e){n.replaceIdOnNode(e,t)}))}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===g.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((function(e){n.patchRootIdOnNode(e,t)}))}}]),e}(),Je=function(){function e(t){a(this,e),this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}return c(e,[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n=this;if(y(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=Pe(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((function(){return r.disconnect()})),this.restoreHandlers.push(Be(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(e.host)),n.restoreHandlers.push(je({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))}),0)}}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,t){var n=this;this.restoreHandlers.push(te(e.prototype,"attachShadow",(function(e){return function(r){var o=e.call(this,r);return this.shadowRoot&&me(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}},{key:"reset",value:function(){this.restoreHandlers.forEach((function(e){try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),e}();function Xe(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}for(var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",et="undefined"==typeof Uint8Array?[]:new Uint8Array(256),tt=0;tt<64;tt++)et[$e.charCodeAt(tt)]=tt;var nt=new Map;var rt=function(e,t,n){if(e&&(at(e,t)||"object"===r(e))){var o=function(e,t){var n=nt.get(e);return n||(n=new Map,nt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),i=o.indexOf(e);return-1===i&&(i=o.length,o.push(e)),i}};function ot(e,t,n){if(e instanceof Array)return e.map((function(e){return ot(e,t,n)}));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var o=e.constructor.name,i=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=$e[n[t]>>2],o+=$e[(3&n[t])<<4|n[t+1]>>4],o+=$e[(15&n[t+1])<<2|n[t+2]>>6],o+=$e[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:o,base64:i}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ot(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement)return{rr_type:e.constructor.name,src:e.src};if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[ot(e.data,t,n),e.width,e.height]}:at(e,t)||"object"===r(e)?{rr_type:e.constructor.name,index:rt(e,t,n)}:e}var it=function(e,t,n){return e.map((function(e){return ot(e,t,n)}))},at=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function st(e,t,n,o){var i=[];try{var a=te(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i){for(var a=arguments.length,s=new Array(a>1?a-1:0),c=1;c<a;c++)s[c-1]=arguments[c];if(!se(this,t,n,!0)){var u=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=u),o&&["webgl","webgl2"].includes(u))if(s[0]&&"object"===r(s[0])){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i].concat(s))}}));i.push(a)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){i.forEach((function(e){return e()}))}}function ct(e,t,n,r,o,i,a){var s,c=[],u=h(Object.getOwnPropertyNames(e));try{var l=function(){var i=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))return"continue";try{if("function"!=typeof e[i])return"continue";var u=te(e,i,(function(e){return function(){for(var s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];var l=e.apply(this,c);if(rt(l,a,this),"tagName"in this.canvas&&!se(this.canvas,r,o,!0)){var d=it(c,a,this),p={type:t,property:i,args:d};n(this.canvas,p)}return l}}));c.push(u)}catch(r){var l=ee(e,i,{set:function(e){n(this.canvas,{type:t,property:i,args:[e],setter:!0})}});c.push(l)}};for(u.s();!(s=u.n()).done;)l()}catch(e){u.e(e)}finally{u.f()}return c}function ut(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),i=o.indexOf("\n",10)+1,a=o.substring(i)+(r?"//# sourceMappingURL="+r:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}var lt,dt,pt,ft,ht,gt,vt,mt=(lt="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",dt=null,pt=!1,function(e){return ft=ft||ut(lt,dt,pt),new Worker(ft,e)}),yt=function(){function e(t){var n=this;a(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId)&&n.rafStamps.invokeId||(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)};var r=t.sampling,o=void 0===r?"all":r,i=t.win,s=t.blockClass,c=t.blockSelector,u=t.recordCanvas,l=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,u&&"all"===o&&this.initCanvasMutationObserver(i,s,c),u&&"number"==typeof o&&this.initCanvasFPSObserver(o,i,s,c,{dataURLOptions:l})}return c(e,[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,t,r,o,i){var a=this,s=st(t,r,o,!0),c=new Map,u=new mt;u.onmessage=function(e){var t=e.data.id;if(c.set(t,!1),"base64"in e.data){var n=e.data,r=n.base64,o=n.type,i=n.width,s=n.height;a.mutationCb({id:t,type:Ie["2D"],commands:[{property:"clearRect",args:[0,0,i,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:o}]},0,0]}]})}};var l,d=1e3/e,p=0;l=requestAnimationFrame((function e(s){var f;p&&s-p<d?l=requestAnimationFrame(e):(p=s,(f=[],function e(t){t.querySelectorAll("canvas").forEach((function(e){se(e,r,o,!0)||f.push(e)})),t.querySelectorAll("*").forEach((function(t){t.shadowRoot&&e(t.shadowRoot)}))}(t.document),f).forEach((function(e){return Xe(a,void 0,void 0,n().mark((function t(){var r,o,a,s,l,d;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=this.mirror.getId(e),!c.get(o)){t.next=3;break}return t.abrupt("return");case 3:if(0!==e.width&&0!==e.height){t.next=5;break}return t.abrupt("return");case 5:return c.set(o,!0),["webgl","webgl2"].includes(e.__context)&&(a=e.getContext(e.__context),!1===(null===(r=null==a?void 0:a.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&a.clear(a.COLOR_BUFFER_BIT)),s=e.clientWidth||e.width,l=e.clientHeight||e.height,t.next=11,createImageBitmap(e,{resizeWidth:s,resizeHeight:l});case 11:d=t.sent,u.postMessage({id:o,bitmap:d,width:s,height:l,dataURLOptions:i.dataURLOptions},[d]);case 13:case"end":return t.stop()}}),t,this)})))})),l=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(l)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=st(e,t,n,!1),o=function(e,t,n,r){var o,i=[],a=h(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));try{var s=function(){var a=o.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])return"continue";var s=te(t.CanvasRenderingContext2D.prototype,a,(function(o){return function(){for(var i=this,s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];return se(this.canvas,n,r,!0)||setTimeout((function(){var n=it(c,t,i);e(i.canvas,{type:Ie["2D"],property:a,args:n})}),0),o.apply(this,c)}}));i.push(s)}catch(n){var c=ee(t.CanvasRenderingContext2D.prototype,a,{set:function(t){e(this.canvas,{type:Ie["2D"],property:a,args:[t],setter:!0})}});i.push(c)}};for(a.s();!(o=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return function(){i.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r,o){var i=[];return i.push.apply(i,d(ct(t.WebGLRenderingContext.prototype,Ie.WebGL,e,n,r,0,t))),void 0!==t.WebGL2RenderingContext&&i.push.apply(i,d(ct(t.WebGL2RenderingContext.prototype,Ie.WebGL2,e,n,r,0,t))),function(){i.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=function(){r(),o(),i()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value:function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){var t=
|
|
1
|
+
!function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(){n=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),a=new w(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return x()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d={};function p(){}function f(){}function h(){}var g={};c(g,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(k([])));m&&m!==t&&r.call(m,i)&&(g=m);var y=h.prototype=p.prototype=Object.create(g);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,i,a,s){var c=l(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function _(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,d;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function k(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return f.prototype=h,c(y,"constructor",h),c(h,"constructor",f),f.displayName=c(h,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,c(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(C.prototype),c(C.prototype,a,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new C(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),c(y,s,"Generator"),c(y,i,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=k,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){o(a,r,i,s,c,"next",e)}function c(e){o(a,r,i,s,c,"throw",e)}s(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=p(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}var g,v="2.0.0-alpha.13";function m(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function y(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function b(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(C).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function C(e){var t,n,r;if(function(e){return"styleSheet"in e}(e))try{t=b(e.styleSheet)||function(e){var t=e.cssText;if(t.split('"').length<3)return t;var n=["@import","url(".concat(JSON.stringify(e.href),")")];return""===e.layerName?n.push("layer"):e.layerName&&n.push("layer(".concat(e.layerName,")")),e.supportsText&&n.push("supports(".concat(e.supportsText,")")),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return n=e.cssText,r=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,n.replace(r,"$1\\$2");return t||e.cssText}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(g||(g={}));var _=function(){function e(){a(this,e),this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return c(e,[{key:"getId",value:function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1}},{key:"getNode",value:function(e){return this.idNodeMap.get(e)||null}},{key:"getIds",value:function(){return Array.from(this.idNodeMap.keys())}},{key:"getMeta",value:function(e){return this.nodeMetaMap.get(e)||null}},{key:"removeNodeFromMap",value:function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach((function(e){return t.removeNodeFromMap(e)}))}},{key:"has",value:function(e){return this.idNodeMap.has(e)}},{key:"hasNode",value:function(e){return this.nodeMetaMap.has(e)}},{key:"add",value:function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}},{key:"replace",value:function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)}},{key:"reset",value:function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}]),e}();function I(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,o=e.type,i=e.value,a=e.maskInputFn,s=i||"",c=o&&S(o);return(n[r.toLowerCase()]||c&&n[c])&&(s=a?a(s,t):"*".repeat(s.length)),s}function S(e){return e.toLowerCase()}var w="__rrweb_original__";function k(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?S(t):null}function x(e,t){var n,r;try{r=new URL(e,null!=t?t:window.location.href)}catch(e){return null}var o=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!==(n=null==o?void 0:o[1])&&void 0!==n?n:null}var A,T,M=1,E=new RegExp("[^a-z0-9-_:]"),N=-2;function O(){return M++}var L=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,R=/^(?:[a-z+]+:)?\/\//i,F=/^www\..*/i,D=/^(data:)([^,]*),(.*)/i;function q(e,t){return(e||"").replace(L,(function(e,n,r,o,i,a){var s,c=r||i||a,u=n||o||"";if(!c)return e;if(R.test(c)||F.test(c))return"url(".concat(u).concat(c).concat(u,")");if(D.test(c))return"url(".concat(u).concat(c).concat(u,")");if("/"===c[0])return"url(".concat(u).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(u,")");var l=t.split("/"),d=c.split("/");l.pop();var p,f=h(d);try{for(f.s();!(p=f.n()).done;){var g=p.value;"."!==g&&(".."===g?l.pop():l.push(g))}}catch(e){f.e(e)}finally{f.f()}return"url(".concat(u).concat(l.join("/")).concat(u,")")}))}var P=/^[^ \t\n\r\u000c]+/,H=/^[, \t\n\r\u000c]+/;function B(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function W(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Z(){var e=document.createElement("a");return e.href="",e.href}function V(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?B(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(H),!(n>=t.length);){var i=r(P);if(","===i.slice(-1))i=B(e,i.substring(0,i.length-1)),o.push(i);else{var a="";i=B(e,i);for(var s=!1;;){var c=t.charAt(n);if(""===c){o.push((i+a).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){n+=1,o.push((i+a).trim());break}"("===c&&(s=!0)}a+=c,n+=1}}}return o.join(", ")}(e,r):"style"===n?q(r,Z()):"object"===t&&"data"===n?B(e,r):r:B(e,r):r}function U(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t||"video"===e&&"src"===t&&n&&n.startsWith("blob:http")}function j(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&j(e.parentNode,t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&j(e.parentNode,t,n)}function G(e,t,n,r){try{var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(r){if(o.closest(".".concat(t)))return!0}else if(o.classList.contains(t))return!0}else if(j(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(e){}return!1}function K(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.needsMask,s=t.inlineStylesheet,c=t.maskInputOptions,u=void 0===c?{}:c,l=t.maskTextFn,d=t.maskInputFn,p=t.dataURLOptions,f=void 0===p?{}:p,h=t.inlineImages,v=t.recordCanvas,m=t.keepIframeSrcFn,y=t.newlyAddedElement,C=void 0!==y&&y,_=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:g.Document,childNodes:[],compatMode:e.compatMode}:{type:g.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:g.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:_};case e.ELEMENT_NODE:return function(e,t){for(var n,r=t.doc,o=t.blockClass,i=t.blockSelector,a=t.inlineStylesheet,s=t.maskInputOptions,c=void 0===s?{}:s,u=t.maskInputFn,l=t.dataURLOptions,d=void 0===l?{}:l,p=t.inlineImages,f=t.recordCanvas,h=t.keepIframeSrcFn,v=t.newlyAddedElement,m=void 0!==v&&v,y=t.rootId,C=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,o,i),_=function(e){if(e instanceof HTMLFormElement)return"form";var t=S(e.tagName);return E.test(t)?"div":t}(e),x={},M=e.attributes.length,N=0;N<M;N++){var O=e.attributes[N];U(_,O.name,O.value)||(x[O.name]=V(r,_,S(O.name),O.value))}if("link"===_&&a){var L=e.href,R=Array.from(r.styleSheets).find((function(e){return e.href===L}));if(!R&&L.includes(".css")){var F=window.location.origin+"/"+L.replace(window.location.href,"");R=Array.from(r.styleSheets).find((function(e){return e.href===F}))}var D=null;R&&(D=b(R)),D&&(delete x.rel,delete x.href,x._cssText=q(D,R.href))}if("style"===_&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){var P=b(e.sheet);P&&(x._cssText=q(P,Z()))}if("input"===_||"textarea"===_||"select"===_){var H=e.value,B=e.checked;"radio"!==x.type&&"checkbox"!==x.type&&"submit"!==x.type&&"button"!==x.type&&H?x.value=I({element:e,type:k(e),tagName:_,value:H,maskInputOptions:c,maskInputFn:u}):B&&(x.checked=B)}"option"===_&&(e.selected&&!c.select?x.selected=!0:delete x.selected);if("canvas"===_&&f)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var o=t.getImageData,i=w in o?o[w]:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some((function(e){return 0!==e})))return!1}return!0})(e)||(x.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){var j=e.toDataURL(d.type,d.quality),G=document.createElement("canvas");G.width=e.width,G.height=e.height,j!==G.toDataURL(d.type,d.quality)&&(x.rr_dataURL=j)}if("img"===_&&p){A||(A=r.createElement("canvas"),T=A.getContext("2d"));var K=e,Q=K.crossOrigin;K.crossOrigin="anonymous";var z=function e(){K.removeEventListener("load",e);try{A.width=K.naturalWidth,A.height=K.naturalHeight,T.drawImage(K,0,0),x.rr_dataURL=A.toDataURL(d.type,d.quality)}catch(e){console.warn("Cannot inline img src=".concat(K.currentSrc,"! Error: ").concat(e))}Q?x.crossOrigin=Q:K.removeAttribute("crossorigin")};K.complete&&0!==K.naturalWidth?z():K.addEventListener("load",z)}if("audio"===_||"video"===_){var Y=x;Y.rr_mediaState=e.paused?"paused":"played",Y.rr_mediaCurrentTime=e.currentTime,Y.rr_mediaPlaybackRate=e.playbackRate,Y.rr_mediaMuted=e.muted,Y.rr_mediaLoop=e.loop,Y.rr_mediaVolume=e.volume}m||(e.scrollLeft&&(x.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(x.rr_scrollTop=e.scrollTop));if(C){var J=e.getBoundingClientRect(),X=J.width,$=J.height;x={class:x.class,rr_width:"".concat(X,"px"),rr_height:"".concat($,"px")}}"iframe"!==_||h(x.src)||(e.contentDocument||(x.rr_src=x.src),delete x.src);try{customElements.get(_)&&(n=!0)}catch(e){}return{type:g.Element,tagName:_,attributes:x,childNodes:[],isSVG:W(e)||void 0,needBlock:C,rootId:y,isCustom:n}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:s,maskInputOptions:u,maskInputFn:d,dataURLOptions:f,inlineImages:h,recordCanvas:v,keepIframeSrcFn:m,newlyAddedElement:C,rootId:_});case e.TEXT_NODE:return function(e,t){var n,r=t.needsMask,o=t.maskTextFn,i=t.rootId,a=e.parentNode&&e.parentNode.tagName,s=e.textContent,c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(c&&s){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(s=b(e.parentNode.sheet))}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}s=q(s,Z())}u&&(s="SCRIPT_PLACEHOLDER");!c&&!u&&s&&r&&(s=o?o(s,e.parentElement):s.replace(/[\S]/g,"*"));return{type:g.Text,textContent:s||"",isStyle:c,rootId:i}}(e,{needsMask:a,maskTextFn:l,rootId:_});case e.CDATA_SECTION_NODE:return{type:g.CDATA,textContent:"",rootId:_};case e.COMMENT_NODE:return{type:g.Comment,textContent:e.textContent||"",rootId:_};default:return!1}}function Q(e){return null==e?"":e.toLowerCase()}function z(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,s=t.maskTextSelector,c=t.skipChild,u=void 0!==c&&c,l=t.inlineStylesheet,d=void 0===l||l,p=t.maskInputOptions,f=void 0===p?{}:p,h=t.maskTextFn,v=t.maskInputFn,b=t.slimDOMOptions,C=t.dataURLOptions,_=void 0===C?{}:C,I=t.inlineImages,S=void 0!==I&&I,w=t.recordCanvas,k=void 0!==w&&w,A=t.onSerialize,T=t.onIframeLoad,M=t.iframeLoadTimeout,E=void 0===M?5e3:M,L=t.onStylesheetLoad,R=t.stylesheetLoadTimeout,F=void 0===R?5e3:R,D=t.keepIframeSrcFn,q=void 0===D?function(){return!1}:D,P=t.newlyAddedElement,H=void 0!==P&&P,B=t.needsMask,W=t.preserveWhiteSpace,Z=void 0===W||W;!B&&e.childNodes&&(B=G(e,a,s,void 0===B));var V,U=K(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:B,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:v,dataURLOptions:_,inlineImages:S,recordCanvas:k,keepIframeSrcFn:q,newlyAddedElement:H});if(!U)return console.warn(e,"not serialized"),null;V=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===g.Comment)return!0;if(e.type===g.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===x(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Q(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Q(e.attributes.name)||"icon"===Q(e.attributes.rel)||"apple-touch-icon"===Q(e.attributes.rel)||"shortcut icon"===Q(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Q(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Q(e.attributes.property).match(/^(og|twitter|fb):/)||Q(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Q(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Q(e.attributes.name)||"googlebot"===Q(e.attributes.name)||"bingbot"===Q(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Q(e.attributes.name)||"generator"===Q(e.attributes.name)||"framework"===Q(e.attributes.name)||"publisher"===Q(e.attributes.name)||"progid"===Q(e.attributes.name)||Q(e.attributes.property).match(/^article:/)||Q(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Q(e.attributes.name)||"yandex-verification"===Q(e.attributes.name)||"csrf-token"===Q(e.attributes.name)||"p:domain_verify"===Q(e.attributes.name)||"verify-v1"===Q(e.attributes.name)||"verification"===Q(e.attributes.name)||"shopify-checkout-api-token"===Q(e.attributes.name)))return!0}}return!1}(U,b)&&(Z||U.type!==g.Text||U.isStyle||U.textContent.replace(/^\s+|\s+$/gm,"").length)?O():N;var j=Object.assign(U,{id:V});if(r.add(e,j),V===N)return null;A&&A(e);var Y=!u;if(j.type===g.Element){Y=Y&&!j.needBlock,delete j.needBlock;var J=e.shadowRoot;J&&y(J)&&(j.isShadowHost=!0)}if((j.type===g.Document||j.type===g.Element)&&Y){b.headWhitespace&&j.type===g.Element&&"head"===j.tagName&&(Z=!1);var X={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:B,maskTextClass:a,maskTextSelector:s,skipChild:u,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:v,slimDOMOptions:b,dataURLOptions:_,inlineImages:S,recordCanvas:k,preserveWhiteSpace:Z,onSerialize:A,onIframeLoad:T,iframeLoadTimeout:E,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:q};if(j.type===g.Element&&"textarea"===j.tagName&&void 0!==j.attributes.value);else for(var $=0,ee=Array.from(e.childNodes);$<ee.length;$++){var te=z(ee[$],X);te&&j.childNodes.push(te)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var ne=0,re=Array.from(e.shadowRoot.childNodes);ne<re.length;ne++){var oe=z(re[ne],X);oe&&(y(e.shadowRoot)&&(oe.isShadow=!0),j.childNodes.push(oe))}}return e.parentNode&&m(e.parentNode)&&y(e.parentNode)&&(j.isShadow=!0),j.type===g.Element&&"iframe"===j.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){var a="about:blank";if(r.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout((function(){i||(t(),i=!0)}),n);e.addEventListener("load",(function(){clearTimeout(s),i=!0,t()}))}}}(e,(function(){var t=e.contentDocument;if(t&&T){var n=z(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:B,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:v,slimDOMOptions:b,dataURLOptions:_,inlineImages:S,recordCanvas:k,preserveWhiteSpace:Z,onSerialize:A,onIframeLoad:T,iframeLoadTimeout:E,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:q});n&&T(e,n)}}),E),j.type===g.Element&&"link"===j.tagName&&"string"==typeof j.attributes.rel&&("stylesheet"===j.attributes.rel||"preload"===j.attributes.rel&&"string"==typeof j.attributes.href&&"css"===x(j.attributes.href))&&function(e,t,n){var r,o=!1;try{r=e.sheet}catch(e){return}if(!r){var i=setTimeout((function(){o||(t(),o=!0)}),n);e.addEventListener("load",(function(){clearTimeout(i),o=!0,t()}))}}(e,(function(){if(L){var t=z(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:B,maskTextClass:a,maskTextSelector:s,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:h,maskInputFn:v,slimDOMOptions:b,dataURLOptions:_,inlineImages:S,recordCanvas:k,preserveWhiteSpace:Z,onSerialize:A,onIframeLoad:T,iframeLoadTimeout:E,onStylesheetLoad:L,stylesheetLoadTimeout:F,keepIframeSrcFn:q});t&&L(e,t)}}),F),j}function Y(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,r={capture:!0,passive:!0};return n.addEventListener(e,t,r),function(){return n.removeEventListener(e,t,r)}}var J="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.",X={map:{},getId:function(){return console.error(J),-1},getNode:function(){return console.error(J),null},removeNodeFromMap:function(){console.error(J)},has:function(){return console.error(J),!1},reset:function(){console.error(J)}};function $(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null,o=0;return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var c=Date.now();o||!1!==n.leading||(o=c);var u=t-(c-o),l=this;u<=0||u>t?(r&&(clearTimeout(r),r=null),o=c,e.apply(l,a)):r||!1===n.trailing||(r=setTimeout((function(){o=!1===n.leading?0:Date.now(),r=null,e.apply(l,a)}),u))}}function ee(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window,i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout((function(){n.set.call(t,e)}),0),i&&i.set&&i.set.call(this,e)}}),function(){return ee(e,t,i||{},!0)}}function te(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(X=new Proxy(X,{get:function(e,t,n){return"map"===t&&console.error(J),Reflect.get(e,t,n)}}));var ne=Date.now;function re(e){var t,n,r,o,i,a,s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==s?void 0:s.documentElement.scrollLeft)||(null===(n=null===(t=null==s?void 0:s.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null==s?void 0:s.body)||void 0===r?void 0:r.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null===(i=null===(o=null==s?void 0:s.body)||void 0===o?void 0:o.parentElement)||void 0===i?void 0:i.scrollTop)||(null===(a=null==s?void 0:s.body)||void 0===a?void 0:a.scrollTop)||0}}function oe(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ie(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function ae(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function se(e,t,n,r){if(!e)return!1;var o=ae(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(j(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function ce(e,t){return t.getId(e)===N}function ue(e,t){if(m(e))return!1;var n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||ue(e.parentNode,t))}function le(e){return Boolean(e.changedTouches)}function de(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function pe(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function fe(e){return Boolean(null==e?void 0:e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(ne=function(){return(new Date).getTime()});var he=function(){function e(){a(this,e),this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}return c(e,[{key:"getId",value:function(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n);var n}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]),e}();function ge(e){var t,n,r=null;return(null===(n=null===(t=e.getRootNode)||void 0===t?void 0:t.call(e))||void 0===n?void 0:n.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(r=e.getRootNode().host),r}function ve(e){var t=e.ownerDocument;if(!t)return!1;var n=function(e){for(var t,n=e;t=ge(n);)n=t;return n}(e);return t.contains(n)}function me(e){var t=e.ownerDocument;return!!t&&(t.contains(e)||ve(e))}var ye=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}(ye||{}),be=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}(be||{}),Ce=function(e){return e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e}(Ce||{}),_e=function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e}(_e||{}),Ie=function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e}(Ie||{});function Se(e){return"__ln"in e}var we,ke=function(){function e(){a(this,e),this.length=0,this.head=null,this.tail=null}return c(e,[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Se(e.previousSibling)){var n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Se(e.nextSibling)&&e.nextSibling.__ln.previous){var r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}},{key:"removeNode",value:function(e){var t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}]),e}(),xe=function(e,t){return"".concat(e,"@").concat(t)},Ae=function(){function e(){var t=this;a(this,e),this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=function(e){e.forEach(t.processMutation),t.emit()},this.emit=function(){if(!t.frozen&&!t.locked){for(var e=[],n=new Set,r=new ke,o=function(e){for(var n=e,r=N;r===N;)r=(n=n&&n.nextSibling)&&t.mirror.getId(n);return r},i=function(i){if(i.parentNode&&me(i)&&"TEXTAREA"!==i.parentNode.tagName){var a=m(i.parentNode)?t.mirror.getId(ge(i)):t.mirror.getId(i.parentNode),s=o(i);if(-1===a||-1===s)return r.addNode(i);var c=z(i,{doc:t.doc,mirror:t.mirror,blockClass:t.blockClass,blockSelector:t.blockSelector,maskTextClass:t.maskTextClass,maskTextSelector:t.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:t.inlineStylesheet,maskInputOptions:t.maskInputOptions,maskTextFn:t.maskTextFn,maskInputFn:t.maskInputFn,slimDOMOptions:t.slimDOMOptions,dataURLOptions:t.dataURLOptions,recordCanvas:t.recordCanvas,inlineImages:t.inlineImages,onSerialize:function(e){de(e,t.mirror)&&t.iframeManager.addIframe(e),pe(e,t.mirror)&&t.stylesheetManager.trackLinkElement(e),fe(i)&&t.shadowDomManager.addShadowRoot(i.shadowRoot,t.doc)},onIframeLoad:function(e,n){t.iframeManager.attachIframe(e,n),t.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,n){t.stylesheetManager.attachLinkElement(e,n)}});c&&(e.push({parentId:a,nextId:s,node:c}),n.add(c.id))}};t.mapRemoves.length;)t.mirror.removeNodeFromMap(t.mapRemoves.shift());var a,s=h(t.movedSet);try{for(s.s();!(a=s.n()).done;){var c=a.value;Me(t.removes,c,t.mirror)&&!t.movedSet.has(c.parentNode)||i(c)}}catch(e){s.e(e)}finally{s.f()}var u,l=h(t.addedSet);try{for(l.s();!(u=l.n()).done;){var d=u.value;Ne(t.droppedSet,d)||Me(t.removes,d,t.mirror)?Ne(t.movedSet,d)?i(d):t.droppedSet.add(d):i(d)}}catch(e){l.e(e)}finally{l.f()}for(var p=null;r.length;){var f=null;if(p){var g=t.mirror.getId(p.value.parentNode),v=o(p.value);-1!==g&&-1!==v&&(f=p)}if(!f)for(var y=r.tail;y;){var b=y;if(y=y.previous,b){var C=t.mirror.getId(b.value.parentNode);if(-1===o(b.value))continue;if(-1!==C){f=b;break}var _=b.value;if(_.parentNode&&_.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var I=_.parentNode.host;if(-1!==t.mirror.getId(I)){f=b;break}}}}if(!f){for(;r.head;)r.removeNode(r.head.value);break}p=f.previous,r.removeNode(f.value),i(f.value)}var S={texts:t.texts.map((function(e){var n=e.node;return n.parentNode&&"TEXTAREA"===n.parentNode.tagName&&t.genTextAreaValueMutation(n.parentNode),{id:t.mirror.getId(n),value:e.value}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),attributes:t.attributes.map((function(e){var n=e.attributes;if("string"==typeof n.style){var r=JSON.stringify(e.styleDiff),o=JSON.stringify(e._unchangedStyles);r.length<n.style.length&&(r+o).split("var(").length===n.style.split("var(").length&&(n.style=e.styleDiff)}return{id:t.mirror.getId(e.node),attributes:n}})).filter((function(e){return!n.has(e.id)})).filter((function(e){return t.mirror.has(e.id)})),removes:t.removes,adds:e};(S.texts.length||S.attributes.length||S.removes.length||S.adds.length)&&(t.texts=[],t.attributes=[],t.attributeMap=new WeakMap,t.removes=[],t.addedSet=new Set,t.movedSet=new Set,t.droppedSet=new Set,t.movedMap={},t.mutationCb(S))}},this.genTextAreaValueMutation=function(e){var n=t.attributeMap.get(e);n||(n={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(n),t.attributeMap.set(e,n)),n.attributes.value=Array.from(e.childNodes,(function(e){return e.textContent||""})).join("")},this.processMutation=function(e){if(!ce(e.target,t.mirror))switch(e.type){case"characterData":var n=e.target.textContent;se(e.target,t.blockClass,t.blockSelector,!1)||n===e.oldValue||t.texts.push({value:G(e.target,t.maskTextClass,t.maskTextSelector,!0)&&n?t.maskTextFn?t.maskTextFn(n,ae(e.target)):n.replace(/[\S]/g,"*"):n,node:e.target});break;case"attributes":var r=e.target,o=e.attributeName,i=e.target.getAttribute(o);if("value"===o){var a=k(r);i=I({element:r,maskInputOptions:t.maskInputOptions,tagName:r.tagName,type:a,value:i,maskInputFn:t.maskInputFn})}if(se(e.target,t.blockClass,t.blockSelector,!1)||i===e.oldValue)return;var s=t.attributeMap.get(e.target);if("IFRAME"===r.tagName&&"src"===o&&!t.keepIframeSrcFn(i)){if(r.contentDocument)return;o="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},t.attributes.push(s),t.attributeMap.set(e.target,s)),"type"===o&&"INPUT"===r.tagName&&"password"===(e.oldValue||"").toLowerCase()&&r.setAttribute("data-rr-is-password","true"),!U(r.tagName,o,i)&&(s.attributes[o]=V(t.doc,S(r.tagName),S(o),i),"style"===o)){if(!t.unattachedDoc)try{t.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){t.unattachedDoc=t.doc}var c=t.unattachedDoc.createElement("span");e.oldValue&&c.setAttribute("style",e.oldValue);for(var u=0,l=Array.from(r.style);u<l.length;u++){var d=l[u],p=r.style.getPropertyValue(d),f=r.style.getPropertyPriority(d);p!==c.style.getPropertyValue(d)||f!==c.style.getPropertyPriority(d)?s.styleDiff[d]=""===f?p:[p,f]:s._unchangedStyles[d]=[p,f]}for(var h=0,g=Array.from(c.style);h<g.length;h++){var v=g[h];""===r.style.getPropertyValue(v)&&(s.styleDiff[v]=!1)}}break;case"childList":if(se(e.target,t.blockClass,t.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void t.genTextAreaValueMutation(e.target);e.addedNodes.forEach((function(n){return t.genAdds(n,e.target)})),e.removedNodes.forEach((function(n){var r=t.mirror.getId(n),o=m(e.target)?t.mirror.getId(e.target.host):t.mirror.getId(e.target);se(e.target,t.blockClass,t.blockSelector,!1)||ce(n,t.mirror)||!function(e,t){return-1!==t.getId(e)}(n,t.mirror)||(t.addedSet.has(n)?(Te(t.addedSet,n),t.droppedSet.add(n)):t.addedSet.has(e.target)&&-1===r||ue(e.target,t.mirror)||(t.movedSet.has(n)&&t.movedMap[xe(r,o)]?Te(t.movedSet,n):t.removes.push({parentId:o,id:r,isShadow:!(!m(e.target)||!y(e.target))||void 0})),t.mapRemoves.push(n))}))}},this.genAdds=function(e,n){if(!t.processedNodeManager.inOtherBuffer(e,t)&&!t.addedSet.has(e)&&!t.movedSet.has(e)){if(t.mirror.hasNode(e)){if(ce(e,t.mirror))return;t.movedSet.add(e);var r=null;n&&t.mirror.hasNode(n)&&(r=t.mirror.getId(n)),r&&-1!==r&&(t.movedMap[xe(t.mirror.getId(e),r)]=!0)}else t.addedSet.add(e),t.droppedSet.delete(e);se(e,t.blockClass,t.blockSelector,!1)||(e.childNodes.forEach((function(e){return t.genAdds(e)})),fe(e)&&e.shadowRoot.childNodes.forEach((function(n){t.processedNodeManager.add(n,t),t.genAdds(n,e)})))}}}return c(e,[{key:"init",value:function(e){var t=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((function(n){t[n]=e[n]}))}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]),e}();function Te(e,t){e.delete(t),t.childNodes.forEach((function(t){return Te(e,t)}))}function Me(e,t,n){return 0!==e.length&&Ee(e,t,n)}function Ee(e,t,n){var r=t.parentNode;if(!r)return!1;var o=n.getId(r);return!!e.some((function(e){return e.id===o}))||Ee(e,r,n)}function Ne(e,t){return 0!==e.size&&Oe(e,t)}function Oe(e,t){var n=t.parentNode;return!!n&&(!!e.has(n)||Oe(e,n))}function Le(e){we=e}function Re(){we=void 0}var Fe=function(e){if(!we)return e;return function(){try{return e.apply(void 0,arguments)}catch(e){if(we&&!0===we(e))return;throw e}}},De=[];function qe(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Pe(e,t){var n,r,o=new Ae;De.push(o),o.init(e);var i=window.MutationObserver||window.__rrMutationObserver,a=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);var s=new i(Fe(o.processMutations.bind(o)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function He(e){var t=e.mouseInteractionCb,n=e.doc,r=e.mirror,o=e.blockClass,i=e.blockSelector,a=e.sampling;if(!1===a.mouseInteraction)return function(){};var s=!0===a.mouseInteraction||void 0===a.mouseInteraction?{}:a.mouseInteraction,c=[],u=null;return Object.keys(Ce).filter((function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]})).forEach((function(e){var a=S(e),s=function(e){return function(n){var a=qe(n);if(!se(a,o,i,!0)){var s=null,c=e;if("pointerType"in n){switch(n.pointerType){case"mouse":s=_e.Mouse;break;case"touch":s=_e.Touch;break;case"pen":s=_e.Pen}s===_e.Touch?Ce[e]===Ce.MouseDown?c="TouchStart":Ce[e]===Ce.MouseUp&&(c="TouchEnd"):_e.Pen}else le(n)&&(s=_e.Touch);null!==s?(u=s,(c.startsWith("Touch")&&s===_e.Touch||c.startsWith("Mouse")&&s===_e.Mouse)&&(s=null)):Ce[e]===Ce.Click&&(s=u,u=null);var l=le(n)?n.changedTouches[0]:n;if(l){var d=r.getId(a),p=l.clientX,f=l.clientY;Fe(t)(Object.assign({type:Ce[c],id:d,x:p,y:f},null!==s&&{pointerType:s}))}}}}(e);if(window.PointerEvent)switch(Ce[e]){case Ce.MouseDown:case Ce.MouseUp:a=a.replace("mouse","pointer");break;case Ce.TouchStart:case Ce.TouchEnd:return}c.push(Y(a,s,n))})),Fe((function(){c.forEach((function(e){return e()}))}))}function Be(e){var t=e.scrollCb,n=e.doc,r=e.mirror,o=e.blockClass,i=e.blockSelector,a=e.sampling;return Y("scroll",Fe($(Fe((function(e){var a=qe(e);if(a&&!se(a,o,i,!0)){var s=r.getId(a);if(a===n&&n.defaultView){var c=re(n.defaultView);t({id:s,x:c.left,y:c.top})}else t({id:s,x:a.scrollLeft,y:a.scrollTop})}})),a.scroll||100)),n)}var We=["INPUT","TEXTAREA","SELECT"],Ze=new WeakMap;function Ve(e){return function(e,t){if(Ke("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ke("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ke("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ke("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){var n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){var r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function Ue(e,t,n){var r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function je(e,t){var n,r,o,i=e.mirror,a=e.stylesheetManager,s=null;s="#document"===t.nodeName?i.getId(t):i.getId(t.host);var c="#document"===t.nodeName?null===(n=t.defaultView)||void 0===n?void 0:n.Document:null===(o=null===(r=t.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===o?void 0:o.ShadowRoot,u=(null==c?void 0:c.prototype)?Object.getOwnPropertyDescriptor(null==c?void 0:c.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&c&&u?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:function(){var e;return null===(e=u.get)||void 0===e?void 0:e.call(this)},set:function(e){var t,n=null===(t=u.set)||void 0===t?void 0:t.call(this,e);if(null!==s&&-1!==s)try{a.adoptStyleSheets(e,s)}catch(e){}return n}}),Fe((function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:u.configurable,enumerable:u.enumerable,get:u.get,set:u.set})}))):function(){}}function Ge(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.doc.defaultView;if(!r)return function(){};!function(e,t){var n=e.mutationCb,r=e.mousemoveCb,o=e.mouseInteractionCb,i=e.scrollCb,a=e.viewportResizeCb,s=e.inputCb,c=e.mediaInteractionCb,u=e.styleSheetRuleCb,l=e.styleDeclarationCb,d=e.canvasMutationCb,p=e.fontCb,f=e.selectionCb,h=e.customElementCb;e.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},e.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),r.apply(void 0,arguments)},e.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),o.apply(void 0,arguments)},e.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),i.apply(void 0,arguments)},e.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),a.apply(void 0,arguments)},e.inputCb=function(){t.input&&t.input.apply(t,arguments),s.apply(void 0,arguments)},e.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),c.apply(void 0,arguments)},e.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),u.apply(void 0,arguments)},e.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),l.apply(void 0,arguments)},e.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),d.apply(void 0,arguments)},e.fontCb=function(){t.font&&t.font.apply(t,arguments),p.apply(void 0,arguments)},e.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),f.apply(void 0,arguments)},e.customElementCb=function(){t.customElement&&t.customElement.apply(t,arguments),h.apply(void 0,arguments)}}(e,n),e.recordDOM&&(t=Pe(e,e.doc));var o=function(e){var t=e.mousemoveCb,n=e.sampling,r=e.doc,o=e.mirror;if(!1===n.mousemove)return function(){};var i,a="number"==typeof n.mousemove?n.mousemove:50,s="number"==typeof n.mousemoveCallback?n.mousemoveCallback:500,c=[],u=$(Fe((function(e){var n=Date.now()-i;t(c.map((function(e){return e.timeOffset-=n,e})),e),c=[],i=null})),s),l=Fe($(Fe((function(e){var t=qe(e),n=le(e)?e.changedTouches[0]:e,r=n.clientX,a=n.clientY;i||(i=ne()),c.push({x:r,y:a,id:o.getId(t),timeOffset:ne()-i}),u("undefined"!=typeof DragEvent&&e instanceof DragEvent?be.Drag:e instanceof MouseEvent?be.MouseMove:be.TouchMove)})),a,{trailing:!1})),d=[Y("mousemove",l,r),Y("touchmove",l,r),Y("drag",l,r)];return Fe((function(){d.forEach((function(e){return e()}))}))}(e),i=He(e),a=Be(e),s=function(e,t){var n=e.viewportResizeCb,r=t.win,o=-1,i=-1;return Y("resize",Fe($(Fe((function(){var e=oe(),t=ie();o===e&&i===t||(n({width:Number(t),height:Number(e)}),o=e,i=t)})),200)),r)}(e,{win:r}),c=function(e){var t=e.inputCb,n=e.doc,r=e.mirror,o=e.blockClass,i=e.blockSelector,a=e.ignoreClass,s=e.ignoreSelector,c=e.maskInputOptions,u=e.maskInputFn,l=e.sampling,p=e.userTriggeredOnInput;function f(e){var t=qe(e),r=e.isTrusted,l=t&&t.tagName;if(t&&"OPTION"===l&&(t=t.parentElement),t&&l&&!(We.indexOf(l)<0)&&!se(t,o,i,!0)&&!(t.classList.contains(a)||s&&t.matches(s))){var d=t.value,f=!1,g=k(t)||"";"radio"===g||"checkbox"===g?f=t.checked:(c[l.toLowerCase()]||c[g])&&(d=I({element:t,maskInputOptions:c,tagName:l,type:g,value:d,maskInputFn:u})),h(t,p?{text:d,isChecked:f,userTriggered:r}:{text:d,isChecked:f});var v=t.name;"radio"===g&&v&&f&&n.querySelectorAll('input[type="radio"][name="'.concat(v,'"]')).forEach((function(e){if(e!==t){var n=e.value;h(e,p?{text:n,isChecked:!f,userTriggered:!1}:{text:n,isChecked:!f})}}))}}function h(e,n){var o=Ze.get(e);if(!o||o.text!==n.text||o.isChecked!==n.isChecked){Ze.set(e,n);var i=r.getId(e);Fe(t)(Object.assign(Object.assign({},n),{id:i}))}}var g=("last"===l.input?["change"]:["input","change"]).map((function(e){return Y(e,Fe(f),n)})),v=n.defaultView;if(!v)return function(){g.forEach((function(e){return e()}))};var m=v.Object.getOwnPropertyDescriptor(v.HTMLInputElement.prototype,"value"),y=[[v.HTMLInputElement.prototype,"value"],[v.HTMLInputElement.prototype,"checked"],[v.HTMLSelectElement.prototype,"value"],[v.HTMLTextAreaElement.prototype,"value"],[v.HTMLSelectElement.prototype,"selectedIndex"],[v.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&g.push.apply(g,d(y.map((function(e){return ee(e[0],e[1],{set:function(){Fe(f)({target:this,isTrusted:!1})}},!1,v)})))),Fe((function(){g.forEach((function(e){return e()}))}))}(e),u=function(e){var t=e.mediaInteractionCb,n=e.blockClass,r=e.blockSelector,o=e.mirror,i=e.sampling,a=e.doc,s=Fe((function(e){return $(Fe((function(i){var a=qe(i);if(a&&!se(a,n,r,!0)){var s=a.currentTime,c=a.volume,u=a.muted,l=a.playbackRate,d=a.loop;t({type:e,id:o.getId(a),currentTime:s,volume:c,muted:u,playbackRate:l,loop:d})}})),i.media||500)})),c=[Y("play",s(0),a),Y("pause",s(1),a),Y("seeked",s(2),a),Y("volumechange",s(3),a),Y("ratechange",s(4),a)];return Fe((function(){c.forEach((function(e){return e()}))}))}(e),p=function(){},f=function(){},g=function(){},v=function(){};e.recordDOM&&(p=function(e,t){var n=e.styleSheetRuleCb,r=e.mirror,o=e.stylesheetManager,i=t.win;if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return function(){};var a=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(a,{apply:Fe((function(e,t,i){var a=l(i,2),s=a[0],c=a[1],u=Ue(t,r,o.styleMirror),d=u.id,p=u.styleId;return(d&&-1!==d||p&&-1!==p)&&n({id:d,styleId:p,adds:[{rule:s,index:c}]}),e.apply(t,i)}))});var s,c,u=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=new Proxy(u,{apply:Fe((function(e,t,i){var a=l(i,1)[0],s=Ue(t,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,removes:[{index:a}]}),e.apply(t,i)}))}),i.CSSStyleSheet.prototype.replace&&(s=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Fe((function(e,t,i){var a=l(i,1)[0],s=Ue(t,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,replace:a}),e.apply(t,i)}))})),i.CSSStyleSheet.prototype.replaceSync&&(c=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:Fe((function(e,t,i){var a=l(i,1)[0],s=Ue(t,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,replaceSync:a}),e.apply(t,i)}))}));var p={};Qe("CSSGroupingRule")?p.CSSGroupingRule=i.CSSGroupingRule:(Qe("CSSMediaRule")&&(p.CSSMediaRule=i.CSSMediaRule),Qe("CSSConditionRule")&&(p.CSSConditionRule=i.CSSConditionRule),Qe("CSSSupportsRule")&&(p.CSSSupportsRule=i.CSSSupportsRule));var f={};return Object.entries(p).forEach((function(e){var t=l(e,2),i=t[0],a=t[1];f[i]={insertRule:a.prototype.insertRule,deleteRule:a.prototype.deleteRule},a.prototype.insertRule=new Proxy(f[i].insertRule,{apply:Fe((function(e,t,i){var a=l(i,2),s=a[0],c=a[1],u=Ue(t.parentStyleSheet,r,o.styleMirror),p=u.id,f=u.styleId;return(p&&-1!==p||f&&-1!==f)&&n({id:p,styleId:f,adds:[{rule:s,index:[].concat(d(Ve(t)),[c||0])}]}),e.apply(t,i)}))}),a.prototype.deleteRule=new Proxy(f[i].deleteRule,{apply:Fe((function(e,t,i){var a=l(i,1)[0],s=Ue(t.parentStyleSheet,r,o.styleMirror),c=s.id,u=s.styleId;return(c&&-1!==c||u&&-1!==u)&&n({id:c,styleId:u,removes:[{index:[].concat(d(Ve(t)),[a])}]}),e.apply(t,i)}))})})),Fe((function(){i.CSSStyleSheet.prototype.insertRule=a,i.CSSStyleSheet.prototype.deleteRule=u,s&&(i.CSSStyleSheet.prototype.replace=s),c&&(i.CSSStyleSheet.prototype.replaceSync=c),Object.entries(p).forEach((function(e){var t=l(e,2),n=t[0],r=t[1];r.prototype.insertRule=f[n].insertRule,r.prototype.deleteRule=f[n].deleteRule}))}))}(e,{win:r}),f=je(e,e.doc),g=function(e,t){var n=e.styleDeclarationCb,r=e.mirror,o=e.ignoreCSSAttributes,i=e.stylesheetManager,a=t.win,s=a.CSSStyleDeclaration.prototype.setProperty;a.CSSStyleDeclaration.prototype.setProperty=new Proxy(s,{apply:Fe((function(e,t,a){var c,u=l(a,3),d=u[0],p=u[1],f=u[2];if(o.has(d))return s.apply(t,[d,p,f]);var h=Ue(null===(c=t.parentRule)||void 0===c?void 0:c.parentStyleSheet,r,i.styleMirror),g=h.id,v=h.styleId;return(g&&-1!==g||v&&-1!==v)&&n({id:g,styleId:v,set:{property:d,value:p,priority:f},index:Ve(t.parentRule)}),e.apply(t,a)}))});var c=a.CSSStyleDeclaration.prototype.removeProperty;return a.CSSStyleDeclaration.prototype.removeProperty=new Proxy(c,{apply:Fe((function(e,t,a){var s,u=l(a,1)[0];if(o.has(u))return c.apply(t,[u]);var d=Ue(null===(s=t.parentRule)||void 0===s?void 0:s.parentStyleSheet,r,i.styleMirror),p=d.id,f=d.styleId;return(p&&-1!==p||f&&-1!==f)&&n({id:p,styleId:f,remove:{property:u},index:Ve(t.parentRule)}),e.apply(t,a)}))}),Fe((function(){a.CSSStyleDeclaration.prototype.setProperty=s,a.CSSStyleDeclaration.prototype.removeProperty=c}))}(e,{win:r}),e.collectFonts&&(v=function(e){var t=e.fontCb,n=e.doc,r=n.defaultView;if(!r)return function(){};var o=[],i=new WeakMap,a=r.FontFace;r.FontFace=function(e,t,n){var r=new a(e,t,n);return i.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};var s=te(n.fonts,"add",(function(e){return function(n){return setTimeout(Fe((function(){var e=i.get(n);e&&(t(e),i.delete(n))})),0),e.apply(this,[n])}}));return o.push((function(){r.FontFace=a})),o.push(s),Fe((function(){o.forEach((function(e){return e()}))}))}(e)));var m,y=function(e){var t=e.doc,n=e.mirror,r=e.blockClass,o=e.blockSelector,i=e.selectionCb,a=!0,s=Fe((function(){var e=t.getSelection();if(!(!e||a&&(null==e?void 0:e.isCollapsed))){a=e.isCollapsed||!1;for(var s=[],c=e.rangeCount||0,u=0;u<c;u++){var l=e.getRangeAt(u),d=l.startContainer,p=l.startOffset,f=l.endContainer,h=l.endOffset;se(d,r,o,!0)||se(f,r,o,!0)||s.push({start:n.getId(d),startOffset:p,end:n.getId(f),endOffset:h})}i({ranges:s})}}));return s(),Y("selectionchange",s)}(e),b=function(e){var t=e.doc,n=e.customElementCb,r=t.defaultView;return r&&r.customElements?te(r.customElements,"define",(function(e){return function(t,r,o){try{n({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return e.apply(this,[t,r,o])}})):function(){}}(e),C=[],_=h(e.plugins);try{for(_.s();!(m=_.n()).done;){var S=m.value;C.push(S.observer(S.callback,r,S.options))}}catch(e){_.e(e)}finally{_.f()}return Fe((function(){De.forEach((function(e){return e.reset()})),null==t||t.disconnect(),o(),i(),a(),s(),c(),u(),p(),f(),g(),v(),y(),b(),C.forEach((function(e){return e()}))}))}function Ke(e){return void 0!==window[e]}function Qe(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ze=function(){function e(t){a(this,e),this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}return c(e,[{key:"getId",value:function(e,t,n,r){var o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e),a=o.get(t);return a||(a=this.generateIdFn(),o.set(t,a),i.set(a,t)),a}},{key:"getIds",value:function(e,t){var n=this,r=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getId(e,t,r,o)}))}},{key:"getRemoteId",value:function(e,t,n){var r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;var o=r.get(t);return o||-1}},{key:"getRemoteIds",value:function(e,t){var n=this,r=this.getRemoteIdToIdMap(e);return t.map((function(t){return n.getRemoteId(e,t,r)}))}},{key:"reset",value:function(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),e}(),Ye=function(){function e(t){a(this,e),this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new ze(O),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ze(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}return c(e,[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;if("rrweb"===t.data.type&&t.origin===t.data.origin&&e.source){var n=this.crossOriginIframeMap.get(e.source);if(n){var r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}}}},{key:"transformCrossOriginEvent",value:function(e,t){var n,r=this;switch(t.type){case ye.FullSnapshot:this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);var o=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,o),this.patchRootIdOnNode(t.data.node,o),{timestamp:t.timestamp,type:ye.IncrementalSnapshot,data:{source:be.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case ye.Meta:case ye.Load:case ye.DomContentLoaded:return!1;case ye.Plugin:return t;case ye.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ye.IncrementalSnapshot:switch(t.data.source){case be.Mutation:return t.data.adds.forEach((function(t){r.replaceIds(t,e,["parentId","nextId","previousId"]),r.replaceIdOnNode(t.node,e);var n=r.crossOriginIframeRootIdMap.get(e);n&&r.patchRootIdOnNode(t.node,n)})),t.data.removes.forEach((function(t){r.replaceIds(t,e,["parentId","id"])})),t.data.attributes.forEach((function(t){r.replaceIds(t,e,["id"])})),t.data.texts.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case be.Drag:case be.TouchMove:case be.MouseMove:return t.data.positions.forEach((function(t){r.replaceIds(t,e,["id"])})),t;case be.ViewportResize:return!1;case be.MediaInteraction:case be.MouseInteraction:case be.Scroll:case be.CanvasMutation:case be.Input:return this.replaceIds(t.data,e,["id"]),t;case be.StyleSheetRule:case be.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case be.Font:return t;case be.Selection:return t.data.ranges.forEach((function(t){r.replaceIds(t,e,["start","end"])})),t;case be.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach((function(t){r.replaceStyleIds(t,e,["styleId"])})),t}}return!1}},{key:"replace",value:function(e,t,n,r){var o,i=h(r);try{for(i.s();!(o=i.n()).done;){var a=o.value;(Array.isArray(t[a])||"number"==typeof t[a])&&(Array.isArray(t[a])?t[a]=e.getIds(n,t[a]):t[a]=e.getId(n,t[a]))}}catch(e){i.e(e)}finally{i.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((function(e){n.replaceIdOnNode(e,t)}))}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===g.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach((function(e){n.patchRootIdOnNode(e,t)}))}}]),e}(),Je=function(){function e(t){a(this,e),this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}return c(e,[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n=this;if(y(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);var r=Pe(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e);this.restoreHandlers.push((function(){return r.disconnect()})),this.restoreHandlers.push(Be(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout((function(){e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&n.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,n.mirror.getId(e.host)),n.restoreHandlers.push(je({mirror:n.mirror,stylesheetManager:n.bypassOptions.stylesheetManager},e))}),0)}}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,t){var n=this;this.restoreHandlers.push(te(e.prototype,"attachShadow",(function(e){return function(r){var o=e.call(this,r);return this.shadowRoot&&me(this)&&n.addShadowRoot(this.shadowRoot,t),o}})))}},{key:"reset",value:function(){this.restoreHandlers.forEach((function(e){try{e()}catch(e){}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),e}();function Xe(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}for(var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",et="undefined"==typeof Uint8Array?[]:new Uint8Array(256),tt=0;tt<64;tt++)et[$e.charCodeAt(tt)]=tt;var nt=new Map;var rt=function(e,t,n){if(e&&(at(e,t)||"object"===r(e))){var o=function(e,t){var n=nt.get(e);return n||(n=new Map,nt.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name),i=o.indexOf(e);return-1===i&&(i=o.length,o.push(e)),i}};function ot(e,t,n){if(e instanceof Array)return e.map((function(e){return ot(e,t,n)}));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){var o=e.constructor.name,i=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=$e[n[t]>>2],o+=$e[(3&n[t])<<4|n[t+1]>>4],o+=$e[(15&n[t+1])<<2|n[t+2]>>6],o+=$e[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:o,base64:i}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[ot(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement)return{rr_type:e.constructor.name,src:e.src};if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}return e instanceof ImageData?{rr_type:e.constructor.name,args:[ot(e.data,t,n),e.width,e.height]}:at(e,t)||"object"===r(e)?{rr_type:e.constructor.name,index:rt(e,t,n)}:e}var it=function(e,t,n){return e.map((function(e){return ot(e,t,n)}))},at=function(e,t){var n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((function(e){return"function"==typeof t[e]}));return Boolean(n.find((function(n){return e instanceof t[n]})))};function st(e,t,n,o){var i=[];try{var a=te(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(i){for(var a=arguments.length,s=new Array(a>1?a-1:0),c=1;c<a;c++)s[c-1]=arguments[c];if(!se(this,t,n,!0)){var u=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=u),o&&["webgl","webgl2"].includes(u))if(s[0]&&"object"===r(s[0])){var l=s[0];l.preserveDrawingBuffer||(l.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i].concat(s))}}));i.push(a)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){i.forEach((function(e){return e()}))}}function ct(e,t,n,r,o,i,a){var s,c=[],u=h(Object.getOwnPropertyNames(e));try{var l=function(){var i=s.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))return"continue";try{if("function"!=typeof e[i])return"continue";var u=te(e,i,(function(e){return function(){for(var s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];var l=e.apply(this,c);if(rt(l,a,this),"tagName"in this.canvas&&!se(this.canvas,r,o,!0)){var d=it(c,a,this),p={type:t,property:i,args:d};n(this.canvas,p)}return l}}));c.push(u)}catch(r){var l=ee(e,i,{set:function(e){n(this.canvas,{type:t,property:i,args:[e],setter:!0})}});c.push(l)}};for(u.s();!(s=u.n()).done;)l()}catch(e){u.e(e)}finally{u.f()}return c}function ut(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),i=o.indexOf("\n",10)+1,a=o.substring(i)+(r?"//# sourceMappingURL="+r:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}var lt,dt,pt,ft,ht,gt,vt,mt=(lt="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",dt=null,pt=!1,function(e){return ft=ft||ut(lt,dt,pt),new Worker(ft,e)}),yt=function(){function e(t){var n=this;a(this,e),this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=function(e,t){!(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId)&&n.rafStamps.invokeId||(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)};var r=t.sampling,o=void 0===r?"all":r,i=t.win,s=t.blockClass,c=t.blockSelector,u=t.recordCanvas,l=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,u&&"all"===o&&this.initCanvasMutationObserver(i,s,c),u&&"number"==typeof o&&this.initCanvasFPSObserver(o,i,s,c,{dataURLOptions:l})}return c(e,[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,t,r,o,i){var a=this,s=st(t,r,o,!0),c=new Map,u=new mt;u.onmessage=function(e){var t=e.data.id;if(c.set(t,!1),"base64"in e.data){var n=e.data,r=n.base64,o=n.type,i=n.width,s=n.height;a.mutationCb({id:t,type:Ie["2D"],commands:[{property:"clearRect",args:[0,0,i,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:o}]},0,0]}]})}};var l,d=1e3/e,p=0;l=requestAnimationFrame((function e(s){var f;p&&s-p<d?l=requestAnimationFrame(e):(p=s,(f=[],function e(t){t.querySelectorAll("canvas").forEach((function(e){se(e,r,o,!0)||f.push(e)})),t.querySelectorAll("*").forEach((function(t){t.shadowRoot&&e(t.shadowRoot)}))}(t.document),f).forEach((function(e){return Xe(a,void 0,void 0,n().mark((function t(){var r,o,a,s,l,d;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=this.mirror.getId(e),!c.get(o)){t.next=3;break}return t.abrupt("return");case 3:if(0!==e.width&&0!==e.height){t.next=5;break}return t.abrupt("return");case 5:return c.set(o,!0),["webgl","webgl2"].includes(e.__context)&&(a=e.getContext(e.__context),!1===(null===(r=null==a?void 0:a.getContextAttributes())||void 0===r?void 0:r.preserveDrawingBuffer)&&a.clear(a.COLOR_BUFFER_BIT)),s=e.clientWidth||e.width,l=e.clientHeight||e.height,t.next=11,createImageBitmap(e,{resizeWidth:s,resizeHeight:l});case 11:d=t.sent,u.postMessage({id:o,bitmap:d,width:s,height:l,dataURLOptions:i.dataURLOptions},[d]);case 13:case"end":return t.stop()}}),t,this)})))})),l=requestAnimationFrame(e))})),this.resetObservers=function(){s(),cancelAnimationFrame(l)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r=st(e,t,n,!1),o=function(e,t,n,r){var o,i=[],a=h(Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype));try{var s=function(){var a=o.value;try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])return"continue";var s=te(t.CanvasRenderingContext2D.prototype,a,(function(o){return function(){for(var i=this,s=arguments.length,c=new Array(s),u=0;u<s;u++)c[u]=arguments[u];return se(this.canvas,n,r,!0)||setTimeout((function(){var n=it(c,t,i);e(i.canvas,{type:Ie["2D"],property:a,args:n})}),0),o.apply(this,c)}}));i.push(s)}catch(n){var c=ee(t.CanvasRenderingContext2D.prototype,a,{set:function(t){e(this.canvas,{type:Ie["2D"],property:a,args:[t],setter:!0})}});i.push(c)}};for(a.s();!(o=a.n()).done;)s()}catch(e){a.e(e)}finally{a.f()}return function(){i.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r,o){var i=[];return i.push.apply(i,d(ct(t.WebGLRenderingContext.prototype,Ie.WebGL,e,n,r,0,t))),void 0!==t.WebGL2RenderingContext&&i.push.apply(i,d(ct(t.WebGL2RenderingContext.prototype,Ie.WebGL2,e,n,r,0,t))),function(){i.forEach((function(e){return e()}))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=function(){r(),o(),i()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"startRAFTimestamping",value:function(){var e=this;requestAnimationFrame((function t(n){e.rafStamps.latestId=n,requestAnimationFrame(t)}))}},{key:"flushPendingCanvasMutations",value:function(){var e=this;this.pendingCanvasMutations.forEach((function(t,n){var r=e.mirror.getId(n);e.flushPendingCanvasMutationFor(n,r)})),requestAnimationFrame((function(){return e.flushPendingCanvasMutations()}))}},{key:"flushPendingCanvasMutationFor",value:function(e,t){if(!this.frozen&&!this.locked){var n=this.pendingCanvasMutations.get(e);if(n&&-1!==t){var r=n.map((function(e){var t=
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -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 o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t})),o=n[0].type;this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),bt=function(){function e(t){a(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new he,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return c(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:[]},o=[],i=h(e);try{for(i.s();!(n=i.n()).done;){var a=n.value,s=void 0;this.styleMirror.has(a)?s=this.styleMirror.getId(a):(s=this.styleMirror.add(a),o.push({styleId:s,rules:Array.from(a.rules||CSSRule,(function(e,t){return{rule:C(e),index:t}}))})),r.styleIds.push(s)}}catch(e){i.e(e)}finally{i.f()}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),Ct=function(){function e(){a(this,e),this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}return c(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 _t(e){return Object.assign(Object.assign({},e),{timestamp:ne()})}var It=!1,St=new _;function wt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,o=e.blockClass,i=void 0===o?"rr-block":o,a=e.blockSelector,s=void 0===a?null:a,c=e.ignoreClass,u=void 0===c?"rr-ignore":c,l=e.ignoreSelector,d=void 0===l?null:l,p=e.maskTextClass,f=void 0===p?"rr-mask":p,g=e.maskTextSelector,v=void 0===g?null:g,m=e.inlineStylesheet,y=void 0===m||m,b=e.maskAllInputs,C=e.maskInputOptions,I=e.slimDOMOptions,S=e.maskInputFn,w=e.maskTextFn,k=e.hooks,x=e.packFn,A=e.sampling,T=void 0===A?{}:A,M=e.dataURLOptions,E=void 0===M?{}:M,N=e.mousemoveWait,O=e.recordDOM,L=void 0===O||O,R=e.recordCanvas,F=void 0!==R&&R,D=e.recordCrossOriginIframes,q=void 0!==D&&D,P=e.recordAfter,H=void 0===P?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":P,B=e.userTriggeredOnInput,Z=void 0!==B&&B,W=e.collectFonts,V=void 0!==W&&W,U=e.inlineImages,j=void 0!==U&&U,G=e.plugins,K=e.keepIframeSrcFn,Q=void 0===K?function(){return!1}:K,J=e.ignoreCSSAttributes,X=void 0===J?new Set([]):J;Le(e.errorHandler);var $=!q||window.parent===window,ee=!1;if(!$)try{window.parent.document&&(ee=!1)}catch(e){ee=!0}if($&&!t)throw new Error("emit function is required");void 0!==N&&void 0===T.mousemove&&(T.mousemove=N),St.reset();var te,ne=!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}:void 0!==C?C:{password:!0},ae=!0===I||"all"===I?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===I,headMetaDescKeywords:"all"===I}:I||{};!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 o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}();var se=0,ce=function(e){var t,n=h(G||[]);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,o){var i;if(!(null===(i=De[0])||void 0===i?void 0:i.isFrozen())||e.type===ye.FullSnapshot||e.type===ye.IncrementalSnapshot&&e.data.source===be.Mutation||De.forEach((function(e){return e.unfreeze()})),$)null==t||t(ce(e),o);else if(ee){var a={type:"rrweb",event:ce(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(a,"*")}if(e.type===ye.FullSnapshot)te=e,se=0;else if(e.type===ye.IncrementalSnapshot){if(e.data.source===be.Mutation&&e.data.isAttachIframe)return;se++;var s=r&&se>=r,c=n&&e.timestamp-te.timestamp>n;(s||c)&>(!0)}};var ue,le=function(e){ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.Mutation},e)}))},he=function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.Scroll},e)}))},ge=function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.CanvasMutation},e)}))},ve=new bt({mutationCb:le,adoptedStyleSheetCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.AdoptedStyleSheet},e)}))}}),me=new Ye({mirror:St,mutationCb:le,stylesheetManager:ve,recordCrossOriginIframes:q,wrappedEmit:ht}),Ce=h(G||[]);try{for(Ce.s();!(ue=Ce.n()).done;){var _e=ue.value;_e.getMirror&&_e.getMirror({nodeMirror:St,crossOriginIframeMirror:me.crossOriginIframeMirror,crossOriginIframeStyleMirror:me.crossOriginIframeStyleMirror})}}catch(e){Ce.e(e)}finally{Ce.f()}var Ie=new Ct;vt=new yt({recordCanvas:F,mutationCb:ge,win:window,blockClass:i,blockSelector:s,mirror:St,sampling:T.canvas,dataURLOptions:E});var Se=new Je({mutationCb:le,scrollCb:he,bypassOptions:{blockClass:i,blockSelector:s,maskTextClass:f,maskTextSelector:v,inlineStylesheet:y,maskInputOptions:ne,dataURLOptions:E,maskTextFn:w,maskInputFn:S,recordCanvas:F,inlineImages:j,sampling:T,slimDOMOptions:ae,iframeManager:me,stylesheetManager:ve,canvasManager:vt,keepIframeSrcFn:Q,processedNodeManager:Ie},mirror:St});gt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(L){ht(_t({type:ye.Meta,data:{href:window.location.href,width:ie(),height:oe()}}),e),ve.reset(),Se.init(),De.forEach((function(e){return e.lock()}));var t=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new _:r,i=n.blockClass,a=void 0===i?"rr-block":i,s=n.blockSelector,c=void 0===s?null:s,u=n.maskTextClass,l=void 0===u?"rr-mask":u,d=n.maskTextSelector,p=void 0===d?null:d,f=n.inlineStylesheet,h=void 0===f||f,g=n.inlineImages,v=void 0!==g&&g,m=n.recordCanvas,y=void 0!==m&&m,b=n.maskAllInputs,C=void 0!==b&&b,I=n.maskTextFn,S=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,x=n.dataURLOptions,A=n.preserveWhiteSpace,T=n.onSerialize,M=n.onIframeLoad,E=n.iframeLoadTimeout,N=n.onStylesheetLoad,O=n.stylesheetLoadTimeout,L=n.keepIframeSrcFn;return z(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:l,maskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===C?{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===C?{password:!0}:C,maskTextFn:I,maskInputFn:S,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:x,inlineImages:v,recordCanvas:y,preserveWhiteSpace:A,onSerialize:T,onIframeLoad:M,iframeLoadTimeout:E,onStylesheetLoad:N,stylesheetLoadTimeout:O,keepIframeSrcFn:void 0===L?function(){return!1}:L,newlyAddedElement:!1})}(document,{mirror:St,blockClass:i,blockSelector:s,maskTextClass:f,maskTextSelector:v,inlineStylesheet:y,maskAllInputs:ne,maskTextFn:w,slimDOM:ae,dataURLOptions:E,recordCanvas:F,inlineImages:j,onSerialize:function(e){de(e,St)&&me.addIframe(e),pe(e,St)&&ve.trackLinkElement(e),fe(e)&&Se.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){me.attachIframe(e,t),Se.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ve.attachLinkElement(e,t)},keepIframeSrcFn:Q});if(!t)return console.warn("Failed to snapshot the document");ht(_t({type:ye.FullSnapshot,data:{node:t,initialOffset:re(window)}}),e),De.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ve.adoptStyleSheets(document.adoptedStyleSheets,St.getId(document))}};try{var we=[],ke=function(e){var t;return Fe(Ge)({mutationCb:le,mousemoveCb:function(e,t){return ht(_t({type:ye.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.MouseInteraction},e)}))},scrollCb:he,viewportResizeCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.ViewportResize},e)}))},inputCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.Input},e)}))},mediaInteractionCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.StyleDeclaration},e)}))},canvasMutationCb:ge,fontCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.Font},e)}))},selectionCb:function(e){ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.Selection},e)}))},customElementCb:function(e){ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.CustomElement},e)}))},blockClass:i,ignoreClass:u,ignoreSelector:d,maskTextClass:f,maskTextSelector:v,maskInputOptions:ne,inlineStylesheet:y,sampling:T,recordDOM:L,recordCanvas:F,inlineImages:j,userTriggeredOnInput:Z,collectFonts:V,doc:e,maskInputFn:S,maskTextFn:w,keepIframeSrcFn:Q,blockSelector:s,slimDOMOptions:ae,dataURLOptions:E,mirror:St,iframeManager:me,stylesheetManager:ve,shadowDomManager:Se,processedNodeManager:Ie,canvasManager:vt,ignoreCSSAttributes:X,plugins:(null===(t=null==G?void 0:G.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(_t({type:ye.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},k)};me.addLoadListener((function(e){try{we.push(ke(e.contentDocument))}catch(e){console.warn(e)}}));var xe=function(){gt(),we.push(ke(document)),It=!0};return"interactive"===document.readyState||"complete"===document.readyState?xe():(we.push(Y("DOMContentLoaded",(function(){ht(_t({type:ye.DomContentLoaded,data:{}})),"DOMContentLoaded"===H&&xe()}))),we.push(Y("load",(function(){ht(_t({type:ye.Load,data:{}})),"load"===H&&xe()}),window))),function(){we.forEach((function(e){return e()})),Ie.destroy(),It=!1,Re()}}catch(e){console.warn(e)}}wt.addCustomEvent=function(e,t){if(!It)throw new Error("please add custom event after start recording");ht(_t({type:ye.Custom,data:{tag:e,payload:t}}))},wt.freezePage=function(){De.forEach((function(e){return e.freeze()}))},wt.takeFullSnapshot=function(e){if(!It)throw new Error("please take full snapshot after start recording");gt(e)},wt.mirror=St;var kt=function(){function e(t){a(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return c(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+/,At=/^\s*at .*(\S+:\d+|\(native\))/m,Tt=/^(eval@)?(\[native code])?$/,Mt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(At)?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(At)}),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),o=this.extractLocation(n?n[1]:r.pop()),i=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new kt({functionName:i,fileName:a,lineNumber:o[1],columnNumber:o[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 kt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new kt({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[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=[],o=2,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new kt({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=[],o=0,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new kt({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 kt({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Et(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,o=[];if(r.children&&r.children.length>0)for(var i=0;i<r.children.length;i++){var a=r.children[i];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&o.push(a)}o.length>1&&(n+=":eq(".concat(o.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Nt(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ot(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(Nt(e[o])&&Ot(e[o],t-1))return!0}return!1}function Lt(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?o.splice(i,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.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(Nt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Nt(e)&&Ot(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 c=t[s];Array.isArray(c)?a[s]=Et(c.length?c[0]:null):a[s]=c}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 Rt={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 Ft(e,t,n){var r,o=n?Object.assign({},Rt,n):Rt,i=o.logger;if(!i)return function(){};r="string"==typeof i?t[i]:i;var a=0,s=!1,c=[];if(o.level.includes("error")){var u=function(t){var n=t.message,r=t.error,i=Mt.parse(r).map((function(e){return e.toString()})),a=[Lt(n,o.stringifyOptions)];e({level:"error",trace:i,payload:a})};t.addEventListener("error",u),c.push((function(){t.removeEventListener("error",u)}));var l=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Lt("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),o.stringifyOptions)]):(n=new Error,r=[Lt("Uncaught (in promise)",o.stringifyOptions),Lt(t.reason,o.stringifyOptions)]);var i=Mt.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:i,payload:r})};t.addEventListener("unhandledrejection",l),c.push((function(){t.removeEventListener("unhandledrejection",l)}))}var d,p=h(o.level);try{for(p.s();!(d=p.n()).done;){var f=d.value;c.push(g(r,f))}}catch(e){p.e(e)}finally{p.f()}return function(){c.forEach((function(e){return e()}))};function g(t,n){var r=this;return t[n]?te(t,n,(function(t){return function(){for(var i=arguments.length,c=new Array(i),u=0;u<i;u++)c[u]=arguments[u];if(t.apply(r,c),!s){s=!0;try{var l=Mt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=c.map((function(e){return Lt(e,o.stringifyOptions)}));++a<o.lengthThreshold?e({level:n,trace:l,payload:d}):a===o.lengthThreshold&&e({level:"warn",trace:[],payload:[Lt("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(c))}finally{s=!1}}}})):function(){}}}var Dt=function(e){return{name:"rrweb/console@1",observer:Ft,options:e}},qt=Array.isArray,Pt=Object.prototype,Ht=Pt.hasOwnProperty,Bt=Pt.toString,Zt=qt||function(e){return"[object Array]"===Bt.call(e)},Wt=function(e){return"function"==typeof e},Vt=function(e){return e===Object(e)&&!Zt(e)},Ut=function(e){return void 0===e},jt=function(e){return"[object String]"==Bt.call(e)},Gt=function(e){return jt(e)&&0===e.trim().length},Kt=function(e){return null===e},Qt=function(e){return Ut(e)||Kt(e)},zt=function(e){return"[object Number]"==Bt.call(e)},Yt=function(e){return"[object Boolean]"===Bt.call(e)},Jt=function(e){return e instanceof Document},Xt=function(e){return e instanceof FormData},$t="undefined"!=typeof window?window:void 0,en="undefined"!=typeof globalThis?globalThis:$t,tn=Array.prototype.forEach,nn=null==en?void 0:en.navigator,rn=null==en?void 0:en.document;null==en||en.location,null==en||en.fetch,null!=en&&en.XMLHttpRequest&&"withCredentials"in new en.XMLHttpRequest&&en.XMLHttpRequest,null==en||en.AbortController,null==nn||nn.userAgent;var on=null!=$t?$t:{},an="[PostHog.js]",sn={_log:function(e){if($t&&on.POSTHOG_DEBUG&&!Ut($t.console)&&$t.console){for(var t=("__rrweb_original__"in $t.console[e]?$t.console[e].__rrweb_original__:$t.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.apply(void 0,[an].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];sn._log.apply(sn,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];sn._log.apply(sn,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];sn._log.apply(sn,["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,[an].concat(n))},uninitializedWarning:function(e){sn.error("You must initialize PostHog before calling ".concat(e))}},cn={};function un(e,t,n){if(!Qt(e)){if(Zt(e))return function(e,t,n){if(Zt(e))if(tn&&e.forEach===tn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===cn)return}(e,t,n);if(Xt(e)){var r,o=h(e.entries());try{for(o.s();!(r=o.n()).done;){var i=r.value;if(t.call(n,i[1],i[0])===cn)return}}catch(e){o.e(e)}finally{o.f()}}else for(var a in e)if(Ht.call(e,a)&&t.call(n,e[a],a)===cn)return}}var ln=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",o=[];return un(e,(function(e,r){Ut(e)||Ut(r)||"undefined"===r||(t=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t)})),o.join(r)},dn={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"]};function pn(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return Wt(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}function fn(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),o={hostname:r,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==r||!r.trim().length)return o;var i,a=h(t.payloadHostDenyList);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(r.endsWith(s))return{hostname:r,isHostDenied:!0}}}catch(e){a.e(e)}finally{a.f()}return o}var hn=function(e){return"navigation"===e.entryType},gn=function(e){return"resource"===e.entryType};function vn(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function mn(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((function(e){return hn(e)||gn(e)&&n.initiatorTypes.includes(e.initiatorType)}));e({requests:r.flatMap((function(e){return wn({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0})})),isInitial:!0})}var o=new t.PerformanceObserver((function(t){var r=t.getEntries().filter((function(e){return hn(e)||gn(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 wn({entry:e,method:void 0,status:void 0,networkRequest:{}})}))})})),i=PerformanceObserver.supportedEntryTypes.filter((function(e){return n.performanceEntryTypeToObserve.includes(e)}));return o.observe({entryTypes:i}),function(){o.disconnect()}}function yn(e,t){return!!t&&(Yt(t)||t[e])}function bn(e){var t=e.type,n=e.recordBody,r=e.headers;function o(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(Yt(n))return!0;if(Zt(n))return o(n);var i=n[t];return Yt(i)?i:o(i)}function Cn(e,t,n,r,o){return _n.apply(this,arguments)}function _n(){return _n=i(n().mark((function e(t,r,o,i,a){var s,c,u,l=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((s=l.length>5&&void 0!==l[5]?l[5]:0)>10)){e.next=4;break}return sn.warn("Failed to get performance entry for request",{url:o,initiatorType:r}),e.abrupt("return",null);case 4:if(c=t.performance.getEntriesByName(o),u=vn(c,(function(e){return gn(e)&&e.initiatorType===r&&(Ut(i)||e.startTime>=i)&&(Ut(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",Cn(t,r,o,i,a,s+1));case 10:return e.abrupt("return",u);case 11:case"end":return e.stop()}}),e)}))),_n.apply(this,arguments)}function In(e){var t=e.body,n=e.options,r=e.url;if(Qt(t))return null;var o=fn(r,n),i=o.hostname;if(o.isHostDenied)return i+" is in deny list";if(jt(t))return t;if(Jt(t))return t.textContent;if(Xt(t))return ln(t);if(Vt(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 Sn=function(e){return!Kt(e)&&("navigation"===e.entryType||"resource"===e.entryType)};function wn(e){var n=e.entry,r=e.method,o=e.status,i=e.networkRequest,a=e.isInitial,s=e.start,c=e.end,u=e.url,l=e.initiatorType;s=n?n.startTime:s,c=n?n.responseEnd:c;var d=Math.floor(Date.now()-performance.now()),p=Math.floor(d+(s||0)),f=[t(t({},n?n.toJSON():{name:u}),{},{startTime:Ut(s)?void 0:Math.round(s),endTime:Ut(c)?void 0:Math.round(c),timeOrigin:d,timestamp:p,method:r,initiatorType:n?n.initiatorType:l,status:o,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:a})];if(Sn(n)){var g,v=h(n.serverTiming||[]);try{for(v.s();!(g=v.n()).done;){var m=g.value;f.push({timeOrigin:d,timestamp:p,startTime:Math.round(n.startTime),name:m.name,duration:m.duration,entryType:"serverTiming"})}}catch(e){v.e(e)}finally{v.f()}}return f}var kn=["video/","audio/"];function xn(e){var t,n=e.r,r=e.options,o=e.url;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var i=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),a=kn.some((function(e){return null==i?void 0:i.startsWith(e)}));if(i&&a)return"Content-Type ".concat(i," is not supported");var s=fn(o,r),c=s.hostname;return s.isHostDenied?c+" is in deny list":null}function An(e){return new Promise((function(t,n){var r=setTimeout((function(){return t("[SessionReplay] Timeout while trying to read body")}),500);try{e.clone().text().then((function(e){return t(e)}),(function(e){return n(e)})).finally((function(){return clearTimeout(r)}))}catch(e){clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}function Tn(e){return Mn.apply(this,arguments)}function Mn(){return Mn=i(n().mark((function e(t){var r,o,i,a,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.r,o=t.options,i=t.url,a=fn(i,o),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",An(r));case 5:case"end":return e.stop()}}),e)}))),Mn.apply(this,arguments)}function En(e){return Nn.apply(this,arguments)}function Nn(){return Nn=i(n().mark((function e(t){var r,o,i,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.r,o=t.options,i=t.url,a=xn({r:r,options:o,url:i}),Kt(a)){e.next=4;break}return e.abrupt("return",Promise.resolve(a));case 4:return e.abrupt("return",An(r));case 5:case"end":return e.stop()}}),e)}))),Nn.apply(this,arguments)}var On=null;function Ln(e,r,o){if(!("performance"in r))return function(){};if(On)return sn.warn("Network observer already initialised, doing nothing"),function(){};var a=o?Object.assign({},dn,o):dn,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}))},c=mn(s,r,a),u=function(){},l=function(){};return(a.recordHeaders||a.recordBody)&&(u=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return function(){};var r=yn("request",n.recordHeaders),o=yn("response",n.recordHeaders),i=pn(t.XMLHttpRequest.prototype,"open",(function(i){return function(a,s){var c,u,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,p=arguments.length>4?arguments[4]:void 0,f=this,h=new Request(s),g={},v={},m=f.setRequestHeader.bind(f);f.setRequestHeader=function(e,t){return v[e]=t,m(e,t)},r&&(g.requestHeaders=v);var y=f.send.bind(f);f.send=function(e){return bn({type:"request",headers:v,url:s,recordBody:n.recordBody})&&(g.requestBody=In({body:e,options:n,url:s})),c=t.performance.now(),y(e)},f.addEventListener("readystatechange",(function(){if(f.readyState===f.DONE){u=t.performance.now();var r={};f.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var t=e.split(": "),n=t.shift(),o=t.join(": ");n&&(r[n]=o)})),o&&(g.responseHeaders=r),bn({type:"response",headers:r,url:s,recordBody:n.recordBody})&&(g.responseBody=In({body:f.response,options:n,url:s})),Cn(t,"xmlhttprequest",h.url,c,u).then((function(t){var n=wn({entry:t,method:h.method,status:null==f?void 0:f.status,networkRequest:g,start:c,end:u,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((function(){}))}})),i.call(f,a,s,l,d,p)}}));return function(){i()}}(s,r,a),l=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return function(){};var o=yn("request",r.recordHeaders),a=yn("response",r.recordHeaders),s=pn(t,"fetch",(function(s){return function(){var c=i(n().mark((function i(c,u){var l,d,p,f,h,g,v;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(l=new Request(c,u),p={},n.prev=2,g={},l.headers.forEach((function(e,t){g[t]=e})),o&&(p.requestHeaders=g),!bn({type:"request",headers:g,url:c,recordBody:r.recordBody})){n.next=10;break}return n.next=9,Tn({r:l,options:r,url:c});case 9:p.requestBody=n.sent;case 10:return f=t.performance.now(),n.next=13,s(l);case 13:if(d=n.sent,h=t.performance.now(),v={},d.headers.forEach((function(e,t){v[t]=e})),a&&(p.responseHeaders=v),!bn({type:"response",headers:v,url:c,recordBody:r.recordBody})){n.next=22;break}return n.next=21,En({r:d,options:r,url:c});case 21:p.responseBody=n.sent;case 22:return n.abrupt("return",d);case 23:return n.prev=23,Cn(t,"fetch",l.url,f,h).then((function(t){var n,r=wn({entry:t,method:l.method,status:null===(n=d)||void 0===n?void 0:n.status,networkRequest:p,start:f,end:h,url:l.url,initiatorType:"fetch"});e({requests:r})})).catch((function(){})),n.finish(23);case 26:case"end":return n.stop()}}),i,null,[[2,,23,26]])})));return function(e,t){return c.apply(this,arguments)}}()}));return function(){s()}}(s,r,a)),On=function(){c(),u(),l()}}var Rn,Fn,Dn,qn=function(e){return{name:"rrweb/network@1",observer:Ln,options:e}};on.__PosthogExtensions__=on.__PosthogExtensions__||{},on.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Dt,getRecordNetworkPlugin:qn},on.__PosthogExtensions__.rrweb={record:wt,version:"v2",rrwebVersion:v},on.rrweb={record:wt,version:"v2",rrwebVersion:v},on.rrwebConsoleRecord={getRecordConsolePlugin:Dt},on.getRecordNetworkPlugin=qn,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Rn||(Rn={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Fn||(Fn={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Dn||(Dn={}));var Pn,Hn,Bn,Zn,Wn,Vn,Un,jn,Gn={},Kn=[],Qn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,zn=Array.isArray;function Yn(e,t){for(var n in t)e[n]=t[n];return e}function Jn(e){var t=e.parentNode;t&&t.removeChild(e)}function Xn(e,t,n){var r,o,i,a={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?Pn.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return $n(e,a,r,o,null)}function $n(e,t,n,r,o){var i={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==o?++Bn:o,__i:-1,__u:0};return null==o&&null!=Hn.vnode&&Hn.vnode(i),i}function er(e){return e.children}function tr(e,t){this.props=e,this.context=t}function nr(e,t){if(null==t)return e.__?nr(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?nr(e):null}function rr(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 rr(e)}}function or(e){(!e.__d&&(e.__d=!0)&&Zn.push(e)&&!ir.__r++||Wn!==Hn.debounceRendering)&&((Wn=Hn.debounceRendering)||Vn)(ir)}function ir(){var e,t,n,r,o,i,a,s,c;for(Zn.sort(Un);e=Zn.shift();)e.__d&&(t=Zn.length,r=void 0,i=(o=(n=e).__v).__e,s=[],c=[],(a=n.__P)&&((r=Yn({},o)).__v=o.__v+1,Hn.vnode&&Hn.vnode(r),fr(a,r,o,n.__n,void 0!==a.ownerSVGElement,32&o.__u?[i]:null,s,null==i?nr(o):i,!!(32&o.__u),c),r.__.__k[r.__i]=r,hr(s,r,c),r.__e!=i&&rr(r)),Zn.length>t&&Zn.sort(Un));ir.__r=0}function ar(e,t,n,r,o,i,a,s,c,u,l){var d,p,f,h,g,v=r&&r.__k||Kn,m=t.length;for(n.__d=c,function(e,t,n){var r,o,i,a,s,c=t.length,u=n.length,l=u,d=0;for(e.__k=[],r=0;r<c;r++)null!=(o=e.__k[r]=null==(o=t[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?$n(null,o,null,null,o):zn(o)?$n(er,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?$n(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,s=cr(o,n,a=r+d,l),o.__i=s,i=null,-1!==s&&(l--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&d--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?d++:s>a?l>c-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==r+d&&(o.__u|=65536))):(i=n[r])&&null==i.key&&i.__e&&(i.__e==e.__d&&(e.__d=nr(i)),vr(i,i,!1),n[r]=null,l--);if(l)for(r=0;r<u;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==e.__d&&(e.__d=nr(i)),vr(i,i))}(n,t,v),c=n.__d,d=0;d<m;d++)null!=(f=n.__k[d])&&"boolean"!=typeof f&&"function"!=typeof f&&(p=-1===f.__i?Gn:v[f.__i]||Gn,f.__i=d,fr(e,f,p,o,i,a,s,c,u,l),h=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&gr(p.ref,null,f),l.push(f.ref,f.__c||h,f)),null==g&&null!=h&&(g=h),65536&f.__u||p.__k===f.__k?c=sr(f,c,e):"function"==typeof f.type&&void 0!==f.__d?c=f.__d:h&&(c=h.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=c,n.__e=g}function sr(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=sr(r[o],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function cr(e,t,n,r){var o=e.key,i=e.type,a=n-1,s=n+1,c=t[n];if(null===c||c&&o==c.key&&i===c.type)return n;if(r>(null!=c&&0==(131072&c.__u)?1:0))for(;a>=0||s<t.length;){if(a>=0){if((c=t[a])&&0==(131072&c.__u)&&o==c.key&&i===c.type)return a;a--}if(s<t.length){if((c=t[s])&&0==(131072&c.__u)&&o==c.key&&i===c.type)return s;s++}}return-1}function ur(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Qn.test(t)?n:n+"px"}function lr(e,t,n,r,o){var i;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||ur(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||ur(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=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+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?pr:dr,i)):e.removeEventListener(t,i?pr:dr,i);else{if(o)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 dr(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Hn.event?Hn.event(e):e)}function pr(e){return this.l[e.type+!0](Hn.event?Hn.event(e):e)}function fr(e,t,n,r,o,i,a,s,c,u){var l,d,p,f,h,g,v,m,y,b,C,_,I,S,w,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(l=Hn.__b)&&l(t);e:if("function"==typeof k)try{if(m=t.props,y=(l=k.contextType)&&r[l.__c],b=l?y?y.props.value:l.__:r,n.__c?v=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(m,b):(t.__c=d=new tr(m,b),d.constructor=k,d.render=mr),y&&y.sub(d),d.props=m,d.state||(d.state={}),d.context=b,d.__n=r,p=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Yn({},d.__s)),Yn(d.__s,k.getDerivedStateFromProps(m,d.__s))),f=d.props,h=d.state,d.__v=t,p)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&m!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,b),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,b)||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)})),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,b),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(f,h,g)}))}if(d.context=b,d.props=m,d.__P=e,d.__e=!1,_=Hn.__r,I=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,_&&_(t),l=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,_&&_(t),l=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(r=Yn(Yn({},r),d.getChildContext())),p||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(f,h)),ar(e,zn(w=null!=l&&l.type===er&&null==l.key?l.props.children:l)?w:[w],t,n,r,o,i,a,s,c,u),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),v&&(d.__E=d.__=null)}catch(e){t.__v=null,c||null!=i?(t.__e=s,t.__u|=c?160:32,i[i.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),Hn.__e(e,t,n)}else null==i&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,o,i,a,s,c){var u,l,d,p,f,h,g,v=n.props,m=t.props,y=t.type;if("svg"===y&&(o=!0),null!=i)for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!y&&(y?f.localName===y:3===f.nodeType)){e=f,i[u]=null;break}if(null==e){if(null===y)return document.createTextNode(m);e=o?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,m.is&&m),i=null,s=!1}if(null===y)v===m||s&&e.data===m||(e.data=m);else{if(i=i&&Pn.call(e.childNodes),v=n.props||Gn,!s&&null!=i)for(v={},u=0;u<e.attributes.length;u++)v[(f=e.attributes[u]).name]=f.value;for(u in v)f=v[u],"children"==u||("dangerouslySetInnerHTML"==u?d=f:"key"===u||u in m||lr(e,u,null,f,o));for(u in m)f=m[u],"children"==u?p=f:"dangerouslySetInnerHTML"==u?l=f:"value"==u?h=f:"checked"==u?g=f:"key"===u||s&&"function"!=typeof f||v[u]===f||lr(e,u,f,v[u],o);if(l)s||d&&(l.__html===d.__html||l.__html===e.innerHTML)||(e.innerHTML=l.__html),t.__k=[];else if(d&&(e.innerHTML=""),ar(e,zn(p)?p:[p],t,n,r,o&&"foreignObject"!==y,i,a,i?i[0]:n.__k&&nr(n,0),s,c),null!=i)for(u=i.length;u--;)null!=i[u]&&Jn(i[u]);s||(u="value",void 0!==h&&(h!==e[u]||"progress"===y&&!h||"option"===y&&h!==v[u])&&lr(e,u,h,v[u],!1),u="checked",void 0!==g&&g!==e[u]&&lr(e,u,g,v[u],!1))}return e}(n.__e,t,n,r,o,i,a,c,u);(l=Hn.diffed)&&l(t)}function hr(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)gr(n[r],n[++r],n[++r]);Hn.__c&&Hn.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Hn.__e(e,t.__v)}}))}function gr(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Hn.__e(e,n)}}function vr(e,t,n){var r,o;if(Hn.unmount&&Hn.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||gr(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Hn.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&vr(r[o],t,n||"function"!=typeof e.type);n||null==e.__e||Jn(e.__e),e.__=e.__e=e.__d=void 0}function mr(e,t,n){return this.constructor(e,n)}function yr(e,t,n){var r,o,i,a;Hn.__&&Hn.__(e,t),o=(r="function"==typeof n)?null:n&&n.__k||t.__k,i=[],a=[],fr(t,e=(!r&&n||t).__k=Xn(er,null,[e]),o||Gn,Gn,void 0!==t.ownerSVGElement,!r&&n?[n]:o?null:t.firstChild?Pn.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,a),hr(i,e,a)}function br(e,t,n){var r,o,i,a,s=Yn({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==i?r=t[i]:"ref"==i?o=t[i]:s[i]=void 0===t[i]&&void 0!==a?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?Pn.call(arguments,2):n),$n(e.type,s,r||e.key,o||e.ref,null)}Pn=Kn.slice,Hn={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},Bn=0,tr.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Yn({},this.state),"function"==typeof e&&(e=e(Yn({},n),this.props)),e&&Yn(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),or(this))},tr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),or(this))},tr.prototype.render=er,Zn=[],Vn="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Un=function(e,t){return e.__v.__b-t.__v.__b},ir.__r=0,jn=0;var Cr=$t,_r=rn,Ir=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(wr((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 Sr(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 wr(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xr;"#"===t[0]&&(e=Sr(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=Sr(n)),!e)return"black";var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var o=parseInt(r[1]),i=parseInt(r[2]),a=parseInt(r[3]);return Math.sqrt(o*o*.299+i*i*.587+a*a*.114)>127.5?"black":"white"}return"black"}var kr={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"},xr="#eeeded",Ar=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;o&&(localStorage.setItem(Lr(r),"true"),o.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=o.get_session_replay_url)||void 0===e?void 0:e.call(o)},n),{},{$set:u({},Rr(r,"responded"),!0)})),Cr.dispatchEvent(new Event("PHSurveySent")))},Tr=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:u({},Rr(e,"dismissed"),!0)}),localStorage.setItem(Lr(e),"true"),Cr.dispatchEvent(new Event("PHSurveyClosed")))},Mr=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}))},Er=function(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))?t.reverse():t},Nr=function(e){return e.questions.forEach((function(e,t){e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?Er(e.questions,Mr(e.questions)):e.questions},Or=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,o,i,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===(o=e.conditions)||void 0===o||null===(i=o.events)||void 0===i||null===(a=i.values)||void 0===a?void 0:a.length)>0}(e))},Lr=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},Rr=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},Fr=function(e,t){var n={__c:t="__cC"+jn++,__: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,or(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}),Dr=function(e){var t=e.component,n=e.children,r=e.renderAsHtml,o=e.style;return br(t,r?{dangerouslySetInnerHTML:{__html:n},style:o}:{children:n,style:o})},qr=rn;var Pr,Hr,Br,Zr,Wr=0,Vr=[],Ur=[],jr=Hn.__b,Gr=Hn.__r,Kr=Hn.diffed,Qr=Hn.__c,zr=Hn.unmount;function Yr(e,t){Hn.__h&&Hn.__h(Hr,e,Wr||t),Wr=0;var n=Hr.__H||(Hr.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Ur}),n.__[e]}function Jr(e){return Wr=1,function(e,t,n){var r=Yr(Pr++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):co(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=Hr,!Hr.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var a=!1;return o.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)&&(!i||i.call(this,e,t,n))};Hr.u=!0;var i=Hr.shouldComponentUpdate,a=Hr.componentWillUpdate;Hr.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}a&&a.call(this,e,t,n)},Hr.shouldComponentUpdate=o}return r.__N||r.__}(co,e)}function Xr(e,t){var n=Yr(Pr++,3);!Hn.__s&&so(n.__H,t)&&(n.__=e,n.i=t,Hr.__H.__h.push(n))}function $r(e){return Wr=5,eo((function(){return{current:e}}),[])}function eo(e,t){var n=Yr(Pr++,7);return so(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function to(e){var t=Hr.context[e.__c],n=Yr(Pr++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Hr)),t.props.value):e.__}function no(){for(var e;e=Vr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(io),e.__H.__h.forEach(ao),e.__H.__h=[]}catch(t){e.__H.__h=[],Hn.__e(t,e.__v)}}Hn.__b=function(e){Hr=null,jr&&jr(e)},Hn.__r=function(e){Gr&&Gr(e),Pr=0;var t=(Hr=e.__c).__H;t&&(Br===Hr?(t.__h=[],Hr.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Ur,e.__N=e.i=void 0}))):(t.__h.forEach(io),t.__h.forEach(ao),t.__h=[],Pr=0)),Br=Hr},Hn.diffed=function(e){Kr&&Kr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Vr.push(t)&&Zr===Hn.requestAnimationFrame||((Zr=Hn.requestAnimationFrame)||oo)(no)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Ur&&(e.__=e.__V),e.i=void 0,e.__V=Ur}))),Br=Hr=null},Hn.__c=function(e,t){t.some((function(e){try{e.__h.forEach(io),e.__h=e.__h.filter((function(e){return!e.__||ao(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Hn.__e(n,e.__v)}})),Qr&&Qr(e,t)},Hn.unmount=function(e){zr&&zr(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{io(e)}catch(e){t=e}})),n.__H=void 0,t&&Hn.__e(t,n.__v))};var ro="function"==typeof requestAnimationFrame;function oo(e){var t,n=function(){clearTimeout(r),ro&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ro&&(t=requestAnimationFrame(n))}function io(e){var t=Hr,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Hr=t}function ao(e){var t=Hr;e.__c=e.__(),Hr=t}function so(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function co(e,t){return"function"==typeof t?t(e):t}var uo=0;function lo(e,t,n,r,o,i){var a,s,c={};for(s in t)"ref"==s?a=t[s]:c[s]=t[s];var u={type:e,props:c,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--uo,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof e&&(a=e.defaultProps))for(s in a)void 0===c[s]&&(c[s]=a[s]);return Hn.vnode&&Hn.vnode(u),u}var po=lo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:lo("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"})}),fo=lo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:lo("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"})}),ho=lo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:lo("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"})}),go=lo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:lo("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"})}),vo=lo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:lo("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"})}),mo=lo("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:lo("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"})}),yo=lo("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[lo("g",{"clip-path":"url(#clip0_2415_6911)",children:[lo("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:lo("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),lo("g",{mask:"url(#mask0_2415_6911)",children:[lo("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"}),lo("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"}),lo("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"}),lo("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"}),lo("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"}),lo("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"})]})]}),lo("defs",{children:lo("clipPath",{id:"clip0_2415_6911",children:lo("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),bo=lo("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:lo("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 Co(){return lo("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",yo]})}function _o(e){var t=e.text,n=e.submitDisabled,r=e.appearance,o=e.onSubmit,i=e.link,a=to(Fr),s=a.isPreviewMode,c=a.isPopup,u=r.submitButtonTextColor||wr(r.submitButtonColor||kr.submitButtonColor);return lo("div",{className:"bottom-section",children:[lo("div",{className:"buttons",children:lo("button",{className:"form-submit",disabled:n&&!s,type:"button",style:c?{color:u}:{},onClick:function(){s||(i&&(null==$t||$t.open(i)),o())},children:t})}),!r.whiteLabel&&lo(Co,{})]})}function Io(e){var t=e.question,n=e.description,r=e.descriptionContentType,o=e.backgroundColor,i=e.forceDisableHtml;return lo("div",{style:to(Fr).isPopup?{backgroundColor:o||kr.backgroundColor}:{},children:[lo("div",{className:"survey-question",children:t}),n&&Dr({component:Xn("div",{className:"survey-question-description"}),children:n,renderAsHtml:!i&&"text"!==r})]})}function So(e){return lo("div",{className:"cancel-btn-wrapper",children:lo("button",{className:"form-cancel",onClick:e.onClick,disabled:to(Fr).isPreviewMode,children:mo})})}function wo(e){var n=e.header,r=e.description,o=e.contentType,i=e.forceDisableHtml,a=e.appearance,s=e.onClose,c=e.styleOverrides,u=wr(a.backgroundColor||kr.backgroundColor),l=to(Fr).isPopup;return lo(er,{children:lo("div",{className:"thank-you-message",style:t({},c),children:lo("div",{className:"thank-you-message-container",children:[l&&lo(So,{onClick:function(){return s()}}),lo("h3",{className:"thank-you-message-header",style:{color:u},children:n}),r&&Dr({component:Xn("div",{className:"thank-you-message-body"}),children:r,renderAsHtml:!i&&"text"!==o,style:{color:u}}),l&&lo(_o,{text:a.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:a,onSubmit:function(){return s()}})]})})})}function ko(e){var t,n=$r(null),r=l(Jr(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black"),2),o=r[0],i=r[1];return Xr((function(){if(n.current){var e=function(e){var t=Cr.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]),o=parseInt(n[2]),i=parseInt(n[3]);return Math.sqrt(r*r*.299+o*o*.587+i*i*.114)>127.5?"black":"white"}(n.current);i(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:o}}function xo(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,o=e.onSubmit,i=$r(null),a=l(Jr(""),2),s=a[0],c=a[1];return lo("div",{ref:i,children:[lo(Io,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:r.backgroundColor,forceDisableHtml:n}),lo("textarea",{rows:4,placeholder:null==r?void 0:r.placeholder,onInput:function(e){return c(e.currentTarget.value)}}),lo(_o,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:r,onSubmit:function(){return o(s)}})]})}function Ao(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,o=e.onSubmit;return lo(er,{children:[lo(Io,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),lo(_o,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:function(){return o("link clicked")}})]})}function To(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,o=e.appearance,i=e.onSubmit,a=t.scale,s=10===t.scale?0:1,c=l(Jr(null),2),u=c[0],d=c[1];return lo(er,{children:[lo(Io,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:o.backgroundColor}),lo("div",{className:"rating-section",children:[lo("div",{className:"rating-options",children:["emoji"===t.display&&lo("div",{className:"rating-options-emoji",children:(3===t.scale?No:Oo).map((function(e,t){var n=t+1===u;return lo("button",{className:"ratings-emoji question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),value:t+1,type:"button",onClick:function(){d(t+1)},style:{fill:n?o.ratingButtonActiveColor:o.ratingButtonColor,borderColor:o.borderColor},children:e},t)}))}),"number"===t.display&&lo("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat(".concat(a-s+1,", minmax(0, 1fr))")},children:Do(t.scale).map((function(e,t){return lo(Mo,{displayQuestionIndex:r,active:u===e,appearance:o,num:e,setActiveNumber:function(e){d(e)}},t)}))})]}),lo("div",{className:"rating-text",children:[lo("div",{children:t.lowerBoundLabel}),lo("div",{children:t.upperBoundLabel})]})]}),lo(_o,{text:t.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:Kt(u)&&!t.optional,appearance:o,onSubmit:function(){return i(u)}})]})}function Mo(e){var t=e.num,n=e.active,r=e.displayQuestionIndex,o=e.appearance,i=e.setActiveNumber,a=ko({appearance:o,defaultTextColor:"black",forceUpdate:n}),s=a.textColor;return lo("button",{ref:a.ref,className:"ratings-number question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),type:"button",onClick:function(){i(t)},style:{color:s,backgroundColor:n?o.ratingButtonActiveColor:o.ratingButtonColor,borderColor:o.borderColor},children:t})}function Eo(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,o=e.appearance,i=e.onSubmit,a=$r(null),s=eo((function(){return function(e){if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var r=Er(t,Mr(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r}(t)}),[t]),c=l(Jr(t.type===Fn.MultipleChoice?[]:null),2),u=c[0],p=c[1],f=l(Jr(!1),2),h=f[0],g=f[1],v=l(Jr(""),2),m=v[0],y=v[1],b=t.type===Fn.SingleChoice?"radio":"checkbox";return lo("div",{ref:a,children:[lo(Io,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:o.backgroundColor}),lo("div",{className:"multiple-choice-options",children:s.map((function(e,n){var o="choice-option",i=e,a=e;return t.hasOpenChoice&&n===t.choices.length-1&&(o+=" choice-option-open"),lo("div",{className:o,children:[lo("input",{type:b,id:"surveyQuestion".concat(r,"Choice").concat(n),name:"question".concat(r),value:i,disabled:!i,onInput:function(){return t.hasOpenChoice&&n===t.choices.length-1?g(!h):t.type===Fn.SingleChoice?p(i):t.type===Fn.MultipleChoice&&Zt(u)?u.includes(i)?p(u.filter((function(e){return e!==i}))):p([].concat(d(u),[i])):void 0}}),lo("label",{htmlFor:"surveyQuestion".concat(r,"Choice").concat(n),style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?lo(er,{children:[lo("span",{children:[a,":"]}),lo("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===Fn.SingleChoice?p(n):t.type===Fn.MultipleChoice&&Zt(u)?y(n):void 0}})]}):a}),lo("span",{className:"choice-check",style:{color:"black"},children:bo})]})}))}),lo(_o,{text:t.buttonText||"Submit",submitDisabled:(Kt(u)||Zt(u)&&!h&&0===u.length||Zt(u)&&h&&!m&&0===u.length&&!t.optional)&&!t.optional,appearance:o,onSubmit:function(){h&&t.type===Fn.MultipleChoice?Zt(u)&&i([].concat(d(u),[m])):i(u)}})]})}var No=[ho,fo,po],Oo=[go,ho,fo,po,vo],Lo=[1,2,3,4,5],Ro=[1,2,3,4,5,6,7],Fo=[0,1,2,3,4,5,6,7,8,9,10];function Do(e){switch(e){case 5:default:return Lo;case 7:return Ro;case 10:return Fo}}var qo=$t,Po=rn,Ho=function(){function e(t){var n=this;a(this,e),u(this,"canShowNextEventBasedSurvey",(function(){var e,t=Po.querySelectorAll("div[class^=PostHogSurvey]");return!(t.length>0)||1===(null===(e=t[t.length-1].shadowRoot)||void 0===e?void 0:e.childElementCount)})),u(this,"handlePopoverSurvey",(function(e){var t,r=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,o=localStorage.getItem("lastSeenSurveyDate");if(r&&o){var i=new Date,a=Math.abs(i.getTime()-new Date(o).getTime());if(Math.ceil(a/864e5)<r)return}var s=function(e){return!!localStorage.getItem(Lr(e))&&!Or(e)}(e);if(!s){n.addSurveyToFocus(e.id);var c=function(e,t,n){var r=_r.createElement("div");r.className="PostHogSurvey".concat(t);var o=r.attachShadow({mode:"open"});if(e){var i=Object.assign(_r.createElement("style"),{innerText:e});o.appendChild(i)}return(n||_r.body).appendChild(r),o}(Ir(null==e?void 0:e.appearance),e.id);yr(lo(Zo,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!0},"popover-survey"),c)}})),u(this,"handleWidget",(function(e){var t=function(e){var t,n=qr.createElement("div");n.className="PostHogWidget".concat(e.id);var r,o=n.attachShadow({mode:"open"}),i=(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 o.append(Object.assign(qr.createElement("style"),{innerText:i})),qr.body.appendChild(n),o}(e),r=Ir(e.appearance);t.appendChild(Object.assign(Po.createElement("style"),{innerText:r})),yr(lo(Vo,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus},"feedback-survey"),t)})),u(this,"handleWidgetSelector",(function(e){var t,r=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&Po.querySelector(e.appearance.widgetSelector);if(r)if(0===Po.querySelectorAll(".PostHogWidget".concat(e.id)).length)n.handleWidget(e);else if(1===Po.querySelectorAll(".PostHogWidget".concat(e.id)).length&&!r.getAttribute("PHWidgetSurveyClickListener")){var o,i,a=null===(o=Po.querySelector(".PostHogWidget".concat(e.id)))||void 0===o||null===(i=o.shadowRoot)||void 0===i?void 0:i.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")}})),u(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!=Rn.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)})),u(this,"renderSurvey",(function(e,t){yr(lo(Zo,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)})),u(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(Kt(n.surveyInFocus)){var t,r,o;if(e.type===Rn.Widget)"tab"===(null===(t=e.appearance)||void 0===t?void 0:t.widgetType)&&0===Po.querySelectorAll(".PostHogWidget".concat(e.id)).length&&n.handleWidget(e),"selector"===(null===(r=e.appearance)||void 0===r?void 0:r.widgetType)&&null!==(o=e.appearance)&&void 0!==o&&o.widgetSelector&&n.handleWidgetSelector(e);e.type===Rn.Popover&&n.canShowNextEventBasedSurvey()&&n.handlePopoverSurvey(e)}}))}),t)})),u(this,"addSurveyToFocus",(function(e){Kt(n.surveyInFocus)||sn.error("Survey ".concat(d(n.surveyInFocus)," already in focus. Cannot add survey ").concat(e,".")),n.surveyInFocus=e})),u(this,"removeSurveyFromFocus",(function(e){n.surveyInFocus!==e&&sn.error("Survey ".concat(e," is not in focus. Cannot remove survey ").concat(e,".")),n.surveyInFocus=null})),this.posthog=t,this.surveyInFocus=null}return c(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 Bo(e){if(Po&&qo){var t=new Ho(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((function(){t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function Zo(e){var n,r,o,i,a,s,c=e.survey,u=e.forceDisableHtml,d=e.posthog,p=e.style,f=e.previewPageIndex,h=e.removeSurveyFromFocus,g=e.isPopup,v=Number.isInteger(f),m=null!==(n=c.appearance)&&void 0!==n&&n.surveyPopupDelaySeconds?1e3*c.appearance.surveyPopupDelaySeconds:0,y=function(e,t,n,r,o){var i=l(Jr(r||0===n),2),a=i[0],s=i[1],c=l(Jr(!1),2),u=c[0],d=c[1];return Xr((function(){if(!r&&t){var i,a=function(){o(e.id),s(!1)},c=function(){var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(d(!0),o(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((function(){s(!1)}),5e3)):(o(e.id),s(!1))},u=function(){var n;s(!0),qo.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 qo.addEventListener("PHSurveyClosed",a),qo.addEventListener("PHSurveySent",c),n>0?(i=setTimeout((function(){u()}),n),function(){clearTimeout(i),qo.removeEventListener("PHSurveyClosed",a),qo.removeEventListener("PHSurveySent",c)}):(u(),function(){qo.removeEventListener("PHSurveyClosed",a),qo.removeEventListener("PHSurveySent",c)})}}),[]),{isPopupVisible:a,isSurveySent:u,setIsPopupVisible:s}}(c,d,m,v,h),b=y.isPopupVisible,C=y.isSurveySent,_=y.setIsPopupVisible,I=C||f===c.questions.length,S=null!==(r=p)&&void 0!==r&&r.left&&zt(null===(o=p)||void 0===o?void 0:o.left)?{left:p.left-40}:{};return v&&((p=p||{}).left="unset",p.right="unset",p.transform="unset"),b?lo(Fr.Provider,{value:{isPreviewMode:v,previewPageIndex:f,handleCloseSurveyPopup:function(){return Tr(c,d,v)},isPopup:g||!1},children:I?lo(wo,{header:(null===(i=c.appearance)||void 0===i?void 0:i.thankYouMessageHeader)||"Thank you!",description:(null===(a=c.appearance)||void 0===a?void 0:a.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null===(s=c.appearance)||void 0===s?void 0:s.thankYouMessageDescriptionContentType,appearance:c.appearance||kr,styleOverrides:t(t({},p),S),onClose:function(){return _(!1)}}):lo(Wo,{survey:c,forceDisableHtml:!!u,posthog:d,styleOverrides:p})}):lo(er,{})}function Wo(e){var n,r,o=e.survey,i=e.forceDisableHtml,a=e.posthog,s=e.styleOverrides,c=wr((null===(n=o.appearance)||void 0===n?void 0:n.backgroundColor)||kr.backgroundColor),d=l(Jr({}),2),p=d[0],f=d[1],h=to(Fr),g=h.isPreviewMode,v=h.previewPageIndex,m=h.handleCloseSurveyPopup,y=h.isPopup,b=l(Jr(v||0),2),C=b[0],_=b[1],I=eo((function(){return Nr(o)}),[o]);Xr((function(){_(null!=v?v:0)}),[v]);return lo("form",{className:"survey-form",style:y?t({color:c,borderColor:null===(r=o.appearance)||void 0===r?void 0:r.borderColor},s):{},children:I.map((function(e,n){var r,s=e.originalQuestionIndex;return(g?C===s:C===n)&&lo("div",{className:"survey-box",style:y?{backgroundColor:(null===(r=o.appearance)||void 0===r?void 0:r.backgroundColor)||kr.backgroundColor}:{},children:[y&&lo(So,{onClick:function(){return m()}}),Uo({question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o.appearance||kr,onSubmit:function(e){return function(e){var n=e.res,r=e.originalQuestionIndex,i=e.displayQuestionIndex;if(a){var s=0===r?"$survey_response":"$survey_response_".concat(r);if(f(t(t({},p),{},u({},s,n))),a.getNextSurveyStep){var c=a.getNextSurveyStep(o,i,n);c===Dn.End?Ar(t(t({},p),{},u({},s,n)),o,a):_(c)}else i===o.questions.length-1?Ar(t(t({},p),{},u({},s,n)),o,a):_(i+1)}}({res:e,originalQuestionIndex:s,displayQuestionIndex:n})}})]})}))})}function Vo(e){var t,n,r=e.survey,o=e.forceDisableHtml,i=e.posthog,a=e.readOnly,s=e.removeSurveyFromFocus,c=l(Jr(!1),2),u=c[0],d=c[1],p=l(Jr({}),2),f=p[0],h=p[1],g=$r(null);return Xr((function(){var e,t;if(!a&&i){if("tab"===(null===(e=r.appearance)||void 0===e?void 0:e.widgetType)&&g.current){var n,o=g.current.getBoundingClientRect(),s={top:"50%",left:parseInt("".concat(o.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 c=Po.querySelector(r.appearance.widgetSelector||"");null==c||c.addEventListener("click",(function(){d(!u)})),null==c||c.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),lo(er,{children:["tab"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)&&lo("div",{className:"ph-survey-widget-tab",ref:g,onClick:function(){return!a&&d(!u)},style:{color:wr(r.appearance.widgetColor)},children:[lo("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=r.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),u&&lo(Zo,{posthog:i,survey:r,forceDisableHtml:o,style:f,removeSurveyFromFocus:s,isPopup:!0},"feedback-widget-survey")]})}var Uo=function(e){var n,r,o=e.question,i=e.forceDisableHtml,a=e.displayQuestionIndex,s=e.appearance,c=e.onSubmit,l=(u(n={},Fn.Open,xo),u(n,Fn.Link,Ao),u(n,Fn.Rating,To),u(n,Fn.SingleChoice,Eo),u(n,Fn.MultipleChoice,Eo),n),d={question:o,forceDisableHtml:i,appearance:s,onSubmit:c},p=(u(r={},Fn.Open,{}),u(r,Fn.Link,{}),u(r,Fn.Rating,{displayQuestionIndex:a}),u(r,Fn.SingleChoice,{displayQuestionIndex:a}),u(r,Fn.MultipleChoice,{displayQuestionIndex:a}),r),f=l[o.type],h=t(t({},d),p[o.type]);return lo(f,t({},h))};function jo(e){return!Ut(Event)&&Go(e,Event)}function Go(e,t){try{return e instanceof t}catch(e){return!1}}function Ko(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function Qo(e){return Ko(e,"DOMError")}on.__PosthogExtensions__=on.__PosthogExtensions__||{},on.__PosthogExtensions__.canActivateRepeatedly=Or,on.__PosthogExtensions__.generateSurveys=Bo,on.extendPostHogWithSurveys=Bo;var zo=/\(error: (.*)\)/,Yo=50,Jo="?";function Xo(e,t,n,r){var o={filename:e,function:t,in_app:!0};return Ut(n)||(o.lineno=n),Ut(r)||(o.colno=r),o}var $o=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ei=/\((\S*)(?::(\d+))(?::(\d+))\)/,ti=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ni=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ri=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var oi,ii=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=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=[],i=e.split("\n"),a=n;a<i.length;a++){var s=i[a];if(!(s.length>1024)){var c=zo.test(s)?s.replace(zo,"$1"):s;if(!c.match(/\S*Error: /)){var u,l=h(o);try{for(l.s();!(u=l.n()).done;){var d=(0,u.value)(c);if(d){r.push(d);break}}}catch(e){l.e(e)}finally{l.f()}if(r.length>=Yo)break}}}return function(e){if(!e.length)return[];var n=e.slice(0,Yo);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=$o.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){var n=ei.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}var r=l(ai(t[1]||Jo,t[2]),2),o=r[0];return Xo(r[1],o,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,function(e){var t=ti.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=ni.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],o=t[1]||Jo,i=l(ai(o,r),2);return o=i[0],Xo(r=i[1],o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],[40,function(e){var t=ri.exec(e);return t?Xo(t[2],t[1]||Jo,+t[3],t[4]?+t[4]:void 0):void 0}]]),ai=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]:Jo,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]};!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(oi||(oi={}));var si=["fatal","error","warning","log","info","debug"],ci=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,ui=/Minified React error #\d+;/i;function li(e){var t=e.stacktrace||e.stack||"",n=function(e){if(e){if(zt(e.framesToPop))return e.framesToPop;if(ui.test(e.message))return 1}return 0}(e);try{return ii(t,n)}catch(e){}return[]}function di(e){var t=li(e);return{$exception_type:e.name,$exception_message:e.message,$exception_stack_trace_raw:JSON.stringify(t),$exception_level:"error"}}function pi(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 o=n.slice(0,r).join(", ");if(!(o.length>t))return r===n.length||o.length<=t?o:"".concat(o.slice(0,t),"...")}return""}function fi(e){return jt(e)&&!Gt(e)&&si.indexOf(e)>=0}function hi(e){var n=l(e,5),r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],c={};if(Ut(s)&&jt(r)){var u="Error",d=r,p=r.match(ci);p&&(u=p[1],d=p[2]),c={$exception_type:u,$exception_message:d}}var f=s||r;if(Qo(f)||function(e){return Ko(e,"DOMException")}(f)){var h=f;if(function(e){return"stack"in e}(f))c=di(f);else{var g=h.name||(Qo(h)?"DOMError":"DOMException"),v=h.message?"".concat(g,": ").concat(h.message):g;c=function(e){return{$exception_type:"Error",$exception_message:e,$exception_level:"error"}}(v),c.$exception_type=Qo(h)?"DOMError":"DOMException",c.$exception_message=c.$exception_message||v}"code"in h&&(c.$exception_DOMException_code="".concat(h.code))}else if(function(e){return Ko(e,"ErrorEvent")}(f)&&f.error)c=di(f.error);else if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Go(e,Error)}}(f))c=di(f);else if(function(e){return Ko(e,"Object")}(f)||jo(f)){c=function(e){return{$exception_type:jo(e)?e.constructor.name:"Error",$exception_message:"Non-Error ".concat("exception"," captured with keys: ",pi(e)),$exception_level:fi(e.level)?e.level:"error"}}(f),c.$exception_is_synthetic=!0}else c.$exception_type=c.$exception_type||"Error",c.$exception_message=c.$exception_message||f,c.$exception_is_synthetic=!0;return t(t(t(t({},c),{},{$exception_type:c.$exception_type||"UnknownErrorType",$exception_message:c.$exception_message||"",$exception_level:fi(c.$exception_level)?c.$exception_level:"error"},o?{$exception_source:o}:{}),i?{$exception_lineno:i}:{}),a?{$exception_colno:a}:{})}function gi(e){var n=l(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 o,i={};return(i=Kt(o=r)||!Vt(o)&&!Wt(o)?{$exception_message:"Non-Error promise rejection captured with value: ".concat(String(r))}:hi([r])).$exception_handled=!1,t(t({},i),{},{$exception_type:i.$exception_type="UnhandledRejection",$exception_message:i.$exception_message=i.$exception_message||n.reason||String(r),$exception_level:fi(i.$exception_level)?i.$exception_level:"error"})}var vi={wrapOnError:function(e){var t=$t;t||sn.info("window not available, cannot wrap onerror");var n=t.onerror;return t.onerror=function(){for(var t,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=hi(o);return e(a),null!==(t=null==n?void 0:n.apply(void 0,o))&&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=$t;t||sn.info("window not available, cannot wrap onUnhandledRejection");var n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];var s=gi(i);return e(s),null!==(r=null==n?void 0:n.apply(t,i))&&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}}};on.__PosthogExtensions__=on.__PosthogExtensions__||{},on.__PosthogExtensions__.errorWrappingFunctions=vi,on.__PosthogExtensions__.parseErrorAsProperties=hi,on.posthogErrorWrappingFunctions=vi,on.parseErrorAsProperties=hi;var mi=function(e,t){var n=e.checkAndGetSessionAndWindowId(!0),r=n.sessionId,o=n.windowId;t.headers.set("X-POSTHOG-SESSION-ID",r),t.headers.set("X-POSTHOG-WINDOW-ID",o)};on.__PosthogExtensions__=on.__PosthogExtensions__||{};var yi={_patchFetch:function(e){return pn($t,"fetch",(function(t){return function(){var r=i(n().mark((function r(o,i){var a;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=new Request(o,i),mi(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 pn($t.XMLHttpRequest.prototype,"open",(function(t){return function(n,r){var o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,s=new Request(r);return mi(e,s),t.call(this,n,s.url,o,i,a)}}))}};on.__PosthogExtensions__.tracingHeadersPatchFns=yi,on.postHogTracingHeadersPatchFns=yi;var bi,Ci,_i,Ii=-1,Si=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Ii=t.timeStamp,e(t))}),!0)},wi=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ki=function(){var e=wi();return e&&e.activationStart||0},xi=function(e,t){var n=wi(),r="navigate";return Ii>=0?r="back-forward-cache":n&&(document.prerendering||ki()>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}},Ai=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){}},Ti=function(e,t,n,r){var o,i;return function(a){t.value>=0&&(a||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Mi=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Ei=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Ni=function(e){var t=!1;return function(){t||(e(),t=!0)}},Oi=-1,Li=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Ri=function(e){"hidden"===document.visibilityState&&Oi>-1&&(Oi="visibilitychange"===e.type?e.timeStamp:0,Di())},Fi=function(){addEventListener("visibilitychange",Ri,!0),addEventListener("prerenderingchange",Ri,!0)},Di=function(){removeEventListener("visibilitychange",Ri,!0),removeEventListener("prerenderingchange",Ri,!0)},qi=function(){return Oi<0&&(Oi=Li(),Fi(),Si((function(){setTimeout((function(){Oi=Li(),Fi()}),0)}))),{get firstHiddenTime(){return Oi}}},Pi=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Hi=[1800,3e3],Bi=function(e,t){t=t||{},Pi((function(){var n,r=qi(),o=xi("FCP"),i=Ai("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime<r.firstHiddenTime&&(o.value=Math.max(e.startTime-ki(),0),o.entries.push(e),n(!0)))}))}));i&&(n=Ti(e,o,Hi,t.reportAllChanges),Si((function(r){o=xi("FCP"),n=Ti(e,o,Hi,t.reportAllChanges),Mi((function(){o.value=performance.now()-r.timeStamp,n(!0)}))})))}))},Zi=[.1,.25],Wi=[2500,4e3],Vi={},Ui=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ji=function(e){if("loading"===document.readyState)return"loading";var t=Ui();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Gi=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Ki=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,o=r.id?"#"+r.id:Gi(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+o.length>(t||100)-1)return n||o;if(n=n?o+">"+n:o,r.id)break;e=r.parentNode}}catch(e){}return n},Qi=-1,zi=function(e,t){var n=Ui(),r="navigate";return Qi>=0?r="back-forward-cache":n&&(document.prerendering||function(){var e=Ui();return e&&e.activationStart||0}()>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}},Yi=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){}},Ji=function(e,t,n,r){var o,i;return function(a){t.value>=0&&(a||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Xi=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},$i=0,ea=1/0,ta=0,na=function(e){e.forEach((function(e){e.interactionId&&(ea=Math.min(ea,e.interactionId),ta=Math.max(ta,e.interactionId),$i=ta?(ta-ea)/7+1:0)}))},ra=function(){"interactionCount"in performance||bi||(bi=Yi("event",na,{type:"event",buffered:!0,durationThreshold:0}))},oa=[],ia=new Map,aa=0,sa=function(){return(bi?$i:performance.interactionCount||0)-aa},ca=[],ua=function(e){if(ca.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=oa[oa.length-1],n=ia.get(e.interactionId);if(n||oa.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]};ia.set(r.id,r),oa.push(r)}oa.sort((function(e,t){return t.latency-e.latency})),oa.length>10&&oa.splice(10).forEach((function(e){return ia.delete(e.id)}))}}},la=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=function(e){var t=!1;return function(){t||(e(),t=!0)}}(e),"hidden"===document.visibilityState?e():(n=t(e),Xi(e)),n},da=[200,500],pa=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()}((function(){var n;ra();var r,o=zi("INP"),i=function(e){la((function(){e.forEach(ua);var t,n=(t=Math.min(oa.length-1,Math.floor(sa()/50)),oa[t]);n&&n.latency!==o.value&&(o.value=n.latency,o.entries=n.entries,r())}))},a=Yi("event",i,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=Ji(e,o,da,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),Xi((function(){i(a.takeRecords()),r(!0)})),function(e){addEventListener("pageshow",(function(t){t.persisted&&(Qi=t.timeStamp,e(t))}),!0)}((function(){aa=0,oa.length=0,ia.clear(),o=zi("INP"),r=Ji(e,o,da,t.reportAllChanges)})))})))},fa=[],ha=[],ga=new WeakMap,va=new Map,ma=-1,ya=function(e){fa=fa.concat(e),ba()},ba=function(){ma<0&&(ma=la(Ca))},Ca=function(){va.size>10&&va.forEach((function(e,t){ia.has(t)||va.delete(t)}));var e=oa.map((function(e){return ga.get(e.entries[0])})),t=ha.length-50;ha=ha.filter((function(n,r){return r>=t||e.includes(n)}));for(var n=new Set,r=0;r<ha.length;r++){var o=ha[r];_a(o.startTime,o.processingEnd).forEach((function(e){n.add(e)}))}for(var i=0;i<50;i++){var a=fa[fa.length-1-i];if(!a||a.startTime<_i)break;n.add(a)}fa=Array.from(n),ma=-1};ca.push((function(e){e.interactionId&&e.target&&!va.has(e.interactionId)&&va.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;_i=Math.max(_i,e.processingEnd);for(var r=ha.length-1;r>=0;r--){var o=ha[r];if(Math.abs(n-o.renderTime)<=8){(t=o).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},ha.push(t)),(e.interactionId||"first-input"===e.entryType)&&ga.set(e,t),ba()}));var _a=function(e,t){for(var n,r=[],o=0;n=fa[o];o++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r},Ia={onLCP:function(e,t){t=t||{},Pi((function(){var n,r=qi(),o=xi("LCP"),i=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(o.value=Math.max(e.startTime-ki(),0),o.entries=[e],n())}))},a=Ai("largest-contentful-paint",i);if(a){n=Ti(e,o,Wi,t.reportAllChanges);var s=Ni((function(){Vi[o.id]||(i(a.takeRecords()),a.disconnect(),Vi[o.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Ni(e),"hidden"===document.visibilityState?e():(n=t(e),Ei(e)),n}(s)}),!0)})),Ei(s),Si((function(r){o=xi("LCP"),n=Ti(e,o,Wi,t.reportAllChanges),Mi((function(){o.value=performance.now()-r.timeStamp,Vi[o.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},Bi(Ni((function(){var n,r=xi("CLS",0),o=0,i=[],a=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=i[0],n=i[i.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,i.push(e)):(o=e.value,i=[e])}})),o>r.value&&(r.value=o,r.entries=i,n())},s=Ai("layout-shift",a);s&&(n=Ti(e,r,Zi,t.reportAllChanges),Ei((function(){a(s.takeRecords()),n(!0)})),Si((function(){o=0,r=xi("CLS",0),n=Ti(e,r,Zi,t.reportAllChanges),Mi((function(){return n()}))})),setTimeout(n,0))})))},onFCP:Bi,onINP:function(e,t){Ci||(Ci=Yi("long-animation-frame",ya)),pa((function(t){var n=function(e){var t=e.entries[0],n=ga.get(t),r=t.processingStart,o=n.processingEnd,i=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),a=_a(t.startTime,o),s=e.entries.find((function(e){return e.target})),c=s&&s.target||va.get(t.interactionId),u=[t.startTime+t.duration,o].concat(a.map((function(e){return e.startTime+e.duration}))),l=Math.max.apply(Math,u),d={interactionTarget:Ki(c),interactionTargetElement:c,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:l,processedEventEntries:i,longAnimationFrameEntries:a,inputDelay:r-t.startTime,processingDuration:o-r,presentationDelay:Math.max(l-o,0),loadState:ji(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};on.__PosthogExtensions__=on.__PosthogExtensions__||{},on.__PosthogExtensions__.postHogWebVitalsCallbacks=Ia,on.postHogWebVitalsCallbacks=Ia}();
|
|
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 o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t})),o=n[0].type;this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}}}]),e}(),bt=function(){function e(t){a(this,e),this.trackedLinkElements=new WeakSet,this.styleMirror=new he,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}return c(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:[]},o=[],i=h(e);try{for(i.s();!(n=i.n()).done;){var a=n.value,s=void 0;this.styleMirror.has(a)?s=this.styleMirror.getId(a):(s=this.styleMirror.add(a),o.push({styleId:s,rules:Array.from(a.rules||CSSRule,(function(e,t){return{rule:C(e),index:t}}))})),r.styleIds.push(s)}}catch(e){i.e(e)}finally{i.f()}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),e}(),Ct=function(){function e(){a(this,e),this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}return c(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 _t(e){return Object.assign(Object.assign({},e),{timestamp:ne()})}var It=!1,St=new _;function wt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.emit,n=e.checkoutEveryNms,r=e.checkoutEveryNth,o=e.blockClass,i=void 0===o?"rr-block":o,a=e.blockSelector,s=void 0===a?null:a,c=e.ignoreClass,u=void 0===c?"rr-ignore":c,l=e.ignoreSelector,d=void 0===l?null:l,p=e.maskTextClass,f=void 0===p?"rr-mask":p,g=e.maskTextSelector,v=void 0===g?null:g,m=e.inlineStylesheet,y=void 0===m||m,b=e.maskAllInputs,C=e.maskInputOptions,I=e.slimDOMOptions,S=e.maskInputFn,w=e.maskTextFn,k=e.hooks,x=e.packFn,A=e.sampling,T=void 0===A?{}:A,M=e.dataURLOptions,E=void 0===M?{}:M,N=e.mousemoveWait,O=e.recordDOM,L=void 0===O||O,R=e.recordCanvas,F=void 0!==R&&R,D=e.recordCrossOriginIframes,q=void 0!==D&&D,P=e.recordAfter,H=void 0===P?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":P,B=e.userTriggeredOnInput,W=void 0!==B&&B,Z=e.collectFonts,V=void 0!==Z&&Z,U=e.inlineImages,j=void 0!==U&&U,G=e.plugins,K=e.keepIframeSrcFn,Q=void 0===K?function(){return!1}:K,J=e.ignoreCSSAttributes,X=void 0===J?new Set([]):J;Le(e.errorHandler);var $=!q||window.parent===window,ee=!1;if(!$)try{window.parent.document&&(ee=!1)}catch(e){ee=!0}if($&&!t)throw new Error("emit function is required");void 0!==N&&void 0===T.mousemove&&(T.mousemove=N),St.reset();var te,ne=!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}:void 0!==C?C:{password:!0},ae=!0===I||"all"===I?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===I,headMetaDescKeywords:"all"===I}:I||{};!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 o=n[0];if(!(0 in n))throw new TypeError("1 argument is required");do{if(e===o)return!0}while(o=o&&o.parentNode);return!1})}();var se=0,ce=function(e){var t,n=h(G||[]);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,o){var i;if(!(null===(i=De[0])||void 0===i?void 0:i.isFrozen())||e.type===ye.FullSnapshot||e.type===ye.IncrementalSnapshot&&e.data.source===be.Mutation||De.forEach((function(e){return e.unfreeze()})),$)null==t||t(ce(e),o);else if(ee){var a={type:"rrweb",event:ce(e),origin:window.location.origin,isCheckout:o};window.parent.postMessage(a,"*")}if(e.type===ye.FullSnapshot)te=e,se=0;else if(e.type===ye.IncrementalSnapshot){if(e.data.source===be.Mutation&&e.data.isAttachIframe)return;se++;var s=r&&se>=r,c=n&&e.timestamp-te.timestamp>n;(s||c)&>(!0)}};var ue,le=function(e){ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.Mutation},e)}))},he=function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.Scroll},e)}))},ge=function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.CanvasMutation},e)}))},ve=new bt({mutationCb:le,adoptedStyleSheetCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.AdoptedStyleSheet},e)}))}}),me=new Ye({mirror:St,mutationCb:le,stylesheetManager:ve,recordCrossOriginIframes:q,wrappedEmit:ht}),Ce=h(G||[]);try{for(Ce.s();!(ue=Ce.n()).done;){var _e=ue.value;_e.getMirror&&_e.getMirror({nodeMirror:St,crossOriginIframeMirror:me.crossOriginIframeMirror,crossOriginIframeStyleMirror:me.crossOriginIframeStyleMirror})}}catch(e){Ce.e(e)}finally{Ce.f()}var Ie=new Ct;vt=new yt({recordCanvas:F,mutationCb:ge,win:window,blockClass:i,blockSelector:s,mirror:St,sampling:T.canvas,dataURLOptions:E});var Se=new Je({mutationCb:le,scrollCb:he,bypassOptions:{blockClass:i,blockSelector:s,maskTextClass:f,maskTextSelector:v,inlineStylesheet:y,maskInputOptions:ne,dataURLOptions:E,maskTextFn:w,maskInputFn:S,recordCanvas:F,inlineImages:j,sampling:T,slimDOMOptions:ae,iframeManager:me,stylesheetManager:ve,canvasManager:vt,keepIframeSrcFn:Q,processedNodeManager:Ie},mirror:St});gt=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(L){ht(_t({type:ye.Meta,data:{href:window.location.href,width:ie(),height:oe()}}),e),ve.reset(),Se.init(),De.forEach((function(e){return e.lock()}));var t=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new _:r,i=n.blockClass,a=void 0===i?"rr-block":i,s=n.blockSelector,c=void 0===s?null:s,u=n.maskTextClass,l=void 0===u?"rr-mask":u,d=n.maskTextSelector,p=void 0===d?null:d,f=n.inlineStylesheet,h=void 0===f||f,g=n.inlineImages,v=void 0!==g&&g,m=n.recordCanvas,y=void 0!==m&&m,b=n.maskAllInputs,C=void 0!==b&&b,I=n.maskTextFn,S=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,x=n.dataURLOptions,A=n.preserveWhiteSpace,T=n.onSerialize,M=n.onIframeLoad,E=n.iframeLoadTimeout,N=n.onStylesheetLoad,O=n.stylesheetLoadTimeout,L=n.keepIframeSrcFn;return z(e,{doc:e,mirror:o,blockClass:a,blockSelector:c,maskTextClass:l,maskTextSelector:p,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===C?{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===C?{password:!0}:C,maskTextFn:I,maskInputFn:S,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:x,inlineImages:v,recordCanvas:y,preserveWhiteSpace:A,onSerialize:T,onIframeLoad:M,iframeLoadTimeout:E,onStylesheetLoad:N,stylesheetLoadTimeout:O,keepIframeSrcFn:void 0===L?function(){return!1}:L,newlyAddedElement:!1})}(document,{mirror:St,blockClass:i,blockSelector:s,maskTextClass:f,maskTextSelector:v,inlineStylesheet:y,maskAllInputs:ne,maskTextFn:w,slimDOM:ae,dataURLOptions:E,recordCanvas:F,inlineImages:j,onSerialize:function(e){de(e,St)&&me.addIframe(e),pe(e,St)&&ve.trackLinkElement(e),fe(e)&&Se.addShadowRoot(e.shadowRoot,document)},onIframeLoad:function(e,t){me.attachIframe(e,t),Se.observeAttachShadow(e)},onStylesheetLoad:function(e,t){ve.attachLinkElement(e,t)},keepIframeSrcFn:Q});if(!t)return console.warn("Failed to snapshot the document");ht(_t({type:ye.FullSnapshot,data:{node:t,initialOffset:re(window)}}),e),De.forEach((function(e){return e.unlock()})),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ve.adoptStyleSheets(document.adoptedStyleSheets,St.getId(document))}};try{var we=[],ke=function(e){var t;return Fe(Ge)({mutationCb:le,mousemoveCb:function(e,t){return ht(_t({type:ye.IncrementalSnapshot,data:{source:t,positions:e}}))},mouseInteractionCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.MouseInteraction},e)}))},scrollCb:he,viewportResizeCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.ViewportResize},e)}))},inputCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.Input},e)}))},mediaInteractionCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.MediaInteraction},e)}))},styleSheetRuleCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.StyleSheetRule},e)}))},styleDeclarationCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.StyleDeclaration},e)}))},canvasMutationCb:ge,fontCb:function(e){return ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.Font},e)}))},selectionCb:function(e){ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.Selection},e)}))},customElementCb:function(e){ht(_t({type:ye.IncrementalSnapshot,data:Object.assign({source:be.CustomElement},e)}))},blockClass:i,ignoreClass:u,ignoreSelector:d,maskTextClass:f,maskTextSelector:v,maskInputOptions:ne,inlineStylesheet:y,sampling:T,recordDOM:L,recordCanvas:F,inlineImages:j,userTriggeredOnInput:W,collectFonts:V,doc:e,maskInputFn:S,maskTextFn:w,keepIframeSrcFn:Q,blockSelector:s,slimDOMOptions:ae,dataURLOptions:E,mirror:St,iframeManager:me,stylesheetManager:ve,shadowDomManager:Se,processedNodeManager:Ie,canvasManager:vt,ignoreCSSAttributes:X,plugins:(null===(t=null==G?void 0:G.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(_t({type:ye.Plugin,data:{plugin:e.name,payload:t}}))}}})))||[]},k)};me.addLoadListener((function(e){try{we.push(ke(e.contentDocument))}catch(e){console.warn(e)}}));var xe=function(){gt(),we.push(ke(document)),It=!0};return"interactive"===document.readyState||"complete"===document.readyState?xe():(we.push(Y("DOMContentLoaded",(function(){ht(_t({type:ye.DomContentLoaded,data:{}})),"DOMContentLoaded"===H&&xe()}))),we.push(Y("load",(function(){ht(_t({type:ye.Load,data:{}})),"load"===H&&xe()}),window))),function(){we.forEach((function(e){return e()})),Ie.destroy(),It=!1,Re()}}catch(e){console.warn(e)}}wt.addCustomEvent=function(e,t){if(!It)throw new Error("please add custom event after start recording");ht(_t({type:ye.Custom,data:{tag:e,payload:t}}))},wt.freezePage=function(){De.forEach((function(e){return e.freeze()}))},wt.takeFullSnapshot=function(e){if(!It)throw new Error("please take full snapshot after start recording");gt(e)},wt.mirror=St;var kt=function(){function e(t){a(this,e),this.fileName=t.fileName||"",this.functionName=t.functionName||"",this.lineNumber=t.lineNumber,this.columnNumber=t.columnNumber}return c(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+/,At=/^\s*at .*(\S+:\d+|\(native\))/m,Tt=/^(eval@)?(\[native code])?$/,Mt={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(At)?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(At)}),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),o=this.extractLocation(n?n[1]:r.pop()),i=r.join(" ")||void 0,a=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new kt({functionName:i,fileName:a,lineNumber:o[1],columnNumber:o[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 kt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new kt({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[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=[],o=2,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new kt({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=[],o=0,i=n.length;o<i;o+=2){var a=t.exec(n[o]);a&&r.push(new kt({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 kt({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})}),this)}};function Et(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,o=[];if(r.children&&r.children.length>0)for(var i=0;i<r.children.length;i++){var a=r.children[i];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&o.push(a)}o.length>1&&(n+=":eq(".concat(o.indexOf(e),")")),t=n+(t?">"+t:""),e=r}return t}function Nt(e){return"[object Object]"===Object.prototype.toString.call(e)}function Ot(e,t){if(0===t)return!0;for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];if(Nt(e[o])&&Ot(e[o],t-1))return!0}return!1}function Lt(e,t){var n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);var r=[],o=[];return JSON.stringify(e,(function(e,t){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?o.splice(i,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.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(Nt(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Nt(e)&&Ot(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 c=t[s];Array.isArray(c)?a[s]=Et(c.length?c[0]:null):a[s]=c}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 Rt={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 Ft(e,t,n){var r,o=n?Object.assign({},Rt,n):Rt,i=o.logger;if(!i)return function(){};r="string"==typeof i?t[i]:i;var a=0,s=!1,c=[];if(o.level.includes("error")){var u=function(t){var n=t.message,r=t.error,i=Mt.parse(r).map((function(e){return e.toString()})),a=[Lt(n,o.stringifyOptions)];e({level:"error",trace:i,payload:a})};t.addEventListener("error",u),c.push((function(){t.removeEventListener("error",u)}));var l=function(t){var n,r;t.reason instanceof Error?(n=t.reason,r=[Lt("Uncaught (in promise) ".concat(n.name,": ").concat(n.message),o.stringifyOptions)]):(n=new Error,r=[Lt("Uncaught (in promise)",o.stringifyOptions),Lt(t.reason,o.stringifyOptions)]);var i=Mt.parse(n).map((function(e){return e.toString()}));e({level:"error",trace:i,payload:r})};t.addEventListener("unhandledrejection",l),c.push((function(){t.removeEventListener("unhandledrejection",l)}))}var d,p=h(o.level);try{for(p.s();!(d=p.n()).done;){var f=d.value;c.push(g(r,f))}}catch(e){p.e(e)}finally{p.f()}return function(){c.forEach((function(e){return e()}))};function g(t,n){var r=this;return t[n]?te(t,n,(function(t){return function(){for(var i=arguments.length,c=new Array(i),u=0;u<i;u++)c[u]=arguments[u];if(t.apply(r,c),!s){s=!0;try{var l=Mt.parse(new Error).map((function(e){return e.toString()})).splice(1),d=c.map((function(e){return Lt(e,o.stringifyOptions)}));++a<o.lengthThreshold?e({level:n,trace:l,payload:d}):a===o.lengthThreshold&&e({level:"warn",trace:[],payload:[Lt("The number of log records reached the threshold.")]})}catch(e){t.apply(void 0,["rrweb logger error:",e].concat(c))}finally{s=!1}}}})):function(){}}}var Dt=function(e){return{name:"rrweb/console@1",observer:Ft,options:e}},qt=Array.isArray,Pt=Object.prototype,Ht=Pt.hasOwnProperty,Bt=Pt.toString,Wt=qt||function(e){return"[object Array]"===Bt.call(e)},Zt=function(e){return"function"==typeof e},Vt=function(e){return e===Object(e)&&!Wt(e)},Ut=function(e){return void 0===e},jt=function(e){return"[object String]"==Bt.call(e)},Gt=function(e){return jt(e)&&0===e.trim().length},Kt=function(e){return null===e},Qt=function(e){return Ut(e)||Kt(e)},zt=function(e){return"[object Number]"==Bt.call(e)},Yt=function(e){return"[object Boolean]"===Bt.call(e)},Jt=function(e){return e instanceof Document},Xt=function(e){return e instanceof FormData},$t="undefined"!=typeof window?window:void 0,en="undefined"!=typeof globalThis?globalThis:$t,tn=Array.prototype.forEach,nn=null==en?void 0:en.navigator,rn=null==en?void 0:en.document;null==en||en.location,null==en||en.fetch,null!=en&&en.XMLHttpRequest&&"withCredentials"in new en.XMLHttpRequest&&en.XMLHttpRequest,null==en||en.AbortController,null==nn||nn.userAgent;var on=null!=$t?$t:{},an="[PostHog.js]",sn={_log:function(e){if($t&&on.POSTHOG_DEBUG&&!Ut($t.console)&&$t.console){for(var t=("__rrweb_original__"in $t.console[e]?$t.console[e].__rrweb_original__:$t.console[e]),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];t.apply(void 0,[an].concat(r))}},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];sn._log.apply(sn,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];sn._log.apply(sn,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];sn._log.apply(sn,["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,[an].concat(n))},uninitializedWarning:function(e){sn.error("You must initialize PostHog before calling ".concat(e))}},cn={};function un(e,t,n){if(!Qt(e)){if(Wt(e))return function(e,t,n){if(Wt(e))if(tn&&e.forEach===tn)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,o=e.length;r<o;r++)if(r in e&&t.call(n,e[r],r)===cn)return}(e,t,n);if(Xt(e)){var r,o=h(e.entries());try{for(o.s();!(r=o.n()).done;){var i=r.value;if(t.call(n,i[1],i[0])===cn)return}}catch(e){o.e(e)}finally{o.f()}}else for(var a in e)if(Ht.call(e,a)&&t.call(n,e[a],a)===cn)return}}var ln=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",o=[];return un(e,(function(e,r){Ut(e)||Ut(r)||"undefined"===r||(t=encodeURIComponent(function(e){return e instanceof File}(e)?e.name:e.toString()),n=encodeURIComponent(r),o[o.length]=n+"="+t)})),o.join(r)},dn={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"]};function pn(e,t,n){try{if(!(t in e))return function(){};var r=e[t],o=n(r);return Zt(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=o,function(){e[t]=r}}catch(e){return function(){}}}function fn(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),o={hostname:r,isHostDenied:!1};if(null===(n=t.payloadHostDenyList)||void 0===n||!n.length||null==r||!r.trim().length)return o;var i,a=h(t.payloadHostDenyList);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(r.endsWith(s))return{hostname:r,isHostDenied:!0}}}catch(e){a.e(e)}finally{a.f()}return o}var hn=function(e){return"navigation"===e.entryType},gn=function(e){return"resource"===e.entryType};function vn(e,t){for(var n=e.length-1;n>=0;n-=1)if(t(e[n]))return e[n]}function mn(e,t,n){if(n.recordInitialRequests){var r=t.performance.getEntries().filter((function(e){return hn(e)||gn(e)&&n.initiatorTypes.includes(e.initiatorType)}));e({requests:r.flatMap((function(e){return wn({entry:e,method:void 0,status:void 0,networkRequest:{},isInitial:!0})})),isInitial:!0})}var o=new t.PerformanceObserver((function(t){var r=t.getEntries().filter((function(e){return hn(e)||gn(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 wn({entry:e,method:void 0,status:void 0,networkRequest:{}})}))})})),i=PerformanceObserver.supportedEntryTypes.filter((function(e){return n.performanceEntryTypeToObserve.includes(e)}));return o.observe({entryTypes:i}),function(){o.disconnect()}}function yn(e,t){return!!t&&(Yt(t)||t[e])}function bn(e){var t=e.type,n=e.recordBody,r=e.headers;function o(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(Yt(n))return!0;if(Wt(n))return o(n);var i=n[t];return Yt(i)?i:o(i)}function Cn(e,t,n,r,o){return _n.apply(this,arguments)}function _n(){return _n=i(n().mark((function e(t,r,o,i,a){var s,c,u,l=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((s=l.length>5&&void 0!==l[5]?l[5]:0)>10)){e.next=4;break}return sn.warn("Failed to get performance entry for request",{url:o,initiatorType:r}),e.abrupt("return",null);case 4:if(c=t.performance.getEntriesByName(o),u=vn(c,(function(e){return gn(e)&&e.initiatorType===r&&(Ut(i)||e.startTime>=i)&&(Ut(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",Cn(t,r,o,i,a,s+1));case 10:return e.abrupt("return",u);case 11:case"end":return e.stop()}}),e)}))),_n.apply(this,arguments)}function In(e){var t=e.body,n=e.options,r=e.url;if(Qt(t))return null;var o=fn(r,n),i=o.hostname;if(o.isHostDenied)return i+" is in deny list";if(jt(t))return t;if(Jt(t))return t.textContent;if(Xt(t))return ln(t);if(Vt(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 Sn=function(e){return!Kt(e)&&("navigation"===e.entryType||"resource"===e.entryType)};function wn(e){var n=e.entry,r=e.method,o=e.status,i=e.networkRequest,a=e.isInitial,s=e.start,c=e.end,u=e.url,l=e.initiatorType;s=n?n.startTime:s,c=n?n.responseEnd:c;var d=Math.floor(Date.now()-performance.now()),p=Math.floor(d+(s||0)),f=[t(t({},n?n.toJSON():{name:u}),{},{startTime:Ut(s)?void 0:Math.round(s),endTime:Ut(c)?void 0:Math.round(c),timeOrigin:d,timestamp:p,method:r,initiatorType:n?n.initiatorType:l,status:o,requestHeaders:i.requestHeaders,requestBody:i.requestBody,responseHeaders:i.responseHeaders,responseBody:i.responseBody,isInitial:a})];if(Sn(n)){var g,v=h(n.serverTiming||[]);try{for(v.s();!(g=v.n()).done;){var m=g.value;f.push({timeOrigin:d,timestamp:p,startTime:Math.round(n.startTime),name:m.name,duration:m.duration,entryType:"serverTiming"})}}catch(e){v.e(e)}finally{v.f()}}return f}var kn=["video/","audio/"];function xn(e){var t,n=e.r,r=e.options,o=e.url;if("chunked"===n.headers.get("Transfer-Encoding"))return"Chunked Transfer-Encoding is not supported";var i=null===(t=n.headers.get("Content-Type"))||void 0===t?void 0:t.toLowerCase(),a=kn.some((function(e){return null==i?void 0:i.startsWith(e)}));if(i&&a)return"Content-Type ".concat(i," is not supported");var s=fn(o,r),c=s.hostname;return s.isHostDenied?c+" is in deny list":null}function An(e){return new Promise((function(t,n){var r=setTimeout((function(){return t("[SessionReplay] Timeout while trying to read body")}),500);try{e.clone().text().then((function(e){return t(e)}),(function(e){return n(e)})).finally((function(){return clearTimeout(r)}))}catch(e){clearTimeout(r),t("[SessionReplay] Failed to read body")}}))}function Tn(e){return Mn.apply(this,arguments)}function Mn(){return Mn=i(n().mark((function e(t){var r,o,i,a,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.r,o=t.options,i=t.url,a=fn(i,o),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",An(r));case 5:case"end":return e.stop()}}),e)}))),Mn.apply(this,arguments)}function En(e){return Nn.apply(this,arguments)}function Nn(){return Nn=i(n().mark((function e(t){var r,o,i,a;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.r,o=t.options,i=t.url,a=xn({r:r,options:o,url:i}),Kt(a)){e.next=4;break}return e.abrupt("return",Promise.resolve(a));case 4:return e.abrupt("return",An(r));case 5:case"end":return e.stop()}}),e)}))),Nn.apply(this,arguments)}var On=null;function Ln(e,r,o){if(!("performance"in r))return function(){};if(On)return sn.warn("Network observer already initialised, doing nothing"),function(){};var a=o?Object.assign({},dn,o):dn,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}))},c=mn(s,r,a),u=function(){},l=function(){};return(a.recordHeaders||a.recordBody)&&(u=function(e,t,n){if(!n.initiatorTypes.includes("xmlhttprequest"))return function(){};var r=yn("request",n.recordHeaders),o=yn("response",n.recordHeaders),i=pn(t.XMLHttpRequest.prototype,"open",(function(i){return function(a,s){var c,u,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],d=arguments.length>3?arguments[3]:void 0,p=arguments.length>4?arguments[4]:void 0,f=this,h=new Request(s),g={},v={},m=f.setRequestHeader.bind(f);f.setRequestHeader=function(e,t){return v[e]=t,m(e,t)},r&&(g.requestHeaders=v);var y=f.send.bind(f);f.send=function(e){return bn({type:"request",headers:v,url:s,recordBody:n.recordBody})&&(g.requestBody=In({body:e,options:n,url:s})),c=t.performance.now(),y(e)},f.addEventListener("readystatechange",(function(){if(f.readyState===f.DONE){u=t.performance.now();var r={};f.getAllResponseHeaders().trim().split(/[\r\n]+/).forEach((function(e){var t=e.split(": "),n=t.shift(),o=t.join(": ");n&&(r[n]=o)})),o&&(g.responseHeaders=r),bn({type:"response",headers:r,url:s,recordBody:n.recordBody})&&(g.responseBody=In({body:f.response,options:n,url:s})),Cn(t,"xmlhttprequest",h.url,c,u).then((function(t){var n=wn({entry:t,method:h.method,status:null==f?void 0:f.status,networkRequest:g,start:c,end:u,url:s.toString(),initiatorType:"xmlhttprequest"});e({requests:n})})).catch((function(){}))}})),i.call(f,a,s,l,d,p)}}));return function(){i()}}(s,r,a),l=function(e,t,r){if(!r.initiatorTypes.includes("fetch"))return function(){};var o=yn("request",r.recordHeaders),a=yn("response",r.recordHeaders),s=pn(t,"fetch",(function(s){return function(){var c=i(n().mark((function i(c,u){var l,d,p,f,h,g,v;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(l=new Request(c,u),p={},n.prev=2,g={},l.headers.forEach((function(e,t){g[t]=e})),o&&(p.requestHeaders=g),!bn({type:"request",headers:g,url:c,recordBody:r.recordBody})){n.next=10;break}return n.next=9,Tn({r:l,options:r,url:c});case 9:p.requestBody=n.sent;case 10:return f=t.performance.now(),n.next=13,s(l);case 13:if(d=n.sent,h=t.performance.now(),v={},d.headers.forEach((function(e,t){v[t]=e})),a&&(p.responseHeaders=v),!bn({type:"response",headers:v,url:c,recordBody:r.recordBody})){n.next=22;break}return n.next=21,En({r:d,options:r,url:c});case 21:p.responseBody=n.sent;case 22:return n.abrupt("return",d);case 23:return n.prev=23,Cn(t,"fetch",l.url,f,h).then((function(t){var n,r=wn({entry:t,method:l.method,status:null===(n=d)||void 0===n?void 0:n.status,networkRequest:p,start:f,end:h,url:l.url,initiatorType:"fetch"});e({requests:r})})).catch((function(){})),n.finish(23);case 26:case"end":return n.stop()}}),i,null,[[2,,23,26]])})));return function(e,t){return c.apply(this,arguments)}}()}));return function(){s()}}(s,r,a)),On=function(){c(),u(),l()}}var Rn,Fn,Dn,qn=function(e){return{name:"rrweb/network@1",observer:Ln,options:e}};on.__PosthogExtensions__=on.__PosthogExtensions__||{},on.__PosthogExtensions__.rrwebPlugins={getRecordConsolePlugin:Dt,getRecordNetworkPlugin:qn},on.__PosthogExtensions__.rrweb={record:wt,version:"v2",rrwebVersion:v},on.rrweb={record:wt,version:"v2",rrwebVersion:v},on.rrwebConsoleRecord={getRecordConsolePlugin:Dt},on.getRecordNetworkPlugin=qn,function(e){e.Popover="popover",e.API="api",e.Widget="widget"}(Rn||(Rn={})),function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"}(Fn||(Fn={})),function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"}(Dn||(Dn={}));var Pn,Hn,Bn,Wn,Zn,Vn,Un,jn,Gn={},Kn=[],Qn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,zn=Array.isArray;function Yn(e,t){for(var n in t)e[n]=t[n];return e}function Jn(e){var t=e.parentNode;t&&t.removeChild(e)}function Xn(e,t,n){var r,o,i,a={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?Pn.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return $n(e,a,r,o,null)}function $n(e,t,n,r,o){var i={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==o?++Bn:o,__i:-1,__u:0};return null==o&&null!=Hn.vnode&&Hn.vnode(i),i}function er(e){return e.children}function tr(e,t){this.props=e,this.context=t}function nr(e,t){if(null==t)return e.__?nr(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?nr(e):null}function rr(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 rr(e)}}function or(e){(!e.__d&&(e.__d=!0)&&Wn.push(e)&&!ir.__r++||Zn!==Hn.debounceRendering)&&((Zn=Hn.debounceRendering)||Vn)(ir)}function ir(){var e,t,n,r,o,i,a,s,c;for(Wn.sort(Un);e=Wn.shift();)e.__d&&(t=Wn.length,r=void 0,i=(o=(n=e).__v).__e,s=[],c=[],(a=n.__P)&&((r=Yn({},o)).__v=o.__v+1,Hn.vnode&&Hn.vnode(r),fr(a,r,o,n.__n,void 0!==a.ownerSVGElement,32&o.__u?[i]:null,s,null==i?nr(o):i,!!(32&o.__u),c),r.__.__k[r.__i]=r,hr(s,r,c),r.__e!=i&&rr(r)),Wn.length>t&&Wn.sort(Un));ir.__r=0}function ar(e,t,n,r,o,i,a,s,c,u,l){var d,p,f,h,g,v=r&&r.__k||Kn,m=t.length;for(n.__d=c,function(e,t,n){var r,o,i,a,s,c=t.length,u=n.length,l=u,d=0;for(e.__k=[],r=0;r<c;r++)null!=(o=e.__k[r]=null==(o=t[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?$n(null,o,null,null,o):zn(o)?$n(er,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?$n(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,s=cr(o,n,a=r+d,l),o.__i=s,i=null,-1!==s&&(l--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&d--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?d++:s>a?l>c-a?d+=s-a:d--:d=s<a&&s==a-1?s-a:0,s!==r+d&&(o.__u|=65536))):(i=n[r])&&null==i.key&&i.__e&&(i.__e==e.__d&&(e.__d=nr(i)),vr(i,i,!1),n[r]=null,l--);if(l)for(r=0;r<u;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==e.__d&&(e.__d=nr(i)),vr(i,i))}(n,t,v),c=n.__d,d=0;d<m;d++)null!=(f=n.__k[d])&&"boolean"!=typeof f&&"function"!=typeof f&&(p=-1===f.__i?Gn:v[f.__i]||Gn,f.__i=d,fr(e,f,p,o,i,a,s,c,u,l),h=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&gr(p.ref,null,f),l.push(f.ref,f.__c||h,f)),null==g&&null!=h&&(g=h),65536&f.__u||p.__k===f.__k?c=sr(f,c,e):"function"==typeof f.type&&void 0!==f.__d?c=f.__d:h&&(c=h.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=c,n.__e=g}function sr(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=sr(r[o],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function cr(e,t,n,r){var o=e.key,i=e.type,a=n-1,s=n+1,c=t[n];if(null===c||c&&o==c.key&&i===c.type)return n;if(r>(null!=c&&0==(131072&c.__u)?1:0))for(;a>=0||s<t.length;){if(a>=0){if((c=t[a])&&0==(131072&c.__u)&&o==c.key&&i===c.type)return a;a--}if(s<t.length){if((c=t[s])&&0==(131072&c.__u)&&o==c.key&&i===c.type)return s;s++}}return-1}function ur(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Qn.test(t)?n:n+"px"}function lr(e,t,n,r,o){var i;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||ur(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||ur(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=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+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?pr:dr,i)):e.removeEventListener(t,i?pr:dr,i);else{if(o)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 dr(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Hn.event?Hn.event(e):e)}function pr(e){return this.l[e.type+!0](Hn.event?Hn.event(e):e)}function fr(e,t,n,r,o,i,a,s,c,u){var l,d,p,f,h,g,v,m,y,b,C,_,I,S,w,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),i=[s=t.__e=n.__e]),(l=Hn.__b)&&l(t);e:if("function"==typeof k)try{if(m=t.props,y=(l=k.contextType)&&r[l.__c],b=l?y?y.props.value:l.__:r,n.__c?v=(d=t.__c=n.__c).__=d.__E:("prototype"in k&&k.prototype.render?t.__c=d=new k(m,b):(t.__c=d=new tr(m,b),d.constructor=k,d.render=mr),y&&y.sub(d),d.props=m,d.state||(d.state={}),d.context=b,d.__n=r,p=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Yn({},d.__s)),Yn(d.__s,k.getDerivedStateFromProps(m,d.__s))),f=d.props,h=d.state,d.__v=t,p)null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==k.getDerivedStateFromProps&&m!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(m,b),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(m,d.__s,b)||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)})),C=0;C<d._sb.length;C++)d.__h.push(d._sb[C]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(m,d.__s,b),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(f,h,g)}))}if(d.context=b,d.props=m,d.__P=e,d.__e=!1,_=Hn.__r,I=0,"prototype"in k&&k.prototype.render){for(d.state=d.__s,d.__d=!1,_&&_(t),l=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,_&&_(t),l=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(r=Yn(Yn({},r),d.getChildContext())),p||null==d.getSnapshotBeforeUpdate||(g=d.getSnapshotBeforeUpdate(f,h)),ar(e,zn(w=null!=l&&l.type===er&&null==l.key?l.props.children:l)?w:[w],t,n,r,o,i,a,s,c,u),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),v&&(d.__E=d.__=null)}catch(e){t.__v=null,c||null!=i?(t.__e=s,t.__u|=c?160:32,i[i.indexOf(s)]=null):(t.__e=n.__e,t.__k=n.__k),Hn.__e(e,t,n)}else null==i&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,o,i,a,s,c){var u,l,d,p,f,h,g,v=n.props,m=t.props,y=t.type;if("svg"===y&&(o=!0),null!=i)for(u=0;u<i.length;u++)if((f=i[u])&&"setAttribute"in f==!!y&&(y?f.localName===y:3===f.nodeType)){e=f,i[u]=null;break}if(null==e){if(null===y)return document.createTextNode(m);e=o?document.createElementNS("http://www.w3.org/2000/svg",y):document.createElement(y,m.is&&m),i=null,s=!1}if(null===y)v===m||s&&e.data===m||(e.data=m);else{if(i=i&&Pn.call(e.childNodes),v=n.props||Gn,!s&&null!=i)for(v={},u=0;u<e.attributes.length;u++)v[(f=e.attributes[u]).name]=f.value;for(u in v)f=v[u],"children"==u||("dangerouslySetInnerHTML"==u?d=f:"key"===u||u in m||lr(e,u,null,f,o));for(u in m)f=m[u],"children"==u?p=f:"dangerouslySetInnerHTML"==u?l=f:"value"==u?h=f:"checked"==u?g=f:"key"===u||s&&"function"!=typeof f||v[u]===f||lr(e,u,f,v[u],o);if(l)s||d&&(l.__html===d.__html||l.__html===e.innerHTML)||(e.innerHTML=l.__html),t.__k=[];else if(d&&(e.innerHTML=""),ar(e,zn(p)?p:[p],t,n,r,o&&"foreignObject"!==y,i,a,i?i[0]:n.__k&&nr(n,0),s,c),null!=i)for(u=i.length;u--;)null!=i[u]&&Jn(i[u]);s||(u="value",void 0!==h&&(h!==e[u]||"progress"===y&&!h||"option"===y&&h!==v[u])&&lr(e,u,h,v[u],!1),u="checked",void 0!==g&&g!==e[u]&&lr(e,u,g,v[u],!1))}return e}(n.__e,t,n,r,o,i,a,c,u);(l=Hn.diffed)&&l(t)}function hr(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)gr(n[r],n[++r],n[++r]);Hn.__c&&Hn.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Hn.__e(e,t.__v)}}))}function gr(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Hn.__e(e,n)}}function vr(e,t,n){var r,o;if(Hn.unmount&&Hn.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||gr(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Hn.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&vr(r[o],t,n||"function"!=typeof e.type);n||null==e.__e||Jn(e.__e),e.__=e.__e=e.__d=void 0}function mr(e,t,n){return this.constructor(e,n)}function yr(e,t,n){var r,o,i,a;Hn.__&&Hn.__(e,t),o=(r="function"==typeof n)?null:n&&n.__k||t.__k,i=[],a=[],fr(t,e=(!r&&n||t).__k=Xn(er,null,[e]),o||Gn,Gn,void 0!==t.ownerSVGElement,!r&&n?[n]:o?null:t.firstChild?Pn.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r,a),hr(i,e,a)}function br(e,t,n){var r,o,i,a,s=Yn({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==i?r=t[i]:"ref"==i?o=t[i]:s[i]=void 0===t[i]&&void 0!==a?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?Pn.call(arguments,2):n),$n(e.type,s,r||e.key,o||e.ref,null)}Pn=Kn.slice,Hn={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},Bn=0,tr.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Yn({},this.state),"function"==typeof e&&(e=e(Yn({},n),this.props)),e&&Yn(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),or(this))},tr.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),or(this))},tr.prototype.render=er,Wn=[],Vn="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Un=function(e,t){return e.__v.__b-t.__v.__b},ir.__r=0,jn=0;var Cr=$t,_r=rn,Ir=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(wr((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 Sr(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 wr(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xr;"#"===t[0]&&(e=Sr(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=Sr(n)),!e)return"black";var r=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(r){var o=parseInt(r[1]),i=parseInt(r[2]),a=parseInt(r[3]);return Math.sqrt(o*o*.299+i*i*.587+a*a*.114)>127.5?"black":"white"}return"black"}var kr={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"},xr="#eeeded",Ar=function(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;o&&(localStorage.setItem(Lr(r),"true"),o.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=o.get_session_replay_url)||void 0===e?void 0:e.call(o)},n),{},{$set:u({},Rr(r,"responded"),!0)})),Cr.dispatchEvent(new Event("PHSurveySent")))},Tr=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:u({},Rr(e,"dismissed"),!0)}),localStorage.setItem(Lr(e),"true"),Cr.dispatchEvent(new Event("PHSurveyClosed")))},Mr=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}))},Er=function(e,t){return e.length===t.length&&e.every((function(e,n){return e===t[n]}))?t.reverse():t},Nr=function(e){return e.questions.forEach((function(e,t){e.originalQuestionIndex=t})),e.appearance&&e.appearance.shuffleQuestions?Er(e.questions,Mr(e.questions)):e.questions},Or=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,o,i,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===(o=e.conditions)||void 0===o||null===(i=o.events)||void 0===i||null===(a=i.values)||void 0===a?void 0:a.length)>0}(e))},Lr=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},Rr=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},Fr=function(e,t){var n={__c:t="__cC"+jn++,__: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,or(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}),Dr=function(e){var t=e.component,n=e.children,r=e.renderAsHtml,o=e.style;return br(t,r?{dangerouslySetInnerHTML:{__html:n},style:o}:{children:n,style:o})},qr=rn;var Pr,Hr,Br,Wr,Zr=0,Vr=[],Ur=[],jr=Hn.__b,Gr=Hn.__r,Kr=Hn.diffed,Qr=Hn.__c,zr=Hn.unmount;function Yr(e,t){Hn.__h&&Hn.__h(Hr,e,Zr||t),Zr=0;var n=Hr.__H||(Hr.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Ur}),n.__[e]}function Jr(e){return Zr=1,function(e,t,n){var r=Yr(Pr++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):co(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=Hr,!Hr.u)){var o=function(e,t,n){if(!r.__c.__H)return!0;var o=r.__c.__H.__.filter((function(e){return e.__c}));if(o.every((function(e){return!e.__N})))return!i||i.call(this,e,t,n);var a=!1;return o.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)&&(!i||i.call(this,e,t,n))};Hr.u=!0;var i=Hr.shouldComponentUpdate,a=Hr.componentWillUpdate;Hr.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,o(e,t,n),i=r}a&&a.call(this,e,t,n)},Hr.shouldComponentUpdate=o}return r.__N||r.__}(co,e)}function Xr(e,t){var n=Yr(Pr++,3);!Hn.__s&&so(n.__H,t)&&(n.__=e,n.i=t,Hr.__H.__h.push(n))}function $r(e){return Zr=5,eo((function(){return{current:e}}),[])}function eo(e,t){var n=Yr(Pr++,7);return so(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function to(e){var t=Hr.context[e.__c],n=Yr(Pr++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Hr)),t.props.value):e.__}function no(){for(var e;e=Vr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(io),e.__H.__h.forEach(ao),e.__H.__h=[]}catch(t){e.__H.__h=[],Hn.__e(t,e.__v)}}Hn.__b=function(e){Hr=null,jr&&jr(e)},Hn.__r=function(e){Gr&&Gr(e),Pr=0;var t=(Hr=e.__c).__H;t&&(Br===Hr?(t.__h=[],Hr.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=Ur,e.__N=e.i=void 0}))):(t.__h.forEach(io),t.__h.forEach(ao),t.__h=[],Pr=0)),Br=Hr},Hn.diffed=function(e){Kr&&Kr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Vr.push(t)&&Wr===Hn.requestAnimationFrame||((Wr=Hn.requestAnimationFrame)||oo)(no)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==Ur&&(e.__=e.__V),e.i=void 0,e.__V=Ur}))),Br=Hr=null},Hn.__c=function(e,t){t.some((function(e){try{e.__h.forEach(io),e.__h=e.__h.filter((function(e){return!e.__||ao(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Hn.__e(n,e.__v)}})),Qr&&Qr(e,t)},Hn.unmount=function(e){zr&&zr(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{io(e)}catch(e){t=e}})),n.__H=void 0,t&&Hn.__e(t,n.__v))};var ro="function"==typeof requestAnimationFrame;function oo(e){var t,n=function(){clearTimeout(r),ro&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ro&&(t=requestAnimationFrame(n))}function io(e){var t=Hr,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Hr=t}function ao(e){var t=Hr;e.__c=e.__(),Hr=t}function so(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function co(e,t){return"function"==typeof t?t(e):t}var uo=0;function lo(e,t,n,r,o,i){var a,s,c={};for(s in t)"ref"==s?a=t[s]:c[s]=t[s];var u={type:e,props:c,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--uo,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof e&&(a=e.defaultProps))for(s in a)void 0===c[s]&&(c[s]=a[s]);return Hn.vnode&&Hn.vnode(u),u}var po=lo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:lo("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"})}),fo=lo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:lo("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"})}),ho=lo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:lo("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"})}),go=lo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:lo("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"})}),vo=lo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:lo("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"})}),mo=lo("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:lo("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"})}),yo=lo("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[lo("g",{"clip-path":"url(#clip0_2415_6911)",children:[lo("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:lo("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),lo("g",{mask:"url(#mask0_2415_6911)",children:[lo("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"}),lo("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"}),lo("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"}),lo("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"}),lo("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"}),lo("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"})]})]}),lo("defs",{children:lo("clipPath",{id:"clip0_2415_6911",children:lo("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]}),bo=lo("svg",{width:"16",height:"12",viewBox:"0 0 16 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:lo("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 Co(){return lo("a",{href:"https://posthog.com",target:"_blank",rel:"noopener",className:"footer-branding",children:["Survey by ",yo]})}function _o(e){var t=e.text,n=e.submitDisabled,r=e.appearance,o=e.onSubmit,i=e.link,a=to(Fr),s=a.isPreviewMode,c=a.isPopup,u=r.submitButtonTextColor||wr(r.submitButtonColor||kr.submitButtonColor);return lo("div",{className:"bottom-section",children:[lo("div",{className:"buttons",children:lo("button",{className:"form-submit",disabled:n&&!s,type:"button",style:c?{color:u}:{},onClick:function(){s||(i&&(null==$t||$t.open(i)),o())},children:t})}),!r.whiteLabel&&lo(Co,{})]})}function Io(e){var t=e.question,n=e.description,r=e.descriptionContentType,o=e.backgroundColor,i=e.forceDisableHtml;return lo("div",{style:to(Fr).isPopup?{backgroundColor:o||kr.backgroundColor}:{},children:[lo("div",{className:"survey-question",children:t}),n&&Dr({component:Xn("div",{className:"survey-question-description"}),children:n,renderAsHtml:!i&&"text"!==r})]})}function So(e){return lo("div",{className:"cancel-btn-wrapper",children:lo("button",{className:"form-cancel",onClick:e.onClick,disabled:to(Fr).isPreviewMode,children:mo})})}function wo(e){var n=e.header,r=e.description,o=e.contentType,i=e.forceDisableHtml,a=e.appearance,s=e.onClose,c=e.styleOverrides,u=wr(a.backgroundColor||kr.backgroundColor),l=to(Fr).isPopup;return lo(er,{children:lo("div",{className:"thank-you-message",style:t({},c),children:lo("div",{className:"thank-you-message-container",children:[l&&lo(So,{onClick:function(){return s()}}),lo("h3",{className:"thank-you-message-header",style:{color:u},children:n}),r&&Dr({component:Xn("div",{className:"thank-you-message-body"}),children:r,renderAsHtml:!i&&"text"!==o,style:{color:u}}),l&&lo(_o,{text:a.thankYouMessageCloseButtonText||"Close",submitDisabled:!1,appearance:a,onSubmit:function(){return s()}})]})})})}function ko(e){var t,n=$r(null),r=l(Jr(null!==(t=e.defaultTextColor)&&void 0!==t?t:"black"),2),o=r[0],i=r[1];return Xr((function(){if(n.current){var e=function(e){var t=Cr.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]),o=parseInt(n[2]),i=parseInt(n[3]);return Math.sqrt(r*r*.299+o*o*.587+i*i*.114)>127.5?"black":"white"}(n.current);i(e)}}),[e.appearance,e.forceUpdate]),{ref:n,textColor:o}}function xo(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,o=e.onSubmit,i=$r(null),a=l(Jr(""),2),s=a[0],c=a[1];return lo("div",{ref:i,children:[lo(Io,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,backgroundColor:r.backgroundColor,forceDisableHtml:n}),lo("textarea",{rows:4,placeholder:null==r?void 0:r.placeholder,onInput:function(e){return c(e.currentTarget.value)}}),lo(_o,{text:t.buttonText||"Submit",submitDisabled:!s&&!t.optional,appearance:r,onSubmit:function(){return o(s)}})]})}function Ao(e){var t=e.question,n=e.forceDisableHtml,r=e.appearance,o=e.onSubmit;return lo(er,{children:[lo(Io,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n}),lo(_o,{text:t.buttonText||"Submit",submitDisabled:!1,link:t.link,appearance:r,onSubmit:function(){return o("link clicked")}})]})}function To(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,o=e.appearance,i=e.onSubmit,a=t.scale,s=10===t.scale?0:1,c=l(Jr(null),2),u=c[0],d=c[1];return lo(er,{children:[lo(Io,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:o.backgroundColor}),lo("div",{className:"rating-section",children:[lo("div",{className:"rating-options",children:["emoji"===t.display&&lo("div",{className:"rating-options-emoji",children:(3===t.scale?No:Oo).map((function(e,t){var n=t+1===u;return lo("button",{className:"ratings-emoji question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),value:t+1,type:"button",onClick:function(){d(t+1)},style:{fill:n?o.ratingButtonActiveColor:o.ratingButtonColor,borderColor:o.borderColor},children:e},t)}))}),"number"===t.display&&lo("div",{className:"rating-options-number",style:{gridTemplateColumns:"repeat(".concat(a-s+1,", minmax(0, 1fr))")},children:Do(t.scale).map((function(e,t){return lo(Mo,{displayQuestionIndex:r,active:u===e,appearance:o,num:e,setActiveNumber:function(e){d(e)}},t)}))})]}),lo("div",{className:"rating-text",children:[lo("div",{children:t.lowerBoundLabel}),lo("div",{children:t.upperBoundLabel})]})]}),lo(_o,{text:t.buttonText||(null==o?void 0:o.submitButtonText)||"Submit",submitDisabled:Kt(u)&&!t.optional,appearance:o,onSubmit:function(){return i(u)}})]})}function Mo(e){var t=e.num,n=e.active,r=e.displayQuestionIndex,o=e.appearance,i=e.setActiveNumber,a=ko({appearance:o,defaultTextColor:"black",forceUpdate:n}),s=a.textColor;return lo("button",{ref:a.ref,className:"ratings-number question-".concat(r,"-rating-").concat(t," ").concat(n?"rating-active":null),type:"button",onClick:function(){i(t)},style:{color:s,backgroundColor:n?o.ratingButtonActiveColor:o.ratingButtonColor,borderColor:o.borderColor},children:t})}function Eo(e){var t=e.question,n=e.forceDisableHtml,r=e.displayQuestionIndex,o=e.appearance,i=e.onSubmit,a=$r(null),s=eo((function(){return function(e){if(!e.shuffleOptions)return e.choices;var t=e.choices,n="";e.hasOpenChoice&&(n=t.pop());var r=Er(t,Mr(t));return e.hasOpenChoice&&(e.choices.push(n),r.push(n)),r}(t)}),[t]),c=l(Jr(t.type===Fn.MultipleChoice?[]:null),2),u=c[0],p=c[1],f=l(Jr(!1),2),h=f[0],g=f[1],v=l(Jr(""),2),m=v[0],y=v[1],b=t.type===Fn.SingleChoice?"radio":"checkbox";return lo("div",{ref:a,children:[lo(Io,{question:t.question,description:t.description,descriptionContentType:t.descriptionContentType,forceDisableHtml:n,backgroundColor:o.backgroundColor}),lo("div",{className:"multiple-choice-options",children:s.map((function(e,n){var o="choice-option",i=e,a=e;return t.hasOpenChoice&&n===t.choices.length-1&&(o+=" choice-option-open"),lo("div",{className:o,children:[lo("input",{type:b,id:"surveyQuestion".concat(r,"Choice").concat(n),name:"question".concat(r),value:i,disabled:!i,onInput:function(){return t.hasOpenChoice&&n===t.choices.length-1?g(!h):t.type===Fn.SingleChoice?p(i):t.type===Fn.MultipleChoice&&Wt(u)?u.includes(i)?p(u.filter((function(e){return e!==i}))):p([].concat(d(u),[i])):void 0}}),lo("label",{htmlFor:"surveyQuestion".concat(r,"Choice").concat(n),style:{color:"black"},children:t.hasOpenChoice&&n===t.choices.length-1?lo(er,{children:[lo("span",{children:[a,":"]}),lo("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===Fn.SingleChoice?p(n):t.type===Fn.MultipleChoice&&Wt(u)?y(n):void 0}})]}):a}),lo("span",{className:"choice-check",style:{color:"black"},children:bo})]})}))}),lo(_o,{text:t.buttonText||"Submit",submitDisabled:(Kt(u)||Wt(u)&&!h&&0===u.length||Wt(u)&&h&&!m&&0===u.length&&!t.optional)&&!t.optional,appearance:o,onSubmit:function(){h&&t.type===Fn.MultipleChoice?Wt(u)&&i([].concat(d(u),[m])):i(u)}})]})}var No=[ho,fo,po],Oo=[go,ho,fo,po,vo],Lo=[1,2,3,4,5],Ro=[1,2,3,4,5,6,7],Fo=[0,1,2,3,4,5,6,7,8,9,10];function Do(e){switch(e){case 5:default:return Lo;case 7:return Ro;case 10:return Fo}}var qo=$t,Po=rn,Ho=function(){function e(t){var n=this;a(this,e),u(this,"canShowNextEventBasedSurvey",(function(){var e,t=Po.querySelectorAll("div[class^=PostHogSurvey]");return!(t.length>0)||1===(null===(e=t[t.length-1].shadowRoot)||void 0===e?void 0:e.childElementCount)})),u(this,"handlePopoverSurvey",(function(e){var t,r=null===(t=e.conditions)||void 0===t?void 0:t.seenSurveyWaitPeriodInDays,o=localStorage.getItem("lastSeenSurveyDate");if(r&&o){var i=new Date,a=Math.abs(i.getTime()-new Date(o).getTime());if(Math.ceil(a/864e5)<r)return}var s=function(e){return!!localStorage.getItem(Lr(e))&&!Or(e)}(e);if(!s){n.addSurveyToFocus(e.id);var c=function(e,t,n){var r=_r.createElement("div");r.className="PostHogSurvey".concat(t);var o=r.attachShadow({mode:"open"});if(e){var i=Object.assign(_r.createElement("style"),{innerText:e});o.appendChild(i)}return(n||_r.body).appendChild(r),o}(Ir(null==e?void 0:e.appearance),e.id);yr(lo(Wo,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!0},"popover-survey"),c)}})),u(this,"handleWidget",(function(e){var t=function(e){var t,n=qr.createElement("div");n.className="PostHogWidget".concat(e.id);var r,o=n.attachShadow({mode:"open"}),i=(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 o.append(Object.assign(qr.createElement("style"),{innerText:i})),qr.body.appendChild(n),o}(e),r=Ir(e.appearance);t.appendChild(Object.assign(Po.createElement("style"),{innerText:r})),yr(lo(Vo,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus},"feedback-survey"),t)})),u(this,"handleWidgetSelector",(function(e){var t,r=(null===(t=e.appearance)||void 0===t?void 0:t.widgetSelector)&&Po.querySelector(e.appearance.widgetSelector);if(r)if(0===Po.querySelectorAll(".PostHogWidget".concat(e.id)).length)n.handleWidget(e);else if(1===Po.querySelectorAll(".PostHogWidget".concat(e.id)).length&&!r.getAttribute("PHWidgetSurveyClickListener")){var o,i,a=null===(o=Po.querySelector(".PostHogWidget".concat(e.id)))||void 0===o||null===(i=o.shadowRoot)||void 0===i?void 0:i.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")}})),u(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!=Rn.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)})),u(this,"renderSurvey",(function(e,t){yr(lo(Wo,{posthog:n.posthog,survey:e,removeSurveyFromFocus:n.removeSurveyFromFocus,isPopup:!1},"popover-survey"),t)})),u(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(Kt(n.surveyInFocus)){var t,r,o;if(e.type===Rn.Widget)"tab"===(null===(t=e.appearance)||void 0===t?void 0:t.widgetType)&&0===Po.querySelectorAll(".PostHogWidget".concat(e.id)).length&&n.handleWidget(e),"selector"===(null===(r=e.appearance)||void 0===r?void 0:r.widgetType)&&null!==(o=e.appearance)&&void 0!==o&&o.widgetSelector&&n.handleWidgetSelector(e);e.type===Rn.Popover&&n.canShowNextEventBasedSurvey()&&n.handlePopoverSurvey(e)}}))}),t)})),u(this,"addSurveyToFocus",(function(e){Kt(n.surveyInFocus)||sn.error("Survey ".concat(d(n.surveyInFocus)," already in focus. Cannot add survey ").concat(e,".")),n.surveyInFocus=e})),u(this,"removeSurveyFromFocus",(function(e){n.surveyInFocus!==e&&sn.error("Survey ".concat(e," is not in focus. Cannot remove survey ").concat(e,".")),n.surveyInFocus=null})),this.posthog=t,this.surveyInFocus=null}return c(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 Bo(e){if(Po&&qo){var t=new Ho(e);return t.callSurveysAndEvaluateDisplayLogic(!0),setInterval((function(){t.callSurveysAndEvaluateDisplayLogic(!1)}),1e3),t}}function Wo(e){var n,r,o,i,a,s,c=e.survey,u=e.forceDisableHtml,d=e.posthog,p=e.style,f=e.previewPageIndex,h=e.removeSurveyFromFocus,g=e.isPopup,v=Number.isInteger(f),m=null!==(n=c.appearance)&&void 0!==n&&n.surveyPopupDelaySeconds?1e3*c.appearance.surveyPopupDelaySeconds:0,y=function(e,t,n,r,o){var i=l(Jr(r||0===n),2),a=i[0],s=i[1],c=l(Jr(!1),2),u=c[0],d=c[1];return Xr((function(){if(!r&&t){var i,a=function(){o(e.id),s(!1)},c=function(){var t,n;null!==(t=e.appearance)&&void 0!==t&&t.displayThankYouMessage?(d(!0),o(e.id),null!==(n=e.appearance)&&void 0!==n&&n.autoDisappear&&setTimeout((function(){s(!1)}),5e3)):(o(e.id),s(!1))},u=function(){var n;s(!0),qo.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 qo.addEventListener("PHSurveyClosed",a),qo.addEventListener("PHSurveySent",c),n>0?(i=setTimeout((function(){u()}),n),function(){clearTimeout(i),qo.removeEventListener("PHSurveyClosed",a),qo.removeEventListener("PHSurveySent",c)}):(u(),function(){qo.removeEventListener("PHSurveyClosed",a),qo.removeEventListener("PHSurveySent",c)})}}),[]),{isPopupVisible:a,isSurveySent:u,setIsPopupVisible:s}}(c,d,m,v,h),b=y.isPopupVisible,C=y.isSurveySent,_=y.setIsPopupVisible,I=C||f===c.questions.length,S=null!==(r=p)&&void 0!==r&&r.left&&zt(null===(o=p)||void 0===o?void 0:o.left)?{left:p.left-40}:{};return v&&((p=p||{}).left="unset",p.right="unset",p.transform="unset"),b?lo(Fr.Provider,{value:{isPreviewMode:v,previewPageIndex:f,handleCloseSurveyPopup:function(){return Tr(c,d,v)},isPopup:g||!1},children:I?lo(wo,{header:(null===(i=c.appearance)||void 0===i?void 0:i.thankYouMessageHeader)||"Thank you!",description:(null===(a=c.appearance)||void 0===a?void 0:a.thankYouMessageDescription)||"",forceDisableHtml:!!u,contentType:null===(s=c.appearance)||void 0===s?void 0:s.thankYouMessageDescriptionContentType,appearance:c.appearance||kr,styleOverrides:t(t({},p),S),onClose:function(){return _(!1)}}):lo(Zo,{survey:c,forceDisableHtml:!!u,posthog:d,styleOverrides:p})}):lo(er,{})}function Zo(e){var n,r,o=e.survey,i=e.forceDisableHtml,a=e.posthog,s=e.styleOverrides,c=wr((null===(n=o.appearance)||void 0===n?void 0:n.backgroundColor)||kr.backgroundColor),d=l(Jr({}),2),p=d[0],f=d[1],h=to(Fr),g=h.isPreviewMode,v=h.previewPageIndex,m=h.handleCloseSurveyPopup,y=h.isPopup,b=l(Jr(v||0),2),C=b[0],_=b[1],I=eo((function(){return Nr(o)}),[o]);Xr((function(){_(null!=v?v:0)}),[v]);return lo("form",{className:"survey-form",style:y?t({color:c,borderColor:null===(r=o.appearance)||void 0===r?void 0:r.borderColor},s):{},children:I.map((function(e,n){var r,s=e.originalQuestionIndex;return(g?C===s:C===n)&&lo("div",{className:"survey-box",style:y?{backgroundColor:(null===(r=o.appearance)||void 0===r?void 0:r.backgroundColor)||kr.backgroundColor}:{},children:[y&&lo(So,{onClick:function(){return m()}}),Uo({question:e,forceDisableHtml:i,displayQuestionIndex:n,appearance:o.appearance||kr,onSubmit:function(e){return function(e){var n=e.res,r=e.originalQuestionIndex,i=e.displayQuestionIndex;if(a){var s=0===r?"$survey_response":"$survey_response_".concat(r);if(f(t(t({},p),{},u({},s,n))),a.getNextSurveyStep){var c=a.getNextSurveyStep(o,i,n);c===Dn.End?Ar(t(t({},p),{},u({},s,n)),o,a):_(c)}else i===o.questions.length-1?Ar(t(t({},p),{},u({},s,n)),o,a):_(i+1)}}({res:e,originalQuestionIndex:s,displayQuestionIndex:n})}})]})}))})}function Vo(e){var t,n,r=e.survey,o=e.forceDisableHtml,i=e.posthog,a=e.readOnly,s=e.removeSurveyFromFocus,c=l(Jr(!1),2),u=c[0],d=c[1],p=l(Jr({}),2),f=p[0],h=p[1],g=$r(null);return Xr((function(){var e,t;if(!a&&i){if("tab"===(null===(e=r.appearance)||void 0===e?void 0:e.widgetType)&&g.current){var n,o=g.current.getBoundingClientRect(),s={top:"50%",left:parseInt("".concat(o.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 c=Po.querySelector(r.appearance.widgetSelector||"");null==c||c.addEventListener("click",(function(){d(!u)})),null==c||c.setAttribute("PHWidgetSurveyClickListener","true")}}}),[]),lo(er,{children:["tab"===(null===(t=r.appearance)||void 0===t?void 0:t.widgetType)&&lo("div",{className:"ph-survey-widget-tab",ref:g,onClick:function(){return!a&&d(!u)},style:{color:wr(r.appearance.widgetColor)},children:[lo("div",{className:"ph-survey-widget-tab-icon"}),(null===(n=r.appearance)||void 0===n?void 0:n.widgetLabel)||""]}),u&&lo(Wo,{posthog:i,survey:r,forceDisableHtml:o,style:f,removeSurveyFromFocus:s,isPopup:!0},"feedback-widget-survey")]})}var Uo=function(e){var n,r,o=e.question,i=e.forceDisableHtml,a=e.displayQuestionIndex,s=e.appearance,c=e.onSubmit,l=(u(n={},Fn.Open,xo),u(n,Fn.Link,Ao),u(n,Fn.Rating,To),u(n,Fn.SingleChoice,Eo),u(n,Fn.MultipleChoice,Eo),n),d={question:o,forceDisableHtml:i,appearance:s,onSubmit:c},p=(u(r={},Fn.Open,{}),u(r,Fn.Link,{}),u(r,Fn.Rating,{displayQuestionIndex:a}),u(r,Fn.SingleChoice,{displayQuestionIndex:a}),u(r,Fn.MultipleChoice,{displayQuestionIndex:a}),r),f=l[o.type],h=t(t({},d),p[o.type]);return lo(f,t({},h))};function jo(e){return!Ut(Event)&&Go(e,Event)}function Go(e,t){try{return e instanceof t}catch(e){return!1}}function Ko(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function Qo(e){return Ko(e,"DOMError")}on.__PosthogExtensions__=on.__PosthogExtensions__||{},on.__PosthogExtensions__.canActivateRepeatedly=Or,on.__PosthogExtensions__.generateSurveys=Bo,on.extendPostHogWithSurveys=Bo;var zo=/\(error: (.*)\)/,Yo=50,Jo="?";function Xo(e,t,n,r){var o={filename:e,function:t,in_app:!0};return Ut(n)||(o.lineno=n),Ut(r)||(o.colno=r),o}var $o=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ei=/\((\S*)(?::(\d+))(?::(\d+))\)/,ti=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ni=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ri=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var oi,ii=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=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=[],i=e.split("\n"),a=n;a<i.length;a++){var s=i[a];if(!(s.length>1024)){var c=zo.test(s)?s.replace(zo,"$1"):s;if(!c.match(/\S*Error: /)){var u,l=h(o);try{for(l.s();!(u=l.n()).done;){var d=(0,u.value)(c);if(d){r.push(d);break}}}catch(e){l.e(e)}finally{l.f()}if(r.length>=Yo)break}}}return function(e){if(!e.length)return[];var n=e.slice(0,Yo);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=$o.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){var n=ei.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}var r=l(ai(t[1]||Jo,t[2]),2),o=r[0];return Xo(r[1],o,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,function(e){var t=ti.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=ni.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],o=t[1]||Jo,i=l(ai(o,r),2);return o=i[0],Xo(r=i[1],o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],[40,function(e){var t=ri.exec(e);return t?Xo(t[2],t[1]||Jo,+t[3],t[4]?+t[4]:void 0):void 0}]]),ai=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]:Jo,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]};!function(e){e.GZipJS="gzip-js",e.Base64="base64"}(oi||(oi={}));var si=["fatal","error","warning","log","info","debug"],ci=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,ui=/Minified React error #\d+;/i;function li(e){var t=e.stacktrace||e.stack||"",n=function(e){if(e){if(zt(e.framesToPop))return e.framesToPop;if(ui.test(e.message))return 1}return 0}(e);try{return ii(t,n)}catch(e){}return[]}function di(e){var t=li(e);return{$exception_type:e.name,$exception_message:e.message,$exception_stack_trace_raw:JSON.stringify(t),$exception_level:"error"}}function pi(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 o=n.slice(0,r).join(", ");if(!(o.length>t))return r===n.length||o.length<=t?o:"".concat(o.slice(0,t),"...")}return""}function fi(e){return jt(e)&&!Gt(e)&&si.indexOf(e)>=0}function hi(e){var n=l(e,5),r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],c={};if(Ut(s)&&jt(r)){var u="Error",d=r,p=r.match(ci);p&&(u=p[1],d=p[2]),c={$exception_type:u,$exception_message:d}}var f=s||r;if(Qo(f)||function(e){return Ko(e,"DOMException")}(f)){var h=f;if(function(e){return"stack"in e}(f))c=di(f);else{var g=h.name||(Qo(h)?"DOMError":"DOMException"),v=h.message?"".concat(g,": ").concat(h.message):g;c=function(e){return{$exception_type:"Error",$exception_message:e,$exception_level:"error"}}(v),c.$exception_type=Qo(h)?"DOMError":"DOMException",c.$exception_message=c.$exception_message||v}"code"in h&&(c.$exception_DOMException_code="".concat(h.code))}else if(function(e){return Ko(e,"ErrorEvent")}(f)&&f.error)c=di(f.error);else if(function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Go(e,Error)}}(f))c=di(f);else if(function(e){return Ko(e,"Object")}(f)||jo(f)){c=function(e){return{$exception_type:jo(e)?e.constructor.name:"Error",$exception_message:"Non-Error ".concat("exception"," captured with keys: ",pi(e)),$exception_level:fi(e.level)?e.level:"error"}}(f),c.$exception_is_synthetic=!0}else c.$exception_type=c.$exception_type||"Error",c.$exception_message=c.$exception_message||f,c.$exception_is_synthetic=!0;return t(t(t(t({},c),{},{$exception_type:c.$exception_type||"UnknownErrorType",$exception_message:c.$exception_message||"",$exception_level:fi(c.$exception_level)?c.$exception_level:"error"},o?{$exception_source:o}:{}),i?{$exception_lineno:i}:{}),a?{$exception_colno:a}:{})}function gi(e){var n=l(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 o,i={};return(i=Kt(o=r)||!Vt(o)&&!Zt(o)?{$exception_message:"Non-Error promise rejection captured with value: ".concat(String(r))}:hi([r])).$exception_handled=!1,t(t({},i),{},{$exception_type:i.$exception_type="UnhandledRejection",$exception_message:i.$exception_message=i.$exception_message||n.reason||String(r),$exception_level:fi(i.$exception_level)?i.$exception_level:"error"})}var vi={wrapOnError:function(e){var t=$t;t||sn.info("window not available, cannot wrap onerror");var n=t.onerror;return t.onerror=function(){for(var t,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var a=hi(o);return e(a),null!==(t=null==n?void 0:n.apply(void 0,o))&&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=$t;t||sn.info("window not available, cannot wrap onUnhandledRejection");var n=t.onunhandledrejection;return t.onunhandledrejection=function(){for(var r,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];var s=gi(i);return e(s),null!==(r=null==n?void 0:n.apply(t,i))&&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}}};on.__PosthogExtensions__=on.__PosthogExtensions__||{},on.__PosthogExtensions__.errorWrappingFunctions=vi,on.__PosthogExtensions__.parseErrorAsProperties=hi,on.posthogErrorWrappingFunctions=vi,on.parseErrorAsProperties=hi;var mi=function(e,t){var n=e.checkAndGetSessionAndWindowId(!0),r=n.sessionId,o=n.windowId;t.headers.set("X-POSTHOG-SESSION-ID",r),t.headers.set("X-POSTHOG-WINDOW-ID",o)};on.__PosthogExtensions__=on.__PosthogExtensions__||{};var yi={_patchFetch:function(e){return pn($t,"fetch",(function(t){return function(){var r=i(n().mark((function r(o,i){var a;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=new Request(o,i),mi(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 pn($t.XMLHttpRequest.prototype,"open",(function(t){return function(n,r){var o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,s=new Request(r);return mi(e,s),t.call(this,n,s.url,o,i,a)}}))}};on.__PosthogExtensions__.tracingHeadersPatchFns=yi,on.postHogTracingHeadersPatchFns=yi;var bi,Ci,_i,Ii=-1,Si=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Ii=t.timeStamp,e(t))}),!0)},wi=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ki=function(){var e=wi();return e&&e.activationStart||0},xi=function(e,t){var n=wi(),r="navigate";return Ii>=0?r="back-forward-cache":n&&(document.prerendering||ki()>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}},Ai=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){}},Ti=function(e,t,n,r){var o,i;return function(a){t.value>=0&&(a||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Mi=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Ei=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Ni=function(e){var t=!1;return function(){t||(e(),t=!0)}},Oi=-1,Li=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Ri=function(e){"hidden"===document.visibilityState&&Oi>-1&&(Oi="visibilitychange"===e.type?e.timeStamp:0,Di())},Fi=function(){addEventListener("visibilitychange",Ri,!0),addEventListener("prerenderingchange",Ri,!0)},Di=function(){removeEventListener("visibilitychange",Ri,!0),removeEventListener("prerenderingchange",Ri,!0)},qi=function(){return Oi<0&&(Oi=Li(),Fi(),Si((function(){setTimeout((function(){Oi=Li(),Fi()}),0)}))),{get firstHiddenTime(){return Oi}}},Pi=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Hi=[1800,3e3],Bi=function(e,t){t=t||{},Pi((function(){var n,r=qi(),o=xi("FCP"),i=Ai("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime<r.firstHiddenTime&&(o.value=Math.max(e.startTime-ki(),0),o.entries.push(e),n(!0)))}))}));i&&(n=Ti(e,o,Hi,t.reportAllChanges),Si((function(r){o=xi("FCP"),n=Ti(e,o,Hi,t.reportAllChanges),Mi((function(){o.value=performance.now()-r.timeStamp,n(!0)}))})))}))},Wi=[.1,.25],Zi=[2500,4e3],Vi={},Ui=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ji=function(e){if("loading"===document.readyState)return"loading";var t=Ui();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},Gi=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Ki=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var r=e,o=r.id?"#"+r.id:Gi(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?"."+r.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+o.length>(t||100)-1)return n||o;if(n=n?o+">"+n:o,r.id)break;e=r.parentNode}}catch(e){}return n},Qi=-1,zi=function(e,t){var n=Ui(),r="navigate";return Qi>=0?r="back-forward-cache":n&&(document.prerendering||function(){var e=Ui();return e&&e.activationStart||0}()>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}},Yi=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){}},Ji=function(e,t,n,r){var o,i;return function(a){t.value>=0&&(a||r)&&((i=t.value-(o||0))||void 0===o)&&(o=t.value,t.delta=i,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Xi=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},$i=0,ea=1/0,ta=0,na=function(e){e.forEach((function(e){e.interactionId&&(ea=Math.min(ea,e.interactionId),ta=Math.max(ta,e.interactionId),$i=ta?(ta-ea)/7+1:0)}))},ra=function(){"interactionCount"in performance||bi||(bi=Yi("event",na,{type:"event",buffered:!0,durationThreshold:0}))},oa=[],ia=new Map,aa=0,sa=function(){return(bi?$i:performance.interactionCount||0)-aa},ca=[],ua=function(e){if(ca.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=oa[oa.length-1],n=ia.get(e.interactionId);if(n||oa.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]};ia.set(r.id,r),oa.push(r)}oa.sort((function(e,t){return t.latency-e.latency})),oa.length>10&&oa.splice(10).forEach((function(e){return ia.delete(e.id)}))}}},la=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=function(e){var t=!1;return function(){t||(e(),t=!0)}}(e),"hidden"===document.visibilityState?e():(n=t(e),Xi(e)),n},da=[200,500],pa=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()}((function(){var n;ra();var r,o=zi("INP"),i=function(e){la((function(){e.forEach(ua);var t,n=(t=Math.min(oa.length-1,Math.floor(sa()/50)),oa[t]);n&&n.latency!==o.value&&(o.value=n.latency,o.entries=n.entries,r())}))},a=Yi("event",i,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=Ji(e,o,da,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),Xi((function(){i(a.takeRecords()),r(!0)})),function(e){addEventListener("pageshow",(function(t){t.persisted&&(Qi=t.timeStamp,e(t))}),!0)}((function(){aa=0,oa.length=0,ia.clear(),o=zi("INP"),r=Ji(e,o,da,t.reportAllChanges)})))})))},fa=[],ha=[],ga=new WeakMap,va=new Map,ma=-1,ya=function(e){fa=fa.concat(e),ba()},ba=function(){ma<0&&(ma=la(Ca))},Ca=function(){va.size>10&&va.forEach((function(e,t){ia.has(t)||va.delete(t)}));var e=oa.map((function(e){return ga.get(e.entries[0])})),t=ha.length-50;ha=ha.filter((function(n,r){return r>=t||e.includes(n)}));for(var n=new Set,r=0;r<ha.length;r++){var o=ha[r];_a(o.startTime,o.processingEnd).forEach((function(e){n.add(e)}))}for(var i=0;i<50;i++){var a=fa[fa.length-1-i];if(!a||a.startTime<_i)break;n.add(a)}fa=Array.from(n),ma=-1};ca.push((function(e){e.interactionId&&e.target&&!va.has(e.interactionId)&&va.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;_i=Math.max(_i,e.processingEnd);for(var r=ha.length-1;r>=0;r--){var o=ha[r];if(Math.abs(n-o.renderTime)<=8){(t=o).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},ha.push(t)),(e.interactionId||"first-input"===e.entryType)&&ga.set(e,t),ba()}));var _a=function(e,t){for(var n,r=[],o=0;n=fa[o];o++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;r.push(n)}return r},Ia={onLCP:function(e,t){t=t||{},Pi((function(){var n,r=qi(),o=xi("LCP"),i=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<r.firstHiddenTime&&(o.value=Math.max(e.startTime-ki(),0),o.entries=[e],n())}))},a=Ai("largest-contentful-paint",i);if(a){n=Ti(e,o,Zi,t.reportAllChanges);var s=Ni((function(){Vi[o.id]||(i(a.takeRecords()),a.disconnect(),Vi[o.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Ni(e),"hidden"===document.visibilityState?e():(n=t(e),Ei(e)),n}(s)}),!0)})),Ei(s),Si((function(r){o=xi("LCP"),n=Ti(e,o,Zi,t.reportAllChanges),Mi((function(){o.value=performance.now()-r.timeStamp,Vi[o.id]=!0,n(!0)}))}))}}))},onCLS:function(e,t){t=t||{},Bi(Ni((function(){var n,r=xi("CLS",0),o=0,i=[],a=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=i[0],n=i[i.length-1];o&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(o+=e.value,i.push(e)):(o=e.value,i=[e])}})),o>r.value&&(r.value=o,r.entries=i,n())},s=Ai("layout-shift",a);s&&(n=Ti(e,r,Wi,t.reportAllChanges),Ei((function(){a(s.takeRecords()),n(!0)})),Si((function(){o=0,r=xi("CLS",0),n=Ti(e,r,Wi,t.reportAllChanges),Mi((function(){return n()}))})),setTimeout(n,0))})))},onFCP:Bi,onINP:function(e,t){Ci||(Ci=Yi("long-animation-frame",ya)),pa((function(t){var n=function(e){var t=e.entries[0],n=ga.get(t),r=t.processingStart,o=n.processingEnd,i=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),a=_a(t.startTime,o),s=e.entries.find((function(e){return e.target})),c=s&&s.target||va.get(t.interactionId),u=[t.startTime+t.duration,o].concat(a.map((function(e){return e.startTime+e.duration}))),l=Math.max.apply(Math,u),d={interactionTarget:Ki(c),interactionTargetElement:c,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:l,processedEventEntries:i,longAnimationFrameEntries:a,inputDelay:r-t.startTime,processingDuration:o-r,presentationDelay:Math.max(l-o,0),loadState:ji(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}};on.__PosthogExtensions__=on.__PosthogExtensions__||{},on.__PosthogExtensions__.postHogWebVitalsCallbacks=Ia,on.postHogWebVitalsCallbacks=Ia}();
|
|
17
17
|
//# sourceMappingURL=all-external-dependencies.js.map
|