harperdb 4.7.8 → 4.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.lazy-DhQph7si.js","assets/react-redux-C8VgMI21.js","assets/index-YHth6Ryl.css","assets/index-n1A9yxoS.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.lazy-WznRtvfY.js","assets/react-redux-DGTs_kVY.js","assets/index-YHth6Ryl.css","assets/index-zg8oq7u7.js"])))=>i.map(i=>d[i]);
2
2
  function Rq(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var lNe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ow={exports:{}},Wf={};var uA;function Iq(){if(uA)return Wf;uA=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var a=null;if(o!==void 0&&(a=""+o),i.key!==void 0&&(a=""+i.key),"key"in i){o={};for(var c in i)c!=="key"&&(o[c]=i[c])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:a,ref:i!==void 0?i:null,props:o}}return Wf.Fragment=t,Wf.jsx=n,Wf.jsxs=n,Wf}var dA;function Tq(){return dA||(dA=1,Ow.exports=Iq()),Ow.exports}var u=Tq();const qu=!0,Nq="/",od=9925,x_="HDB_ADMIN",el="/",aC="../";function jo(e,t,n){return e===1||e==="1"?`${e} ${t}`:`${e} ${n}`}function Aq(e){return e.replicated?.some(t=>Z$(t))??!1}function Oq(e){return e.status!=="failed"}function Z$(e){return e.status==="failed"}function Dq(e){if(Aq(e.data)){const t=e.data.replicated.filter(Oq),n=e.data.replicated.filter(Z$),r=t.length?`The operation partially succeeded, but ${jo(n.length,"node","nodes")} failed:`:n.length===1?"The operation failed on the single node:":`The operation failed on all ${n.length} nodes:`,i=n.map(o=>`${o.node}: ${o.reason}`).join(`
3
3
  `);return Promise.reject(r+`
4
4
  `+i)}return e}function Y$(e,t){return function(){return e.apply(t,arguments)}}const{toString:$q}=Object.prototype,{getPrototypeOf:sC}=Object,{iterator:Py,toStringTag:W$}=Symbol,zy=(e=>t=>{const n=$q.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),zo=e=>(e=e.toLowerCase(),t=>zy(t)===e),Ly=e=>t=>typeof t===e,{isArray:Nd}=Array,ad=Ly("undefined");function fp(e){return e!==null&&!ad(e)&&e.constructor!==null&&!ad(e.constructor)&&ui(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const X$=zo("ArrayBuffer");function Mq(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&X$(e.buffer),t}const Pq=Ly("string"),ui=Ly("function"),Q$=Ly("number"),mp=e=>e!==null&&typeof e=="object",zq=e=>e===!0||e===!1,dv=e=>{if(zy(e)!=="object")return!1;const t=sC(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(W$ in e)&&!(Py in e)},Lq=e=>{if(!mp(e)||fp(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Uq=zo("Date"),Fq=zo("File"),Vq=zo("Blob"),Bq=zo("FileList"),Hq=e=>mp(e)&&ui(e.pipe),qq=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ui(e.append)&&((t=zy(e))==="formdata"||t==="object"&&ui(e.toString)&&e.toString()==="[object FormData]"))},Gq=zo("URLSearchParams"),[Kq,Zq,Yq,Wq]=["ReadableStream","Request","Response","Headers"].map(zo),Xq=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function pp(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Nd(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(fp(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let c;for(r=0;r<a;r++)c=o[r],t.call(null,e[c],c,e)}}function J$(e,t){if(fp(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Pl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,eM=e=>!ad(e)&&e!==Pl;function w_(){const{caseless:e,skipUndefined:t}=eM(this)&&this||{},n={},r=(i,o)=>{const a=e&&J$(n,o)||o;dv(n[a])&&dv(i)?n[a]=w_(n[a],i):dv(i)?n[a]=w_({},i):Nd(i)?n[a]=i.slice():(!t||!ad(i))&&(n[a]=i)};for(let i=0,o=arguments.length;i<o;i++)arguments[i]&&pp(arguments[i],r);return n}const Qq=(e,t,n,{allOwnKeys:r}={})=>(pp(t,(i,o)=>{n&&ui(i)?e[o]=Y$(i,n):e[o]=i},{allOwnKeys:r}),e),Jq=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),eG=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},tG=(e,t,n,r)=>{let i,o,a;const c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!r||r(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&sC(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},nG=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},rG=e=>{if(!e)return null;if(Nd(e))return e;let t=e.length;if(!Q$(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},iG=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&sC(Uint8Array)),oG=(e,t)=>{const r=(e&&e[Py]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},aG=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},sG=zo("HTMLFormElement"),lG=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),fA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),cG=zo("RegExp"),tM=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};pp(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},uG=e=>{tM(e,(t,n)=>{if(ui(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(ui(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},dG=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Nd(e)?r(e):r(String(e).split(t)),n},fG=()=>{},mG=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function pG(e){return!!(e&&ui(e.append)&&e[W$]==="FormData"&&e[Py])}const hG=e=>{const t=new Array(10),n=(r,i)=>{if(mp(r)){if(t.indexOf(r)>=0)return;if(fp(r))return r;if(!("toJSON"in r)){t[i]=r;const o=Nd(r)?[]:{};return pp(r,(a,c)=>{const d=n(a,i+1);!ad(d)&&(o[c]=d)}),t[i]=void 0,o}}return r};return n(e,0)},gG=zo("AsyncFunction"),vG=e=>e&&(mp(e)||ui(e))&&ui(e.then)&&ui(e.catch),nM=((e,t)=>e?setImmediate:t?((n,r)=>(Pl.addEventListener("message",({source:i,data:o})=>{i===Pl&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Pl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ui(Pl.postMessage)),yG=typeof queueMicrotask<"u"?queueMicrotask.bind(Pl):typeof process<"u"&&process.nextTick||nM,bG=e=>e!=null&&ui(e[Py]),fe={isArray:Nd,isArrayBuffer:X$,isBuffer:fp,isFormData:qq,isArrayBufferView:Mq,isString:Pq,isNumber:Q$,isBoolean:zq,isObject:mp,isPlainObject:dv,isEmptyObject:Lq,isReadableStream:Kq,isRequest:Zq,isResponse:Yq,isHeaders:Wq,isUndefined:ad,isDate:Uq,isFile:Fq,isBlob:Vq,isRegExp:cG,isFunction:ui,isStream:Hq,isURLSearchParams:Gq,isTypedArray:iG,isFileList:Bq,forEach:pp,merge:w_,extend:Qq,trim:Xq,stripBOM:Jq,inherits:eG,toFlatObject:tG,kindOf:zy,kindOfTest:zo,endsWith:nG,toArray:rG,forEachEntry:oG,matchAll:aG,isHTMLForm:sG,hasOwnProperty:fA,hasOwnProp:fA,reduceDescriptors:tM,freezeMethods:uG,toObjectSet:dG,toCamelCase:lG,noop:fG,toFiniteNumber:mG,findKey:J$,global:Pl,isContextDefined:eM,isSpecCompliantForm:pG,toJSONObject:hG,isAsyncFn:gG,isThenable:vG,setImmediate:nM,asap:yG,isIterable:bG};function ut(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}fe.inherits(ut,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:fe.toJSONObject(this.config),code:this.code,status:this.status}}});const rM=ut.prototype,iM={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{iM[e]={value:e}});Object.defineProperties(ut,iM);Object.defineProperty(rM,"isAxiosError",{value:!0});ut.from=(e,t,n,r,i,o)=>{const a=Object.create(rM);fe.toFlatObject(e,a,function(p){return p!==Error.prototype},f=>f!=="isAxiosError");const c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return ut.call(a,c,d,n,r,i),e&&a.cause==null&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",o&&Object.assign(a,o),a};const xG=null;function S_(e){return fe.isPlainObject(e)||fe.isArray(e)}function oM(e){return fe.endsWith(e,"[]")?e.slice(0,-2):e}function mA(e,t,n){return e?e.concat(t).map(function(i,o){return i=oM(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function wG(e){return fe.isArray(e)&&!e.some(S_)}const SG=fe.toFlatObject(fe,{},null,function(t){return/^is[A-Z]/.test(t)});function Uy(e,t,n){if(!fe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=fe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,C){return!fe.isUndefined(C[S])});const r=n.metaTokens,i=n.visitor||p,o=n.dots,a=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&fe.isSpecCompliantForm(t);if(!fe.isFunction(i))throw new TypeError("visitor must be a function");function f(b){if(b===null)return"";if(fe.isDate(b))return b.toISOString();if(fe.isBoolean(b))return b.toString();if(!d&&fe.isBlob(b))throw new ut("Blob is not supported. Use a Buffer instead.");return fe.isArrayBuffer(b)||fe.isTypedArray(b)?d&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function p(b,S,C){let E=b;if(b&&!C&&typeof b=="object"){if(fe.endsWith(S,"{}"))S=r?S:S.slice(0,-2),b=JSON.stringify(b);else if(fe.isArray(b)&&wG(b)||(fe.isFileList(b)||fe.endsWith(S,"[]"))&&(E=fe.toArray(b)))return S=oM(S),E.forEach(function(j,I){!(fe.isUndefined(j)||j===null)&&t.append(a===!0?mA([S],I,o):a===null?S:S+"[]",f(j))}),!1}return S_(b)?!0:(t.append(mA(C,S,o),f(b)),!1)}const h=[],v=Object.assign(SG,{defaultVisitor:p,convertValue:f,isVisitable:S_});function y(b,S){if(!fe.isUndefined(b)){if(h.indexOf(b)!==-1)throw Error("Circular reference detected in "+S.join("."));h.push(b),fe.forEach(b,function(E,k){(!(fe.isUndefined(E)||E===null)&&i.call(t,E,fe.isString(k)?k.trim():k,S,v))===!0&&y(E,S?S.concat(k):[k])}),h.pop()}}if(!fe.isObject(e))throw new TypeError("data must be an object");return y(e),t}function pA(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function lC(e,t){this._pairs=[],e&&Uy(e,this,t)}const aM=lC.prototype;aM.append=function(t,n){this._pairs.push([t,n])};aM.toString=function(t){const n=t?function(r){return t.call(this,r,pA)}:pA;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function _G(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function sM(e,t,n){if(!t)return e;const r=n&&n.encode||_G;fe.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=fe.isURLSearchParams(t)?t.toString():new lC(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class hA{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){fe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const lM={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},CG=typeof URLSearchParams<"u"?URLSearchParams:lC,EG=typeof FormData<"u"?FormData:null,kG=typeof Blob<"u"?Blob:null,jG={isBrowser:!0,classes:{URLSearchParams:CG,FormData:EG,Blob:kG},protocols:["http","https","file","blob","url","data"]},cC=typeof window<"u"&&typeof document<"u",__=typeof navigator=="object"&&navigator||void 0,RG=cC&&(!__||["ReactNative","NativeScript","NS"].indexOf(__.product)<0),IG=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",TG=cC&&window.location.href||"http://localhost",NG=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:cC,hasStandardBrowserEnv:RG,hasStandardBrowserWebWorkerEnv:IG,navigator:__,origin:TG},Symbol.toStringTag,{value:"Module"})),_r={...NG,...jG};function AG(e,t){return Uy(e,new _r.classes.URLSearchParams,{visitor:function(n,r,i,o){return _r.isNode&&fe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function OG(e){return fe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function DG(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}function cM(e){function t(n,r,i,o){let a=n[o++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),d=o>=n.length;return a=!a&&fe.isArray(i)?i.length:a,d?(fe.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!c):((!i[a]||!fe.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&fe.isArray(i[a])&&(i[a]=DG(i[a])),!c)}if(fe.isFormData(e)&&fe.isFunction(e.entries)){const n={};return fe.forEachEntry(e,(r,i)=>{t(OG(r),i,n,0)}),n}return null}function $G(e,t,n){if(fe.isString(e))try{return(t||JSON.parse)(e),fe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const hp={transitional:lM,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=fe.isObject(t);if(o&&fe.isHTMLForm(t)&&(t=new FormData(t)),fe.isFormData(t))return i?JSON.stringify(cM(t)):t;if(fe.isArrayBuffer(t)||fe.isBuffer(t)||fe.isStream(t)||fe.isFile(t)||fe.isBlob(t)||fe.isReadableStream(t))return t;if(fe.isArrayBufferView(t))return t.buffer;if(fe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return AG(t,this.formSerializer).toString();if((c=fe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Uy(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),$G(t)):t}],transformResponse:[function(t){const n=this.transitional||hp.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(fe.isResponse(t)||fe.isReadableStream(t))return t;if(t&&fe.isString(t)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(c){if(a)throw c.name==="SyntaxError"?ut.from(c,ut.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_r.classes.FormData,Blob:_r.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};fe.forEach(["delete","get","head","post","put","patch"],e=>{hp.headers[e]={}});const MG=fe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),PG=e=>{const t={};let n,r,i;return e&&e.split(`
@@ -35,7 +35,7 @@ ${h}`,b=>{n.notifyAfterAddMessage(b-v)})}function c(h){return h!==void 0&&i[h]!=
35
35
  `);i={};const y=gte(h.reason),b=y?t.sendOnExit:t.send;if(y&&e.isAsync){const S=e.finishSync();S.outputBytesCount&&b(RO(S));const C=[S.pendingData,v].filter(Boolean).join(`
36
36
  `);C&&b({data:C,bytesCount:zP(C)})}else v&&e.write(e.isEmpty?v:`
37
37
  ${v}`),e.finish(S=>{b(RO(S))})}return{flushController:n,add:f,upsert:f,stop:o.unsubscribe}}function RO(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function Rz({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:r,sessionExpireObservable:i}){const o=r.subscribe(b=>p(b.reason)),a=i.subscribe(()=>p("session_expire")),c=new Nt(()=>()=>{o.unsubscribe(),a.unsubscribe()});let d=0,f=0;function p(b){if(f===0)return;const S=f,C=d;f=0,d=0,y(),c.notify({reason:b,messagesCount:S,bytesCount:C})}let h;function v(){h===void 0&&(h=Er(()=>{p("duration_limit")},n))}function y(){to(h),h=void 0}return{flushObservable:c,get messagesCount(){return f},notifyBeforeAddMessage(b){d+b>=t&&p("bytes_limit"),f+=1,d+=b,v()},notifyAfterAddMessage(b=0){d+=b,f>=e?p("messages_limit"):d>=t&&p("bytes_limit")},notifyAfterRemoveMessage(b){d-=b,f-=1,f===0&&y()}}}const Zs="DISCARDED",Di="SKIPPED";function vte(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(r=>r!==n)}}},triggerHook(t,n){const r=e[t]||[],i=[];for(const o of r){const a=o(n);if(a===Zs)return Zs;a!==Di&&i.push(a)}return qa(...i)}}}const Vs={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},yte=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],bte=1,xte=[tee];let iS;function Vd(){return iS||(iS=new BP(100)),iS}function wte(e,t,n,r,i,o){const a=new Nt,{stop:c}=_te(t,r,i,o,a),{enabled:d,metricsEnabled:f}=Ste(e,t,n,a);return{stop:c,enabled:d,metricsEnabled:f}}function Ste(e,t,n,r,i=bte){const o={},a=!xte.includes(t.site)&&Ll(t.telemetrySampleRate),c={[Vs.LOG]:a,[Vs.CONFIGURATION]:a&&Ll(t.telemetryConfigurationSampleRate),[Vs.USAGE]:a&&Ll(t.telemetryUsageSampleRate),metric:a&&Ll(i)},d=Cte(),f=Vd();return f.subscribe(({rawEvent:h,metricName:v})=>{if(v&&!c.metric||!c[h.type])return;const y=v||h.status||h.type;let b=o[y];if(b||(b=o[y]=new Set),b.size>=t.maxTelemetryEventsPerPage)return;const S=Ep(h);if(b.has(S))return;const C=n.triggerHook(1,{startTime:er().relative});if(C===Zs)return;const E=p(C,e,h,d);r.notify(E),gz("telemetry",E),b.add(S)}),f.unbuffer(),uJ(UC),{enabled:a,metricsEnabled:c.metric};function p(h,v,y,b){const C={type:"telemetry",date:er().timeStamp,service:v,version:"6.24.0",source:"browser",_dd:{format_version:2},telemetry:qa(y,{runtime_env:b,connectivity:vz(),sdk_setup:"npm"}),ddtags:hz(t).join(","),experimental_features:Array.from(gee())};return qa(C,h)}}function _te(e,t,n,r,i){const o=[];if(gd()){const a=kp(),c=i.subscribe(d=>a.send("internal_telemetry",d));o.push(c.unsubscribe)}else{const a=[e.rumEndpointBuilder];e.replica&&Ete(e)&&a.push(e.replica.rumEndpointBuilder);const c=jz({encoder:r(4),request:Ez(a,e.batchBytesLimit,t),flushController:Rz({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:n,sessionExpireObservable:new Nt}),messageBytesLimit:e.messageBytesLimit});o.push(c.stop);const d=i.subscribe(c.add);o.push(d.unsubscribe)}return{stop:()=>o.forEach(a=>a())}}function Cte(){var e;return{is_local_file:((e=oa.location)===null||e===void 0?void 0:e.protocol)==="file:",is_worker:Hv}}function Ete(e){return e.site===az}function jp(e,t){V_(Yy.debug,e,t),Vd().notify({rawEvent:{type:Vs.LOG,message:e,status:"debug",...t}})}function UC(e,t){Vd().notify({rawEvent:{type:Vs.LOG,status:"error",...jte(e),...t}})}function kte(e){Vd().notify({rawEvent:{type:Vs.CONFIGURATION,configuration:e}})}function ob(e,t){Vd().notify({rawEvent:{type:Vs.LOG,message:e,status:"debug",...t},metricName:e})}function lr(e){Vd().notify({rawEvent:{type:Vs.USAGE,usage:e}})}function jte(e){if(xc(e)){const t=_p(e);return{error:{kind:t.name,stack:Cp(Rte(t))},message:t.message}}return{error:{stack:dz},message:`Uncaught ${Ep(e)}`}}function Rte(e){return e.stack=e.stack.filter(t=>!t.url||yte.some(n=>t.url.startsWith(n))),e}function Iz(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function Xl(e){return Array.isArray(e)&&e.length>0}const Dg=1/0,Ite=Br;let om=null;const bv=new Set;function Tte(){bv.forEach(e=>e())}function Bd({expireDelay:e,maxEntries:t}){let n=[];om||(om=Ud(()=>Tte(),Ite));const r=()=>{const p=Oi()-e;for(;n.length>0&&n[n.length-1].endTime<p;)n.pop()};bv.add(r);function i(p,h){const v={value:p,startTime:h,endTime:Dg,remove:()=>{Iz(n,v)},close:y=>{v.endTime=y}};return t&&n.length>=t&&n.pop(),n.unshift(v),v}function o(p=Dg,h={returnInactive:!1}){for(const v of n)if(v.startTime<=p){if(h.returnInactive||p<=v.endTime)return v.value;break}}function a(p){const h=n[0];h&&h.endTime===Dg&&h.close(p)}function c(p=Dg,h=0){const v=Ld(p,h);return n.filter(y=>y.startTime<=v&&p<=y.endTime).map(y=>y.value)}function d(){n=[]}function f(){bv.delete(r),bv.size===0&&om&&(Qy(om),om=null)}return{add:i,find:o,closeActive:a,findAll:c,reset:d,stop:f}}const Nte="datadog-synthetics-public-id",Ate="datadog-synthetics-result-id",Ote="datadog-synthetics-injects-rum";function Tz(){return Hv?!1:!!(oa._DATADOG_SYNTHETICS_INJECTS_RUM||$s(Ote))}function Nz(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||$s(Nte);return typeof e=="string"?e:void 0}function Az(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||$s(Ate);return typeof e=="string"?e:void 0}function Oz(){return!!(Nz()&&Az())}const Dte=Br,$te=yc;function Mte(e,t,n,r){const i=new Nt,o=new Nt,a=GJ(e.sessionStoreStrategyType,e,t,n),c=Bd({expireDelay:$te});if(a.renewObservable.subscribe(()=>{c.add(d(),Oi()),i.notify()}),a.expireObservable.subscribe(()=>{o.notify(),c.closeActive(Oi())}),a.expandOrRenewSession(),c.add(d(),MP().relative),Sp(Gs.SHORT_SESSION_INVESTIGATION)){const f=a.getSession();f&&Fte(e,f)}r.observable.subscribe(()=>{r.isGranted()?a.expandOrRenewSession():a.expire(!1)}),Pte(e,()=>{r.isGranted()&&a.expandOrRenewSession()}),zte(e,()=>a.expandSession()),Lte(e,()=>a.restartSession());function d(){const f=a.getSession();return f?{id:f.id,trackingType:f[t],isReplayForced:!!f.forcedReplay,anonymousId:f.anonymousId}:(Ute(e).catch(()=>{}),{id:"invalid",trackingType:WP,isReplayForced:!1,anonymousId:void 0})}return{findSession:(f,p)=>c.find(f,p),renewObservable:i,expireObservable:o,sessionStateUpdateObservable:a.sessionStateUpdateObservable,expire:a.expire,updateSessionState:a.updateSessionState}}function Pte(e,t){const{stop:n}=Ks(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function zte(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:r}=xn(e,document,"visibilitychange",n);Ud(n,Dte)}function Lte(e,t){const{stop:n}=xn(e,window,"resume",t,{capture:!0})}async function Ute(e){const t=e.sessionStoreStrategyType;if(!t)return;let n,r;t.type===md.COOKIE?(n=ez(t.cookieOptions,e),r={cookie:await Dz(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):n=rz(),jp("Unexpected session state",{sessionStoreStrategyType:t.type,session:n,isSyntheticsTest:Oz(),createdTimestamp:n?.created,expireTimestamp:n?.expire,...r})}function Fte(e,t){if(!window.cookieStore||!t.created)return;const n=Number(t.created),r=Ur(),{stop:i}=xn(e,cookieStore,"change",o);function o(a){const c=KP(a.changed,f=>f.name===Ha);if(!c)return;const d=Ur()-n;if(d>14*Br)i();else{const f=rb(c.value);if(f.id&&f.id!==t.id){i();const p=Ur()-r;Dz().then(h=>{jp("Session cookie changed",{time:p,session_age:d,old:t,new:f,cookie:h})}).catch(qs)}}}}async function Dz(){let e;return"cookieStore"in window?e=await window.cookieStore.getAll(Ha):e=document.cookie.split(/\s*;\s*/).filter(t=>t.startsWith(Ha)),{count:e.length,domain:GP()||"undefined",...e}}function Vte(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){const i=zP(n);t+=i,e+=n,r&&r(i)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class Bte{constructor(){this.callbacks={}}notify(t,n){const r=this.callbacks[t];r&&r.forEach(i=>i(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(r=>n!==r)}}}}function oS(e,t,n){let r=0,i=!1;return{isLimitReached(){if(r===0&&Er(()=>{r=0},Br),r+=1,r<=t||i)return i=!1,!1;if(r===t+1){i=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:Fd.AGENT,startClocks:er()})}finally{i=!1}}return!0}}}function FC(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:Ft}):xn(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function Hte(e,t){return new Promise(n=>{FC(e,t,n)})}let aS;const VC=new WeakMap;function qte(e){return aS||(aS=Gte(e)),aS}function Gte(e){return new Nt(t=>{const{stop:n}=na(XMLHttpRequest.prototype,"open",Kte),{stop:r}=na(XMLHttpRequest.prototype,"send",o=>{Zte(o,e,t)},{computeHandlingStack:!0}),{stop:i}=na(XMLHttpRequest.prototype,"abort",Yte);return()=>{n(),r(),i()}})}function Kte({target:e,parameters:[t,n]}){VC.set(e,{state:"open",method:String(t).toUpperCase(),url:DC(String(n))})}function Zte({target:e,parameters:[t],handlingStack:n},r,i){const o=VC.get(e);if(!o)return;const a=o;a.state="start",a.startClocks=er(),a.isAborted=!1,a.xhr=e,a.handlingStack=n,a.requestBody=t;let c=!1;const{stop:d}=na(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&f()}),f=()=>{if(p(),d(),c)return;c=!0;const h=o;h.state="complete",h.duration=Mn(a.startClocks.timeStamp,vr()),h.status=e.status,typeof e.response=="string"&&(h.responseBody=e.response),i.notify(qm(h))},{stop:p}=xn(r,e,"loadend",f);i.notify(a)}function Yte({target:e}){const t=VC.get(e);t&&(t.isAborted=!0)}async function Wte(e,t){const n=e.getReader(),r=[];for(;;){const i=await n.read();if(i.done)break;t.collectStreamBody&&r.push(i.value)}return n.cancel().catch(Ft),t.collectStreamBody?LP(r):void 0}let sS;const $z=[];function Mz({responseBodyAction:e}={}){return e&&$z.push(e),sS||(sS=Xte()),sS}function Xte(){return new Nt(e=>{if(!oa.fetch)return;const{stop:t}=na(oa,"fetch",n=>Qte(n,e),{computeHandlingStack:!0});return t})}function Qte({parameters:e,onPostCall:t,handlingStack:n},r){const[i,o]=e;let a=o&&o.method;a===void 0&&i instanceof Request&&(a=i.method);const c=a!==void 0?String(a).toUpperCase():"GET",d=i instanceof Request?i.url:DC(String(i)),f=er(),p={state:"start",init:o,input:i,method:c,startClocks:f,url:d,handlingStack:n};r.notify(p),e[0]=p.input,e[1]=p.init,t(h=>{Jte(r,h,p).catch(qs)})}async function Jte(e,t,n){var r,i;const o=n;o.state="resolve";let a;try{a=await t}catch(d){o.status=0,o.isAborted=((i=(r=o.init)===null||r===void 0?void 0:r.signal)===null||i===void 0?void 0:i.aborted)||d instanceof DOMException&&d.code===DOMException.ABORT_ERR,o.error=d,e.notify(o);return}o.response=a,o.status=a.status,o.responseType=a.type,o.isAborted=!1;const c=$z.reduce((d,f)=>Math.max(d,f(o)),0);if(c!==0){const d=rte(a);if(d&&d.body)try{const f=await Wte(d.body,{collectStreamBody:c===2});o.responseBody=f&&new TextDecoder().decode(f)}catch{}}e.notify(o)}function ene(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(yt(e),t);return()=>window.cancelIdleCallback(n)}return nne(e)}const tne=50;function nne(e){const t=Ur(),n=Er(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,tne-(Ur()-t))})},0);return()=>to(n)}const rne=Rr,ine=30;function one(){const e=[];function t(r){let i;if(r.didTimeout){const o=performance.now();i=()=>ine-(performance.now()-o)}else i=r.timeRemaining.bind(r);for(;i()>0&&e.length;)e.shift()();e.length&&n()}function n(){ene(t,{timeout:rne})}return{push(r){e.push(r)===1&&n()},stop(){e.length=0}}}let lS={};function ane(e){const t=e.map(n=>(lS[n]||(lS[n]=sne(n)),lS[n]));return VP(...t)}function sne(e){return new Nt(t=>{const n=Ma[e];return Ma[e]=(...r)=>{n.apply(console,r);const i=Zm("console error");Fs(()=>{t.notify(lne(r,e,i))})},()=>{Ma[e]=n}})}function lne(e,t,n){const r=e.map(i=>cne(i)).join(" ");if(t===Yy.error){const i=e.find(xc),o=zC({originalError:i,handlingStack:n,startClocks:er(),source:Fd.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return o.message=r,{api:t,message:r,handlingStack:n,error:o}}return{api:t,message:r,error:void 0,handlingStack:n}}function cne(e){return typeof e=="string"?ln(e):xc(e)?uz(_p(e)):Ep(ln(e),void 0,2)}const une=500;function dne(){const e=[];return{add:i=>{e.push(i)>une&&e.splice(0,1)},remove:i=>{Iz(e,i)},drain:i=>{e.forEach(o=>o(i)),e.length=0}}}function fne(e){const t=bc(e)==="object";return t||dt.error("Unsupported context:",e),t}function cS(e,t,n){const r={...e};for(const[i,{required:o,type:a}]of Object.entries(t))a==="string"&&!IO(r[i])&&(r[i]=String(r[i])),o&&IO(r[i])&&dt.warn(`The property ${i} of ${n} is required; context will not be sent to the intake.`);return r}function IO(e){return e==null||e===""}function ab(e="",{propertiesConfig:t={}}={}){let n={};const r=new Nt,i={getContext:()=>LC(n),setContext:o=>{fne(o)?n=ln(cS(o,t,e)):i.clearContext(),r.notify()},setContextProperty:(o,a)=>{n=ln(cS({...n,[o]:a},t,e)),r.notify()},removeContextProperty:o=>{delete n[o],cS(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function Ar(e,t,n,r){return yt((...i)=>(r&&lr({feature:r}),e()[t][n](...i)))}const mne="_dd_c",pne=[];function BC(e,t,n,r){const i=hne(n,r);pne.push(xn(e,window,"storage",({key:f})=>{i===f&&a()})),t.changeObservable.subscribe(c);const o=qa(d(),t.getContext());il(o)||t.setContext(o);function a(){t.setContext(d())}function c(){localStorage.setItem(i,JSON.stringify(t.getContext()))}function d(){const f=localStorage.getItem(i);return f?JSON.parse(f):{}}}function hne(e,t){return`${mne}_${e}_${t}`}function gne(e,t,n){const r=Pz();return t.storeContextsAcrossPages&&BC(t,r,n,4),e.register(0,()=>{const i=r.getContext();return il(i)||!i.id?Di:{account:i}}),r}function Pz(){return ab("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function vne(e,t,n,r){const i=zz();return t.storeContextsAcrossPages&&BC(t,i,n,2),e.register(0,()=>({context:i.getContext()})),i}function zz(){return ab("global context")}function yne(e,t,n,r){const i=Lz();return t.storeContextsAcrossPages&&BC(t,i,r,1),e.register(0,({eventType:o,startTime:a})=>{const c=i.getContext(),d=n.findTrackedSession(a);return d&&d.anonymousId&&!c.anonymous_id&&t.trackAnonymousUser&&(c.anonymous_id=d.anonymousId),il(c)?Di:{type:o,usr:c}}),e.register(1,({startTime:o})=>{var a;return{anonymous_id:(a=n.findTrackedSession(o))===null||a===void 0?void 0:a.anonymousId}}),i}function Lz(){return ab("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const cr={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},Or={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"},Mr={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},sb={FETCH:Mr.FETCH,XHR:Mr.XHR},bne=500;function xne(e=Fee){const t=new BP(bne),n=e().subscribe(r=>{t.notify({type:0,error:r})});return{observable:t,stop:()=>{n.unsubscribe()}}}function wne(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const gt={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},Uz={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},Pa={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},HC={CLICK:"click",CUSTOM:"custom"},am={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},Wm={DURATION:"duration",OPERATION_STEP:"operation_step"};function Sne(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function _ne(e,t,n){function r(a){return!t.wasInPageStateDuringPeriod("frozen",a.startClocks.relative,a.duration)}function i(a){r(a)&&e.notify(12,TO(a))}function o(a,c,d,f){if(!Sp(Gs.FEATURE_OPERATION_VITAL))return;const{operationKey:p,context:h,description:v}=d||{},y={name:a,type:Wm.OPERATION_STEP,operationKey:p,failureReason:f,stepType:c,startClocks:er(),context:ln(h),description:v};e.notify(12,TO(y))}return{addOperationStepVital:o,addDurationVital:i,startDurationVital:(a,c={})=>Fz(n,a,c),stopDurationVital:(a,c={})=>{Vz(i,n,a,c)}}}function Fz({vitalsByName:e,vitalsByReference:t},n,r={}){const i={name:n,startClocks:er(),...r},o={__dd_vital_reference:!0};return e.set(n,i),t.set(o,i),o}function Vz(e,{vitalsByName:t,vitalsByReference:n},r,i={}){const o=typeof r=="string"?t.get(r):n.get(r);o&&(e(Cne(o,o.startClocks,i,er())),typeof r=="string"?t.delete(r):n.delete(r))}function Cne(e,t,n,r){var i;return{name:e.name,type:Wm.DURATION,startClocks:t,duration:Mn(t.timeStamp,r.timeStamp),context:qa(e.context,n.context),description:(i=n.description)!==null&&i!==void 0?i:e.description}}function TO(e){const{startClocks:t,type:n,name:r,description:i,context:o}=e,a={id:jr(),type:n,name:r,description:i,...n===Wm.DURATION?{duration:ht(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason}};return{rawRumEvent:{date:t.timeStamp,vital:a,type:gt.VITAL,context:o},startTime:t.relative,duration:n===Wm.DURATION?e.duration:void 0,domainContext:{}}}function Bz(e,t,n){if(e)for(const r of e){const i=r[t];i&&i(n)}}const NO=new Map;function Hz(e,t){if(t===100)return!0;if(t===0)return!1;const n=NO.get(t);if(n&&e===n.sessionId)return n.decision;let r;return window.BigInt?r=Ene(BigInt(`0x${e.split("-")[4]}`),t):r=Ll(t),NO.set(t,{sessionId:e,decision:r}),r}function Ene(e,t){const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),i=e*n%r;return Number(i)<=t/100*Number(r)}function kne(){return Gz(64)}function qz(){return Gz(63)}function Gz(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let r=t[1],i=t[0],o="";do{const a=r%n*4294967296+i;r=Math.floor(r/n),i=Math.floor(a/n),o=(a%n).toString(n)+o}while(r||i);return o}}}function Eu(e){return e.toString(16).padStart(16,"0")}function jne(e){const t=e;return bc(t)==="object"&&Km(t.match)&&Array.isArray(t.propagatorTypes)}function Rne(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function Ine(e,t,n,r){return{clearTracingIfNeeded:Rne,traceFetch:i=>AO(e,i,t,n,r,o=>{var a;if(i.input instanceof Request&&!(!((a=i.init)===null||a===void 0)&&a.headers))i.input=new Request(i.input),Object.keys(o).forEach(c=>{i.input.headers.append(c,o[c])});else{i.init=qm(i.init);const c=[];i.init.headers instanceof Headers?i.init.headers.forEach((d,f)=>{c.push([f,d])}):Array.isArray(i.init.headers)?i.init.headers.forEach(d=>{c.push(d)}):i.init.headers&&Object.keys(i.init.headers).forEach(d=>{c.push([d,i.init.headers[d]])}),i.init.headers=c.concat($C(o))}}),traceXhr:(i,o)=>AO(e,i,t,n,r,a=>{Object.keys(a).forEach(c=>{o.setRequestHeader(c,a[c])})})}}function AO(e,t,n,r,i,o){const a=n.findTrackedSession();if(!a)return;const c=e.allowedTracingUrls.find(p=>ib([p.match],t.url,!0));if(!c)return;const d=Hz(a.id,e.traceSampleRate);(d||e.traceContextInjection===q_.ALL)&&(t.traceSampled=d,t.traceId=kne(),t.spanId=qz(),o(Tne(t.traceId,t.spanId,t.traceSampled,a.id,c.propagatorTypes,r,i,e)))}function Tne(e,t,n,r,i,o,a,c){const d={};if(i.forEach(f=>{switch(f){case"datadog":{Object.assign(d,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(d,{traceparent:`00-0000000000000000${Eu(e)}-${Eu(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(d,{b3:`${Eu(e)}-${Eu(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(d,{"X-B3-TraceId":Eu(e),"X-B3-SpanId":Eu(t),"X-B3-Sampled":n?"1":"0"});break}}}),c.propagateTraceBaggage){const f={"session.id":r},p=o.getContext().id;typeof p=="string"&&(f["user.id"]=p);const h=a.getContext().id;typeof h=="string"&&(f["account.id"]=h);const v=Object.entries(f).map(([y,b])=>`${y}=${encodeURIComponent(b)}`).join(",");v&&(d.baggage=v)}return d}const Kz=["tracecontext","datadog"];function Nne(e,t){var n,r,i,o,a,c,d;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&dt.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){dt.error("Application ID is not configured, no RUM data will be collected.");return}if(!Uu(e.sessionReplaySampleRate,"Session Replay")||!Uu(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){dt.error("Excluded Activity Urls should be an array");return}const f=Ane(e);if(!f)return;const p=fee(e,t),h=Dne(e);if(!p)return;const v=(n=e.sessionReplaySampleRate)!==null&&n!==void 0?n:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:v,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:v===0,traceSampleRate:(r=e.traceSampleRate)!==null&&r!==void 0?r:100,rulePsr:xp(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:f,excludedActivityUrls:(i=e.excludedActivityUrls)!==null&&i!==void 0?i:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((o=e.trackUserInteractions)!==null&&o!==void 0)||o),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((a=e.trackResources)!==null&&a!==void 0)||a),trackLongTasks:!!(!((c=e.trackLongTasks)!==null&&c!==void 0)||c),trackBfcacheViews:!!e.trackBfcacheViews,trackEarlyRequests:!!e.trackEarlyRequests,subdomain:e.subdomain,defaultPrivacyLevel:Bv(Lu,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:Lu.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,traceContextInjection:Bv(q_,e.traceContextInjection)?e.traceContextInjection:q_.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(d=e.profilingSampleRate)!==null&&d!==void 0?d:0,propagateTraceBaggage:!!e.propagateTraceBaggage,allowedGraphQlUrls:h,...p}}function Ane(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){dt.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){dt.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{Km(n)?t.push({match:n,propagatorTypes:Kz}):jne(n)?t.push(n):dt.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function One(e){const t=new Set;return Xl(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(n=>{Km(n)?Kz.forEach(r=>t.add(r)):bc(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(r=>t.add(r))}),Array.from(t)}function Dne(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return dt.warn("allowedGraphQlUrls should be an array"),[];const t=[];return e.allowedGraphQlUrls.forEach(n=>{Km(n)?t.push({match:n,trackPayload:!1,trackResponseErrors:!1}):n&&typeof n=="object"&&"match"in n&&Km(n.match)&&t.push({match:n.match,trackPayload:!!n.trackPayload,trackResponseErrors:!!n.trackResponseErrors})}),t}function $ne(e){return Xl(e)&&e.some(t=>typeof t=="object"&&"trackPayload"in t?!!t.trackPayload:!1)}function Mne(e){return Xl(e)&&e.some(t=>typeof t=="object"&&"trackResponseErrors"in t?!!t.trackResponseErrors:!1)}function Pne(e){var t;const n=mee(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,propagate_trace_baggage:e.propagateTraceBaggage,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:Xl(e.allowedTracingUrls),use_allowed_graph_ql_urls:Xl(e.allowedGraphQlUrls),use_track_graph_ql_payload:$ne(e.allowedGraphQlUrls),use_track_graph_ql_response_errors:Mne(e.allowedGraphQlUrls),selected_tracing_propagators:One(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Xl(e.excludedActivityUrls),use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,track_bfcache_views:e.trackBfcacheViews,track_early_requests:e.trackEarlyRequests,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(r=>{var i;return{name:r.name,...(i=r.getConfigurationTelemetry)===null||i===void 0?void 0:i.call(r)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,profiling_sample_rate:e.profilingSampleRate,use_remote_configuration_proxy:!!e.remoteConfigurationProxy,...n}}function zne(e){const t=[];let n=0,r;const i={quote:void 0,escapeSequence:void 0};let o="";for(const a of e){if(r=OO[n].find(c=>Hne[c](a,i)),!r)return[];if(i.escapeSequence!==void 0&&r!==12){if(!Kne(i.escapeSequence))return[];o+=Yne(i.escapeSequence),i.escapeSequence=void 0}qne.includes(r)?o+=a:Gne.includes(r)&&o!==""?(t.push(o),o=""):r===12?i.escapeSequence=i.escapeSequence?`${i.escapeSequence}${a}`:a:r===8?i.quote=a:r===9&&(i.quote=void 0),n=r}return OO[n].includes(1)?(o!==""&&t.push(o),t):[]}const Lne=/[a-zA-Z_$]/,Une=/[a-zA-Z0-9_$]/,Fne=/[0-9]/,Vne=/[a-fA-F0-9]/,Bne=`'"`,Hne={0:()=>!1,1:()=>!1,2:e=>Lne.test(e),3:e=>Une.test(e),4:e=>e===".",5:e=>e==="[",6:e=>e==="]",7:e=>Fne.test(e),8:e=>Bne.includes(e),9:(e,t)=>e===t.quote,10:()=>!0,11:e=>e==="\\",12:(e,t)=>t.escapeSequence===void 0?`${t.quote}/\\bfnrtu`.includes(e):t.escapeSequence.startsWith("u")&&t.escapeSequence.length<5?Vne.test(e):!1},OO={0:[2,5],1:[],2:[3,4,5,1],3:[3,4,5,1],4:[2],5:[8,7],6:[4,5,1],7:[7,6],8:[11,9,10],9:[6],10:[11,9,10],11:[12],12:[12,11,9,10]},qne=[2,3,7,10],Gne=[4,5,6];function Kne(e){return`"'/\\bfnrt`.includes(e)||e.startsWith("u")&&e.length===5}const Zne={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:`
38
- `,r:"\r",t:" "};function Yne(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):Zne[e]}const Wne="v1",Xne=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function Qne(e,t){let n;const r=ere(),i=await ire(e);return i.ok?(r.increment("fetch","success"),n=Jne(e,i.value,t,r)):(r.increment("fetch","failure"),dt.error(i.error)),ob("remote configuration metrics",{metrics:r.get()}),n}function Jne(e,t,n,r){const i={...e};return Xne.forEach(v=>{v in t&&(i[v]=o(t[v]))}),Object.keys(n).forEach(v=>{t[v]!==void 0&&a(n[v],t[v])}),i;function o(v){if(Array.isArray(v))return v.map(o);if(tre(v)){if(nre(v)){const y=v.rcSerializedType;switch(y){case"string":return v.value;case"regex":return Zz(v.value);case"dynamic":return c(v);default:dt.error(`Unsupported remote configuration: "rcSerializedType": "${y}"`);return}}return UP(v,o)}return v}function a(v,y){y.forEach(({key:b,value:S})=>{v.setContextProperty(b,o(S))})}function c(v){const y=v.strategy;let b;switch(y){case"cookie":b=d(v);break;case"dom":b=f(v);break;case"js":b=h(v);break;default:dt.error(`Unsupported remote configuration: "strategy": "${y}"`);return}const S=v.extractor;return S!==void 0&&typeof b=="string"?rre(S,b):b}function d({name:v}){const y=nb(v);return r.increment("cookie",y!==void 0?"success":"missing"),y}function f({selector:v,attribute:y}){let b;try{b=document.querySelector(v)}catch{dt.error(`Invalid selector in the remote configuration: '${v}'`),r.increment("dom","failure");return}if(!b){r.increment("dom","missing");return}if(p(b,y)){dt.error(`Forbidden element selected by the remote configuration: '${v}'`),r.increment("dom","failure");return}const S=y!==void 0?b.getAttribute(y):b.textContent;if(S===null){r.increment("dom","missing");return}return r.increment("dom","success"),S}function p(v,y){return v.getAttribute("type")==="password"&&y==="value"}function h({path:v}){let y=window;const b=zne(v);if(b.length===0){dt.error(`Invalid JSON path in the remote configuration: '${v}'`),r.increment("js","failure");return}for(const S of b){if(!(S in y)){r.increment("js","missing");return}try{y=y[S]}catch(C){dt.error(`Error accessing: '${v}'`,C),r.increment("js","failure");return}}return r.increment("js","success"),y}}function ere(){const e={fetch:{}};return{get:()=>e,increment:(t,n)=>{e[t]||(e[t]={}),e[t][n]||(e[t][n]=0),e[t][n]=e[t][n]+1}}}function tre(e){return typeof e=="object"&&e!==null}function nre(e){return"rcSerializedType"in e}function Zz(e){try{return new RegExp(e)}catch{dt.error(`Invalid regex in the remote configuration: '${e}'`)}}function rre(e,t){const n=Zz(e.value);if(n===void 0)return;const r=n.exec(t);if(r===null)return;const[i,o]=r;return o||i}async function ire(e){let t;try{t=await fetch(ore(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const n=await t.json();return n.rum?{ok:!0,value:n.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function ore(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${sz("rum",e)}/${Wne}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function are({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,r,i){const o=dne(),a=zz();uS(a,cr.globalContext,o);const c=Lz();uS(c,cr.userContext,o);const d=Pz();uS(d,cr.accountContext,o);let f,p,h,v;const y=n.observable.subscribe(S),b={};function S(){if(!h||!v||!n.isGranted())return;y.unsubscribe();let I;if(v.trackViewsManually){if(!f)return;o.remove(f.callback),I=f.options}const A=i(v,p,I);o.drain(A)}function C(I,A){const T=gd();if(T&&(I=sre(I)),h=I,kte(Pne(I)),v){fz("DD_RUM",I);return}const N=Nne(I,A);if(N){if(!T&&!N.sessionStoreStrategyType){dt.warn("No storage available for session. We will not send any data.");return}N.compressIntakeRequests&&!T&&t&&(p=t(N,"Datadog RUM",Ft),!p)||(v=N,Mz().subscribe(Ft),n.tryToInit(N.trackingConsent),S())}}const E=I=>{o.add(A=>A.addDurationVital(I))};return{init(I,A,T){if(!I){dt.error("Missing configuration");return}pee(I.enableExperimentalFeatures),h=I,!(e&&Tz())&&(Bz(I.plugins,"onInit",{initConfiguration:I,publicApi:A}),I.remoteConfigurationId?Qne(I,{user:c,context:a}).then(N=>{N&&C(N,T)}).catch(qs):C(I,T))},get initConfiguration(){return h},getInternalContext:Ft,stopSession:Ft,addTiming(I,A=vr()){o.add(T=>T.addTiming(I,A))},startView(I,A=er()){const T=N=>{N.startView(I,A)};o.add(T),f||(f={options:I,callback:T},S())},setViewName(I){o.add(A=>A.setViewName(I))},setViewContext(I){o.add(A=>A.setViewContext(I))},setViewContextProperty(I,A){o.add(T=>T.setViewContextProperty(I,A))},getViewContext:()=>b,globalContext:a,userContext:c,accountContext:d,addAction(I){o.add(A=>A.addAction(I))},addError(I){o.add(A=>A.addError(I))},addFeatureFlagEvaluation(I,A){o.add(T=>T.addFeatureFlagEvaluation(I,A))},startDurationVital(I,A){return Fz(r,I,A)},stopDurationVital(I,A){Vz(E,r,I,A)},addDurationVital:E,addOperationStepVital:(I,A,T,N)=>{o.add(z=>z.addOperationStepVital(ln(I),A,ln(T),ln(N)))}}}function sre(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=kp())===null||n===void 0?void 0:n.getPrivacyLevel()}}function uS(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(i=>i[t].setContext(r))})}function lre(e,t,n,r={}){const i=KJ(),o=Sne(),a=xne().observable;let c=are(r,i,o,(h,v,y)=>{const b=v&&r.createDeflateEncoder?C=>r.createDeflateEncoder(h,v,C):Vte,S=e(h,t,n,y,b,i,o,a,r.sdkName);return t.onRumStart(S.lifeCycle,h,S.session,S.viewHistory,v,S.telemetry),n.onRumStart(S.lifeCycle,S.hooks,h,S.session,S.viewHistory,b),c=cre(c,S),Bz(h.plugins,"onRumStart",{strategy:c,addEvent:S.addEvent}),S});const d=()=>c,f=yt(h=>{const v=typeof h=="object"?h:{name:h};c.startView(v),lr({feature:"start-view"})}),p=Hee({init:h=>{const v=new Error().stack;Fs(()=>c.init(h,p,v))},setTrackingConsent:yt(h=>{i.update(h),lr({feature:"set-tracking-consent",tracking_consent:h})}),setViewName:yt(h=>{c.setViewName(h),lr({feature:"set-view-name"})}),setViewContext:yt(h=>{c.setViewContext(h),lr({feature:"set-view-context"})}),setViewContextProperty:yt((h,v)=>{c.setViewContextProperty(h,v),lr({feature:"set-view-context-property"})}),getViewContext:yt(()=>(lr({feature:"set-view-context-property"}),c.getViewContext())),getInternalContext:yt(h=>c.getInternalContext(h)),getInitConfiguration:yt(()=>LC(c.initConfiguration)),addAction:(h,v)=>{const y=Zm("action");Fs(()=>{c.addAction({name:ln(h),context:ln(v),startClocks:er(),type:HC.CUSTOM,handlingStack:y}),lr({feature:"add-action"})})},addError:(h,v)=>{const y=Zm("error");Fs(()=>{c.addError({error:h,handlingStack:y,context:ln(v),startClocks:er()}),lr({feature:"add-error"})})},addTiming:yt((h,v)=>{c.addTiming(ln(h),v)}),setGlobalContext:Ar(d,cr.globalContext,Or.setContext,"set-global-context"),getGlobalContext:Ar(d,cr.globalContext,Or.getContext,"get-global-context"),setGlobalContextProperty:Ar(d,cr.globalContext,Or.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:Ar(d,cr.globalContext,Or.removeContextProperty,"remove-global-context-property"),clearGlobalContext:Ar(d,cr.globalContext,Or.clearContext,"clear-global-context"),setUser:Ar(d,cr.userContext,Or.setContext,"set-user"),getUser:Ar(d,cr.userContext,Or.getContext,"get-user"),setUserProperty:Ar(d,cr.userContext,Or.setContextProperty,"set-user-property"),removeUserProperty:Ar(d,cr.userContext,Or.removeContextProperty,"remove-user-property"),clearUser:Ar(d,cr.userContext,Or.clearContext,"clear-user"),setAccount:Ar(d,cr.accountContext,Or.setContext,"set-account"),getAccount:Ar(d,cr.accountContext,Or.getContext,"get-account"),setAccountProperty:Ar(d,cr.accountContext,Or.setContextProperty,"set-account-property"),removeAccountProperty:Ar(d,cr.accountContext,Or.removeContextProperty,"remove-account-property"),clearAccount:Ar(d,cr.accountContext,Or.clearContext,"clear-account"),startView:f,stopSession:yt(()=>{c.stopSession(),lr({feature:"stop-session"})}),addFeatureFlagEvaluation:yt((h,v)=>{c.addFeatureFlagEvaluation(ln(h),ln(v)),lr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:yt(()=>t.getSessionReplayLink()),startSessionReplayRecording:yt(h=>{t.start(h),lr({feature:"start-session-replay-recording",force:h&&h.force})}),stopSessionReplayRecording:yt(()=>t.stop()),addDurationVital:yt((h,v)=>{lr({feature:"add-duration-vital"}),c.addDurationVital({name:ln(h),type:Wm.DURATION,startClocks:iJ(v.startTime),duration:v.duration,context:ln(v&&v.context),description:ln(v&&v.description)})}),startDurationVital:yt((h,v)=>(lr({feature:"start-duration-vital"}),c.startDurationVital(ln(h),{context:ln(v&&v.context),description:ln(v&&v.description)}))),stopDurationVital:yt((h,v)=>{lr({feature:"stop-duration-vital"}),c.stopDurationVital(typeof h=="string"?ln(h):h,{context:ln(v&&v.context),description:ln(v&&v.description)})}),startFeatureOperation:yt((h,v)=>{lr({feature:"add-operation-step-vital",action_type:"start"}),c.addOperationStepVital(h,"start",v)}),succeedFeatureOperation:yt((h,v)=>{lr({feature:"add-operation-step-vital",action_type:"succeed"}),c.addOperationStepVital(h,"end",v)}),failFeatureOperation:yt((h,v,y)=>{lr({feature:"add-operation-step-vital",action_type:"fail"}),c.addOperationStepVital(h,"end",y,v)})});return p}function cre(e,t){return{init:n=>{fz("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function ure(){const e=dre();return new Nt(t=>{if(!e)return;const n=new e(yt(r=>t.notify(r)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function dre(){let e;const t=window;if(t.Zone&&(e=Hs(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(Ft),r=Hs(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function fre(){const e=new Nt,{stop:t}=na(window,"open",()=>e.notify());return{observable:e,stop:t}}function mre(e,t,n,r,i){return{get:o=>{const a=n.findView(o),c=i.findUrl(o),d=t.findTrackedSession(o);if(d&&a&&c){const f=r.findActionId(o);return{application_id:e,session_id:d.id,user_action:f?{id:f}:void 0,view:{id:a.id,name:a.name,referrer:c.referrer,url:c.url}}}}}}const pre=Bte,hre=yc;function gre(e){const t=Bd({expireDelay:hre});e.subscribe(1,r=>{t.add(n(r),r.startClocks.relative)}),e.subscribe(6,({endClocks:r})=>{t.closeActive(r.relative)}),e.subscribe(3,r=>{const i=t.find(r.startClocks.relative);i&&(r.name&&(i.name=r.name),r.context&&(i.context=r.context),i.sessionIsActive=r.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function n(r){return{service:r.service,version:r.version,context:r.context,id:r.id,name:r.name,startClocks:r.startClocks}}return{findView:r=>t.find(r),stop:()=>{t.stop()}}}const Yz="initial_document",vre=[[Mr.DOCUMENT,e=>Yz===e],[Mr.XHR,e=>e==="xmlhttprequest"],[Mr.FETCH,e=>e==="fetch"],[Mr.BEACON,e=>e==="beacon"],[Mr.CSS,(e,t)=>/\.css$/i.test(t)],[Mr.JS,(e,t)=>/\.js$/i.test(t)],[Mr.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[Mr.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[Mr.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function yre(e){const t=e.name;if(!gJ(t))return Mr.OTHER;const n=vJ(t);for(const[r,i]of vre)if(i(e.initiatorType,n))return r;return Mr.OTHER}function DO(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function Wz(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function bre(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?Mn(n,r):t}function xre(e){if(!Qz(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:o,domainLookupStart:a,domainLookupEnd:c,connectStart:d,secureConnectionStart:f,connectEnd:p,requestStart:h,responseStart:v,responseEnd:y}=e,b={download:Tl(t,v,y),first_byte:Tl(t,h,v)};return 0<r&&r<n&&(b.worker=Tl(t,r,n)),n<p&&(b.connect=Tl(t,d,p),d<=f&&f<=p&&(b.ssl=Tl(t,f,p))),n<c&&(b.dns=Tl(t,a,c)),t<o&&(b.redirect=Tl(t,i,o)),b}function Xz(e){return e.duration>=0}function Qz(e){const t=DO(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=wre(e)?DO(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function wre(e){return e.redirectEnd>e.startTime}function Tl(e,t,n){if(e<=t&&t<=n)return{duration:ht(Mn(t,n)),start:ht(Mn(e,t))}}function Sre(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function _re(e){return e.deliveryType===""?"other":e.deliveryType}function Cre(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:r}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function qC(e){return e&&(!uee(e)||Sp(Gs.TRACK_INTAKE_REQUESTS))}const Ere=/data:(.+)?(;base64)?,/g,kre=24e3;function jre(e,t=kre){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(Ere);return n?`${n[0]}[...]`:e}const Rre=32*dd;function Ire(e,t){const n=Nre(e.requestBody,t.trackPayload);if(n){if(t.trackResponseErrors&&e.responseBody){const r=Tre(e.responseBody);r&&(n.errors_count=r.length,n.errors=r)}return n}}function Tre(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const n=t;return Xl(n.errors)?n.errors.map(i=>{var o;return{message:i.message,path:i.path,locations:i.locations,code:(o=i.extensions)===null||o===void 0?void 0:o.code}}):void 0}function Jz(e,t){return t.allowedGraphQlUrls.find(n=>ib([n.match],e))}function Nre(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n||!n.query)return;const r=n.query.trim(),i=Are(r),o=n.operationName;if(!i)return;let a;return n.variables&&(a=JSON.stringify(n.variables)),{operationType:i,operationName:o,variables:a,payload:t?OC(r,Rre,"..."):void 0}}function Are(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let $O=1;function Ore(e,t,n,r,i){const o=Ine(t,n,r,i);Dre(e,t,o),$re(e,t,o)}function Dre(e,t,n){const r=qte(t).subscribe(i=>{const o=i;if(qC(o.url))switch(o.state){case"start":n.traceXhr(o,o.xhr),o.requestIndex=e4(),e.notify(7,{requestIndex:o.requestIndex,url:o.url});break;case"complete":n.clearTracingIfNeeded(o),e.notify(8,{duration:o.duration,method:o.method,requestIndex:o.requestIndex,spanId:o.spanId,startClocks:o.startClocks,status:o.status,traceId:o.traceId,traceSampled:o.traceSampled,type:sb.XHR,url:o.url,xhr:o.xhr,isAborted:o.isAborted,handlingStack:o.handlingStack,requestBody:o.requestBody,responseBody:o.responseBody});break}});return{stop:()=>r.unsubscribe()}}function $re(e,t,n){const r=Mz({responseBodyAction:i=>{var o;return!((o=Jz(i.url,t))===null||o===void 0)&&o.trackResponseErrors?2:1}}).subscribe(i=>{var o;const a=i;if(qC(a.url))switch(a.state){case"start":n.traceFetch(a),a.requestIndex=e4(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"resolve":n.clearTracingIfNeeded(a),e.notify(8,{duration:Mn(a.startClocks.timeStamp,vr()),method:a.method,requestIndex:a.requestIndex,responseType:a.responseType,spanId:a.spanId,startClocks:a.startClocks,status:a.status,traceId:a.traceId,traceSampled:a.traceSampled,type:sb.FETCH,url:a.url,response:a.response,init:a.init,input:a.input,isAborted:a.isAborted,handlingStack:a.handlingStack,requestBody:(o=a.init)===null||o===void 0?void 0:o.body,responseBody:a.responseBody});break}});return{stop:()=>r.unsubscribe()}}function e4(){const e=$O;return $O+=1,e}function t4(e){return xp(e)&&e<0?void 0:e}function n4({lifeCycle:e,isChildEvent:t,onChange:n=Ft}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},i=e.subscribe(13,o=>{var a;if(!(o.type==="view"||o.type==="vital"||!t(o)))switch(o.type){case gt.ERROR:r.errorCount+=1,n();break;case gt.ACTION:r.actionCount+=1,o.action.frustration&&(r.frustrationCount+=o.action.frustration.type.length),n();break;case gt.LONG_TASK:r.longTaskCount+=1,n();break;case gt.RESOURCE:!((a=o._dd)===null||a===void 0)&&a.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}function Mre(e,t){const n=Ur();let r=!1;const{stop:i}=Ks(e,window,["click","mousedown","keydown","touchstart","pointerdown"],c=>{if(!c.cancelable)return;const d={entryType:"first-input",processingStart:Oi(),processingEnd:Oi(),startTime:c.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};c.type==="pointerdown"?o(e,d):a(d)},{passive:!0,capture:!0});return{stop:i};function o(c,d){Ks(c,window,["pointerup","pointercancel"],f=>{f.type==="pointerup"&&a(d)},{once:!0})}function a(c){if(!r){r=!0,i();const d=c.processingStart-c.startTime;d>=0&&d<Ur()-n&&t(c)}}}var Dt;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(Dt||(Dt={}));function aa(e,t){return new Nt(n=>{if(!window.PerformanceObserver)return;const r=d=>{const f=Lre(d);f.length>0&&n.notify(f)};let i,o=!0;const a=new PerformanceObserver(yt(d=>{o?i=Er(()=>r(d.getEntries())):r(d.getEntries())}));try{a.observe(t)}catch{if([Dt.RESOURCE,Dt.NAVIGATION,Dt.LONG_TASK,Dt.PAINT].includes(t.type)){t.buffered&&(i=Er(()=>r(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}o=!1,Pre(e);let c;return!wc(Dt.FIRST_INPUT)&&t.type===Dt.FIRST_INPUT&&({stop:c}=Mre(e,d=>{r([d])})),()=>{a.disconnect(),c&&c(),to(i)}})}let sm;function Pre(e){return!sm&&zre()&&"addEventListener"in performance&&(sm=xn(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{sm?.stop()}}function zre(){return window.performance!==void 0&&"getEntries"in performance}function wc(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function Lre(e){return e.filter(t=>!Ure(t))}function Ure(e){return e.entryType===Dt.RESOURCE&&(!qC(e.name)||!Xz(e))}function K_(e){return e.nodeType===Node.TEXT_NODE}function Fre(e){return e.nodeType===Node.COMMENT_NODE}function Ga(e){return e.nodeType===Node.ELEMENT_NODE}function r4(e){return Ga(e)&&!!e.shadowRoot}function Vre(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&Ga(t.host)}function ANe(e){return e.childNodes.length>0||r4(e)}function ONe(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;r4(e)&&t(e.shadowRoot)}function Bre(e){return Vre(e)?e.host:e.parentNode}const i4=100,Hre=100,MO="data-dd-excluded-activity-mutations";function GC(e,t,n,r,i,o){const a=Gre(e,t,n,r);return qre(a,i,o)}function qre(e,t,n){let r,i=!1;const o=Er(yt(()=>f({hadActivity:!1})),i4),a=n!==void 0?Er(yt(()=>f({hadActivity:!0,end:vr()})),n):void 0,c=e.subscribe(({isBusy:p})=>{to(o),to(r);const h=vr();p||(r=Er(yt(()=>f({hadActivity:!0,end:h})),Hre))}),d=()=>{i=!0,to(o),to(r),to(a),c.unsubscribe()};function f(p){i||(d(),t(p))}return{stop:d}}function Gre(e,t,n,r){return new Nt(i=>{const o=[];let a,c=0;return o.push(t.subscribe(f=>{f.every(Kre)||d()}),n.subscribe(d),aa(r,{type:Dt.RESOURCE}).subscribe(f=>{f.some(p=>!dS(r,p.name))&&d()}),e.subscribe(7,f=>{dS(r,f.url)||(a===void 0&&(a=f.requestIndex),c+=1,d())}),e.subscribe(8,f=>{dS(r,f.url)||a===void 0||f.requestIndex<a||(c-=1,d())})),()=>{o.forEach(f=>f.unsubscribe())};function d(){i.notify({isBusy:c>0})}})}function dS(e,t){return ib(e.excludedActivityUrls,t)}function Kre(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&Ga(t)&&t.matches(`[${MO}], [${MO}] *`))}const lb="data-dd-action-name",Zre="Masked Element",Yre=[lb,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],Wre=[a4,Qre],Xre=[a4,Jre,eie];function Rp(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const i=PO(r,Wre,nie,t,n);if(i)return i;n=PO(r,Xre,rie,t,n)||cb(tie(r),n),r=r.parentElement}return n}function o4(e){return/[0-9]/.test(e)}function Qre(e){if(e.id&&!o4(e.id))return`#${CSS.escape(e.id)}`}function Jre(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!o4(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function eie(e){return CSS.escape(e.tagName)}function a4(e,t){if(t){const r=n(t);if(r)return r}for(const r of Yre){const i=n(r);if(i)return i}function n(r){if(e.hasAttribute(r))return`${CSS.escape(e.tagName)}[${r}="${CSS.escape(e.getAttribute(r))}"]`}}function tie(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function PO(e,t,n,r,i){for(const o of t){const a=o(e,r);if(a&&n(e,a,i))return cb(a,i)}}function nie(e,t,n){return e.ownerDocument.querySelectorAll(cb(t,n)).length===1}function rie(e,t,n){let r;if(n===void 0)r=a=>a.matches(t);else{const a=cb(`${t}:scope`,n);r=c=>c.querySelector(a)!==null}let o=e.parentElement.firstElementChild;for(;o;){if(o!==e&&r(o))return!1;o=o.nextElementSibling}return!0}function cb(e,t){return t?`${e}>${t}`:e}const It={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Lu.ALLOW,MASK:Lu.MASK,MASK_USER_INPUT:Lu.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:Lu.MASK_UNLESS_ALLOWLISTED},iie="data-dd-privacy",DNe="hidden",oie="dd-privacy-",fS="***",$Ne="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",aie={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},sie="x";function Dl(e){return`[${iie}="${e}"], .${oie}${e}`}function KC(e,t,n){if(n&&n.has(e))return n.get(e);const r=Bre(e),i=r?KC(r,t,n):t,o=cie(e),a=lie(o,i);return n&&n.set(e,a),a}function lie(e,t){switch(t){case It.HIDDEN:case It.IGNORE:return t}switch(e){case It.ALLOW:case It.MASK:case It.MASK_USER_INPUT:case It.MASK_UNLESS_ALLOWLISTED:case It.HIDDEN:case It.IGNORE:return e;default:return t}}function cie(e){if(Ga(e)){if(e.tagName==="BASE")return It.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return It.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return It.MASK}if(e.matches(Dl(It.HIDDEN)))return It.HIDDEN;if(e.matches(Dl(It.MASK)))return It.MASK;if(e.matches(Dl(It.MASK_UNLESS_ALLOWLISTED)))return It.MASK_UNLESS_ALLOWLISTED;if(e.matches(Dl(It.MASK_USER_INPUT)))return It.MASK_USER_INPUT;if(e.matches(Dl(It.ALLOW)))return It.ALLOW;if(uie(e))return It.IGNORE}}function s4(e,t){switch(t){case It.MASK:case It.HIDDEN:case It.IGNORE:return!0;case It.MASK_UNLESS_ALLOWLISTED:return K_(e)?$g(e.parentNode)?!0:!c4(e.textContent||""):$g(e);case It.MASK_USER_INPUT:return K_(e)?$g(e.parentNode):$g(e);default:return!1}}function $g(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!aie[t.tagName]}const l4=e=>e.replace(/\S/g,sie);function MNe(e,t){var n;const r=(n=e.parentElement)===null||n===void 0?void 0:n.tagName;let i=e.textContent||"";if(r==="HEAD"&&!i.trim())return;const a=t;if(r==="SCRIPT")i=fS;else if(a===It.HIDDEN)i=fS;else if(s4(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=fS:a===It.MASK_UNLESS_ALLOWLISTED?i=die(i):i=l4(i);return i}function uie(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),r=t("rel"),i=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||r==="icon"||r==="apple-touch-icon"||r==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(i)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(i)||/^product:/.test(i)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function c4(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function die(e,t){return c4(e)?e:t||l4(e)}const u4=Rr,fie=100;function mie(e,t){const n=[];let r=0,i;o(e);function o(d){d.stopObservable.subscribe(a),n.push(d),to(i),i=Er(c,u4)}function a(){r===1&&n.every(d=>d.isStopped())&&(r=2,t(n))}function c(){to(i),r===0&&(r=1,a())}return{tryAppend:d=>r!==0?!1:n.length>0&&!pie(n[n.length-1].event,d.event)?(c(),!1):(o(d),!0),stop:()=>{c()}}}function pie(e,t){return e.target===t.target&&hie(e,t)<=fie&&e.timeStamp-t.timeStamp<=u4}function hie(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function gie(e,t,n=It.ALLOW){const{actionNameAttribute:r}=t,i=zO(e,lb)||r&&zO(e,r);return i?{name:i,nameSource:"custom_attribute"}:n===It.MASK?{name:Zre,nameSource:"mask_placeholder"}:LO(e,vie,t)||LO(e,yie,t)||{name:"",nameSource:"blank"}}function zO(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return f4(d4(r.trim()))}const vie=[(e,t)=>{if("labels"in e&&e.labels&&e.labels.length>0)return xv(e.labels[0],t)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return xv(e,t)},e=>lm(e,"aria-label"),(e,t)=>{const n=e.getAttribute("aria-labelledby");if(n)return{name:n.split(/\s+/).map(r=>xie(e,r)).filter(r=>!!r).map(r=>m4(r,t)).join(" "),nameSource:"text_content"}},e=>lm(e,"alt"),e=>lm(e,"name"),e=>lm(e,"title"),e=>lm(e,"placeholder"),(e,t)=>{if("options"in e&&e.options.length>0)return xv(e.options[0],t)}],yie=[(e,t)=>xv(e,t)],bie=10;function LO(e,t,n){let r=e,i=0;for(;i<=bie&&r&&r.nodeName!=="BODY"&&r.nodeName!=="HTML"&&r.nodeName!=="HEAD";){for(const o of t){const a=o(r,n);if(a){const{name:c,nameSource:d}=a,f=c&&c.trim();if(f)return{name:f4(d4(f)),nameSource:d}}}if(r.nodeName==="FORM")break;r=r.parentElement,i+=1}}function d4(e){return e.replace(/\s+/g," ")}function f4(e){return e.length>100?`${OC(e,100)} [...]`:e}function xie(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function lm(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function xv(e,t){return{name:m4(e,t)||"",nameSource:"text_content"}}function m4(e,t){if(e.isContentEditable)return;const{enablePrivacyForActionName:n,actionNameAttribute:r,defaultPrivacyLevel:i}=t;if(Sp(Gs.USE_TREE_WALKER_FOR_ACTION_NAME))return wie(e,r,n,i);if("innerText"in e){let o=e.innerText;const a=c=>{const d=e.querySelectorAll(c);for(let f=0;f<d.length;f+=1){const p=d[f];if("innerText"in p){const h=p.innerText;h&&h.trim().length>0&&(o=o.replace(h,""))}}};return a(`[${lb}]`),r&&a(`[${r}]`),n&&a(`${Dl(It.HIDDEN)}, ${Dl(It.MASK)}`),o}return e.textContent}function wie(e,t,n,r){const i=new Map,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,c);let a="";for(;o.nextNode();){const d=o.currentNode;if(Ga(d)){(d.nodeName==="BR"||d.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(d).display))&&(a+=" ");continue}a+=d.textContent||""}return a.replace(/\s+/g," ").trim();function c(d){const f=KC(d,r,i);if(n&&f&&s4(d,f))return NodeFilter.FILTER_REJECT;if(Ga(d)){if(d.hasAttribute(lb)||t&&d.hasAttribute(t))return NodeFilter.FILTER_REJECT;const p=getComputedStyle(d);if(p.visibility!=="visible"||p.display==="none"||p.contentVisibility&&p.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function Sie(e,{onPointerDown:t,onPointerUp:n}){let r,i={selection:!1,input:!1,scroll:!1},o;const a=[xn(e,window,"pointerdown",c=>{FO(c)&&(r=UO(),i={selection:!1,input:!1,scroll:!1},o=t(c))},{capture:!0}),xn(e,window,"selectionchange",()=>{(!r||!UO())&&(i.selection=!0)},{capture:!0}),xn(e,window,"scroll",()=>{i.scroll=!0},{capture:!0,passive:!0}),xn(e,window,"pointerup",c=>{if(FO(c)&&o){const d=i;n(o,c,()=>d),o=void 0}},{capture:!0}),xn(e,window,"input",()=>{i.input=!0},{capture:!0})];return{stop:()=>{a.forEach(c=>c.stop())}}}function UO(){const e=window.getSelection();return!e||e.isCollapsed}function FO(e){return e.target instanceof Element&&e.isPrimary!==!1}const VO=3;function _ie(e,t){if(Cie(e))return t.addFrustration(am.RAGE_CLICK),e.some(BO)&&t.addFrustration(am.DEAD_CLICK),t.hasError&&t.addFrustration(am.ERROR_CLICK),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration(am.ERROR_CLICK),BO(r)&&!n&&r.addFrustration(am.DEAD_CLICK)}),{isRage:!1}}function Cie(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(VO-1);t+=1)if(e[t+VO-1].event.timeStamp-e[t].event.timeStamp<=Rr)return!0;return!1}const Eie='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function BO(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(Eie)}const p4=10*Rr,Dm=new Map;function kie(e){const t=Dm.get(e);return Dm.delete(e),t}function h4(e,t){Dm.set(e,t),Dm.forEach((n,r)=>{Mn(r,Oi())>p4&&Dm.delete(r)})}const jie=5*Br;function Rie(e,t,n,r){const i=Bd({expireDelay:jie}),o=new Nt;let a;e.subscribe(10,()=>{i.reset()}),e.subscribe(5,p),e.subscribe(11,h=>{h.reason===Zu.UNLOADING&&p()});const{stop:c}=Sie(r,{onPointerDown:h=>Iie(r,e,t,h,n),onPointerUp:({clickActionBase:h,hadActivityOnPointerDown:v},y,b)=>{Tie(r,e,t,n,i,o,f,h,y,b,v)}});return{stop:()=>{p(),o.notify(),c()},actionContexts:{findActionId:h=>i.findAll(h)}};function f(h){if(!a||!a.tryAppend(h)){const v=h.clone();a=mie(h,y=>{Aie(y,v)})}}function p(){a&&a.stop()}}function Iie(e,t,n,r,i){let o;if(e.enablePrivacyForActionName?o=KC(r.target,e.defaultPrivacyLevel):o=It.ALLOW,o===It.HIDDEN)return;const a=Nie(r,o,e);let c=!1;return GC(t,n,i,e,d=>{c=d.hadActivity},i4),{clickActionBase:a,hadActivityOnPointerDown:()=>c}}function Tie(e,t,n,r,i,o,a,c,d,f,p){var h;const v=g4(t,i,f,c,d);a(v);const y=(h=c?.target)===null||h===void 0?void 0:h.selector;y&&h4(d.timeStamp,y);const{stop:b}=GC(t,n,r,e,E=>{E.hadActivity&&E.end<v.startClocks.timeStamp?v.discard():E.hadActivity?v.stop(E.end):p()?v.stop(v.startClocks.timeStamp):v.stop()},p4),S=t.subscribe(5,({endClocks:E})=>{v.stop(E.timeStamp)}),C=o.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),b(),C.unsubscribe()})}function Nie(e,t,n){const r=e.target.getBoundingClientRect(),i=Rp(e.target,n.actionNameAttribute);i&&h4(e.timeStamp,i);const{name:o,nameSource:a}=gie(e.target,n,t);return{type:HC.CLICK,target:{width:Math.round(r.width),height:Math.round(r.height),selector:i},position:{x:Math.round(e.clientX-r.left),y:Math.round(e.clientY-r.top)},name:o,nameSource:a}}function g4(e,t,n,r,i){const o=jr(),a=er(),c=t.add(o,a.relative),d=n4({lifeCycle:e,isChildEvent:b=>b.action!==void 0&&(Array.isArray(b.action.id)?b.action.id.includes(o):b.action.id===o)});let f=0,p;const h=[],v=new Nt;function y(b){f===0&&(p=b,f=1,p?c.close(AC(p)):c.remove(),d.stop(),v.notify())}return{event:i,stop:y,stopObservable:v,get hasError(){return d.eventCounts.errorCount>0},get hasPageActivity(){return p!==void 0},getUserActivity:n,addFrustration:b=>{h.push(b)},startClocks:a,isStopped:()=>f===1||f===2,clone:()=>g4(e,t,n,r,i),validate:b=>{if(y(),f!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:E}=d.eventCounts,k={duration:p&&Mn(a.timeStamp,p),startClocks:a,id:o,frustrationTypes:h,counts:{resourceCount:S,errorCount:C,longTaskCount:E},events:b??[i],event:i,...r};e.notify(0,k),f=2},discard:()=>{y(),f=2}}}function Aie(e,t){const{isRage:n}=_ie(e,t);n?(e.forEach(r=>r.discard()),t.stop(vr()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function Oie(e,t,n,r,i){const{unsubscribe:o}=e.subscribe(0,d=>{e.notify(12,HO(d))});t.register(0,({startTime:d,eventType:f})=>{if(f!==gt.ERROR&&f!==gt.RESOURCE&&f!==gt.LONG_TASK)return Di;const p=a.findActionId(d);return p?{type:f,action:{id:p}}:Di}),t.register(1,({startTime:d})=>({action:{id:a.findActionId(d)}}));let a={findActionId:Ft},c=Ft;return i.trackUserInteractions&&({actionContexts:a,stop:c}=Rie(e,n,r,i)),{addAction:d=>{e.notify(12,HO(d))},actionContexts:a,stop:()=>{o(),c()}}}function HO(e){const t=mS(e)?{action:{id:e.id,loading_time:t4(ht(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=qa({action:{id:jr(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:gt.ACTION},t),r=mS(e)?e.duration:void 0,i=mS(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function mS(e){return e.type!==HC.CUSTOM}function Die(e){const t=ane([Yy.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function $ie(e,t){const n=Gee(e,[Ym.cspViolation,Ym.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function Mie(e,t,n){const r=new Nt;return n.subscribe(i=>{i.type===0&&r.notify(i.error)}),Die(r),$ie(t,r),r.subscribe(i=>e.notify(14,{error:i})),Pie(e)}function Pie(e){return e.subscribe(14,({error:t})=>{e.notify(12,zie(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:o})=>{const a=zC({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:"Provided",source:Fd.CUSTOM,handling:"handled"});a.context=qa(a.context,o),e.notify(14,{error:a})}}}function zie(e){const t={date:e.startClocks.timeStamp,error:{id:jr(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:gt.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const qO=new WeakSet;function Lie(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(r=>!qO.has(r)).filter(r=>Xz(r)&&Qz(r)).filter(r=>Uie(r,e.startClocks.relative,v4({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return qO.add(n[0]),n[0].toJSON()}function v4(e){return Ld(e.startTime,e.duration)}function Uie(e,t,n){return e.startTime>=t-1&&v4(e)<=Ld(n,1)}const Fie=2*Br;function Vie(e){const t=Bie(e)||Hie(e);if(!(!t||t.traceTime<=Ur()-Fie))return t.traceId}function Bie(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return y4(t&&t.content,n&&n.content)}function Hie(e){const t=qie(e);if(t)return y4(Gm(t,"trace-id"),Gm(t,"trace-time"))}function y4(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function qie(e){for(let t=0;t<e.childNodes.length;t+=1){const n=GO(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],r=GO(n);if(r)return r;if(!K_(n))break}}function GO(e){if(e&&Fre(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function b4(){if(wc(Dt.NAVIGATION)){const n=performance.getEntriesByType(Dt.NAVIGATION)[0];if(n)return n}const e=Gie(),t={entryType:Dt.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function Gie(){const e={},t=performance.timing;for(const n in t)if(xp(t[n])){const r=n,i=t[r];e[r]=i===0?0:AC(i)}return e}function Kie(e,t,n=b4){FC(e,"interactive",()=>{const r=n(),i=Object.assign(r.toJSON(),{entryType:Dt.RESOURCE,initiatorType:Yz,duration:r.responseEnd,traceId:Vie(document),toJSON:()=>({...i,toJSON:void 0})});t(i)})}const Zie=1e3;function Yie(e){const t=new Set,n=e.subscribe(8,r=>{t.add(r),t.size>Zie&&(jp("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(r){let i=1/0,o;for(const a of t){const c=r.startTime-a.startClocks.relative;0<=c&&c<i&&a.url===r.name&&(i=Math.abs(c),o=a)}return o&&t.delete(o),o},stop(){n.unsubscribe()}}}function Wie(e,t,n,r=one(),i=Kie){let o;const a=t.trackEarlyRequests;a?o=Yie(e):e.subscribe(8,f=>{d(()=>Xie(f,t,n))});const c=aa(t,{type:Dt.RESOURCE,buffered:!0}).subscribe(f=>{for(const p of f)(a||!Wz(p))&&d(()=>KO(p,t,n,o))});i(t,f=>{d(()=>KO(f,t,n,o))});function d(f){r.push(()=>{const p=f();p&&e.notify(12,p)})}return{stop:()=>{r.stop(),c.unsubscribe()}}}function Xie(e,t,n){const r=Lie(e);return x4(r,e,n,t)}function KO(e,t,n,r){const i=Wz(e)&&r?r.getMatchingRequest(e):void 0;return x4(e,i,n,t)}function x4(e,t,n,r){if(!e&&!t)return;const i=t?toe(t,r):noe(e,r);if(!r.trackResources&&!i)return;const o=e?Xy(e.startTime):t.startClocks,a=e?bre(e):roe(n,o,t.duration),c=t&&Qie(t,r),d=qa({date:o.timeStamp,resource:{id:jr(),duration:ht(a),type:t?t.type===sb.XHR?Mr.XHR:Mr.FETCH:yre(e),method:t?t.method:void 0,status_code:t?t.status:ioe(e.responseStatus),url:t?jre(t.url):e.name,protocol:e&&Sre(e),delivery_type:e&&_re(e),graphql:c},type:gt.RESOURCE,_dd:{discarded:!r.trackResources}},i,e&&eoe(e));return{startTime:o.relative,duration:a,rawRumEvent:d,domainContext:Jie(e,t)}}function Qie(e,t){const n=Jz(e.url,t);if(n)return Ire(e,n)}function Jie(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===sb.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function eoe(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...Cre(e),...xre(e)}}}function toe(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function noe(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:qz().toString(),rule_psr:t.rulePsr}}}function roe(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function ioe(e){return e===0?void 0:e}function ooe(e,t,n){const{stop:r,eventCounts:i}=n4({lifeCycle:e,isChildEvent:o=>o.view.id===t,onChange:n});return{stop:r,eventCounts:i}}const aoe=10*Br;function soe(e,t,n){return{stop:aa(e,{type:Dt.PAINT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<aoe);o&&n(o.startTime)}).unsubscribe}}function loe(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Mn(e,Oi()))})})}function coe(e,t,n){const r=aa(e,{type:Dt.FIRST_INPUT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.startTime<t.timeStamp);if(o){const a=Mn(o.startTime,o.processingStart);let c;o.target&&Ga(o.target)&&(c=Rp(o.target,e.actionNameAttribute)),n({delay:a>=0?a:0,time:o.startTime,targetSelector:c})}});return{stop:()=>{r.unsubscribe()}}}function uoe(e,t,n=b4){return moe(e,()=>{const r=n();foe(r)||t(doe(r))})}function doe(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=Oi()?e.responseStart:void 0}}function foe(e){return e.loadEventEnd<=0}function moe(e,t){let n;const{stop:r}=FC(e,"complete",()=>{n=Er(()=>t())});return{stop:()=>{r(),to(n)}}}const poe=10*Br;function hoe(e,t,n,r){let i=1/0;const{stop:o}=Ks(e,n,["pointerdown","keydown"],d=>{i=d.timeStamp},{capture:!0,once:!0});let a=0;const c=aa(e,{type:Dt.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(d=>{const f=KP(d,p=>p.entryType===Dt.LARGEST_CONTENTFUL_PAINT&&p.startTime<i&&p.startTime<t.timeStamp&&p.startTime<poe&&p.size>a);if(f){let p;f.element&&(p=Rp(f.element,e.actionNameAttribute)),r({value:f.startTime,targetSelector:p,resourceUrl:goe(f)}),a=f.size}});return{stop:()=>{o(),c.unsubscribe()}}}function goe(e){return e.url===""?void 0:e.url}function w4(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:Ft};if(wc(Dt.VISIBILITY_STATE)){const o=performance.getEntriesByType(Dt.VISIBILITY_STATE).filter(a=>a.name==="hidden").find(a=>a.startTime>=t.relative);if(o)return{timeStamp:o.startTime,stop:Ft}}let r=1/0;const{stop:i}=Ks(e,n,["pagehide","visibilitychange"],o=>{(o.type==="pagehide"||document.visibilityState==="hidden")&&(r=o.timeStamp,i())},{capture:!0});return{get timeStamp(){return r},stop:i}}function voe(e,t,n,r){const i={},{stop:o}=uoe(e,h=>{n(h.loadEvent),i.navigationTimings=h,r()}),a=w4(e,t),{stop:c}=soe(e,a,h=>{i.firstContentfulPaint=h,r()}),{stop:d}=hoe(e,a,window,h=>{i.largestContentfulPaint=h,r()}),{stop:f}=coe(e,a,h=>{i.firstInput=h,r()});function p(){o(),c(),d(),f(),a.stop()}return{stop:p,initialViewMetrics:i}}const Z_=(e,t)=>e*t,yoe=(e,t)=>{const n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),o=Math.min(e.bottom,t.bottom);return n>=i||r>=o?0:Z_(i-n,o-r)},ZO=e=>{const t=Z_(e.previousRect.width,e.previousRect.height),n=Z_(e.currentRect.width,e.currentRect.height),r=yoe(e.previousRect,e.currentRect);return t+n-r};function boe(e,t,n){if(!Coe())return{stop:Ft};let r=0,i;n({value:0});const o=_oe(),a=aa(e,{type:Dt.LAYOUT_SHIFT,buffered:!0}).subscribe(c=>{var d;for(const f of c){if(f.hadRecentInput||f.startTime<t)continue;const{cumulatedValue:p,isMaxValue:h}=o.update(f);if(h){const v=xoe(f.sources);i={target:v?.node?new WeakRef(v.node):void 0,time:Mn(t,f.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(p>r){r=p;const v=(d=i?.target)===null||d===void 0?void 0:d.deref();n({value:Am(r,4),targetSelector:v&&Rp(v,e.actionNameAttribute),time:i?.time,previousRect:i?.previousRect?YO(i.previousRect):void 0,currentRect:i?.currentRect?YO(i.currentRect):void 0,devicePixelRatio:i?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function xoe(e){let t;for(const n of e)if(n.node&&Ga(n.node)){const r=ZO(n);(!t||ZO(t)<r)&&(t=n)}return t}function YO({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const woe=5*Rr,Soe=Rr;function _oe(){let e=0,t,n,r=0;return{update:i=>{const o=t===void 0||i.startTime-n>=Soe||i.startTime-t>=woe;let a;return o?(t=n=i.startTime,r=e=i.value,a=!0):(e+=i.value,n=i.startTime,a=i.value>r,a&&(r=i.value)),{cumulatedValue:e,isMaxValue:a}}}}function Coe(){return wc(Dt.LAYOUT_SHIFT)&&"WeakRef"in window}let wv,S4=0,pS=1/0,hS=0;function Eoe(){"interactionCount"in performance||wv||(wv=new window.PerformanceObserver(yt(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(pS=Math.min(pS,n.interactionId),hS=Math.max(hS,n.interactionId),S4=(hS-pS)/7+1)})})),wv.observe({type:"event",buffered:!0,durationThreshold:0}))}const WO=()=>wv?S4:window.performance.interactionCount||0,XO=10,koe=1*Br;function joe(e,t,n){if(!Toe())return{getInteractionToNextPaint:()=>{},setViewEnd:Ft,stop:Ft};const{getViewInteractionCount:r,stopViewInteractionCount:i}=Ioe(n);let o=1/0;const a=Roe(r);let c=-1,d,f;function p(y){for(const S of y)S.interactionId&&S.startTime>=t&&S.startTime<=o&&a.process(S);const b=a.estimateP98Interaction();b&&b.duration!==c&&(c=b.duration,f=Mn(t,b.startTime),d=kie(b.startTime),!d&&b.target&&Ga(b.target)&&(d=Rp(b.target,e.actionNameAttribute)))}const h=aa(e,{type:Dt.FIRST_INPUT,buffered:!0}).subscribe(p),v=aa(e,{type:Dt.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);return{getInteractionToNextPaint:()=>{if(c>=0)return{value:Math.min(c,koe),targetSelector:d,time:f};if(r())return{value:0}},setViewEnd:y=>{o=y,i()},stop:()=>{v.unsubscribe(),h.unsubscribe()}}}function Roe(e){const t=[];function n(){t.sort((r,i)=>i.duration-r.duration).splice(XO)}return{process(r){const i=t.findIndex(a=>r.interactionId===a.interactionId),o=t[t.length-1];i!==-1?r.duration>t[i].duration&&(t[i]=r,n()):(t.length<XO||r.duration>o.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function Ioe(e){Eoe();const t=e===Pa.INITIAL_LOAD?0:WO();let n={stopped:!1};function r(){return WO()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function Toe(){return wc(Dt.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function Noe(e,t,n,r,i,o,a){let c=i===Pa.INITIAL_LOAD,d=!0;const f=[],p=w4(r,o);function h(){if(!d&&!c&&f.length>0){const y=Math.max(...f);y<p.timeStamp-o.relative&&a(y)}}const{stop:v}=GC(e,t,n,r,y=>{d&&(d=!1,y.hadActivity&&f.push(Mn(o.timeStamp,y.end)),h())});return{stop:()=>{v(),p.stop()},setLoadEvent:y=>{c&&(c=!1,f.push(y),h())}}}function PNe(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function Aoe(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let gS;function Ooe(e){return gS||(gS=Doe(e)),gS}function Doe(e){return new Nt(t=>{const{throttled:n}=Jy(()=>{t.notify(ZC())},200);return xn(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function ZC(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const $oe=Rr;function Moe(e,t,n,r=zoe(e)){let i=0,o=0,a=0;const c=r.subscribe(({scrollDepth:d,scrollTop:f,scrollHeight:p})=>{let h=!1;if(d>i&&(i=d,h=!0),p>o){o=p;const v=Oi();a=Mn(t.relative,v),h=!0}h&&n({maxDepth:Math.min(i,o),maxDepthScrollTop:f,maxScrollHeight:o,maxScrollHeightTime:a})});return{stop:()=>c.unsubscribe()}}function Poe(){const e=Aoe(),{height:t}=ZC(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function zoe(e,t=$oe){return new Nt(n=>{function r(){n.notify(Poe())}if(window.ResizeObserver){const i=Jy(r,t,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,a=new ResizeObserver(yt(i.throttled));o&&a.observe(o);const c=xn(e,window,"scroll",i.throttled,{passive:!0});return()=>{i.cancel(),a.disconnect(),c.stop()}}})}function Loe(e,t,n,r,i,o,a){const c={},{stop:d,setLoadEvent:f}=Noe(e,t,n,r,o,a,S=>{c.loadingTime=S,i()}),{stop:p}=Moe(r,a,S=>{c.scroll=S}),{stop:h}=boe(r,a.relative,S=>{c.cumulativeLayoutShift=S,i()}),{stop:v,getInteractionToNextPaint:y,setViewEnd:b}=joe(r,a.relative,o);return{stop:()=>{d(),h(),p()},stopINPTracking:v,setLoadEvent:f,setViewEnd:b,getCommonViewMetrics:()=>(c.interactionToNextPaint=y(),c)}}function Uoe(e,t){const{stop:n}=xn(e,window,"pageshow",r=>{r.persisted&&t(r)},{capture:!0});return n}function Foe(e,t,n){loe(e.relative,r=>{t.firstContentfulPaint=r,t.largestContentfulPaint={value:r},n()})}const Voe=3e3,Boe=5*Br,Hoe=5*Br;function qoe(e,t,n,r,i,o,a,c){const d=new Set;let f=v(Pa.INITIAL_LOAD,MP(),c),p;y();let h;a&&(h=b(o),i.trackBfcacheViews&&(p=Uoe(i,S=>{f.end();const C=Xy(S.timeStamp);f=v(Pa.BF_CACHE,C,void 0)})));function v(S,C,E){const k=Goe(t,n,r,i,e,S,C,E);return d.add(k),k.stopObservable.subscribe(()=>{d.delete(k)}),k}function y(){t.subscribe(10,()=>{f=v(Pa.ROUTE_CHANGE,void 0,{name:f.name,service:f.service,version:f.version,context:f.contextManager.getContext()})}),t.subscribe(9,()=>{f.end({sessionIsActive:!1})})}function b(S){return S.subscribe(({oldLocation:C,newLocation:E})=>{Zoe(C,E)&&(f.end(),f=v(Pa.ROUTE_CHANGE))})}return{addTiming:(S,C=vr())=>{f.addTiming(S,C)},startView:(S,C)=>{f.end({endClocks:C}),f=v(Pa.ROUTE_CHANGE,C,S)},setViewContext:S=>{f.contextManager.setContext(S)},setViewContextProperty:(S,C)=>{f.contextManager.setContextProperty(S,C)},setViewName:S=>{f.setViewName(S)},getViewContext:()=>f.contextManager.getContext(),stop:()=>{h&&h.unsubscribe(),p&&p(),f.end(),d.forEach(S=>S.stop())}}}function Goe(e,t,n,r,i,o,a=er(),c){const d=jr(),f=new Nt,p={};let h=0,v;const y=qm(i),b=ab();let S=!0,C=c?.name;const E=c?.service||r.service,k=c?.version||r.version,j=c?.context;j&&b.setContext(j);const I={id:d,name:C,startClocks:a,service:E,version:k,context:j};e.notify(1,I),e.notify(2,I);const{throttled:A,cancel:T}=Jy(D,Voe,{leading:!1}),{setLoadEvent:N,setViewEnd:z,stop:L,stopINPTracking:K,getCommonViewMetrics:J}=Loe(e,t,n,r,te,o,a),{stop:H,initialViewMetrics:Y}=o===Pa.INITIAL_LOAD?voe(r,a,N,te):{stop:Ft,initialViewMetrics:{}};o===Pa.BF_CACHE&&Foe(a,Y,te);const{stop:B,eventCounts:W}=ooe(e,d,te),M=Ud(D,Boe),Z=e.subscribe(11,P=>{P.reason===Zu.UNLOADING&&D()});D(),b.changeObservable.subscribe(te);function U(){e.notify(3,{id:d,name:C,context:b.getContext(),startClocks:a,sessionIsActive:S})}function te(){U(),A()}function D(){T(),U(),h+=1;const P=v===void 0?vr():v.timeStamp;e.notify(4,{customTimings:p,documentVersion:h,id:d,name:C,service:E,version:k,context:b.getContext(),loadingType:o,location:y,startClocks:a,commonViewMetrics:J(),initialViewMetrics:Y,duration:Mn(a.timeStamp,P),isActive:v===void 0,sessionIsActive:S,eventCounts:W})}return{get name(){return C},service:E,version:k,contextManager:b,stopObservable:f,end(P={}){var F,O;v||(v=(F=P.endClocks)!==null&&F!==void 0?F:er(),S=(O=P.sessionIsActive)!==null&&O!==void 0?O:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),Qy(M),z(v.relative),L(),Z.unsubscribe(),D(),Er(()=>{this.stop()},Hoe))},stop(){H(),B(),K(),f.notify()},addTiming(P,F){if(v)return;const O=lJ(F)?F:Mn(a.timeStamp,F);p[Koe(P)]=O,te()},setViewName(P){C=P,D()}}}function Koe(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&dt.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function Zoe(e,t){return e.pathname!==t.pathname||!Yoe(t.hash)&&QO(t.hash)!==QO(e.hash)}function Yoe(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function QO(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function Woe(e,t,n,r,i,o,a,c,d,f){return e.subscribe(4,p=>e.notify(12,Xoe(p,n,c))),t.register(0,({startTime:p,eventType:h})=>{const v=d.findView(p);return v?{type:h,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:Zs}),t.register(1,({startTime:p})=>{var h;return{view:{id:(h=d.findView(p))===null||h===void 0?void 0:h.id}}}),qoe(r,e,i,o,n,a,!n.trackViewsManually,f)}function Xoe(e,t,n){var r,i,o,a,c,d,f,p,h,v,y,b,S,C,E,k,j,I;const A=n.getReplayStats(e.id),T=(i=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||i===void 0?void 0:i.devicePixelRatio,N={_dd:{document_version:e.documentVersion,replay_stats:A,cls:T?{device_pixel_ratio:T}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:gt.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(o=e.commonViewMetrics.cumulativeLayoutShift)===null||o===void 0?void 0:o.value,cumulative_layout_shift_time:ht((a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.time),cumulative_layout_shift_target_selector:(c=e.commonViewMetrics.cumulativeLayoutShift)===null||c===void 0?void 0:c.targetSelector,first_byte:ht((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.firstByte),dom_complete:ht((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.domComplete),dom_content_loaded:ht((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.domContentLoaded),dom_interactive:ht((h=e.initialViewMetrics.navigationTimings)===null||h===void 0?void 0:h.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:ht(e.initialViewMetrics.firstContentfulPaint),first_input_delay:ht((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:ht((y=e.initialViewMetrics.firstInput)===null||y===void 0?void 0:y.time),first_input_target_selector:(b=e.initialViewMetrics.firstInput)===null||b===void 0?void 0:b.targetSelector,interaction_to_next_paint:ht((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:ht((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(E=e.commonViewMetrics.interactionToNextPaint)===null||E===void 0?void 0:E.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:ht((k=e.initialViewMetrics.largestContentfulPaint)===null||k===void 0?void 0:k.value),largest_contentful_paint_target_selector:(j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.targetSelector,load_event:ht((I=e.initialViewMetrics.navigationTimings)===null||I===void 0?void 0:I.loadEvent),loading_time:t4(ht(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Qoe(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:ht(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:ht(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:wne()}};return il(e.customTimings)||(N.view.custom_timings=UP(e.customTimings,ht)),{rawRumEvent:N,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function Qoe({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:ht(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:ht(n)},fid:r&&{duration:ht(r.delay),timestamp:ht(r.time),target_selector:r.targetSelector},inp:t&&{duration:ht(t.value),timestamp:ht(t.time),target_selector:t.targetSelector},lcp:i&&{timestamp:ht(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl}}}const Joe="rum";function eae(e,t,n){const r=Mte(e,Joe,i=>nae(e,i),n);return r.expireObservable.subscribe(()=>{t.notify(9)}),r.renewObservable.subscribe(()=>{t.notify(10)}),r.sessionStateUpdateObservable.subscribe(({previousState:i,newState:o})=>{if(!i.forcedReplay&&o.forcedReplay){const a=r.findSession();a&&(a.isReplayForced=!0)}}),{findTrackedSession:i=>{const o=r.findSession(i);if(!(!o||o.trackingType==="0"))return{id:o.id,sessionReplay:o.trackingType==="1"?1:o.isReplayForced?2:0,anonymousId:o.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function tae(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:kz("records")?1:0};return{findTrackedSession:()=>e,expire:Ft,expireObservable:new Nt,setForcedReplay:Ft}}function nae(e,t){return rae(t)?t:Ll(e.sessionSampleRate)?Ll(e.sessionReplaySampleRate)?"1":"2":"0"}function rae(e){return e==="0"||e==="1"||e==="2"}function iae(e,t,n,r,i,o){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const c=jz({encoder:o(2),request:Ez(a,e.batchBytesLimit,n),flushController:Rz({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:r,sessionExpireObservable:i}),messageBytesLimit:e.messageBytesLimit});return t.subscribe(13,d=>{d.type===gt.VIEW?c.upsert(d,d.view.id):c.add(d)}),c}function oae(e){const t=kp();e.subscribe(13,n=>{t.send("rum",n)})}const aae=yc;function sae(e,t,n,r){const i=Bd({expireDelay:aae});let o;e.subscribe(1,({startClocks:d})=>{const f=r.href;i.add(c({url:f,referrer:o||document.referrer}),d.relative),o=f}),e.subscribe(6,({endClocks:d})=>{i.closeActive(d.relative)});const a=n.subscribe(({newLocation:d})=>{const f=i.find();if(f){const p=Oi();i.closeActive(p),i.add(c({url:d.href,referrer:f.referrer}),p)}});function c({url:d,referrer:f}){return{url:d,referrer:f}}return t.register(0,({startTime:d,eventType:f})=>{const p=i.find(d);return p?{type:f,view:{url:p.url,referrer:p.referrer}}:Zs}),{findUrl:d=>i.find(d),stop:()=>{a.unsubscribe(),i.stop()}}}function lae(e,t){let n=qm(t);return new Nt(r=>{const{stop:i}=cae(e,a),{stop:o}=uae(e,a);function a(){if(n.href===t.href)return;const c=qm(t);r.notify({newLocation:c,oldLocation:n}),n=c}return()=>{i(),o()}})}function cae(e,t){const{stop:n}=na(JO("pushState"),"pushState",({onPostCall:o})=>{o(t)}),{stop:r}=na(JO("replaceState"),"replaceState",({onPostCall:o})=>{o(t)}),{stop:i}=xn(e,window,"popstate",t);return{stop:()=>{n(),r(),i()}}}function uae(e,t){return xn(e,window,"hashchange",t)}function JO(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const dae=yc;function fae(e,t,n){const r=Bd({expireDelay:dae});return e.subscribe(1,({startClocks:i})=>{r.add({},i.relative)}),e.subscribe(6,({endClocks:i})=>{r.closeActive(i.relative)}),t.register(0,({startTime:i,eventType:o})=>{if(!n.trackFeatureFlagsForEvents.concat([gt.VIEW,gt.ERROR]).includes(o))return Di;const c=r.find(i);return!c||il(c)?Di:{type:o,feature_flags:c}}),{addFeatureFlagEvaluation:(i,o)=>{const a=r.find();a&&(a[i]=o)}}}const mae=10*Rr;let Yu,Mg;function pae(e,t,n){e.metricsEnabled&&(_4(),Mg=!1,t.subscribe(13,()=>{Mg=!0}),n.subscribe(({bytesCount:r,messagesCount:i})=>{Mg&&(Mg=!1,Yu.batchCount+=1,tD(Yu.batchBytesCount,r),tD(Yu.batchMessagesCount,i))}),Ud(hae,mae))}function hae(){Yu.batchCount!==0&&(ob("Customer data measures",Yu),_4())}function eD(){return{min:1/0,max:0,sum:0}}function tD(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function _4(){Yu={batchCount:0,batchBytesCount:eD(),batchMessagesCount:eD()}}const gae=4e3,vae=500,yae=yc;function bae(e,t,n=vae){const r=Bd({expireDelay:yae,maxEntries:gae});let i;wc(Dt.VISIBILITY_STATE)&&performance.getEntriesByType(Dt.VISIBILITY_STATE).forEach(f=>{const p=f.name==="hidden"?"hidden":"active";a(p,f.startTime)}),a(C4(),Oi());const{stop:o}=Ks(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],d=>{a(wae(d),d.timeStamp)},{capture:!0});function a(d,f=Oi()){d!==i&&(i=d,r.closeActive(f),r.add({state:i,startTime:f},f))}function c(d,f,p){return r.findAll(f,p).some(h=>h.state===d)}return e.register(0,({startTime:d,duration:f=0,eventType:p})=>{if(p===gt.VIEW){const h=r.findAll(d,f);return{type:p,_dd:{page_states:xae(h,d,n)}}}return p===gt.ACTION||p===gt.ERROR?{type:p,view:{in_foreground:c("active",d,0)}}:Di}),{wasInPageStateDuringPeriod:c,addPageState:a,stop:()=>{o(),r.stop()}}}function xae(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:i})=>({state:r,start:ht(Mn(t,i))}))}function wae(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":C4()}function C4(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function Sae(e,t){let n;const r=requestAnimationFrame(yt(()=>{n=ZC()})),i=Ooe(t).subscribe(o=>{n=o}).unsubscribe;return e.register(0,({eventType:o})=>({type:o,display:n?{viewport:n}:void 0})),{stop:()=>{i(),r&&cancelAnimationFrame(r)}}}function _ae(e,t){const n=window.cookieStore?Cae(e):kae;return new Nt(r=>n(t,i=>r.notify(i)))}function Cae(e){return(t,n)=>xn(e,window.cookieStore,"change",i=>{const o=i.changed.find(a=>a.name===t)||i.deleted.find(a=>a.name===t);o&&n(o.value)}).stop}const Eae=Rr;function kae(e,t){const n=Gm(document.cookie,e),r=Ud(()=>{const i=Gm(document.cookie,e);i!==n&&t(i)},Eae);return()=>{Qy(r)}}const nD="datadog-ci-visibility-test-execution-id";function jae(e,t,n=_ae(e,nD)){var r;let i=$s(nD)||((r=window.Cypress)===null||r===void 0?void 0:r.env("traceId"));const o=n.subscribe(a=>{i=a});return t.register(0,({eventType:a})=>typeof i!="string"?Di:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:i}}),{stop:()=>{o.unsubscribe()}}}function Rae(e,t){const n=aa(t,{type:Dt.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const i of r){const o=Xy(i.startTime),a={date:o.timeStamp,long_task:{id:jr(),entry_type:Uz.LONG_ANIMATION_FRAME,duration:ht(i.duration),blocking_duration:ht(i.blockingDuration),first_ui_event_timestamp:ht(i.firstUIEventTimestamp),render_start:ht(i.renderStart),style_and_layout_start:ht(i.styleAndLayoutStart),start_time:ht(i.startTime),scripts:i.scripts.map(c=>({duration:ht(c.duration),pause_duration:ht(c.pauseDuration),forced_style_and_layout_duration:ht(c.forcedStyleAndLayoutDuration),start_time:ht(c.startTime),execution_start:ht(c.executionStart),source_url:c.sourceURL,source_function_name:c.sourceFunctionName,source_char_position:c.sourceCharPosition,invoker:c.invoker,invoker_type:c.invokerType,window_attribution:c.windowAttribution}))},type:gt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop:()=>n.unsubscribe()}}function Iae(e,t){const n=aa(t,{type:Dt.LONG_TASK,buffered:!0}).subscribe(r=>{for(const i of r){if(i.entryType!==Dt.LONG_TASK||!t.trackLongTasks)break;const o=Xy(i.startTime),a={date:o.timeStamp,long_task:{id:jr(),entry_type:Uz.LONG_TASK,duration:ht(i.duration)},type:gt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop(){n.unsubscribe()}}}function Tae(e){e.register(0,({eventType:t})=>{if(!Oz())return Di;const n=Nz(),r=Az();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:Tz()}}})}function Nae(e,t,n){const r=LC(e),i=n(r);return $C(t).forEach(([o,a])=>Y_(e,r,o.split(/\.|(?=\[\])/),a)),i}function Y_(e,t,n,r){const[i,...o]=n;if(i==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,c)=>Y_(a,t[c],o,r));return}if(!(!rD(e)||!rD(t))){if(o.length>0)return Y_(e[i],t[i],o,r);Aae(e,i,t[i],r)}}function Aae(e,t,n,r){const i=bc(n);i===r?e[t]=ln(n):r==="object"&&(i==="undefined"||i==="null")&&(e[t]={})}function rD(e){return bc(e)==="object"}const ku={"view.name":"string","view.url":"string","view.referrer":"string"},ju={context:"object"},Ru={service:"string",version:"string"};let E4;function Oae(e,t,n,r){E4={[gt.VIEW]:{"view.performance.lcp.resource_url":"string",...ju,...ku,...Ru},[gt.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...ju,...ku,...Ru},[gt.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...ju,...ku,...Ru},[gt.ACTION]:{"action.target.name":"string",...ju,...ku,...Ru},[gt.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...ju,...ku,...Ru},[gt.VITAL]:{...ju,...ku,...Ru}};const i={[gt.ERROR]:oS(gt.ERROR,e.eventRateLimiterThreshold,r),[gt.ACTION]:oS(gt.ACTION,e.eventRateLimiterThreshold,r),[gt.VITAL]:oS(gt.VITAL,e.eventRateLimiterThreshold,r)};t.subscribe(12,({startTime:o,duration:a,rawRumEvent:c,domainContext:d})=>{const f=n.triggerHook(0,{eventType:c.type,startTime:o,duration:a});if(f===Zs)return;const p=qa(f,c,{ddtags:hz(e).join(",")});Dae(p,e.beforeSend,d,i)&&(il(p.context)&&delete p.context,t.notify(13,p))})}function Dae(e,t,n,r){var i;if(t){const a=Nae(e,E4[e.type],c=>t(c,n));if(a===!1&&e.type!==gt.VIEW)return!1;a===!1&&dt.warn("Can't dismiss view events using beforeSend!")}return!((i=r[e.type])===null||i===void 0?void 0:i.isLimitReached())}function $ae(e,t,n,r){e.register(0,({eventType:i,startTime:o})=>{const a=t.findTrackedSession(o),c=r.findView(o);if(!a||!c)return Zs;let d,f,p;return i===gt.VIEW?(d=n.getReplayStats(c.id)?!0:void 0,f=a.sessionReplay===1,p=c.sessionIsActive?void 0:!1):d=n.isRecording()?!0:void 0,{type:i,session:{id:a.id,type:"user",has_replay:d,sampled_for_replay:f,is_active:p}}}),e.register(1,({startTime:i})=>{const o=t.findTrackedSession(i);return o?{session:{id:o.id}}:Di})}function Mae(e){e.register(0,({eventType:t})=>({type:t,connectivity:vz()}))}function Pae(e,t,n){e.register(0,({eventType:r})=>{const i=t.source;return{type:r,_dd:{format_version:2,drift:aJ(),configuration:{session_sample_rate:Am(t.sessionSampleRate,3),session_replay_sample_rate:Am(t.sessionReplaySampleRate,3),profiling_sample_rate:Am(t.profilingSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:gd()?"6.24.0":void 0,sdk_name:n},application:{id:t.applicationId},date:vr(),source:i}}),e.register(1,()=>({application:{id:t.applicationId}}))}function zae(e,t){e.register(1,()=>t.isGranted()?Di:Zs)}const Lae=vte,Uae=[gt.ACTION,gt.ERROR,gt.LONG_TASK,gt.RESOURCE,gt.VITAL];function Fae(e){return{addEvent:(t,n,r,i)=>{Uae.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:r,duration:i})}}}function Vae(e,t){if(!t.metricsEnabled)return{stop:Ft};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:r})=>{!r.largestContentfulPaint||!r.navigationTimings||(ob("Initial view metrics",{metrics:Bae(r.largestContentfulPaint,r.navigationTimings)}),n())});return{stop:n}}function Bae(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function Hae(e,t,n,r,i,o,a,c,d){const f=[],p=new pre,h=Lae();p.subscribe(13,ie=>gz("rum",ie));const v=ie=>{p.notify(14,{error:ie}),jp("Error reported to customer",{"error.message":ie.message})},y=hte(e),b=y.subscribe(ie=>{p.notify(11,ie)});f.push(()=>b.unsubscribe());const S=wte("browser-rum-sdk",e,h,v,y,i);f.push(S.stop);const C=gd()?tae():eae(e,p,o);if(gd())oae(p);else{const ie=iae(e,p,v,y,C.expireObservable,i);f.push(()=>ie.stop()),pae(S,p,ie.flushController.flushObservable)}const E=ure(),k=lae(e,location),{observable:j,stop:I}=fre();f.push(I),Pae(h,e,d);const A=bae(h,e),T=gre(p);f.push(()=>T.stop());const N=sae(p,h,k,location);f.push(()=>N.stop());const z=fae(p,h,e);$ae(h,C,t,T),Mae(h),zae(h,o);const L=vne(h,e,"rum"),K=yne(h,e,C,"rum"),J=gne(h,e,"rum"),{actionContexts:H,addAction:Y,addEvent:B,stop:W}=qae(p,h,e,A,E,j,v);f.push(W);const{addTiming:M,startView:Z,setViewName:U,setViewContext:te,setViewContextProperty:D,getViewContext:P,stop:F}=Woe(p,h,e,location,E,j,k,t,T,r);f.push(F);const{stop:O}=Vae(p,S);f.push(O);const{stop:ee}=Wie(p,e,A);if(f.push(ee),e.trackLongTasks)if(wc(Dt.LONG_ANIMATION_FRAME)){const{stop:ie}=Rae(p,e);f.push(ie)}else Iae(p,e);const{addError:ue}=Mie(p,e,c);c.unbuffer(),Ore(p,e,C,K,J);const pe=_ne(p,A,a),V=mre(e.applicationId,C,T,H,N);return f.push(()=>n.stop()),{addAction:Y,addEvent:B,addError:ue,addTiming:M,addFeatureFlagEvaluation:z.addFeatureFlagEvaluation,startView:Z,setViewContext:te,setViewContextProperty:D,getViewContext:P,setViewName:U,lifeCycle:p,viewHistory:T,session:C,stopSession:()=>C.expire(),getInternalContext:V.get,startDurationVital:pe.startDurationVital,stopDurationVital:pe.stopDurationVital,addDurationVital:pe.addDurationVital,addOperationStepVital:pe.addOperationStepVital,globalContext:L,userContext:K,accountContext:J,telemetry:S,stop:()=>{f.forEach(ie=>ie())},hooks:h}}function qae(e,t,n,r,i,o,a){const c=Oie(e,t,i,o,n),d=Fae(e),f=Sae(t,n),p=jae(n,t);return Tae(t),Oae(n,e,t,a),{pageStateHistory:r,addAction:c.addAction,addEvent:d.addEvent,actionContexts:c.actionContexts,stop:()=>{c.stop(),p.stop(),f.stop(),r.stop()}}}function Gae(e,{session:t,viewContext:n,errorType:r}){const i=t?t.id:"no-session-id",o=[];r!==void 0&&o.push(`error-type=${r}`),n&&(o.push(`seed=${n.id}`),o.push(`from=${n.startClocks.timeStamp}`));const a=Kae(e),c=`/rum/replay/sessions/${i}`;return`${a}${c}?${o.join("&")}`}function Kae(e){const t=e.site,n=e.subdomain||Zae(e);return`https://${n?`${n}.`:""}${t}`}function Zae(e){switch(e.site){case Ul:case eee:return"app";case az:return"dd";default:return}}const Yae=1e3;let Ji;function zNe(e){return ub(e).segments_count}function LNe(e){ub(e).segments_count+=1}function UNe(e){ub(e).records_count+=1}function FNe(e,t){ub(e).segments_total_raw_size+=t}function Wae(e){return Ji?.get(e)}function ub(e){Ji||(Ji=new Map);let t;return Ji.has(e)?t=Ji.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},Ji.set(e,t),Ji.size>Yae&&Xae()),t}function Xae(){if(!Ji)return;const e=Ji.keys().next().value;e&&Ji.delete(e)}function k4(e,t,n){let r=0,i=[],o,a=!0,c=0;const d=[],{stop:f}=xn(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const y=d[0];y&&(y.id===v.id?(d.shift(),r+=v.additionalBytesCount,i.push(v.result),o=v.trailer,y.writeCallback?y.writeCallback(v.result.byteLength):y.finishCallback&&y.finishCallback()):y.id<v.id&&f())});function p(){const v=i.length===0?new Uint8Array(0):LP(i.concat(o)),y={rawBytesCount:r,output:v,outputBytesCount:v.byteLength,encoding:"deflate"};return r=0,i=[],y}function h(){a||(t.postMessage({action:"reset",streamId:n}),a=!0)}return{isAsync:!0,get isEmpty(){return a},write(v,y){t.postMessage({action:"write",id:c,data:v,streamId:n}),d.push({id:c,writeCallback:y,data:v}),a=!1,c+=1},finish(v){h(),d.length?(d.forEach(y=>{delete y.writeCallback}),d[d.length-1].finishCallback=()=>v(p())):v(p())},finishSync(){h();const v=d.map(y=>y.data).join("");return d.length=0,{...p(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){f()}}}function YC({configuredUrl:e,error:t,source:n,scriptType:r}){if(dt.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&Qae(t.message)){let i;e?i=`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:i="Please make sure CSP is correctly configured.",dt.error(`${i} See documentation at ${Wy}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&UC(t)}function Qae(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const Jae=30*Rr;function j4(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.24.0"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}let $n={status:0};function R4(e,t,n,r=j4){switch($n.status===0&&ese(e,t,r),$n.status){case 1:return $n.initializationFailureCallbacks.push(n),$n.worker;case 3:return $n.worker}}function iD(){return $n.status}function ese(e,t,n=j4){try{const r=n(e),{stop:i}=xn(e,r,"error",c=>{vS(e,t,c)}),{stop:o}=xn(e,r,"message",({data:c})=>{c.type==="errored"?vS(e,t,c.error,c.streamId):c.type==="initialized"&&nse(c.version)});r.postMessage({action:"init"}),Er(()=>tse(t),Jae),$n={status:1,worker:r,stop:()=>{i(),o()},initializationFailureCallbacks:[]}}catch(r){vS(e,t,r)}}function tse(e){$n.status===1&&(dt.error(`${e} failed to start: a timeout occurred while initializing the Worker`),$n.initializationFailureCallbacks.forEach(t=>t()),$n={status:2})}function nse(e){$n.status===1&&($n={status:3,worker:$n.worker,stop:$n.stop,version:e})}function vS(e,t,n,r){$n.status===1||$n.status===0?(YC({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),$n.status===1&&$n.initializationFailureCallbacks.forEach(i=>i()),$n={status:2}):UC(n,{worker_version:$n.status===3&&$n.version,stream_id:r})}function I4(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function rse(e,t,n,r){const i=t.findTrackedSession(),o=ise(i,r),a=n.findView();return Gae(e,{viewContext:a,errorType:o,session:i})}function ise(e,t){if(!I4())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function ose(e,t){if(!e.metricsEnabled)return{stop:Ft};let n,r,i;const{unsubscribe:o}=t.subscribe(a=>{switch(a.type){case"start":n={forced:a.forced,timestamp:vr()},r=void 0,i=void 0;break;case"document-ready":n&&(r=Mn(n.timestamp,vr()));break;case"recorder-settled":n&&(i=Mn(n.timestamp,vr()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":o(),n&&ob("Recorder init metrics",{metrics:ase(n.forced,i,Mn(n.timestamp,vr()),a.type,r)});break}});return{stop:o}}function ase(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}function sse(e,t,n,r,i,o,a){let c=0,d;t.subscribe(9,()=>{(c===2||c===3)&&(v(),c=1)}),t.subscribe(10,()=>{c===1&&h()});const f=new Nt;ose(a,f);const p=async y=>{f.notify({type:"start",forced:y});const[b]=await Promise.all([oD(f,{type:"recorder-settled"},i()),oD(f,{type:"document-ready"},Hte(e,"interactive"))]);if(c!==2){f.notify({type:"aborted"});return}if(!b){c=0,f.notify({type:"recorder-load-failed"});return}const S=o();if(!S){c=0,f.notify({type:"deflate-encoder-load-failed"});return}({stop:d}=b(t,e,n,r,S,a)),c=3,f.notify({type:"succeeded"})};function h(y){const b=n.findTrackedSession();if(lse(b,y)){c=1;return}if(cse(c))return;c=2;const S=use(b,y)||!1;p(S).catch(qs),S&&n.setForcedReplay()}function v(){c===3&&d?.(),c=0}return{start:h,stop:v,getSessionReplayLink(){return rse(e,n,r,c!==0)},isRecording:()=>c===3}}function lse(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function cse(e){return e===2||e===3}function use(e,t){return t&&t.force&&e.sessionReplay===0}async function oD(e,t,n){try{return await n}finally{e.notify(t)}}function dse(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:Ft},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function fse(e,t){if(gd()&&!kz("records")||!I4())return{start:Ft,stop:Ft,getReplayStats:()=>{},onRumStart:Ft,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=dse();return{start:o=>n.start(o),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:i,isRecording:()=>iD()===3&&n.isRecording(),getReplayStats:o=>iD()===3?Wae(o):void 0};function i(o,a,c,d,f,p){let h;function v(){return h||(f??(f=R4(a,"Datadog Session Replay",()=>{n.stop()},t)),f&&(h=k4(a,f,1))),h}n=sse(a,o,c,d,e,v,p),r(a)&&n.start()}}const mse="modulepreload",pse=function(e){return"/"+e},aD={},Ip=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let d=function(f){return Promise.all(f.map(p=>Promise.resolve(p).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");i=d(n.map(f=>{if(f=pse(f),f in aD)return;aD[f]=!0;const p=f.endsWith(".css"),h=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":mse,p||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),document.head.appendChild(v),p)return new Promise((y,b)=>{v.addEventListener("load",y),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};async function hse(e=gse){try{return await e()}catch(t){YC({error:t,source:"Recorder",scriptType:"module"})}}async function gse(){return(await Ip(()=>import("./startRecording-CapM7c3R.js"),[])).startRecording}function vse(){return fo().Profiler!==void 0}const yse=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==gt.VIEW&&n!==gt.LONG_TASK?Di:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function bse(e=xse){try{return await e()}catch(t){YC({error:t,source:"Profiler",scriptType:"module"})}}async function xse(){return(await Ip(()=>import("./profiler-xCOLgFE8.js"),[])).createRumProfiler}function wse(){let e;function t(n,r,i,o,a,c){const d=o.findTrackedSession();if(!d||!Hz(d.id,i.profilingSampleRate))return;const f=yse(r);if(!vse()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}bse().then(p=>{if(!p){jp("[DD_RUM] Failed to lazy load the RUM Profiler"),f.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=p(i,n,o,f,c),e.start(a.findView())}).catch(qs)}return{onRumStart:t,stop:()=>{e?.stop().catch(qs)}}}const Sse=fse(hse),_se=wse(),Cse=lre(Hae,Sse,_se,{startDeflateWorker:R4,createDeflateEncoder:k4,sdkName:"rum"});qee(fo(),"DD_RUM",Cse);function Sv(e,t){Zm("react error"),er()}const sD={didCatch:!1,error:null};class VNe extends X.Component{constructor(t){super(t),this.resetError=()=>{this.setState(sD)},this.state=sD}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){Sv()}render(){return this.state.didCatch?X.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let lD=!1;function Ese(){x.useEffect(()=>{lD||(lD=!0)},[])}function kse(){return u.jsx(u.Fragment,{children:u.jsx(tl,{})})}const db=bY()({component:kse});function jse(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 126.644 96",width:24,height:24,children:u.jsx("path",{fill:"currentColor",d:"M81.15,0c-1.2376,2.1973-2.3489,4.4704-3.3591,6.794-9.5975-1.4396-19.3718-1.4396-28.9945,0-.985-2.3236-2.1216-4.5967-3.3591-6.794-9.0166,1.5407-17.8059,4.2431-26.1405,8.0568C2.779,32.5304-1.6914,56.3725.5312,79.8863c9.6732,7.1476,20.5083,12.603,32.0505,16.0884,2.6014-3.4854,4.8998-7.1981,6.8698-11.0623-3.738-1.3891-7.3497-3.1318-10.8098-5.1523.9092-.6567,1.7932-1.3386,2.6519-1.9953,20.281,9.547,43.7696,9.547,64.0758,0,.8587.7072,1.7427,1.3891,2.6519,1.9953-3.4601,2.0457-7.0718,3.7632-10.835,5.1776,1.97,3.8642,4.2683,7.5769,6.8698,11.0623,11.5419-3.4854,22.3769-8.9156,32.0509-16.0631,2.626-27.2771-4.496-50.9172-18.817-71.8548C98.9811,4.2684,90.1918,1.5659,81.1752.0505l-.0252-.0505ZM42.2802,65.4144c-6.2383,0-11.4159-5.6575-11.4159-12.6535s4.9755-12.6788,11.3907-12.6788,11.5169,5.708,11.4159,12.6788c-.101,6.9708-5.026,12.6535-11.3907,12.6535ZM84.3576,65.4144c-6.2637,0-11.3907-5.6575-11.3907-12.6535s4.9755-12.6788,11.3907-12.6788,11.4917,5.708,11.3906,12.6788c-.101,6.9708-5.026,12.6535-11.3906,12.6535Z"})})}function WC(){return u.jsxs(u.Fragment,{children:[u.jsx("img",{src:"/harper-studio_white.png",alt:"Harper Studio",className:"w-64 hidden md:inline-block"}),u.jsx("img",{src:"/HDBDogOnly.svg",width:"50px",height:"44px",alt:"Harper",className:"inline-block md:hidden"})]})}function Rse(e,t){const n=x.createContext(t),r=o=>{const{children:a,...c}=o,d=x.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:d,children:a})};r.displayName=e+"Provider";function i(o){const a=x.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Mi(e,t=[]){let n=[];function r(o,a){const c=x.createContext(a),d=n.length;n=[...n,a];const f=h=>{const{scope:v,children:y,...b}=h,S=v?.[e]?.[d]||c,C=x.useMemo(()=>b,Object.values(b));return u.jsx(S.Provider,{value:C,children:y})};f.displayName=o+"Provider";function p(h,v){const y=v?.[e]?.[d]||c,b=x.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,p]}const i=()=>{const o=n.map(a=>x.createContext(a));return function(c){const d=c?.[e]||o;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,Ise(i,...t)]}function Ise(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((c,{useScope:d,scopeName:f})=>{const h=d(o)[`__scope${f}`];return{...c,...h}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function je(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function vd(e){const t=Tse(e),n=x.forwardRef((r,i)=>{const{children:o,...a}=r,c=x.Children.toArray(o),d=c.find(Ase);if(d){const f=d.props.children,p=c.map(h=>h===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return u.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Tse(e){const t=x.forwardRef((n,r)=>{const{children:i,...o}=n;if(x.isValidElement(i)){const a=Dse(i),c=Ose(o,i.props);return i.type!==x.Fragment&&(c.ref=r?zd(r,a):a),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var T4=Symbol("radix.slottable");function Nse(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=T4,t}function Ase(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===T4}function Ose(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...c)=>{const d=o(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Dse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $se=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ge=$se.reduce((e,t)=>{const n=vd(`Primitive.${t}`),r=x.forwardRef((i,o)=>{const{asChild:a,...c}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Kv(e,t){e&&$d.flushSync(()=>e.dispatchEvent(t))}var qn=globalThis?.document?x.useLayoutEffect:()=>{},Mse=hC[" useInsertionEffect ".trim().toString()]||qn;function Ao({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=Pse({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const h=p.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=x.useCallback(p=>{if(c){const h=zse(p)?p(e):p;h!==e&&a.current?.(h)}else o(p)},[c,e,o,a]);return[d,f]}function Pse({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),o=x.useRef(t);return Mse(()=>{o.current=t},[t]),x.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function zse(e){return typeof e=="function"}var Lse=x.createContext(void 0);function Sc(e){const t=x.useContext(Lse);return e||t||"ltr"}function Use(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Gn=e=>{const{present:t,children:n}=e,r=Fse(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),o=lt(r.ref,Vse(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:o}):null};Gn.displayName="Presence";function Fse(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),o=x.useRef("none"),a=e?"mounted":"unmounted",[c,d]=Use(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Pg(r.current);o.current=c==="mounted"?f:"none"},[c]),qn(()=>{const f=r.current,p=i.current;if(p!==e){const v=o.current,y=Pg(f);e?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),qn(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,h=y=>{const S=Pg(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(d("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=y=>{y.target===t&&(o.current=Pg(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Pg(e){return e?.animationName||"none"}function Vse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bse=hC[" useId ".trim().toString()]||(()=>{}),Hse=0;function Ti(e){const[t,n]=x.useState(Bse());return qn(()=>{n(r=>r??String(Hse++))},[e]),t?`radix-${t}`:""}function Tp(e){const t=e+"CollectionProvider",[n,r]=Mi(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=S=>{const{scope:C,children:E}=S,k=X.useRef(null),j=X.useRef(new Map).current;return u.jsx(i,{scope:C,itemMap:j,collectionRef:k,children:E})};a.displayName=t;const c=e+"CollectionSlot",d=vd(c),f=X.forwardRef((S,C)=>{const{scope:E,children:k}=S,j=o(c,E),I=lt(C,j.collectionRef);return u.jsx(d,{ref:I,children:k})});f.displayName=c;const p=e+"CollectionItemSlot",h="data-radix-collection-item",v=vd(p),y=X.forwardRef((S,C)=>{const{scope:E,children:k,...j}=S,I=X.useRef(null),A=lt(C,I),T=o(p,E);return X.useEffect(()=>(T.itemMap.set(I,{ref:I,...j}),()=>void T.itemMap.delete(I))),u.jsx(v,{[h]:"",ref:A,children:k})});y.displayName=p;function b(S){const C=o(e+"CollectionConsumer",S);return X.useCallback(()=>{const k=C.collectionRef.current;if(!k)return[];const j=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(C.itemMap.values()).sort((T,N)=>j.indexOf(T.ref.current)-j.indexOf(N.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},b,r]}function mn(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function qse(e,t=globalThis?.document){const n=mn(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Gse="DismissableLayer",W_="dismissableLayer.update",Kse="dismissableLayer.pointerDownOutside",Zse="dismissableLayer.focusOutside",cD,N4=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hd=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...d}=e,f=x.useContext(N4),[p,h]=x.useState(null),v=p?.ownerDocument??globalThis?.document,[,y]=x.useState({}),b=lt(t,N=>h(N)),S=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(C),k=p?S.indexOf(p):-1,j=f.layersWithOutsidePointerEventsDisabled.size>0,I=k>=E,A=Xse(N=>{const z=N.target,L=[...f.branches].some(K=>K.contains(z));!I||L||(i?.(N),a?.(N),N.defaultPrevented||c?.())},v),T=Qse(N=>{const z=N.target;[...f.branches].some(K=>K.contains(z))||(o?.(N),a?.(N),N.defaultPrevented||c?.())},v);return qse(N=>{k===f.layers.size-1&&(r?.(N),!N.defaultPrevented&&c&&(N.preventDefault(),c()))},v),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(cD=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),uD(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=cD)}},[p,v,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),uD())},[p,f]),x.useEffect(()=>{const N=()=>y({});return document.addEventListener(W_,N),()=>document.removeEventListener(W_,N)},[]),u.jsx(Ge.div,{...d,ref:b,style:{pointerEvents:j?I?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,T.onFocusCapture),onBlurCapture:je(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,A.onPointerDownCapture)})});Hd.displayName=Gse;var Yse="DismissableLayerBranch",Wse=x.forwardRef((e,t)=>{const n=x.useContext(N4),r=x.useRef(null),i=lt(t,r);return x.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Ge.div,{...e,ref:i})});Wse.displayName=Yse;function Xse(e,t=globalThis?.document){const n=mn(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let d=function(){A4(Kse,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Qse(e,t=globalThis?.document){const n=mn(e),r=x.useRef(!1);return x.useEffect(()=>{const i=o=>{o.target&&!r.current&&A4(Zse,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function uD(){const e=new CustomEvent(W_);document.dispatchEvent(e)}function A4(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Kv(i,o):i.dispatchEvent(o)}function XC(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var O4=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Jse="VisuallyHidden",D4=x.forwardRef((e,t)=>u.jsx(Ge.span,{...e,ref:t,style:{...O4,...e.style}}));D4.displayName=Jse;var $4=D4,_c="NavigationMenu",[QC,M4,ele]=Tp(_c),[X_,tle,nle]=Tp(_c),[JC]=Mi(_c,[ele,nle]),[rle,mo]=JC(_c),[ile,ole]=JC(_c),P4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,delayDuration:a=200,skipDelayDuration:c=300,orientation:d="horizontal",dir:f,...p}=e,[h,v]=x.useState(null),y=lt(t,L=>v(L)),b=Sc(f),S=x.useRef(0),C=x.useRef(0),E=x.useRef(0),[k,j]=x.useState(!0),[I,A]=Ao({prop:r,onChange:L=>{const K=L!=="",J=c>0;K?(window.clearTimeout(E.current),J&&j(!1)):(window.clearTimeout(E.current),E.current=window.setTimeout(()=>j(!0),c)),i?.(L)},defaultProp:o??"",caller:_c}),T=x.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>A(""),150)},[A]),N=x.useCallback(L=>{window.clearTimeout(C.current),A(L)},[A]),z=x.useCallback(L=>{I===L?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),A(L)},a)},[I,A,a]);return x.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(E.current)},[]),u.jsx(z4,{scope:n,isRootMenu:!0,value:I,dir:b,orientation:d,rootNavigationMenu:h,onTriggerEnter:L=>{window.clearTimeout(S.current),k?z(L):N(L)},onTriggerLeave:()=>{window.clearTimeout(S.current),T()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:T,onItemSelect:L=>{A(K=>K===L?"":L)},onItemDismiss:()=>A(""),children:u.jsx(Ge.nav,{"aria-label":"Main","data-orientation":d,dir:b,...p,ref:y})})});P4.displayName=_c;var Q_="NavigationMenuSub",ale=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",...c}=e,d=mo(Q_,n),[f,p]=Ao({prop:r,onChange:i,defaultProp:o??"",caller:Q_});return u.jsx(z4,{scope:n,isRootMenu:!1,value:f,dir:d.dir,orientation:a,rootNavigationMenu:d.rootNavigationMenu,onTriggerEnter:h=>p(h),onItemSelect:h=>p(h),onItemDismiss:()=>p(""),children:u.jsx(Ge.div,{"data-orientation":a,...c,ref:t})})});ale.displayName=Q_;var z4=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:o,children:a,value:c,onItemSelect:d,onItemDismiss:f,onTriggerEnter:p,onTriggerLeave:h,onContentEnter:v,onContentLeave:y}=e,[b,S]=x.useState(null),[C,E]=x.useState(new Map),[k,j]=x.useState(null);return u.jsx(rle,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:c,previousValue:XC(c),baseId:Ti(),dir:i,orientation:o,viewport:b,onViewportChange:S,indicatorTrack:k,onIndicatorTrackChange:j,onTriggerEnter:mn(p),onTriggerLeave:mn(h),onContentEnter:mn(v),onContentLeave:mn(y),onItemSelect:mn(d),onItemDismiss:mn(f),onViewportContentChange:x.useCallback((I,A)=>{E(T=>(T.set(I,A),new Map(T)))},[]),onViewportContentRemove:x.useCallback(I=>{E(A=>A.has(I)?(A.delete(I),new Map(A)):A)},[]),children:u.jsx(QC.Provider,{scope:t,children:u.jsx(ile,{scope:t,items:C,children:a})})})},L4="NavigationMenuList",U4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=mo(L4,n),o=u.jsx(Ge.ul,{"data-orientation":i.orientation,...r,ref:t});return u.jsx(Ge.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:u.jsx(QC.Slot,{scope:n,children:i.isRootMenu?u.jsx(K4,{asChild:!0,children:o}):o})})});U4.displayName=L4;var F4="NavigationMenuItem",[sle,V4]=JC(F4),B4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,o=Ti(),a=r||o||"LEGACY_REACT_AUTO_VALUE",c=x.useRef(null),d=x.useRef(null),f=x.useRef(null),p=x.useRef(()=>{}),h=x.useRef(!1),v=x.useCallback((b="start")=>{if(c.current){p.current();const S=e1(c.current);S.length&&nE(b==="start"?S:S.reverse())}},[]),y=x.useCallback(()=>{if(c.current){const b=e1(c.current);b.length&&(p.current=vle(b))}},[]);return u.jsx(sle,{scope:n,value:a,triggerRef:d,contentRef:c,focusProxyRef:f,wasEscapeCloseRef:h,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:y,onContentFocusOutside:y,children:u.jsx(Ge.li,{...i,ref:t})})});B4.displayName=F4;var J_="NavigationMenuTrigger",lle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,o=mo(J_,e.__scopeNavigationMenu),a=V4(J_,e.__scopeNavigationMenu),c=x.useRef(null),d=lt(c,a.triggerRef,t),f=Y4(o.baseId,a.value),p=W4(o.baseId,a.value),h=x.useRef(!1),v=x.useRef(!1),y=a.value===o.value;return u.jsxs(u.Fragment,{children:[u.jsx(QC.ItemSlot,{scope:n,value:a.value,children:u.jsx(Z4,{asChild:!0,children:u.jsx(Ge.button,{id:f,disabled:r,"data-disabled":r?"":void 0,"data-state":rE(y),"aria-expanded":y,"aria-controls":p,...i,ref:d,onPointerEnter:je(e.onPointerEnter,()=>{v.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:je(e.onPointerMove,Zv(()=>{r||v.current||a.wasEscapeCloseRef.current||h.current||(o.onTriggerEnter(a.value),h.current=!0)})),onPointerLeave:je(e.onPointerLeave,Zv(()=>{r||(o.onTriggerLeave(),h.current=!1)})),onClick:je(e.onClick,()=>{o.onItemSelect(a.value),v.current=y}),onKeyDown:je(e.onKeyDown,b=>{const C={horizontal:"ArrowDown",vertical:o.dir==="rtl"?"ArrowLeft":"ArrowRight"}[o.orientation];y&&b.key===C&&(a.onEntryKeyDown(),b.preventDefault())})})})}),y&&u.jsxs(u.Fragment,{children:[u.jsx($4,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:b=>{const S=a.contentRef.current,C=b.relatedTarget,E=C===c.current,k=S?.contains(C);(E||!k)&&a.onFocusProxyEnter(E?"start":"end")}}),o.viewport&&u.jsx("span",{"aria-owns":p})]})]})});lle.displayName=J_;var cle="NavigationMenuLink",dD="navigationMenu.linkSelect",H4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...o}=e;return u.jsx(Z4,{asChild:!0,children:u.jsx(Ge.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...o,ref:t,onClick:je(e.onClick,a=>{const c=a.target,d=new CustomEvent(dD,{bubbles:!0,cancelable:!0});if(c.addEventListener(dD,f=>i?.(f),{once:!0}),Kv(c,d),!d.defaultPrevented&&!a.metaKey){const f=new CustomEvent(_v,{bubbles:!0,cancelable:!0});Kv(c,f)}},{checkForDefaultPrevented:!1})})})});H4.displayName=cle;var eE="NavigationMenuIndicator",ule=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mo(eE,e.__scopeNavigationMenu),o=!!i.value;return i.indicatorTrack?_C.createPortal(u.jsx(Gn,{present:n||o,children:u.jsx(dle,{...r,ref:t})}),i.indicatorTrack):null});ule.displayName=eE;var dle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=mo(eE,n),o=M4(n),[a,c]=x.useState(null),[d,f]=x.useState(null),p=i.orientation==="horizontal",h=!!i.value;x.useEffect(()=>{const b=o().find(S=>S.value===i.value)?.ref.current;b&&c(b)},[o,i.value]);const v=()=>{a&&f({size:p?a.offsetWidth:a.offsetHeight,offset:p?a.offsetLeft:a.offsetTop})};return t1(a,v),t1(i.indicatorTrack,v),d?u.jsx(Ge.div,{"aria-hidden":!0,"data-state":h?"visible":"hidden","data-orientation":i.orientation,...r,ref:t,style:{position:"absolute",...p?{left:0,width:d.size+"px",transform:`translateX(${d.offset}px)`}:{top:0,height:d.size+"px",transform:`translateY(${d.offset}px)`},...r.style}}):null}),yd="NavigationMenuContent",fle=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mo(yd,e.__scopeNavigationMenu),o=V4(yd,e.__scopeNavigationMenu),a=lt(o.contentRef,t),c=o.value===i.value,d={value:o.value,triggerRef:o.triggerRef,focusProxyRef:o.focusProxyRef,wasEscapeCloseRef:o.wasEscapeCloseRef,onContentFocusOutside:o.onContentFocusOutside,onRootContentClose:o.onRootContentClose,...r};return i.viewport?u.jsx(mle,{forceMount:n,...d,ref:a}):u.jsx(Gn,{present:n||c,children:u.jsx(q4,{"data-state":rE(c),...d,ref:a,onPointerEnter:je(e.onPointerEnter,i.onContentEnter),onPointerLeave:je(e.onPointerLeave,Zv(i.onContentLeave)),style:{pointerEvents:!c&&i.isRootMenu?"none":void 0,...d.style}})})});fle.displayName=yd;var mle=x.forwardRef((e,t)=>{const n=mo(yd,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return qn(()=>{r(e.value,{ref:t,...e})},[e,t,r]),qn(()=>()=>i(e.value),[e.value,i]),null}),_v="navigationMenu.rootContentDismiss",q4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:o,wasEscapeCloseRef:a,onRootContentClose:c,onContentFocusOutside:d,...f}=e,p=mo(yd,n),h=x.useRef(null),v=lt(h,t),y=Y4(p.baseId,r),b=W4(p.baseId,r),S=M4(n),C=x.useRef(null),{onItemDismiss:E}=p;x.useEffect(()=>{const j=h.current;if(p.isRootMenu&&j){const I=()=>{E(),c(),j.contains(document.activeElement)&&i.current?.focus()};return j.addEventListener(_v,I),()=>j.removeEventListener(_v,I)}},[p.isRootMenu,e.value,i,E,c]);const k=x.useMemo(()=>{const I=S().map(K=>K.value);p.dir==="rtl"&&I.reverse();const A=I.indexOf(p.value),T=I.indexOf(p.previousValue),N=r===p.value,z=T===I.indexOf(r);if(!N&&!z)return C.current;const L=(()=>{if(A!==T){if(N&&T!==-1)return A>T?"from-end":"from-start";if(z&&A!==-1)return A>T?"to-start":"to-end"}return null})();return C.current=L,L},[p.previousValue,p.value,p.dir,S,r]);return u.jsx(K4,{asChild:!0,children:u.jsx(Hd,{id:b,"aria-labelledby":y,"data-motion":k,"data-orientation":p.orientation,...f,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const j=new Event(_v,{bubbles:!0,cancelable:!0});h.current?.dispatchEvent(j)},onFocusOutside:je(e.onFocusOutside,j=>{d();const I=j.target;p.rootNavigationMenu?.contains(I)&&j.preventDefault()}),onPointerDownOutside:je(e.onPointerDownOutside,j=>{const I=j.target,A=S().some(N=>N.ref.current?.contains(I)),T=p.isRootMenu&&p.viewport?.contains(I);(A||T||!p.isRootMenu)&&j.preventDefault()}),onKeyDown:je(e.onKeyDown,j=>{const I=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!I){const T=e1(j.currentTarget),N=document.activeElement,z=T.findIndex(J=>J===N),K=j.shiftKey?T.slice(0,z).reverse():T.slice(z+1,T.length);nE(K)?j.preventDefault():o.current?.focus()}}),onEscapeKeyDown:je(e.onEscapeKeyDown,j=>{a.current=!0})})})}),tE="NavigationMenuViewport",G4=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=!!mo(tE,e.__scopeNavigationMenu).value;return u.jsx(Gn,{present:n||o,children:u.jsx(ple,{...r,ref:t})})});G4.displayName=tE;var ple=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,o=mo(tE,n),a=lt(t,o.onViewportChange),c=ole(yd,e.__scopeNavigationMenu),[d,f]=x.useState(null),[p,h]=x.useState(null),v=d?d?.width+"px":void 0,y=d?d?.height+"px":void 0,b=!!o.value,S=b?o.value:o.previousValue;return t1(p,()=>{p&&f({width:p.offsetWidth,height:p.offsetHeight})}),u.jsx(Ge.div,{"data-state":rE(b),"data-orientation":o.orientation,...i,ref:a,style:{pointerEvents:!b&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":y,...i.style},onPointerEnter:je(e.onPointerEnter,o.onContentEnter),onPointerLeave:je(e.onPointerLeave,Zv(o.onContentLeave)),children:Array.from(c.items).map(([E,{ref:k,forceMount:j,...I}])=>{const A=S===E;return u.jsx(Gn,{present:j||A,children:u.jsx(q4,{...I,ref:zd(k,T=>{A&&T&&h(T)})})},E)})})}),hle="FocusGroup",K4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=mo(hle,n);return u.jsx(X_.Provider,{scope:n,children:u.jsx(X_.Slot,{scope:n,children:u.jsx(Ge.div,{dir:i.dir,...r,ref:t})})})}),fD=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],gle="FocusGroupItem",Z4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=tle(n),o=mo(gle,n);return u.jsx(X_.ItemSlot,{scope:n,children:u.jsx(Ge.button,{...r,ref:t,onKeyDown:je(e.onKeyDown,a=>{if(["Home","End",...fD].includes(a.key)){let d=i().map(h=>h.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&d.reverse(),fD.includes(a.key)){const h=d.indexOf(a.currentTarget);d=d.slice(h+1)}setTimeout(()=>nE(d)),a.preventDefault()}})})})});function e1(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nE(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function vle(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function t1(e,t){const n=mn(t);qn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}function rE(e){return e?"open":"closed"}function Y4(e,t){return`${e}-trigger-${t}`}function W4(e,t){return`${e}-content-${t}`}function Zv(e){return t=>t.pointerType==="mouse"?e(t):void 0}var yle=P4,ble=U4,xle=B4,wle=H4,Sle=G4;function _le({className:e,...t}){return u.jsx("div",{className:ze("absolute top-full left-0 isolate z-50 flex justify-center"),children:u.jsx(Sle,{"data-slot":"navigation-menu-viewport",className:ze("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function X4({className:e,children:t,viewport:n=!0,...r}){return u.jsxs(yle,{"data-slot":"navigation-menu","data-viewport":n,className:ze("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,n&&u.jsx(_le,{})]})}function n1({className:e,...t}){return u.jsx(xle,{"data-slot":"navigation-menu-item",className:ze("relative",e),...t})}function r1({className:e,...t}){return u.jsx(wle,{"data-slot":"navigation-menu-link",className:ze("hover:text-white ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Q4({className:e,...t}){return u.jsx(ble,{"data-slot":"navigation-menu-list",className:ze("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}const J4=Zy("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-auto",{variants:{variant:{default:"border-primary bg-primary/40 text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-secondary bg-secondary/40 text-secondary-foreground [a&]:hover:bg-secondary/90",warning:"border-yellow bg-yellow/40 text-white [a&]:hover:bg-yellow/90",success:"border-green bg-green/40 text-white [a&]:hover:bg-green/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"text-white [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function iE(){return u.jsx("a",{href:"https://github.com/HarperFast/studio/releases",target:"_blank",rel:"noopener noreferrer",children:u.jsxs("span",{className:ze(J4({variant:"default"}),"text-xs inline-block ml-2 align-text-top"),children:["v4.7.8"," BETA"]})})}function fb(e,t,n){const{instanceId:r,clusterId:i}=et({strict:!1});return Gl({id:En,operationsUrl:e,port:t,secure:n})}function mb(e,t,n){const{instanceId:r,clusterId:i}=et({strict:!1});return{instanceClient:Gl({id:En,operationsUrl:e,port:t,secure:n}),entityType:"instance"}}function Yt(e,t,n){const r=et({strict:!1});return eL({...r,operationsUrl:e,port:t,secure:n})}function eL({instanceId:e,clusterId:t,operationsUrl:n,port:r,secure:i}){const o=En;return{instanceClient:Gl({id:o,operationsUrl:n,port:r,secure:i}),entityId:o,entityType:"instance"}}function Cle(){localStorage.clear()}function Ele(){sessionStorage.clear()}async function kle(){kn.setUserForEntity(En,null),Vv.getQueryCache().clear(),Cle(),Ele(),await Vv.invalidateQueries({refetchType:"none"})}async function jle(e){await kn.signOutFromPotentiallyAuthenticatedInstances(),await yp({...e,entityId:En})}function Rle(){const e=fb();return ft({mutationFn:()=>jle({instanceClient:e}),onSuccess:kle})}function pb(e){const{user:t}=hc(),{organizationId:n}=et({strict:!1}),r=t?.roles?.[e??n];return!r?.permission&&!r?.organization?{update:!1,remove:!1}:r.permission?.super_user?{update:!0,remove:!0}:{update:r.organization.update,remove:r.organization.delete}}function qd(e){const{user:t}=hc(),{organizationId:n}=et({strict:!1}),r=t?.roles?.[e??n];if(!r?.permission&&!r?.organization?.roles)return{create:!1,remove:!1,update:!1,view:!1};if(r.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const i=r.organization.roles;return{create:i.create,remove:i.delete,update:i.update,view:i.view}}function hb(e,t){const{user:n}=hc(),{organizationId:r,clusterId:i}=et({strict:!1}),o=t??i,a=n?.roles?.[e??r];if(!a?.permission&&!a?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(a.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const c=a.organization.clusters.resources?.find(f=>f.id===o),d=a.organization.clusters;return{create:d.create,remove:c?c.delete:d.delete,update:c?c.update:d.update,view:c?c.view:d.view}}function Ile(e){const{clusterId:t,instanceId:n}=et({strict:!1}),{user:r}=Wa(),i=r?.role?.permission;return i?i.super_user===!0:!1}function Gd(e){const{clusterId:t,instanceId:n}=et({strict:!1}),{user:r}=Wa(),i=r?.role?.permission;return i?i.super_user===!0||i.structure_user===!0:!1}function yS(e,t,n,r){const{clusterId:i,instanceId:o}=et({strict:!1}),{user:a}=Wa(),c=a?.role?.permission;return c?c.super_user===!0||c.structure_user===!0?!0:c[t]?.tables?.[n][r]===!0:!1}const oE={className:"text-white"};function tL(){const{mutate:e}=Rle(),t=pn(),{user:n}=pc(),r=tn(),{organizationId:i}=et({strict:!1}),{update:o}=pb(i),{view:a}=qd(i),c=o,d=x.useCallback(()=>{e(void 0,{onSuccess:async()=>{Ee.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),t({to:"/sign-in"}),r.invalidate()}})},[e,r,t]),f=x.useMemo(()=>[!qu,!qu,!qu,{to:"https://docs.harperdb.io/docs",target:"_blank",icon:u.jsx(yP,{}),text:"Docs",textBreakpoint:"md"},{to:"https://github.com/HarperFast/studio/issues",target:"_blank",icon:u.jsx(BW,{}),text:"Report an Issue",textBreakpoint:"lg"},{to:"https://discord.gg/VzZuaw3Xay",target:"_blank",icon:u.jsx(jse,{}),text:"Discord",textBreakpoint:"lg"},{onClick:d,icon:u.jsx(BX,{}),text:"Sign Out",textBreakpoint:"md"}].filter(ua),[i,c,a,d]);return n?u.jsxs(u.Fragment,{children:[u.jsx(Ale,{menuItems:f}),u.jsx(Nle,{menuItems:f})]}):u.jsx(Tle,{})}function nL(e){return e.items!==void 0}function Tle(){return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(We,{to:"/sign-in",children:u.jsx(WC,{})}),u.jsx(iE,{})]}),u.jsx(X4,{children:u.jsxs(Q4,{className:"text-grey-400",children:[u.jsx(n1,{children:u.jsx(r1,{asChild:!0,children:u.jsxs(We,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[u.jsx(yP,{})," ",u.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),u.jsx(n1,{children:u.jsx(r1,{asChild:!0,children:u.jsxs(We,{to:"/sign-in",className:"flex-row items-center",activeProps:oE,children:[u.jsx(LX,{})," Sign In"]})})})]})})]})}function Nle({menuItems:e}){const{user:t}=pc();return vc(t),u.jsx("div",{className:"hidden md:block",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(We,{to:el,children:u.jsx(WC,{})}),u.jsx(iE,{})]}),u.jsx(X4,{children:u.jsx(Q4,{className:"text-grey-400",children:e.map(n=>nL(n)?!!n.items.length&&u.jsx("div",{className:"bg-black rounded-2xl flex",children:n.items.map(r=>u.jsx(mD,{menuItem:r},r.text))},n.text):u.jsx(mD,{menuItem:n},n.text))})})]})})}function mD({menuItem:e}){return u.jsx(n1,{className:"text-gray-400 hover:text-white",children:u.jsx(r1,{asChild:!0,children:u.jsxs(We,{to:e.to,onClick:e.onClick,className:"flex-row items-center",target:e.target,activeProps:e.to?oE:void 0,children:[e.icon,u.jsx("span",{className:`hidden ${e.textBreakpoint}:inline-block`,children:e.text}),u.jsx("span",{className:`${e.textBreakpoint}:hidden`,children:" "})]})})})}function Ale({menuItems:e}){const{user:t}=pc();vc(t);const[n,r]=x.useState(!1),i=x.useCallback(()=>r(a=>!a),[]),o=x.useCallback(()=>r(!1),[]);return u.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(We,{to:el,children:u.jsx(WC,{})}),u.jsx(iE,{}),u.jsxs("button",{type:"button",className:"shadow-xs text-grey-400 hover:text-white hover:bg-black-dark",onClick:i,children:[u.jsx("span",{className:"sr-only",children:n?"Close menu":"Open menu"}),n?u.jsx(AP,{}):u.jsx(jP,{})]})]}),u.jsx("div",{className:`${n?"fixed":"hidden"} top-40 bottom-0 left-0 right-0 bg-black-dark opacity-70`,onClick:o}),u.jsx("div",{className:`${n?"block":"hidden"} md:hidden z-50 space-y-1 pb-3 bg-black-dark absolute left-0 top-full w-full rounded-b-md`,children:e.map(a=>nL(a)?!!a.items.length&&u.jsx("div",{className:"bg-black pl-10 pr-2 py-2",children:a.items.map(c=>u.jsx(pD,{menuItem:c,onClick:o},c.text))},a.text):u.jsx(pD,{menuItem:a,onClick:o},a.text))})]})}function pD({menuItem:e,onClick:t}){const n=x.useCallback(()=>{e.onClick?.(),t()},[e,t]);return u.jsxs(We,{to:e.to,onClick:n,target:e.target,className:"flex flex-row px-3 py-2 text-base font-medium rounded-md text-gray-400 hover:text-white",activeProps:e.to?oE:void 0,children:[e.icon,u.jsx("span",{className:"ml-4",children:e.text})]})}function cm({title:e,children:t}){return u.jsxs("li",{className:"list-image-(--checkmark-icon) mt-4",children:[u.jsx("h3",{className:"text-xl font-bold",children:e}),t]})}function Ole(){return u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:u.jsx(tL,{})}),u.jsxs("div",{className:"pt-20 grid h-screen grid-cols-1 md:grid-cols-2",children:[u.jsx("section",{className:"items-center justify-center hidden text-white md:flex bg-linear-(--blue-pink-gradient) px-6",children:u.jsxs("div",{children:[u.jsx("h1",{className:"text-4xl font-bold",children:"Harper Fabric"}),u.jsxs("ul",{className:"ps-5",children:[u.jsx(cm,{title:"Free Tier",children:u.jsx("span",{children:"Try us out, no credit card required!"})}),u.jsx(cm,{title:"Global Deployments Managed as One",children:u.jsx("span",{children:"Coordinate global environments as if they were a single node."})}),u.jsx(cm,{title:"Database, App, Cache, & Messaging",children:u.jsx("span",{children:"Bring your stack together for reliable, ultra-fast performance."})}),u.jsx(cm,{title:"NoSQL, Vector, & Blob",children:u.jsx("span",{children:"Store and serve modern data types with low latency, semantic search ability, and global reach."})}),u.jsx(cm,{title:"Simplified Operations",children:u.jsx("span",{children:"Focus on what differentiates your app; leave infrastructure to us."})})]}),u.jsx("span",{className:"opacity-5",children:"Bravo!"})]})}),u.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:u.jsx(tl,{})})]})]})}function Dle(){x.useEffect(()=>{},[])}const $le=["gmail.com","yahoo.com","hotmail.com","outlook.com","icloud.com","aol.com","protonmail.com","mail.com","zoho.com","yandex.com","gmx.com","live.com","msn.com","me.com","inbox.com"];function aE(e){if(!e||!e.includes("@"))return null;const t=e.split("@").pop()||"";if(!t)return null;for(const n of $le)if(t===n||t.endsWith("."+n))return null;return t}let bS=null;function Mle(){const e=pn(),t=tn(),n=ur(),{redirect:r}=yr({strict:!1});return x.useEffect(()=>{bS||(bS=(async function(){const i=await DM().catch(()=>null);if(!i)Ee.error("We were not able to verify your sign-in. Please try signing in again.",{duration:1e4}),await e({to:"/sign-in"});else{kn.setUserForEntity(En,i);const o=vc(i);aE(i.email),await n.invalidateQueries({queryKey:vp,refetchType:"none"}),await t.invalidate(),await e({to:r?.startsWith("/")?r:o})}bS=null})())},[]),u.jsxs("div",{className:"text-white w-lg flex flex-col gap-4",children:[u.jsxs("h1",{className:"text-3xl font-light",children:[u.jsx("span",{"aria-hidden":"true",className:"text-2xl animate-flower-dance mr-4",title:"Loading",children:"🌼"}),"Checking..."]}),u.jsx("div",{className:"underline flex gap-4",children:u.jsx(We,{className:"text-sm opacity-50 hover:text-blue-300",to:"/sign-in",children:"Try signing in again"})})]})}const Ple=["top","right","bottom","left"],Ys=Math.min,ki=Math.max,Yv=Math.round,zg=Math.floor,ra=e=>({x:e,y:e}),zle={left:"right",right:"left",bottom:"top",top:"bottom"},Lle={start:"end",end:"start"};function i1(e,t,n){return ki(e,Ys(t,n))}function Ka(e,t){return typeof e=="function"?e(t):e}function Za(e){return e.split("-")[0]}function Kd(e){return e.split("-")[1]}function sE(e){return e==="x"?"y":"x"}function lE(e){return e==="y"?"height":"width"}const Ule=new Set(["top","bottom"]);function Jo(e){return Ule.has(Za(e))?"y":"x"}function cE(e){return sE(Jo(e))}function Fle(e,t,n){n===void 0&&(n=!1);const r=Kd(e),i=cE(e),o=lE(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Wv(a)),[a,Wv(a)]}function Vle(e){const t=Wv(e);return[o1(e),t,o1(t)]}function o1(e){return e.replace(/start|end/g,t=>Lle[t])}const hD=["left","right"],gD=["right","left"],Ble=["top","bottom"],Hle=["bottom","top"];function qle(e,t,n){switch(e){case"top":case"bottom":return n?t?gD:hD:t?hD:gD;case"left":case"right":return t?Ble:Hle;default:return[]}}function Gle(e,t,n,r){const i=Kd(e);let o=qle(Za(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(o1)))),o}function Wv(e){return e.replace(/left|right|bottom|top/g,t=>zle[t])}function Kle(e){return{top:0,right:0,bottom:0,left:0,...e}}function rL(e){return typeof e!="number"?Kle(e):{top:e,right:e,bottom:e,left:e}}function Xv(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function vD(e,t,n){let{reference:r,floating:i}=e;const o=Jo(t),a=cE(t),c=lE(a),d=Za(t),f=o==="y",p=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,v=r[c]/2-i[c]/2;let y;switch(d){case"top":y={x:p,y:r.y-i.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:h};break;case"left":y={x:r.x-i.width,y:h};break;default:y={x:r.x,y:r.y}}switch(Kd(t)){case"start":y[a]-=v*(n&&f?-1:1);break;case"end":y[a]+=v*(n&&f?-1:1);break}return y}const Zle=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:h}=vD(f,r,d),v=r,y={},b=0;for(let S=0;S<c.length;S++){const{name:C,fn:E}=c[S],{x:k,y:j,data:I,reset:A}=await E({x:p,y:h,initialPlacement:r,placement:v,strategy:i,middlewareData:y,rects:f,platform:a,elements:{reference:e,floating:t}});p=k??p,h=j??h,y={...y,[C]:{...y[C],...I}},A&&b<=50&&(b++,typeof A=="object"&&(A.placement&&(v=A.placement),A.rects&&(f=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:p,y:h}=vD(f,v,d)),S=-1)}return{x:p,y:h,placement:v,strategy:i,middlewareData:y}};async function Xm(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:v=!1,padding:y=0}=Ka(t,e),b=rL(y),C=c[v?h==="floating"?"reference":"floating":h],E=Xv(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),k=h==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),I=await(o.isElement==null?void 0:o.isElement(j))?await(o.getScale==null?void 0:o.getScale(j))||{x:1,y:1}:{x:1,y:1},A=Xv(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:k,offsetParent:j,strategy:d}):k);return{top:(E.top-A.top+b.top)/I.y,bottom:(A.bottom-E.bottom+b.bottom)/I.y,left:(E.left-A.left+b.left)/I.x,right:(A.right-E.right+b.right)/I.x}}const Yle=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:c,middlewareData:d}=t,{element:f,padding:p=0}=Ka(e,t)||{};if(f==null)return{};const h=rL(p),v={x:n,y:r},y=cE(i),b=lE(y),S=await a.getDimensions(f),C=y==="y",E=C?"top":"left",k=C?"bottom":"right",j=C?"clientHeight":"clientWidth",I=o.reference[b]+o.reference[y]-v[y]-o.floating[b],A=v[y]-o.reference[y],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let N=T?T[j]:0;(!N||!await(a.isElement==null?void 0:a.isElement(T)))&&(N=c.floating[j]||o.floating[b]);const z=I/2-A/2,L=N/2-S[b]/2-1,K=Ys(h[E],L),J=Ys(h[k],L),H=K,Y=N-S[b]-J,B=N/2-S[b]/2+z,W=i1(H,B,Y),M=!d.arrow&&Kd(i)!=null&&B!==W&&o.reference[b]/2-(B<H?K:J)-S[b]/2<0,Z=M?B<H?B-H:B-Y:0;return{[y]:v[y]+Z,data:{[y]:W,centerOffset:B-W-Z,...M&&{alignmentOffset:Z}},reset:M}}}),Wle=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:S=!0,...C}=Ka(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=Za(i),k=Jo(c),j=Za(c)===c,I=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=v||(j||!S?[Wv(c)]:Vle(c)),T=b!=="none";!v&&T&&A.push(...Gle(c,S,b,I));const N=[c,...A],z=await Xm(t,C),L=[];let K=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&L.push(z[E]),h){const B=Fle(i,a,I);L.push(z[B[0]],z[B[1]])}if(K=[...K,{placement:i,overflows:L}],!L.every(B=>B<=0)){var J,H;const B=(((J=o.flip)==null?void 0:J.index)||0)+1,W=N[B];if(W&&(!(h==="alignment"?k!==Jo(W):!1)||K.every(U=>Jo(U.placement)===k?U.overflows[0]>0:!0)))return{data:{index:B,overflows:K},reset:{placement:W}};let M=(H=K.filter(Z=>Z.overflows[0]<=0).sort((Z,U)=>Z.overflows[1]-U.overflows[1])[0])==null?void 0:H.placement;if(!M)switch(y){case"bestFit":{var Y;const Z=(Y=K.filter(U=>{if(T){const te=Jo(U.placement);return te===k||te==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(te=>te>0).reduce((te,D)=>te+D,0)]).sort((U,te)=>U[1]-te[1])[0])==null?void 0:Y[0];Z&&(M=Z);break}case"initialPlacement":M=c;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function yD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bD(e){return Ple.some(t=>e[t]>=0)}const Xle=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Ka(e,t);switch(r){case"referenceHidden":{const o=await Xm(t,{...i,elementContext:"reference"}),a=yD(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:bD(a)}}}case"escaped":{const o=await Xm(t,{...i,altBoundary:!0}),a=yD(o,n.floating);return{data:{escapedOffsets:a,escaped:bD(a)}}}default:return{}}}}},iL=new Set(["left","top"]);async function Qle(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Za(n),c=Kd(n),d=Jo(n)==="y",f=iL.has(a)?-1:1,p=o&&d?-1:1,h=Ka(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof b=="number"&&(y=c==="end"?b*-1:b),d?{x:y*p,y:v*f}:{x:v*f,y:y*p}}const Jle=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:c}=t,d=await Qle(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:o+d.y,data:{...d,placement:a}}}}},ece=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:C=>{let{x:E,y:k}=C;return{x:E,y:k}}},...d}=Ka(e,t),f={x:n,y:r},p=await Xm(t,d),h=Jo(Za(i)),v=sE(h);let y=f[v],b=f[h];if(o){const C=v==="y"?"top":"left",E=v==="y"?"bottom":"right",k=y+p[C],j=y-p[E];y=i1(k,y,j)}if(a){const C=h==="y"?"top":"left",E=h==="y"?"bottom":"right",k=b+p[C],j=b-p[E];b=i1(k,b,j)}const S=c.fn({...t,[v]:y,[h]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[h]:a}}}}}},tce=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=Ka(e,t),p={x:n,y:r},h=Jo(i),v=sE(h);let y=p[v],b=p[h];const S=Ka(c,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const j=v==="y"?"height":"width",I=o.reference[v]-o.floating[j]+C.mainAxis,A=o.reference[v]+o.reference[j]-C.mainAxis;y<I?y=I:y>A&&(y=A)}if(f){var E,k;const j=v==="y"?"width":"height",I=iL.has(Za(i)),A=o.reference[h]-o.floating[j]+(I&&((E=a.offset)==null?void 0:E[h])||0)+(I?0:C.crossAxis),T=o.reference[h]+o.reference[j]+(I?0:((k=a.offset)==null?void 0:k[h])||0)-(I?C.crossAxis:0);b<A?b=A:b>T&&(b=T)}return{[v]:y,[h]:b}}}},nce=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:c}=t,{apply:d=()=>{},...f}=Ka(e,t),p=await Xm(t,f),h=Za(i),v=Kd(i),y=Jo(i)==="y",{width:b,height:S}=o.floating;let C,E;h==="top"||h==="bottom"?(C=h,E=v===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=h,C=v==="end"?"top":"bottom");const k=S-p.top-p.bottom,j=b-p.left-p.right,I=Ys(S-p[C],k),A=Ys(b-p[E],j),T=!t.middlewareData.shift;let N=I,z=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=k),T&&!v){const K=ki(p.left,0),J=ki(p.right,0),H=ki(p.top,0),Y=ki(p.bottom,0);y?z=b-2*(K!==0||J!==0?K+J:ki(p.left,p.right)):N=S-2*(H!==0||Y!==0?H+Y:ki(p.top,p.bottom))}await d({...t,availableWidth:z,availableHeight:N});const L=await a.getDimensions(c.floating);return b!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function gb(){return typeof window<"u"}function Zd(e){return oL(e)?(e.nodeName||"").toLowerCase():"#document"}function Ni(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function da(e){var t;return(t=(oL(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function oL(e){return gb()?e instanceof Node||e instanceof Ni(e).Node:!1}function Oo(e){return gb()?e instanceof Element||e instanceof Ni(e).Element:!1}function sa(e){return gb()?e instanceof HTMLElement||e instanceof Ni(e).HTMLElement:!1}function xD(e){return!gb()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ni(e).ShadowRoot}const rce=new Set(["inline","contents"]);function Np(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Do(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!rce.has(i)}const ice=new Set(["table","td","th"]);function oce(e){return ice.has(Zd(e))}const ace=[":popover-open",":modal"];function vb(e){return ace.some(t=>{try{return e.matches(t)}catch{return!1}})}const sce=["transform","translate","scale","rotate","perspective"],lce=["transform","translate","scale","rotate","perspective","filter"],cce=["paint","layout","strict","content"];function uE(e){const t=dE(),n=Oo(e)?Do(e):e;return sce.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||lce.some(r=>(n.willChange||"").includes(r))||cce.some(r=>(n.contain||"").includes(r))}function uce(e){let t=Ws(e);for(;sa(t)&&!bd(t);){if(uE(t))return t;if(vb(t))return null;t=Ws(t)}return null}function dE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const dce=new Set(["html","body","#document"]);function bd(e){return dce.has(Zd(e))}function Do(e){return Ni(e).getComputedStyle(e)}function yb(e){return Oo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ws(e){if(Zd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xD(e)&&e.host||da(e);return xD(t)?t.host:t}function aL(e){const t=Ws(e);return bd(t)?e.ownerDocument?e.ownerDocument.body:e.body:sa(t)&&Np(t)?t:aL(t)}function Qm(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=aL(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Ni(i);if(o){const c=a1(a);return t.concat(a,a.visualViewport||[],Np(i)?i:[],c&&n?Qm(c):[])}return t.concat(i,Qm(i,[],n))}function a1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sL(e){const t=Do(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=sa(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,c=Yv(n)!==o||Yv(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function fE(e){return Oo(e)?e:e.contextElement}function Wu(e){const t=fE(e);if(!sa(t))return ra(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=sL(t);let a=(o?Yv(n.width):n.width)/r,c=(o?Yv(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const fce=ra(0);function lL(e){const t=Ni(e);return!dE()||!t.visualViewport?fce:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mce(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ni(e)?!1:t}function ac(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=fE(e);let a=ra(1);t&&(r?Oo(r)&&(a=Wu(r)):a=Wu(e));const c=mce(o,n,r)?lL(o):ra(0);let d=(i.left+c.x)/a.x,f=(i.top+c.y)/a.y,p=i.width/a.x,h=i.height/a.y;if(o){const v=Ni(o),y=r&&Oo(r)?Ni(r):r;let b=v,S=a1(b);for(;S&&r&&y!==b;){const C=Wu(S),E=S.getBoundingClientRect(),k=Do(S),j=E.left+(S.clientLeft+parseFloat(k.paddingLeft))*C.x,I=E.top+(S.clientTop+parseFloat(k.paddingTop))*C.y;d*=C.x,f*=C.y,p*=C.x,h*=C.y,d+=j,f+=I,b=Ni(S),S=a1(b)}}return Xv({width:p,height:h,x:d,y:f})}function bb(e,t){const n=yb(e).scrollLeft;return t?t.left+n:ac(da(e)).left+n}function cL(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-bb(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function pce(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=da(r),c=t?vb(t.floating):!1;if(r===a||c&&o)return n;let d={scrollLeft:0,scrollTop:0},f=ra(1);const p=ra(0),h=sa(r);if((h||!h&&!o)&&((Zd(r)!=="body"||Np(a))&&(d=yb(r)),sa(r))){const y=ac(r);f=Wu(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const v=a&&!h&&!o?cL(a,d):ra(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+v.x,y:n.y*f.y-d.scrollTop*f.y+p.y+v.y}}function hce(e){return Array.from(e.getClientRects())}function gce(e){const t=da(e),n=yb(e),r=e.ownerDocument.body,i=ki(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ki(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+bb(e);const c=-n.scrollTop;return Do(r).direction==="rtl"&&(a+=ki(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:c}}const wD=25;function vce(e,t){const n=Ni(e),r=da(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,d=0;if(i){o=i.width,a=i.height;const p=dE();(!p||p&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const f=bb(r);if(f<=0){const p=r.ownerDocument,h=p.body,v=getComputedStyle(h),y=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(r.clientWidth-h.clientWidth-y);b<=wD&&(o-=b)}else f<=wD&&(o+=f);return{width:o,height:a,x:c,y:d}}const yce=new Set(["absolute","fixed"]);function bce(e,t){const n=ac(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=sa(e)?Wu(e):ra(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,d=i*o.x,f=r*o.y;return{width:a,height:c,x:d,y:f}}function SD(e,t,n){let r;if(t==="viewport")r=vce(e,n);else if(t==="document")r=gce(da(e));else if(Oo(t))r=bce(t,n);else{const i=lL(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Xv(r)}function uL(e,t){const n=Ws(e);return n===t||!Oo(n)||bd(n)?!1:Do(n).position==="fixed"||uL(n,t)}function xce(e,t){const n=t.get(e);if(n)return n;let r=Qm(e,[],!1).filter(c=>Oo(c)&&Zd(c)!=="body"),i=null;const o=Do(e).position==="fixed";let a=o?Ws(e):e;for(;Oo(a)&&!bd(a);){const c=Do(a),d=uE(a);!d&&c.position==="fixed"&&(i=null),(o?!d&&!i:!d&&c.position==="static"&&!!i&&yce.has(i.position)||Np(a)&&!d&&uL(e,a))?r=r.filter(p=>p!==a):i=c,a=Ws(a)}return t.set(e,r),r}function wce(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?vb(t)?[]:xce(t,this._c):[].concat(n),r],c=a[0],d=a.reduce((f,p)=>{const h=SD(t,p,i);return f.top=ki(h.top,f.top),f.right=Ys(h.right,f.right),f.bottom=Ys(h.bottom,f.bottom),f.left=ki(h.left,f.left),f},SD(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Sce(e){const{width:t,height:n}=sL(e);return{width:t,height:n}}function _ce(e,t,n){const r=sa(t),i=da(t),o=n==="fixed",a=ac(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const d=ra(0);function f(){d.x=bb(i)}if(r||!r&&!o)if((Zd(t)!=="body"||Np(i))&&(c=yb(t)),r){const y=ac(t,!0,o,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else i&&f();o&&!r&&i&&f();const p=i&&!r&&!o?cL(i,c):ra(0),h=a.left+c.scrollLeft-d.x-p.x,v=a.top+c.scrollTop-d.y-p.y;return{x:h,y:v,width:a.width,height:a.height}}function xS(e){return Do(e).position==="static"}function _D(e,t){if(!sa(e)||Do(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return da(e)===n&&(n=n.ownerDocument.body),n}function dL(e,t){const n=Ni(e);if(vb(e))return n;if(!sa(e)){let i=Ws(e);for(;i&&!bd(i);){if(Oo(i)&&!xS(i))return i;i=Ws(i)}return n}let r=_D(e,t);for(;r&&oce(r)&&xS(r);)r=_D(r,t);return r&&bd(r)&&xS(r)&&!uE(r)?n:r||uce(e)||n}const Cce=async function(e){const t=this.getOffsetParent||dL,n=this.getDimensions,r=await n(e.floating);return{reference:_ce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ece(e){return Do(e).direction==="rtl"}const kce={convertOffsetParentRelativeRectToViewportRelativeRect:pce,getDocumentElement:da,getClippingRect:wce,getOffsetParent:dL,getElementRects:Cce,getClientRects:hce,getDimensions:Sce,getScale:Wu,isElement:Oo,isRTL:Ece};function fL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jce(e,t){let n=null,r;const i=da(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:p,top:h,width:v,height:y}=f;if(c||t(),!v||!y)return;const b=zg(h),S=zg(i.clientWidth-(p+v)),C=zg(i.clientHeight-(h+y)),E=zg(p),j={rootMargin:-b+"px "+-S+"px "+-C+"px "+-E+"px",threshold:ki(0,Ys(1,d))||1};let I=!0;function A(T){const N=T[0].intersectionRatio;if(N!==d){if(!I)return a();N?a(!1,N):r=setTimeout(()=>{a(!1,1e-7)},1e3)}N===1&&!fL(f,e.getBoundingClientRect())&&a(),I=!1}try{n=new IntersectionObserver(A,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,j)}n.observe(e)}return a(!0),o}function Rce(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=fE(e),p=i||o?[...f?Qm(f):[],...Qm(t)]:[];p.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const h=f&&c?jce(f,n):null;let v=-1,y=null;a&&(y=new ResizeObserver(E=>{let[k]=E;k&&k.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var j;(j=y)==null||j.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let b,S=d?ac(e):null;d&&C();function C(){const E=ac(e);S&&!fL(S,E)&&n(),S=E,b=requestAnimationFrame(C)}return n(),()=>{var E;p.forEach(k=>{i&&k.removeEventListener("scroll",n),o&&k.removeEventListener("resize",n)}),h?.(),(E=y)==null||E.disconnect(),y=null,d&&cancelAnimationFrame(b)}}const Ice=Jle,Tce=ece,Nce=Wle,Ace=nce,Oce=Xle,CD=Yle,Dce=tce,$ce=(e,t,n)=>{const r=new Map,i={platform:kce,...n},o={...i.platform,_c:r};return Zle(e,t,{...i,platform:o})};var Mce=typeof document<"u",Pce=function(){},Cv=Mce?x.useLayoutEffect:Pce;function Qv(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Qv(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Qv(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function mL(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ED(e,t){const n=mL(e);return Math.round(t*n)/n}function wS(e){const t=x.useRef(e);return Cv(()=>{t.current=e}),t}function zce(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[p,h]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=x.useState(r);Qv(v,r)||y(r);const[b,S]=x.useState(null),[C,E]=x.useState(null),k=x.useCallback(U=>{U!==T.current&&(T.current=U,S(U))},[]),j=x.useCallback(U=>{U!==N.current&&(N.current=U,E(U))},[]),I=o||b,A=a||C,T=x.useRef(null),N=x.useRef(null),z=x.useRef(p),L=d!=null,K=wS(d),J=wS(i),H=wS(f),Y=x.useCallback(()=>{if(!T.current||!N.current)return;const U={placement:t,strategy:n,middleware:v};J.current&&(U.platform=J.current),$ce(T.current,N.current,U).then(te=>{const D={...te,isPositioned:H.current!==!1};B.current&&!Qv(z.current,D)&&(z.current=D,$d.flushSync(()=>{h(D)}))})},[v,t,n,J,H]);Cv(()=>{f===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,h(U=>({...U,isPositioned:!1})))},[f]);const B=x.useRef(!1);Cv(()=>(B.current=!0,()=>{B.current=!1}),[]),Cv(()=>{if(I&&(T.current=I),A&&(N.current=A),I&&A){if(K.current)return K.current(I,A,Y);Y()}},[I,A,Y,K,L]);const W=x.useMemo(()=>({reference:T,floating:N,setReference:k,setFloating:j}),[k,j]),M=x.useMemo(()=>({reference:I,floating:A}),[I,A]),Z=x.useMemo(()=>{const U={position:n,left:0,top:0};if(!M.floating)return U;const te=ED(M.floating,p.x),D=ED(M.floating,p.y);return c?{...U,transform:"translate("+te+"px, "+D+"px)",...mL(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:D}},[n,c,M.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:Y,refs:W,elements:M,floatingStyles:Z}),[p,Y,W,M,Z])}const Lce=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?CD({element:r.current,padding:i}).fn(n):{}:r?CD({element:r,padding:i}).fn(n):{}}}},Uce=(e,t)=>({...Ice(e),options:[e,t]}),Fce=(e,t)=>({...Tce(e),options:[e,t]}),Vce=(e,t)=>({...Dce(e),options:[e,t]}),Bce=(e,t)=>({...Nce(e),options:[e,t]}),Hce=(e,t)=>({...Ace(e),options:[e,t]}),qce=(e,t)=>({...Oce(e),options:[e,t]}),Gce=(e,t)=>({...Lce(e),options:[e,t]});var Kce="Arrow",pL=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return u.jsx(Ge.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});pL.displayName=Kce;var Zce=pL;function hL(e){const[t,n]=x.useState(void 0);return qn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,c;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;a=f.inlineSize,c=f.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var mE="Popper",[gL,Yd]=Mi(mE),[Yce,vL]=gL(mE),yL=e=>{const{__scopePopper:t,children:n}=e,[r,i]=x.useState(null);return u.jsx(Yce,{scope:t,anchor:r,onAnchorChange:i,children:n})};yL.displayName=mE;var bL="PopperAnchor",xL=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=vL(bL,n),a=x.useRef(null),c=lt(t,a),d=x.useRef(null);return x.useEffect(()=>{const f=d.current;d.current=r?.current||a.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:u.jsx(Ge.div,{...i,ref:c})});xL.displayName=bL;var pE="PopperContent",[Wce,Xce]=gL(pE),wL=x.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:b,...S}=e,C=vL(pE,n),[E,k]=x.useState(null),j=lt(t,V=>k(V)),[I,A]=x.useState(null),T=hL(I),N=T?.width??0,z=T?.height??0,L=r+(o!=="center"?"-"+o:""),K=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},J=Array.isArray(f)?f:[f],H=J.length>0,Y={padding:K,boundary:J.filter(Jce),altBoundary:H},{refs:B,floatingStyles:W,placement:M,isPositioned:Z,middlewareData:U}=zce({strategy:"fixed",placement:L,whileElementsMounted:(...V)=>Rce(...V,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[Uce({mainAxis:i+z,alignmentAxis:a}),d&&Fce({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Vce():void 0,...Y}),d&&Bce({...Y}),Hce({...Y,apply:({elements:V,rects:ie,availableWidth:we,availableHeight:Ie})=>{const{width:Ue,height:Pe}=ie.reference,Ze=V.floating.style;Ze.setProperty("--radix-popper-available-width",`${we}px`),Ze.setProperty("--radix-popper-available-height",`${Ie}px`),Ze.setProperty("--radix-popper-anchor-width",`${Ue}px`),Ze.setProperty("--radix-popper-anchor-height",`${Pe}px`)}}),I&&Gce({element:I,padding:c}),eue({arrowWidth:N,arrowHeight:z}),v&&qce({strategy:"referenceHidden",...Y})]}),[te,D]=CL(M),P=mn(b);qn(()=>{Z&&P?.()},[Z,P]);const F=U.arrow?.x,O=U.arrow?.y,ee=U.arrow?.centerOffset!==0,[ue,pe]=x.useState();return qn(()=>{E&&pe(window.getComputedStyle(E).zIndex)},[E]),u.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:Z?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(Wce,{scope:n,placedSide:te,onArrowChange:A,arrowX:F,arrowY:O,shouldHideArrow:ee,children:u.jsx(Ge.div,{"data-side":te,"data-align":D,...S,ref:j,style:{...S.style,animation:Z?void 0:"none"}})})})});wL.displayName=pE;var SL="PopperArrow",Qce={top:"bottom",right:"left",bottom:"top",left:"right"},_L=x.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Xce(SL,r),a=Qce[o.placedSide];return u.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:u.jsx(Zce,{...i,ref:n,style:{...i.style,display:"block"}})})});_L.displayName=SL;function Jce(e){return e!==null}var eue=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,d=a?0:e.arrowHeight,[f,p]=CL(n),h={start:"0%",center:"50%",end:"100%"}[p],v=(i.arrow?.x??0)+c/2,y=(i.arrow?.y??0)+d/2;let b="",S="";return f==="bottom"?(b=a?h:`${v}px`,S=`${-d}px`):f==="top"?(b=a?h:`${v}px`,S=`${r.floating.height+d}px`):f==="right"?(b=`${-d}px`,S=a?h:`${y}px`):f==="left"&&(b=`${r.floating.width+d}px`,S=a?h:`${y}px`),{data:{x:b,y:S}}}});function CL(e){const[t,n="center"]=e.split("-");return[t,n]}var hE=yL,gE=xL,vE=wL,yE=_L,tue="Portal",Ap=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=x.useState(!1);qn(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?_C.createPortal(u.jsx(Ge.div,{...r,ref:t}),a):null});Ap.displayName=tue;var[xb]=Mi("Tooltip",[Yd]),wb=Yd(),EL="TooltipProvider",nue=700,s1="tooltip.open",[rue,bE]=xb(EL),kL=e=>{const{__scopeTooltip:t,delayDuration:n=nue,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=x.useRef(!0),c=x.useRef(!1),d=x.useRef(0);return x.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),u.jsx(rue,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:x.useCallback(f=>{c.current=f},[]),disableHoverableContent:i,children:o})};kL.displayName=EL;var Jm="Tooltip",[iue,Op]=xb(Jm),jL=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:c}=e,d=bE(Jm,e.__scopeTooltip),f=wb(t),[p,h]=x.useState(null),v=Ti(),y=x.useRef(0),b=a??d.disableHoverableContent,S=c??d.delayDuration,C=x.useRef(!1),[E,k]=Ao({prop:r,defaultProp:i??!1,onChange:N=>{N?(d.onOpen(),document.dispatchEvent(new CustomEvent(s1))):d.onClose(),o?.(N)},caller:Jm}),j=x.useMemo(()=>E?C.current?"delayed-open":"instant-open":"closed",[E]),I=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,k(!0)},[k]),A=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,k(!1)},[k]),T=x.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,k(!0),y.current=0},S)},[S,k]);return x.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),u.jsx(hE,{...f,children:u.jsx(iue,{scope:t,contentId:v,open:E,stateAttribute:j,trigger:p,onTriggerChange:h,onTriggerEnter:x.useCallback(()=>{d.isOpenDelayedRef.current?T():I()},[d.isOpenDelayedRef,T,I]),onTriggerLeave:x.useCallback(()=>{b?A():(window.clearTimeout(y.current),y.current=0)},[A,b]),onOpen:I,onClose:A,disableHoverableContent:b,children:n})})};jL.displayName=Jm;var l1="TooltipTrigger",RL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Op(l1,n),o=bE(l1,n),a=wb(n),c=x.useRef(null),d=lt(t,c,i.onTriggerChange),f=x.useRef(!1),p=x.useRef(!1),h=x.useCallback(()=>f.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),u.jsx(gE,{asChild:!0,...a,children:u.jsx(Ge.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:je(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:je(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:je(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:je(e.onBlur,i.onClose),onClick:je(e.onClick,i.onClose)})})});RL.displayName=l1;var xE="TooltipPortal",[oue,aue]=xb(xE,{forceMount:void 0}),IL=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Op(xE,t);return u.jsx(oue,{scope:t,forceMount:n,children:u.jsx(Gn,{present:n||o.open,children:u.jsx(Ap,{asChild:!0,container:i,children:r})})})};IL.displayName=xE;var xd="TooltipContent",TL=x.forwardRef((e,t)=>{const n=aue(xd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=Op(xd,e.__scopeTooltip);return u.jsx(Gn,{present:r||a.open,children:a.disableHoverableContent?u.jsx(NL,{side:i,...o,ref:t}):u.jsx(sue,{side:i,...o,ref:t})})}),sue=x.forwardRef((e,t)=>{const n=Op(xd,e.__scopeTooltip),r=bE(xd,e.__scopeTooltip),i=x.useRef(null),o=lt(t,i),[a,c]=x.useState(null),{trigger:d,onClose:f}=n,p=i.current,{onPointerInTransitChange:h}=r,v=x.useCallback(()=>{c(null),h(!1)},[h]),y=x.useCallback((b,S)=>{const C=b.currentTarget,E={x:b.clientX,y:b.clientY},k=due(E,C.getBoundingClientRect()),j=fue(E,k),I=mue(S.getBoundingClientRect()),A=hue([...j,...I]);c(A),h(!0)},[h]);return x.useEffect(()=>()=>v(),[v]),x.useEffect(()=>{if(d&&p){const b=C=>y(C,p),S=C=>y(C,d);return d.addEventListener("pointerleave",b),p.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",b),p.removeEventListener("pointerleave",S)}}},[d,p,y,v]),x.useEffect(()=>{if(a){const b=S=>{const C=S.target,E={x:S.clientX,y:S.clientY},k=d?.contains(C)||p?.contains(C),j=!pue(E,a);k?v():j&&(v(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,p,a,f,v]),u.jsx(NL,{...e,ref:o})}),[lue,cue]=xb(Jm,{isInside:!1}),uue=Nse("TooltipContent"),NL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...c}=e,d=Op(xd,n),f=wb(n),{onClose:p}=d;return x.useEffect(()=>(document.addEventListener(s1,p),()=>document.removeEventListener(s1,p)),[p]),x.useEffect(()=>{if(d.trigger){const h=v=>{v.target?.contains(d.trigger)&&p()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,p]),u.jsx(Hd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:p,children:u.jsxs(vE,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(uue,{children:r}),u.jsx(lue,{scope:n,isInside:!0,children:u.jsx($4,{id:d.contentId,role:"tooltip",children:i||r})})]})})});TL.displayName=xd;var AL="TooltipArrow",OL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=wb(n);return cue(AL,n).isInside?null:u.jsx(yE,{...i,...r,ref:t})});OL.displayName=AL;function due(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function fue(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function mue(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function pue(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],d=t[a],f=c.x,p=c.y,h=d.x,v=d.y;p>r!=v>r&&n<(h-f)*(r-p)/(v-p)+f&&(i=!i)}return i}function hue(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),gue(t)}function gue(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var vue=kL,yue=jL,bue=RL,xue=IL,wue=TL,Sue=OL;function _ue({delayDuration:e=0,...t}){return u.jsx(vue,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function wE({...e}){return u.jsx(_ue,{children:u.jsx(yue,{"data-slot":"tooltip",...e})})}function SE({...e}){return u.jsx(bue,{"data-slot":"tooltip-trigger",...e})}function _E({className:e,sideOffset:t=0,arrowClassName:n,children:r,...i}){return u.jsx(xue,{children:u.jsxs(wue,{"data-slot":"tooltip-content",sideOffset:t,className:ze("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...i,children:[r,u.jsx(Sue,{className:ze("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",n)})]})})}function ep({width:e,className:t,animated:n,placeholder:r}){return u.jsxs("div",{className:ia("w-full bg-gray-200 rounded-full relative",r?"h-6":"h-2.5"),children:[r&&u.jsx("div",{className:"absolute top-0 h-full w-full font-bold text-xs flex flex-col items-center justify-center text-black/60 text-shadow-2xs",children:r}),u.jsx("div",{className:ia("rounded-full",r?"h-6":"h-2.5",!t?.includes("bg-")&&"bg-purple/40",n&&"transition-[width] duration-1000 ease-in-out motion-reduce:transition-none",t),style:{width:e}})]})}async function CE(e){const{data:t}=await Vt.get(`/Cluster/${e}`);return t}function Cc(e,t){return{queryKey:[e],queryFn:()=>CE(e),retry:!1,enabled:!!e,refetchInterval:t?t===!0?1e4:t:void 0}}async function Cue(e,t=3,n=1e3){let r=0;if(t<=0)throw new Error("retries must be greater than 0");let i;for(;r<t;)try{return await e()}catch(o){if(r++,i=o,r===t)break;await bp(n)}throw i}async function DL({operation:e,replicated:t,instanceClient:n}){const{data:r}=await n.post("/",{operation:e,service:e==="restart_service"?"http":void 0,replicated:t});return await bp(1e4),await Cue(()=>sd({instanceClient:n,timeout:3e3}),12,15e3),r}function Eue(){return ft({mutationFn:DL})}function kue({onRestartedSuccessfully:e}={}){const{clusterId:t}=et({strict:!1}),n=ur(),[r,i]=x.useState(!1);return{onRestartClick:x.useCallback(async()=>{if(!t)throw new Error("clusterId must be set in the route to invoke useRestartClusterClick");i(!0);let a=!1;const c={duration:6e4,action:{label:"Cancel",onClick:()=>{a=!0}}},d=Ee.loading("Restarting",{...c,description:u.jsx(ep,{animated:!0,width:"0%"})}),p=(await CE(t))?.instances??[],h=p.filter(y=>y.status==="RUNNING").map(y=>Gl({id:y.id,operationsUrl:vC(y)})).reverse();let v=0;if(h.length)for(let y=0;y<h.length;y++){const b=h[y];if(!a){Ee.loading(`Restarting Instance ${y+1} of ${h.length}`,{...c,id:d,description:u.jsx(ep,{animated:!0,width:(y===0?0:y/h.length*100)+"%"})});try{await sd({instanceClient:b}),await DL({operation:"restart",replicated:!1,instanceClient:b}),v+=1}catch{y+1!==h.length&&(Ee.loading(`Failed Restarting Instance ${y+1} of ${h.length}`,{...c,id:d,description:"We will carry on momentarily."}),await bp(3e3))}}}if(i(!1),n.invalidateQueries({queryKey:[t]}),a)Ee.error("Cancelled",{id:d,description:"The restart was partially cancelled.",duration:1e4,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}});else if(p.length===v)e?.(),Ee.success("Success",{id:d,description:"Cluster fully restarted!",duration:1e4,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}});else{const y=jo(p.length,"instance","instances"),b=jo(v,'"RUNNING" instance was','"RUNNING" instances were');Ee.error("Error",{id:d,description:`Failed to fully restart cluster.
38
+ `,r:"\r",t:" "};function Yne(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):Zne[e]}const Wne="v1",Xne=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function Qne(e,t){let n;const r=ere(),i=await ire(e);return i.ok?(r.increment("fetch","success"),n=Jne(e,i.value,t,r)):(r.increment("fetch","failure"),dt.error(i.error)),ob("remote configuration metrics",{metrics:r.get()}),n}function Jne(e,t,n,r){const i={...e};return Xne.forEach(v=>{v in t&&(i[v]=o(t[v]))}),Object.keys(n).forEach(v=>{t[v]!==void 0&&a(n[v],t[v])}),i;function o(v){if(Array.isArray(v))return v.map(o);if(tre(v)){if(nre(v)){const y=v.rcSerializedType;switch(y){case"string":return v.value;case"regex":return Zz(v.value);case"dynamic":return c(v);default:dt.error(`Unsupported remote configuration: "rcSerializedType": "${y}"`);return}}return UP(v,o)}return v}function a(v,y){y.forEach(({key:b,value:S})=>{v.setContextProperty(b,o(S))})}function c(v){const y=v.strategy;let b;switch(y){case"cookie":b=d(v);break;case"dom":b=f(v);break;case"js":b=h(v);break;default:dt.error(`Unsupported remote configuration: "strategy": "${y}"`);return}const S=v.extractor;return S!==void 0&&typeof b=="string"?rre(S,b):b}function d({name:v}){const y=nb(v);return r.increment("cookie",y!==void 0?"success":"missing"),y}function f({selector:v,attribute:y}){let b;try{b=document.querySelector(v)}catch{dt.error(`Invalid selector in the remote configuration: '${v}'`),r.increment("dom","failure");return}if(!b){r.increment("dom","missing");return}if(p(b,y)){dt.error(`Forbidden element selected by the remote configuration: '${v}'`),r.increment("dom","failure");return}const S=y!==void 0?b.getAttribute(y):b.textContent;if(S===null){r.increment("dom","missing");return}return r.increment("dom","success"),S}function p(v,y){return v.getAttribute("type")==="password"&&y==="value"}function h({path:v}){let y=window;const b=zne(v);if(b.length===0){dt.error(`Invalid JSON path in the remote configuration: '${v}'`),r.increment("js","failure");return}for(const S of b){if(!(S in y)){r.increment("js","missing");return}try{y=y[S]}catch(C){dt.error(`Error accessing: '${v}'`,C),r.increment("js","failure");return}}return r.increment("js","success"),y}}function ere(){const e={fetch:{}};return{get:()=>e,increment:(t,n)=>{e[t]||(e[t]={}),e[t][n]||(e[t][n]=0),e[t][n]=e[t][n]+1}}}function tre(e){return typeof e=="object"&&e!==null}function nre(e){return"rcSerializedType"in e}function Zz(e){try{return new RegExp(e)}catch{dt.error(`Invalid regex in the remote configuration: '${e}'`)}}function rre(e,t){const n=Zz(e.value);if(n===void 0)return;const r=n.exec(t);if(r===null)return;const[i,o]=r;return o||i}async function ire(e){let t;try{t=await fetch(ore(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const n=await t.json();return n.rum?{ok:!0,value:n.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function ore(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${sz("rum",e)}/${Wne}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function are({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,r,i){const o=dne(),a=zz();uS(a,cr.globalContext,o);const c=Lz();uS(c,cr.userContext,o);const d=Pz();uS(d,cr.accountContext,o);let f,p,h,v;const y=n.observable.subscribe(S),b={};function S(){if(!h||!v||!n.isGranted())return;y.unsubscribe();let I;if(v.trackViewsManually){if(!f)return;o.remove(f.callback),I=f.options}const A=i(v,p,I);o.drain(A)}function C(I,A){const T=gd();if(T&&(I=sre(I)),h=I,kte(Pne(I)),v){fz("DD_RUM",I);return}const N=Nne(I,A);if(N){if(!T&&!N.sessionStoreStrategyType){dt.warn("No storage available for session. We will not send any data.");return}N.compressIntakeRequests&&!T&&t&&(p=t(N,"Datadog RUM",Ft),!p)||(v=N,Mz().subscribe(Ft),n.tryToInit(N.trackingConsent),S())}}const E=I=>{o.add(A=>A.addDurationVital(I))};return{init(I,A,T){if(!I){dt.error("Missing configuration");return}pee(I.enableExperimentalFeatures),h=I,!(e&&Tz())&&(Bz(I.plugins,"onInit",{initConfiguration:I,publicApi:A}),I.remoteConfigurationId?Qne(I,{user:c,context:a}).then(N=>{N&&C(N,T)}).catch(qs):C(I,T))},get initConfiguration(){return h},getInternalContext:Ft,stopSession:Ft,addTiming(I,A=vr()){o.add(T=>T.addTiming(I,A))},startView(I,A=er()){const T=N=>{N.startView(I,A)};o.add(T),f||(f={options:I,callback:T},S())},setViewName(I){o.add(A=>A.setViewName(I))},setViewContext(I){o.add(A=>A.setViewContext(I))},setViewContextProperty(I,A){o.add(T=>T.setViewContextProperty(I,A))},getViewContext:()=>b,globalContext:a,userContext:c,accountContext:d,addAction(I){o.add(A=>A.addAction(I))},addError(I){o.add(A=>A.addError(I))},addFeatureFlagEvaluation(I,A){o.add(T=>T.addFeatureFlagEvaluation(I,A))},startDurationVital(I,A){return Fz(r,I,A)},stopDurationVital(I,A){Vz(E,r,I,A)},addDurationVital:E,addOperationStepVital:(I,A,T,N)=>{o.add(z=>z.addOperationStepVital(ln(I),A,ln(T),ln(N)))}}}function sre(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=kp())===null||n===void 0?void 0:n.getPrivacyLevel()}}function uS(e,t,n){e.changeObservable.subscribe(()=>{const r=e.getContext();n.add(i=>i[t].setContext(r))})}function lre(e,t,n,r={}){const i=KJ(),o=Sne(),a=xne().observable;let c=are(r,i,o,(h,v,y)=>{const b=v&&r.createDeflateEncoder?C=>r.createDeflateEncoder(h,v,C):Vte,S=e(h,t,n,y,b,i,o,a,r.sdkName);return t.onRumStart(S.lifeCycle,h,S.session,S.viewHistory,v,S.telemetry),n.onRumStart(S.lifeCycle,S.hooks,h,S.session,S.viewHistory,b),c=cre(c,S),Bz(h.plugins,"onRumStart",{strategy:c,addEvent:S.addEvent}),S});const d=()=>c,f=yt(h=>{const v=typeof h=="object"?h:{name:h};c.startView(v),lr({feature:"start-view"})}),p=Hee({init:h=>{const v=new Error().stack;Fs(()=>c.init(h,p,v))},setTrackingConsent:yt(h=>{i.update(h),lr({feature:"set-tracking-consent",tracking_consent:h})}),setViewName:yt(h=>{c.setViewName(h),lr({feature:"set-view-name"})}),setViewContext:yt(h=>{c.setViewContext(h),lr({feature:"set-view-context"})}),setViewContextProperty:yt((h,v)=>{c.setViewContextProperty(h,v),lr({feature:"set-view-context-property"})}),getViewContext:yt(()=>(lr({feature:"set-view-context-property"}),c.getViewContext())),getInternalContext:yt(h=>c.getInternalContext(h)),getInitConfiguration:yt(()=>LC(c.initConfiguration)),addAction:(h,v)=>{const y=Zm("action");Fs(()=>{c.addAction({name:ln(h),context:ln(v),startClocks:er(),type:HC.CUSTOM,handlingStack:y}),lr({feature:"add-action"})})},addError:(h,v)=>{const y=Zm("error");Fs(()=>{c.addError({error:h,handlingStack:y,context:ln(v),startClocks:er()}),lr({feature:"add-error"})})},addTiming:yt((h,v)=>{c.addTiming(ln(h),v)}),setGlobalContext:Ar(d,cr.globalContext,Or.setContext,"set-global-context"),getGlobalContext:Ar(d,cr.globalContext,Or.getContext,"get-global-context"),setGlobalContextProperty:Ar(d,cr.globalContext,Or.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:Ar(d,cr.globalContext,Or.removeContextProperty,"remove-global-context-property"),clearGlobalContext:Ar(d,cr.globalContext,Or.clearContext,"clear-global-context"),setUser:Ar(d,cr.userContext,Or.setContext,"set-user"),getUser:Ar(d,cr.userContext,Or.getContext,"get-user"),setUserProperty:Ar(d,cr.userContext,Or.setContextProperty,"set-user-property"),removeUserProperty:Ar(d,cr.userContext,Or.removeContextProperty,"remove-user-property"),clearUser:Ar(d,cr.userContext,Or.clearContext,"clear-user"),setAccount:Ar(d,cr.accountContext,Or.setContext,"set-account"),getAccount:Ar(d,cr.accountContext,Or.getContext,"get-account"),setAccountProperty:Ar(d,cr.accountContext,Or.setContextProperty,"set-account-property"),removeAccountProperty:Ar(d,cr.accountContext,Or.removeContextProperty,"remove-account-property"),clearAccount:Ar(d,cr.accountContext,Or.clearContext,"clear-account"),startView:f,stopSession:yt(()=>{c.stopSession(),lr({feature:"stop-session"})}),addFeatureFlagEvaluation:yt((h,v)=>{c.addFeatureFlagEvaluation(ln(h),ln(v)),lr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:yt(()=>t.getSessionReplayLink()),startSessionReplayRecording:yt(h=>{t.start(h),lr({feature:"start-session-replay-recording",force:h&&h.force})}),stopSessionReplayRecording:yt(()=>t.stop()),addDurationVital:yt((h,v)=>{lr({feature:"add-duration-vital"}),c.addDurationVital({name:ln(h),type:Wm.DURATION,startClocks:iJ(v.startTime),duration:v.duration,context:ln(v&&v.context),description:ln(v&&v.description)})}),startDurationVital:yt((h,v)=>(lr({feature:"start-duration-vital"}),c.startDurationVital(ln(h),{context:ln(v&&v.context),description:ln(v&&v.description)}))),stopDurationVital:yt((h,v)=>{lr({feature:"stop-duration-vital"}),c.stopDurationVital(typeof h=="string"?ln(h):h,{context:ln(v&&v.context),description:ln(v&&v.description)})}),startFeatureOperation:yt((h,v)=>{lr({feature:"add-operation-step-vital",action_type:"start"}),c.addOperationStepVital(h,"start",v)}),succeedFeatureOperation:yt((h,v)=>{lr({feature:"add-operation-step-vital",action_type:"succeed"}),c.addOperationStepVital(h,"end",v)}),failFeatureOperation:yt((h,v,y)=>{lr({feature:"add-operation-step-vital",action_type:"fail"}),c.addOperationStepVital(h,"end",y,v)})});return p}function cre(e,t){return{init:n=>{fz("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function ure(){const e=dre();return new Nt(t=>{if(!e)return;const n=new e(yt(r=>t.notify(r)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function dre(){let e;const t=window;if(t.Zone&&(e=Hs(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(Ft),r=Hs(n,"originalInstance");e=r&&r.constructor}return e||(e=t.MutationObserver),e}function fre(){const e=new Nt,{stop:t}=na(window,"open",()=>e.notify());return{observable:e,stop:t}}function mre(e,t,n,r,i){return{get:o=>{const a=n.findView(o),c=i.findUrl(o),d=t.findTrackedSession(o);if(d&&a&&c){const f=r.findActionId(o);return{application_id:e,session_id:d.id,user_action:f?{id:f}:void 0,view:{id:a.id,name:a.name,referrer:c.referrer,url:c.url}}}}}}const pre=Bte,hre=yc;function gre(e){const t=Bd({expireDelay:hre});e.subscribe(1,r=>{t.add(n(r),r.startClocks.relative)}),e.subscribe(6,({endClocks:r})=>{t.closeActive(r.relative)}),e.subscribe(3,r=>{const i=t.find(r.startClocks.relative);i&&(r.name&&(i.name=r.name),r.context&&(i.context=r.context),i.sessionIsActive=r.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function n(r){return{service:r.service,version:r.version,context:r.context,id:r.id,name:r.name,startClocks:r.startClocks}}return{findView:r=>t.find(r),stop:()=>{t.stop()}}}const Yz="initial_document",vre=[[Mr.DOCUMENT,e=>Yz===e],[Mr.XHR,e=>e==="xmlhttprequest"],[Mr.FETCH,e=>e==="fetch"],[Mr.BEACON,e=>e==="beacon"],[Mr.CSS,(e,t)=>/\.css$/i.test(t)],[Mr.JS,(e,t)=>/\.js$/i.test(t)],[Mr.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[Mr.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[Mr.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function yre(e){const t=e.name;if(!gJ(t))return Mr.OTHER;const n=vJ(t);for(const[r,i]of vre)if(i(e.initiatorType,n))return r;return Mr.OTHER}function DO(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function Wz(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function bre(e){const{duration:t,startTime:n,responseEnd:r}=e;return t===0&&n<r?Mn(n,r):t}function xre(e){if(!Qz(e))return;const{startTime:t,fetchStart:n,workerStart:r,redirectStart:i,redirectEnd:o,domainLookupStart:a,domainLookupEnd:c,connectStart:d,secureConnectionStart:f,connectEnd:p,requestStart:h,responseStart:v,responseEnd:y}=e,b={download:Tl(t,v,y),first_byte:Tl(t,h,v)};return 0<r&&r<n&&(b.worker=Tl(t,r,n)),n<p&&(b.connect=Tl(t,d,p),d<=f&&f<=p&&(b.ssl=Tl(t,f,p))),n<c&&(b.dns=Tl(t,a,c)),t<o&&(b.redirect=Tl(t,i,o)),b}function Xz(e){return e.duration>=0}function Qz(e){const t=DO(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=wre(e)?DO(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function wre(e){return e.redirectEnd>e.startTime}function Tl(e,t,n){if(e<=t&&t<=n)return{duration:ht(Mn(t,n)),start:ht(Mn(e,t))}}function Sre(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function _re(e){return e.deliveryType===""?"other":e.deliveryType}function Cre(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:r}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function qC(e){return e&&(!uee(e)||Sp(Gs.TRACK_INTAKE_REQUESTS))}const Ere=/data:(.+)?(;base64)?,/g,kre=24e3;function jre(e,t=kre){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(Ere);return n?`${n[0]}[...]`:e}const Rre=32*dd;function Ire(e,t){const n=Nre(e.requestBody,t.trackPayload);if(n){if(t.trackResponseErrors&&e.responseBody){const r=Tre(e.responseBody);r&&(n.errors_count=r.length,n.errors=r)}return n}}function Tre(e){let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!="object")return;const n=t;return Xl(n.errors)?n.errors.map(i=>{var o;return{message:i.message,path:i.path,locations:i.locations,code:(o=i.extensions)===null||o===void 0?void 0:o.code}}):void 0}function Jz(e,t){return t.allowedGraphQlUrls.find(n=>ib([n.match],e))}function Nre(e,t=!1){if(!e||typeof e!="string")return;let n;try{n=JSON.parse(e)}catch{return}if(!n||!n.query)return;const r=n.query.trim(),i=Are(r),o=n.operationName;if(!i)return;let a;return n.variables&&(a=JSON.stringify(n.variables)),{operationType:i,operationName:o,variables:a,payload:t?OC(r,Rre,"..."):void 0}}function Are(e){var t;return(t=e.match(/^\s*(query|mutation|subscription)\b/i))===null||t===void 0?void 0:t[1]}let $O=1;function Ore(e,t,n,r,i){const o=Ine(t,n,r,i);Dre(e,t,o),$re(e,t,o)}function Dre(e,t,n){const r=qte(t).subscribe(i=>{const o=i;if(qC(o.url))switch(o.state){case"start":n.traceXhr(o,o.xhr),o.requestIndex=e4(),e.notify(7,{requestIndex:o.requestIndex,url:o.url});break;case"complete":n.clearTracingIfNeeded(o),e.notify(8,{duration:o.duration,method:o.method,requestIndex:o.requestIndex,spanId:o.spanId,startClocks:o.startClocks,status:o.status,traceId:o.traceId,traceSampled:o.traceSampled,type:sb.XHR,url:o.url,xhr:o.xhr,isAborted:o.isAborted,handlingStack:o.handlingStack,requestBody:o.requestBody,responseBody:o.responseBody});break}});return{stop:()=>r.unsubscribe()}}function $re(e,t,n){const r=Mz({responseBodyAction:i=>{var o;return!((o=Jz(i.url,t))===null||o===void 0)&&o.trackResponseErrors?2:1}}).subscribe(i=>{var o;const a=i;if(qC(a.url))switch(a.state){case"start":n.traceFetch(a),a.requestIndex=e4(),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"resolve":n.clearTracingIfNeeded(a),e.notify(8,{duration:Mn(a.startClocks.timeStamp,vr()),method:a.method,requestIndex:a.requestIndex,responseType:a.responseType,spanId:a.spanId,startClocks:a.startClocks,status:a.status,traceId:a.traceId,traceSampled:a.traceSampled,type:sb.FETCH,url:a.url,response:a.response,init:a.init,input:a.input,isAborted:a.isAborted,handlingStack:a.handlingStack,requestBody:(o=a.init)===null||o===void 0?void 0:o.body,responseBody:a.responseBody});break}});return{stop:()=>r.unsubscribe()}}function e4(){const e=$O;return $O+=1,e}function t4(e){return xp(e)&&e<0?void 0:e}function n4({lifeCycle:e,isChildEvent:t,onChange:n=Ft}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},i=e.subscribe(13,o=>{var a;if(!(o.type==="view"||o.type==="vital"||!t(o)))switch(o.type){case gt.ERROR:r.errorCount+=1,n();break;case gt.ACTION:r.actionCount+=1,o.action.frustration&&(r.frustrationCount+=o.action.frustration.type.length),n();break;case gt.LONG_TASK:r.longTaskCount+=1,n();break;case gt.RESOURCE:!((a=o._dd)===null||a===void 0)&&a.discarded||(r.resourceCount+=1,n());break}});return{stop:()=>{i.unsubscribe()},eventCounts:r}}function Mre(e,t){const n=Ur();let r=!1;const{stop:i}=Ks(e,window,["click","mousedown","keydown","touchstart","pointerdown"],c=>{if(!c.cancelable)return;const d={entryType:"first-input",processingStart:Oi(),processingEnd:Oi(),startTime:c.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};c.type==="pointerdown"?o(e,d):a(d)},{passive:!0,capture:!0});return{stop:i};function o(c,d){Ks(c,window,["pointerup","pointercancel"],f=>{f.type==="pointerup"&&a(d)},{once:!0})}function a(c){if(!r){r=!0,i();const d=c.processingStart-c.startTime;d>=0&&d<Ur()-n&&t(c)}}}var Dt;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"})(Dt||(Dt={}));function aa(e,t){return new Nt(n=>{if(!window.PerformanceObserver)return;const r=d=>{const f=Lre(d);f.length>0&&n.notify(f)};let i,o=!0;const a=new PerformanceObserver(yt(d=>{o?i=Er(()=>r(d.getEntries())):r(d.getEntries())}));try{a.observe(t)}catch{if([Dt.RESOURCE,Dt.NAVIGATION,Dt.LONG_TASK,Dt.PAINT].includes(t.type)){t.buffered&&(i=Er(()=>r(performance.getEntriesByType(t.type))));try{a.observe({entryTypes:[t.type]})}catch{return}}}o=!1,Pre(e);let c;return!wc(Dt.FIRST_INPUT)&&t.type===Dt.FIRST_INPUT&&({stop:c}=Mre(e,d=>{r([d])})),()=>{a.disconnect(),c&&c(),to(i)}})}let sm;function Pre(e){return!sm&&zre()&&"addEventListener"in performance&&(sm=xn(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{sm?.stop()}}function zre(){return window.performance!==void 0&&"getEntries"in performance}function wc(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function Lre(e){return e.filter(t=>!Ure(t))}function Ure(e){return e.entryType===Dt.RESOURCE&&(!qC(e.name)||!Xz(e))}function K_(e){return e.nodeType===Node.TEXT_NODE}function Fre(e){return e.nodeType===Node.COMMENT_NODE}function Ga(e){return e.nodeType===Node.ELEMENT_NODE}function r4(e){return Ga(e)&&!!e.shadowRoot}function Vre(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&Ga(t.host)}function ANe(e){return e.childNodes.length>0||r4(e)}function ONe(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;r4(e)&&t(e.shadowRoot)}function Bre(e){return Vre(e)?e.host:e.parentNode}const i4=100,Hre=100,MO="data-dd-excluded-activity-mutations";function GC(e,t,n,r,i,o){const a=Gre(e,t,n,r);return qre(a,i,o)}function qre(e,t,n){let r,i=!1;const o=Er(yt(()=>f({hadActivity:!1})),i4),a=n!==void 0?Er(yt(()=>f({hadActivity:!0,end:vr()})),n):void 0,c=e.subscribe(({isBusy:p})=>{to(o),to(r);const h=vr();p||(r=Er(yt(()=>f({hadActivity:!0,end:h})),Hre))}),d=()=>{i=!0,to(o),to(r),to(a),c.unsubscribe()};function f(p){i||(d(),t(p))}return{stop:d}}function Gre(e,t,n,r){return new Nt(i=>{const o=[];let a,c=0;return o.push(t.subscribe(f=>{f.every(Kre)||d()}),n.subscribe(d),aa(r,{type:Dt.RESOURCE}).subscribe(f=>{f.some(p=>!dS(r,p.name))&&d()}),e.subscribe(7,f=>{dS(r,f.url)||(a===void 0&&(a=f.requestIndex),c+=1,d())}),e.subscribe(8,f=>{dS(r,f.url)||a===void 0||f.requestIndex<a||(c-=1,d())})),()=>{o.forEach(f=>f.unsubscribe())};function d(){i.notify({isBusy:c>0})}})}function dS(e,t){return ib(e.excludedActivityUrls,t)}function Kre(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&Ga(t)&&t.matches(`[${MO}], [${MO}] *`))}const lb="data-dd-action-name",Zre="Masked Element",Yre=[lb,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],Wre=[a4,Qre],Xre=[a4,Jre,eie];function Rp(e,t){if(!e.isConnected)return;let n,r=e;for(;r&&r.nodeName!=="HTML";){const i=PO(r,Wre,nie,t,n);if(i)return i;n=PO(r,Xre,rie,t,n)||cb(tie(r),n),r=r.parentElement}return n}function o4(e){return/[0-9]/.test(e)}function Qre(e){if(e.id&&!o4(e.id))return`#${CSS.escape(e.id)}`}function Jre(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const r=t[n];if(!o4(r))return`${CSS.escape(e.tagName)}.${CSS.escape(r)}`}}function eie(e){return CSS.escape(e.tagName)}function a4(e,t){if(t){const r=n(t);if(r)return r}for(const r of Yre){const i=n(r);if(i)return i}function n(r){if(e.hasAttribute(r))return`${CSS.escape(e.tagName)}[${r}="${CSS.escape(e.getAttribute(r))}"]`}}function tie(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function PO(e,t,n,r,i){for(const o of t){const a=o(e,r);if(a&&n(e,a,i))return cb(a,i)}}function nie(e,t,n){return e.ownerDocument.querySelectorAll(cb(t,n)).length===1}function rie(e,t,n){let r;if(n===void 0)r=a=>a.matches(t);else{const a=cb(`${t}:scope`,n);r=c=>c.querySelector(a)!==null}let o=e.parentElement.firstElementChild;for(;o;){if(o!==e&&r(o))return!1;o=o.nextElementSibling}return!0}function cb(e,t){return t?`${e}>${t}`:e}const It={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Lu.ALLOW,MASK:Lu.MASK,MASK_USER_INPUT:Lu.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:Lu.MASK_UNLESS_ALLOWLISTED},iie="data-dd-privacy",DNe="hidden",oie="dd-privacy-",fS="***",$Ne="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",aie={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},sie="x";function Dl(e){return`[${iie}="${e}"], .${oie}${e}`}function KC(e,t,n){if(n&&n.has(e))return n.get(e);const r=Bre(e),i=r?KC(r,t,n):t,o=cie(e),a=lie(o,i);return n&&n.set(e,a),a}function lie(e,t){switch(t){case It.HIDDEN:case It.IGNORE:return t}switch(e){case It.ALLOW:case It.MASK:case It.MASK_USER_INPUT:case It.MASK_UNLESS_ALLOWLISTED:case It.HIDDEN:case It.IGNORE:return e;default:return t}}function cie(e){if(Ga(e)){if(e.tagName==="BASE")return It.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return It.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return It.MASK}if(e.matches(Dl(It.HIDDEN)))return It.HIDDEN;if(e.matches(Dl(It.MASK)))return It.MASK;if(e.matches(Dl(It.MASK_UNLESS_ALLOWLISTED)))return It.MASK_UNLESS_ALLOWLISTED;if(e.matches(Dl(It.MASK_USER_INPUT)))return It.MASK_USER_INPUT;if(e.matches(Dl(It.ALLOW)))return It.ALLOW;if(uie(e))return It.IGNORE}}function s4(e,t){switch(t){case It.MASK:case It.HIDDEN:case It.IGNORE:return!0;case It.MASK_UNLESS_ALLOWLISTED:return K_(e)?$g(e.parentNode)?!0:!c4(e.textContent||""):$g(e);case It.MASK_USER_INPUT:return K_(e)?$g(e.parentNode):$g(e);default:return!1}}function $g(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!aie[t.tagName]}const l4=e=>e.replace(/\S/g,sie);function MNe(e,t){var n;const r=(n=e.parentElement)===null||n===void 0?void 0:n.tagName;let i=e.textContent||"";if(r==="HEAD"&&!i.trim())return;const a=t;if(r==="SCRIPT")i=fS;else if(a===It.HIDDEN)i=fS;else if(s4(e,a))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=fS:a===It.MASK_UNLESS_ALLOWLISTED?i=die(i):i=l4(i);return i}function uie(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),r=t("rel"),i=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||r==="icon"||r==="apple-touch-icon"||r==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(i)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(i)||/^product:/.test(i)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function c4(e){var t;return!e||!e.trim()?!0:((t=window.$DD_ALLOW)===null||t===void 0?void 0:t.has(e.toLocaleLowerCase()))||!1}function die(e,t){return c4(e)?e:t||l4(e)}const u4=Rr,fie=100;function mie(e,t){const n=[];let r=0,i;o(e);function o(d){d.stopObservable.subscribe(a),n.push(d),to(i),i=Er(c,u4)}function a(){r===1&&n.every(d=>d.isStopped())&&(r=2,t(n))}function c(){to(i),r===0&&(r=1,a())}return{tryAppend:d=>r!==0?!1:n.length>0&&!pie(n[n.length-1].event,d.event)?(c(),!1):(o(d),!0),stop:()=>{c()}}}function pie(e,t){return e.target===t.target&&hie(e,t)<=fie&&e.timeStamp-t.timeStamp<=u4}function hie(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function gie(e,t,n=It.ALLOW){const{actionNameAttribute:r}=t,i=zO(e,lb)||r&&zO(e,r);return i?{name:i,nameSource:"custom_attribute"}:n===It.MASK?{name:Zre,nameSource:"mask_placeholder"}:LO(e,vie,t)||LO(e,yie,t)||{name:"",nameSource:"blank"}}function zO(e,t){const n=e.closest(`[${t}]`);if(!n)return;const r=n.getAttribute(t);return f4(d4(r.trim()))}const vie=[(e,t)=>{if("labels"in e&&e.labels&&e.labels.length>0)return xv(e.labels[0],t)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return xv(e,t)},e=>lm(e,"aria-label"),(e,t)=>{const n=e.getAttribute("aria-labelledby");if(n)return{name:n.split(/\s+/).map(r=>xie(e,r)).filter(r=>!!r).map(r=>m4(r,t)).join(" "),nameSource:"text_content"}},e=>lm(e,"alt"),e=>lm(e,"name"),e=>lm(e,"title"),e=>lm(e,"placeholder"),(e,t)=>{if("options"in e&&e.options.length>0)return xv(e.options[0],t)}],yie=[(e,t)=>xv(e,t)],bie=10;function LO(e,t,n){let r=e,i=0;for(;i<=bie&&r&&r.nodeName!=="BODY"&&r.nodeName!=="HTML"&&r.nodeName!=="HEAD";){for(const o of t){const a=o(r,n);if(a){const{name:c,nameSource:d}=a,f=c&&c.trim();if(f)return{name:f4(d4(f)),nameSource:d}}}if(r.nodeName==="FORM")break;r=r.parentElement,i+=1}}function d4(e){return e.replace(/\s+/g," ")}function f4(e){return e.length>100?`${OC(e,100)} [...]`:e}function xie(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function lm(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function xv(e,t){return{name:m4(e,t)||"",nameSource:"text_content"}}function m4(e,t){if(e.isContentEditable)return;const{enablePrivacyForActionName:n,actionNameAttribute:r,defaultPrivacyLevel:i}=t;if(Sp(Gs.USE_TREE_WALKER_FOR_ACTION_NAME))return wie(e,r,n,i);if("innerText"in e){let o=e.innerText;const a=c=>{const d=e.querySelectorAll(c);for(let f=0;f<d.length;f+=1){const p=d[f];if("innerText"in p){const h=p.innerText;h&&h.trim().length>0&&(o=o.replace(h,""))}}};return a(`[${lb}]`),r&&a(`[${r}]`),n&&a(`${Dl(It.HIDDEN)}, ${Dl(It.MASK)}`),o}return e.textContent}function wie(e,t,n,r){const i=new Map,o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,c);let a="";for(;o.nextNode();){const d=o.currentNode;if(Ga(d)){(d.nodeName==="BR"||d.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(d).display))&&(a+=" ");continue}a+=d.textContent||""}return a.replace(/\s+/g," ").trim();function c(d){const f=KC(d,r,i);if(n&&f&&s4(d,f))return NodeFilter.FILTER_REJECT;if(Ga(d)){if(d.hasAttribute(lb)||t&&d.hasAttribute(t))return NodeFilter.FILTER_REJECT;const p=getComputedStyle(d);if(p.visibility!=="visible"||p.display==="none"||p.contentVisibility&&p.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function Sie(e,{onPointerDown:t,onPointerUp:n}){let r,i={selection:!1,input:!1,scroll:!1},o;const a=[xn(e,window,"pointerdown",c=>{FO(c)&&(r=UO(),i={selection:!1,input:!1,scroll:!1},o=t(c))},{capture:!0}),xn(e,window,"selectionchange",()=>{(!r||!UO())&&(i.selection=!0)},{capture:!0}),xn(e,window,"scroll",()=>{i.scroll=!0},{capture:!0,passive:!0}),xn(e,window,"pointerup",c=>{if(FO(c)&&o){const d=i;n(o,c,()=>d),o=void 0}},{capture:!0}),xn(e,window,"input",()=>{i.input=!0},{capture:!0})];return{stop:()=>{a.forEach(c=>c.stop())}}}function UO(){const e=window.getSelection();return!e||e.isCollapsed}function FO(e){return e.target instanceof Element&&e.isPrimary!==!1}const VO=3;function _ie(e,t){if(Cie(e))return t.addFrustration(am.RAGE_CLICK),e.some(BO)&&t.addFrustration(am.DEAD_CLICK),t.hasError&&t.addFrustration(am.ERROR_CLICK),{isRage:!0};const n=e.some(r=>r.getUserActivity().selection);return e.forEach(r=>{r.hasError&&r.addFrustration(am.ERROR_CLICK),BO(r)&&!n&&r.addFrustration(am.DEAD_CLICK)}),{isRage:!1}}function Cie(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(VO-1);t+=1)if(e[t+VO-1].event.timeStamp-e[t].event.timeStamp<=Rr)return!0;return!1}const Eie='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function BO(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(Eie)}const p4=10*Rr,Dm=new Map;function kie(e){const t=Dm.get(e);return Dm.delete(e),t}function h4(e,t){Dm.set(e,t),Dm.forEach((n,r)=>{Mn(r,Oi())>p4&&Dm.delete(r)})}const jie=5*Br;function Rie(e,t,n,r){const i=Bd({expireDelay:jie}),o=new Nt;let a;e.subscribe(10,()=>{i.reset()}),e.subscribe(5,p),e.subscribe(11,h=>{h.reason===Zu.UNLOADING&&p()});const{stop:c}=Sie(r,{onPointerDown:h=>Iie(r,e,t,h,n),onPointerUp:({clickActionBase:h,hadActivityOnPointerDown:v},y,b)=>{Tie(r,e,t,n,i,o,f,h,y,b,v)}});return{stop:()=>{p(),o.notify(),c()},actionContexts:{findActionId:h=>i.findAll(h)}};function f(h){if(!a||!a.tryAppend(h)){const v=h.clone();a=mie(h,y=>{Aie(y,v)})}}function p(){a&&a.stop()}}function Iie(e,t,n,r,i){let o;if(e.enablePrivacyForActionName?o=KC(r.target,e.defaultPrivacyLevel):o=It.ALLOW,o===It.HIDDEN)return;const a=Nie(r,o,e);let c=!1;return GC(t,n,i,e,d=>{c=d.hadActivity},i4),{clickActionBase:a,hadActivityOnPointerDown:()=>c}}function Tie(e,t,n,r,i,o,a,c,d,f,p){var h;const v=g4(t,i,f,c,d);a(v);const y=(h=c?.target)===null||h===void 0?void 0:h.selector;y&&h4(d.timeStamp,y);const{stop:b}=GC(t,n,r,e,E=>{E.hadActivity&&E.end<v.startClocks.timeStamp?v.discard():E.hadActivity?v.stop(E.end):p()?v.stop(v.startClocks.timeStamp):v.stop()},p4),S=t.subscribe(5,({endClocks:E})=>{v.stop(E.timeStamp)}),C=o.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),b(),C.unsubscribe()})}function Nie(e,t,n){const r=e.target.getBoundingClientRect(),i=Rp(e.target,n.actionNameAttribute);i&&h4(e.timeStamp,i);const{name:o,nameSource:a}=gie(e.target,n,t);return{type:HC.CLICK,target:{width:Math.round(r.width),height:Math.round(r.height),selector:i},position:{x:Math.round(e.clientX-r.left),y:Math.round(e.clientY-r.top)},name:o,nameSource:a}}function g4(e,t,n,r,i){const o=jr(),a=er(),c=t.add(o,a.relative),d=n4({lifeCycle:e,isChildEvent:b=>b.action!==void 0&&(Array.isArray(b.action.id)?b.action.id.includes(o):b.action.id===o)});let f=0,p;const h=[],v=new Nt;function y(b){f===0&&(p=b,f=1,p?c.close(AC(p)):c.remove(),d.stop(),v.notify())}return{event:i,stop:y,stopObservable:v,get hasError(){return d.eventCounts.errorCount>0},get hasPageActivity(){return p!==void 0},getUserActivity:n,addFrustration:b=>{h.push(b)},startClocks:a,isStopped:()=>f===1||f===2,clone:()=>g4(e,t,n,r,i),validate:b=>{if(y(),f!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:E}=d.eventCounts,k={duration:p&&Mn(a.timeStamp,p),startClocks:a,id:o,frustrationTypes:h,counts:{resourceCount:S,errorCount:C,longTaskCount:E},events:b??[i],event:i,...r};e.notify(0,k),f=2},discard:()=>{y(),f=2}}}function Aie(e,t){const{isRage:n}=_ie(e,t);n?(e.forEach(r=>r.discard()),t.stop(vr()),t.validate(e.map(r=>r.event))):(t.discard(),e.forEach(r=>r.validate()))}function Oie(e,t,n,r,i){const{unsubscribe:o}=e.subscribe(0,d=>{e.notify(12,HO(d))});t.register(0,({startTime:d,eventType:f})=>{if(f!==gt.ERROR&&f!==gt.RESOURCE&&f!==gt.LONG_TASK)return Di;const p=a.findActionId(d);return p?{type:f,action:{id:p}}:Di}),t.register(1,({startTime:d})=>({action:{id:a.findActionId(d)}}));let a={findActionId:Ft},c=Ft;return i.trackUserInteractions&&({actionContexts:a,stop:c}=Rie(e,n,r,i)),{addAction:d=>{e.notify(12,HO(d))},actionContexts:a,stop:()=>{o(),c()}}}function HO(e){const t=mS(e)?{action:{id:e.id,loading_time:t4(ht(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=qa({action:{id:jr(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:gt.ACTION},t),r=mS(e)?e.duration:void 0,i=mS(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:r,startTime:e.startClocks.relative,domainContext:i}}function mS(e){return e.type!==HC.CUSTOM}function Die(e){const t=ane([Yy.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function $ie(e,t){const n=Gee(e,[Ym.cspViolation,Ym.intervention]).subscribe(r=>t.notify(r));return{stop:()=>{n.unsubscribe()}}}function Mie(e,t,n){const r=new Nt;return n.subscribe(i=>{i.type===0&&r.notify(i.error)}),Die(r),$ie(t,r),r.subscribe(i=>e.notify(14,{error:i})),Pie(e)}function Pie(e){return e.subscribe(14,({error:t})=>{e.notify(12,zie(t))}),{addError:({error:t,handlingStack:n,componentStack:r,startClocks:i,context:o})=>{const a=zC({originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:"Provided",source:Fd.CUSTOM,handling:"handled"});a.context=qa(a.context,o),e.notify(14,{error:a})}}}function zie(e){const t={date:e.startClocks.timeStamp,error:{id:jr(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:gt.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const qO=new WeakSet;function Lie(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(r=>!qO.has(r)).filter(r=>Xz(r)&&Qz(r)).filter(r=>Uie(r,e.startClocks.relative,v4({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return qO.add(n[0]),n[0].toJSON()}function v4(e){return Ld(e.startTime,e.duration)}function Uie(e,t,n){return e.startTime>=t-1&&v4(e)<=Ld(n,1)}const Fie=2*Br;function Vie(e){const t=Bie(e)||Hie(e);if(!(!t||t.traceTime<=Ur()-Fie))return t.traceId}function Bie(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return y4(t&&t.content,n&&n.content)}function Hie(e){const t=qie(e);if(t)return y4(Gm(t,"trace-id"),Gm(t,"trace-time"))}function y4(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function qie(e){for(let t=0;t<e.childNodes.length;t+=1){const n=GO(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],r=GO(n);if(r)return r;if(!K_(n))break}}function GO(e){if(e&&Fre(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function b4(){if(wc(Dt.NAVIGATION)){const n=performance.getEntriesByType(Dt.NAVIGATION)[0];if(n)return n}const e=Gie(),t={entryType:Dt.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function Gie(){const e={},t=performance.timing;for(const n in t)if(xp(t[n])){const r=n,i=t[r];e[r]=i===0?0:AC(i)}return e}function Kie(e,t,n=b4){FC(e,"interactive",()=>{const r=n(),i=Object.assign(r.toJSON(),{entryType:Dt.RESOURCE,initiatorType:Yz,duration:r.responseEnd,traceId:Vie(document),toJSON:()=>({...i,toJSON:void 0})});t(i)})}const Zie=1e3;function Yie(e){const t=new Set,n=e.subscribe(8,r=>{t.add(r),t.size>Zie&&(jp("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(r){let i=1/0,o;for(const a of t){const c=r.startTime-a.startClocks.relative;0<=c&&c<i&&a.url===r.name&&(i=Math.abs(c),o=a)}return o&&t.delete(o),o},stop(){n.unsubscribe()}}}function Wie(e,t,n,r=one(),i=Kie){let o;const a=t.trackEarlyRequests;a?o=Yie(e):e.subscribe(8,f=>{d(()=>Xie(f,t,n))});const c=aa(t,{type:Dt.RESOURCE,buffered:!0}).subscribe(f=>{for(const p of f)(a||!Wz(p))&&d(()=>KO(p,t,n,o))});i(t,f=>{d(()=>KO(f,t,n,o))});function d(f){r.push(()=>{const p=f();p&&e.notify(12,p)})}return{stop:()=>{r.stop(),c.unsubscribe()}}}function Xie(e,t,n){const r=Lie(e);return x4(r,e,n,t)}function KO(e,t,n,r){const i=Wz(e)&&r?r.getMatchingRequest(e):void 0;return x4(e,i,n,t)}function x4(e,t,n,r){if(!e&&!t)return;const i=t?toe(t,r):noe(e,r);if(!r.trackResources&&!i)return;const o=e?Xy(e.startTime):t.startClocks,a=e?bre(e):roe(n,o,t.duration),c=t&&Qie(t,r),d=qa({date:o.timeStamp,resource:{id:jr(),duration:ht(a),type:t?t.type===sb.XHR?Mr.XHR:Mr.FETCH:yre(e),method:t?t.method:void 0,status_code:t?t.status:ioe(e.responseStatus),url:t?jre(t.url):e.name,protocol:e&&Sre(e),delivery_type:e&&_re(e),graphql:c},type:gt.RESOURCE,_dd:{discarded:!r.trackResources}},i,e&&eoe(e));return{startTime:o.relative,duration:a,rawRumEvent:d,domainContext:Jie(e,t)}}function Qie(e,t){const n=Jz(e.url,t);if(n)return Ire(e,n)}function Jie(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===sb.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function eoe(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...Cre(e),...xre(e)}}}function toe(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function noe(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:qz().toString(),rule_psr:t.rulePsr}}}function roe(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function ioe(e){return e===0?void 0:e}function ooe(e,t,n){const{stop:r,eventCounts:i}=n4({lifeCycle:e,isChildEvent:o=>o.view.id===t,onChange:n});return{stop:r,eventCounts:i}}const aoe=10*Br;function soe(e,t,n){return{stop:aa(e,{type:Dt.PAINT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.name==="first-contentful-paint"&&a.startTime<t.timeStamp&&a.startTime<aoe);o&&n(o.startTime)}).unsubscribe}}function loe(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Mn(e,Oi()))})})}function coe(e,t,n){const r=aa(e,{type:Dt.FIRST_INPUT,buffered:!0}).subscribe(i=>{const o=i.find(a=>a.startTime<t.timeStamp);if(o){const a=Mn(o.startTime,o.processingStart);let c;o.target&&Ga(o.target)&&(c=Rp(o.target,e.actionNameAttribute)),n({delay:a>=0?a:0,time:o.startTime,targetSelector:c})}});return{stop:()=>{r.unsubscribe()}}}function uoe(e,t,n=b4){return moe(e,()=>{const r=n();foe(r)||t(doe(r))})}function doe(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=Oi()?e.responseStart:void 0}}function foe(e){return e.loadEventEnd<=0}function moe(e,t){let n;const{stop:r}=FC(e,"complete",()=>{n=Er(()=>t())});return{stop:()=>{r(),to(n)}}}const poe=10*Br;function hoe(e,t,n,r){let i=1/0;const{stop:o}=Ks(e,n,["pointerdown","keydown"],d=>{i=d.timeStamp},{capture:!0,once:!0});let a=0;const c=aa(e,{type:Dt.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(d=>{const f=KP(d,p=>p.entryType===Dt.LARGEST_CONTENTFUL_PAINT&&p.startTime<i&&p.startTime<t.timeStamp&&p.startTime<poe&&p.size>a);if(f){let p;f.element&&(p=Rp(f.element,e.actionNameAttribute)),r({value:f.startTime,targetSelector:p,resourceUrl:goe(f)}),a=f.size}});return{stop:()=>{o(),c.unsubscribe()}}}function goe(e){return e.url===""?void 0:e.url}function w4(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:Ft};if(wc(Dt.VISIBILITY_STATE)){const o=performance.getEntriesByType(Dt.VISIBILITY_STATE).filter(a=>a.name==="hidden").find(a=>a.startTime>=t.relative);if(o)return{timeStamp:o.startTime,stop:Ft}}let r=1/0;const{stop:i}=Ks(e,n,["pagehide","visibilitychange"],o=>{(o.type==="pagehide"||document.visibilityState==="hidden")&&(r=o.timeStamp,i())},{capture:!0});return{get timeStamp(){return r},stop:i}}function voe(e,t,n,r){const i={},{stop:o}=uoe(e,h=>{n(h.loadEvent),i.navigationTimings=h,r()}),a=w4(e,t),{stop:c}=soe(e,a,h=>{i.firstContentfulPaint=h,r()}),{stop:d}=hoe(e,a,window,h=>{i.largestContentfulPaint=h,r()}),{stop:f}=coe(e,a,h=>{i.firstInput=h,r()});function p(){o(),c(),d(),f(),a.stop()}return{stop:p,initialViewMetrics:i}}const Z_=(e,t)=>e*t,yoe=(e,t)=>{const n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),o=Math.min(e.bottom,t.bottom);return n>=i||r>=o?0:Z_(i-n,o-r)},ZO=e=>{const t=Z_(e.previousRect.width,e.previousRect.height),n=Z_(e.currentRect.width,e.currentRect.height),r=yoe(e.previousRect,e.currentRect);return t+n-r};function boe(e,t,n){if(!Coe())return{stop:Ft};let r=0,i;n({value:0});const o=_oe(),a=aa(e,{type:Dt.LAYOUT_SHIFT,buffered:!0}).subscribe(c=>{var d;for(const f of c){if(f.hadRecentInput||f.startTime<t)continue;const{cumulatedValue:p,isMaxValue:h}=o.update(f);if(h){const v=xoe(f.sources);i={target:v?.node?new WeakRef(v.node):void 0,time:Mn(t,f.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(p>r){r=p;const v=(d=i?.target)===null||d===void 0?void 0:d.deref();n({value:Am(r,4),targetSelector:v&&Rp(v,e.actionNameAttribute),time:i?.time,previousRect:i?.previousRect?YO(i.previousRect):void 0,currentRect:i?.currentRect?YO(i.currentRect):void 0,devicePixelRatio:i?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function xoe(e){let t;for(const n of e)if(n.node&&Ga(n.node)){const r=ZO(n);(!t||ZO(t)<r)&&(t=n)}return t}function YO({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r}}const woe=5*Rr,Soe=Rr;function _oe(){let e=0,t,n,r=0;return{update:i=>{const o=t===void 0||i.startTime-n>=Soe||i.startTime-t>=woe;let a;return o?(t=n=i.startTime,r=e=i.value,a=!0):(e+=i.value,n=i.startTime,a=i.value>r,a&&(r=i.value)),{cumulatedValue:e,isMaxValue:a}}}}function Coe(){return wc(Dt.LAYOUT_SHIFT)&&"WeakRef"in window}let wv,S4=0,pS=1/0,hS=0;function Eoe(){"interactionCount"in performance||wv||(wv=new window.PerformanceObserver(yt(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(pS=Math.min(pS,n.interactionId),hS=Math.max(hS,n.interactionId),S4=(hS-pS)/7+1)})})),wv.observe({type:"event",buffered:!0,durationThreshold:0}))}const WO=()=>wv?S4:window.performance.interactionCount||0,XO=10,koe=1*Br;function joe(e,t,n){if(!Toe())return{getInteractionToNextPaint:()=>{},setViewEnd:Ft,stop:Ft};const{getViewInteractionCount:r,stopViewInteractionCount:i}=Ioe(n);let o=1/0;const a=Roe(r);let c=-1,d,f;function p(y){for(const S of y)S.interactionId&&S.startTime>=t&&S.startTime<=o&&a.process(S);const b=a.estimateP98Interaction();b&&b.duration!==c&&(c=b.duration,f=Mn(t,b.startTime),d=kie(b.startTime),!d&&b.target&&Ga(b.target)&&(d=Rp(b.target,e.actionNameAttribute)))}const h=aa(e,{type:Dt.FIRST_INPUT,buffered:!0}).subscribe(p),v=aa(e,{type:Dt.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);return{getInteractionToNextPaint:()=>{if(c>=0)return{value:Math.min(c,koe),targetSelector:d,time:f};if(r())return{value:0}},setViewEnd:y=>{o=y,i()},stop:()=>{v.unsubscribe(),h.unsubscribe()}}}function Roe(e){const t=[];function n(){t.sort((r,i)=>i.duration-r.duration).splice(XO)}return{process(r){const i=t.findIndex(a=>r.interactionId===a.interactionId),o=t[t.length-1];i!==-1?r.duration>t[i].duration&&(t[i]=r,n()):(t.length<XO||r.duration>o.duration)&&(t.push(r),n())},estimateP98Interaction(){const r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function Ioe(e){Eoe();const t=e===Pa.INITIAL_LOAD?0:WO();let n={stopped:!1};function r(){return WO()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}function Toe(){return wc(Dt.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function Noe(e,t,n,r,i,o,a){let c=i===Pa.INITIAL_LOAD,d=!0;const f=[],p=w4(r,o);function h(){if(!d&&!c&&f.length>0){const y=Math.max(...f);y<p.timeStamp-o.relative&&a(y)}}const{stop:v}=GC(e,t,n,r,y=>{d&&(d=!1,y.hadActivity&&f.push(Mn(o.timeStamp,y.end)),h())});return{stop:()=>{v(),p.stop()},setLoadEvent:y=>{c&&(c=!1,f.push(y),h())}}}function PNe(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function Aoe(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let gS;function Ooe(e){return gS||(gS=Doe(e)),gS}function Doe(e){return new Nt(t=>{const{throttled:n}=Jy(()=>{t.notify(ZC())},200);return xn(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function ZC(){const e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}const $oe=Rr;function Moe(e,t,n,r=zoe(e)){let i=0,o=0,a=0;const c=r.subscribe(({scrollDepth:d,scrollTop:f,scrollHeight:p})=>{let h=!1;if(d>i&&(i=d,h=!0),p>o){o=p;const v=Oi();a=Mn(t.relative,v),h=!0}h&&n({maxDepth:Math.min(i,o),maxDepthScrollTop:f,maxScrollHeight:o,maxScrollHeightTime:a})});return{stop:()=>c.unsubscribe()}}function Poe(){const e=Aoe(),{height:t}=ZC(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function zoe(e,t=$oe){return new Nt(n=>{function r(){n.notify(Poe())}if(window.ResizeObserver){const i=Jy(r,t,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,a=new ResizeObserver(yt(i.throttled));o&&a.observe(o);const c=xn(e,window,"scroll",i.throttled,{passive:!0});return()=>{i.cancel(),a.disconnect(),c.stop()}}})}function Loe(e,t,n,r,i,o,a){const c={},{stop:d,setLoadEvent:f}=Noe(e,t,n,r,o,a,S=>{c.loadingTime=S,i()}),{stop:p}=Moe(r,a,S=>{c.scroll=S}),{stop:h}=boe(r,a.relative,S=>{c.cumulativeLayoutShift=S,i()}),{stop:v,getInteractionToNextPaint:y,setViewEnd:b}=joe(r,a.relative,o);return{stop:()=>{d(),h(),p()},stopINPTracking:v,setLoadEvent:f,setViewEnd:b,getCommonViewMetrics:()=>(c.interactionToNextPaint=y(),c)}}function Uoe(e,t){const{stop:n}=xn(e,window,"pageshow",r=>{r.persisted&&t(r)},{capture:!0});return n}function Foe(e,t,n){loe(e.relative,r=>{t.firstContentfulPaint=r,t.largestContentfulPaint={value:r},n()})}const Voe=3e3,Boe=5*Br,Hoe=5*Br;function qoe(e,t,n,r,i,o,a,c){const d=new Set;let f=v(Pa.INITIAL_LOAD,MP(),c),p;y();let h;a&&(h=b(o),i.trackBfcacheViews&&(p=Uoe(i,S=>{f.end();const C=Xy(S.timeStamp);f=v(Pa.BF_CACHE,C,void 0)})));function v(S,C,E){const k=Goe(t,n,r,i,e,S,C,E);return d.add(k),k.stopObservable.subscribe(()=>{d.delete(k)}),k}function y(){t.subscribe(10,()=>{f=v(Pa.ROUTE_CHANGE,void 0,{name:f.name,service:f.service,version:f.version,context:f.contextManager.getContext()})}),t.subscribe(9,()=>{f.end({sessionIsActive:!1})})}function b(S){return S.subscribe(({oldLocation:C,newLocation:E})=>{Zoe(C,E)&&(f.end(),f=v(Pa.ROUTE_CHANGE))})}return{addTiming:(S,C=vr())=>{f.addTiming(S,C)},startView:(S,C)=>{f.end({endClocks:C}),f=v(Pa.ROUTE_CHANGE,C,S)},setViewContext:S=>{f.contextManager.setContext(S)},setViewContextProperty:(S,C)=>{f.contextManager.setContextProperty(S,C)},setViewName:S=>{f.setViewName(S)},getViewContext:()=>f.contextManager.getContext(),stop:()=>{h&&h.unsubscribe(),p&&p(),f.end(),d.forEach(S=>S.stop())}}}function Goe(e,t,n,r,i,o,a=er(),c){const d=jr(),f=new Nt,p={};let h=0,v;const y=qm(i),b=ab();let S=!0,C=c?.name;const E=c?.service||r.service,k=c?.version||r.version,j=c?.context;j&&b.setContext(j);const I={id:d,name:C,startClocks:a,service:E,version:k,context:j};e.notify(1,I),e.notify(2,I);const{throttled:A,cancel:T}=Jy(D,Voe,{leading:!1}),{setLoadEvent:N,setViewEnd:z,stop:L,stopINPTracking:K,getCommonViewMetrics:J}=Loe(e,t,n,r,te,o,a),{stop:H,initialViewMetrics:Y}=o===Pa.INITIAL_LOAD?voe(r,a,N,te):{stop:Ft,initialViewMetrics:{}};o===Pa.BF_CACHE&&Foe(a,Y,te);const{stop:B,eventCounts:W}=ooe(e,d,te),M=Ud(D,Boe),Z=e.subscribe(11,P=>{P.reason===Zu.UNLOADING&&D()});D(),b.changeObservable.subscribe(te);function U(){e.notify(3,{id:d,name:C,context:b.getContext(),startClocks:a,sessionIsActive:S})}function te(){U(),A()}function D(){T(),U(),h+=1;const P=v===void 0?vr():v.timeStamp;e.notify(4,{customTimings:p,documentVersion:h,id:d,name:C,service:E,version:k,context:b.getContext(),loadingType:o,location:y,startClocks:a,commonViewMetrics:J(),initialViewMetrics:Y,duration:Mn(a.timeStamp,P),isActive:v===void 0,sessionIsActive:S,eventCounts:W})}return{get name(){return C},service:E,version:k,contextManager:b,stopObservable:f,end(P={}){var F,O;v||(v=(F=P.endClocks)!==null&&F!==void 0?F:er(),S=(O=P.sessionIsActive)!==null&&O!==void 0?O:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),Qy(M),z(v.relative),L(),Z.unsubscribe(),D(),Er(()=>{this.stop()},Hoe))},stop(){H(),B(),K(),f.notify()},addTiming(P,F){if(v)return;const O=lJ(F)?F:Mn(a.timeStamp,F);p[Koe(P)]=O,te()},setViewName(P){C=P,D()}}}function Koe(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&dt.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function Zoe(e,t){return e.pathname!==t.pathname||!Yoe(t.hash)&&QO(t.hash)!==QO(e.hash)}function Yoe(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function QO(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function Woe(e,t,n,r,i,o,a,c,d,f){return e.subscribe(4,p=>e.notify(12,Xoe(p,n,c))),t.register(0,({startTime:p,eventType:h})=>{const v=d.findView(p);return v?{type:h,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:Zs}),t.register(1,({startTime:p})=>{var h;return{view:{id:(h=d.findView(p))===null||h===void 0?void 0:h.id}}}),qoe(r,e,i,o,n,a,!n.trackViewsManually,f)}function Xoe(e,t,n){var r,i,o,a,c,d,f,p,h,v,y,b,S,C,E,k,j,I;const A=n.getReplayStats(e.id),T=(i=(r=e.commonViewMetrics)===null||r===void 0?void 0:r.cumulativeLayoutShift)===null||i===void 0?void 0:i.devicePixelRatio,N={_dd:{document_version:e.documentVersion,replay_stats:A,cls:T?{device_pixel_ratio:T}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:gt.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(o=e.commonViewMetrics.cumulativeLayoutShift)===null||o===void 0?void 0:o.value,cumulative_layout_shift_time:ht((a=e.commonViewMetrics.cumulativeLayoutShift)===null||a===void 0?void 0:a.time),cumulative_layout_shift_target_selector:(c=e.commonViewMetrics.cumulativeLayoutShift)===null||c===void 0?void 0:c.targetSelector,first_byte:ht((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.firstByte),dom_complete:ht((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.domComplete),dom_content_loaded:ht((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.domContentLoaded),dom_interactive:ht((h=e.initialViewMetrics.navigationTimings)===null||h===void 0?void 0:h.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:ht(e.initialViewMetrics.firstContentfulPaint),first_input_delay:ht((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:ht((y=e.initialViewMetrics.firstInput)===null||y===void 0?void 0:y.time),first_input_target_selector:(b=e.initialViewMetrics.firstInput)===null||b===void 0?void 0:b.targetSelector,interaction_to_next_paint:ht((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:ht((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(E=e.commonViewMetrics.interactionToNextPaint)===null||E===void 0?void 0:E.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:ht((k=e.initialViewMetrics.largestContentfulPaint)===null||k===void 0?void 0:k.value),largest_contentful_paint_target_selector:(j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.targetSelector,load_event:ht((I=e.initialViewMetrics.navigationTimings)===null||I===void 0?void 0:I.loadEvent),loading_time:t4(ht(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Qoe(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:ht(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:ht(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:wne()}};return il(e.customTimings)||(N.view.custom_timings=UP(e.customTimings,ht)),{rawRumEvent:N,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function Qoe({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:r,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:ht(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:ht(n)},fid:r&&{duration:ht(r.delay),timestamp:ht(r.time),target_selector:r.targetSelector},inp:t&&{duration:ht(t.value),timestamp:ht(t.time),target_selector:t.targetSelector},lcp:i&&{timestamp:ht(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl}}}const Joe="rum";function eae(e,t,n){const r=Mte(e,Joe,i=>nae(e,i),n);return r.expireObservable.subscribe(()=>{t.notify(9)}),r.renewObservable.subscribe(()=>{t.notify(10)}),r.sessionStateUpdateObservable.subscribe(({previousState:i,newState:o})=>{if(!i.forcedReplay&&o.forcedReplay){const a=r.findSession();a&&(a.isReplayForced=!0)}}),{findTrackedSession:i=>{const o=r.findSession(i);if(!(!o||o.trackingType==="0"))return{id:o.id,sessionReplay:o.trackingType==="1"?1:o.isReplayForced?2:0,anonymousId:o.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function tae(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:kz("records")?1:0};return{findTrackedSession:()=>e,expire:Ft,expireObservable:new Nt,setForcedReplay:Ft}}function nae(e,t){return rae(t)?t:Ll(e.sessionSampleRate)?Ll(e.sessionReplaySampleRate)?"1":"2":"0"}function rae(e){return e==="0"||e==="1"||e==="2"}function iae(e,t,n,r,i,o){const a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);const c=jz({encoder:o(2),request:Ez(a,e.batchBytesLimit,n),flushController:Rz({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:r,sessionExpireObservable:i}),messageBytesLimit:e.messageBytesLimit});return t.subscribe(13,d=>{d.type===gt.VIEW?c.upsert(d,d.view.id):c.add(d)}),c}function oae(e){const t=kp();e.subscribe(13,n=>{t.send("rum",n)})}const aae=yc;function sae(e,t,n,r){const i=Bd({expireDelay:aae});let o;e.subscribe(1,({startClocks:d})=>{const f=r.href;i.add(c({url:f,referrer:o||document.referrer}),d.relative),o=f}),e.subscribe(6,({endClocks:d})=>{i.closeActive(d.relative)});const a=n.subscribe(({newLocation:d})=>{const f=i.find();if(f){const p=Oi();i.closeActive(p),i.add(c({url:d.href,referrer:f.referrer}),p)}});function c({url:d,referrer:f}){return{url:d,referrer:f}}return t.register(0,({startTime:d,eventType:f})=>{const p=i.find(d);return p?{type:f,view:{url:p.url,referrer:p.referrer}}:Zs}),{findUrl:d=>i.find(d),stop:()=>{a.unsubscribe(),i.stop()}}}function lae(e,t){let n=qm(t);return new Nt(r=>{const{stop:i}=cae(e,a),{stop:o}=uae(e,a);function a(){if(n.href===t.href)return;const c=qm(t);r.notify({newLocation:c,oldLocation:n}),n=c}return()=>{i(),o()}})}function cae(e,t){const{stop:n}=na(JO("pushState"),"pushState",({onPostCall:o})=>{o(t)}),{stop:r}=na(JO("replaceState"),"replaceState",({onPostCall:o})=>{o(t)}),{stop:i}=xn(e,window,"popstate",t);return{stop:()=>{n(),r(),i()}}}function uae(e,t){return xn(e,window,"hashchange",t)}function JO(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const dae=yc;function fae(e,t,n){const r=Bd({expireDelay:dae});return e.subscribe(1,({startClocks:i})=>{r.add({},i.relative)}),e.subscribe(6,({endClocks:i})=>{r.closeActive(i.relative)}),t.register(0,({startTime:i,eventType:o})=>{if(!n.trackFeatureFlagsForEvents.concat([gt.VIEW,gt.ERROR]).includes(o))return Di;const c=r.find(i);return!c||il(c)?Di:{type:o,feature_flags:c}}),{addFeatureFlagEvaluation:(i,o)=>{const a=r.find();a&&(a[i]=o)}}}const mae=10*Rr;let Yu,Mg;function pae(e,t,n){e.metricsEnabled&&(_4(),Mg=!1,t.subscribe(13,()=>{Mg=!0}),n.subscribe(({bytesCount:r,messagesCount:i})=>{Mg&&(Mg=!1,Yu.batchCount+=1,tD(Yu.batchBytesCount,r),tD(Yu.batchMessagesCount,i))}),Ud(hae,mae))}function hae(){Yu.batchCount!==0&&(ob("Customer data measures",Yu),_4())}function eD(){return{min:1/0,max:0,sum:0}}function tD(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function _4(){Yu={batchCount:0,batchBytesCount:eD(),batchMessagesCount:eD()}}const gae=4e3,vae=500,yae=yc;function bae(e,t,n=vae){const r=Bd({expireDelay:yae,maxEntries:gae});let i;wc(Dt.VISIBILITY_STATE)&&performance.getEntriesByType(Dt.VISIBILITY_STATE).forEach(f=>{const p=f.name==="hidden"?"hidden":"active";a(p,f.startTime)}),a(C4(),Oi());const{stop:o}=Ks(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],d=>{a(wae(d),d.timeStamp)},{capture:!0});function a(d,f=Oi()){d!==i&&(i=d,r.closeActive(f),r.add({state:i,startTime:f},f))}function c(d,f,p){return r.findAll(f,p).some(h=>h.state===d)}return e.register(0,({startTime:d,duration:f=0,eventType:p})=>{if(p===gt.VIEW){const h=r.findAll(d,f);return{type:p,_dd:{page_states:xae(h,d,n)}}}return p===gt.ACTION||p===gt.ERROR?{type:p,view:{in_foreground:c("active",d,0)}}:Di}),{wasInPageStateDuringPeriod:c,addPageState:a,stop:()=>{o(),r.stop()}}}function xae(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:r,startTime:i})=>({state:r,start:ht(Mn(t,i))}))}function wae(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":C4()}function C4(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function Sae(e,t){let n;const r=requestAnimationFrame(yt(()=>{n=ZC()})),i=Ooe(t).subscribe(o=>{n=o}).unsubscribe;return e.register(0,({eventType:o})=>({type:o,display:n?{viewport:n}:void 0})),{stop:()=>{i(),r&&cancelAnimationFrame(r)}}}function _ae(e,t){const n=window.cookieStore?Cae(e):kae;return new Nt(r=>n(t,i=>r.notify(i)))}function Cae(e){return(t,n)=>xn(e,window.cookieStore,"change",i=>{const o=i.changed.find(a=>a.name===t)||i.deleted.find(a=>a.name===t);o&&n(o.value)}).stop}const Eae=Rr;function kae(e,t){const n=Gm(document.cookie,e),r=Ud(()=>{const i=Gm(document.cookie,e);i!==n&&t(i)},Eae);return()=>{Qy(r)}}const nD="datadog-ci-visibility-test-execution-id";function jae(e,t,n=_ae(e,nD)){var r;let i=$s(nD)||((r=window.Cypress)===null||r===void 0?void 0:r.env("traceId"));const o=n.subscribe(a=>{i=a});return t.register(0,({eventType:a})=>typeof i!="string"?Di:{type:a,session:{type:"ci_test"},ci_test:{test_execution_id:i}}),{stop:()=>{o.unsubscribe()}}}function Rae(e,t){const n=aa(t,{type:Dt.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(r=>{for(const i of r){const o=Xy(i.startTime),a={date:o.timeStamp,long_task:{id:jr(),entry_type:Uz.LONG_ANIMATION_FRAME,duration:ht(i.duration),blocking_duration:ht(i.blockingDuration),first_ui_event_timestamp:ht(i.firstUIEventTimestamp),render_start:ht(i.renderStart),style_and_layout_start:ht(i.styleAndLayoutStart),start_time:ht(i.startTime),scripts:i.scripts.map(c=>({duration:ht(c.duration),pause_duration:ht(c.pauseDuration),forced_style_and_layout_duration:ht(c.forcedStyleAndLayoutDuration),start_time:ht(c.startTime),execution_start:ht(c.executionStart),source_url:c.sourceURL,source_function_name:c.sourceFunctionName,source_char_position:c.sourceCharPosition,invoker:c.invoker,invoker_type:c.invokerType,window_attribution:c.windowAttribution}))},type:gt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop:()=>n.unsubscribe()}}function Iae(e,t){const n=aa(t,{type:Dt.LONG_TASK,buffered:!0}).subscribe(r=>{for(const i of r){if(i.entryType!==Dt.LONG_TASK||!t.trackLongTasks)break;const o=Xy(i.startTime),a={date:o.timeStamp,long_task:{id:jr(),entry_type:Uz.LONG_TASK,duration:ht(i.duration)},type:gt.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:a,startTime:o.relative,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop(){n.unsubscribe()}}}function Tae(e){e.register(0,({eventType:t})=>{if(!Oz())return Di;const n=Nz(),r=Az();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:r,injected:Tz()}}})}function Nae(e,t,n){const r=LC(e),i=n(r);return $C(t).forEach(([o,a])=>Y_(e,r,o.split(/\.|(?=\[\])/),a)),i}function Y_(e,t,n,r){const[i,...o]=n;if(i==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((a,c)=>Y_(a,t[c],o,r));return}if(!(!rD(e)||!rD(t))){if(o.length>0)return Y_(e[i],t[i],o,r);Aae(e,i,t[i],r)}}function Aae(e,t,n,r){const i=bc(n);i===r?e[t]=ln(n):r==="object"&&(i==="undefined"||i==="null")&&(e[t]={})}function rD(e){return bc(e)==="object"}const ku={"view.name":"string","view.url":"string","view.referrer":"string"},ju={context:"object"},Ru={service:"string",version:"string"};let E4;function Oae(e,t,n,r){E4={[gt.VIEW]:{"view.performance.lcp.resource_url":"string",...ju,...ku,...Ru},[gt.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...ju,...ku,...Ru},[gt.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string",...ju,...ku,...Ru},[gt.ACTION]:{"action.target.name":"string",...ju,...ku,...Ru},[gt.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...ju,...ku,...Ru},[gt.VITAL]:{...ju,...ku,...Ru}};const i={[gt.ERROR]:oS(gt.ERROR,e.eventRateLimiterThreshold,r),[gt.ACTION]:oS(gt.ACTION,e.eventRateLimiterThreshold,r),[gt.VITAL]:oS(gt.VITAL,e.eventRateLimiterThreshold,r)};t.subscribe(12,({startTime:o,duration:a,rawRumEvent:c,domainContext:d})=>{const f=n.triggerHook(0,{eventType:c.type,startTime:o,duration:a});if(f===Zs)return;const p=qa(f,c,{ddtags:hz(e).join(",")});Dae(p,e.beforeSend,d,i)&&(il(p.context)&&delete p.context,t.notify(13,p))})}function Dae(e,t,n,r){var i;if(t){const a=Nae(e,E4[e.type],c=>t(c,n));if(a===!1&&e.type!==gt.VIEW)return!1;a===!1&&dt.warn("Can't dismiss view events using beforeSend!")}return!((i=r[e.type])===null||i===void 0?void 0:i.isLimitReached())}function $ae(e,t,n,r){e.register(0,({eventType:i,startTime:o})=>{const a=t.findTrackedSession(o),c=r.findView(o);if(!a||!c)return Zs;let d,f,p;return i===gt.VIEW?(d=n.getReplayStats(c.id)?!0:void 0,f=a.sessionReplay===1,p=c.sessionIsActive?void 0:!1):d=n.isRecording()?!0:void 0,{type:i,session:{id:a.id,type:"user",has_replay:d,sampled_for_replay:f,is_active:p}}}),e.register(1,({startTime:i})=>{const o=t.findTrackedSession(i);return o?{session:{id:o.id}}:Di})}function Mae(e){e.register(0,({eventType:t})=>({type:t,connectivity:vz()}))}function Pae(e,t,n){e.register(0,({eventType:r})=>{const i=t.source;return{type:r,_dd:{format_version:2,drift:aJ(),configuration:{session_sample_rate:Am(t.sessionSampleRate,3),session_replay_sample_rate:Am(t.sessionReplaySampleRate,3),profiling_sample_rate:Am(t.profilingSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:gd()?"6.24.0":void 0,sdk_name:n},application:{id:t.applicationId},date:vr(),source:i}}),e.register(1,()=>({application:{id:t.applicationId}}))}function zae(e,t){e.register(1,()=>t.isGranted()?Di:Zs)}const Lae=vte,Uae=[gt.ACTION,gt.ERROR,gt.LONG_TASK,gt.RESOURCE,gt.VITAL];function Fae(e){return{addEvent:(t,n,r,i)=>{Uae.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:r,duration:i})}}}function Vae(e,t){if(!t.metricsEnabled)return{stop:Ft};const{unsubscribe:n}=e.subscribe(4,({initialViewMetrics:r})=>{!r.largestContentfulPaint||!r.navigationTimings||(ob("Initial view metrics",{metrics:Bae(r.largestContentfulPaint,r.navigationTimings)}),n())});return{stop:n}}function Bae(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function Hae(e,t,n,r,i,o,a,c,d){const f=[],p=new pre,h=Lae();p.subscribe(13,ie=>gz("rum",ie));const v=ie=>{p.notify(14,{error:ie}),jp("Error reported to customer",{"error.message":ie.message})},y=hte(e),b=y.subscribe(ie=>{p.notify(11,ie)});f.push(()=>b.unsubscribe());const S=wte("browser-rum-sdk",e,h,v,y,i);f.push(S.stop);const C=gd()?tae():eae(e,p,o);if(gd())oae(p);else{const ie=iae(e,p,v,y,C.expireObservable,i);f.push(()=>ie.stop()),pae(S,p,ie.flushController.flushObservable)}const E=ure(),k=lae(e,location),{observable:j,stop:I}=fre();f.push(I),Pae(h,e,d);const A=bae(h,e),T=gre(p);f.push(()=>T.stop());const N=sae(p,h,k,location);f.push(()=>N.stop());const z=fae(p,h,e);$ae(h,C,t,T),Mae(h),zae(h,o);const L=vne(h,e,"rum"),K=yne(h,e,C,"rum"),J=gne(h,e,"rum"),{actionContexts:H,addAction:Y,addEvent:B,stop:W}=qae(p,h,e,A,E,j,v);f.push(W);const{addTiming:M,startView:Z,setViewName:U,setViewContext:te,setViewContextProperty:D,getViewContext:P,stop:F}=Woe(p,h,e,location,E,j,k,t,T,r);f.push(F);const{stop:O}=Vae(p,S);f.push(O);const{stop:ee}=Wie(p,e,A);if(f.push(ee),e.trackLongTasks)if(wc(Dt.LONG_ANIMATION_FRAME)){const{stop:ie}=Rae(p,e);f.push(ie)}else Iae(p,e);const{addError:ue}=Mie(p,e,c);c.unbuffer(),Ore(p,e,C,K,J);const pe=_ne(p,A,a),V=mre(e.applicationId,C,T,H,N);return f.push(()=>n.stop()),{addAction:Y,addEvent:B,addError:ue,addTiming:M,addFeatureFlagEvaluation:z.addFeatureFlagEvaluation,startView:Z,setViewContext:te,setViewContextProperty:D,getViewContext:P,setViewName:U,lifeCycle:p,viewHistory:T,session:C,stopSession:()=>C.expire(),getInternalContext:V.get,startDurationVital:pe.startDurationVital,stopDurationVital:pe.stopDurationVital,addDurationVital:pe.addDurationVital,addOperationStepVital:pe.addOperationStepVital,globalContext:L,userContext:K,accountContext:J,telemetry:S,stop:()=>{f.forEach(ie=>ie())},hooks:h}}function qae(e,t,n,r,i,o,a){const c=Oie(e,t,i,o,n),d=Fae(e),f=Sae(t,n),p=jae(n,t);return Tae(t),Oae(n,e,t,a),{pageStateHistory:r,addAction:c.addAction,addEvent:d.addEvent,actionContexts:c.actionContexts,stop:()=>{c.stop(),p.stop(),f.stop(),r.stop()}}}function Gae(e,{session:t,viewContext:n,errorType:r}){const i=t?t.id:"no-session-id",o=[];r!==void 0&&o.push(`error-type=${r}`),n&&(o.push(`seed=${n.id}`),o.push(`from=${n.startClocks.timeStamp}`));const a=Kae(e),c=`/rum/replay/sessions/${i}`;return`${a}${c}?${o.join("&")}`}function Kae(e){const t=e.site,n=e.subdomain||Zae(e);return`https://${n?`${n}.`:""}${t}`}function Zae(e){switch(e.site){case Ul:case eee:return"app";case az:return"dd";default:return}}const Yae=1e3;let Ji;function zNe(e){return ub(e).segments_count}function LNe(e){ub(e).segments_count+=1}function UNe(e){ub(e).records_count+=1}function FNe(e,t){ub(e).segments_total_raw_size+=t}function Wae(e){return Ji?.get(e)}function ub(e){Ji||(Ji=new Map);let t;return Ji.has(e)?t=Ji.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},Ji.set(e,t),Ji.size>Yae&&Xae()),t}function Xae(){if(!Ji)return;const e=Ji.keys().next().value;e&&Ji.delete(e)}function k4(e,t,n){let r=0,i=[],o,a=!0,c=0;const d=[],{stop:f}=xn(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const y=d[0];y&&(y.id===v.id?(d.shift(),r+=v.additionalBytesCount,i.push(v.result),o=v.trailer,y.writeCallback?y.writeCallback(v.result.byteLength):y.finishCallback&&y.finishCallback()):y.id<v.id&&f())});function p(){const v=i.length===0?new Uint8Array(0):LP(i.concat(o)),y={rawBytesCount:r,output:v,outputBytesCount:v.byteLength,encoding:"deflate"};return r=0,i=[],y}function h(){a||(t.postMessage({action:"reset",streamId:n}),a=!0)}return{isAsync:!0,get isEmpty(){return a},write(v,y){t.postMessage({action:"write",id:c,data:v,streamId:n}),d.push({id:c,writeCallback:y,data:v}),a=!1,c+=1},finish(v){h(),d.length?(d.forEach(y=>{delete y.writeCallback}),d[d.length-1].finishCallback=()=>v(p())):v(p())},finishSync(){h();const v=d.map(y=>y.data).join("");return d.length=0,{...p(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){f()}}}function YC({configuredUrl:e,error:t,source:n,scriptType:r}){if(dt.error(`${n} failed to start: an error occurred while initializing the ${r}:`,t),t instanceof Event||t instanceof Error&&Qae(t.message)){let i;e?i=`Please make sure the ${r} URL ${e} is correct and CSP is correctly configured.`:i="Please make sure CSP is correctly configured.",dt.error(`${i} See documentation at ${Wy}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else r==="worker"&&UC(t)}function Qae(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const Jae=30*Rr;function j4(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.24.0"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}let $n={status:0};function R4(e,t,n,r=j4){switch($n.status===0&&ese(e,t,r),$n.status){case 1:return $n.initializationFailureCallbacks.push(n),$n.worker;case 3:return $n.worker}}function iD(){return $n.status}function ese(e,t,n=j4){try{const r=n(e),{stop:i}=xn(e,r,"error",c=>{vS(e,t,c)}),{stop:o}=xn(e,r,"message",({data:c})=>{c.type==="errored"?vS(e,t,c.error,c.streamId):c.type==="initialized"&&nse(c.version)});r.postMessage({action:"init"}),Er(()=>tse(t),Jae),$n={status:1,worker:r,stop:()=>{i(),o()},initializationFailureCallbacks:[]}}catch(r){vS(e,t,r)}}function tse(e){$n.status===1&&(dt.error(`${e} failed to start: a timeout occurred while initializing the Worker`),$n.initializationFailureCallbacks.forEach(t=>t()),$n={status:2})}function nse(e){$n.status===1&&($n={status:3,worker:$n.worker,stop:$n.stop,version:e})}function vS(e,t,n,r){$n.status===1||$n.status===0?(YC({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),$n.status===1&&$n.initializationFailureCallbacks.forEach(i=>i()),$n={status:2}):UC(n,{worker_version:$n.status===3&&$n.version,stream_id:r})}function I4(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function rse(e,t,n,r){const i=t.findTrackedSession(),o=ise(i,r),a=n.findView();return Gae(e,{viewContext:a,errorType:o,session:i})}function ise(e,t){if(!I4())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function ose(e,t){if(!e.metricsEnabled)return{stop:Ft};let n,r,i;const{unsubscribe:o}=t.subscribe(a=>{switch(a.type){case"start":n={forced:a.forced,timestamp:vr()},r=void 0,i=void 0;break;case"document-ready":n&&(r=Mn(n.timestamp,vr()));break;case"recorder-settled":n&&(i=Mn(n.timestamp,vr()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":o(),n&&ob("Recorder init metrics",{metrics:ase(n.forced,i,Mn(n.timestamp,vr()),a.type,r)});break}});return{stop:o}}function ase(e,t,n,r,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:r,waitForDocReadyDuration:i}}function sse(e,t,n,r,i,o,a){let c=0,d;t.subscribe(9,()=>{(c===2||c===3)&&(v(),c=1)}),t.subscribe(10,()=>{c===1&&h()});const f=new Nt;ose(a,f);const p=async y=>{f.notify({type:"start",forced:y});const[b]=await Promise.all([oD(f,{type:"recorder-settled"},i()),oD(f,{type:"document-ready"},Hte(e,"interactive"))]);if(c!==2){f.notify({type:"aborted"});return}if(!b){c=0,f.notify({type:"recorder-load-failed"});return}const S=o();if(!S){c=0,f.notify({type:"deflate-encoder-load-failed"});return}({stop:d}=b(t,e,n,r,S,a)),c=3,f.notify({type:"succeeded"})};function h(y){const b=n.findTrackedSession();if(lse(b,y)){c=1;return}if(cse(c))return;c=2;const S=use(b,y)||!1;p(S).catch(qs),S&&n.setForcedReplay()}function v(){c===3&&d?.(),c=0}return{start:h,stop:v,getSessionReplayLink(){return rse(e,n,r,c!==0)},isRecording:()=>c===3}}function lse(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function cse(e){return e===2||e===3}function use(e,t){return t&&t.force&&e.sessionReplay===0}async function oD(e,t,n){try{return await n}finally{e.notify(t)}}function dse(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:Ft},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function fse(e,t){if(gd()&&!kz("records")||!I4())return{start:Ft,stop:Ft,getReplayStats:()=>{},onRumStart:Ft,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=dse();return{start:o=>n.start(o),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:i,isRecording:()=>iD()===3&&n.isRecording(),getReplayStats:o=>iD()===3?Wae(o):void 0};function i(o,a,c,d,f,p){let h;function v(){return h||(f??(f=R4(a,"Datadog Session Replay",()=>{n.stop()},t)),f&&(h=k4(a,f,1))),h}n=sse(a,o,c,d,e,v,p),r(a)&&n.start()}}const mse="modulepreload",pse=function(e){return"/"+e},aD={},Ip=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let d=function(f){return Promise.all(f.map(p=>Promise.resolve(p).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");i=d(n.map(f=>{if(f=pse(f),f in aD)return;aD[f]=!0;const p=f.endsWith(".css"),h=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${h}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":mse,p||(v.as="script"),v.crossOrigin="",v.href=f,c&&v.setAttribute("nonce",c),document.head.appendChild(v),p)return new Promise((y,b)=>{v.addEventListener("load",y),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};async function hse(e=gse){try{return await e()}catch(t){YC({error:t,source:"Recorder",scriptType:"module"})}}async function gse(){return(await Ip(()=>import("./startRecording-DFPWzJie.js"),[])).startRecording}function vse(){return fo().Profiler!==void 0}const yse=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==gt.VIEW&&n!==gt.LONG_TASK?Di:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function bse(e=xse){try{return await e()}catch(t){YC({error:t,source:"Profiler",scriptType:"module"})}}async function xse(){return(await Ip(()=>import("./profiler-B8q4d48d.js"),[])).createRumProfiler}function wse(){let e;function t(n,r,i,o,a,c){const d=o.findTrackedSession();if(!d||!Hz(d.id,i.profilingSampleRate))return;const f=yse(r);if(!vse()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}bse().then(p=>{if(!p){jp("[DD_RUM] Failed to lazy load the RUM Profiler"),f.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=p(i,n,o,f,c),e.start(a.findView())}).catch(qs)}return{onRumStart:t,stop:()=>{e?.stop().catch(qs)}}}const Sse=fse(hse),_se=wse(),Cse=lre(Hae,Sse,_se,{startDeflateWorker:R4,createDeflateEncoder:k4,sdkName:"rum"});qee(fo(),"DD_RUM",Cse);function Sv(e,t){Zm("react error"),er()}const sD={didCatch:!1,error:null};class VNe extends X.Component{constructor(t){super(t),this.resetError=()=>{this.setState(sD)},this.state=sD}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){Sv()}render(){return this.state.didCatch?X.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let lD=!1;function Ese(){x.useEffect(()=>{lD||(lD=!0)},[])}function kse(){return u.jsx(u.Fragment,{children:u.jsx(tl,{})})}const db=bY()({component:kse});function jse(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 126.644 96",width:24,height:24,children:u.jsx("path",{fill:"currentColor",d:"M81.15,0c-1.2376,2.1973-2.3489,4.4704-3.3591,6.794-9.5975-1.4396-19.3718-1.4396-28.9945,0-.985-2.3236-2.1216-4.5967-3.3591-6.794-9.0166,1.5407-17.8059,4.2431-26.1405,8.0568C2.779,32.5304-1.6914,56.3725.5312,79.8863c9.6732,7.1476,20.5083,12.603,32.0505,16.0884,2.6014-3.4854,4.8998-7.1981,6.8698-11.0623-3.738-1.3891-7.3497-3.1318-10.8098-5.1523.9092-.6567,1.7932-1.3386,2.6519-1.9953,20.281,9.547,43.7696,9.547,64.0758,0,.8587.7072,1.7427,1.3891,2.6519,1.9953-3.4601,2.0457-7.0718,3.7632-10.835,5.1776,1.97,3.8642,4.2683,7.5769,6.8698,11.0623,11.5419-3.4854,22.3769-8.9156,32.0509-16.0631,2.626-27.2771-4.496-50.9172-18.817-71.8548C98.9811,4.2684,90.1918,1.5659,81.1752.0505l-.0252-.0505ZM42.2802,65.4144c-6.2383,0-11.4159-5.6575-11.4159-12.6535s4.9755-12.6788,11.3907-12.6788,11.5169,5.708,11.4159,12.6788c-.101,6.9708-5.026,12.6535-11.3907,12.6535ZM84.3576,65.4144c-6.2637,0-11.3907-5.6575-11.3907-12.6535s4.9755-12.6788,11.3907-12.6788,11.4917,5.708,11.3906,12.6788c-.101,6.9708-5.026,12.6535-11.3906,12.6535Z"})})}function WC(){return u.jsxs(u.Fragment,{children:[u.jsx("img",{src:"/harper-studio_white.png",alt:"Harper Studio",className:"w-64 hidden md:inline-block"}),u.jsx("img",{src:"/HDBDogOnly.svg",width:"50px",height:"44px",alt:"Harper",className:"inline-block md:hidden"})]})}function Rse(e,t){const n=x.createContext(t),r=o=>{const{children:a,...c}=o,d=x.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:d,children:a})};r.displayName=e+"Provider";function i(o){const a=x.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Mi(e,t=[]){let n=[];function r(o,a){const c=x.createContext(a),d=n.length;n=[...n,a];const f=h=>{const{scope:v,children:y,...b}=h,S=v?.[e]?.[d]||c,C=x.useMemo(()=>b,Object.values(b));return u.jsx(S.Provider,{value:C,children:y})};f.displayName=o+"Provider";function p(h,v){const y=v?.[e]?.[d]||c,b=x.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[f,p]}const i=()=>{const o=n.map(a=>x.createContext(a));return function(c){const d=c?.[e]||o;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,Ise(i,...t)]}function Ise(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((c,{useScope:d,scopeName:f})=>{const h=d(o)[`__scope${f}`];return{...c,...h}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function je(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function vd(e){const t=Tse(e),n=x.forwardRef((r,i)=>{const{children:o,...a}=r,c=x.Children.toArray(o),d=c.find(Ase);if(d){const f=d.props.children,p=c.map(h=>h===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:h);return u.jsx(t,{...a,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return u.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Tse(e){const t=x.forwardRef((n,r)=>{const{children:i,...o}=n;if(x.isValidElement(i)){const a=Dse(i),c=Ose(o,i.props);return i.type!==x.Fragment&&(c.ref=r?zd(r,a):a),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var T4=Symbol("radix.slottable");function Nse(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=T4,t}function Ase(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===T4}function Ose(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...c)=>{const d=o(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Dse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var $se=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ge=$se.reduce((e,t)=>{const n=vd(`Primitive.${t}`),r=x.forwardRef((i,o)=>{const{asChild:a,...c}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Kv(e,t){e&&$d.flushSync(()=>e.dispatchEvent(t))}var qn=globalThis?.document?x.useLayoutEffect:()=>{},Mse=hC[" useInsertionEffect ".trim().toString()]||qn;function Ao({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=Pse({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const h=p.current;h!==c&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=x.useCallback(p=>{if(c){const h=zse(p)?p(e):p;h!==e&&a.current?.(h)}else o(p)},[c,e,o,a]);return[d,f]}function Pse({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),o=x.useRef(t);return Mse(()=>{o.current=t},[t]),x.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function zse(e){return typeof e=="function"}var Lse=x.createContext(void 0);function Sc(e){const t=x.useContext(Lse);return e||t||"ltr"}function Use(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Gn=e=>{const{present:t,children:n}=e,r=Fse(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),o=lt(r.ref,Vse(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:o}):null};Gn.displayName="Presence";function Fse(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),o=x.useRef("none"),a=e?"mounted":"unmounted",[c,d]=Use(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Pg(r.current);o.current=c==="mounted"?f:"none"},[c]),qn(()=>{const f=r.current,p=i.current;if(p!==e){const v=o.current,y=Pg(f);e?d("MOUNT"):y==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&v!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),qn(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,h=y=>{const S=Pg(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(d("ANIMATION_END"),!i.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=y=>{y.target===t&&(o.current=Pg(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Pg(e){return e?.animationName||"none"}function Vse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bse=hC[" useId ".trim().toString()]||(()=>{}),Hse=0;function Ti(e){const[t,n]=x.useState(Bse());return qn(()=>{n(r=>r??String(Hse++))},[e]),t?`radix-${t}`:""}function Tp(e){const t=e+"CollectionProvider",[n,r]=Mi(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=S=>{const{scope:C,children:E}=S,k=X.useRef(null),j=X.useRef(new Map).current;return u.jsx(i,{scope:C,itemMap:j,collectionRef:k,children:E})};a.displayName=t;const c=e+"CollectionSlot",d=vd(c),f=X.forwardRef((S,C)=>{const{scope:E,children:k}=S,j=o(c,E),I=lt(C,j.collectionRef);return u.jsx(d,{ref:I,children:k})});f.displayName=c;const p=e+"CollectionItemSlot",h="data-radix-collection-item",v=vd(p),y=X.forwardRef((S,C)=>{const{scope:E,children:k,...j}=S,I=X.useRef(null),A=lt(C,I),T=o(p,E);return X.useEffect(()=>(T.itemMap.set(I,{ref:I,...j}),()=>void T.itemMap.delete(I))),u.jsx(v,{[h]:"",ref:A,children:k})});y.displayName=p;function b(S){const C=o(e+"CollectionConsumer",S);return X.useCallback(()=>{const k=C.collectionRef.current;if(!k)return[];const j=Array.from(k.querySelectorAll(`[${h}]`));return Array.from(C.itemMap.values()).sort((T,N)=>j.indexOf(T.ref.current)-j.indexOf(N.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:f,ItemSlot:y},b,r]}function mn(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function qse(e,t=globalThis?.document){const n=mn(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Gse="DismissableLayer",W_="dismissableLayer.update",Kse="dismissableLayer.pointerDownOutside",Zse="dismissableLayer.focusOutside",cD,N4=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hd=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...d}=e,f=x.useContext(N4),[p,h]=x.useState(null),v=p?.ownerDocument??globalThis?.document,[,y]=x.useState({}),b=lt(t,N=>h(N)),S=Array.from(f.layers),[C]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(C),k=p?S.indexOf(p):-1,j=f.layersWithOutsidePointerEventsDisabled.size>0,I=k>=E,A=Xse(N=>{const z=N.target,L=[...f.branches].some(K=>K.contains(z));!I||L||(i?.(N),a?.(N),N.defaultPrevented||c?.())},v),T=Qse(N=>{const z=N.target;[...f.branches].some(K=>K.contains(z))||(o?.(N),a?.(N),N.defaultPrevented||c?.())},v);return qse(N=>{k===f.layers.size-1&&(r?.(N),!N.defaultPrevented&&c&&(N.preventDefault(),c()))},v),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(cD=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),uD(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=cD)}},[p,v,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),uD())},[p,f]),x.useEffect(()=>{const N=()=>y({});return document.addEventListener(W_,N),()=>document.removeEventListener(W_,N)},[]),u.jsx(Ge.div,{...d,ref:b,style:{pointerEvents:j?I?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,T.onFocusCapture),onBlurCapture:je(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,A.onPointerDownCapture)})});Hd.displayName=Gse;var Yse="DismissableLayerBranch",Wse=x.forwardRef((e,t)=>{const n=x.useContext(N4),r=x.useRef(null),i=lt(t,r);return x.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(Ge.div,{...e,ref:i})});Wse.displayName=Yse;function Xse(e,t=globalThis?.document){const n=mn(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const o=c=>{if(c.target&&!r.current){let d=function(){A4(Kse,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Qse(e,t=globalThis?.document){const n=mn(e),r=x.useRef(!1);return x.useEffect(()=>{const i=o=>{o.target&&!r.current&&A4(Zse,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function uD(){const e=new CustomEvent(W_);document.dispatchEvent(e)}function A4(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Kv(i,o):i.dispatchEvent(o)}function XC(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var O4=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Jse="VisuallyHidden",D4=x.forwardRef((e,t)=>u.jsx(Ge.span,{...e,ref:t,style:{...O4,...e.style}}));D4.displayName=Jse;var $4=D4,_c="NavigationMenu",[QC,M4,ele]=Tp(_c),[X_,tle,nle]=Tp(_c),[JC]=Mi(_c,[ele,nle]),[rle,mo]=JC(_c),[ile,ole]=JC(_c),P4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,delayDuration:a=200,skipDelayDuration:c=300,orientation:d="horizontal",dir:f,...p}=e,[h,v]=x.useState(null),y=lt(t,L=>v(L)),b=Sc(f),S=x.useRef(0),C=x.useRef(0),E=x.useRef(0),[k,j]=x.useState(!0),[I,A]=Ao({prop:r,onChange:L=>{const K=L!=="",J=c>0;K?(window.clearTimeout(E.current),J&&j(!1)):(window.clearTimeout(E.current),E.current=window.setTimeout(()=>j(!0),c)),i?.(L)},defaultProp:o??"",caller:_c}),T=x.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>A(""),150)},[A]),N=x.useCallback(L=>{window.clearTimeout(C.current),A(L)},[A]),z=x.useCallback(L=>{I===L?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),A(L)},a)},[I,A,a]);return x.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(E.current)},[]),u.jsx(z4,{scope:n,isRootMenu:!0,value:I,dir:b,orientation:d,rootNavigationMenu:h,onTriggerEnter:L=>{window.clearTimeout(S.current),k?z(L):N(L)},onTriggerLeave:()=>{window.clearTimeout(S.current),T()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:T,onItemSelect:L=>{A(K=>K===L?"":L)},onItemDismiss:()=>A(""),children:u.jsx(Ge.nav,{"aria-label":"Main","data-orientation":d,dir:b,...p,ref:y})})});P4.displayName=_c;var Q_="NavigationMenuSub",ale=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",...c}=e,d=mo(Q_,n),[f,p]=Ao({prop:r,onChange:i,defaultProp:o??"",caller:Q_});return u.jsx(z4,{scope:n,isRootMenu:!1,value:f,dir:d.dir,orientation:a,rootNavigationMenu:d.rootNavigationMenu,onTriggerEnter:h=>p(h),onItemSelect:h=>p(h),onItemDismiss:()=>p(""),children:u.jsx(Ge.div,{"data-orientation":a,...c,ref:t})})});ale.displayName=Q_;var z4=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:o,children:a,value:c,onItemSelect:d,onItemDismiss:f,onTriggerEnter:p,onTriggerLeave:h,onContentEnter:v,onContentLeave:y}=e,[b,S]=x.useState(null),[C,E]=x.useState(new Map),[k,j]=x.useState(null);return u.jsx(rle,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:c,previousValue:XC(c),baseId:Ti(),dir:i,orientation:o,viewport:b,onViewportChange:S,indicatorTrack:k,onIndicatorTrackChange:j,onTriggerEnter:mn(p),onTriggerLeave:mn(h),onContentEnter:mn(v),onContentLeave:mn(y),onItemSelect:mn(d),onItemDismiss:mn(f),onViewportContentChange:x.useCallback((I,A)=>{E(T=>(T.set(I,A),new Map(T)))},[]),onViewportContentRemove:x.useCallback(I=>{E(A=>A.has(I)?(A.delete(I),new Map(A)):A)},[]),children:u.jsx(QC.Provider,{scope:t,children:u.jsx(ile,{scope:t,items:C,children:a})})})},L4="NavigationMenuList",U4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=mo(L4,n),o=u.jsx(Ge.ul,{"data-orientation":i.orientation,...r,ref:t});return u.jsx(Ge.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:u.jsx(QC.Slot,{scope:n,children:i.isRootMenu?u.jsx(K4,{asChild:!0,children:o}):o})})});U4.displayName=L4;var F4="NavigationMenuItem",[sle,V4]=JC(F4),B4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,o=Ti(),a=r||o||"LEGACY_REACT_AUTO_VALUE",c=x.useRef(null),d=x.useRef(null),f=x.useRef(null),p=x.useRef(()=>{}),h=x.useRef(!1),v=x.useCallback((b="start")=>{if(c.current){p.current();const S=e1(c.current);S.length&&nE(b==="start"?S:S.reverse())}},[]),y=x.useCallback(()=>{if(c.current){const b=e1(c.current);b.length&&(p.current=vle(b))}},[]);return u.jsx(sle,{scope:n,value:a,triggerRef:d,contentRef:c,focusProxyRef:f,wasEscapeCloseRef:h,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:y,onContentFocusOutside:y,children:u.jsx(Ge.li,{...i,ref:t})})});B4.displayName=F4;var J_="NavigationMenuTrigger",lle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,o=mo(J_,e.__scopeNavigationMenu),a=V4(J_,e.__scopeNavigationMenu),c=x.useRef(null),d=lt(c,a.triggerRef,t),f=Y4(o.baseId,a.value),p=W4(o.baseId,a.value),h=x.useRef(!1),v=x.useRef(!1),y=a.value===o.value;return u.jsxs(u.Fragment,{children:[u.jsx(QC.ItemSlot,{scope:n,value:a.value,children:u.jsx(Z4,{asChild:!0,children:u.jsx(Ge.button,{id:f,disabled:r,"data-disabled":r?"":void 0,"data-state":rE(y),"aria-expanded":y,"aria-controls":p,...i,ref:d,onPointerEnter:je(e.onPointerEnter,()=>{v.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:je(e.onPointerMove,Zv(()=>{r||v.current||a.wasEscapeCloseRef.current||h.current||(o.onTriggerEnter(a.value),h.current=!0)})),onPointerLeave:je(e.onPointerLeave,Zv(()=>{r||(o.onTriggerLeave(),h.current=!1)})),onClick:je(e.onClick,()=>{o.onItemSelect(a.value),v.current=y}),onKeyDown:je(e.onKeyDown,b=>{const C={horizontal:"ArrowDown",vertical:o.dir==="rtl"?"ArrowLeft":"ArrowRight"}[o.orientation];y&&b.key===C&&(a.onEntryKeyDown(),b.preventDefault())})})})}),y&&u.jsxs(u.Fragment,{children:[u.jsx($4,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:b=>{const S=a.contentRef.current,C=b.relatedTarget,E=C===c.current,k=S?.contains(C);(E||!k)&&a.onFocusProxyEnter(E?"start":"end")}}),o.viewport&&u.jsx("span",{"aria-owns":p})]})]})});lle.displayName=J_;var cle="NavigationMenuLink",dD="navigationMenu.linkSelect",H4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...o}=e;return u.jsx(Z4,{asChild:!0,children:u.jsx(Ge.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...o,ref:t,onClick:je(e.onClick,a=>{const c=a.target,d=new CustomEvent(dD,{bubbles:!0,cancelable:!0});if(c.addEventListener(dD,f=>i?.(f),{once:!0}),Kv(c,d),!d.defaultPrevented&&!a.metaKey){const f=new CustomEvent(_v,{bubbles:!0,cancelable:!0});Kv(c,f)}},{checkForDefaultPrevented:!1})})})});H4.displayName=cle;var eE="NavigationMenuIndicator",ule=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mo(eE,e.__scopeNavigationMenu),o=!!i.value;return i.indicatorTrack?_C.createPortal(u.jsx(Gn,{present:n||o,children:u.jsx(dle,{...r,ref:t})}),i.indicatorTrack):null});ule.displayName=eE;var dle=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=mo(eE,n),o=M4(n),[a,c]=x.useState(null),[d,f]=x.useState(null),p=i.orientation==="horizontal",h=!!i.value;x.useEffect(()=>{const b=o().find(S=>S.value===i.value)?.ref.current;b&&c(b)},[o,i.value]);const v=()=>{a&&f({size:p?a.offsetWidth:a.offsetHeight,offset:p?a.offsetLeft:a.offsetTop})};return t1(a,v),t1(i.indicatorTrack,v),d?u.jsx(Ge.div,{"aria-hidden":!0,"data-state":h?"visible":"hidden","data-orientation":i.orientation,...r,ref:t,style:{position:"absolute",...p?{left:0,width:d.size+"px",transform:`translateX(${d.offset}px)`}:{top:0,height:d.size+"px",transform:`translateY(${d.offset}px)`},...r.style}}):null}),yd="NavigationMenuContent",fle=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=mo(yd,e.__scopeNavigationMenu),o=V4(yd,e.__scopeNavigationMenu),a=lt(o.contentRef,t),c=o.value===i.value,d={value:o.value,triggerRef:o.triggerRef,focusProxyRef:o.focusProxyRef,wasEscapeCloseRef:o.wasEscapeCloseRef,onContentFocusOutside:o.onContentFocusOutside,onRootContentClose:o.onRootContentClose,...r};return i.viewport?u.jsx(mle,{forceMount:n,...d,ref:a}):u.jsx(Gn,{present:n||c,children:u.jsx(q4,{"data-state":rE(c),...d,ref:a,onPointerEnter:je(e.onPointerEnter,i.onContentEnter),onPointerLeave:je(e.onPointerLeave,Zv(i.onContentLeave)),style:{pointerEvents:!c&&i.isRootMenu?"none":void 0,...d.style}})})});fle.displayName=yd;var mle=x.forwardRef((e,t)=>{const n=mo(yd,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return qn(()=>{r(e.value,{ref:t,...e})},[e,t,r]),qn(()=>()=>i(e.value),[e.value,i]),null}),_v="navigationMenu.rootContentDismiss",q4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:o,wasEscapeCloseRef:a,onRootContentClose:c,onContentFocusOutside:d,...f}=e,p=mo(yd,n),h=x.useRef(null),v=lt(h,t),y=Y4(p.baseId,r),b=W4(p.baseId,r),S=M4(n),C=x.useRef(null),{onItemDismiss:E}=p;x.useEffect(()=>{const j=h.current;if(p.isRootMenu&&j){const I=()=>{E(),c(),j.contains(document.activeElement)&&i.current?.focus()};return j.addEventListener(_v,I),()=>j.removeEventListener(_v,I)}},[p.isRootMenu,e.value,i,E,c]);const k=x.useMemo(()=>{const I=S().map(K=>K.value);p.dir==="rtl"&&I.reverse();const A=I.indexOf(p.value),T=I.indexOf(p.previousValue),N=r===p.value,z=T===I.indexOf(r);if(!N&&!z)return C.current;const L=(()=>{if(A!==T){if(N&&T!==-1)return A>T?"from-end":"from-start";if(z&&A!==-1)return A>T?"to-start":"to-end"}return null})();return C.current=L,L},[p.previousValue,p.value,p.dir,S,r]);return u.jsx(K4,{asChild:!0,children:u.jsx(Hd,{id:b,"aria-labelledby":y,"data-motion":k,"data-orientation":p.orientation,...f,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const j=new Event(_v,{bubbles:!0,cancelable:!0});h.current?.dispatchEvent(j)},onFocusOutside:je(e.onFocusOutside,j=>{d();const I=j.target;p.rootNavigationMenu?.contains(I)&&j.preventDefault()}),onPointerDownOutside:je(e.onPointerDownOutside,j=>{const I=j.target,A=S().some(N=>N.ref.current?.contains(I)),T=p.isRootMenu&&p.viewport?.contains(I);(A||T||!p.isRootMenu)&&j.preventDefault()}),onKeyDown:je(e.onKeyDown,j=>{const I=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!I){const T=e1(j.currentTarget),N=document.activeElement,z=T.findIndex(J=>J===N),K=j.shiftKey?T.slice(0,z).reverse():T.slice(z+1,T.length);nE(K)?j.preventDefault():o.current?.focus()}}),onEscapeKeyDown:je(e.onEscapeKeyDown,j=>{a.current=!0})})})}),tE="NavigationMenuViewport",G4=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=!!mo(tE,e.__scopeNavigationMenu).value;return u.jsx(Gn,{present:n||o,children:u.jsx(ple,{...r,ref:t})})});G4.displayName=tE;var ple=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,o=mo(tE,n),a=lt(t,o.onViewportChange),c=ole(yd,e.__scopeNavigationMenu),[d,f]=x.useState(null),[p,h]=x.useState(null),v=d?d?.width+"px":void 0,y=d?d?.height+"px":void 0,b=!!o.value,S=b?o.value:o.previousValue;return t1(p,()=>{p&&f({width:p.offsetWidth,height:p.offsetHeight})}),u.jsx(Ge.div,{"data-state":rE(b),"data-orientation":o.orientation,...i,ref:a,style:{pointerEvents:!b&&o.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":y,...i.style},onPointerEnter:je(e.onPointerEnter,o.onContentEnter),onPointerLeave:je(e.onPointerLeave,Zv(o.onContentLeave)),children:Array.from(c.items).map(([E,{ref:k,forceMount:j,...I}])=>{const A=S===E;return u.jsx(Gn,{present:j||A,children:u.jsx(q4,{...I,ref:zd(k,T=>{A&&T&&h(T)})})},E)})})}),hle="FocusGroup",K4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=mo(hle,n);return u.jsx(X_.Provider,{scope:n,children:u.jsx(X_.Slot,{scope:n,children:u.jsx(Ge.div,{dir:i.dir,...r,ref:t})})})}),fD=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],gle="FocusGroupItem",Z4=x.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=tle(n),o=mo(gle,n);return u.jsx(X_.ItemSlot,{scope:n,children:u.jsx(Ge.button,{...r,ref:t,onKeyDown:je(e.onKeyDown,a=>{if(["Home","End",...fD].includes(a.key)){let d=i().map(h=>h.ref.current);if([o.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&d.reverse(),fD.includes(a.key)){const h=d.indexOf(a.currentTarget);d=d.slice(h+1)}setTimeout(()=>nE(d)),a.preventDefault()}})})})});function e1(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nE(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function vle(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function t1(e,t){const n=mn(t);qn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}function rE(e){return e?"open":"closed"}function Y4(e,t){return`${e}-trigger-${t}`}function W4(e,t){return`${e}-content-${t}`}function Zv(e){return t=>t.pointerType==="mouse"?e(t):void 0}var yle=P4,ble=U4,xle=B4,wle=H4,Sle=G4;function _le({className:e,...t}){return u.jsx("div",{className:ze("absolute top-full left-0 isolate z-50 flex justify-center"),children:u.jsx(Sle,{"data-slot":"navigation-menu-viewport",className:ze("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function X4({className:e,children:t,viewport:n=!0,...r}){return u.jsxs(yle,{"data-slot":"navigation-menu","data-viewport":n,className:ze("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...r,children:[t,n&&u.jsx(_le,{})]})}function n1({className:e,...t}){return u.jsx(xle,{"data-slot":"navigation-menu-item",className:ze("relative",e),...t})}function r1({className:e,...t}){return u.jsx(wle,{"data-slot":"navigation-menu-link",className:ze("hover:text-white ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Q4({className:e,...t}){return u.jsx(ble,{"data-slot":"navigation-menu-list",className:ze("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}const J4=Zy("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-auto",{variants:{variant:{default:"border-primary bg-primary/40 text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-secondary bg-secondary/40 text-secondary-foreground [a&]:hover:bg-secondary/90",warning:"border-yellow bg-yellow/40 text-white [a&]:hover:bg-yellow/90",success:"border-green bg-green/40 text-white [a&]:hover:bg-green/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"text-white [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function iE(){return u.jsx("a",{href:"https://github.com/HarperFast/studio/releases",target:"_blank",rel:"noopener noreferrer",children:u.jsxs("span",{className:ze(J4({variant:"default"}),"text-xs inline-block ml-2 align-text-top"),children:["v4.7.9"," BETA"]})})}function fb(e,t,n){const{instanceId:r,clusterId:i}=et({strict:!1});return Gl({id:En,operationsUrl:e,port:t,secure:n})}function mb(e,t,n){const{instanceId:r,clusterId:i}=et({strict:!1});return{instanceClient:Gl({id:En,operationsUrl:e,port:t,secure:n}),entityType:"instance"}}function Yt(e,t,n){const r=et({strict:!1});return eL({...r,operationsUrl:e,port:t,secure:n})}function eL({instanceId:e,clusterId:t,operationsUrl:n,port:r,secure:i}){const o=En;return{instanceClient:Gl({id:o,operationsUrl:n,port:r,secure:i}),entityId:o,entityType:"instance"}}function Cle(){localStorage.clear()}function Ele(){sessionStorage.clear()}async function kle(){kn.setUserForEntity(En,null),Vv.getQueryCache().clear(),Cle(),Ele(),await Vv.invalidateQueries({refetchType:"none"})}async function jle(e){await kn.signOutFromPotentiallyAuthenticatedInstances(),await yp({...e,entityId:En})}function Rle(){const e=fb();return ft({mutationFn:()=>jle({instanceClient:e}),onSuccess:kle})}function pb(e){const{user:t}=hc(),{organizationId:n}=et({strict:!1}),r=t?.roles?.[e??n];return!r?.permission&&!r?.organization?{update:!1,remove:!1}:r.permission?.super_user?{update:!0,remove:!0}:{update:r.organization.update,remove:r.organization.delete}}function qd(e){const{user:t}=hc(),{organizationId:n}=et({strict:!1}),r=t?.roles?.[e??n];if(!r?.permission&&!r?.organization?.roles)return{create:!1,remove:!1,update:!1,view:!1};if(r.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const i=r.organization.roles;return{create:i.create,remove:i.delete,update:i.update,view:i.view}}function hb(e,t){const{user:n}=hc(),{organizationId:r,clusterId:i}=et({strict:!1}),o=t??i,a=n?.roles?.[e??r];if(!a?.permission&&!a?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(a.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const c=a.organization.clusters.resources?.find(f=>f.id===o),d=a.organization.clusters;return{create:d.create,remove:c?c.delete:d.delete,update:c?c.update:d.update,view:c?c.view:d.view}}function Ile(e){const{clusterId:t,instanceId:n}=et({strict:!1}),{user:r}=Wa(),i=r?.role?.permission;return i?i.super_user===!0:!1}function Gd(e){const{clusterId:t,instanceId:n}=et({strict:!1}),{user:r}=Wa(),i=r?.role?.permission;return i?i.super_user===!0||i.structure_user===!0:!1}function yS(e,t,n,r){const{clusterId:i,instanceId:o}=et({strict:!1}),{user:a}=Wa(),c=a?.role?.permission;return c?c.super_user===!0||c.structure_user===!0?!0:c[t]?.tables?.[n][r]===!0:!1}const oE={className:"text-white"};function tL(){const{mutate:e}=Rle(),t=pn(),{user:n}=pc(),r=tn(),{organizationId:i}=et({strict:!1}),{update:o}=pb(i),{view:a}=qd(i),c=o,d=x.useCallback(()=>{e(void 0,{onSuccess:async()=>{Ee.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),t({to:"/sign-in"}),r.invalidate()}})},[e,r,t]),f=x.useMemo(()=>[!qu,!qu,!qu,{to:"https://docs.harperdb.io/docs",target:"_blank",icon:u.jsx(yP,{}),text:"Docs",textBreakpoint:"md"},{to:"https://github.com/HarperFast/studio/issues",target:"_blank",icon:u.jsx(BW,{}),text:"Report an Issue",textBreakpoint:"lg"},{to:"https://discord.gg/VzZuaw3Xay",target:"_blank",icon:u.jsx(jse,{}),text:"Discord",textBreakpoint:"lg"},{onClick:d,icon:u.jsx(BX,{}),text:"Sign Out",textBreakpoint:"md"}].filter(ua),[i,c,a,d]);return n?u.jsxs(u.Fragment,{children:[u.jsx(Ale,{menuItems:f}),u.jsx(Nle,{menuItems:f})]}):u.jsx(Tle,{})}function nL(e){return e.items!==void 0}function Tle(){return u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(We,{to:"/sign-in",children:u.jsx(WC,{})}),u.jsx(iE,{})]}),u.jsx(X4,{children:u.jsxs(Q4,{className:"text-grey-400",children:[u.jsx(n1,{children:u.jsx(r1,{asChild:!0,children:u.jsxs(We,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[u.jsx(yP,{})," ",u.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),u.jsx(n1,{children:u.jsx(r1,{asChild:!0,children:u.jsxs(We,{to:"/sign-in",className:"flex-row items-center",activeProps:oE,children:[u.jsx(LX,{})," Sign In"]})})})]})})]})}function Nle({menuItems:e}){const{user:t}=pc();return vc(t),u.jsx("div",{className:"hidden md:block",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"inline-block",children:[u.jsx(We,{to:el,children:u.jsx(WC,{})}),u.jsx(iE,{})]}),u.jsx(X4,{children:u.jsx(Q4,{className:"text-grey-400",children:e.map(n=>nL(n)?!!n.items.length&&u.jsx("div",{className:"bg-black rounded-2xl flex",children:n.items.map(r=>u.jsx(mD,{menuItem:r},r.text))},n.text):u.jsx(mD,{menuItem:n},n.text))})})]})})}function mD({menuItem:e}){return u.jsx(n1,{className:"text-gray-400 hover:text-white",children:u.jsx(r1,{asChild:!0,children:u.jsxs(We,{to:e.to,onClick:e.onClick,className:"flex-row items-center",target:e.target,activeProps:e.to?oE:void 0,children:[e.icon,u.jsx("span",{className:`hidden ${e.textBreakpoint}:inline-block`,children:e.text}),u.jsx("span",{className:`${e.textBreakpoint}:hidden`,children:" "})]})})})}function Ale({menuItems:e}){const{user:t}=pc();vc(t);const[n,r]=x.useState(!1),i=x.useCallback(()=>r(a=>!a),[]),o=x.useCallback(()=>r(!1),[]);return u.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(We,{to:el,children:u.jsx(WC,{})}),u.jsx(iE,{}),u.jsxs("button",{type:"button",className:"shadow-xs text-grey-400 hover:text-white hover:bg-black-dark",onClick:i,children:[u.jsx("span",{className:"sr-only",children:n?"Close menu":"Open menu"}),n?u.jsx(AP,{}):u.jsx(jP,{})]})]}),u.jsx("div",{className:`${n?"fixed":"hidden"} top-40 bottom-0 left-0 right-0 bg-black-dark opacity-70`,onClick:o}),u.jsx("div",{className:`${n?"block":"hidden"} md:hidden z-50 space-y-1 pb-3 bg-black-dark absolute left-0 top-full w-full rounded-b-md`,children:e.map(a=>nL(a)?!!a.items.length&&u.jsx("div",{className:"bg-black pl-10 pr-2 py-2",children:a.items.map(c=>u.jsx(pD,{menuItem:c,onClick:o},c.text))},a.text):u.jsx(pD,{menuItem:a,onClick:o},a.text))})]})}function pD({menuItem:e,onClick:t}){const n=x.useCallback(()=>{e.onClick?.(),t()},[e,t]);return u.jsxs(We,{to:e.to,onClick:n,target:e.target,className:"flex flex-row px-3 py-2 text-base font-medium rounded-md text-gray-400 hover:text-white",activeProps:e.to?oE:void 0,children:[e.icon,u.jsx("span",{className:"ml-4",children:e.text})]})}function cm({title:e,children:t}){return u.jsxs("li",{className:"list-image-(--checkmark-icon) mt-4",children:[u.jsx("h3",{className:"text-xl font-bold",children:e}),t]})}function Ole(){return u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:u.jsx(tL,{})}),u.jsxs("div",{className:"pt-20 grid h-screen grid-cols-1 md:grid-cols-2",children:[u.jsx("section",{className:"items-center justify-center hidden text-white md:flex bg-linear-(--blue-pink-gradient) px-6",children:u.jsxs("div",{children:[u.jsx("h1",{className:"text-4xl font-bold",children:"Harper Fabric"}),u.jsxs("ul",{className:"ps-5",children:[u.jsx(cm,{title:"Free Tier",children:u.jsx("span",{children:"Try us out, no credit card required!"})}),u.jsx(cm,{title:"Global Deployments Managed as One",children:u.jsx("span",{children:"Coordinate global environments as if they were a single node."})}),u.jsx(cm,{title:"Database, App, Cache, & Messaging",children:u.jsx("span",{children:"Bring your stack together for reliable, ultra-fast performance."})}),u.jsx(cm,{title:"NoSQL, Vector, & Blob",children:u.jsx("span",{children:"Store and serve modern data types with low latency, semantic search ability, and global reach."})}),u.jsx(cm,{title:"Simplified Operations",children:u.jsx("span",{children:"Focus on what differentiates your app; leave infrastructure to us."})})]}),u.jsx("span",{className:"opacity-5",children:"Bravo!"})]})}),u.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:u.jsx(tl,{})})]})]})}function Dle(){x.useEffect(()=>{},[])}const $le=["gmail.com","yahoo.com","hotmail.com","outlook.com","icloud.com","aol.com","protonmail.com","mail.com","zoho.com","yandex.com","gmx.com","live.com","msn.com","me.com","inbox.com"];function aE(e){if(!e||!e.includes("@"))return null;const t=e.split("@").pop()||"";if(!t)return null;for(const n of $le)if(t===n||t.endsWith("."+n))return null;return t}let bS=null;function Mle(){const e=pn(),t=tn(),n=ur(),{redirect:r}=yr({strict:!1});return x.useEffect(()=>{bS||(bS=(async function(){const i=await DM().catch(()=>null);if(!i)Ee.error("We were not able to verify your sign-in. Please try signing in again.",{duration:1e4}),await e({to:"/sign-in"});else{kn.setUserForEntity(En,i);const o=vc(i);aE(i.email),await n.invalidateQueries({queryKey:vp,refetchType:"none"}),await t.invalidate(),await e({to:r?.startsWith("/")?r:o})}bS=null})())},[]),u.jsxs("div",{className:"text-white w-lg flex flex-col gap-4",children:[u.jsxs("h1",{className:"text-3xl font-light",children:[u.jsx("span",{"aria-hidden":"true",className:"text-2xl animate-flower-dance mr-4",title:"Loading",children:"🌼"}),"Checking..."]}),u.jsx("div",{className:"underline flex gap-4",children:u.jsx(We,{className:"text-sm opacity-50 hover:text-blue-300",to:"/sign-in",children:"Try signing in again"})})]})}const Ple=["top","right","bottom","left"],Ys=Math.min,ki=Math.max,Yv=Math.round,zg=Math.floor,ra=e=>({x:e,y:e}),zle={left:"right",right:"left",bottom:"top",top:"bottom"},Lle={start:"end",end:"start"};function i1(e,t,n){return ki(e,Ys(t,n))}function Ka(e,t){return typeof e=="function"?e(t):e}function Za(e){return e.split("-")[0]}function Kd(e){return e.split("-")[1]}function sE(e){return e==="x"?"y":"x"}function lE(e){return e==="y"?"height":"width"}const Ule=new Set(["top","bottom"]);function Jo(e){return Ule.has(Za(e))?"y":"x"}function cE(e){return sE(Jo(e))}function Fle(e,t,n){n===void 0&&(n=!1);const r=Kd(e),i=cE(e),o=lE(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Wv(a)),[a,Wv(a)]}function Vle(e){const t=Wv(e);return[o1(e),t,o1(t)]}function o1(e){return e.replace(/start|end/g,t=>Lle[t])}const hD=["left","right"],gD=["right","left"],Ble=["top","bottom"],Hle=["bottom","top"];function qle(e,t,n){switch(e){case"top":case"bottom":return n?t?gD:hD:t?hD:gD;case"left":case"right":return t?Ble:Hle;default:return[]}}function Gle(e,t,n,r){const i=Kd(e);let o=qle(Za(e),n==="start",r);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(o1)))),o}function Wv(e){return e.replace(/left|right|bottom|top/g,t=>zle[t])}function Kle(e){return{top:0,right:0,bottom:0,left:0,...e}}function rL(e){return typeof e!="number"?Kle(e):{top:e,right:e,bottom:e,left:e}}function Xv(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function vD(e,t,n){let{reference:r,floating:i}=e;const o=Jo(t),a=cE(t),c=lE(a),d=Za(t),f=o==="y",p=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,v=r[c]/2-i[c]/2;let y;switch(d){case"top":y={x:p,y:r.y-i.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:h};break;case"left":y={x:r.x-i.width,y:h};break;default:y={x:r.x,y:r.y}}switch(Kd(t)){case"start":y[a]-=v*(n&&f?-1:1);break;case"end":y[a]+=v*(n&&f?-1:1);break}return y}const Zle=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),d=await(a.isRTL==null?void 0:a.isRTL(t));let f=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:h}=vD(f,r,d),v=r,y={},b=0;for(let S=0;S<c.length;S++){const{name:C,fn:E}=c[S],{x:k,y:j,data:I,reset:A}=await E({x:p,y:h,initialPlacement:r,placement:v,strategy:i,middlewareData:y,rects:f,platform:a,elements:{reference:e,floating:t}});p=k??p,h=j??h,y={...y,[C]:{...y[C],...I}},A&&b<=50&&(b++,typeof A=="object"&&(A.placement&&(v=A.placement),A.rects&&(f=A.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:p,y:h}=vD(f,v,d)),S=-1)}return{x:p,y:h,placement:v,strategy:i,middlewareData:y}};async function Xm(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:a,elements:c,strategy:d}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:v=!1,padding:y=0}=Ka(t,e),b=rL(y),C=c[v?h==="floating"?"reference":"floating":h],E=Xv(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:d})),k=h==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),I=await(o.isElement==null?void 0:o.isElement(j))?await(o.getScale==null?void 0:o.getScale(j))||{x:1,y:1}:{x:1,y:1},A=Xv(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:k,offsetParent:j,strategy:d}):k);return{top:(E.top-A.top+b.top)/I.y,bottom:(A.bottom-E.bottom+b.bottom)/I.y,left:(E.left-A.left+b.left)/I.x,right:(A.right-E.right+b.right)/I.x}}const Yle=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:c,middlewareData:d}=t,{element:f,padding:p=0}=Ka(e,t)||{};if(f==null)return{};const h=rL(p),v={x:n,y:r},y=cE(i),b=lE(y),S=await a.getDimensions(f),C=y==="y",E=C?"top":"left",k=C?"bottom":"right",j=C?"clientHeight":"clientWidth",I=o.reference[b]+o.reference[y]-v[y]-o.floating[b],A=v[y]-o.reference[y],T=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f));let N=T?T[j]:0;(!N||!await(a.isElement==null?void 0:a.isElement(T)))&&(N=c.floating[j]||o.floating[b]);const z=I/2-A/2,L=N/2-S[b]/2-1,K=Ys(h[E],L),J=Ys(h[k],L),H=K,Y=N-S[b]-J,B=N/2-S[b]/2+z,W=i1(H,B,Y),M=!d.arrow&&Kd(i)!=null&&B!==W&&o.reference[b]/2-(B<H?K:J)-S[b]/2<0,Z=M?B<H?B-H:B-Y:0;return{[y]:v[y]+Z,data:{[y]:W,centerOffset:B-W-Z,...M&&{alignmentOffset:Z}},reset:M}}}),Wle=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:c,platform:d,elements:f}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:S=!0,...C}=Ka(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=Za(i),k=Jo(c),j=Za(c)===c,I=await(d.isRTL==null?void 0:d.isRTL(f.floating)),A=v||(j||!S?[Wv(c)]:Vle(c)),T=b!=="none";!v&&T&&A.push(...Gle(c,S,b,I));const N=[c,...A],z=await Xm(t,C),L=[];let K=((r=o.flip)==null?void 0:r.overflows)||[];if(p&&L.push(z[E]),h){const B=Fle(i,a,I);L.push(z[B[0]],z[B[1]])}if(K=[...K,{placement:i,overflows:L}],!L.every(B=>B<=0)){var J,H;const B=(((J=o.flip)==null?void 0:J.index)||0)+1,W=N[B];if(W&&(!(h==="alignment"?k!==Jo(W):!1)||K.every(U=>Jo(U.placement)===k?U.overflows[0]>0:!0)))return{data:{index:B,overflows:K},reset:{placement:W}};let M=(H=K.filter(Z=>Z.overflows[0]<=0).sort((Z,U)=>Z.overflows[1]-U.overflows[1])[0])==null?void 0:H.placement;if(!M)switch(y){case"bestFit":{var Y;const Z=(Y=K.filter(U=>{if(T){const te=Jo(U.placement);return te===k||te==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(te=>te>0).reduce((te,D)=>te+D,0)]).sort((U,te)=>U[1]-te[1])[0])==null?void 0:Y[0];Z&&(M=Z);break}case"initialPlacement":M=c;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function yD(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bD(e){return Ple.some(t=>e[t]>=0)}const Xle=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=Ka(e,t);switch(r){case"referenceHidden":{const o=await Xm(t,{...i,elementContext:"reference"}),a=yD(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:bD(a)}}}case"escaped":{const o=await Xm(t,{...i,altBoundary:!0}),a=yD(o,n.floating);return{data:{escapedOffsets:a,escaped:bD(a)}}}default:return{}}}}},iL=new Set(["left","top"]);async function Qle(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=Za(n),c=Kd(n),d=Jo(n)==="y",f=iL.has(a)?-1:1,p=o&&d?-1:1,h=Ka(t,e);let{mainAxis:v,crossAxis:y,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof b=="number"&&(y=c==="end"?b*-1:b),d?{x:y*p,y:v*f}:{x:v*f,y:y*p}}const Jle=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:c}=t,d=await Qle(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:o+d.y,data:{...d,placement:a}}}}},ece=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:C=>{let{x:E,y:k}=C;return{x:E,y:k}}},...d}=Ka(e,t),f={x:n,y:r},p=await Xm(t,d),h=Jo(Za(i)),v=sE(h);let y=f[v],b=f[h];if(o){const C=v==="y"?"top":"left",E=v==="y"?"bottom":"right",k=y+p[C],j=y-p[E];y=i1(k,y,j)}if(a){const C=h==="y"?"top":"left",E=h==="y"?"bottom":"right",k=b+p[C],j=b-p[E];b=i1(k,b,j)}const S=c.fn({...t,[v]:y,[h]:b});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:o,[h]:a}}}}}},tce=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:c=0,mainAxis:d=!0,crossAxis:f=!0}=Ka(e,t),p={x:n,y:r},h=Jo(i),v=sE(h);let y=p[v],b=p[h];const S=Ka(c,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const j=v==="y"?"height":"width",I=o.reference[v]-o.floating[j]+C.mainAxis,A=o.reference[v]+o.reference[j]-C.mainAxis;y<I?y=I:y>A&&(y=A)}if(f){var E,k;const j=v==="y"?"width":"height",I=iL.has(Za(i)),A=o.reference[h]-o.floating[j]+(I&&((E=a.offset)==null?void 0:E[h])||0)+(I?0:C.crossAxis),T=o.reference[h]+o.reference[j]+(I?0:((k=a.offset)==null?void 0:k[h])||0)-(I?C.crossAxis:0);b<A?b=A:b>T&&(b=T)}return{[v]:y,[h]:b}}}},nce=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:a,elements:c}=t,{apply:d=()=>{},...f}=Ka(e,t),p=await Xm(t,f),h=Za(i),v=Kd(i),y=Jo(i)==="y",{width:b,height:S}=o.floating;let C,E;h==="top"||h==="bottom"?(C=h,E=v===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(E=h,C=v==="end"?"top":"bottom");const k=S-p.top-p.bottom,j=b-p.left-p.right,I=Ys(S-p[C],k),A=Ys(b-p[E],j),T=!t.middlewareData.shift;let N=I,z=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=j),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=k),T&&!v){const K=ki(p.left,0),J=ki(p.right,0),H=ki(p.top,0),Y=ki(p.bottom,0);y?z=b-2*(K!==0||J!==0?K+J:ki(p.left,p.right)):N=S-2*(H!==0||Y!==0?H+Y:ki(p.top,p.bottom))}await d({...t,availableWidth:z,availableHeight:N});const L=await a.getDimensions(c.floating);return b!==L.width||S!==L.height?{reset:{rects:!0}}:{}}}};function gb(){return typeof window<"u"}function Zd(e){return oL(e)?(e.nodeName||"").toLowerCase():"#document"}function Ni(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function da(e){var t;return(t=(oL(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function oL(e){return gb()?e instanceof Node||e instanceof Ni(e).Node:!1}function Oo(e){return gb()?e instanceof Element||e instanceof Ni(e).Element:!1}function sa(e){return gb()?e instanceof HTMLElement||e instanceof Ni(e).HTMLElement:!1}function xD(e){return!gb()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ni(e).ShadowRoot}const rce=new Set(["inline","contents"]);function Np(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Do(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!rce.has(i)}const ice=new Set(["table","td","th"]);function oce(e){return ice.has(Zd(e))}const ace=[":popover-open",":modal"];function vb(e){return ace.some(t=>{try{return e.matches(t)}catch{return!1}})}const sce=["transform","translate","scale","rotate","perspective"],lce=["transform","translate","scale","rotate","perspective","filter"],cce=["paint","layout","strict","content"];function uE(e){const t=dE(),n=Oo(e)?Do(e):e;return sce.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||lce.some(r=>(n.willChange||"").includes(r))||cce.some(r=>(n.contain||"").includes(r))}function uce(e){let t=Ws(e);for(;sa(t)&&!bd(t);){if(uE(t))return t;if(vb(t))return null;t=Ws(t)}return null}function dE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const dce=new Set(["html","body","#document"]);function bd(e){return dce.has(Zd(e))}function Do(e){return Ni(e).getComputedStyle(e)}function yb(e){return Oo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ws(e){if(Zd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xD(e)&&e.host||da(e);return xD(t)?t.host:t}function aL(e){const t=Ws(e);return bd(t)?e.ownerDocument?e.ownerDocument.body:e.body:sa(t)&&Np(t)?t:aL(t)}function Qm(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=aL(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=Ni(i);if(o){const c=a1(a);return t.concat(a,a.visualViewport||[],Np(i)?i:[],c&&n?Qm(c):[])}return t.concat(i,Qm(i,[],n))}function a1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sL(e){const t=Do(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=sa(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,c=Yv(n)!==o||Yv(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function fE(e){return Oo(e)?e:e.contextElement}function Wu(e){const t=fE(e);if(!sa(t))return ra(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=sL(t);let a=(o?Yv(n.width):n.width)/r,c=(o?Yv(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const fce=ra(0);function lL(e){const t=Ni(e);return!dE()||!t.visualViewport?fce:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function mce(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ni(e)?!1:t}function ac(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=fE(e);let a=ra(1);t&&(r?Oo(r)&&(a=Wu(r)):a=Wu(e));const c=mce(o,n,r)?lL(o):ra(0);let d=(i.left+c.x)/a.x,f=(i.top+c.y)/a.y,p=i.width/a.x,h=i.height/a.y;if(o){const v=Ni(o),y=r&&Oo(r)?Ni(r):r;let b=v,S=a1(b);for(;S&&r&&y!==b;){const C=Wu(S),E=S.getBoundingClientRect(),k=Do(S),j=E.left+(S.clientLeft+parseFloat(k.paddingLeft))*C.x,I=E.top+(S.clientTop+parseFloat(k.paddingTop))*C.y;d*=C.x,f*=C.y,p*=C.x,h*=C.y,d+=j,f+=I,b=Ni(S),S=a1(b)}}return Xv({width:p,height:h,x:d,y:f})}function bb(e,t){const n=yb(e).scrollLeft;return t?t.left+n:ac(da(e)).left+n}function cL(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-bb(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function pce(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",a=da(r),c=t?vb(t.floating):!1;if(r===a||c&&o)return n;let d={scrollLeft:0,scrollTop:0},f=ra(1);const p=ra(0),h=sa(r);if((h||!h&&!o)&&((Zd(r)!=="body"||Np(a))&&(d=yb(r)),sa(r))){const y=ac(r);f=Wu(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const v=a&&!h&&!o?cL(a,d):ra(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+p.x+v.x,y:n.y*f.y-d.scrollTop*f.y+p.y+v.y}}function hce(e){return Array.from(e.getClientRects())}function gce(e){const t=da(e),n=yb(e),r=e.ownerDocument.body,i=ki(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ki(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+bb(e);const c=-n.scrollTop;return Do(r).direction==="rtl"&&(a+=ki(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:c}}const wD=25;function vce(e,t){const n=Ni(e),r=da(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,d=0;if(i){o=i.width,a=i.height;const p=dE();(!p||p&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}const f=bb(r);if(f<=0){const p=r.ownerDocument,h=p.body,v=getComputedStyle(h),y=p.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,b=Math.abs(r.clientWidth-h.clientWidth-y);b<=wD&&(o-=b)}else f<=wD&&(o+=f);return{width:o,height:a,x:c,y:d}}const yce=new Set(["absolute","fixed"]);function bce(e,t){const n=ac(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=sa(e)?Wu(e):ra(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,d=i*o.x,f=r*o.y;return{width:a,height:c,x:d,y:f}}function SD(e,t,n){let r;if(t==="viewport")r=vce(e,n);else if(t==="document")r=gce(da(e));else if(Oo(t))r=bce(t,n);else{const i=lL(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Xv(r)}function uL(e,t){const n=Ws(e);return n===t||!Oo(n)||bd(n)?!1:Do(n).position==="fixed"||uL(n,t)}function xce(e,t){const n=t.get(e);if(n)return n;let r=Qm(e,[],!1).filter(c=>Oo(c)&&Zd(c)!=="body"),i=null;const o=Do(e).position==="fixed";let a=o?Ws(e):e;for(;Oo(a)&&!bd(a);){const c=Do(a),d=uE(a);!d&&c.position==="fixed"&&(i=null),(o?!d&&!i:!d&&c.position==="static"&&!!i&&yce.has(i.position)||Np(a)&&!d&&uL(e,a))?r=r.filter(p=>p!==a):i=c,a=Ws(a)}return t.set(e,r),r}function wce(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?vb(t)?[]:xce(t,this._c):[].concat(n),r],c=a[0],d=a.reduce((f,p)=>{const h=SD(t,p,i);return f.top=ki(h.top,f.top),f.right=Ys(h.right,f.right),f.bottom=Ys(h.bottom,f.bottom),f.left=ki(h.left,f.left),f},SD(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Sce(e){const{width:t,height:n}=sL(e);return{width:t,height:n}}function _ce(e,t,n){const r=sa(t),i=da(t),o=n==="fixed",a=ac(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const d=ra(0);function f(){d.x=bb(i)}if(r||!r&&!o)if((Zd(t)!=="body"||Np(i))&&(c=yb(t)),r){const y=ac(t,!0,o,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else i&&f();o&&!r&&i&&f();const p=i&&!r&&!o?cL(i,c):ra(0),h=a.left+c.scrollLeft-d.x-p.x,v=a.top+c.scrollTop-d.y-p.y;return{x:h,y:v,width:a.width,height:a.height}}function xS(e){return Do(e).position==="static"}function _D(e,t){if(!sa(e)||Do(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return da(e)===n&&(n=n.ownerDocument.body),n}function dL(e,t){const n=Ni(e);if(vb(e))return n;if(!sa(e)){let i=Ws(e);for(;i&&!bd(i);){if(Oo(i)&&!xS(i))return i;i=Ws(i)}return n}let r=_D(e,t);for(;r&&oce(r)&&xS(r);)r=_D(r,t);return r&&bd(r)&&xS(r)&&!uE(r)?n:r||uce(e)||n}const Cce=async function(e){const t=this.getOffsetParent||dL,n=this.getDimensions,r=await n(e.floating);return{reference:_ce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ece(e){return Do(e).direction==="rtl"}const kce={convertOffsetParentRelativeRectToViewportRelativeRect:pce,getDocumentElement:da,getClippingRect:wce,getOffsetParent:dL,getElementRects:Cce,getClientRects:hce,getDimensions:Sce,getScale:Wu,isElement:Oo,isRTL:Ece};function fL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function jce(e,t){let n=null,r;const i=da(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),o();const f=e.getBoundingClientRect(),{left:p,top:h,width:v,height:y}=f;if(c||t(),!v||!y)return;const b=zg(h),S=zg(i.clientWidth-(p+v)),C=zg(i.clientHeight-(h+y)),E=zg(p),j={rootMargin:-b+"px "+-S+"px "+-C+"px "+-E+"px",threshold:ki(0,Ys(1,d))||1};let I=!0;function A(T){const N=T[0].intersectionRatio;if(N!==d){if(!I)return a();N?a(!1,N):r=setTimeout(()=>{a(!1,1e-7)},1e3)}N===1&&!fL(f,e.getBoundingClientRect())&&a(),I=!1}try{n=new IntersectionObserver(A,{...j,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,j)}n.observe(e)}return a(!0),o}function Rce(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,f=fE(e),p=i||o?[...f?Qm(f):[],...Qm(t)]:[];p.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const h=f&&c?jce(f,n):null;let v=-1,y=null;a&&(y=new ResizeObserver(E=>{let[k]=E;k&&k.target===f&&y&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var j;(j=y)==null||j.observe(t)})),n()}),f&&!d&&y.observe(f),y.observe(t));let b,S=d?ac(e):null;d&&C();function C(){const E=ac(e);S&&!fL(S,E)&&n(),S=E,b=requestAnimationFrame(C)}return n(),()=>{var E;p.forEach(k=>{i&&k.removeEventListener("scroll",n),o&&k.removeEventListener("resize",n)}),h?.(),(E=y)==null||E.disconnect(),y=null,d&&cancelAnimationFrame(b)}}const Ice=Jle,Tce=ece,Nce=Wle,Ace=nce,Oce=Xle,CD=Yle,Dce=tce,$ce=(e,t,n)=>{const r=new Map,i={platform:kce,...n},o={...i.platform,_c:r};return Zle(e,t,{...i,platform:o})};var Mce=typeof document<"u",Pce=function(){},Cv=Mce?x.useLayoutEffect:Pce;function Qv(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Qv(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!Qv(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function mL(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ED(e,t){const n=mL(e);return Math.round(t*n)/n}function wS(e){const t=x.useRef(e);return Cv(()=>{t.current=e}),t}function zce(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:d,open:f}=e,[p,h]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=x.useState(r);Qv(v,r)||y(r);const[b,S]=x.useState(null),[C,E]=x.useState(null),k=x.useCallback(U=>{U!==T.current&&(T.current=U,S(U))},[]),j=x.useCallback(U=>{U!==N.current&&(N.current=U,E(U))},[]),I=o||b,A=a||C,T=x.useRef(null),N=x.useRef(null),z=x.useRef(p),L=d!=null,K=wS(d),J=wS(i),H=wS(f),Y=x.useCallback(()=>{if(!T.current||!N.current)return;const U={placement:t,strategy:n,middleware:v};J.current&&(U.platform=J.current),$ce(T.current,N.current,U).then(te=>{const D={...te,isPositioned:H.current!==!1};B.current&&!Qv(z.current,D)&&(z.current=D,$d.flushSync(()=>{h(D)}))})},[v,t,n,J,H]);Cv(()=>{f===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,h(U=>({...U,isPositioned:!1})))},[f]);const B=x.useRef(!1);Cv(()=>(B.current=!0,()=>{B.current=!1}),[]),Cv(()=>{if(I&&(T.current=I),A&&(N.current=A),I&&A){if(K.current)return K.current(I,A,Y);Y()}},[I,A,Y,K,L]);const W=x.useMemo(()=>({reference:T,floating:N,setReference:k,setFloating:j}),[k,j]),M=x.useMemo(()=>({reference:I,floating:A}),[I,A]),Z=x.useMemo(()=>{const U={position:n,left:0,top:0};if(!M.floating)return U;const te=ED(M.floating,p.x),D=ED(M.floating,p.y);return c?{...U,transform:"translate("+te+"px, "+D+"px)",...mL(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:D}},[n,c,M.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:Y,refs:W,elements:M,floatingStyles:Z}),[p,Y,W,M,Z])}const Lce=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?CD({element:r.current,padding:i}).fn(n):{}:r?CD({element:r,padding:i}).fn(n):{}}}},Uce=(e,t)=>({...Ice(e),options:[e,t]}),Fce=(e,t)=>({...Tce(e),options:[e,t]}),Vce=(e,t)=>({...Dce(e),options:[e,t]}),Bce=(e,t)=>({...Nce(e),options:[e,t]}),Hce=(e,t)=>({...Ace(e),options:[e,t]}),qce=(e,t)=>({...Oce(e),options:[e,t]}),Gce=(e,t)=>({...Lce(e),options:[e,t]});var Kce="Arrow",pL=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return u.jsx(Ge.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});pL.displayName=Kce;var Zce=pL;function hL(e){const[t,n]=x.useState(void 0);return qn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,c;if("borderBoxSize"in o){const d=o.borderBoxSize,f=Array.isArray(d)?d[0]:d;a=f.inlineSize,c=f.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var mE="Popper",[gL,Yd]=Mi(mE),[Yce,vL]=gL(mE),yL=e=>{const{__scopePopper:t,children:n}=e,[r,i]=x.useState(null);return u.jsx(Yce,{scope:t,anchor:r,onAnchorChange:i,children:n})};yL.displayName=mE;var bL="PopperAnchor",xL=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=vL(bL,n),a=x.useRef(null),c=lt(t,a),d=x.useRef(null);return x.useEffect(()=>{const f=d.current;d.current=r?.current||a.current,f!==d.current&&o.onAnchorChange(d.current)}),r?null:u.jsx(Ge.div,{...i,ref:c})});xL.displayName=bL;var pE="PopperContent",[Wce,Xce]=gL(pE),wL=x.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:b,...S}=e,C=vL(pE,n),[E,k]=x.useState(null),j=lt(t,V=>k(V)),[I,A]=x.useState(null),T=hL(I),N=T?.width??0,z=T?.height??0,L=r+(o!=="center"?"-"+o:""),K=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},J=Array.isArray(f)?f:[f],H=J.length>0,Y={padding:K,boundary:J.filter(Jce),altBoundary:H},{refs:B,floatingStyles:W,placement:M,isPositioned:Z,middlewareData:U}=zce({strategy:"fixed",placement:L,whileElementsMounted:(...V)=>Rce(...V,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[Uce({mainAxis:i+z,alignmentAxis:a}),d&&Fce({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Vce():void 0,...Y}),d&&Bce({...Y}),Hce({...Y,apply:({elements:V,rects:ie,availableWidth:we,availableHeight:Ie})=>{const{width:Ue,height:Pe}=ie.reference,Ze=V.floating.style;Ze.setProperty("--radix-popper-available-width",`${we}px`),Ze.setProperty("--radix-popper-available-height",`${Ie}px`),Ze.setProperty("--radix-popper-anchor-width",`${Ue}px`),Ze.setProperty("--radix-popper-anchor-height",`${Pe}px`)}}),I&&Gce({element:I,padding:c}),eue({arrowWidth:N,arrowHeight:z}),v&&qce({strategy:"referenceHidden",...Y})]}),[te,D]=CL(M),P=mn(b);qn(()=>{Z&&P?.()},[Z,P]);const F=U.arrow?.x,O=U.arrow?.y,ee=U.arrow?.centerOffset!==0,[ue,pe]=x.useState();return qn(()=>{E&&pe(window.getComputedStyle(E).zIndex)},[E]),u.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:Z?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[U.transformOrigin?.x,U.transformOrigin?.y].join(" "),...U.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(Wce,{scope:n,placedSide:te,onArrowChange:A,arrowX:F,arrowY:O,shouldHideArrow:ee,children:u.jsx(Ge.div,{"data-side":te,"data-align":D,...S,ref:j,style:{...S.style,animation:Z?void 0:"none"}})})})});wL.displayName=pE;var SL="PopperArrow",Qce={top:"bottom",right:"left",bottom:"top",left:"right"},_L=x.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Xce(SL,r),a=Qce[o.placedSide];return u.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:u.jsx(Zce,{...i,ref:n,style:{...i.style,display:"block"}})})});_L.displayName=SL;function Jce(e){return e!==null}var eue=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,c=a?0:e.arrowWidth,d=a?0:e.arrowHeight,[f,p]=CL(n),h={start:"0%",center:"50%",end:"100%"}[p],v=(i.arrow?.x??0)+c/2,y=(i.arrow?.y??0)+d/2;let b="",S="";return f==="bottom"?(b=a?h:`${v}px`,S=`${-d}px`):f==="top"?(b=a?h:`${v}px`,S=`${r.floating.height+d}px`):f==="right"?(b=`${-d}px`,S=a?h:`${y}px`):f==="left"&&(b=`${r.floating.width+d}px`,S=a?h:`${y}px`),{data:{x:b,y:S}}}});function CL(e){const[t,n="center"]=e.split("-");return[t,n]}var hE=yL,gE=xL,vE=wL,yE=_L,tue="Portal",Ap=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=x.useState(!1);qn(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?_C.createPortal(u.jsx(Ge.div,{...r,ref:t}),a):null});Ap.displayName=tue;var[xb]=Mi("Tooltip",[Yd]),wb=Yd(),EL="TooltipProvider",nue=700,s1="tooltip.open",[rue,bE]=xb(EL),kL=e=>{const{__scopeTooltip:t,delayDuration:n=nue,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,a=x.useRef(!0),c=x.useRef(!1),d=x.useRef(0);return x.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),u.jsx(rue,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(d.current),a.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:x.useCallback(f=>{c.current=f},[]),disableHoverableContent:i,children:o})};kL.displayName=EL;var Jm="Tooltip",[iue,Op]=xb(Jm),jL=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:c}=e,d=bE(Jm,e.__scopeTooltip),f=wb(t),[p,h]=x.useState(null),v=Ti(),y=x.useRef(0),b=a??d.disableHoverableContent,S=c??d.delayDuration,C=x.useRef(!1),[E,k]=Ao({prop:r,defaultProp:i??!1,onChange:N=>{N?(d.onOpen(),document.dispatchEvent(new CustomEvent(s1))):d.onClose(),o?.(N)},caller:Jm}),j=x.useMemo(()=>E?C.current?"delayed-open":"instant-open":"closed",[E]),I=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,k(!0)},[k]),A=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,k(!1)},[k]),T=x.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,k(!0),y.current=0},S)},[S,k]);return x.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),u.jsx(hE,{...f,children:u.jsx(iue,{scope:t,contentId:v,open:E,stateAttribute:j,trigger:p,onTriggerChange:h,onTriggerEnter:x.useCallback(()=>{d.isOpenDelayedRef.current?T():I()},[d.isOpenDelayedRef,T,I]),onTriggerLeave:x.useCallback(()=>{b?A():(window.clearTimeout(y.current),y.current=0)},[A,b]),onOpen:I,onClose:A,disableHoverableContent:b,children:n})})};jL.displayName=Jm;var l1="TooltipTrigger",RL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Op(l1,n),o=bE(l1,n),a=wb(n),c=x.useRef(null),d=lt(t,c,i.onTriggerChange),f=x.useRef(!1),p=x.useRef(!1),h=x.useCallback(()=>f.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),u.jsx(gE,{asChild:!0,...a,children:u.jsx(Ge.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:je(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:je(e.onPointerDown,()=>{i.open&&i.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:je(e.onFocus,()=>{f.current||i.onOpen()}),onBlur:je(e.onBlur,i.onClose),onClick:je(e.onClick,i.onClose)})})});RL.displayName=l1;var xE="TooltipPortal",[oue,aue]=xb(xE,{forceMount:void 0}),IL=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Op(xE,t);return u.jsx(oue,{scope:t,forceMount:n,children:u.jsx(Gn,{present:n||o.open,children:u.jsx(Ap,{asChild:!0,container:i,children:r})})})};IL.displayName=xE;var xd="TooltipContent",TL=x.forwardRef((e,t)=>{const n=aue(xd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=Op(xd,e.__scopeTooltip);return u.jsx(Gn,{present:r||a.open,children:a.disableHoverableContent?u.jsx(NL,{side:i,...o,ref:t}):u.jsx(sue,{side:i,...o,ref:t})})}),sue=x.forwardRef((e,t)=>{const n=Op(xd,e.__scopeTooltip),r=bE(xd,e.__scopeTooltip),i=x.useRef(null),o=lt(t,i),[a,c]=x.useState(null),{trigger:d,onClose:f}=n,p=i.current,{onPointerInTransitChange:h}=r,v=x.useCallback(()=>{c(null),h(!1)},[h]),y=x.useCallback((b,S)=>{const C=b.currentTarget,E={x:b.clientX,y:b.clientY},k=due(E,C.getBoundingClientRect()),j=fue(E,k),I=mue(S.getBoundingClientRect()),A=hue([...j,...I]);c(A),h(!0)},[h]);return x.useEffect(()=>()=>v(),[v]),x.useEffect(()=>{if(d&&p){const b=C=>y(C,p),S=C=>y(C,d);return d.addEventListener("pointerleave",b),p.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",b),p.removeEventListener("pointerleave",S)}}},[d,p,y,v]),x.useEffect(()=>{if(a){const b=S=>{const C=S.target,E={x:S.clientX,y:S.clientY},k=d?.contains(C)||p?.contains(C),j=!pue(E,a);k?v():j&&(v(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[d,p,a,f,v]),u.jsx(NL,{...e,ref:o})}),[lue,cue]=xb(Jm,{isInside:!1}),uue=Nse("TooltipContent"),NL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...c}=e,d=Op(xd,n),f=wb(n),{onClose:p}=d;return x.useEffect(()=>(document.addEventListener(s1,p),()=>document.removeEventListener(s1,p)),[p]),x.useEffect(()=>{if(d.trigger){const h=v=>{v.target?.contains(d.trigger)&&p()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[d.trigger,p]),u.jsx(Hd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:p,children:u.jsxs(vE,{"data-state":d.stateAttribute,...f,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(uue,{children:r}),u.jsx(lue,{scope:n,isInside:!0,children:u.jsx($4,{id:d.contentId,role:"tooltip",children:i||r})})]})})});TL.displayName=xd;var AL="TooltipArrow",OL=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=wb(n);return cue(AL,n).isInside?null:u.jsx(yE,{...i,...r,ref:t})});OL.displayName=AL;function due(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function fue(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function mue(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function pue(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],d=t[a],f=c.x,p=c.y,h=d.x,v=d.y;p>r!=v>r&&n<(h-f)*(r-p)/(v-p)+f&&(i=!i)}return i}function hue(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),gue(t)}function gue(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var vue=kL,yue=jL,bue=RL,xue=IL,wue=TL,Sue=OL;function _ue({delayDuration:e=0,...t}){return u.jsx(vue,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function wE({...e}){return u.jsx(_ue,{children:u.jsx(yue,{"data-slot":"tooltip",...e})})}function SE({...e}){return u.jsx(bue,{"data-slot":"tooltip-trigger",...e})}function _E({className:e,sideOffset:t=0,arrowClassName:n,children:r,...i}){return u.jsx(xue,{children:u.jsxs(wue,{"data-slot":"tooltip-content",sideOffset:t,className:ze("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...i,children:[r,u.jsx(Sue,{className:ze("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",n)})]})})}function ep({width:e,className:t,animated:n,placeholder:r}){return u.jsxs("div",{className:ia("w-full bg-gray-200 rounded-full relative",r?"h-6":"h-2.5"),children:[r&&u.jsx("div",{className:"absolute top-0 h-full w-full font-bold text-xs flex flex-col items-center justify-center text-black/60 text-shadow-2xs",children:r}),u.jsx("div",{className:ia("rounded-full",r?"h-6":"h-2.5",!t?.includes("bg-")&&"bg-purple/40",n&&"transition-[width] duration-1000 ease-in-out motion-reduce:transition-none",t),style:{width:e}})]})}async function CE(e){const{data:t}=await Vt.get(`/Cluster/${e}`);return t}function Cc(e,t){return{queryKey:[e],queryFn:()=>CE(e),retry:!1,enabled:!!e,refetchInterval:t?t===!0?1e4:t:void 0}}async function Cue(e,t=3,n=1e3){let r=0;if(t<=0)throw new Error("retries must be greater than 0");let i;for(;r<t;)try{return await e()}catch(o){if(r++,i=o,r===t)break;await bp(n)}throw i}async function DL({operation:e,replicated:t,instanceClient:n}){const{data:r}=await n.post("/",{operation:e,service:e==="restart_service"?"http":void 0,replicated:t});return await bp(1e4),await Cue(()=>sd({instanceClient:n,timeout:3e3}),12,15e3),r}function Eue(){return ft({mutationFn:DL})}function kue({onRestartedSuccessfully:e}={}){const{clusterId:t}=et({strict:!1}),n=ur(),[r,i]=x.useState(!1);return{onRestartClick:x.useCallback(async()=>{if(!t)throw new Error("clusterId must be set in the route to invoke useRestartClusterClick");i(!0);let a=!1;const c={duration:6e4,action:{label:"Cancel",onClick:()=>{a=!0}}},d=Ee.loading("Restarting",{...c,description:u.jsx(ep,{animated:!0,width:"0%"})}),p=(await CE(t))?.instances??[],h=p.filter(y=>y.status==="RUNNING").map(y=>Gl({id:y.id,operationsUrl:vC(y)})).reverse();let v=0;if(h.length)for(let y=0;y<h.length;y++){const b=h[y];if(!a){Ee.loading(`Restarting Instance ${y+1} of ${h.length}`,{...c,id:d,description:u.jsx(ep,{animated:!0,width:(y===0?0:y/h.length*100)+"%"})});try{await sd({instanceClient:b}),await DL({operation:"restart",replicated:!1,instanceClient:b}),v+=1}catch{y+1!==h.length&&(Ee.loading(`Failed Restarting Instance ${y+1} of ${h.length}`,{...c,id:d,description:"We will carry on momentarily."}),await bp(3e3))}}}if(i(!1),n.invalidateQueries({queryKey:[t]}),a)Ee.error("Cancelled",{id:d,description:"The restart was partially cancelled.",duration:1e4,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}});else if(p.length===v)e?.(),Ee.success("Success",{id:d,description:"Cluster fully restarted!",duration:1e4,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}});else{const y=jo(p.length,"instance","instances"),b=jo(v,'"RUNNING" instance was','"RUNNING" instances were');Ee.error("Error",{id:d,description:`Failed to fully restart cluster.
39
39
  `+([p.length===0&&"No instances were found within the cluster to restart.",v===0&&`No instances were in a "RUNNING" state of ${y}.`,p.length!==v&&`Only ${b} restarted of ${y}.`].filter(ua).shift()||""),duration:1e4,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}})}},[t,e,n]),isRestartPending:r}}function jue({operation:e,instanceClient:t,onRestartedSuccessfully:n}){const{clusterId:r,instanceId:i}=et({strict:!1}),o="Instance",{mutate:a,isPending:c}=Eue(),d=ur();return{onRestartClick:x.useCallback(()=>{const p=Ee.loading("Restarting",{description:`Restarting ${o.toLowerCase()}. This may take up to 60 seconds.`,duration:18e4,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}});a({operation:e,replicated:e==="restart_service"&&o==="Cluster",instanceClient:t},{onSuccess:()=>{d.invalidateQueries({queryKey:[r]}),d.invalidateQueries({queryKey:[i]}),Ee.dismiss(p),Ee.success("Success",{description:`${o} restarted!`,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),n?.()},onError:()=>{Ee.dismiss(p),Ee.error("Error",{description:`Failed to restart ${o.toLowerCase()}.`,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}})}})},[r,t,i,n,e,d,a,o]),isRestartPending:c}}function EE({className:e,disabled:t,hideText:n,instanceClient:r,operation:i,targetNoun:o,tooltip:a,variant:c}){const{onRestartClick:d,isRestartPending:f}=kue(),{onRestartClick:p,isRestartPending:h}=jue({operation:i,instanceClient:r});return u.jsxs(wE,{children:[u.jsx(SE,{asChild:!0,children:u.jsxs(Se,{variant:c||"positiveOutline",className:ia("mx-0 md:mx-4 rounded-full",e),onClick:o==="Cluster"&&i==="restart"?d:p,disabled:t||h||f,children:[u.jsx(lQ,{}),n!==!0&&u.jsxs("span",{className:"hidden md:inline-block",children:["Restart ",o]})]})}),u.jsx(_E,{children:a||(i==="restart_service"?"Restarts all service threads to apply changes. No downtime expected. Performance may be briefly slower during restart.":"This fully restarts the Harper service and causes downtime.")})]})}const um=new Map;function So(e){if(!e)return"";if(um.has(e))return um.get(e);const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return um.set(e,""),"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return um.set(e,""),"";const r=[];for(let a=0;a<n.length;a++){const c=n[a],d=a+1<n.length?n[a+1]:void 0;/^[A-Z]{2,}$/.test(c)&&d&&/[A-Z]*s$/.test(d)||/^[A-Z]$/.test(c)&&d!==void 0&&/^[A-Z]s$/.test(d)?(r.push(c+d),a++):r.push(c)}const o=r.map(Rue).join(" ");return um.set(e,o),o}function Rue(e){return/^[A-Z]{2,3}s?$/.test(e)||/^[0-9]+$/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}function Sb({restartRequired:e}){const t=DY(),{organization:n,instance:r,cluster:i}=Ky({strict:!1}),o=x.useMemo(()=>{const a=t.pathname.split("/").filter(d=>d&&d.length>0),c=[u.jsxs(We,{to:"/",children:[u.jsx(AX,{"aria-hidden":"true",className:"size-5 shrink-0"}),u.jsx("span",{className:"sr-only",children:"Home"})]})];for(let d=0;d<a.length;d++){const f=a[d];if(f==="instance")continue;let p=`/${a.slice(0,d+1).join("/")}`,h=So(f),v;f==="databases"&&a.length===d+3?(h=a[d+2],d+=2):h.startsWith("Org ")?h=n?.name||"Org":h.startsWith("Clu ")?(h=i?.name||"Cluster",a[d+1]==="instance"&&(p+="/instances")):h.startsWith("Ins ")?h=r?.name?.split(".")?.shift()||"Instance":h==="Apis"&&(h="APIs"),c.push(u.jsx("svg",{fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",className:"size-5 shrink-0 text-grey",children:u.jsx("path",{d:"M5.555 17.776l8-16 .894.448-8 16-.894-.448z"})}),u.jsxs(We,{to:p,className:"text-xs md:text-sm font-medium hover:text-grey truncate max-w-48",children:[h,v]}))}return c},[t.pathname,i?.name,r?.name,n?.name]);return u.jsxs("div",{role:"list",className:"flex items-center space-x-2 xl:space-x-4 sm:max-w-9/10 max-w-[calc(100%-56px)]",children:[...o,e&&u.jsx(Iue,{})]})}function Iue(){const{instanceId:e}=et({strict:!1}),t="Instance",n=Yt();return u.jsx(EE,{className:"animate-glow-pulse",targetNoun:t,instanceClient:n.instanceClient,operation:"restart",hideText:!0,tooltip:`This ${t} is requesting a restart, when convenient, to apply your latest changes.`})}var Dp=e=>e.type==="checkbox",Fl=e=>e instanceof Date,ai=e=>e==null;const $L=e=>typeof e=="object";var Hn=e=>!ai(e)&&!Array.isArray(e)&&$L(e)&&!Fl(e),ML=e=>Hn(e)&&e.target?Dp(e.target)?e.target.checked:e.target.value:e,Tue=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,PL=(e,t)=>e.has(Tue(t)),Nue=e=>{const t=e.constructor&&e.constructor.prototype;return Hn(t)&&t.hasOwnProperty("isPrototypeOf")},kE=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function sn(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(kE&&(e instanceof Blob||r))&&(n||Hn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!Nue(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=sn(e[i]));else return e;return t}var _b=e=>/^\w*$/.test(e),Jt=e=>e===void 0,Cb=e=>Array.isArray(e)?e.filter(Boolean):[],jE=e=>Cb(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Te=(e,t,n)=>{if(!t||!Hn(e))return n;const r=(_b(t)?[t]:jE(t)).reduce((i,o)=>ai(i)?i:i[o],e);return Jt(r)||r===e?Jt(e[t])?n:e[t]:r},Ci=e=>typeof e=="boolean",Mt=(e,t,n)=>{let r=-1;const i=_b(t)?[t]:jE(t),o=i.length,a=o-1;for(;++r<o;){const c=i[r];let d=n;if(r!==a){const f=e[c];d=Hn(f)||Array.isArray(f)?f:isNaN(+i[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;e[c]=d,e=e[c]}};const Jv={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},no={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Oa={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},RE=X.createContext(null);RE.displayName="HookFormContext";const $p=()=>X.useContext(RE),Aue=e=>{const{children:t,...n}=e;return X.createElement(RE.Provider,{value:n},t)};var zL=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const a=o;return t._proxyFormState[a]!==no.all&&(t._proxyFormState[a]=!r||no.all),n&&(n[a]=!0),e[a]}});return i};const Eb=typeof window<"u"?X.useLayoutEffect:X.useEffect;function IE(e){const t=$p(),{control:n=t.control,disabled:r,name:i,exact:o}=e||{},[a,c]=X.useState(n._formState),d=X.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Eb(()=>n._subscribe({name:i,formState:d.current,exact:o,callback:f=>{!r&&c({...n._formState,...f})}}),[i,r,o]),X.useEffect(()=>{d.current.isValid&&n._setValid(!0)},[n]),X.useMemo(()=>zL(a,n,d.current,!1),[a,n])}var ji=e=>typeof e=="string",LL=(e,t,n,r,i)=>ji(e)?(r&&t.watch.add(e),Te(n,e,i)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),Te(n,o))):(r&&(t.watchAll=!0),n),c1=e=>ai(e)||!$L(e);function za(e,t,n=new WeakSet){if(c1(e)||c1(t))return e===t;if(Fl(e)&&Fl(t))return e.getTime()===t.getTime();const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const o of r){const a=e[o];if(!i.includes(o))return!1;if(o!=="ref"){const c=t[o];if(Fl(a)&&Fl(c)||Hn(a)&&Hn(c)||Array.isArray(a)&&Array.isArray(c)?!za(a,c,n):a!==c)return!1}}return!0}function Oue(e){const t=$p(),{control:n=t.control,name:r,defaultValue:i,disabled:o,exact:a,compute:c}=e||{},d=X.useRef(i),f=X.useRef(c),p=X.useRef(void 0);f.current=c;const h=X.useMemo(()=>n._getWatch(r,d.current),[n,r]),[v,y]=X.useState(f.current?f.current(h):h);return Eb(()=>n._subscribe({name:r,formState:{values:!0},exact:a,callback:b=>{if(!o){const S=LL(r,n._names,b.values||n._formValues,!1,d.current);if(f.current){const C=f.current(S);za(C,p.current)||(y(C),p.current=C)}else y(S)}}}),[n,o,r,a]),X.useEffect(()=>n._removeUnmounted()),v}function Due(e){const t=$p(),{name:n,disabled:r,control:i=t.control,shouldUnregister:o,defaultValue:a}=e,c=PL(i._names.array,n),d=X.useMemo(()=>Te(i._formValues,n,Te(i._defaultValues,n,a)),[i,n,a]),f=Oue({control:i,name:n,defaultValue:d,exact:!0}),p=IE({control:i,name:n,exact:!0}),h=X.useRef(e),v=X.useRef(void 0),y=X.useRef(i.register(n,{...e.rules,value:f,...Ci(e.disabled)?{disabled:e.disabled}:{}}));h.current=e;const b=X.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Te(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Te(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Te(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Te(p.validatingFields,n)},error:{enumerable:!0,get:()=>Te(p.errors,n)}}),[p,n]),S=X.useCallback(j=>y.current.onChange({target:{value:ML(j),name:n},type:Jv.CHANGE}),[n]),C=X.useCallback(()=>y.current.onBlur({target:{value:Te(i._formValues,n),name:n},type:Jv.BLUR}),[n,i._formValues]),E=X.useCallback(j=>{const I=Te(i._fields,n);I&&j&&(I._f.ref={focus:()=>j.focus&&j.focus(),select:()=>j.select&&j.select(),setCustomValidity:A=>j.setCustomValidity(A),reportValidity:()=>j.reportValidity()})},[i._fields,n]),k=X.useMemo(()=>({name:n,value:f,...Ci(r)||p.disabled?{disabled:p.disabled||r}:{},onChange:S,onBlur:C,ref:E}),[n,r,p.disabled,S,C,E,f]);return X.useEffect(()=>{const j=i._options.shouldUnregister||o,I=v.current;I&&I!==n&&!c&&i.unregister(I),i.register(n,{...h.current.rules,...Ci(h.current.disabled)?{disabled:h.current.disabled}:{}});const A=(T,N)=>{const z=Te(i._fields,T);z&&z._f&&(z._f.mount=N)};if(A(n,!0),j){const T=sn(Te(i._options.defaultValues,n,h.current.defaultValue));Mt(i._defaultValues,n,T),Jt(Te(i._formValues,n))&&Mt(i._formValues,n,T)}return!c&&i.register(n),v.current=n,()=>{(c?j&&!i._state.action:j)?i.unregister(n):A(n,!1)}},[n,i,c,o]),X.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),X.useMemo(()=>({field:k,formState:p,fieldState:b}),[k,p,b])}const $ue=e=>e.render(Due(e));var TE=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},ci=e=>Array.isArray(e)?e:[e],kD=()=>{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}};function UL(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const i=e[r],o=t[r];if(i&&Hn(i)&&o){const a=UL(i,o);Hn(a)&&(n[r]=a)}else e[r]&&(n[r]=o)}return n}var $r=e=>Hn(e)&&!Object.keys(e).length,NE=e=>e.type==="file",_o=e=>typeof e=="function",ey=e=>{if(!kE)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},FL=e=>e.type==="select-multiple",AE=e=>e.type==="radio",Mue=e=>AE(e)||Dp(e),SS=e=>ey(e)&&e.isConnected;function Pue(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Jt(e)?r++:e[t[r++]];return e}function zue(e){for(const t in e)if(e.hasOwnProperty(t)&&!Jt(e[t]))return!1;return!0}function Dn(e,t){const n=Array.isArray(t)?t:_b(t)?[t]:jE(t),r=n.length===1?e:Pue(e,n),i=n.length-1,o=n[i];return r&&delete r[o],i!==0&&(Hn(r)&&$r(r)||Array.isArray(r)&&zue(r))&&Dn(e,n.slice(0,-1)),e}var Lue=e=>{for(const t in e)if(_o(e[t]))return!0;return!1};function VL(e){return Array.isArray(e)||Hn(e)&&!Lue(e)}function u1(e,t={}){for(const n in e)VL(e[n])?(t[n]=Array.isArray(e[n])?[]:{},u1(e[n],t[n])):Jt(e[n])||(t[n]=!0);return t}function Pu(e,t,n){n||(n=u1(t));for(const r in e)VL(e[r])?Jt(t)||c1(n[r])?n[r]=u1(e[r],Array.isArray(e[r])?[]:{}):Pu(e[r],ai(t)?{}:t[r],n[r]):n[r]=!za(e[r],t[r]);return n}const jD={value:!1,isValid:!1},RD={value:!0,isValid:!0};var BL=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Jt(e[0].attributes.value)?Jt(e[0].value)||e[0].value===""?RD:{value:e[0].value,isValid:!0}:RD:jD}return jD},HL=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Jt(e)?e:t?e===""?NaN:e&&+e:n&&ji(e)?new Date(e):r?r(e):e;const ID={isValid:!1,value:null};var qL=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,ID):ID;function TD(e){const t=e.ref;return NE(t)?t.files:AE(t)?qL(e.refs).value:FL(t)?[...t.selectedOptions].map(({value:n})=>n):Dp(t)?BL(e.refs).value:HL(Jt(t.value)?e.ref.value:t.value,e)}var Uue=(e,t,n,r)=>{const i={};for(const o of e){const a=Te(t,o);a&&Mt(i,o,a._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},ty=e=>e instanceof RegExp,dm=e=>Jt(e)?e:ty(e)?e.source:Hn(e)?ty(e.value)?e.value.source:e.value:e,Vu=e=>({isOnSubmit:!e||e===no.onSubmit,isOnBlur:e===no.onBlur,isOnChange:e===no.onChange,isOnAll:e===no.all,isOnTouch:e===no.onTouched});const ND="AsyncFunction";var Fue=e=>!!e&&!!e.validate&&!!(_o(e.validate)&&e.validate.constructor.name===ND||Hn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===ND)),Vue=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),d1=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Xu=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const o=Te(e,i);if(o){const{_f:a,...c}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!r)return!0;if(a.ref&&t(a.ref,a.name)&&!r)return!0;if(Xu(c,t))break}else if(Hn(c)&&Xu(c,t))break}}};function AD(e,t,n){const r=Te(e,n);if(r||_b(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const o=i.join("."),a=Te(t,o),c=Te(e,o);if(a&&!Array.isArray(a)&&n!==o)return{name:n};if(c&&c.type)return{name:o,error:c};if(c&&c.root&&c.root.type)return{name:`${o}.root`,error:c.root};i.pop()}return{name:n}}var Bue=(e,t,n,r)=>{n(e);const{name:i,...o}=e;return $r(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!r||no.all))},Hue=(e,t,n)=>!e||!t||e===t||ci(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),que=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,Gue=(e,t)=>!Cb(Te(e,t)).length&&Dn(e,t),GL=(e,t,n)=>{const r=ci(Te(e,n));return Mt(r,"root",t[n]),Mt(e,n,r),e};function OD(e,t,n="validate"){if(ji(e)||Array.isArray(e)&&e.every(ji)||Ci(e)&&!e)return{type:n,message:ji(e)?e:"",ref:t}}var Iu=e=>Hn(e)&&!ty(e)?e:{value:e,message:""},f1=async(e,t,n,r,i,o)=>{const{ref:a,refs:c,required:d,maxLength:f,minLength:p,min:h,max:v,pattern:y,validate:b,name:S,valueAsNumber:C,mount:E}=e._f,k=Te(n,S);if(!E||t.has(S))return{};const j=c?c[0]:a,I=H=>{i&&j.reportValidity&&(j.setCustomValidity(Ci(H)?"":H||""),j.reportValidity())},A={},T=AE(a),N=Dp(a),z=T||N,L=(C||NE(a))&&Jt(a.value)&&Jt(k)||ey(a)&&a.value===""||k===""||Array.isArray(k)&&!k.length,K=TE.bind(null,S,r,A),J=(H,Y,B,W=Oa.maxLength,M=Oa.minLength)=>{const Z=H?Y:B;A[S]={type:H?W:M,message:Z,ref:a,...K(H?W:M,Z)}};if(o?!Array.isArray(k)||!k.length:d&&(!z&&(L||ai(k))||Ci(k)&&!k||N&&!BL(c).isValid||T&&!qL(c).isValid)){const{value:H,message:Y}=ji(d)?{value:!!d,message:d}:Iu(d);if(H&&(A[S]={type:Oa.required,message:Y,ref:j,...K(Oa.required,Y)},!r))return I(Y),A}if(!L&&(!ai(h)||!ai(v))){let H,Y;const B=Iu(v),W=Iu(h);if(!ai(k)&&!isNaN(k)){const M=a.valueAsNumber||k&&+k;ai(B.value)||(H=M>B.value),ai(W.value)||(Y=M<W.value)}else{const M=a.valueAsDate||new Date(k),Z=D=>new Date(new Date().toDateString()+" "+D),U=a.type=="time",te=a.type=="week";ji(B.value)&&k&&(H=U?Z(k)>Z(B.value):te?k>B.value:M>new Date(B.value)),ji(W.value)&&k&&(Y=U?Z(k)<Z(W.value):te?k<W.value:M<new Date(W.value))}if((H||Y)&&(J(!!H,B.message,W.message,Oa.max,Oa.min),!r))return I(A[S].message),A}if((f||p)&&!L&&(ji(k)||o&&Array.isArray(k))){const H=Iu(f),Y=Iu(p),B=!ai(H.value)&&k.length>+H.value,W=!ai(Y.value)&&k.length<+Y.value;if((B||W)&&(J(B,H.message,Y.message),!r))return I(A[S].message),A}if(y&&!L&&ji(k)){const{value:H,message:Y}=Iu(y);if(ty(H)&&!k.match(H)&&(A[S]={type:Oa.pattern,message:Y,ref:a,...K(Oa.pattern,Y)},!r))return I(Y),A}if(b){if(_o(b)){const H=await b(k,n),Y=OD(H,j);if(Y&&(A[S]={...Y,...K(Oa.validate,Y.message)},!r))return I(Y.message),A}else if(Hn(b)){let H={};for(const Y in b){if(!$r(H)&&!r)break;const B=OD(await b[Y](k,n),j,Y);B&&(H={...B,...K(Y,B.message)},I(B.message),r&&(A[S]=H))}if(!$r(H)&&(A[S]={ref:j,...H},!r))return A}}return I(!0),A};const Kue={mode:no.onSubmit,reValidateMode:no.onChange,shouldFocusError:!0};function Zue(e={}){let t={...Kue,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:_o(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=Hn(t.defaultValues)||Hn(t.values)?sn(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:sn(i),a={action:!1,mount:!1,watch:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},d,f=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let h={...p};const v={array:kD(),state:kD()},y=t.criteriaMode===no.all,b=G=>oe=>{clearTimeout(f),f=setTimeout(G,oe)},S=async G=>{if(!t.disabled&&(p.isValid||h.isValid||G)){const oe=t.resolver?$r((await N()).errors):await L(r,!0);oe!==n.isValid&&v.state.next({isValid:oe})}},C=(G,oe)=>{!t.disabled&&(p.isValidating||p.validatingFields||h.isValidating||h.validatingFields)&&((G||Array.from(c.mount)).forEach(de=>{de&&(oe?Mt(n.validatingFields,de,oe):Dn(n.validatingFields,de))}),v.state.next({validatingFields:n.validatingFields,isValidating:!$r(n.validatingFields)}))},E=(G,oe=[],de,xe,ve=!0,Ce=!0)=>{if(xe&&de&&!t.disabled){if(a.action=!0,Ce&&Array.isArray(Te(r,G))){const ne=de(Te(r,G),xe.argA,xe.argB);ve&&Mt(r,G,ne)}if(Ce&&Array.isArray(Te(n.errors,G))){const ne=de(Te(n.errors,G),xe.argA,xe.argB);ve&&Mt(n.errors,G,ne),Gue(n.errors,G)}if((p.touchedFields||h.touchedFields)&&Ce&&Array.isArray(Te(n.touchedFields,G))){const ne=de(Te(n.touchedFields,G),xe.argA,xe.argB);ve&&Mt(n.touchedFields,G,ne)}(p.dirtyFields||h.dirtyFields)&&(n.dirtyFields=Pu(i,o)),v.state.next({name:G,isDirty:J(G,oe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Mt(o,G,oe)},k=(G,oe)=>{Mt(n.errors,G,oe),v.state.next({errors:n.errors})},j=G=>{n.errors=G,v.state.next({errors:n.errors,isValid:!1})},I=(G,oe,de,xe)=>{const ve=Te(r,G);if(ve){const Ce=Te(o,G,Jt(de)?Te(i,G):de);Jt(Ce)||xe&&xe.defaultChecked||oe?Mt(o,G,oe?Ce:TD(ve._f)):B(G,Ce),a.mount&&S()}},A=(G,oe,de,xe,ve)=>{let Ce=!1,ne=!1;const ye={name:G};if(!t.disabled){if(!de||xe){(p.isDirty||h.isDirty)&&(ne=n.isDirty,n.isDirty=ye.isDirty=J(),Ce=ne!==ye.isDirty);const Ne=za(Te(i,G),oe);ne=!!Te(n.dirtyFields,G),Ne?Dn(n.dirtyFields,G):Mt(n.dirtyFields,G,!0),ye.dirtyFields=n.dirtyFields,Ce=Ce||(p.dirtyFields||h.dirtyFields)&&ne!==!Ne}if(de){const Ne=Te(n.touchedFields,G);Ne||(Mt(n.touchedFields,G,de),ye.touchedFields=n.touchedFields,Ce=Ce||(p.touchedFields||h.touchedFields)&&Ne!==de)}Ce&&ve&&v.state.next(ye)}return Ce?ye:{}},T=(G,oe,de,xe)=>{const ve=Te(n.errors,G),Ce=(p.isValid||h.isValid)&&Ci(oe)&&n.isValid!==oe;if(t.delayError&&de?(d=b(()=>k(G,de)),d(t.delayError)):(clearTimeout(f),d=null,de?Mt(n.errors,G,de):Dn(n.errors,G)),(de?!za(ve,de):ve)||!$r(xe)||Ce){const ne={...xe,...Ce&&Ci(oe)?{isValid:oe}:{},errors:n.errors,name:G};n={...n,...ne},v.state.next(ne)}},N=async G=>{C(G,!0);const oe=await t.resolver(o,t.context,Uue(G||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return C(G),oe},z=async G=>{const{errors:oe}=await N(G);if(G)for(const de of G){const xe=Te(oe,de);xe?Mt(n.errors,de,xe):Dn(n.errors,de)}else n.errors=oe;return oe},L=async(G,oe,de={valid:!0})=>{for(const xe in G){const ve=G[xe];if(ve){const{_f:Ce,...ne}=ve;if(Ce){const ye=c.array.has(Ce.name),Ne=ve._f&&Fue(ve._f);Ne&&p.validatingFields&&C([Ce.name],!0);const Ke=await f1(ve,c.disabled,o,y,t.shouldUseNativeValidation&&!oe,ye);if(Ne&&p.validatingFields&&C([Ce.name]),Ke[Ce.name]&&(de.valid=!1,oe))break;!oe&&(Te(Ke,Ce.name)?ye?GL(n.errors,Ke,Ce.name):Mt(n.errors,Ce.name,Ke[Ce.name]):Dn(n.errors,Ce.name))}!$r(ne)&&await L(ne,oe,de)}}return de.valid},K=()=>{for(const G of c.unMount){const oe=Te(r,G);oe&&(oe._f.refs?oe._f.refs.every(de=>!SS(de)):!SS(oe._f.ref))&&V(G)}c.unMount=new Set},J=(G,oe)=>!t.disabled&&(G&&oe&&Mt(o,G,oe),!za(D(),i)),H=(G,oe,de)=>LL(G,c,{...a.mount?o:Jt(oe)?i:ji(G)?{[G]:oe}:oe},de,oe),Y=G=>Cb(Te(a.mount?o:i,G,t.shouldUnregister?Te(i,G,[]):[])),B=(G,oe,de={})=>{const xe=Te(r,G);let ve=oe;if(xe){const Ce=xe._f;Ce&&(!Ce.disabled&&Mt(o,G,HL(oe,Ce)),ve=ey(Ce.ref)&&ai(oe)?"":oe,FL(Ce.ref)?[...Ce.ref.options].forEach(ne=>ne.selected=ve.includes(ne.value)):Ce.refs?Dp(Ce.ref)?Ce.refs.forEach(ne=>{(!ne.defaultChecked||!ne.disabled)&&(Array.isArray(ve)?ne.checked=!!ve.find(ye=>ye===ne.value):ne.checked=ve===ne.value||!!ve)}):Ce.refs.forEach(ne=>ne.checked=ne.value===ve):NE(Ce.ref)?Ce.ref.value="":(Ce.ref.value=ve,Ce.ref.type||v.state.next({name:G,values:sn(o)})))}(de.shouldDirty||de.shouldTouch)&&A(G,ve,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&te(G)},W=(G,oe,de)=>{for(const xe in oe){if(!oe.hasOwnProperty(xe))return;const ve=oe[xe],Ce=G+"."+xe,ne=Te(r,Ce);(c.array.has(G)||Hn(ve)||ne&&!ne._f)&&!Fl(ve)?W(Ce,ve,de):B(Ce,ve,de)}},M=(G,oe,de={})=>{const xe=Te(r,G),ve=c.array.has(G),Ce=sn(oe);Mt(o,G,Ce),ve?(v.array.next({name:G,values:sn(o)}),(p.isDirty||p.dirtyFields||h.isDirty||h.dirtyFields)&&de.shouldDirty&&v.state.next({name:G,dirtyFields:Pu(i,o),isDirty:J(G,Ce)})):xe&&!xe._f&&!ai(Ce)?W(G,Ce,de):B(G,Ce,de),d1(G,c)&&v.state.next({...n,name:G}),v.state.next({name:a.mount?G:void 0,values:sn(o)})},Z=async G=>{a.mount=!0;const oe=G.target;let de=oe.name,xe=!0;const ve=Te(r,de),Ce=Ne=>{xe=Number.isNaN(Ne)||Fl(Ne)&&isNaN(Ne.getTime())||za(Ne,Te(o,de,Ne))},ne=Vu(t.mode),ye=Vu(t.reValidateMode);if(ve){let Ne,Ke;const ot=oe.type?TD(ve._f):ML(G),Bt=G.type===Jv.BLUR||G.type===Jv.FOCUS_OUT,zn=!Vue(ve._f)&&!t.resolver&&!Te(n.errors,de)&&!ve._f.deps||que(Bt,Te(n.touchedFields,de),n.isSubmitted,ye,ne),vn=d1(de,c,Bt);Mt(o,de,ot),Bt?(!oe||!oe.readOnly)&&(ve._f.onBlur&&ve._f.onBlur(G),d&&d(0)):ve._f.onChange&&ve._f.onChange(G);const Kt=A(de,ot,Bt),_t=!$r(Kt)||vn;if(!Bt&&v.state.next({name:de,type:G.type,values:sn(o)}),zn)return(p.isValid||h.isValid)&&(t.mode==="onBlur"?Bt&&S():Bt||S()),_t&&v.state.next({name:de,...vn?{}:Kt});if(!Bt&&vn&&v.state.next({...n}),t.resolver){const{errors:vt}=await N([de]);if(Ce(ot),xe){const Gr=AD(n.errors,r,de),ir=AD(vt,r,Gr.name||de);Ne=ir.error,de=ir.name,Ke=$r(vt)}}else C([de],!0),Ne=(await f1(ve,c.disabled,o,y,t.shouldUseNativeValidation))[de],C([de]),Ce(ot),xe&&(Ne?Ke=!1:(p.isValid||h.isValid)&&(Ke=await L(r,!0)));xe&&(ve._f.deps&&(!Array.isArray(ve._f.deps)||ve._f.deps.length>0)&&te(ve._f.deps),T(de,Ke,Ne,Kt))}},U=(G,oe)=>{if(Te(n.errors,oe)&&G.focus)return G.focus(),1},te=async(G,oe={})=>{let de,xe;const ve=ci(G);if(t.resolver){const Ce=await z(Jt(G)?G:ve);de=$r(Ce),xe=G?!ve.some(ne=>Te(Ce,ne)):de}else G?(xe=(await Promise.all(ve.map(async Ce=>{const ne=Te(r,Ce);return await L(ne&&ne._f?{[Ce]:ne}:ne)}))).every(Boolean),!(!xe&&!n.isValid)&&S()):xe=de=await L(r);return v.state.next({...!ji(G)||(p.isValid||h.isValid)&&de!==n.isValid?{}:{name:G},...t.resolver||!G?{isValid:de}:{},errors:n.errors}),oe.shouldFocus&&!xe&&Xu(r,U,G?ve:c.mount),xe},D=(G,oe)=>{let de={...a.mount?o:i};return oe&&(de=UL(oe.dirtyFields?n.dirtyFields:n.touchedFields,de)),Jt(G)?de:ji(G)?Te(de,G):G.map(xe=>Te(de,xe))},P=(G,oe)=>({invalid:!!Te((oe||n).errors,G),isDirty:!!Te((oe||n).dirtyFields,G),error:Te((oe||n).errors,G),isValidating:!!Te(n.validatingFields,G),isTouched:!!Te((oe||n).touchedFields,G)}),F=G=>{G&&ci(G).forEach(oe=>Dn(n.errors,oe)),v.state.next({errors:G?n.errors:{}})},O=(G,oe,de)=>{const xe=(Te(r,G,{_f:{}})._f||{}).ref,ve=Te(n.errors,G)||{},{ref:Ce,message:ne,type:ye,...Ne}=ve;Mt(n.errors,G,{...Ne,...oe,ref:xe}),v.state.next({name:G,errors:n.errors,isValid:!1}),de&&de.shouldFocus&&xe&&xe.focus&&xe.focus()},ee=(G,oe)=>_o(G)?v.state.subscribe({next:de=>"values"in de&&G(H(void 0,oe),de)}):H(G,oe,!0),ue=G=>v.state.subscribe({next:oe=>{Hue(G.name,oe.name,G.exact)&&Bue(oe,G.formState||p,Pn,G.reRenderRoot)&&G.callback({values:{...o},...n,...oe,defaultValues:i})}}).unsubscribe,pe=G=>(a.mount=!0,h={...h,...G.formState},ue({...G,formState:h})),V=(G,oe={})=>{for(const de of G?ci(G):c.mount)c.mount.delete(de),c.array.delete(de),oe.keepValue||(Dn(r,de),Dn(o,de)),!oe.keepError&&Dn(n.errors,de),!oe.keepDirty&&Dn(n.dirtyFields,de),!oe.keepTouched&&Dn(n.touchedFields,de),!oe.keepIsValidating&&Dn(n.validatingFields,de),!t.shouldUnregister&&!oe.keepDefaultValue&&Dn(i,de);v.state.next({values:sn(o)}),v.state.next({...n,...oe.keepDirty?{isDirty:J()}:{}}),!oe.keepIsValid&&S()},ie=({disabled:G,name:oe})=>{(Ci(G)&&a.mount||G||c.disabled.has(oe))&&(G?c.disabled.add(oe):c.disabled.delete(oe))},we=(G,oe={})=>{let de=Te(r,G);const xe=Ci(oe.disabled)||Ci(t.disabled);return Mt(r,G,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:G}},name:G,mount:!0,...oe}}),c.mount.add(G),de?ie({disabled:Ci(oe.disabled)?oe.disabled:t.disabled,name:G}):I(G,!0,oe.value),{...xe?{disabled:oe.disabled||t.disabled}:{},...t.progressive?{required:!!oe.required,min:dm(oe.min),max:dm(oe.max),minLength:dm(oe.minLength),maxLength:dm(oe.maxLength),pattern:dm(oe.pattern)}:{},name:G,onChange:Z,onBlur:Z,ref:ve=>{if(ve){we(G,oe),de=Te(r,G);const Ce=Jt(ve.value)&&ve.querySelectorAll&&ve.querySelectorAll("input,select,textarea")[0]||ve,ne=Mue(Ce),ye=de._f.refs||[];if(ne?ye.find(Ne=>Ne===Ce):Ce===de._f.ref)return;Mt(r,G,{_f:{...de._f,...ne?{refs:[...ye.filter(SS),Ce,...Array.isArray(Te(i,G))?[{}]:[]],ref:{type:Ce.type,name:G}}:{ref:Ce}}}),I(G,!1,void 0,Ce)}else de=Te(r,G,{}),de._f&&(de._f.mount=!1),(t.shouldUnregister||oe.shouldUnregister)&&!(PL(c.array,G)&&a.action)&&c.unMount.add(G)}}},Ie=()=>t.shouldFocusError&&Xu(r,U,c.mount),Ue=G=>{Ci(G)&&(v.state.next({disabled:G}),Xu(r,(oe,de)=>{const xe=Te(r,de);xe&&(oe.disabled=xe._f.disabled||G,Array.isArray(xe._f.refs)&&xe._f.refs.forEach(ve=>{ve.disabled=xe._f.disabled||G}))},0,!1))},Pe=(G,oe)=>async de=>{let xe;de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let ve=sn(o);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:Ce,values:ne}=await N();n.errors=Ce,ve=sn(ne)}else await L(r);if(c.disabled.size)for(const Ce of c.disabled)Dn(ve,Ce);if(Dn(n.errors,"root"),$r(n.errors)){v.state.next({errors:{}});try{await G(ve,de)}catch(Ce){xe=Ce}}else oe&&await oe({...n.errors},de),Ie(),setTimeout(Ie);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:$r(n.errors)&&!xe,submitCount:n.submitCount+1,errors:n.errors}),xe)throw xe},Ze=(G,oe={})=>{Te(r,G)&&(Jt(oe.defaultValue)?M(G,sn(Te(i,G))):(M(G,oe.defaultValue),Mt(i,G,sn(oe.defaultValue))),oe.keepTouched||Dn(n.touchedFields,G),oe.keepDirty||(Dn(n.dirtyFields,G),n.isDirty=oe.defaultValue?J(G,sn(Te(i,G))):J()),oe.keepError||(Dn(n.errors,G),p.isValid&&S()),v.state.next({...n}))},St=(G,oe={})=>{const de=G?sn(G):i,xe=sn(de),ve=$r(G),Ce=ve?i:xe;if(oe.keepDefaultValues||(i=de),!oe.keepValues){if(oe.keepDirtyValues){const ne=new Set([...c.mount,...Object.keys(Pu(i,o))]);for(const ye of Array.from(ne))Te(n.dirtyFields,ye)?Mt(Ce,ye,Te(o,ye)):M(ye,Te(Ce,ye))}else{if(kE&&Jt(G))for(const ne of c.mount){const ye=Te(r,ne);if(ye&&ye._f){const Ne=Array.isArray(ye._f.refs)?ye._f.refs[0]:ye._f.ref;if(ey(Ne)){const Ke=Ne.closest("form");if(Ke){Ke.reset();break}}}}if(oe.keepFieldsRef)for(const ne of c.mount)M(ne,Te(Ce,ne));else r={}}o=t.shouldUnregister?oe.keepDefaultValues?sn(i):{}:sn(Ce),v.array.next({values:{...Ce}}),v.state.next({values:{...Ce}})}c={mount:oe.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!p.isValid||!!oe.keepIsValid||!!oe.keepDirtyValues,a.watch=!!t.shouldUnregister,v.state.next({submitCount:oe.keepSubmitCount?n.submitCount:0,isDirty:ve?!1:oe.keepDirty?n.isDirty:!!(oe.keepDefaultValues&&!za(G,i)),isSubmitted:oe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ve?{}:oe.keepDirtyValues?oe.keepDefaultValues&&o?Pu(i,o):n.dirtyFields:oe.keepDefaultValues&&G?Pu(i,G):oe.keepDirty?n.dirtyFields:{},touchedFields:oe.keepTouched?n.touchedFields:{},errors:oe.keepErrors?n.errors:{},isSubmitSuccessful:oe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},un=(G,oe)=>St(_o(G)?G(o):G,oe),Tn=(G,oe={})=>{const de=Te(r,G),xe=de&&de._f;if(xe){const ve=xe.refs?xe.refs[0]:xe.ref;ve.focus&&(ve.focus(),oe.shouldSelect&&_o(ve.select)&&ve.select())}},Pn=G=>{n={...n,...G}},Xt={control:{register:we,unregister:V,getFieldState:P,handleSubmit:Pe,setError:O,_subscribe:ue,_runSchema:N,_focusError:Ie,_getWatch:H,_getDirty:J,_setValid:S,_setFieldArray:E,_setDisabledField:ie,_setErrors:j,_getFieldArray:Y,_reset:St,_resetDefaultValues:()=>_o(t.defaultValues)&&t.defaultValues().then(G=>{un(G,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:K,_disableForm:Ue,_subjects:v,_proxyFormState:p,get _fields(){return r},get _formValues(){return o},get _state(){return a},set _state(G){a=G},get _defaultValues(){return i},get _names(){return c},set _names(G){c=G},get _formState(){return n},get _options(){return t},set _options(G){t={...t,...G}}},subscribe:pe,trigger:te,register:we,handleSubmit:Pe,watch:ee,setValue:M,getValues:D,reset:un,resetField:Ze,clearErrors:F,unregister:V,setError:O,setFocus:Tn,getFieldState:P};return{...Xt,formControl:Xt}}var js=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},_S=(e,t,n={})=>n.shouldFocus||Jt(n.shouldFocus)?n.focusName||`${e}.${Jt(n.focusIndex)?t:n.focusIndex}.`:"",CS=(e,t)=>[...e,...ci(t)],ES=e=>Array.isArray(e)?e.map(()=>{}):void 0;function kS(e,t,n){return[...e.slice(0,t),...ci(n),...e.slice(t)]}var jS=(e,t,n)=>Array.isArray(e)?(Jt(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],RS=(e,t)=>[...ci(t),...ci(e)];function Yue(e,t){let n=0;const r=[...e];for(const i of t)r.splice(i-n,1),n++;return Cb(r).length?r:[]}var IS=(e,t)=>Jt(t)?[]:Yue(e,ci(t).sort((n,r)=>n-r)),TS=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},DD=(e,t,n)=>(e[t]=n,e);function KL(e){const t=$p(),{control:n=t.control,name:r,keyName:i="id",shouldUnregister:o,rules:a}=e,[c,d]=X.useState(n._getFieldArray(r)),f=X.useRef(n._getFieldArray(r).map(js)),p=X.useRef(!1);n._names.array.add(r),X.useMemo(()=>a&&c.length>=0&&n.register(r,a),[n,r,c.length,a]),Eb(()=>n._subjects.array.subscribe({next:({values:I,name:A})=>{if(A===r||!A){const T=Te(I,r);Array.isArray(T)&&(d(T),f.current=T.map(js))}}}).unsubscribe,[n,r]);const h=X.useCallback(I=>{p.current=!0,n._setFieldArray(r,I)},[n,r]),v=(I,A)=>{const T=ci(sn(I)),N=CS(n._getFieldArray(r),T);n._names.focus=_S(r,N.length-1,A),f.current=CS(f.current,T.map(js)),h(N),d(N),n._setFieldArray(r,N,CS,{argA:ES(I)})},y=(I,A)=>{const T=ci(sn(I)),N=RS(n._getFieldArray(r),T);n._names.focus=_S(r,0,A),f.current=RS(f.current,T.map(js)),h(N),d(N),n._setFieldArray(r,N,RS,{argA:ES(I)})},b=I=>{const A=IS(n._getFieldArray(r),I);f.current=IS(f.current,I),h(A),d(A),!Array.isArray(Te(n._fields,r))&&Mt(n._fields,r,void 0),n._setFieldArray(r,A,IS,{argA:I})},S=(I,A,T)=>{const N=ci(sn(A)),z=kS(n._getFieldArray(r),I,N);n._names.focus=_S(r,I,T),f.current=kS(f.current,I,N.map(js)),h(z),d(z),n._setFieldArray(r,z,kS,{argA:I,argB:ES(A)})},C=(I,A)=>{const T=n._getFieldArray(r);TS(T,I,A),TS(f.current,I,A),h(T),d(T),n._setFieldArray(r,T,TS,{argA:I,argB:A},!1)},E=(I,A)=>{const T=n._getFieldArray(r);jS(T,I,A),jS(f.current,I,A),h(T),d(T),n._setFieldArray(r,T,jS,{argA:I,argB:A},!1)},k=(I,A)=>{const T=sn(A),N=DD(n._getFieldArray(r),I,T);f.current=[...N].map((z,L)=>!z||L===I?js():f.current[L]),h(N),d([...N]),n._setFieldArray(r,N,DD,{argA:I,argB:T},!0,!1)},j=I=>{const A=ci(sn(I));f.current=A.map(js),h([...A]),d([...A]),n._setFieldArray(r,[...A],T=>T,{},!0,!1)};return X.useEffect(()=>{if(n._state.action=!1,d1(r,n._names)&&n._subjects.state.next({...n._formState}),p.current&&(!Vu(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!Vu(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(I=>{const A=Te(I.errors,r),T=Te(n._formState.errors,r);(T?!A&&T.type||A&&(T.type!==A.type||T.message!==A.message):A&&A.type)&&(A?Mt(n._formState.errors,r,A):Dn(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const I=Te(n._fields,r);I&&I._f&&!(Vu(n._options.reValidateMode).isOnSubmit&&Vu(n._options.mode).isOnSubmit)&&f1(I,n._names.disabled,n._formValues,n._options.criteriaMode===no.all,n._options.shouldUseNativeValidation,!0).then(A=>!$r(A)&&n._subjects.state.next({errors:GL(n._formState.errors,A,r)}))}n._subjects.state.next({name:r,values:sn(n._formValues)}),n._names.focus&&Xu(n._fields,(I,A)=>{if(n._names.focus&&A.startsWith(n._names.focus)&&I.focus)return I.focus(),1}),n._names.focus="",n._setValid(),p.current=!1},[c,r,n]),X.useEffect(()=>(!Te(n._formValues,r)&&n._setFieldArray(r),()=>{const I=(A,T)=>{const N=Te(n._fields,A);N&&N._f&&(N._f.mount=T)};n._options.shouldUnregister||o?n.unregister(r):I(r,!1)}),[r,n,i,o]),{swap:X.useCallback(C,[h,r,n]),move:X.useCallback(E,[h,r,n]),prepend:X.useCallback(y,[h,r,n]),append:X.useCallback(v,[h,r,n]),remove:X.useCallback(b,[h,r,n]),insert:X.useCallback(S,[h,r,n]),update:X.useCallback(k,[h,r,n]),replace:X.useCallback(j,[h,r,n]),fields:X.useMemo(()=>c.map((I,A)=>({...I,[i]:f.current[A]||js()})),[c,i])}}function hn(e={}){const t=X.useRef(void 0),n=X.useRef(void 0),[r,i]=X.useState({isDirty:!1,isValidating:!1,isLoading:_o(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:_o(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!_o(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...c}=Zue(e);t.current={...c,formState:r}}const o=t.current.control;return o._options=e,Eb(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>i({...o._formState}),reRenderRoot:!0});return i(c=>({...c,isReady:!0})),o._formState.isReady=!0,a},[o]),X.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),X.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),X.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),X.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),X.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==r.isDirty&&o._subjects.state.next({isDirty:a})}},[o,r.isDirty]),X.useEffect(()=>{e.values&&!za(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),n.current=e.values,i(a=>({...a}))):o._resetDefaultValues()},[o,e.values]),X.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=zL(r,o),t.current}const gn=Aue,ZL=x.createContext({}),YL=x.createContext({});function OE(){const e=x.useContext(ZL),t=x.useContext(YL),{getFieldState:n}=$p(),r=IE({name:e.name}),i=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}}function Me({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:i}=OE();return u.jsx(EC,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...e})}function $e({...e}){return u.jsx(ZL,{value:{name:e.name},children:u.jsx($ue,{...e})})}function Ae({className:e,...t}){const n=x.useId();return u.jsx(YL,{value:{id:n},children:u.jsx("div",{"data-slot":"form-item",className:ze("grid gap-2",e),...t})})}var Wue=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],WL=Wue.reduce((e,t)=>{const n=hP(`Primitive.${t}`),r=x.forwardRef((i,o)=>{const{asChild:a,...c}=i,d=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(d,{...c,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Xue="Label",XL=x.forwardRef((e,t)=>u.jsx(WL.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));XL.displayName=Xue;var Que=XL;function Mp({className:e,...t}){return u.jsx(Que,{"data-slot":"label",className:ze("text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function Oe({className:e,...t}){const{error:n,formItemId:r}=OE();return u.jsx(Mp,{"data-slot":"form-label","data-error":!!n,className:ze("data-[error=true]:text-destructive",e),htmlFor:r,...t})}function De({className:e,...t}){const{error:n,formMessageId:r}=OE(),i=n?String(n?.message):t.children;return i?u.jsx("p",{"data-slot":"form-message",id:r,className:ze("text-destructive text-sm",e),...t,children:i}):null}function qe({className:e,type:t,...n}){return u.jsx("input",{type:t,"data-slot":"input",className:ze(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
40
40
  selection:text-primary-foreground
41
41
  dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
@@ -125,7 +125,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
125
125
  monaco.config({ paths: { vs: '...' } })
126
126
 
127
127
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
128
- `},M2=Dwe(zwe)(tH),Lwe={config:Mwe},Uwe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,a){return a(o)},i)}};function nH(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],nH(e[n],t[n]))}),A2(A2({},e),t)}var Fwe={type:"cancelation",msg:"operation is manually canceled"};function WS(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(Fwe):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var Vwe=Awe.create({config:Owe,isInitialized:!1,resolve:null,reject:null,monaco:null}),rH=mwe(Vwe,2),ih=rH[0],cx=rH[1];function Bwe(e){var t=Lwe.config(e),n=t.monaco,r=fwe(t,["monaco"]);cx(function(i){return{config:nH(i.config,r),monaco:n}})}function Hwe(){var e=ih(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(cx({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),WS(XS);if(window.monaco&&window.monaco.editor)return iH(window.monaco),e.resolve(window.monaco),WS(XS);Uwe(qwe,Kwe)(Zwe)}return WS(XS)}function qwe(e){return document.body.appendChild(e)}function Gwe(e){var t=document.createElement("script");return e&&(t.src=e),t}function Kwe(e){var t=ih(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=Gwe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Zwe(){var e=ih(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){iH(n),e.resolve(n)},function(n){e.reject(n)})}function iH(e){ih().monaco||cx({monaco:e})}function Ywe(){return ih(function(e){var t=e.monaco;return t})}var XS=new Promise(function(e,t){return cx({resolve:e,reject:t})}),oH={config:Bwe,init:Hwe,__getMonacoInstance:Ywe},Wwe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},QS=Wwe,Xwe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Qwe=Xwe;function Jwe({children:e}){return X.createElement("div",{style:Qwe.container},e)}var eSe=Jwe,tSe=eSe;function nSe({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:a}){return X.createElement("section",{style:{...QS.wrapper,width:e,height:t},...a},!n&&X.createElement(tSe,null,r),X.createElement("div",{ref:i,style:{...QS.fullWidth,...!n&&QS.hide},className:o}))}var rSe=nSe,aH=x.memo(rSe);function iSe(e){x.useEffect(e,[])}var sH=iSe;function oSe(e,t,n=!0){let r=x.useRef(!0);x.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Ei=oSe;function Pm(){}function Bu(e,t,n,r){return aSe(e,r)||sSe(e,t,n,r)}function aSe(e,t){return e.editor.getModel(lH(e,t))}function sSe(e,t,n,r){return e.editor.createModel(t,n,r?lH(e,r):void 0)}function lH(e,t){return e.Uri.parse(t)}function lSe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:p="Loading...",options:h={},height:v="100%",width:y="100%",className:b,wrapperProps:S={},beforeMount:C=Pm,onMount:E=Pm}){let[k,j]=x.useState(!1),[I,A]=x.useState(!0),T=x.useRef(null),N=x.useRef(null),z=x.useRef(null),L=x.useRef(E),K=x.useRef(C),J=x.useRef(!1);sH(()=>{let W=oH.init();return W.then(M=>(N.current=M)&&A(!1)).catch(M=>M?.type!=="cancelation"&&console.error("Monaco initialization: error:",M)),()=>T.current?B():W.cancel()}),Ei(()=>{if(T.current&&N.current){let W=T.current.getOriginalEditor(),M=Bu(N.current,e||"",r||n||"text",o||"");M!==W.getModel()&&W.setModel(M)}},[o],k),Ei(()=>{if(T.current&&N.current){let W=T.current.getModifiedEditor(),M=Bu(N.current,t||"",i||n||"text",a||"");M!==W.getModel()&&W.setModel(M)}},[a],k),Ei(()=>{let W=T.current.getModifiedEditor();W.getOption(N.current.editor.EditorOption.readOnly)?W.setValue(t||""):t!==W.getValue()&&(W.executeEdits("",[{range:W.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),W.pushUndoStop())},[t],k),Ei(()=>{T.current?.getModel()?.original.setValue(e||"")},[e],k),Ei(()=>{let{original:W,modified:M}=T.current.getModel();N.current.editor.setModelLanguage(W,r||n||"text"),N.current.editor.setModelLanguage(M,i||n||"text")},[n,r,i],k),Ei(()=>{N.current?.editor.setTheme(f)},[f],k),Ei(()=>{T.current?.updateOptions(h)},[h],k);let H=x.useCallback(()=>{if(!N.current)return;K.current(N.current);let W=Bu(N.current,e||"",r||n||"text",o||""),M=Bu(N.current,t||"",i||n||"text",a||"");T.current?.setModel({original:W,modified:M})},[n,t,i,e,r,o,a]),Y=x.useCallback(()=>{!J.current&&z.current&&(T.current=N.current.editor.createDiffEditor(z.current,{automaticLayout:!0,...h}),H(),N.current?.editor.setTheme(f),j(!0),J.current=!0)},[h,f,H]);x.useEffect(()=>{k&&L.current(T.current,N.current)},[k]),x.useEffect(()=>{!I&&!k&&Y()},[I,k,Y]);function B(){let W=T.current?.getModel();c||W?.original?.dispose(),d||W?.modified?.dispose(),T.current?.dispose()}return X.createElement(aH,{width:y,height:v,isEditorReady:k,loading:p,_ref:z,className:b,wrapperProps:S})}var cSe=lSe;x.memo(cSe);function uSe(e){let t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}var dSe=uSe,tv=new Map;function fSe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:a="light",line:c,loading:d="Loading...",options:f={},overrideServices:p={},saveViewState:h=!0,keepCurrentModel:v=!1,width:y="100%",height:b="100%",className:S,wrapperProps:C={},beforeMount:E=Pm,onMount:k=Pm,onChange:j,onValidate:I=Pm}){let[A,T]=x.useState(!1),[N,z]=x.useState(!0),L=x.useRef(null),K=x.useRef(null),J=x.useRef(null),H=x.useRef(k),Y=x.useRef(E),B=x.useRef(),W=x.useRef(r),M=dSe(o),Z=x.useRef(!1),U=x.useRef(!1);sH(()=>{let P=oH.init();return P.then(F=>(L.current=F)&&z(!1)).catch(F=>F?.type!=="cancelation"&&console.error("Monaco initialization: error:",F)),()=>K.current?D():P.cancel()}),Ei(()=>{let P=Bu(L.current,e||r||"",t||i||"",o||n||"");P!==K.current?.getModel()&&(h&&tv.set(M,K.current?.saveViewState()),K.current?.setModel(P),h&&K.current?.restoreViewState(tv.get(o)))},[o],A),Ei(()=>{K.current?.updateOptions(f)},[f],A),Ei(()=>{!K.current||r===void 0||(K.current.getOption(L.current.editor.EditorOption.readOnly)?K.current.setValue(r):r!==K.current.getValue()&&(U.current=!0,K.current.executeEdits("",[{range:K.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),K.current.pushUndoStop(),U.current=!1))},[r],A),Ei(()=>{let P=K.current?.getModel();P&&i&&L.current?.editor.setModelLanguage(P,i)},[i],A),Ei(()=>{c!==void 0&&K.current?.revealLine(c)},[c],A),Ei(()=>{L.current?.editor.setTheme(a)},[a],A);let te=x.useCallback(()=>{if(!(!J.current||!L.current)&&!Z.current){Y.current(L.current);let P=o||n,F=Bu(L.current,r||e||"",t||i||"",P||"");K.current=L.current?.editor.create(J.current,{model:F,automaticLayout:!0,...f},p),h&&K.current.restoreViewState(tv.get(P)),L.current.editor.setTheme(a),c!==void 0&&K.current.revealLine(c),T(!0),Z.current=!0}},[e,t,n,r,i,o,f,p,h,a,c]);x.useEffect(()=>{A&&H.current(K.current,L.current)},[A]),x.useEffect(()=>{!N&&!A&&te()},[N,A,te]),W.current=r,x.useEffect(()=>{A&&j&&(B.current?.dispose(),B.current=K.current?.onDidChangeModelContent(P=>{U.current||j(K.current.getValue(),P)}))},[A,j]),x.useEffect(()=>{if(A){let P=L.current.editor.onDidChangeMarkers(F=>{let O=K.current.getModel()?.uri;if(O&&F.find(ee=>ee.path===O.path)){let ee=L.current.editor.getModelMarkers({resource:O});I?.(ee)}});return()=>{P?.dispose()}}return()=>{}},[A,I]);function D(){B.current?.dispose(),v?h&&tv.set(o,K.current.saveViewState()):K.current.getModel()?.dispose(),K.current.dispose()}return X.createElement(aH,{width:y,height:b,isEditorReady:A,loading:d,_ref:J,className:S,wrapperProps:C})}var mSe=fSe,oh=x.memo(mSe),ux=oh;const P2={roles:{create:!0,view:!0,update:!0,delete:!0},clusters:{create:!0,view:!0,update:!0,delete:!0,resources:[]}};function pSe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=et({strict:!1}),[i,o]=x.useState(!0),[a,c]=x.useState(JSON.stringify(P2,null,2)),{mutate:d,isPending:f}=cwe(),p=hn({resolver:wn(swe),defaultValues:{roleName:"",updateOrganization:!1,deleteOrganization:!1}}),h=x.useCallback(y=>{o(y.length===0)},[o]),v=x.useCallback(async y=>{const b={organizationId:r,name:y.roleName,update:y.updateOrganization,delete:y.deleteOrganization,...JSON.parse(a)};y&&i&&d(b,{onSuccess:()=>{p.reset(),t(),Ee.success("Organization role added successfully!")},onError:S=>{Ee.error(`Failed to add organization role: ${S.message}`)}})},[i,a,d,p,t,r]);return u.jsx(tr,{onOpenChange:n,open:e,children:u.jsxs(nr,{children:[u.jsx(Kn,{children:"Add New Organization Role"}),u.jsx(Vr,{children:"Set the new organization role permissions."}),u.jsx(gn,{...p,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:p.handleSubmit(v),children:[u.jsx($e,{control:p.control,name:"roleName",render:({field:y})=>u.jsxs(Ae,{className:"col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Role Name"}),u.jsx(Me,{children:u.jsx(qe,{type:"text",placeholder:"Developer",className:"",...y})}),u.jsx(De,{})]})}),u.jsx($e,{control:p.control,name:"updateOrganization",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Update Organization"}),u.jsx(Me,{children:u.jsx(qe,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:b=>y.onChange(b.target.checked)})}),u.jsx(De,{})]})}),u.jsx($e,{control:p.control,name:"deleteOrganization",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(Me,{children:u.jsx(qe,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:b=>y.onChange(b.target.checked)})}),u.jsx(De,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(oh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:h,onChange:y=>{y&&c(y)},defaultValue:JSON.stringify(P2,null,2)})}),u.jsx(rr,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(Se,{variant:"destructiveOutline",className:"rounded-full",type:"button",onClick:()=>n(!1),disabled:f,children:"Cancel"}),u.jsx(Se,{variant:"submit",className:"rounded-full",disabled:f||!i,children:"Save Changes"})]})})]})})]})})}async function hSe({roleId:e}){const{data:t}=await Vt.delete(`/Role/${e}`,{id:e,deleted:!0});return t}function gSe(){return ft({mutationFn:({roleId:e})=>hSe({roleId:e})})}const vSe=Cr.object({roleName:Cr.string().nonempty({error:"Please enter a role name."}).regex(/^[a-zA-Z_]*$/,{error:"Role must contain only letters and underscores."}).max(30,{error:"Role name cannot be longer than 30 characters."}),updateOrganization:Cr.boolean(),deleteOrganization:Cr.boolean()});async function ySe({roleId:e,updatedRoleInfo:t}){const{data:n}=await Vt.put(`/Role/${e}`,t);return n}function bSe(){return ft({mutationFn:({roleId:e,updatedRoleInfo:t})=>ySe({roleId:e,updatedRoleInfo:t})})}function xSe({organizationId:e,roleId:t}){return{queryKey:[e,"roles",t],queryFn:()=>wSe(t),refetchInterval:10*1e3}}async function wSe(e){const{data:t}=await Vt.get(`/Role/${e}`);return t}const SSe=({onRoleDeleteClick:e,setIsConfirmingRoleDeletion:t,isRoleDeletionPending:n})=>u.jsxs(u.Fragment,{children:[u.jsx(Kn,{children:"Confirm Role Deletion"}),u.jsx(Vr,{children:"Are you sure you want to delete this role? This action cannot be undone."}),u.jsxs(rr,{children:[u.jsx(Se,{type:"button",variant:"defaultOutline",className:"rounded-full",onClick:()=>t(!1),children:"Cancel"}),u.jsx(Se,{variant:"destructiveOutline",className:"rounded-full",onClick:e,disabled:n,children:n?"Deleting...":"Delete Role"})]})]});function _Se({data:e,isModalOpen:t,closeModal:n,roleDeleted:r}){const{data:i}=uo(xSe({roleId:e.id,organizationId:e.organizationId})),o=hc(),a=o.user&&o.user?.roles?.[e.organizationId]?.role===e.roleName,{update:c,remove:d}=qd(e.organizationId),{mutate:f,isPending:p}=bSe(),{mutate:h,isPending:v}=gSe(),[y,b]=x.useState(!1),S=x.useCallback(()=>{h({roleId:e.id},{onSuccess:()=>{Ee.success("Role deleted successfully!"),r(),n()},onError:N=>{Ee.error("Error",{description:`Failed to delete role: ${N instanceof Error?N.message:String(N)}.`,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}})}})},[e.id,h,r,n]),[C,E]=x.useState(!0),[k,j]=x.useState(JSON.stringify({roles:{...i.organization.roles},clusters:{...i.organization.clusters}},null,2)),I=hn({resolver:wn(vSe),defaultValues:{roleName:i.role,updateOrganization:i?.organization.update||!1,deleteOrganization:i?.organization.delete||!1}}),A=x.useCallback(N=>{E(N.length===0)},[E]),T=x.useCallback(async N=>{if(!c)return;const z={...i};z.organizationId=e.organizationId,z.name=N.roleName,z.role=N.roleName,z.organization.roles=JSON.parse(k).roles,z.organization.clusters=JSON.parse(k).clusters,z.organization.update=N.updateOrganization,z.organization.delete=N.deleteOrganization,k&&C&&f({roleId:e.id,updatedRoleInfo:z},{onSuccess:()=>{Ee.success("Role updated successfully!"),n()},onError:L=>{Ee.error("Error",{description:`Failed to update role: ${L instanceof Error?L.message:String(L)}.`,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}})}})},[c,i,e.organizationId,e.id,k,C,f,n]);return u.jsx(tr,{onOpenChange:n,open:t,children:u.jsx(nr,{children:y?u.jsx(SSe,{onRoleDeleteClick:S,setIsConfirmingRoleDeletion:b,isRoleDeletionPending:v}):u.jsxs(u.Fragment,{children:[u.jsxs(Kn,{children:[a||!c?"View":"Edit",' Organization Role "',i.role,'"']}),u.jsx(gn,{...I,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:I.handleSubmit(T),children:[u.jsx($e,{control:I.control,name:"roleName",render:({field:N})=>u.jsxs(Ae,{className:"col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Role Name"}),u.jsx(Me,{children:u.jsx(qe,{type:"text",placeholder:"Developer",className:"",...N,disabled:a||!c,readOnly:a||!c})}),u.jsx(De,{})]})}),u.jsx($e,{control:I.control,name:"updateOrganization",render:({field:N})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Update Organization"}),u.jsx(Me,{children:u.jsx(qe,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:N.value,onChange:z=>N.onChange(z.target.checked)})}),u.jsx(De,{})]})}),u.jsx($e,{control:I.control,name:"deleteOrganization",render:({field:N})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(Me,{children:u.jsx(qe,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:N.value,onChange:z=>N.onChange(z.target.checked)})}),u.jsx(De,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(oh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:A,onChange:N=>{N&&j(N)},options:a||!c?{readOnly:!0}:void 0,defaultValue:k})}),!a&&(d||c)&&u.jsx(rr,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[d&&u.jsx(Se,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:()=>b(!0),disabled:p,children:"Delete Role"}),c&&u.jsx(Se,{variant:"submit",className:"rounded-full",disabled:!C||p,children:"Save Changes"})]})})]})})]})})})}function cH(){const e=pn(),{organizationId:t,orgRoleId:n}=et({strict:!1}),{create:r}=qd(t),{data:i,refetch:o,isFetching:a,isRefetching:c}=uo(lx(t)),d=x.useMemo(()=>i&&i?.find(j=>j.id===n),[i,n]),f=!!n&&!!d,[p,h]=x.useState(!1),v=x.useCallback(j=>{const I=[n?"..":"",j].filter(Boolean);e({to:I.join("/")})},[n,e]),y=x.useCallback(()=>{o(),h(!1)},[o,h]),b=x.useCallback(()=>{h(!0)},[h]),S=x.useCallback(()=>{o(),h(!1)},[o,h]),C=x.useCallback(j=>{v(j.original.id)},[v]),E=x.useCallback(()=>{v(void 0)},[v]),k=Nc(o);return u.jsxs(u.Fragment,{children:[u.jsx(es,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(x.Suspense,{fallback:u.jsx(ho,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(rh,{data:i,columns:awe,onRowClick:C,children:[u.jsxs(Se,{variant:"defaultOutline",onClick:k,accessKey:"r",disabled:a||c,children:[u.jsx(Ba,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),r&&u.jsxs(Se,{variant:"positiveOutline",onClick:b,accessKey:"a",disabled:p,children:[u.jsx(Lo,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(pSe,{isModalOpen:p,onChangesSaved:S,setIsModalOpen:h}),f&&u.jsx(_Se,{roleDeleted:y,data:d,isModalOpen:f,closeModal:E})]})})]})}const CSe=nx(),ESe=[{header:"User Id",accessorKey:"id",enableSorting:!1},{header:"Email",accessorKey:"email",enableSorting:!1},{header:"First Name",accessorKey:"firstname",enableSorting:!1},{header:"Last Name",accessorKey:"lastname",enableSorting:!1},CSe.display({header:"Roles",enableSorting:!1,id:"roles",cell:e=>e.row.original.roles?.map(t=>t.roleName)?.sort()?.join(", ")}),{header:"Status",accessorKey:"status",enableSorting:!1},{header:"Verified",accessorKey:"isVerified",enableSorting:!1}],kSe=Cr.object({email:Qd.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Cr.string().nonempty({error:"Please select a role."})});async function jSe(e){const{data:t}=await Vt.post("/OrganizationRole/",e);return t}function uH(){return ft({mutationFn:e=>jSe(e)})}Cr.object({email:Qd.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Cr.string().nonempty({error:"Please select a role."})});async function RSe(e){const{data:t}=await Vt.post("/UserInvite/",e);return t}function ISe(){return ft({mutationFn:e=>RSe(e)})}function TSe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=et({strict:!1}),{data:i}=uo(lx(r)),[o,a]=x.useState(!1),c=hn({resolver:wn(kSe),defaultValues:{email:"",roleId:""}}),{mutate:d,isPending:f}=uH(),{mutate:p,isPending:h}=ISe(),v=x.useCallback(async y=>{y&&(o?p:d)(y,{onSuccess:()=>{const b=y.roleId;c.reset(),c.setValue("roleId",b),t(),Ee.success("User invited successfully!"),n(!1),a(!1)},onError:b=>{b?.status===404&&a(!0)}})},[d,c,p,t,n,o]);return u.jsx(tr,{onOpenChange:()=>{n(!1),a(!1),c.reset()},open:e,children:u.jsx(nr,{"aria-describedby":void 0,children:u.jsx(gn,{...c,children:u.jsxs("form",{onSubmit:c.handleSubmit(v),className:"grid gap-4 my-4",children:[u.jsx(Ir,{children:u.jsx(Kn,{children:o?"Invite User":"Add User"})}),u.jsx($e,{control:c.control,name:"email",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Email"}),u.jsx(Me,{children:u.jsx(qe,{type:"email",enterKeyHint:"next",autoComplete:"email",...y})}),u.jsx(De,{})]})}),u.jsx($e,{control:c.control,name:"roleId",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Roles"}),u.jsx(x.Suspense,{fallback:u.jsx(kr,{}),children:u.jsx(Me,{children:u.jsxs(ao,{...y,onValueChange:b=>y.onChange(b),children:[u.jsx(lo,{className:"w-full",children:u.jsx(so,{placeholder:"Choose Role"})}),u.jsx(co,{children:u.jsxs(Po,{children:[u.jsx(Uj,{children:"Role"}),i?.map(b=>u.jsx(bn,{value:b.id,children:b.roleName},b.id))]})})]})})}),u.jsx(De,{})]})}),o&&u.jsxs(Vr,{className:"p-3 my-5 text-white rounded-md bg-amber-600 flex",children:[u.jsx(qX,{className:"inline-block size-12 pr-2"}),u.jsx("span",{children:"This person doesn’t have a Fabric account. Do you want to invite them?"})]}),u.jsx(rr,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(Se,{type:"submit",variant:"submit",className:"rounded-full",disabled:f||h,children:[u.jsx(ca,{})," ",o?"Invite User":"Add User"]})})})]})})})})}async function NSe({roleId:e,userId:t}){const{data:n}=await Vt.delete(`/OrganizationRole/role/${e}/user/${t}`);return n}function ASe(){return ft({mutationFn:({roleId:e,userId:t})=>NSe({roleId:e,userId:t})})}function dH(e){const[t,n]=x.useState(e||!1),r=x.useCallback(i=>{n(i.target.checked)},[]);return[t,r]}function OSe({data:e,readOnly:t,canRemove:n,orgRole:r,selectedRoles:i,setChangesMade:o}){const{mutate:a,isPending:c}=uH(),{mutate:d,isPending:f}=ASe(),p=!!i[r.roleName],[h,v]=x.useState(p),[y,b]=dH(p);return x.useEffect(()=>{y!==h&&(y?a({email:e.email,roleId:r.id},{onSuccess:()=>{v(y),o(!0),Ee.success("Role added successfully")}}):d({userId:e.id,roleId:r.id},{onSuccess:()=>{v(y),o(!0),Ee.success("Role removed successfully")}}))},[a,e.email,e.id,y,r.id,d,o,h]),u.jsxs(Mp,{className:"flex",children:[u.jsx(qe,{type:"checkbox",className:"w-6",disabled:t||c||f||!n&&y,checked:y,onChange:b}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:r.roleName})]},r.id)}function DSe({closeModal:e,data:t,isModalOpen:n,onUserUpdated:r}){const{organizationId:i}=et({strict:!1}),o=hc(),{update:a,remove:c}=qd(i),d=o.user?.email===t.email,{data:f}=uo(lx(i)),p=x.useMemo(()=>t.roles?tf(t.roles,"roleName"):{},[t]),[h,v]=x.useState(!1);return u.jsx(tr,{onOpenChange:h?r:e,open:n,children:u.jsxs(nr,{className:"sm:max-w-[750px]",children:[u.jsx(Ir,{children:u.jsxs(Kn,{children:[a?"Edit ":"View "," ",t.email," ",d?"(yourself)":""]})}),a&&u.jsxs(Vr,{children:["To remove ",d?"your self":"this user"," from the organization, uncheck all of the boxes below."]}),f.map(y=>u.jsx(OSe,{readOnly:!a,canRemove:c,data:t,orgRole:y,selectedRoles:p,setChangesMade:v},y.id))]})})}function $Se(e,t){return e.email>t.email?1:-1}function fH(){const e=pn(),{organizationId:t,orgUserId:n}=et({strict:!1}),{update:r}=qd(t),{data:i,refetch:o,isFetching:a,isRefetching:c}=uo(lx(t)),d=x.useMemo(()=>{const T={};for(const N of i)if(N.users)for(const z of N.users)T[z.id]||(T[z.id]={...z,roles:[]}),T[z.id].roles.push(N);return Object.values(T).sort($Se)},[i]),f=x.useMemo(()=>d?.find(T=>T.id===n),[d,n]),p=x.useCallback(T=>{const N=[n?"..":"",T].filter(Boolean);e({to:N.join("/")})},[n,e]),h=!!n&&!!f,[v,y]=x.useState(!1),[b]=x.useState({attribute:"email",descending:!1}),S=x.useMemo(()=>[{desc:b.descending,id:b.attribute}],[b]),C=x.useCallback(()=>{y(!0)},[y]),E=x.useCallback(()=>{o(),y(!1)},[o,y]),k=x.useCallback(T=>{p(T.original.id)},[p]),j=x.useCallback(()=>{p(void 0)},[p]),I=x.useCallback(()=>{o(),p(void 0)},[p,o]),A=Nc(o);return u.jsxs(u.Fragment,{children:[u.jsx(es,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(x.Suspense,{fallback:u.jsx(ho,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(rh,{data:d,isFetching:a||c,columns:ESe,onRowClick:k,sortingState:S,children:[u.jsxs(Se,{variant:"defaultOutline",onClick:A,accessKey:"r",disabled:a||c,children:[u.jsx(Ba,{})," ",u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),r&&u.jsxs(Se,{variant:"positiveOutline",onClick:C,accessKey:"a",disabled:v,children:[u.jsx(Lo,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(TSe,{isModalOpen:v,onChangesSaved:E,setIsModalOpen:y}),h&&u.jsx(DSe,{closeModal:j,data:f,isModalOpen:h,onUserUpdated:I})]})})]})}function MSe({organizationRole:e,onDeleteOrgModal:t}){const{organizationId:n,organizationName:r,roleName:i}=e,{remove:o,update:a}=pb(n),c=a,{view:d}=qd(n),f=x.useCallback(()=>{t(e)},[t,e]);return u.jsxs(ic,{className:"relative h-full justify-between",children:[u.jsxs(nl,{children:[u.jsxs(gc,{className:"flex items-center justify-between",children:[u.jsx("span",{className:"truncate",children:n}),o&&u.jsxs(Jp,{children:[u.jsx(eh,{className:"p-4 -m-4 -mr-6 hover:text-white",children:u.jsx(jC,{"aria-label":"Options"})}),u.jsxs(th,{children:[u.jsx(vy,{className:"text-gray-600 text-xs",children:"Options"}),u.jsx(yy,{}),u.jsx(We,{to:`${n}`,children:u.jsx(Sr,{children:"Clusters"})}),d&&u.jsx(We,{to:`${n}/roles`,children:u.jsx(Sr,{children:"Roles"})}),d&&u.jsx(We,{to:`${n}/users`,children:u.jsx(Sr,{children:"Users"})}),c&&u.jsx(We,{to:`${n}/billing`,children:u.jsx(Sr,{children:"Billing"})}),u.jsx(yy,{}),o&&u.jsx(Sr,{className:"focus:bg-red/70 focus:text-white",onClick:f,children:"Delete"})]})]})]}),u.jsx(rl,{children:u.jsx("h2",{children:r})})]}),u.jsxs(Xa,{className:"flex justify-between",children:[u.jsx(Mo,{children:So(i)}),u.jsx(We,{to:n,className:"text-sm","aria-label":`View ${r}`,title:`View ${r}`,children:u.jsxs("span",{className:"py-2 transition-all duration-100 ease-in-out border-0 hover:border-b-2",children:["View ",u.jsx(Co,{className:"inline-block"})]})})]})]})}async function PSe(e){const{data:t}=await Vt.delete(`/Organization/${e}`);return t}function zSe(){return ft({mutationFn:e=>PSe(e)})}async function LSe(e){const{data:t}=await Vt.post("/Organization/",{...e});return t}function USe(){return ft({mutationFn:e=>LSe(e)})}const nv=jn({name:wt().max(255,{error:"Name cannot be longer than 255 characters."}),subdomain:wt().max(62,{error:"The subdomain cannot be longer than 62 characters."}).regex(/^[a-zA-Z0-9-]*$/,{error:"Please only use letters, digits and dashes (-) in the subdomain."})});function FSe(){const{user:e}=hc(),t=pn(),n=hn({resolver:wn(nv),defaultValues:{name:"",subdomain:""}}),{setFocus:r,watch:i}=n;x.useEffect(()=>{r("name")},[r]);const o=`${e?.firstname} ${e?.lastname} Org`,a=i("name")||o,c=i("subdomain"),d=x.useMemo(()=>{const y=JV(Qb(a),nv.shape.subdomain.maxLength);return{suggestedSubdomain:y,fullHostName:`future-cluster-names.${c||y}.harperfabric.com`}},[a,c]),{mutate:f,isPending:p}=USe(),h=ur(),v=x.useCallback(async y=>{f({name:y.name||o,subdomain:y.subdomain||d.suggestedSubdomain},{onSuccess:b=>{h.invalidateQueries({queryKey:vp,refetchType:"active"}),kn.reloadUser(En),t({to:`/${b.id}`})}})},[d.suggestedSubdomain,h,f,o,t]);return u.jsx(u.Fragment,{children:u.jsx(gn,{...n,children:u.jsxs("form",{onSubmit:n.handleSubmit(v),className:"grid gap-6 text-white max-w-xl",children:[u.jsx($e,{control:n.control,name:"name",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Name"}),u.jsx(Me,{children:u.jsx(qe,{type:"text",maxLength:nv.shape.name.maxLength,autoCapitalize:"words",placeholder:o,...y})}),u.jsx(De,{})]})}),u.jsx($e,{control:n.control,name:"subdomain",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Subdomain"}),u.jsx(Me,{children:u.jsx(qe,{type:"text",maxLength:nv.shape.subdomain.maxLength,autoCapitalize:"none",placeholder:d.suggestedSubdomain,...y})}),u.jsx(De,{})]})}),u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Full Host Name"}),u.jsx(Me,{children:u.jsx("span",{children:d.fullHostName})}),u.jsx(De,{})]}),u.jsx(rr,{children:u.jsxs(Se,{type:"submit",variant:"submit",className:"rounded-full",disabled:p,children:["Create New Organization ",u.jsx(Co,{})]})})]})})})}function mH(){return u.jsxs(u.Fragment,{children:[u.jsx(es,{}),u.jsx("section",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(FSe,{})})]})}function VSe(){const e=ur(),{data:t}=uo(BK()),{mutate:n,isPending:r}=zSe(),[i,o]=x.useState(!1),[a,c]=x.useState(null),[d,f]=x.useState(""),p=x.useCallback(()=>f(""),[]),h=x.useMemo(()=>{const C=t?.roles||{},E=Object.values(C);return Object.keys(C).map((j,I)=>({organizationId:j,organizationName:E[I].organizationName,roleName:E[I].role})).filter(VB(["organizationId","organizationName"],d)).sort((j,I)=>(j.organizationName||"")>(I.organizationName||"")?1:-1)||[]},[d,t?.roles]),v=x.useCallback(C=>{f(C.currentTarget.value?.toLowerCase()||"")},[]),y=x.useCallback(C=>{C?.organizationId&&n(C.organizationId,{onSuccess:()=>{Ee.success("Success",{description:"Organization successfully deleted.",duration:5e3,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),e.invalidateQueries({queryKey:[]}),o(!1)},onError:()=>o(!1)})},[n,e,o]),b=x.useCallback(C=>{c(C),o(!0)},[]),{createCluster:S}=yr({strict:!1});return h.length===1&&!d.length&&S?u.jsx(Wl,{to:`/${h[0].organizationId}/new-cluster`,replace:!0}):!h.length&&!d.length?u.jsx(mH,{}):u.jsxs(u.Fragment,{children:[u.jsx(es,{children:u.jsxs("div",{className:"flex w-full justify-end gap-2",children:[u.jsx(qe,{placeholder:"Filter by name",className:"inline-block w-48 md:w-64 bg-black border",value:d,onChange:v}),u.jsx(We,{to:"/new-org",children:u.jsxs(Se,{variant:"positive",className:"rounded-full w-44",accessKey:"n",children:[u.jsx(Lo,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"N"}),"ew Organization"]})]})})]})}),u.jsx("section",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12",children:[h.map(C=>u.jsx("div",{className:"col-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:u.jsx(MSe,{organizationRole:C,onDeleteOrgModal:b})},C.organizationId)),!h.length&&u.jsxs("div",{className:"col-span-1 md:col-span-12 text-center",children:[u.jsx("h2",{className:"my-4 text-xl",children:"No matches found."}),u.jsx(Se,{variant:"outline",onClick:p,children:"Clear Filters"})]})]})}),a&&u.jsx(Zb,{typeOfThingBeingDeleted:"organization",nameOfThingBeingDeleted:a.organizationName,isModalOpen:i,setIsModalOpen:()=>o(!1),deletionConfirmed:()=>y(a),deletionPending:r})]})}function BSe(){const{isLoading:e}=pc(),{createCluster:t}=yr({strict:!1}),[,n]=ef(Ic.SavedClusterState,null);return x.useEffect(()=>{t&&n(t)},[t,n]),e?u.jsx(ho,{className:"fixed z-50 translate-1/2"}):u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:u.jsx(tL,{})}),u.jsx("main",{children:u.jsx(tl,{})})]})}const HSe=["/","/forgot-password","/reset-password","/sign-in","/sign-up","/verify-email"];function qSe(){const e=BB();return!HSe.includes(e)&&{redirect:e}}const dx=nt({getParentRoute:()=>db,id:"_dashboardLayout",component:BSe,beforeLoad:({context:e})=>{const t=e.authentication[En];if(t&&!t.isLoading&&!t.user)throw Dd({to:"/sign-in",search:qSe()})}}),Gj=nt({getParentRoute:()=>dx,id:"_orgsLayout"});nt({getParentRoute:()=>Gj,path:"/",component:VSe});nt({getParentRoute:()=>Gj,path:"/new-org",component:mH});const Ac=nt({getParentRoute:()=>Gj,path:"$organizationId",beforeLoad:async e=>({organization:await e.context.queryClient.ensureQueryData(Tc(e.params.organizationId))})}),GSe=nt({getParentRoute:()=>Ac,path:"/roles",component:cH}),KSe=nt({getParentRoute:()=>Ac,path:"/roles/$orgRoleId",component:cH}),ZSe=nt({getParentRoute:()=>Ac,path:"/users",component:fH}),YSe=nt({getParentRoute:()=>Ac,path:"/users/$orgUserId",component:fH});rwe(Ac);const pH=nt({getParentRoute:()=>Ac,id:"_clusterLayout"});nt({getParentRoute:()=>pH,path:"/",component:e0e});nt({getParentRoute:()=>Ac,path:"/new-cluster",component:Fj});nt({getParentRoute:()=>Oc,path:"/edit",component:Fj});function WSe(){return u.jsx(tl,{})}const Oc=nt({getParentRoute:()=>pH,path:"$clusterId",component:WSe,beforeLoad:async({context:e,params:t})=>({cluster:await e.queryClient.ensureQueryData(Cc(t.clusterId))})});async function XSe(e){await Vt.patch(`/ResetPasswordUpdater/${e}`)}async function hH(e){const{instanceClient:t,...n}=e,{data:r}=await t.post("/",{operation:"add_user",...n});return r}function QSe(){return ft({mutationFn:hH})}async function gH({username:e,password:t,role:n,active:r,instanceClient:i}){const{data:o}=await i.post("/",{operation:"alter_user",username:e,password:t,role:n,active:r});return o}function JSe(){return ft({mutationFn:gH})}async function vH({username:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_user",username:e});return n}function e_e(){return ft({mutationFn:vH})}async function t_e({clusterId:e,initialUsername:t,desiredUsername:n,newPassword:r,tempPassword:i,instanceClient:o}){if(!i)throw new Error("You may not have permission to set the password on this cluster.");try{const a=await m1({username:t,password:i,instanceClient:o,entityId:e});return n===x_?await gH({username:n,password:r,instanceClient:o}):(await hH({username:n,password:r,role:"super_user",active:!0,instanceClient:o}),await vH({username:x_,instanceClient:o}),await m1({username:n,password:r,instanceClient:o,entityId:e})),await XSe(e),a}catch(a){throw await yp({entityId:e,instanceClient:o}),a}}function n_e(){return ft({mutationFn:t_e})}const Hu=jn({username:bj,role:wt().nonempty({error:"Please select a role."}),password:Zp.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:wt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function r_e(){const{user:e}=hc(),{clusterId:t}=et({strict:!1}),{data:n}=zt(Cc(t,!0)),r=pn(),i=x.useMemo(()=>gC(n),[n]),o=fb(i),{redirect:a}=yr({strict:!1}),c=tn(),d=hn({resolver:wn(Hu),defaultValues:{confirmPassword:"",password:"",role:"super_user",username:e?.email??""}}),{setFocus:f,control:p,handleSubmit:h}=d;x.useEffect(()=>{f("password")},[f]);const v=n?.instances?.find(C=>C.tempPassword)?.tempPassword,{mutate:y,isPending:b}=n_e(),S=x.useCallback(async C=>{if(!i){Ee.error("Cluster is not yet fully loaded, please wait a moment before trying to sign in.");return}y({instanceClient:o,clusterId:t,newPassword:C.password,tempPassword:v,initialUsername:x_,desiredUsername:C.username},{onSuccess:async({message:E,user:k})=>{Ee.success(E),kn.setUserForEntity(n,k),c.invalidate(),await r({to:a?.startsWith("/")?a:aC})}})},[n,t,o,r,i,a,c,y,v]);return n&&!n.resetPassword?u.jsx(Wl,{to:"../sign-in",replace:!0}):u.jsxs(u.Fragment,{children:[u.jsx("nav",{className:"fixed top-20 w-full h-12 z-39 px-4 md:px-12 bg-grey-700 flex items-center",children:u.jsx(Sb,{})}),u.jsx("div",{className:"items-center justify-center flex mt-32 py-4 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h2",{className:"text-2xl font-light",children:"Create Admin User"}),u.jsx("p",{className:"text-muted-foreground",children:"You are ready to create your first user in your new cluster. These credentials belong to you alone, and you can create more users and roles once you create this first one."}),u.jsx(gn,{...d,children:u.jsxs("form",{onSubmit:h(S),className:"my-4",children:[u.jsx($e,{control:p,name:"username",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Username"}),u.jsx(Me,{children:u.jsx(qe,{autoComplete:"username",type:"text",...C})}),u.jsx(De,{})]})}),u.jsx($e,{control:p,name:"password",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Password"}),u.jsx(Me,{children:u.jsx(qe,{type:"password",...C})}),u.jsx(De,{})]})}),u.jsx($e,{control:p,name:"confirmPassword",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Confirm Password"}),u.jsx(Me,{children:u.jsx(qe,{type:"password",...C})}),u.jsx(De,{})]})}),u.jsx(Se,{disabled:b,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Create Admin User"})]})}),u.jsxs("p",{className:"text-muted-foreground flex gap-2 align-middle",children:[u.jsx(NW,{size:36,className:"flex-none"}),u.jsx("span",{children:"These credentials will be used to sign into your cluster directly, providing you a secure connection from your browser to your cluster."})]})]})})]})}function i_e({columns:e,data:t}){const n=ox({data:t,columns:e,getCoreRowModel:ix()});return u.jsx("div",{className:"bg-black-dark rounded-md",children:u.jsxs(ax,{children:[u.jsx(nh,{children:n.getHeaderGroups().map(r=>u.jsx(Ai,{className:"border-none",children:r.headers.map(i=>u.jsx(qj,{className:"p-4",style:{width:`${i.getSize()}%`},children:i.isPlaceholder?null:mc(i.column.columnDef.header,i.getContext())},i.id))},r.id))}),u.jsx(sx,{className:"bg-black",children:n.getRowModel().rows?.length?n.getRowModel().rows.map(r=>u.jsx(Ai,{"data-state":r.getIsSelected()&&"selected",className:"hover:bg-muted/10 data-[state=selected]:bg-muted",children:r.getVisibleCells().map(i=>u.jsx(Ya,{className:"p-4",style:{width:`${i.column.getSize()}%`},children:mc(i.column.columnDef.cell,i.getContext())},i.id))},r.id)):u.jsx(Ai,{children:u.jsx(Ya,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function o_e(){return u.jsx("div",{className:"flex-col items-center justify-center px-16 space-y-3 text-center pt-30",children:u.jsx("p",{children:"No instances found."})})}function a_e({instance:e}){const{user:t,isLoading:n}=Wa(e.id),r=x.useMemo(()=>vC(e),[e]),i=fb(r),o=x.useCallback(async()=>{await yp({instanceClient:i,entityId:e.id}),kn.setUserForEntity(e,null)},[e,i]);return n||!["CLONE_READY","RUNNING","UPDATED"].includes(e.status)?u.jsx(kP,{className:"animate-spin",color:"gray"}):t?u.jsxs("span",{className:"flex gap-4",children:[u.jsx(We,{to:`../instance/${e.id}${el}`,className:"text-sm","aria-label":`Go to ${e.name} instance`,title:`Go to ${e.name} instance`,children:u.jsx(Se,{variant:"positiveOutline",children:"View"})}),u.jsx(Se,{variant:"destructiveOutline",className:"text-sm","aria-label":`Sign out from ${e.name} instance`,title:`Sign out from ${e.name} instance`,onClick:o,children:"Sign Out"})]}):u.jsx(We,{to:`../instance/${e.id}/sign-in`,className:"text-sm","aria-label":`Sign in to ${e.name} instance`,title:`Sign in to ${e.name} instance`,children:u.jsx(Se,{variant:"positiveOutline",children:"Sign In"})})}function s_e(){const{clusterId:e}=et({strict:!1}),{data:t,isLoading:n}=zt(Cc(e,!0)),r=WV(t),i=x.useMemo(()=>[{id:"instanceActions",size:1,minSize:1,cell:a=>u.jsx("div",{className:"flex justify-end",children:u.jsx(a_e,{instance:a.row.original})})},r&&{accessorKey:"instanceFqdn",size:90,header:"URL",cell:a=>UB({secure:a.row.original.operationsApiSecure?"true":"false",port:a.row.original.operationsApiPort,fqdn:a.row.original.instanceFqdn})},!r&&{accessorKey:"name",size:90,header:"Name"},!r&&{accessorKey:"status",header:"Status",size:1,minSize:1,cell:a=>{const c=a.getValue();return u.jsx(Mo,{variant:D5(c),children:So(c)})}},!r&&{accessorKey:"version",size:1,minSize:1,header:"Version"},!r&&{accessorKey:"storageGb",size:1,minSize:1,header:"Storage",cell:a=>{const c=a.getValue();return Da(c,Math.pow(1024,3))}},!r&&{accessorKey:"cpuCores",size:1,minSize:1,header:"Cores/Threads",cell:a=>u.jsxs(u.Fragment,{children:[a.row.original.cpuCores," / ",a.row.original.threads]})},!r&&{accessorKey:"memoryMb",size:1,minSize:1,header:"Memory",cell:a=>{const c=a.getValue();return Da(c,Math.pow(1024,2))}}].filter(ua),[r]),o=x.useMemo(()=>t?.instances?t.instances.filter(a=>a.status&&!DE.includes(a.status)).sort(XV):[],[t]);return u.jsxs(u.Fragment,{children:[u.jsx(es,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(ic,{className:"p-0 mt-4 min-h-96",children:u.jsx(Xa,{className:"p-0 min-h-96",children:n?u.jsx(kr,{}):o.length?u.jsx(i_e,{data:o,columns:i}):u.jsx(o_e,{})})})})]})}function Hl({children:e,className:t}){return u.jsxs(u.Fragment,{children:[u.jsx(es,{}),u.jsx("div",{className:ia("mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))] flex justify-center",t),children:e})]})}function l_e(){const{clusterId:e}=et({strict:!1}),{data:t,isLoading:n}=zt(Cc(e,2e3)),r=t?.status,i=x.useMemo(()=>r&&kb.includes(r),[r]);return n||!t?u.jsx(Hl,{className:"flex justify-center",children:u.jsx(kr,{})}):i?u.jsx(Hl,{className:"flex justify-center",children:u.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"All done!"}),u.jsx(lp,{cluster:t,forceProgressBarVisible:!0}),u.jsx("p",{children:"Your cluster finished updating, and is ready for interaction."}),u.jsx("div",{className:"text-center",children:u.jsx(Mj,{cluster:t})})]})}):u.jsx(Hl,{className:"flex justify-center",children:u.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),u.jsx(lp,{cluster:t,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is updating with the latest changes. This includes waiting several minutes to let traffic drain safely.",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}function c_e(){const e=tn(),{clusterId:t}=et({strict:!1}),{data:n,isLoading:r}=zt(Cc(t,2e3)),i=n?.status,o=x.useMemo(()=>i&&kb.includes(i),[i]),a=Yp(i),[,c]=ef(Ic.SavedClusterState,null),d=x.useCallback(()=>{c(n),e.navigate({to:`/${n.organizationId}/new-cluster`})},[n,e,c]);return r||!n?u.jsx(Hl,{className:"flex justify-center",children:u.jsx(kr,{})}):a?u.jsx(Hl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4 items-center",children:[u.jsx(tX,{className:"w-24 h-24"}),u.jsxs("span",{children:["Your cluster failed to successfully start. This is usually caused by temporary communication problems. Would you like to try again? We also get notified about these failures. ",u.jsx(Qs,{})," if you want more help."]}),u.jsx(Se,{type:"button",variant:"positiveOutline",onClick:d,children:"Try Again"})]})}):o?u.jsx(Hl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"It's ready!"}),u.jsx(lp,{cluster:n,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Let's set up your secure, browser-to-cluster connection now. ",u.jsx("span",{className:"text-muted-foreground",children:"Did you know you connect straight to your cluster, providing a private secure connection?"})]}),u.jsx("div",{className:"text-center",children:u.jsx(Mj,{cluster:n})})]})}):u.jsx(Hl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),u.jsx(lp,{cluster:n,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is spinning up with the latest changes, including your own DNS records and private connections. Please wait while we get everything going.",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}nt({getParentRoute:()=>Oc,path:"instances",component:s_e});nt({getParentRoute:()=>Oc,path:"starting-up",component:c_e});nt({getParentRoute:()=>Oc,path:"scaling",component:l_e});nt({getParentRoute:()=>Oc,path:"sign-in",component:xj,beforeLoad:({context:e,location:t,params:n})=>{if(e.authentication[n.clusterId]?.user){const r=t?.search;throw Dd({to:r?.redirect?.startsWith("/")?r.redirect:aC})}}});nt({getParentRoute:()=>Oc,path:"instance/$instanceId/sign-in",component:xj,beforeLoad:({context:e,location:t,params:n})=>{if(e.authentication[n.instanceId||n.clusterId]?.user){const r=t?.search;throw Dd({to:r?.redirect?.startsWith("/")?r.redirect:aC})}}});nt({getParentRoute:()=>Oc,path:"finish-setup",component:r_e});function u_e(e){return nt({getParentRoute:()=>e,path:"apis"}).lazy(()=>Ip(()=>import("./index.lazy-DhQph7si.js"),__vite__mapDeps([0,1,2])).then(t=>t.route))}const JS="__root__",$l="importedApplications",ko="newApplication";function z2(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i)||e[i]!==t[i])return!1;return!0}function Iv(e,t){const[n,r]=x.useState(t),[i,o]=x.useState(e);return x.useEffect(()=>{z2(n,t)||(r(t),o(e))},[n,t,e]),z2(n,t)?[i,o]:[e,o]}const zu={};function ky(e,t,n){const r=x.useCallback(i=>t(i),[n]);x.useEffect(()=>(zu[e]||(zu[e]=[]),zu[e].push(r),function(){const o=zu[e].indexOf(r);o>=0&&zu[e].splice(o,1)}),[e,t,r])}function fx(e,t){const n=zu[e];if(n)for(const r of n)r(t)}function L2(e,t){return()=>fx(e,t)}function U2(e,t){return x.useCallback(()=>fx(e,t),[e,t])}function F2(e,t){return Pj(sessionStorage.getItem(String(e)))??t}function d_e(e,t){t==null?sessionStorage.removeItem(String(e)):sessionStorage.setItem(String(e),JSON.stringify(t))}function Ju(e,t){const n=Iv(F2(e,t),[e]),[r,i]=n;return x.useEffect(()=>{d_e(e,r),fx(`Session:${e}`,r)},[e,r]),ky(`Session:${e}`,function(a){r!==a&&i(a)},[r,e,t]),x.useEffect(function(){const a=c=>{c.key===e&&i(F2(e,t))};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}},[e,i,t]),n}function mx(e){const{instanceId:t,clusterId:n}=et({strict:!1}),r=En,[i,o]=Ju(`EditorFileContent/${r}}/${e}`,void 0);return x.useMemo(()=>({content:e?i:void 0,setContent:o}),[e,i,o])}function zr(e){return!!e?.entries}const yH=x.createContext(null);function mi(){return x.useContext(yH)}function Dc(e,t){const[n,r]=x.useState(t);return ky(e,i=>r(i),[r]),n}function jd(e,t){fx(e,t)}function rv(e,t){return()=>jd(e,t)}function li(e,t){return x.useCallback(()=>jd(e,t),[e,t])}function f_e({toggledSidebar:e,toggleSidebar:t}){const n=Yt(),{openedEntryContents:r,openedEntry:i,isSavingFile:o,restrictPackageModification:a}=mi(),{content:c}=mx(i?.path),d=Gd(),f=n.entityType==="instance"?"Instance":"Cluster",p=li("ShowAddDirectoryOrFileModalType","file"),h=li("ShowAddDirectoryOrFileModalType","directory"),v=li("ShowDownloadApplicationModal",!0),y=li("ShowRenameFileModal",!0),b=li("ShowDeleteDirectoryOrFileModal",!0),S=li("ShowRedeployApplicationModal",!0),C=U2("SaveFile",!0),E=U2("RevertChanges",!0),k=c===void 0||c===r;return u.jsxs("div",{className:"absolute top-0 right-0 left-0 backdrop-blur-sm bg-black-10 shadow-xl flex pr-4 md:pr-12",children:[u.jsxs(Se,{variant:"ghost",className:(e?"toggled-sidebar-toggler":"hidden-sidebar-toggler")+" inline-flex text-sm md:hidden focus:outline-none focus:ring-2 text-white hover:text-grey focus:ring-gray-600 rounded-none",onClick:t,children:[u.jsxs("span",{className:"sr-only",children:[e?"Close":"Open"," sidebar"]}),e?u.jsx(JX,{}):u.jsx(XX,{})]}),i&&i?.path!==ko&&u.jsxs(u.Fragment,{children:[i.package&&u.jsxs(wE,{children:[u.jsx(SE,{asChild:!0,children:u.jsxs(Se,{variant:"ghost",type:"button",className:"cursor-help",children:[u.jsx(FX,{width:16,height:16}),u.jsx("span",{className:"hidden md:inline-block",children:"Imported applications are read-only"})]})}),u.jsx(_E,{children:a?u.jsxs(u.Fragment,{children:["This application is read-only, and cannot be modified.",u.jsx("br",{}),"It helps govern clustering amongst your instances."]}):u.jsx(u.Fragment,{children:"This application is read-only, and cannot be directly modified. But you can re-deploy or remove it."})})]}),!zr(i)&&!i.package&&d&&u.jsxs(Se,{variant:"default",className:"rounded-none",onClick:C,disabled:k||o,children:[u.jsx(ca,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"S"}),"ave"]})]}),!zr(i)&&!i.package&&d&&u.jsxs(Se,{variant:"ghost",className:"rounded-none",onClick:y,disabled:!k||o,children:[u.jsx(RP,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"ename"]})]}),!i.package&&d&&u.jsxs(Se,{variant:"ghost",className:"rounded-none",onClick:p,children:[u.jsx(hX,{}),u.jsxs("span",{children:[u.jsx("u",{children:"N"}),"ew",u.jsx("span",{className:"hidden mlg:inline-block",children:" File"})]})]}),!i.package&&d&&u.jsxs(Se,{variant:"ghost",className:"rounded-none",onClick:h,children:[u.jsx(vX,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd",u.jsx("span",{className:"hidden xl:inline-block",children:" Directory"})]})]}),i.project&&u.jsxs(Se,{variant:"ghost",className:"rounded-none",onClick:v,children:[u.jsx(CP,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:["Download",u.jsx("span",{className:"hidden xl:inline-block",children:" Application"})]})]}),!!i.package&&d&&!a&&u.jsxs(Se,{variant:"ghost",className:"rounded-none",onClick:S,children:[u.jsx(IC,{}),u.jsxs("span",{children:["Redeploy ",u.jsx("u",{children:"P"}),"ackage"]})]}),u.jsx("div",{className:"grow"}),d&&u.jsx(EE,{targetNoun:f,instanceClient:n.instanceClient,operation:"restart_service",variant:"ghost",className:"rounded-none mx-0 md:mx-0",disabled:!k||o}),!zr(i)&&!i.package&&d&&u.jsxs(Se,{variant:"ghost",className:"rounded-none",onClick:E,disabled:k||o,children:[u.jsx(_Q,{}),u.jsx("span",{className:"hidden xl:inline-block",children:"Revert Changes"})]}),!a&&d&&u.jsxs(Se,{variant:"destructiveGhost",className:"rounded-none",onClick:b,children:[u.jsx(Qa,{}),u.jsxs("span",{className:"hidden xl:inline-block",children:[u.jsx("u",{children:"D"}),"elete"]})]})]})]})}function m_e(e){return x.useCallback((t,n,r)=>{if(n!=="href")return t;if(t.startsWith("http"))return r.properties.target="_blank",t;{const i=HB().split("?")[0];switch(t){case"./apis":case"./config":case"./config/roles":case"./config/users":case"./databases":case"./logs":case"./status":return`${i}/${t.slice(2)}`}return`${i}?open=${e}/${t.slice(2)}`}},[e])}function p_e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const h_e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,g_e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,v_e={};function V2(e,t){return(v_e.jsx?g_e:h_e).test(e)}const y_e=/[ \t\n\f\r]/g;function b_e(e){return typeof e=="object"?e.type==="text"?B2(e.value):!1:B2(e)}function B2(e){return e.replace(y_e,"")===""}class ah{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ah.prototype.normal={};ah.prototype.property={};ah.prototype.space=void 0;function bH(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ah(n,r,t)}function V1(e){return e.toLowerCase()}class pi{constructor(t,n){this.attribute=n,this.property=t}}pi.prototype.attribute="";pi.prototype.booleanish=!1;pi.prototype.boolean=!1;pi.prototype.commaOrSpaceSeparated=!1;pi.prototype.commaSeparated=!1;pi.prototype.defined=!1;pi.prototype.mustUseProperty=!1;pi.prototype.number=!1;pi.prototype.overloadedBoolean=!1;pi.prototype.property="";pi.prototype.spaceSeparated=!1;pi.prototype.space=void 0;let x_e=0;const pt=$c(),Bn=$c(),B1=$c(),ke=$c(),Qt=$c(),ed=$c(),_i=$c();function $c(){return 2**++x_e}const H1=Object.freeze(Object.defineProperty({__proto__:null,boolean:pt,booleanish:Bn,commaOrSpaceSeparated:_i,commaSeparated:ed,number:ke,overloadedBoolean:B1,spaceSeparated:Qt},Symbol.toStringTag,{value:"Module"})),e_=Object.keys(H1);class Kj extends pi{constructor(t,n,r,i){let o=-1;if(super(t,n),H2(this,"space",i),typeof r=="number")for(;++o<e_.length;){const a=e_[o];H2(this,e_[o],(r&H1[a])===H1[a])}}}Kj.prototype.defined=!0;function H2(e,t,n){n&&(e[t]=n)}function rf(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Kj(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[V1(r)]=r,n[V1(o.attribute)]=r}return new ah(t,n,e.space)}const xH=rf({properties:{ariaActiveDescendant:null,ariaAtomic:Bn,ariaAutoComplete:null,ariaBusy:Bn,ariaChecked:Bn,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:Qt,ariaCurrent:null,ariaDescribedBy:Qt,ariaDetails:null,ariaDisabled:Bn,ariaDropEffect:Qt,ariaErrorMessage:null,ariaExpanded:Bn,ariaFlowTo:Qt,ariaGrabbed:Bn,ariaHasPopup:null,ariaHidden:Bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Qt,ariaLevel:ke,ariaLive:null,ariaModal:Bn,ariaMultiLine:Bn,ariaMultiSelectable:Bn,ariaOrientation:null,ariaOwns:Qt,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:Bn,ariaReadOnly:Bn,ariaRelevant:null,ariaRequired:Bn,ariaRoleDescription:Qt,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:Bn,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function wH(e,t){return t in e?e[t]:t}function SH(e,t){return wH(e,t.toLowerCase())}const w_e=rf({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ed,acceptCharset:Qt,accessKey:Qt,action:null,allow:null,allowFullScreen:pt,allowPaymentRequest:pt,allowUserMedia:pt,alt:null,as:null,async:pt,autoCapitalize:null,autoComplete:Qt,autoFocus:pt,autoPlay:pt,blocking:Qt,capture:null,charSet:null,checked:pt,cite:null,className:Qt,cols:ke,colSpan:null,content:null,contentEditable:Bn,controls:pt,controlsList:Qt,coords:ke|ed,crossOrigin:null,data:null,dateTime:null,decoding:null,default:pt,defer:pt,dir:null,dirName:null,disabled:pt,download:B1,draggable:Bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:pt,formTarget:null,headers:Qt,height:ke,hidden:B1,high:ke,href:null,hrefLang:null,htmlFor:Qt,httpEquiv:Qt,id:null,imageSizes:null,imageSrcSet:null,inert:pt,inputMode:null,integrity:null,is:null,isMap:pt,itemId:null,itemProp:Qt,itemRef:Qt,itemScope:pt,itemType:Qt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:pt,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:pt,muted:pt,name:null,nonce:null,noModule:pt,noValidate:pt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:pt,optimum:ke,pattern:null,ping:Qt,placeholder:null,playsInline:pt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:pt,referrerPolicy:null,rel:Qt,required:pt,reversed:pt,rows:ke,rowSpan:ke,sandbox:Qt,scope:null,scoped:pt,seamless:pt,selected:pt,shadowRootClonable:pt,shadowRootDelegatesFocus:pt,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:Bn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:pt,useMap:null,value:Bn,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Qt,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:pt,declare:pt,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:pt,noHref:pt,noShade:pt,noWrap:pt,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:Bn,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:pt,disableRemotePlayback:pt,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:SH}),S_e=rf({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:_i,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:Qt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:pt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ed,g2:ed,glyphName:ed,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:_i,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ke,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Qt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_i,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_i,rev:_i,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_i,requiredFeatures:_i,requiredFonts:_i,requiredFormats:_i,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:_i,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_i,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_i,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:wH}),_H=rf({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),CH=rf({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:SH}),EH=rf({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),__e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},C_e=/[A-Z]/g,q2=/-[a-z]/g,E_e=/^data[-\w.:]+$/i;function k_e(e,t){const n=V1(t);let r=t,i=pi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&E_e.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(q2,R_e);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!q2.test(o)){let a=o.replace(C_e,j_e);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Kj}return new i(r,t)}function j_e(e){return"-"+e.toLowerCase()}function R_e(e){return e.charAt(1).toUpperCase()}const I_e=bH([xH,w_e,_H,CH,EH],"html"),Zj=bH([xH,S_e,_H,CH,EH],"svg");function T_e(e){return e.join(" ").trim()}var Ou={},t_,G2;function N_e(){if(G2)return t_;G2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
128
+ `},M2=Dwe(zwe)(tH),Lwe={config:Mwe},Uwe=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(i){return n.reduceRight(function(o,a){return a(o)},i)}};function nH(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],nH(e[n],t[n]))}),A2(A2({},e),t)}var Fwe={type:"cancelation",msg:"operation is manually canceled"};function WS(e){var t=!1,n=new Promise(function(r,i){e.then(function(o){return t?i(Fwe):r(o)}),e.catch(i)});return n.cancel=function(){return t=!0},n}var Vwe=Awe.create({config:Owe,isInitialized:!1,resolve:null,reject:null,monaco:null}),rH=mwe(Vwe,2),ih=rH[0],cx=rH[1];function Bwe(e){var t=Lwe.config(e),n=t.monaco,r=fwe(t,["monaco"]);cx(function(i){return{config:nH(i.config,r),monaco:n}})}function Hwe(){var e=ih(function(t){var n=t.monaco,r=t.isInitialized,i=t.resolve;return{monaco:n,isInitialized:r,resolve:i}});if(!e.isInitialized){if(cx({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),WS(XS);if(window.monaco&&window.monaco.editor)return iH(window.monaco),e.resolve(window.monaco),WS(XS);Uwe(qwe,Kwe)(Zwe)}return WS(XS)}function qwe(e){return document.body.appendChild(e)}function Gwe(e){var t=document.createElement("script");return e&&(t.src=e),t}function Kwe(e){var t=ih(function(r){var i=r.config,o=r.reject;return{config:i,reject:o}}),n=Gwe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Zwe(){var e=ih(function(n){var r=n.config,i=n.resolve,o=n.reject;return{config:r,resolve:i,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){iH(n),e.resolve(n)},function(n){e.reject(n)})}function iH(e){ih().monaco||cx({monaco:e})}function Ywe(){return ih(function(e){var t=e.monaco;return t})}var XS=new Promise(function(e,t){return cx({resolve:e,reject:t})}),oH={config:Bwe,init:Hwe,__getMonacoInstance:Ywe},Wwe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},QS=Wwe,Xwe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Qwe=Xwe;function Jwe({children:e}){return X.createElement("div",{style:Qwe.container},e)}var eSe=Jwe,tSe=eSe;function nSe({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:o,wrapperProps:a}){return X.createElement("section",{style:{...QS.wrapper,width:e,height:t},...a},!n&&X.createElement(tSe,null,r),X.createElement("div",{ref:i,style:{...QS.fullWidth,...!n&&QS.hide},className:o}))}var rSe=nSe,aH=x.memo(rSe);function iSe(e){x.useEffect(e,[])}var sH=iSe;function oSe(e,t,n=!0){let r=x.useRef(!0);x.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Ei=oSe;function Pm(){}function Bu(e,t,n,r){return aSe(e,r)||sSe(e,t,n,r)}function aSe(e,t){return e.editor.getModel(lH(e,t))}function sSe(e,t,n,r){return e.editor.createModel(t,n,r?lH(e,r):void 0)}function lH(e,t){return e.Uri.parse(t)}function lSe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:o,modifiedModelPath:a,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:d=!1,theme:f="light",loading:p="Loading...",options:h={},height:v="100%",width:y="100%",className:b,wrapperProps:S={},beforeMount:C=Pm,onMount:E=Pm}){let[k,j]=x.useState(!1),[I,A]=x.useState(!0),T=x.useRef(null),N=x.useRef(null),z=x.useRef(null),L=x.useRef(E),K=x.useRef(C),J=x.useRef(!1);sH(()=>{let W=oH.init();return W.then(M=>(N.current=M)&&A(!1)).catch(M=>M?.type!=="cancelation"&&console.error("Monaco initialization: error:",M)),()=>T.current?B():W.cancel()}),Ei(()=>{if(T.current&&N.current){let W=T.current.getOriginalEditor(),M=Bu(N.current,e||"",r||n||"text",o||"");M!==W.getModel()&&W.setModel(M)}},[o],k),Ei(()=>{if(T.current&&N.current){let W=T.current.getModifiedEditor(),M=Bu(N.current,t||"",i||n||"text",a||"");M!==W.getModel()&&W.setModel(M)}},[a],k),Ei(()=>{let W=T.current.getModifiedEditor();W.getOption(N.current.editor.EditorOption.readOnly)?W.setValue(t||""):t!==W.getValue()&&(W.executeEdits("",[{range:W.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),W.pushUndoStop())},[t],k),Ei(()=>{T.current?.getModel()?.original.setValue(e||"")},[e],k),Ei(()=>{let{original:W,modified:M}=T.current.getModel();N.current.editor.setModelLanguage(W,r||n||"text"),N.current.editor.setModelLanguage(M,i||n||"text")},[n,r,i],k),Ei(()=>{N.current?.editor.setTheme(f)},[f],k),Ei(()=>{T.current?.updateOptions(h)},[h],k);let H=x.useCallback(()=>{if(!N.current)return;K.current(N.current);let W=Bu(N.current,e||"",r||n||"text",o||""),M=Bu(N.current,t||"",i||n||"text",a||"");T.current?.setModel({original:W,modified:M})},[n,t,i,e,r,o,a]),Y=x.useCallback(()=>{!J.current&&z.current&&(T.current=N.current.editor.createDiffEditor(z.current,{automaticLayout:!0,...h}),H(),N.current?.editor.setTheme(f),j(!0),J.current=!0)},[h,f,H]);x.useEffect(()=>{k&&L.current(T.current,N.current)},[k]),x.useEffect(()=>{!I&&!k&&Y()},[I,k,Y]);function B(){let W=T.current?.getModel();c||W?.original?.dispose(),d||W?.modified?.dispose(),T.current?.dispose()}return X.createElement(aH,{width:y,height:v,isEditorReady:k,loading:p,_ref:z,className:b,wrapperProps:S})}var cSe=lSe;x.memo(cSe);function uSe(e){let t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}var dSe=uSe,tv=new Map;function fSe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:o,theme:a="light",line:c,loading:d="Loading...",options:f={},overrideServices:p={},saveViewState:h=!0,keepCurrentModel:v=!1,width:y="100%",height:b="100%",className:S,wrapperProps:C={},beforeMount:E=Pm,onMount:k=Pm,onChange:j,onValidate:I=Pm}){let[A,T]=x.useState(!1),[N,z]=x.useState(!0),L=x.useRef(null),K=x.useRef(null),J=x.useRef(null),H=x.useRef(k),Y=x.useRef(E),B=x.useRef(),W=x.useRef(r),M=dSe(o),Z=x.useRef(!1),U=x.useRef(!1);sH(()=>{let P=oH.init();return P.then(F=>(L.current=F)&&z(!1)).catch(F=>F?.type!=="cancelation"&&console.error("Monaco initialization: error:",F)),()=>K.current?D():P.cancel()}),Ei(()=>{let P=Bu(L.current,e||r||"",t||i||"",o||n||"");P!==K.current?.getModel()&&(h&&tv.set(M,K.current?.saveViewState()),K.current?.setModel(P),h&&K.current?.restoreViewState(tv.get(o)))},[o],A),Ei(()=>{K.current?.updateOptions(f)},[f],A),Ei(()=>{!K.current||r===void 0||(K.current.getOption(L.current.editor.EditorOption.readOnly)?K.current.setValue(r):r!==K.current.getValue()&&(U.current=!0,K.current.executeEdits("",[{range:K.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),K.current.pushUndoStop(),U.current=!1))},[r],A),Ei(()=>{let P=K.current?.getModel();P&&i&&L.current?.editor.setModelLanguage(P,i)},[i],A),Ei(()=>{c!==void 0&&K.current?.revealLine(c)},[c],A),Ei(()=>{L.current?.editor.setTheme(a)},[a],A);let te=x.useCallback(()=>{if(!(!J.current||!L.current)&&!Z.current){Y.current(L.current);let P=o||n,F=Bu(L.current,r||e||"",t||i||"",P||"");K.current=L.current?.editor.create(J.current,{model:F,automaticLayout:!0,...f},p),h&&K.current.restoreViewState(tv.get(P)),L.current.editor.setTheme(a),c!==void 0&&K.current.revealLine(c),T(!0),Z.current=!0}},[e,t,n,r,i,o,f,p,h,a,c]);x.useEffect(()=>{A&&H.current(K.current,L.current)},[A]),x.useEffect(()=>{!N&&!A&&te()},[N,A,te]),W.current=r,x.useEffect(()=>{A&&j&&(B.current?.dispose(),B.current=K.current?.onDidChangeModelContent(P=>{U.current||j(K.current.getValue(),P)}))},[A,j]),x.useEffect(()=>{if(A){let P=L.current.editor.onDidChangeMarkers(F=>{let O=K.current.getModel()?.uri;if(O&&F.find(ee=>ee.path===O.path)){let ee=L.current.editor.getModelMarkers({resource:O});I?.(ee)}});return()=>{P?.dispose()}}return()=>{}},[A,I]);function D(){B.current?.dispose(),v?h&&tv.set(o,K.current.saveViewState()):K.current.getModel()?.dispose(),K.current.dispose()}return X.createElement(aH,{width:y,height:b,isEditorReady:A,loading:d,_ref:J,className:S,wrapperProps:C})}var mSe=fSe,oh=x.memo(mSe),ux=oh;const P2={roles:{create:!0,view:!0,update:!0,delete:!0},clusters:{create:!0,view:!0,update:!0,delete:!0,resources:[]}};function pSe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=et({strict:!1}),[i,o]=x.useState(!0),[a,c]=x.useState(JSON.stringify(P2,null,2)),{mutate:d,isPending:f}=cwe(),p=hn({resolver:wn(swe),defaultValues:{roleName:"",updateOrganization:!1,deleteOrganization:!1}}),h=x.useCallback(y=>{o(y.length===0)},[o]),v=x.useCallback(async y=>{const b={organizationId:r,name:y.roleName,update:y.updateOrganization,delete:y.deleteOrganization,...JSON.parse(a)};y&&i&&d(b,{onSuccess:()=>{p.reset(),t(),Ee.success("Organization role added successfully!")},onError:S=>{Ee.error(`Failed to add organization role: ${S.message}`)}})},[i,a,d,p,t,r]);return u.jsx(tr,{onOpenChange:n,open:e,children:u.jsxs(nr,{children:[u.jsx(Kn,{children:"Add New Organization Role"}),u.jsx(Vr,{children:"Set the new organization role permissions."}),u.jsx(gn,{...p,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:p.handleSubmit(v),children:[u.jsx($e,{control:p.control,name:"roleName",render:({field:y})=>u.jsxs(Ae,{className:"col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Role Name"}),u.jsx(Me,{children:u.jsx(qe,{type:"text",placeholder:"Developer",className:"",...y})}),u.jsx(De,{})]})}),u.jsx($e,{control:p.control,name:"updateOrganization",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Update Organization"}),u.jsx(Me,{children:u.jsx(qe,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:b=>y.onChange(b.target.checked)})}),u.jsx(De,{})]})}),u.jsx($e,{control:p.control,name:"deleteOrganization",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(Me,{children:u.jsx(qe,{type:"checkbox",className:"w-6 ml-2",checked:y.value,onChange:b=>y.onChange(b.target.checked)})}),u.jsx(De,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(oh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:h,onChange:y=>{y&&c(y)},defaultValue:JSON.stringify(P2,null,2)})}),u.jsx(rr,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx(Se,{variant:"destructiveOutline",className:"rounded-full",type:"button",onClick:()=>n(!1),disabled:f,children:"Cancel"}),u.jsx(Se,{variant:"submit",className:"rounded-full",disabled:f||!i,children:"Save Changes"})]})})]})})]})})}async function hSe({roleId:e}){const{data:t}=await Vt.delete(`/Role/${e}`,{id:e,deleted:!0});return t}function gSe(){return ft({mutationFn:({roleId:e})=>hSe({roleId:e})})}const vSe=Cr.object({roleName:Cr.string().nonempty({error:"Please enter a role name."}).regex(/^[a-zA-Z_]*$/,{error:"Role must contain only letters and underscores."}).max(30,{error:"Role name cannot be longer than 30 characters."}),updateOrganization:Cr.boolean(),deleteOrganization:Cr.boolean()});async function ySe({roleId:e,updatedRoleInfo:t}){const{data:n}=await Vt.put(`/Role/${e}`,t);return n}function bSe(){return ft({mutationFn:({roleId:e,updatedRoleInfo:t})=>ySe({roleId:e,updatedRoleInfo:t})})}function xSe({organizationId:e,roleId:t}){return{queryKey:[e,"roles",t],queryFn:()=>wSe(t),refetchInterval:10*1e3}}async function wSe(e){const{data:t}=await Vt.get(`/Role/${e}`);return t}const SSe=({onRoleDeleteClick:e,setIsConfirmingRoleDeletion:t,isRoleDeletionPending:n})=>u.jsxs(u.Fragment,{children:[u.jsx(Kn,{children:"Confirm Role Deletion"}),u.jsx(Vr,{children:"Are you sure you want to delete this role? This action cannot be undone."}),u.jsxs(rr,{children:[u.jsx(Se,{type:"button",variant:"defaultOutline",className:"rounded-full",onClick:()=>t(!1),children:"Cancel"}),u.jsx(Se,{variant:"destructiveOutline",className:"rounded-full",onClick:e,disabled:n,children:n?"Deleting...":"Delete Role"})]})]});function _Se({data:e,isModalOpen:t,closeModal:n,roleDeleted:r}){const{data:i}=uo(xSe({roleId:e.id,organizationId:e.organizationId})),o=hc(),a=o.user&&o.user?.roles?.[e.organizationId]?.role===e.roleName,{update:c,remove:d}=qd(e.organizationId),{mutate:f,isPending:p}=bSe(),{mutate:h,isPending:v}=gSe(),[y,b]=x.useState(!1),S=x.useCallback(()=>{h({roleId:e.id},{onSuccess:()=>{Ee.success("Role deleted successfully!"),r(),n()},onError:N=>{Ee.error("Error",{description:`Failed to delete role: ${N instanceof Error?N.message:String(N)}.`,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}})}})},[e.id,h,r,n]),[C,E]=x.useState(!0),[k,j]=x.useState(JSON.stringify({roles:{...i.organization.roles},clusters:{...i.organization.clusters}},null,2)),I=hn({resolver:wn(vSe),defaultValues:{roleName:i.role,updateOrganization:i?.organization.update||!1,deleteOrganization:i?.organization.delete||!1}}),A=x.useCallback(N=>{E(N.length===0)},[E]),T=x.useCallback(async N=>{if(!c)return;const z={...i};z.organizationId=e.organizationId,z.name=N.roleName,z.role=N.roleName,z.organization.roles=JSON.parse(k).roles,z.organization.clusters=JSON.parse(k).clusters,z.organization.update=N.updateOrganization,z.organization.delete=N.deleteOrganization,k&&C&&f({roleId:e.id,updatedRoleInfo:z},{onSuccess:()=>{Ee.success("Role updated successfully!"),n()},onError:L=>{Ee.error("Error",{description:`Failed to update role: ${L instanceof Error?L.message:String(L)}.`,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}})}})},[c,i,e.organizationId,e.id,k,C,f,n]);return u.jsx(tr,{onOpenChange:n,open:t,children:u.jsx(nr,{children:y?u.jsx(SSe,{onRoleDeleteClick:S,setIsConfirmingRoleDeletion:b,isRoleDeletionPending:v}):u.jsxs(u.Fragment,{children:[u.jsxs(Kn,{children:[a||!c?"View":"Edit",' Organization Role "',i.role,'"']}),u.jsx(gn,{...I,children:u.jsxs("form",{className:"grid grid-cols-2 gap-4 my-4",onSubmit:I.handleSubmit(T),children:[u.jsx($e,{control:I.control,name:"roleName",render:({field:N})=>u.jsxs(Ae,{className:"col-span-2",children:[u.jsx(Oe,{className:"pb-1",children:"Role Name"}),u.jsx(Me,{children:u.jsx(qe,{type:"text",placeholder:"Developer",className:"",...N,disabled:a||!c,readOnly:a||!c})}),u.jsx(De,{})]})}),u.jsx($e,{control:I.control,name:"updateOrganization",render:({field:N})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Update Organization"}),u.jsx(Me,{children:u.jsx(qe,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:N.value,onChange:z=>N.onChange(z.target.checked)})}),u.jsx(De,{})]})}),u.jsx($e,{control:I.control,name:"deleteOrganization",render:({field:N})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Can Delete Organization"}),u.jsx(Me,{children:u.jsx(qe,{type:"checkbox",className:"w-6 ml-2",disabled:a||!c,readOnly:a||!c,checked:N.value,onChange:z=>N.onChange(z.target.checked)})}),u.jsx(De,{})]})}),u.jsx("div",{className:"col-span-2",children:u.jsx(oh,{theme:"vs-dark",height:"300px",defaultLanguage:"json",onValidate:A,onChange:N=>{N&&j(N)},options:a||!c?{readOnly:!0}:void 0,defaultValue:k})}),!a&&(d||c)&&u.jsx(rr,{className:"col-span-2",children:u.jsxs("div",{className:"flex justify-between w-full",children:[d&&u.jsx(Se,{type:"button",variant:"destructiveOutline",className:"rounded-full",onClick:()=>b(!0),disabled:p,children:"Delete Role"}),c&&u.jsx(Se,{variant:"submit",className:"rounded-full",disabled:!C||p,children:"Save Changes"})]})})]})})]})})})}function cH(){const e=pn(),{organizationId:t,orgRoleId:n}=et({strict:!1}),{create:r}=qd(t),{data:i,refetch:o,isFetching:a,isRefetching:c}=uo(lx(t)),d=x.useMemo(()=>i&&i?.find(j=>j.id===n),[i,n]),f=!!n&&!!d,[p,h]=x.useState(!1),v=x.useCallback(j=>{const I=[n?"..":"",j].filter(Boolean);e({to:I.join("/")})},[n,e]),y=x.useCallback(()=>{o(),h(!1)},[o,h]),b=x.useCallback(()=>{h(!0)},[h]),S=x.useCallback(()=>{o(),h(!1)},[o,h]),C=x.useCallback(j=>{v(j.original.id)},[v]),E=x.useCallback(()=>{v(void 0)},[v]),k=Nc(o);return u.jsxs(u.Fragment,{children:[u.jsx(es,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(x.Suspense,{fallback:u.jsx(ho,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(rh,{data:i,columns:awe,onRowClick:C,children:[u.jsxs(Se,{variant:"defaultOutline",onClick:k,accessKey:"r",disabled:a||c,children:[u.jsx(Ba,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),r&&u.jsxs(Se,{variant:"positiveOutline",onClick:b,accessKey:"a",disabled:p,children:[u.jsx(Lo,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(pSe,{isModalOpen:p,onChangesSaved:S,setIsModalOpen:h}),f&&u.jsx(_Se,{roleDeleted:y,data:d,isModalOpen:f,closeModal:E})]})})]})}const CSe=nx(),ESe=[{header:"User Id",accessorKey:"id",enableSorting:!1},{header:"Email",accessorKey:"email",enableSorting:!1},{header:"First Name",accessorKey:"firstname",enableSorting:!1},{header:"Last Name",accessorKey:"lastname",enableSorting:!1},CSe.display({header:"Roles",enableSorting:!1,id:"roles",cell:e=>e.row.original.roles?.map(t=>t.roleName)?.sort()?.join(", ")}),{header:"Status",accessorKey:"status",enableSorting:!1},{header:"Verified",accessorKey:"isVerified",enableSorting:!1}],kSe=Cr.object({email:Qd.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Cr.string().nonempty({error:"Please select a role."})});async function jSe(e){const{data:t}=await Vt.post("/OrganizationRole/",e);return t}function uH(){return ft({mutationFn:e=>jSe(e)})}Cr.object({email:Qd.max(80,{error:"Email cannot be longer than 80 characters."}),roleId:Cr.string().nonempty({error:"Please select a role."})});async function RSe(e){const{data:t}=await Vt.post("/UserInvite/",e);return t}function ISe(){return ft({mutationFn:e=>RSe(e)})}function TSe({isModalOpen:e,onChangesSaved:t,setIsModalOpen:n}){const{organizationId:r}=et({strict:!1}),{data:i}=uo(lx(r)),[o,a]=x.useState(!1),c=hn({resolver:wn(kSe),defaultValues:{email:"",roleId:""}}),{mutate:d,isPending:f}=uH(),{mutate:p,isPending:h}=ISe(),v=x.useCallback(async y=>{y&&(o?p:d)(y,{onSuccess:()=>{const b=y.roleId;c.reset(),c.setValue("roleId",b),t(),Ee.success("User invited successfully!"),n(!1),a(!1)},onError:b=>{b?.status===404&&a(!0)}})},[d,c,p,t,n,o]);return u.jsx(tr,{onOpenChange:()=>{n(!1),a(!1),c.reset()},open:e,children:u.jsx(nr,{"aria-describedby":void 0,children:u.jsx(gn,{...c,children:u.jsxs("form",{onSubmit:c.handleSubmit(v),className:"grid gap-4 my-4",children:[u.jsx(Ir,{children:u.jsx(Kn,{children:o?"Invite User":"Add User"})}),u.jsx($e,{control:c.control,name:"email",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Email"}),u.jsx(Me,{children:u.jsx(qe,{type:"email",enterKeyHint:"next",autoComplete:"email",...y})}),u.jsx(De,{})]})}),u.jsx($e,{control:c.control,name:"roleId",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Roles"}),u.jsx(x.Suspense,{fallback:u.jsx(kr,{}),children:u.jsx(Me,{children:u.jsxs(ao,{...y,onValueChange:b=>y.onChange(b),children:[u.jsx(lo,{className:"w-full",children:u.jsx(so,{placeholder:"Choose Role"})}),u.jsx(co,{children:u.jsxs(Po,{children:[u.jsx(Uj,{children:"Role"}),i?.map(b=>u.jsx(bn,{value:b.id,children:b.roleName},b.id))]})})]})})}),u.jsx(De,{})]})}),o&&u.jsxs(Vr,{className:"p-3 my-5 text-white rounded-md bg-amber-600 flex",children:[u.jsx(qX,{className:"inline-block size-12 pr-2"}),u.jsx("span",{children:"This person doesn’t have a Fabric account. Do you want to invite them?"})]}),u.jsx(rr,{children:u.jsx("div",{className:"flex justify-between w-full",children:u.jsxs(Se,{type:"submit",variant:"submit",className:"rounded-full",disabled:f||h,children:[u.jsx(ca,{})," ",o?"Invite User":"Add User"]})})})]})})})})}async function NSe({roleId:e,userId:t}){const{data:n}=await Vt.delete(`/OrganizationRole/role/${e}/user/${t}`);return n}function ASe(){return ft({mutationFn:({roleId:e,userId:t})=>NSe({roleId:e,userId:t})})}function dH(e){const[t,n]=x.useState(e||!1),r=x.useCallback(i=>{n(i.target.checked)},[]);return[t,r]}function OSe({data:e,readOnly:t,canRemove:n,orgRole:r,selectedRoles:i,setChangesMade:o}){const{mutate:a,isPending:c}=uH(),{mutate:d,isPending:f}=ASe(),p=!!i[r.roleName],[h,v]=x.useState(p),[y,b]=dH(p);return x.useEffect(()=>{y!==h&&(y?a({email:e.email,roleId:r.id},{onSuccess:()=>{v(y),o(!0),Ee.success("Role added successfully")}}):d({userId:e.id,roleId:r.id},{onSuccess:()=>{v(y),o(!0),Ee.success("Role removed successfully")}}))},[a,e.email,e.id,y,r.id,d,o,h]),u.jsxs(Mp,{className:"flex",children:[u.jsx(qe,{type:"checkbox",className:"w-6",disabled:t||c||f||!n&&y,checked:y,onChange:b}),u.jsx("span",{className:"pl-4 pr-8 flex-1 py-2.5",children:r.roleName})]},r.id)}function DSe({closeModal:e,data:t,isModalOpen:n,onUserUpdated:r}){const{organizationId:i}=et({strict:!1}),o=hc(),{update:a,remove:c}=qd(i),d=o.user?.email===t.email,{data:f}=uo(lx(i)),p=x.useMemo(()=>t.roles?tf(t.roles,"roleName"):{},[t]),[h,v]=x.useState(!1);return u.jsx(tr,{onOpenChange:h?r:e,open:n,children:u.jsxs(nr,{className:"sm:max-w-[750px]",children:[u.jsx(Ir,{children:u.jsxs(Kn,{children:[a?"Edit ":"View "," ",t.email," ",d?"(yourself)":""]})}),a&&u.jsxs(Vr,{children:["To remove ",d?"your self":"this user"," from the organization, uncheck all of the boxes below."]}),f.map(y=>u.jsx(OSe,{readOnly:!a,canRemove:c,data:t,orgRole:y,selectedRoles:p,setChangesMade:v},y.id))]})})}function $Se(e,t){return e.email>t.email?1:-1}function fH(){const e=pn(),{organizationId:t,orgUserId:n}=et({strict:!1}),{update:r}=qd(t),{data:i,refetch:o,isFetching:a,isRefetching:c}=uo(lx(t)),d=x.useMemo(()=>{const T={};for(const N of i)if(N.users)for(const z of N.users)T[z.id]||(T[z.id]={...z,roles:[]}),T[z.id].roles.push(N);return Object.values(T).sort($Se)},[i]),f=x.useMemo(()=>d?.find(T=>T.id===n),[d,n]),p=x.useCallback(T=>{const N=[n?"..":"",T].filter(Boolean);e({to:N.join("/")})},[n,e]),h=!!n&&!!f,[v,y]=x.useState(!1),[b]=x.useState({attribute:"email",descending:!1}),S=x.useMemo(()=>[{desc:b.descending,id:b.attribute}],[b]),C=x.useCallback(()=>{y(!0)},[y]),E=x.useCallback(()=>{o(),y(!1)},[o,y]),k=x.useCallback(T=>{p(T.original.id)},[p]),j=x.useCallback(()=>{p(void 0)},[p]),I=x.useCallback(()=>{o(),p(void 0)},[p,o]),A=Nc(o);return u.jsxs(u.Fragment,{children:[u.jsx(es,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs(x.Suspense,{fallback:u.jsx(ho,{className:"flex flex-col items-center justify-center h-full",text:"Loading..."}),children:[u.jsxs(rh,{data:d,isFetching:a||c,columns:ESe,onRowClick:k,sortingState:S,children:[u.jsxs(Se,{variant:"defaultOutline",onClick:A,accessKey:"r",disabled:a||c,children:[u.jsx(Ba,{})," ",u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"efresh"]})]}),r&&u.jsxs(Se,{variant:"positiveOutline",onClick:C,accessKey:"a",disabled:v,children:[u.jsx(Lo,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd"]})]})]}),r&&u.jsx(TSe,{isModalOpen:v,onChangesSaved:E,setIsModalOpen:y}),h&&u.jsx(DSe,{closeModal:j,data:f,isModalOpen:h,onUserUpdated:I})]})})]})}function MSe({organizationRole:e,onDeleteOrgModal:t}){const{organizationId:n,organizationName:r,roleName:i}=e,{remove:o,update:a}=pb(n),c=a,{view:d}=qd(n),f=x.useCallback(()=>{t(e)},[t,e]);return u.jsxs(ic,{className:"relative h-full justify-between",children:[u.jsxs(nl,{children:[u.jsxs(gc,{className:"flex items-center justify-between",children:[u.jsx("span",{className:"truncate",children:n}),o&&u.jsxs(Jp,{children:[u.jsx(eh,{className:"p-4 -m-4 -mr-6 hover:text-white",children:u.jsx(jC,{"aria-label":"Options"})}),u.jsxs(th,{children:[u.jsx(vy,{className:"text-gray-600 text-xs",children:"Options"}),u.jsx(yy,{}),u.jsx(We,{to:`${n}`,children:u.jsx(Sr,{children:"Clusters"})}),d&&u.jsx(We,{to:`${n}/roles`,children:u.jsx(Sr,{children:"Roles"})}),d&&u.jsx(We,{to:`${n}/users`,children:u.jsx(Sr,{children:"Users"})}),c&&u.jsx(We,{to:`${n}/billing`,children:u.jsx(Sr,{children:"Billing"})}),u.jsx(yy,{}),o&&u.jsx(Sr,{className:"focus:bg-red/70 focus:text-white",onClick:f,children:"Delete"})]})]})]}),u.jsx(rl,{children:u.jsx("h2",{children:r})})]}),u.jsxs(Xa,{className:"flex justify-between",children:[u.jsx(Mo,{children:So(i)}),u.jsx(We,{to:n,className:"text-sm","aria-label":`View ${r}`,title:`View ${r}`,children:u.jsxs("span",{className:"py-2 transition-all duration-100 ease-in-out border-0 hover:border-b-2",children:["View ",u.jsx(Co,{className:"inline-block"})]})})]})]})}async function PSe(e){const{data:t}=await Vt.delete(`/Organization/${e}`);return t}function zSe(){return ft({mutationFn:e=>PSe(e)})}async function LSe(e){const{data:t}=await Vt.post("/Organization/",{...e});return t}function USe(){return ft({mutationFn:e=>LSe(e)})}const nv=jn({name:wt().max(255,{error:"Name cannot be longer than 255 characters."}),subdomain:wt().max(62,{error:"The subdomain cannot be longer than 62 characters."}).regex(/^[a-zA-Z0-9-]*$/,{error:"Please only use letters, digits and dashes (-) in the subdomain."})});function FSe(){const{user:e}=hc(),t=pn(),n=hn({resolver:wn(nv),defaultValues:{name:"",subdomain:""}}),{setFocus:r,watch:i}=n;x.useEffect(()=>{r("name")},[r]);const o=`${e?.firstname} ${e?.lastname} Org`,a=i("name")||o,c=i("subdomain"),d=x.useMemo(()=>{const y=JV(Qb(a),nv.shape.subdomain.maxLength);return{suggestedSubdomain:y,fullHostName:`future-cluster-names.${c||y}.harperfabric.com`}},[a,c]),{mutate:f,isPending:p}=USe(),h=ur(),v=x.useCallback(async y=>{f({name:y.name||o,subdomain:y.subdomain||d.suggestedSubdomain},{onSuccess:b=>{h.invalidateQueries({queryKey:vp,refetchType:"active"}),kn.reloadUser(En),t({to:`/${b.id}`})}})},[d.suggestedSubdomain,h,f,o,t]);return u.jsx(u.Fragment,{children:u.jsx(gn,{...n,children:u.jsxs("form",{onSubmit:n.handleSubmit(v),className:"grid gap-6 text-white max-w-xl",children:[u.jsx($e,{control:n.control,name:"name",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Name"}),u.jsx(Me,{children:u.jsx(qe,{type:"text",maxLength:nv.shape.name.maxLength,autoCapitalize:"words",placeholder:o,...y})}),u.jsx(De,{})]})}),u.jsx($e,{control:n.control,name:"subdomain",render:({field:y})=>u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Subdomain"}),u.jsx(Me,{children:u.jsx(qe,{type:"text",maxLength:nv.shape.subdomain.maxLength,autoCapitalize:"none",placeholder:d.suggestedSubdomain,...y})}),u.jsx(De,{})]})}),u.jsxs(Ae,{children:[u.jsx(Oe,{className:"pb-1",children:"Full Host Name"}),u.jsx(Me,{children:u.jsx("span",{children:d.fullHostName})}),u.jsx(De,{})]}),u.jsx(rr,{children:u.jsxs(Se,{type:"submit",variant:"submit",className:"rounded-full",disabled:p,children:["Create New Organization ",u.jsx(Co,{})]})})]})})})}function mH(){return u.jsxs(u.Fragment,{children:[u.jsx(es,{}),u.jsx("section",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(FSe,{})})]})}function VSe(){const e=ur(),{data:t}=uo(BK()),{mutate:n,isPending:r}=zSe(),[i,o]=x.useState(!1),[a,c]=x.useState(null),[d,f]=x.useState(""),p=x.useCallback(()=>f(""),[]),h=x.useMemo(()=>{const C=t?.roles||{},E=Object.values(C);return Object.keys(C).map((j,I)=>({organizationId:j,organizationName:E[I].organizationName,roleName:E[I].role})).filter(VB(["organizationId","organizationName"],d)).sort((j,I)=>(j.organizationName||"")>(I.organizationName||"")?1:-1)||[]},[d,t?.roles]),v=x.useCallback(C=>{f(C.currentTarget.value?.toLowerCase()||"")},[]),y=x.useCallback(C=>{C?.organizationId&&n(C.organizationId,{onSuccess:()=>{Ee.success("Success",{description:"Organization successfully deleted.",duration:5e3,action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),e.invalidateQueries({queryKey:[]}),o(!1)},onError:()=>o(!1)})},[n,e,o]),b=x.useCallback(C=>{c(C),o(!0)},[]),{createCluster:S}=yr({strict:!1});return h.length===1&&!d.length&&S?u.jsx(Wl,{to:`/${h[0].organizationId}/new-cluster`,replace:!0}):!h.length&&!d.length?u.jsx(mH,{}):u.jsxs(u.Fragment,{children:[u.jsx(es,{children:u.jsxs("div",{className:"flex w-full justify-end gap-2",children:[u.jsx(qe,{placeholder:"Filter by name",className:"inline-block w-48 md:w-64 bg-black border",value:d,onChange:v}),u.jsx(We,{to:"/new-org",children:u.jsxs(Se,{variant:"positive",className:"rounded-full w-44",accessKey:"n",children:[u.jsx(Lo,{})," ",u.jsxs("span",{children:[u.jsx("u",{children:"N"}),"ew Organization"]})]})})]})}),u.jsx("section",{className:"mt-40 md:mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12",children:[h.map(C=>u.jsx("div",{className:"col-span-1 md:col-span-4 lg:col-span-3 2xl:col-span-2",children:u.jsx(MSe,{organizationRole:C,onDeleteOrgModal:b})},C.organizationId)),!h.length&&u.jsxs("div",{className:"col-span-1 md:col-span-12 text-center",children:[u.jsx("h2",{className:"my-4 text-xl",children:"No matches found."}),u.jsx(Se,{variant:"outline",onClick:p,children:"Clear Filters"})]})]})}),a&&u.jsx(Zb,{typeOfThingBeingDeleted:"organization",nameOfThingBeingDeleted:a.organizationName,isModalOpen:i,setIsModalOpen:()=>o(!1),deletionConfirmed:()=>y(a),deletionPending:r})]})}function BSe(){const{isLoading:e}=pc(),{createCluster:t}=yr({strict:!1}),[,n]=ef(Ic.SavedClusterState,null);return x.useEffect(()=>{t&&n(t)},[t,n]),e?u.jsx(ho,{className:"fixed z-50 translate-1/2"}):u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:u.jsx(tL,{})}),u.jsx("main",{children:u.jsx(tl,{})})]})}const HSe=["/","/forgot-password","/reset-password","/sign-in","/sign-up","/verify-email"];function qSe(){const e=BB();return!HSe.includes(e)&&{redirect:e}}const dx=nt({getParentRoute:()=>db,id:"_dashboardLayout",component:BSe,beforeLoad:({context:e})=>{const t=e.authentication[En];if(t&&!t.isLoading&&!t.user)throw Dd({to:"/sign-in",search:qSe()})}}),Gj=nt({getParentRoute:()=>dx,id:"_orgsLayout"});nt({getParentRoute:()=>Gj,path:"/",component:VSe});nt({getParentRoute:()=>Gj,path:"/new-org",component:mH});const Ac=nt({getParentRoute:()=>Gj,path:"$organizationId",beforeLoad:async e=>({organization:await e.context.queryClient.ensureQueryData(Tc(e.params.organizationId))})}),GSe=nt({getParentRoute:()=>Ac,path:"/roles",component:cH}),KSe=nt({getParentRoute:()=>Ac,path:"/roles/$orgRoleId",component:cH}),ZSe=nt({getParentRoute:()=>Ac,path:"/users",component:fH}),YSe=nt({getParentRoute:()=>Ac,path:"/users/$orgUserId",component:fH});rwe(Ac);const pH=nt({getParentRoute:()=>Ac,id:"_clusterLayout"});nt({getParentRoute:()=>pH,path:"/",component:e0e});nt({getParentRoute:()=>Ac,path:"/new-cluster",component:Fj});nt({getParentRoute:()=>Oc,path:"/edit",component:Fj});function WSe(){return u.jsx(tl,{})}const Oc=nt({getParentRoute:()=>pH,path:"$clusterId",component:WSe,beforeLoad:async({context:e,params:t})=>({cluster:await e.queryClient.ensureQueryData(Cc(t.clusterId))})});async function XSe(e){await Vt.patch(`/ResetPasswordUpdater/${e}`)}async function hH(e){const{instanceClient:t,...n}=e,{data:r}=await t.post("/",{operation:"add_user",...n});return r}function QSe(){return ft({mutationFn:hH})}async function gH({username:e,password:t,role:n,active:r,instanceClient:i}){const{data:o}=await i.post("/",{operation:"alter_user",username:e,password:t,role:n,active:r});return o}function JSe(){return ft({mutationFn:gH})}async function vH({username:e,instanceClient:t}){const{data:n}=await t.post("/",{operation:"drop_user",username:e});return n}function e_e(){return ft({mutationFn:vH})}async function t_e({clusterId:e,initialUsername:t,desiredUsername:n,newPassword:r,tempPassword:i,instanceClient:o}){if(!i)throw new Error("You may not have permission to set the password on this cluster.");try{const a=await m1({username:t,password:i,instanceClient:o,entityId:e});return n===x_?await gH({username:n,password:r,instanceClient:o}):(await hH({username:n,password:r,role:"super_user",active:!0,instanceClient:o}),await vH({username:x_,instanceClient:o}),await m1({username:n,password:r,instanceClient:o,entityId:e})),await XSe(e),a}catch(a){throw await yp({entityId:e,instanceClient:o}),a}}function n_e(){return ft({mutationFn:t_e})}const Hu=jn({username:bj,role:wt().nonempty({error:"Please select a role."}),password:Zp.min(8,{error:"Password must be at least 8 characters long."}),confirmPassword:wt()}).refine(e=>e.password===e.confirmPassword,{error:"Passwords do not match.",path:["confirmPassword"]});function r_e(){const{user:e}=hc(),{clusterId:t}=et({strict:!1}),{data:n}=zt(Cc(t,!0)),r=pn(),i=x.useMemo(()=>gC(n),[n]),o=fb(i),{redirect:a}=yr({strict:!1}),c=tn(),d=hn({resolver:wn(Hu),defaultValues:{confirmPassword:"",password:"",role:"super_user",username:e?.email??""}}),{setFocus:f,control:p,handleSubmit:h}=d;x.useEffect(()=>{f("password")},[f]);const v=n?.instances?.find(C=>C.tempPassword)?.tempPassword,{mutate:y,isPending:b}=n_e(),S=x.useCallback(async C=>{if(!i){Ee.error("Cluster is not yet fully loaded, please wait a moment before trying to sign in.");return}y({instanceClient:o,clusterId:t,newPassword:C.password,tempPassword:v,initialUsername:x_,desiredUsername:C.username},{onSuccess:async({message:E,user:k})=>{Ee.success(E),kn.setUserForEntity(n,k),c.invalidate(),await r({to:a?.startsWith("/")?a:aC})}})},[n,t,o,r,i,a,c,y,v]);return n&&!n.resetPassword?u.jsx(Wl,{to:"../sign-in",replace:!0}):u.jsxs(u.Fragment,{children:[u.jsx("nav",{className:"fixed top-20 w-full h-12 z-39 px-4 md:px-12 bg-grey-700 flex items-center",children:u.jsx(Sb,{})}),u.jsx("div",{className:"items-center justify-center flex mt-32 py-4 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsxs("div",{className:"text-white w-xs",children:[u.jsx("h2",{className:"text-2xl font-light",children:"Create Admin User"}),u.jsx("p",{className:"text-muted-foreground",children:"You are ready to create your first user in your new cluster. These credentials belong to you alone, and you can create more users and roles once you create this first one."}),u.jsx(gn,{...d,children:u.jsxs("form",{onSubmit:h(S),className:"my-4",children:[u.jsx($e,{control:p,name:"username",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Username"}),u.jsx(Me,{children:u.jsx(qe,{autoComplete:"username",type:"text",...C})}),u.jsx(De,{})]})}),u.jsx($e,{control:p,name:"password",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Password"}),u.jsx(Me,{children:u.jsx(qe,{type:"password",...C})}),u.jsx(De,{})]})}),u.jsx($e,{control:p,name:"confirmPassword",render:({field:C})=>u.jsxs(Ae,{className:"my-4",children:[u.jsx(Oe,{children:"Confirm Password"}),u.jsx(Me,{children:u.jsx(qe,{type:"password",...C})}),u.jsx(De,{})]})}),u.jsx(Se,{disabled:b,type:"submit",variant:"submit",className:"w-full my-2 rounded-full",children:"Create Admin User"})]})}),u.jsxs("p",{className:"text-muted-foreground flex gap-2 align-middle",children:[u.jsx(NW,{size:36,className:"flex-none"}),u.jsx("span",{children:"These credentials will be used to sign into your cluster directly, providing you a secure connection from your browser to your cluster."})]})]})})]})}function i_e({columns:e,data:t}){const n=ox({data:t,columns:e,getCoreRowModel:ix()});return u.jsx("div",{className:"bg-black-dark rounded-md",children:u.jsxs(ax,{children:[u.jsx(nh,{children:n.getHeaderGroups().map(r=>u.jsx(Ai,{className:"border-none",children:r.headers.map(i=>u.jsx(qj,{className:"p-4",style:{width:`${i.getSize()}%`},children:i.isPlaceholder?null:mc(i.column.columnDef.header,i.getContext())},i.id))},r.id))}),u.jsx(sx,{className:"bg-black",children:n.getRowModel().rows?.length?n.getRowModel().rows.map(r=>u.jsx(Ai,{"data-state":r.getIsSelected()&&"selected",className:"hover:bg-muted/10 data-[state=selected]:bg-muted",children:r.getVisibleCells().map(i=>u.jsx(Ya,{className:"p-4",style:{width:`${i.column.getSize()}%`},children:mc(i.column.columnDef.cell,i.getContext())},i.id))},r.id)):u.jsx(Ai,{children:u.jsx(Ya,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})}function o_e(){return u.jsx("div",{className:"flex-col items-center justify-center px-16 space-y-3 text-center pt-30",children:u.jsx("p",{children:"No instances found."})})}function a_e({instance:e}){const{user:t,isLoading:n}=Wa(e.id),r=x.useMemo(()=>vC(e),[e]),i=fb(r),o=x.useCallback(async()=>{await yp({instanceClient:i,entityId:e.id}),kn.setUserForEntity(e,null)},[e,i]);return n||!["CLONE_READY","RUNNING","UPDATED"].includes(e.status)?u.jsx(kP,{className:"animate-spin",color:"gray"}):t?u.jsxs("span",{className:"flex gap-4",children:[u.jsx(We,{to:`../instance/${e.id}${el}`,className:"text-sm","aria-label":`Go to ${e.name} instance`,title:`Go to ${e.name} instance`,children:u.jsx(Se,{variant:"positiveOutline",children:"View"})}),u.jsx(Se,{variant:"destructiveOutline",className:"text-sm","aria-label":`Sign out from ${e.name} instance`,title:`Sign out from ${e.name} instance`,onClick:o,children:"Sign Out"})]}):u.jsx(We,{to:`../instance/${e.id}/sign-in`,className:"text-sm","aria-label":`Sign in to ${e.name} instance`,title:`Sign in to ${e.name} instance`,children:u.jsx(Se,{variant:"positiveOutline",children:"Sign In"})})}function s_e(){const{clusterId:e}=et({strict:!1}),{data:t,isLoading:n}=zt(Cc(e,!0)),r=WV(t),i=x.useMemo(()=>[{id:"instanceActions",size:1,minSize:1,cell:a=>u.jsx("div",{className:"flex justify-end",children:u.jsx(a_e,{instance:a.row.original})})},r&&{accessorKey:"instanceFqdn",size:90,header:"URL",cell:a=>UB({secure:a.row.original.operationsApiSecure?"true":"false",port:a.row.original.operationsApiPort,fqdn:a.row.original.instanceFqdn})},!r&&{accessorKey:"name",size:90,header:"Name"},!r&&{accessorKey:"status",header:"Status",size:1,minSize:1,cell:a=>{const c=a.getValue();return u.jsx(Mo,{variant:D5(c),children:So(c)})}},!r&&{accessorKey:"version",size:1,minSize:1,header:"Version"},!r&&{accessorKey:"storageGb",size:1,minSize:1,header:"Storage",cell:a=>{const c=a.getValue();return Da(c,Math.pow(1024,3))}},!r&&{accessorKey:"cpuCores",size:1,minSize:1,header:"Cores/Threads",cell:a=>u.jsxs(u.Fragment,{children:[a.row.original.cpuCores," / ",a.row.original.threads]})},!r&&{accessorKey:"memoryMb",size:1,minSize:1,header:"Memory",cell:a=>{const c=a.getValue();return Da(c,Math.pow(1024,2))}}].filter(ua),[r]),o=x.useMemo(()=>t?.instances?t.instances.filter(a=>a.status&&!DE.includes(a.status)).sort(XV):[],[t]);return u.jsxs(u.Fragment,{children:[u.jsx(es,{}),u.jsx("div",{className:"mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))]",children:u.jsx(ic,{className:"p-0 mt-4 min-h-96",children:u.jsx(Xa,{className:"p-0 min-h-96",children:n?u.jsx(kr,{}):o.length?u.jsx(i_e,{data:o,columns:i}):u.jsx(o_e,{})})})})]})}function Hl({children:e,className:t}){return u.jsxs(u.Fragment,{children:[u.jsx(es,{}),u.jsx("div",{className:ia("mt-32 px-4 pt-4 md:px-12 min-h-[calc(100vh-theme(spacing.32))] flex justify-center",t),children:e})]})}function l_e(){const{clusterId:e}=et({strict:!1}),{data:t,isLoading:n}=zt(Cc(e,2e3)),r=t?.status,i=x.useMemo(()=>r&&kb.includes(r),[r]);return n||!t?u.jsx(Hl,{className:"flex justify-center",children:u.jsx(kr,{})}):i?u.jsx(Hl,{className:"flex justify-center",children:u.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"All done!"}),u.jsx(lp,{cluster:t,forceProgressBarVisible:!0}),u.jsx("p",{children:"Your cluster finished updating, and is ready for interaction."}),u.jsx("div",{className:"text-center",children:u.jsx(Mj,{cluster:t})})]})}):u.jsx(Hl,{className:"flex justify-center",children:u.jsxs("div",{className:"center w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),u.jsx(lp,{cluster:t,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is updating with the latest changes. This includes waiting several minutes to let traffic drain safely.",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}function c_e(){const e=tn(),{clusterId:t}=et({strict:!1}),{data:n,isLoading:r}=zt(Cc(t,2e3)),i=n?.status,o=x.useMemo(()=>i&&kb.includes(i),[i]),a=Yp(i),[,c]=ef(Ic.SavedClusterState,null),d=x.useCallback(()=>{c(n),e.navigate({to:`/${n.organizationId}/new-cluster`})},[n,e,c]);return r||!n?u.jsx(Hl,{className:"flex justify-center",children:u.jsx(kr,{})}):a?u.jsx(Hl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4 items-center",children:[u.jsx(tX,{className:"w-24 h-24"}),u.jsxs("span",{children:["Your cluster failed to successfully start. This is usually caused by temporary communication problems. Would you like to try again? We also get notified about these failures. ",u.jsx(Qs,{})," if you want more help."]}),u.jsx(Se,{type:"button",variant:"positiveOutline",onClick:d,children:"Try Again"})]})}):o?u.jsx(Hl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"It's ready!"}),u.jsx(lp,{cluster:n,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Let's set up your secure, browser-to-cluster connection now. ",u.jsx("span",{className:"text-muted-foreground",children:"Did you know you connect straight to your cluster, providing a private secure connection?"})]}),u.jsx("div",{className:"text-center",children:u.jsx(Mj,{cluster:n})})]})}):u.jsx(Hl,{className:"flex justify-center",children:u.jsxs("div",{className:"center max-w-2xl flex flex-col gap-4",children:[u.jsx("h1",{className:"text-xl text-center",children:"Here we go!"}),u.jsx(lp,{cluster:n,forceProgressBarVisible:!0}),u.jsxs("p",{children:["Your cluster is spinning up with the latest changes, including your own DNS records and private connections. Please wait while we get everything going.",u.jsxs("span",{className:"text-muted-foreground",children:["We will let you know when we are ready for you to connect! In the meantime, join us on ",u.jsx("a",{href:"https://discord.gg/VzZuaw3Xay",target:"_blank",children:"Discord"}),"! Get real-time help from our engineers, see feature drops early, and connect with others building on Fabric."]})]})]})})}nt({getParentRoute:()=>Oc,path:"instances",component:s_e});nt({getParentRoute:()=>Oc,path:"starting-up",component:c_e});nt({getParentRoute:()=>Oc,path:"scaling",component:l_e});nt({getParentRoute:()=>Oc,path:"sign-in",component:xj,beforeLoad:({context:e,location:t,params:n})=>{if(e.authentication[n.clusterId]?.user){const r=t?.search;throw Dd({to:r?.redirect?.startsWith("/")?r.redirect:aC})}}});nt({getParentRoute:()=>Oc,path:"instance/$instanceId/sign-in",component:xj,beforeLoad:({context:e,location:t,params:n})=>{if(e.authentication[n.instanceId||n.clusterId]?.user){const r=t?.search;throw Dd({to:r?.redirect?.startsWith("/")?r.redirect:aC})}}});nt({getParentRoute:()=>Oc,path:"finish-setup",component:r_e});function u_e(e){return nt({getParentRoute:()=>e,path:"apis"}).lazy(()=>Ip(()=>import("./index.lazy-WznRtvfY.js"),__vite__mapDeps([0,1,2])).then(t=>t.route))}const JS="__root__",$l="importedApplications",ko="newApplication";function z2(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i)||e[i]!==t[i])return!1;return!0}function Iv(e,t){const[n,r]=x.useState(t),[i,o]=x.useState(e);return x.useEffect(()=>{z2(n,t)||(r(t),o(e))},[n,t,e]),z2(n,t)?[i,o]:[e,o]}const zu={};function ky(e,t,n){const r=x.useCallback(i=>t(i),[n]);x.useEffect(()=>(zu[e]||(zu[e]=[]),zu[e].push(r),function(){const o=zu[e].indexOf(r);o>=0&&zu[e].splice(o,1)}),[e,t,r])}function fx(e,t){const n=zu[e];if(n)for(const r of n)r(t)}function L2(e,t){return()=>fx(e,t)}function U2(e,t){return x.useCallback(()=>fx(e,t),[e,t])}function F2(e,t){return Pj(sessionStorage.getItem(String(e)))??t}function d_e(e,t){t==null?sessionStorage.removeItem(String(e)):sessionStorage.setItem(String(e),JSON.stringify(t))}function Ju(e,t){const n=Iv(F2(e,t),[e]),[r,i]=n;return x.useEffect(()=>{d_e(e,r),fx(`Session:${e}`,r)},[e,r]),ky(`Session:${e}`,function(a){r!==a&&i(a)},[r,e,t]),x.useEffect(function(){const a=c=>{c.key===e&&i(F2(e,t))};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}},[e,i,t]),n}function mx(e){const{instanceId:t,clusterId:n}=et({strict:!1}),r=En,[i,o]=Ju(`EditorFileContent/${r}}/${e}`,void 0);return x.useMemo(()=>({content:e?i:void 0,setContent:o}),[e,i,o])}function zr(e){return!!e?.entries}const yH=x.createContext(null);function mi(){return x.useContext(yH)}function Dc(e,t){const[n,r]=x.useState(t);return ky(e,i=>r(i),[r]),n}function jd(e,t){fx(e,t)}function rv(e,t){return()=>jd(e,t)}function li(e,t){return x.useCallback(()=>jd(e,t),[e,t])}function f_e({toggledSidebar:e,toggleSidebar:t}){const n=Yt(),{openedEntryContents:r,openedEntry:i,isSavingFile:o,restrictPackageModification:a}=mi(),{content:c}=mx(i?.path),d=Gd(),f=n.entityType==="instance"?"Instance":"Cluster",p=li("ShowAddDirectoryOrFileModalType","file"),h=li("ShowAddDirectoryOrFileModalType","directory"),v=li("ShowDownloadApplicationModal",!0),y=li("ShowRenameFileModal",!0),b=li("ShowDeleteDirectoryOrFileModal",!0),S=li("ShowRedeployApplicationModal",!0),C=U2("SaveFile",!0),E=U2("RevertChanges",!0),k=c===void 0||c===r;return u.jsxs("div",{className:"absolute top-0 right-0 left-0 backdrop-blur-sm bg-black-10 shadow-xl flex pr-4 md:pr-12",children:[u.jsxs(Se,{variant:"ghost",className:(e?"toggled-sidebar-toggler":"hidden-sidebar-toggler")+" inline-flex text-sm md:hidden focus:outline-none focus:ring-2 text-white hover:text-grey focus:ring-gray-600 rounded-none",onClick:t,children:[u.jsxs("span",{className:"sr-only",children:[e?"Close":"Open"," sidebar"]}),e?u.jsx(JX,{}):u.jsx(XX,{})]}),i&&i?.path!==ko&&u.jsxs(u.Fragment,{children:[i.package&&u.jsxs(wE,{children:[u.jsx(SE,{asChild:!0,children:u.jsxs(Se,{variant:"ghost",type:"button",className:"cursor-help",children:[u.jsx(FX,{width:16,height:16}),u.jsx("span",{className:"hidden md:inline-block",children:"Imported applications are read-only"})]})}),u.jsx(_E,{children:a?u.jsxs(u.Fragment,{children:["This application is read-only, and cannot be modified.",u.jsx("br",{}),"It helps govern clustering amongst your instances."]}):u.jsx(u.Fragment,{children:"This application is read-only, and cannot be directly modified. But you can re-deploy or remove it."})})]}),!zr(i)&&!i.package&&d&&u.jsxs(Se,{variant:"default",className:"rounded-none",onClick:C,disabled:k||o,children:[u.jsx(ca,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"S"}),"ave"]})]}),!zr(i)&&!i.package&&d&&u.jsxs(Se,{variant:"ghost",className:"rounded-none",onClick:y,disabled:!k||o,children:[u.jsx(RP,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:[u.jsx("u",{children:"R"}),"ename"]})]}),!i.package&&d&&u.jsxs(Se,{variant:"ghost",className:"rounded-none",onClick:p,children:[u.jsx(hX,{}),u.jsxs("span",{children:[u.jsx("u",{children:"N"}),"ew",u.jsx("span",{className:"hidden mlg:inline-block",children:" File"})]})]}),!i.package&&d&&u.jsxs(Se,{variant:"ghost",className:"rounded-none",onClick:h,children:[u.jsx(vX,{}),u.jsxs("span",{children:[u.jsx("u",{children:"A"}),"dd",u.jsx("span",{className:"hidden xl:inline-block",children:" Directory"})]})]}),i.project&&u.jsxs(Se,{variant:"ghost",className:"rounded-none",onClick:v,children:[u.jsx(CP,{}),u.jsxs("span",{className:"hidden lg:inline-block",children:["Download",u.jsx("span",{className:"hidden xl:inline-block",children:" Application"})]})]}),!!i.package&&d&&!a&&u.jsxs(Se,{variant:"ghost",className:"rounded-none",onClick:S,children:[u.jsx(IC,{}),u.jsxs("span",{children:["Redeploy ",u.jsx("u",{children:"P"}),"ackage"]})]}),u.jsx("div",{className:"grow"}),d&&u.jsx(EE,{targetNoun:f,instanceClient:n.instanceClient,operation:"restart_service",variant:"ghost",className:"rounded-none mx-0 md:mx-0",disabled:!k||o}),!zr(i)&&!i.package&&d&&u.jsxs(Se,{variant:"ghost",className:"rounded-none",onClick:E,disabled:k||o,children:[u.jsx(_Q,{}),u.jsx("span",{className:"hidden xl:inline-block",children:"Revert Changes"})]}),!a&&d&&u.jsxs(Se,{variant:"destructiveGhost",className:"rounded-none",onClick:b,children:[u.jsx(Qa,{}),u.jsxs("span",{className:"hidden xl:inline-block",children:[u.jsx("u",{children:"D"}),"elete"]})]})]})]})}function m_e(e){return x.useCallback((t,n,r)=>{if(n!=="href")return t;if(t.startsWith("http"))return r.properties.target="_blank",t;{const i=HB().split("?")[0];switch(t){case"./apis":case"./config":case"./config/roles":case"./config/users":case"./databases":case"./logs":case"./status":return`${i}/${t.slice(2)}`}return`${i}?open=${e}/${t.slice(2)}`}},[e])}function p_e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const h_e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,g_e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,v_e={};function V2(e,t){return(v_e.jsx?g_e:h_e).test(e)}const y_e=/[ \t\n\f\r]/g;function b_e(e){return typeof e=="object"?e.type==="text"?B2(e.value):!1:B2(e)}function B2(e){return e.replace(y_e,"")===""}class ah{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ah.prototype.normal={};ah.prototype.property={};ah.prototype.space=void 0;function bH(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new ah(n,r,t)}function V1(e){return e.toLowerCase()}class pi{constructor(t,n){this.attribute=n,this.property=t}}pi.prototype.attribute="";pi.prototype.booleanish=!1;pi.prototype.boolean=!1;pi.prototype.commaOrSpaceSeparated=!1;pi.prototype.commaSeparated=!1;pi.prototype.defined=!1;pi.prototype.mustUseProperty=!1;pi.prototype.number=!1;pi.prototype.overloadedBoolean=!1;pi.prototype.property="";pi.prototype.spaceSeparated=!1;pi.prototype.space=void 0;let x_e=0;const pt=$c(),Bn=$c(),B1=$c(),ke=$c(),Qt=$c(),ed=$c(),_i=$c();function $c(){return 2**++x_e}const H1=Object.freeze(Object.defineProperty({__proto__:null,boolean:pt,booleanish:Bn,commaOrSpaceSeparated:_i,commaSeparated:ed,number:ke,overloadedBoolean:B1,spaceSeparated:Qt},Symbol.toStringTag,{value:"Module"})),e_=Object.keys(H1);class Kj extends pi{constructor(t,n,r,i){let o=-1;if(super(t,n),H2(this,"space",i),typeof r=="number")for(;++o<e_.length;){const a=e_[o];H2(this,e_[o],(r&H1[a])===H1[a])}}}Kj.prototype.defined=!0;function H2(e,t,n){n&&(e[t]=n)}function rf(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Kj(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[V1(r)]=r,n[V1(o.attribute)]=r}return new ah(t,n,e.space)}const xH=rf({properties:{ariaActiveDescendant:null,ariaAtomic:Bn,ariaAutoComplete:null,ariaBusy:Bn,ariaChecked:Bn,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:Qt,ariaCurrent:null,ariaDescribedBy:Qt,ariaDetails:null,ariaDisabled:Bn,ariaDropEffect:Qt,ariaErrorMessage:null,ariaExpanded:Bn,ariaFlowTo:Qt,ariaGrabbed:Bn,ariaHasPopup:null,ariaHidden:Bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Qt,ariaLevel:ke,ariaLive:null,ariaModal:Bn,ariaMultiLine:Bn,ariaMultiSelectable:Bn,ariaOrientation:null,ariaOwns:Qt,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:Bn,ariaReadOnly:Bn,ariaRelevant:null,ariaRequired:Bn,ariaRoleDescription:Qt,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:Bn,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function wH(e,t){return t in e?e[t]:t}function SH(e,t){return wH(e,t.toLowerCase())}const w_e=rf({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ed,acceptCharset:Qt,accessKey:Qt,action:null,allow:null,allowFullScreen:pt,allowPaymentRequest:pt,allowUserMedia:pt,alt:null,as:null,async:pt,autoCapitalize:null,autoComplete:Qt,autoFocus:pt,autoPlay:pt,blocking:Qt,capture:null,charSet:null,checked:pt,cite:null,className:Qt,cols:ke,colSpan:null,content:null,contentEditable:Bn,controls:pt,controlsList:Qt,coords:ke|ed,crossOrigin:null,data:null,dateTime:null,decoding:null,default:pt,defer:pt,dir:null,dirName:null,disabled:pt,download:B1,draggable:Bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:pt,formTarget:null,headers:Qt,height:ke,hidden:B1,high:ke,href:null,hrefLang:null,htmlFor:Qt,httpEquiv:Qt,id:null,imageSizes:null,imageSrcSet:null,inert:pt,inputMode:null,integrity:null,is:null,isMap:pt,itemId:null,itemProp:Qt,itemRef:Qt,itemScope:pt,itemType:Qt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:pt,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:pt,muted:pt,name:null,nonce:null,noModule:pt,noValidate:pt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:pt,optimum:ke,pattern:null,ping:Qt,placeholder:null,playsInline:pt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:pt,referrerPolicy:null,rel:Qt,required:pt,reversed:pt,rows:ke,rowSpan:ke,sandbox:Qt,scope:null,scoped:pt,seamless:pt,selected:pt,shadowRootClonable:pt,shadowRootDelegatesFocus:pt,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:Bn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:pt,useMap:null,value:Bn,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Qt,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:pt,declare:pt,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:pt,noHref:pt,noShade:pt,noWrap:pt,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:Bn,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:pt,disableRemotePlayback:pt,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:SH}),S_e=rf({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:_i,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:Qt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:pt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ed,g2:ed,glyphName:ed,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:_i,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ke,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Qt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_i,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_i,rev:_i,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_i,requiredFeatures:_i,requiredFonts:_i,requiredFormats:_i,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:_i,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_i,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_i,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:wH}),_H=rf({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),CH=rf({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:SH}),EH=rf({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),__e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},C_e=/[A-Z]/g,q2=/-[a-z]/g,E_e=/^data[-\w.:]+$/i;function k_e(e,t){const n=V1(t);let r=t,i=pi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&E_e.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(q2,R_e);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!q2.test(o)){let a=o.replace(C_e,j_e);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Kj}return new i(r,t)}function j_e(e){return"-"+e.toLowerCase()}function R_e(e){return e.charAt(1).toUpperCase()}const I_e=bH([xH,w_e,_H,CH,EH],"html"),Zj=bH([xH,S_e,_H,CH,EH],"svg");function T_e(e){return e.join(" ").trim()}var Ou={},t_,G2;function N_e(){if(G2)return t_;G2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
129
129
  `,f="/",p="*",h="",v="comment",y="declaration";t_=function(S,C){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];C=C||{};var E=1,k=1;function j(Y){var B=Y.match(t);B&&(E+=B.length);var W=Y.lastIndexOf(d);k=~W?Y.length-W:k+Y.length}function I(){var Y={line:E,column:k};return function(B){return B.position=new A(Y),z(),B}}function A(Y){this.start=Y,this.end={line:E,column:k},this.source=C.source}A.prototype.content=S;function T(Y){var B=new Error(C.source+":"+E+":"+k+": "+Y);if(B.reason=Y,B.filename=C.source,B.line=E,B.column=k,B.source=S,!C.silent)throw B}function N(Y){var B=Y.exec(S);if(B){var W=B[0];return j(W),S=S.slice(W.length),B}}function z(){N(n)}function L(Y){var B;for(Y=Y||[];B=K();)B!==!1&&Y.push(B);return Y}function K(){var Y=I();if(!(f!=S.charAt(0)||p!=S.charAt(1))){for(var B=2;h!=S.charAt(B)&&(p!=S.charAt(B)||f!=S.charAt(B+1));)++B;if(B+=2,h===S.charAt(B-1))return T("End of comment missing");var W=S.slice(2,B-2);return k+=2,j(W),S=S.slice(B),k+=2,Y({type:v,comment:W})}}function J(){var Y=I(),B=N(r);if(B){if(K(),!N(i))return T("property missing ':'");var W=N(o),M=Y({type:y,property:b(B[0].replace(e,h)),value:W?b(W[0].replace(e,h)):h});return N(a),M}}function H(){var Y=[];L(Y);for(var B;B=J();)B!==!1&&(Y.push(B),L(Y));return Y}return z(),H()};function b(S){return S?S.replace(c,h):h}return t_}var K2;function A_e(){if(K2)return Ou;K2=1;var e=Ou&&Ou.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.default=n;const t=e(N_e());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const a=(0,t.default)(r),c=typeof i=="function";return a.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?i(f,p,d):p&&(o=o||{},o[f]=p)}),o}return Ou}var gm={},Z2;function O_e(){if(Z2)return gm;Z2=1,Object.defineProperty(gm,"__esModule",{value:!0}),gm.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(f){return!f||n.test(f)||e.test(f)},a=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),o(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(i,c):f=f.replace(r,c),f.replace(t,a))};return gm.camelCase=d,gm}var vm,Y2;function D_e(){if(Y2)return vm;Y2=1;var e=vm&&vm.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(A_e()),n=O_e();function r(i,o){var a={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(a[(0,n.camelCase)(c,o)]=d)}),a}return r.default=r,vm=r,vm}var $_e=D_e();const M_e=dp($_e),kH=jH("end"),Yj=jH("start");function jH(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function P_e(e){const t=Yj(e),n=kH(e);if(t&&n)return{start:t,end:n}}function zm(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?W2(e.position):"start"in e||"end"in e?W2(e):"line"in e||"column"in e?q1(e):""}function q1(e){return X2(e&&e.line)+":"+X2(e&&e.column)}function W2(e){return q1(e&&e.start)+"-"+q1(e&&e.end)}function X2(e){return e&&typeof e=="number"?e:1}class Tr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=zm(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Tr.prototype.file="";Tr.prototype.name="";Tr.prototype.reason="";Tr.prototype.message="";Tr.prototype.stack="";Tr.prototype.column=void 0;Tr.prototype.line=void 0;Tr.prototype.ancestors=void 0;Tr.prototype.cause=void 0;Tr.prototype.fatal=void 0;Tr.prototype.place=void 0;Tr.prototype.ruleId=void 0;Tr.prototype.source=void 0;const Wj={}.hasOwnProperty,z_e=new Map,L_e=/[A-Z]/g,U_e=new Set(["table","tbody","thead","tfoot","tr"]),F_e=new Set(["td","th"]),RH="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function V_e(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=W_e(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Y_e(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Zj:I_e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=IH(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function IH(e,t,n){if(t.type==="element")return B_e(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return H_e(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return G_e(e,t,n);if(t.type==="mdxjsEsm")return q_e(e,t);if(t.type==="root")return K_e(e,t,n);if(t.type==="text")return Z_e(e,t)}function B_e(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Zj,e.schema=i),e.ancestors.push(t);const o=NH(e,t.tagName,!1),a=X_e(e,t);let c=Qj(e,t);return U_e.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!b_e(d):!0})),TH(e,a,o,t),Xj(a,c),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function H_e(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}up(e,t.position)}function q_e(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);up(e,t.position)}function G_e(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Zj,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:NH(e,t.name,!0),a=Q_e(e,t),c=Qj(e,t);return TH(e,a,o,t),Xj(a,c),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function K_e(e,t,n){const r={};return Xj(r,Qj(e,t)),e.create(t,e.Fragment,r,n)}function Z_e(e,t){return t.value}function TH(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Xj(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Y_e(e,t,n){return r;function r(i,o,a,c){const f=Array.isArray(a.children)?n:t;return c?f(o,a,c):f(o,a)}}function W_e(e,t){return n;function n(r,i,o,a){const c=Array.isArray(o.children),d=Yj(r);return t(i,o,a,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function X_e(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Wj.call(t.properties,i)){const o=J_e(e,i,t.properties[i]);if(o){const[a,c]=o;e.tableCellAlignToStyle&&a==="align"&&typeof c=="string"&&F_e.has(t.tagName)?r=c:n[a]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Q_e(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const c=a.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else up(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else up(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Qj(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:z_e;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const f=i.get(d)||0;a=d+"-"+f,i.set(d,f+1)}}const c=IH(e,o,a);c!==void 0&&n.push(c)}return n}function J_e(e,t,n){const r=k_e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?p_e(n):T_e(n)),r.property==="style"){let i=typeof n=="object"?n:e1e(e,String(n));return e.stylePropertyNameCase==="css"&&(i=t1e(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?__e[r.property]||r.property:r.attribute,n]}}function e1e(e,t){try{return M_e(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Tr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=RH+"#cannot-parse-style-attribute",i}}function NH(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,a;for(;++o<i.length;){const c=V2(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};a=a?{type:"MemberExpression",object:a,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=a}else r=V2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Wj.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);up(e)}function up(e,t){const n=new Tr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=RH+"#cannot-handle-mdx-estrees-without-createevaluater",n}function t1e(e){const t={};let n;for(n in e)Wj.call(e,n)&&(t[n1e(n)]=e[n]);return t}function n1e(e){let t=e.replace(L_e,r1e);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function r1e(e){return"-"+e.toLowerCase()}const n_={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},i1e={};function o1e(e,t){const n=i1e,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return AH(e,r,i)}function AH(e,t,n){if(a1e(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Q2(e.children,t,n)}return Array.isArray(e)?Q2(e,t,n):""}function Q2(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=AH(e[i],t,n);return r.join("")}function a1e(e){return!!(e&&typeof e=="object")}const J2=document.createElement("i");function Jj(e){const t="&"+e+";";J2.innerHTML=t;const n=J2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function la(e,t,n,r){const i=e.length;let o=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function eo(e,t){return e.length>0?(la(e,e.length,0,t),e):t}const e$={}.hasOwnProperty;function s1e(e){const t={};let n=-1;for(;++n<e.length;)l1e(t,e[n]);return t}function l1e(e,t){let n;for(n in t){const i=(e$.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){e$.call(i,a)||(i[a]=[]);const c=o[a];c1e(i[a],Array.isArray(c)?c:c?[c]:[])}}}function c1e(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);la(e,0,0,r)}function OH(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function td(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Xo=cl(/[A-Za-z]/),Ii=cl(/[\dA-Za-z]/),u1e=cl(/[#-'*+\--9=?A-Z^-~]/);function G1(e){return e!==null&&(e<32||e===127)}const K1=cl(/\d/),d1e=cl(/[\dA-Fa-f]/),f1e=cl(/[!-/:-@[-`{-~]/);function tt(e){return e!==null&&e<-2}function fi(e){return e!==null&&(e<0||e===32)}function Pt(e){return e===-2||e===-1||e===32}const m1e=cl(new RegExp("\\p{P}|\\p{S}","u")),p1e=cl(/\s/);function cl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function of(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&Ii(e.charCodeAt(n+1))&&Ii(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(a=String.fromCharCode(o,c),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function en(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(d){return Pt(d)?(e.enter(n),c(d)):t(d)}function c(d){return Pt(d)&&o++<i?(e.consume(d),c):(e.exit(n),t(d))}}const h1e={tokenize:g1e};function g1e(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),en(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),o(c)}function o(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,a(c)}function a(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return tt(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),a)}}const v1e={tokenize:y1e},t$={tokenize:b1e};function y1e(e){const t=this,n=[];let r=0,i,o,a;return c;function c(j){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,d,f)(j)}return f(j)}function d(j){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&k();const I=t.events.length;let A=I,T;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){T=t.events[A][1].end;break}E(r);let N=I;for(;N<t.events.length;)t.events[N][1].end={...T},N++;return la(t.events,A+1,0,t.events.slice(I)),t.events.length=N,f(j)}return c(j)}function f(j){if(r===n.length){if(!i)return v(j);if(i.currentConstruct&&i.currentConstruct.concrete)return b(j);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(t$,p,h)(j)}function p(j){return i&&k(),E(r),v(j)}function h(j){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,b(j)}function v(j){return t.containerState={},e.attempt(t$,y,b)(j)}function y(j){return r++,n.push([t.currentConstruct,t.containerState]),v(j)}function b(j){if(j===null){i&&k(),E(0),e.consume(j);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),S(j)}function S(j){if(j===null){C(e.exit("chunkFlow"),!0),E(0),e.consume(j);return}return tt(j)?(e.consume(j),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(j),S)}function C(j,I){const A=t.sliceStream(j);if(I&&A.push(null),j.previous=o,o&&(o.next=j),o=j,i.defineSkip(j.start),i.write(A),t.parser.lazy[j.start.line]){let T=i.events.length;for(;T--;)if(i.events[T][1].start.offset<a&&(!i.events[T][1].end||i.events[T][1].end.offset>a))return;const N=t.events.length;let z=N,L,K;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){if(L){K=t.events[z][1].end;break}L=!0}for(E(r),T=N;T<t.events.length;)t.events[T][1].end={...K},T++;la(t.events,z+1,0,t.events.slice(N)),t.events.length=T}}function E(j){let I=n.length;for(;I-- >j;){const A=n[I];t.containerState=A[1],A[0].exit.call(t,e)}n.length=j}function k(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function b1e(e,t,n){return en(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function n$(e){if(e===null||fi(e)||p1e(e))return 1;if(m1e(e))return 2}function eR(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Z1={name:"attention",resolveAll:x1e,tokenize:w1e};function x1e(e,t){let n=-1,r,i,o,a,c,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},v={...e[n][1].start};r$(h,-d),r$(v,d),a={type:d>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...a.start},end:{...c.end}},e[r][1].end={...a.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=eo(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=eo(f,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),f=eo(f,eR(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=eo(f,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=eo(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,la(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function w1e(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=n$(r);let o;return a;function a(d){return o=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===o)return e.consume(d),c;const f=e.exit("attentionSequence"),p=n$(d),h=!p||p===2&&i||n.includes(d),v=!i||i===2&&p||n.includes(r);return f._open=!!(o===42?h:h&&(i||!v)),f._close=!!(o===42?v:v&&(p||!h)),t(d)}}function r$(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const S1e={name:"autolink",tokenize:_1e};function _1e(e,t,n){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return Xo(y)?(e.consume(y),a):y===64?n(y):f(y)}function a(y){return y===43||y===45||y===46||Ii(y)?(r=1,c(y)):f(y)}function c(y){return y===58?(e.consume(y),r=0,d):(y===43||y===45||y===46||Ii(y))&&r++<32?(e.consume(y),c):(r=0,f(y))}function d(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||G1(y)?n(y):(e.consume(y),d)}function f(y){return y===64?(e.consume(y),p):u1e(y)?(e.consume(y),f):n(y)}function p(y){return Ii(y)?h(y):n(y)}function h(y){return y===46?(e.consume(y),r=0,p):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):v(y)}function v(y){if((y===45||Ii(y))&&r++<63){const b=y===45?v:h;return e.consume(y),b}return n(y)}}const px={partial:!0,tokenize:C1e};function C1e(e,t,n){return r;function r(o){return Pt(o)?en(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||tt(o)?t(o):n(o)}}const DH={continuation:{tokenize:k1e},exit:j1e,name:"blockQuote",tokenize:E1e};function E1e(e,t,n){const r=this;return i;function i(a){if(a===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Pt(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function k1e(e,t,n){const r=this;return i;function i(a){return Pt(a)?en(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(DH,t,n)(a)}}function j1e(e){e.exit("blockQuote")}const $H={name:"characterEscape",tokenize:R1e};function R1e(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return f1e(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const MH={name:"characterReference",tokenize:I1e};function I1e(e,t,n){const r=this;let i=0,o,a;return c;function c(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),d}function d(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,a=Ii,p(h))}function f(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=d1e,p):(e.enter("characterReferenceValue"),o=7,a=K1,p(h))}function p(h){if(h===59&&i){const v=e.exit("characterReferenceValue");return a===Ii&&!Jj(r.sliceSerialize(v))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<o?(e.consume(h),p):n(h)}}const i$={partial:!0,tokenize:N1e},o$={concrete:!0,name:"codeFenced",tokenize:T1e};function T1e(e,t,n){const r=this,i={partial:!0,tokenize:A};let o=0,a=0,c;return d;function d(T){return f(T)}function f(T){const N=r.events[r.events.length-1];return o=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,c=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(T)}function p(T){return T===c?(a++,e.consume(T),p):a<3?n(T):(e.exit("codeFencedFenceSequence"),Pt(T)?en(e,h,"whitespace")(T):h(T))}function h(T){return T===null||tt(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(i$,S,I)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(T))}function v(T){return T===null||tt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(T)):Pt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),en(e,y,"whitespace")(T)):T===96&&T===c?n(T):(e.consume(T),v)}function y(T){return T===null||tt(T)?h(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(T))}function b(T){return T===null||tt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(T)):T===96&&T===c?n(T):(e.consume(T),b)}function S(T){return e.attempt(i,I,C)(T)}function C(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),E}function E(T){return o>0&&Pt(T)?en(e,k,"linePrefix",o+1)(T):k(T)}function k(T){return T===null||tt(T)?e.check(i$,S,I)(T):(e.enter("codeFlowValue"),j(T))}function j(T){return T===null||tt(T)?(e.exit("codeFlowValue"),k(T)):(e.consume(T),j)}function I(T){return e.exit("codeFenced"),t(T)}function A(T,N,z){let L=0;return K;function K(W){return T.enter("lineEnding"),T.consume(W),T.exit("lineEnding"),J}function J(W){return T.enter("codeFencedFence"),Pt(W)?en(T,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):H(W)}function H(W){return W===c?(T.enter("codeFencedFenceSequence"),Y(W)):z(W)}function Y(W){return W===c?(L++,T.consume(W),Y):L>=a?(T.exit("codeFencedFenceSequence"),Pt(W)?en(T,B,"whitespace")(W):B(W)):z(W)}function B(W){return W===null||tt(W)?(T.exit("codeFencedFence"),N(W)):z(W)}}}function N1e(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const r_={name:"codeIndented",tokenize:O1e},A1e={partial:!0,tokenize:D1e};function O1e(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),en(e,o,"linePrefix",5)(f)}function o(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?a(f):n(f)}function a(f){return f===null?d(f):tt(f)?e.attempt(A1e,a,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||tt(f)?(e.exit("codeFlowValue"),a(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function D1e(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):tt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):en(e,o,"linePrefix",5)(a)}function o(a){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):tt(a)?i(a):n(a)}}const $1e={name:"codeText",previous:P1e,resolve:M1e,tokenize:z1e};function M1e(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function P1e(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function z1e(e,t,n){let r=0,i,o;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),c(h)}function c(h){return h===96?(e.consume(h),r++,c):(e.exit("codeTextSequence"),d(h))}function d(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),d):h===96?(o=e.enter("codeTextSequence"),i=0,p(h)):tt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(h))}function f(h){return h===null||h===32||h===96||tt(h)?(e.exit("codeTextData"),d(h)):(e.consume(h),f)}function p(h){return h===96?(e.consume(h),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",f(h))}}class L1e{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&ym(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ym(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ym(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ym(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ym(this.left,n.reverse())}}}function ym(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function PH(e){const t={};let n=-1,r,i,o,a,c,d,f;const p=new L1e(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,U1e(p,n)),n=t[n],f=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(a=p.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},c=p.slice(i,n),c.unshift(r),p.splice(i,n-i+1,c))}}return la(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function U1e(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const c=a.events,d=[],f={};let p,h,v=-1,y=n,b=0,S=0;const C=[S];for(;y;){for(;e.get(++i)[1]!==y;);o.push(i),y._tokenizer||(p=r.sliceStream(y),y.next||p.push(null),h&&a.defineSkip(y.start),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(p),y._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=y,y=y.next}for(y=n;++v<c.length;)c[v][0]==="exit"&&c[v-1][0]==="enter"&&c[v][1].type===c[v-1][1].type&&c[v][1].start.line!==c[v][1].end.line&&(S=v+1,C.push(S),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(a.events=[],y?(y._tokenizer=void 0,y.previous=void 0):C.pop(),v=C.length;v--;){const E=c.slice(C[v],C[v+1]),k=o.pop();d.push([k,k+E.length-1]),e.splice(k,2,E)}for(d.reverse(),v=-1;++v<d.length;)f[b+d[v][0]]=b+d[v][1],b+=d[v][1]-d[v][0]-1;return f}const F1e={resolve:B1e,tokenize:H1e},V1e={partial:!0,tokenize:q1e};function B1e(e){return PH(e),e}function H1e(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?o(c):tt(c)?e.check(V1e,a,o)(c):(e.consume(c),i)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function a(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function q1e(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),en(e,o,"linePrefix")}function o(a){if(a===null||tt(a))return n(a);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function zH(e,t,n,r,i,o,a,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return h;function h(E){return E===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(E),e.exit(o),v):E===null||E===32||E===41||G1(E)?n(E):(e.enter(r),e.enter(a),e.enter(c),e.enter("chunkString",{contentType:"string"}),S(E))}function v(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),y(E))}function y(E){return E===62?(e.exit("chunkString"),e.exit(c),v(E)):E===null||E===60||tt(E)?n(E):(e.consume(E),E===92?b:y)}function b(E){return E===60||E===62||E===92?(e.consume(E),y):y(E)}function S(E){return!p&&(E===null||E===41||fi(E))?(e.exit("chunkString"),e.exit(c),e.exit(a),e.exit(r),t(E)):p<f&&E===40?(e.consume(E),p++,S):E===41?(e.consume(E),p--,S):E===null||E===32||E===40||G1(E)?n(E):(e.consume(E),E===92?C:S)}function C(E){return E===40||E===41||E===92?(e.consume(E),S):S(E)}}function LH(e,t,n,r,i,o){const a=this;let c=0,d;return f;function f(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(o),p}function p(y){return c>999||y===null||y===91||y===93&&!d||y===94&&!c&&"_hiddenFootnoteSupport"in a.parser.constructs?n(y):y===93?(e.exit(o),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):tt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||y===91||y===93||tt(y)||c++>999?(e.exit("chunkString"),p(y)):(e.consume(y),d||(d=!Pt(y)),y===92?v:h)}function v(y){return y===91||y===92||y===93?(e.consume(y),c++,h):h(y)}}function UH(e,t,n,r,i,o){let a;return c;function c(v){return v===34||v===39||v===40?(e.enter(r),e.enter(i),e.consume(v),e.exit(i),a=v===40?41:v,d):n(v)}function d(v){return v===a?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):(e.enter(o),f(v))}function f(v){return v===a?(e.exit(o),d(a)):v===null?n(v):tt(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),en(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===a||v===null||tt(v)?(e.exit("chunkString"),f(v)):(e.consume(v),v===92?h:p)}function h(v){return v===a||v===92?(e.consume(v),p):p(v)}}function Lm(e,t){let n;return r;function r(i){return tt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Pt(i)?en(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const G1e={name:"definition",tokenize:Z1e},K1e={partial:!0,tokenize:Y1e};function Z1e(e,t,n){const r=this;let i;return o;function o(y){return e.enter("definition"),a(y)}function a(y){return LH.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function c(y){return i=td(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),d):n(y)}function d(y){return fi(y)?Lm(e,f)(y):f(y)}function f(y){return zH(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function p(y){return e.attempt(K1e,h,h)(y)}function h(y){return Pt(y)?en(e,v,"whitespace")(y):v(y)}function v(y){return y===null||tt(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function Y1e(e,t,n){return r;function r(c){return fi(c)?Lm(e,i)(c):n(c)}function i(c){return UH(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return Pt(c)?en(e,a,"whitespace")(c):a(c)}function a(c){return c===null||tt(c)?t(c):n(c)}}const W1e={name:"hardBreakEscape",tokenize:X1e};function X1e(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return tt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Q1e={name:"headingAtx",resolve:J1e,tokenize:eCe};function J1e(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},la(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function eCe(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),a(p)}function a(p){return p===35&&r++<6?(e.consume(p),a):p===null||fi(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||tt(p)?(e.exit("atxHeading"),t(p)):Pt(p)?en(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||fi(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const tCe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],a$=["pre","script","style","textarea"],nCe={concrete:!0,name:"htmlFlow",resolveTo:oCe,tokenize:aCe},rCe={partial:!0,tokenize:lCe},iCe={partial:!0,tokenize:sCe};function oCe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function aCe(e,t,n){const r=this;let i,o,a,c,d;return f;function f(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),h}function h(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),o=!0,S):O===63?(e.consume(O),i=3,r.interrupt?t:D):Xo(O)?(e.consume(O),a=String.fromCharCode(O),C):n(O)}function v(O){return O===45?(e.consume(O),i=2,y):O===91?(e.consume(O),i=5,c=0,b):Xo(O)?(e.consume(O),i=4,r.interrupt?t:D):n(O)}function y(O){return O===45?(e.consume(O),r.interrupt?t:D):n(O)}function b(O){const ee="CDATA[";return O===ee.charCodeAt(c++)?(e.consume(O),c===ee.length?r.interrupt?t:H:b):n(O)}function S(O){return Xo(O)?(e.consume(O),a=String.fromCharCode(O),C):n(O)}function C(O){if(O===null||O===47||O===62||fi(O)){const ee=O===47,ue=a.toLowerCase();return!ee&&!o&&a$.includes(ue)?(i=1,r.interrupt?t(O):H(O)):tCe.includes(a.toLowerCase())?(i=6,ee?(e.consume(O),E):r.interrupt?t(O):H(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?k(O):j(O))}return O===45||Ii(O)?(e.consume(O),a+=String.fromCharCode(O),C):n(O)}function E(O){return O===62?(e.consume(O),r.interrupt?t:H):n(O)}function k(O){return Pt(O)?(e.consume(O),k):K(O)}function j(O){return O===47?(e.consume(O),K):O===58||O===95||Xo(O)?(e.consume(O),I):Pt(O)?(e.consume(O),j):K(O)}function I(O){return O===45||O===46||O===58||O===95||Ii(O)?(e.consume(O),I):A(O)}function A(O){return O===61?(e.consume(O),T):Pt(O)?(e.consume(O),A):j(O)}function T(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),d=O,N):Pt(O)?(e.consume(O),T):z(O)}function N(O){return O===d?(e.consume(O),d=null,L):O===null||tt(O)?n(O):(e.consume(O),N)}function z(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||fi(O)?A(O):(e.consume(O),z)}function L(O){return O===47||O===62||Pt(O)?j(O):n(O)}function K(O){return O===62?(e.consume(O),J):n(O)}function J(O){return O===null||tt(O)?H(O):Pt(O)?(e.consume(O),J):n(O)}function H(O){return O===45&&i===2?(e.consume(O),M):O===60&&i===1?(e.consume(O),Z):O===62&&i===4?(e.consume(O),P):O===63&&i===3?(e.consume(O),D):O===93&&i===5?(e.consume(O),te):tt(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(rCe,F,Y)(O)):O===null||tt(O)?(e.exit("htmlFlowData"),Y(O)):(e.consume(O),H)}function Y(O){return e.check(iCe,B,F)(O)}function B(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),W}function W(O){return O===null||tt(O)?Y(O):(e.enter("htmlFlowData"),H(O))}function M(O){return O===45?(e.consume(O),D):H(O)}function Z(O){return O===47?(e.consume(O),a="",U):H(O)}function U(O){if(O===62){const ee=a.toLowerCase();return a$.includes(ee)?(e.consume(O),P):H(O)}return Xo(O)&&a.length<8?(e.consume(O),a+=String.fromCharCode(O),U):H(O)}function te(O){return O===93?(e.consume(O),D):H(O)}function D(O){return O===62?(e.consume(O),P):O===45&&i===2?(e.consume(O),D):H(O)}function P(O){return O===null||tt(O)?(e.exit("htmlFlowData"),F(O)):(e.consume(O),P)}function F(O){return e.exit("htmlFlow"),t(O)}}function sCe(e,t,n){const r=this;return i;function i(a){return tt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function lCe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(px,t,n)}}const cCe={name:"htmlText",tokenize:uCe};function uCe(e,t,n){const r=this;let i,o,a;return c;function c(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),d}function d(D){return D===33?(e.consume(D),f):D===47?(e.consume(D),A):D===63?(e.consume(D),j):Xo(D)?(e.consume(D),z):n(D)}function f(D){return D===45?(e.consume(D),p):D===91?(e.consume(D),o=0,b):Xo(D)?(e.consume(D),k):n(D)}function p(D){return D===45?(e.consume(D),y):n(D)}function h(D){return D===null?n(D):D===45?(e.consume(D),v):tt(D)?(a=h,Z(D)):(e.consume(D),h)}function v(D){return D===45?(e.consume(D),y):h(D)}function y(D){return D===62?M(D):D===45?v(D):h(D)}function b(D){const P="CDATA[";return D===P.charCodeAt(o++)?(e.consume(D),o===P.length?S:b):n(D)}function S(D){return D===null?n(D):D===93?(e.consume(D),C):tt(D)?(a=S,Z(D)):(e.consume(D),S)}function C(D){return D===93?(e.consume(D),E):S(D)}function E(D){return D===62?M(D):D===93?(e.consume(D),E):S(D)}function k(D){return D===null||D===62?M(D):tt(D)?(a=k,Z(D)):(e.consume(D),k)}function j(D){return D===null?n(D):D===63?(e.consume(D),I):tt(D)?(a=j,Z(D)):(e.consume(D),j)}function I(D){return D===62?M(D):j(D)}function A(D){return Xo(D)?(e.consume(D),T):n(D)}function T(D){return D===45||Ii(D)?(e.consume(D),T):N(D)}function N(D){return tt(D)?(a=N,Z(D)):Pt(D)?(e.consume(D),N):M(D)}function z(D){return D===45||Ii(D)?(e.consume(D),z):D===47||D===62||fi(D)?L(D):n(D)}function L(D){return D===47?(e.consume(D),M):D===58||D===95||Xo(D)?(e.consume(D),K):tt(D)?(a=L,Z(D)):Pt(D)?(e.consume(D),L):M(D)}function K(D){return D===45||D===46||D===58||D===95||Ii(D)?(e.consume(D),K):J(D)}function J(D){return D===61?(e.consume(D),H):tt(D)?(a=J,Z(D)):Pt(D)?(e.consume(D),J):L(D)}function H(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,Y):tt(D)?(a=H,Z(D)):Pt(D)?(e.consume(D),H):(e.consume(D),B)}function Y(D){return D===i?(e.consume(D),i=void 0,W):D===null?n(D):tt(D)?(a=Y,Z(D)):(e.consume(D),Y)}function B(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||fi(D)?L(D):(e.consume(D),B)}function W(D){return D===47||D===62||fi(D)?L(D):n(D)}function M(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function Z(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),U}function U(D){return Pt(D)?en(e,te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):te(D)}function te(D){return e.enter("htmlTextData"),a(D)}}const tR={name:"labelEnd",resolveAll:pCe,resolveTo:hCe,tokenize:gCe},dCe={tokenize:vCe},fCe={tokenize:yCe},mCe={tokenize:bCe};function pCe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&la(e,0,e.length,n),e}function hCe(e,t){let n=e.length,r=0,i,o,a,c;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},p={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=eo(c,e.slice(o+1,o+r+3)),c=eo(c,[["enter",p,t]]),c=eo(c,eR(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),c=eo(c,[["exit",p,t],e[a-2],e[a-1],["exit",f,t]]),c=eo(c,e.slice(a+1)),c=eo(c,[["exit",d,t]]),la(e,o,e.length,c),e}function gCe(e,t,n){const r=this;let i=r.events.length,o,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return c;function c(v){return o?o._inactive?h(v):(a=r.parser.defined.includes(td(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),d):n(v)}function d(v){return v===40?e.attempt(dCe,p,a?p:h)(v):v===91?e.attempt(fCe,p,a?f:h)(v):a?p(v):h(v)}function f(v){return e.attempt(mCe,p,h)(v)}function p(v){return t(v)}function h(v){return o._balanced=!0,n(v)}}function vCe(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return fi(h)?Lm(e,o)(h):o(h)}function o(h){return h===41?p(h):zH(e,a,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return fi(h)?Lm(e,d)(h):p(h)}function c(h){return n(h)}function d(h){return h===34||h===39||h===40?UH(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):p(h)}function f(h){return fi(h)?Lm(e,p)(h):p(h)}function p(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function yCe(e,t,n){const r=this;return i;function i(c){return LH.call(r,e,o,a,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(td(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function a(c){return n(c)}}function bCe(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const xCe={name:"labelStartImage",resolveAll:tR.resolveAll,tokenize:wCe};function wCe(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),a):n(c)}function a(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const SCe={name:"labelStartLink",resolveAll:tR.resolveAll,tokenize:_Ce};function _Ce(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const i_={name:"lineEnding",tokenize:CCe};function CCe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),en(e,t,"linePrefix")}}const Tv={name:"thematicBreak",tokenize:ECe};function ECe(e,t,n){let r=0,i;return o;function o(f){return e.enter("thematicBreak"),a(f)}function a(f){return i=f,c(f)}function c(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||tt(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Pt(f)?en(e,c,"whitespace")(f):c(f))}}const ri={continuation:{tokenize:ICe},exit:NCe,name:"list",tokenize:RCe},kCe={partial:!0,tokenize:ACe},jCe={partial:!0,tokenize:TCe};function RCe(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return c;function c(y){const b=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:K1(y)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Tv,n,f)(y):f(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(y)}return n(y)}function d(y){return K1(y)&&++a<10?(e.consume(y),d):(!r.interrupt||a<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),f(y)):n(y)}function f(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(px,r.interrupt?n:p,e.attempt(kCe,v,h))}function p(y){return r.containerState.initialBlankLine=!0,o++,v(y)}function h(y){return Pt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),v):n(y)}function v(y){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function ICe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(px,i,o);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,en(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!Pt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(jCe,t,a)(c))}function a(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,en(e,e.attempt(ri,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function TCe(e,t,n){const r=this;return en(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function NCe(e){e.exit(this.containerState.type)}function ACe(e,t,n){const r=this;return en(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const a=r.events[r.events.length-1];return!Pt(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const s$={name:"setextUnderline",resolveTo:OCe,tokenize:DCe};function OCe(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function DCe(e,t,n){const r=this;let i;return o;function o(f){let p=r.events.length,h;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){h=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=f,a(f)):n(f)}function a(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===i?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),Pt(f)?en(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||tt(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const $Ce={tokenize:MCe};function MCe(e){const t=this,n=e.attempt(px,r,e.attempt(this.parser.constructs.flowInitial,i,en(e,e.attempt(this.parser.constructs.flow,i,e.attempt(F1e,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const PCe={resolveAll:VH()},zCe=FH("string"),LCe=FH("text");function FH(e){return{resolveAll:VH(e==="text"?UCe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,c);return a;function a(p){return f(p)?o(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),o(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const h=i[p];let v=-1;if(h)for(;++v<h.length;){const y=h[v];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function VH(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function UCe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,a=-1,c=0,d;for(;o--;){const f=i[o];if(typeof f=="string"){for(a=f.length;f.charCodeAt(a-1)===32;)c++,a--;if(a)break;a=-1}else if(f===-2)d=!0,c++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const FCe={42:ri,43:ri,45:ri,48:ri,49:ri,50:ri,51:ri,52:ri,53:ri,54:ri,55:ri,56:ri,57:ri,62:DH},VCe={91:G1e},BCe={[-2]:r_,[-1]:r_,32:r_},HCe={35:Q1e,42:Tv,45:[s$,Tv],60:nCe,61:s$,95:Tv,96:o$,126:o$},qCe={38:MH,92:$H},GCe={[-5]:i_,[-4]:i_,[-3]:i_,33:xCe,38:MH,42:Z1,60:[S1e,cCe],91:SCe,92:[W1e,$H],93:tR,95:Z1,96:$1e},KCe={null:[Z1,PCe]},ZCe={null:[42,95]},YCe={null:[]},WCe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ZCe,contentInitial:VCe,disable:YCe,document:FCe,flow:HCe,flowInitial:BCe,insideSpan:KCe,string:qCe,text:GCe},Symbol.toStringTag,{value:"Module"}));function XCe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let a=[],c=[];const d={attempt:N(A),check:N(T),consume:k,enter:j,exit:I,interrupt:N(T,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:b,parser:e,previous:null,sliceSerialize:v,sliceStream:y,write:h};let p=t.tokenize.call(f,d);return t.resolveAll&&o.push(t),f;function h(J){return a=eo(a,J),C(),a[a.length-1]!==null?[]:(z(t,0),f.events=eR(o,f.events,f),f.events)}function v(J,H){return JCe(y(J),H)}function y(J){return QCe(a,J)}function b(){const{_bufferIndex:J,_index:H,line:Y,column:B,offset:W}=r;return{_bufferIndex:J,_index:H,line:Y,column:B,offset:W}}function S(J){i[J.line]=J.column,K()}function C(){let J;for(;r._index<a.length;){const H=a[r._index];if(typeof H=="string")for(J=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===J&&r._bufferIndex<H.length;)E(H.charCodeAt(r._bufferIndex));else E(H)}}function E(J){p=p(J)}function k(J){tt(J)?(r.line++,r.column=1,r.offset+=J===-3?2:1,K()):J!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=J}function j(J,H){const Y=H||{};return Y.type=J,Y.start=b(),f.events.push(["enter",Y,f]),c.push(Y),Y}function I(J){const H=c.pop();return H.end=b(),f.events.push(["exit",H,f]),H}function A(J,H){z(J,H.from)}function T(J,H){H.restore()}function N(J,H){return Y;function Y(B,W,M){let Z,U,te,D;return Array.isArray(B)?F(B):"tokenize"in B?F([B]):P(B);function P(pe){return V;function V(ie){const we=ie!==null&&pe[ie],Ie=ie!==null&&pe.null,Ue=[...Array.isArray(we)?we:we?[we]:[],...Array.isArray(Ie)?Ie:Ie?[Ie]:[]];return F(Ue)(ie)}}function F(pe){return Z=pe,U=0,pe.length===0?M:O(pe[U])}function O(pe){return V;function V(ie){return D=L(),te=pe,pe.partial||(f.currentConstruct=pe),pe.name&&f.parser.constructs.disable.null.includes(pe.name)?ue():pe.tokenize.call(H?Object.assign(Object.create(f),H):f,d,ee,ue)(ie)}}function ee(pe){return J(te,D),W}function ue(pe){return D.restore(),++U<Z.length?O(Z[U]):M}}}function z(J,H){J.resolveAll&&!o.includes(J)&&o.push(J),J.resolve&&la(f.events,H,f.events.length-H,J.resolve(f.events.slice(H),f)),J.resolveTo&&(f.events=J.resolveTo(f.events,f))}function L(){const J=b(),H=f.previous,Y=f.currentConstruct,B=f.events.length,W=Array.from(c);return{from:B,restore:M};function M(){r=J,f.previous=H,f.currentConstruct=Y,f.events.length=B,c=W,K()}}function K(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function QCe(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,o)];else{if(a=e.slice(n,i),r>-1){const c=a[0];typeof c=="string"?a[0]=c.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function JCe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
130
130
  `;break}case-3:{a=`\r
131
131
  `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(o)}i=o===-2,r.push(a)}return r.join("")}function eEe(e){const r={constructs:s1e([WCe,...(e||{}).extensions||[]]),content:i(h1e),defined:[],document:i(v1e),flow:i($Ce),lazy:{},string:i(zCe),text:i(LCe)};return r;function i(o){return a;function a(c){return XCe(r,o,c)}}}function tEe(e){for(;!PH(e););return e}const l$=/[\0\t\n\r]/g;function nEe(){let e=1,t="",n=!0,r;return i;function i(o,a,c){const d=[];let f,p,h,v,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(l$.lastIndex=h,f=l$.exec(o),v=f&&f.index!==void 0?f.index:o.length,y=o.charCodeAt(v),!f){t=o.slice(h);break}if(y===10&&h===v&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),h<v&&(d.push(o.slice(h,v)),e+=v-h),y){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}h=v+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const rEe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iEe(e){return e.replace(rEe,oEe)}function oEe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return OH(n.slice(o?2:1),o?16:10)}return Jj(n)||e}const BH={}.hasOwnProperty;function aEe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),sEe(n)(tEe(eEe(n).document().write(nEe()(e,t,!0))))}function sEe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Xt),autolinkProtocol:L,autolinkEmail:L,atxHeading:o(un),blockQuote:o(Ie),characterEscape:L,characterReference:L,codeFenced:o(Ue),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(Ue,a),codeText:o(Pe,a),codeTextData:L,data:L,codeFlowValue:L,definition:o(Ze),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(St),hardBreakEscape:o(Tn),hardBreakTrailing:o(Tn),htmlFlow:o(Pn,a),htmlFlowData:L,htmlText:o(Pn,a),htmlTextData:L,image:o(hi),label:a,link:o(Xt),listItem:o(oe),listItemValue:v,listOrdered:o(G,h),listUnordered:o(G),paragraph:o(de),reference:O,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(un),strong:o(xe),thematicBreak:o(Ce)},exit:{atxHeading:d(),atxHeadingSequence:A,autolink:d(),autolinkEmail:we,autolinkProtocol:ie,blockQuote:d(),characterEscapeValue:K,characterReferenceMarkerHexadecimal:ue,characterReferenceMarkerNumeric:ue,characterReferenceValue:pe,characterReference:V,codeFenced:d(C),codeFencedFence:S,codeFencedFenceInfo:y,codeFencedFenceMeta:b,codeFlowValue:K,codeIndented:d(E),codeText:d(W),codeTextData:K,data:K,definition:d(),definitionDestinationString:I,definitionLabelString:k,definitionTitleString:j,emphasis:d(),hardBreakEscape:d(H),hardBreakTrailing:d(H),htmlFlow:d(Y),htmlFlowData:K,htmlText:d(B),htmlTextData:K,image:d(Z),label:te,labelText:U,lineEnding:J,link:d(M),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:ee,resourceDestinationString:D,resourceTitleString:P,resource:F,setextHeading:d(z),setextHeadingLineSequence:N,setextHeadingText:T,strong:d(),thematicBreak:d()}};HH(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ne){let ye={type:"root",children:[]};const Ne={stack:[ye],tokenStack:[],config:t,enter:c,exit:f,buffer:a,resume:p,data:n},Ke=[];let ot=-1;for(;++ot<ne.length;)if(ne[ot][1].type==="listOrdered"||ne[ot][1].type==="listUnordered")if(ne[ot][0]==="enter")Ke.push(ot);else{const Bt=Ke.pop();ot=i(ne,Bt,ot)}for(ot=-1;++ot<ne.length;){const Bt=t[ne[ot][0]];BH.call(Bt,ne[ot][1].type)&&Bt[ne[ot][1].type].call(Object.assign({sliceSerialize:ne[ot][2].sliceSerialize},Ne),ne[ot][1])}if(Ne.tokenStack.length>0){const Bt=Ne.tokenStack[Ne.tokenStack.length-1];(Bt[1]||c$).call(Ne,void 0,Bt[0])}for(ye.position={start:Rs(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:Rs(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},ot=-1;++ot<t.transforms.length;)ye=t.transforms[ot](ye)||ye;return ye}function i(ne,ye,Ne){let Ke=ye-1,ot=-1,Bt=!1,zn,vn,Kt,_t;for(;++Ke<=Ne;){const vt=ne[Ke];switch(vt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{vt[0]==="enter"?ot++:ot--,_t=void 0;break}case"lineEndingBlank":{vt[0]==="enter"&&(zn&&!_t&&!ot&&!Kt&&(Kt=Ke),_t=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_t=void 0}if(!ot&&vt[0]==="enter"&&vt[1].type==="listItemPrefix"||ot===-1&&vt[0]==="exit"&&(vt[1].type==="listUnordered"||vt[1].type==="listOrdered")){if(zn){let Gr=Ke;for(vn=void 0;Gr--;){const ir=ne[Gr];if(ir[1].type==="lineEnding"||ir[1].type==="lineEndingBlank"){if(ir[0]==="exit")continue;vn&&(ne[vn][1].type="lineEndingBlank",Bt=!0),ir[1].type="lineEnding",vn=Gr}else if(!(ir[1].type==="linePrefix"||ir[1].type==="blockQuotePrefix"||ir[1].type==="blockQuotePrefixWhitespace"||ir[1].type==="blockQuoteMarker"||ir[1].type==="listItemIndent"))break}Kt&&(!vn||Kt<vn)&&(zn._spread=!0),zn.end=Object.assign({},vn?ne[vn][1].start:vt[1].end),ne.splice(vn||Ke,0,["exit",zn,vt[2]]),Ke++,Ne++}if(vt[1].type==="listItemPrefix"){const Gr={type:"listItem",_spread:!1,start:Object.assign({},vt[1].start),end:void 0};zn=Gr,ne.splice(Ke,0,["enter",Gr,vt[2]]),Ke++,Ne++,Kt=void 0,_t=!0}}}return ne[ye][1]._spread=Bt,Ne}function o(ne,ye){return Ne;function Ne(Ke){c.call(this,ne(Ke),Ke),ye&&ye.call(this,Ke)}}function a(){this.stack.push({type:"fragment",children:[]})}function c(ne,ye,Ne){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([ye,Ne||void 0]),ne.position={start:Rs(ye.start),end:void 0}}function d(ne){return ye;function ye(Ne){ne&&ne.call(this,Ne),f.call(this,Ne)}}function f(ne,ye){const Ne=this.stack.pop(),Ke=this.tokenStack.pop();if(Ke)Ke[0].type!==ne.type&&(ye?ye.call(this,ne,Ke[0]):(Ke[1]||c$).call(this,ne,Ke[0]));else throw new Error("Cannot close `"+ne.type+"` ("+zm({start:ne.start,end:ne.end})+"): it’s not open");Ne.position.end=Rs(ne.end)}function p(){return o1e(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function v(ne){if(this.data.expectingFirstListItemValue){const ye=this.stack[this.stack.length-2];ye.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function y(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.lang=ne}function b(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.meta=ne}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne.replace(/(\r?\n|\r)$/g,"")}function k(ne){const ye=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=ye,Ne.identifier=td(this.sliceSerialize(ne)).toLowerCase()}function j(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ne}function I(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ne}function A(ne){const ye=this.stack[this.stack.length-1];if(!ye.depth){const Ne=this.sliceSerialize(ne).length;ye.depth=Ne}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function N(ne){const ye=this.stack[this.stack.length-1];ye.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function z(){this.data.setextHeadingSlurpLineEnding=void 0}function L(ne){const Ne=this.stack[this.stack.length-1].children;let Ke=Ne[Ne.length-1];(!Ke||Ke.type!=="text")&&(Ke=ve(),Ke.position={start:Rs(ne.start),end:void 0},Ne.push(Ke)),this.stack.push(Ke)}function K(ne){const ye=this.stack.pop();ye.value+=this.sliceSerialize(ne),ye.position.end=Rs(ne.end)}function J(ne){const ye=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ne=ye.children[ye.children.length-1];Ne.position.end=Rs(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ye.type)&&(L.call(this,ne),K.call(this,ne))}function H(){this.data.atHardBreak=!0}function Y(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne}function B(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne}function W(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.value=ne}function M(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=ye,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function Z(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const ye=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=ye,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function U(ne){const ye=this.sliceSerialize(ne),Ne=this.stack[this.stack.length-2];Ne.label=iEe(ye),Ne.identifier=td(ye).toLowerCase()}function te(){const ne=this.stack[this.stack.length-1],ye=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){const Ke=ne.children;Ne.children=Ke}else Ne.alt=ye}function D(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.url=ne}function P(){const ne=this.resume(),ye=this.stack[this.stack.length-1];ye.title=ne}function F(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ee(ne){const ye=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=ye,Ne.identifier=td(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function ue(ne){this.data.characterReferenceType=ne.type}function pe(ne){const ye=this.sliceSerialize(ne),Ne=this.data.characterReferenceType;let Ke;Ne?(Ke=OH(ye,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ke=Jj(ye);const ot=this.stack[this.stack.length-1];ot.value+=Ke}function V(ne){const ye=this.stack.pop();ye.position.end=Rs(ne.end)}function ie(ne){K.call(this,ne);const ye=this.stack[this.stack.length-1];ye.url=this.sliceSerialize(ne)}function we(ne){K.call(this,ne);const ye=this.stack[this.stack.length-1];ye.url="mailto:"+this.sliceSerialize(ne)}function Ie(){return{type:"blockquote",children:[]}}function Ue(){return{type:"code",lang:null,meta:null,value:""}}function Pe(){return{type:"inlineCode",value:""}}function Ze(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function St(){return{type:"emphasis",children:[]}}function un(){return{type:"heading",depth:0,children:[]}}function Tn(){return{type:"break"}}function Pn(){return{type:"html",value:""}}function hi(){return{type:"image",title:null,url:"",alt:null}}function Xt(){return{type:"link",title:null,url:"",children:[]}}function G(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function oe(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function de(){return{type:"paragraph",children:[]}}function xe(){return{type:"strong",children:[]}}function ve(){return{type:"text",value:""}}function Ce(){return{type:"thematicBreak"}}}function Rs(e){return{line:e.line,column:e.column,offset:e.offset}}function HH(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?HH(e,r):lEe(e,r)}}function lEe(e,t){let n;for(n in t)if(BH.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function c$(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+zm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+zm({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+zm({start:t.start,end:t.end})+") is still open")}function cEe(e){const t=this;t.parser=n;function n(r){return aEe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function uEe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function dEe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
@@ -181,7 +181,7 @@ cd ${r}`},{title:"Start Local Harper Instance",code:"npm run dev",alert:"You wil
181
181
  focus-visible:ring-1
182
182
  focus-visible:outline-1
183
183
  focus-visible:ring-purple-200
184
- aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",outline:"border bg-default border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});var h9="Toggle",g9=x.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[a,c]=Ao({prop:n,onChange:i,defaultProp:r??!1,caller:h9});return u.jsx(Ge.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:je(e.onClick,()=>{e.disabled||c(!a)})})});g9.displayName=h9;var BTe=g9;function HTe({className:e,variant:t,size:n,...r}){return u.jsx(BTe,{"data-slot":"toggle",className:ze(VTe({variant:t,size:n,className:e})),...r})}const g_={limit:"100",level:"undefined",from:"",until:""},qTe=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return u.jsx(Mo,{variant:m9(t),children:So(t)})}},{accessorKey:"timestamp",header:"Date",cell:({row:e})=>{const{timestamp:t}=e.original;return u.jsx("span",{children:new Date(t).toLocaleDateString()})}},{accessorKey:"time",header:"Time",cell:({row:e})=>{const{timestamp:t}=e.original;return u.jsx("span",{children:new Date(t).toLocaleTimeString()})}},{accessorKey:"thread",header:"Thread"},{accessorKey:"node",header:"Node",cell:({row:e})=>{const{node:t}=e.original,n=p9(t);return u.jsx(u.Fragment,{children:t?u.jsxs(wE,{children:[u.jsx(SE,{asChild:!0,children:u.jsxs(Mo,{variant:n,children:[t.split(".")[0],"..."]})}),u.jsx(_E,{className:"bg-grey-700",arrowClassName:"bg-grey-700 fill-grey-700",children:t})]}):null})}},{accessorKey:"tags",header:"Tags"},{accessorKey:"message",header:"Message",cell:({row:e})=>{const{message:t}=e.original;return e.getIsSelected(),u.jsx("pre",{children:u.jsx("code",{children:t})})}}],GTe=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),r=new Date(t);return n<=r};function KTe(){const[e,t]=x.useState(g_),[n,r]=x.useState(!1),[i,o]=x.useState(),[a,c]=x.useState(!1),d=Yt(),{data:f,isLoading:p,refetch:h,isFetching:v}=zt(LTe({logFilters:e,...d,replicated:d.entityType==="cluster",isAutoRefreshEnabled:a})),y=hn({resolver:wn(UTe),defaultValues:g_,mode:"onChange"}),b=k=>{o(k.original),r(!0)},S=async k=>{if(!GTe(k.from,k.until)){y.setError("from",{type:"onChange",message:"Start date must be before end date"}),y.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(k)},C=async()=>{y.reset(),t(g_)},E=Nc(h);return u.jsxs("div",{className:"grid grid-cols-1 gap-4 text-white md:grid-cols-12",children:[u.jsxs("section",{className:"col-span-1 md:col-span-4 lg:col-span-3 px-2 pt-4 md:pt-12",children:[u.jsx(FTe,{form:y,resetFilters:C,submitFilters:S}),u.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[u.jsxs(Se,{variant:"defaultOutline",onClick:E,disabled:v||p||a,className:"grow",children:[u.jsx(Ba,{}),"Refresh"]}),u.jsxs(HTe,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:c,children:[u.jsx(Ba,{}),"Auto Refresh ",a?"On":"Off"]})]})]}),u.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:p?u.jsx("div",{children:"Loading..."}):u.jsx("div",{children:u.jsx(MTe,{columns:qTe,data:f||[],onRowClick:b})})}),u.jsx(zTe,{isModalOpen:n,setIsModalOpen:r,data:i})]})}function ZTe(e){return nt({getParentRoute:()=>e,path:"logs",component:KTe})}function YTe(e){return nt({getParentRoute:()=>e,path:"status",component:JM(async()=>Ip(()=>import("./index-n1A9yxoS.js"),__vite__mapDeps([3,1])),"StatusIndex")})}function WTe(e){const t=$Te(),n=[ZTe(t),...zRe(t),u_e(t),YTe(t),yIe(t),jTe(t)];return t.addChildren(n)}nt({getParentRoute:()=>dx,path:"profile",component:JM(async()=>Ip(()=>import("./index-DzmdGhay.js"),[]),"ProfileIndex")});const XTe=db.addChildren([...cge,dx.addChildren([WTe()])]);function QTe({routeTree:e=XTe,authentication:t}){const n=YK();return TY({routeTree:e,history:n,defaultNotFoundComponent:kQ,defaultErrorComponent:Fv,defaultPreload:jQ()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:Vv,authentication:t||{}}})}function JTe(){const e=$Y(),t=QTe({authentication:e});return u.jsxs(u.Fragment,{children:[u.jsx(OY,{router:t,context:{authentication:e}}),!1]})}const eNe=({...e})=>u.jsx(eJ,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground font-medium"}},...e});var tNe=function(){return null};function nNe(){return Dle(),Ese(),u.jsxs(u.Fragment,{children:[u.jsxs(NK,{client:Vv,children:[u.jsx(JTe,{}),u.jsx(tNe,{buttonPosition:"bottom-right"})]}),u.jsx(eNe,{richColors:!0})]})}var v_={exports:{}},Sm={},y_={exports:{}},b_={};var H$;function rNe(){return H$||(H$=1,(function(e){function t(M,Z){var U=M.length;M.push(Z);e:for(;0<U;){var te=U-1>>>1,D=M[te];if(0<i(D,Z))M[te]=Z,M[U]=D,U=te;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var Z=M[0],U=M.pop();if(U!==Z){M[0]=U;e:for(var te=0,D=M.length,P=D>>>1;te<P;){var F=2*(te+1)-1,O=M[F],ee=F+1,ue=M[ee];if(0>i(O,U))ee<D&&0>i(ue,O)?(M[te]=ue,M[ee]=U,te=ee):(M[te]=O,M[F]=U,te=F);else if(ee<D&&0>i(ue,U))M[te]=ue,M[ee]=U,te=ee;else break e}}return Z}function i(M,Z){var U=M.sortIndex-Z.sortIndex;return U!==0?U:M.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],f=[],p=1,h=null,v=3,y=!1,b=!1,S=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function I(M){for(var Z=n(f);Z!==null;){if(Z.callback===null)r(f);else if(Z.startTime<=M)r(f),Z.sortIndex=Z.expirationTime,t(d,Z);else break;Z=n(f)}}function A(M){if(S=!1,I(M),!b)if(n(d)!==null)b=!0,T||(T=!0,H());else{var Z=n(f);Z!==null&&W(A,Z.startTime-M)}}var T=!1,N=-1,z=5,L=-1;function K(){return C?!0:!(e.unstable_now()-L<z)}function J(){if(C=!1,T){var M=e.unstable_now();L=M;var Z=!0;try{e:{b=!1,S&&(S=!1,k(N),N=-1),y=!0;var U=v;try{t:{for(I(M),h=n(d);h!==null&&!(h.expirationTime>M&&K());){var te=h.callback;if(typeof te=="function"){h.callback=null,v=h.priorityLevel;var D=te(h.expirationTime<=M);if(M=e.unstable_now(),typeof D=="function"){h.callback=D,I(M),Z=!0;break t}h===n(d)&&r(d),I(M)}else r(d);h=n(d)}if(h!==null)Z=!0;else{var P=n(f);P!==null&&W(A,P.startTime-M),Z=!1}}break e}finally{h=null,v=U,y=!1}Z=void 0}}finally{Z?H():T=!1}}}var H;if(typeof j=="function")H=function(){j(J)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,B=Y.port2;Y.port1.onmessage=J,H=function(){B.postMessage(null)}}else H=function(){E(J,0)};function W(M,Z){N=E(function(){M(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(M){switch(v){case 1:case 2:case 3:var Z=3;break;default:Z=v}var U=v;v=Z;try{return M()}finally{v=U}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(M,Z){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var U=v;v=M;try{return Z()}finally{v=U}},e.unstable_scheduleCallback=function(M,Z,U){var te=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?te+U:te):U=te,M){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=U+D,M={id:p++,callback:Z,priorityLevel:M,startTime:U,expirationTime:D,sortIndex:-1},U>te?(M.sortIndex=U,t(f,M),n(d)===null&&M===n(f)&&(S?(k(N),N=-1):S=!0,W(A,U-te))):(M.sortIndex=D,t(d,M),b||y||(b=!0,T||(T=!0,H()))),M},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(M){var Z=v;return function(){var U=v;v=Z;try{return M.apply(this,arguments)}finally{v=U}}}})(b_)),b_}var q$;function iNe(){return q$||(q$=1,y_.exports=rNe()),y_.exports}var G$;function oNe(){if(G$)return Sm;G$=1;var e=iNe(),t=gp(),n=QM();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)l+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var l=s,m=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(m=l.return),s=l.return;while(s)}return l.tag===3?m:null}function a(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function d(s){if(o(s)!==s)throw Error(r(188))}function f(s){var l=s.alternate;if(!l){if(l=o(s),l===null)throw Error(r(188));return l!==s?null:s}for(var m=s,g=l;;){var w=m.return;if(w===null)break;var _=w.alternate;if(_===null){if(g=w.return,g!==null){m=g;continue}break}if(w.child===_.child){for(_=w.child;_;){if(_===m)return d(w),s;if(_===g)return d(w),l;_=_.sibling}throw Error(r(188))}if(m.return!==g.return)m=w,g=_;else{for(var R=!1,$=w.child;$;){if($===m){R=!0,m=w,g=_;break}if($===g){R=!0,g=w,m=_;break}$=$.sibling}if(!R){for($=_.child;$;){if($===m){R=!0,m=_,g=w;break}if($===g){R=!0,g=_,m=w;break}$=$.sibling}if(!R)throw Error(r(189))}}if(m.alternate!==g)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?s:l}function p(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=p(s),l!==null)return l;s=s.sibling}return null}var h=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),j=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function H(s){return s===null||typeof s!="object"?null:(s=J&&s[J]||s["@@iterator"],typeof s=="function"?s:null)}var Y=Symbol.for("react.client.reference");function B(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===Y?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case A:return"Suspense";case T:return"SuspenseList";case L:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case j:return s.displayName||"Context";case k:return(s._context.displayName||"Context")+".Consumer";case I:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case N:return l=s.displayName||null,l!==null?l:B(s.type)||"Memo";case z:l=s._payload,s=s._init;try{return B(s(l))}catch{}}return null}var W=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},te=[],D=-1;function P(s){return{current:s}}function F(s){0>D||(s.current=te[D],te[D]=null,D--)}function O(s,l){D++,te[D]=s.current,s.current=l}var ee=P(null),ue=P(null),pe=P(null),V=P(null);function ie(s,l){switch(O(pe,l),O(ue,s),O(ee,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?ON(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=ON(l),s=DN(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}F(ee),O(ee,s)}function we(){F(ee),F(ue),F(pe)}function Ie(s){s.memoizedState!==null&&O(V,s);var l=ee.current,m=DN(l,s.type);l!==m&&(O(ue,s),O(ee,m))}function Ue(s){ue.current===s&&(F(ee),F(ue)),V.current===s&&(F(V),Gf._currentValue=U)}var Pe,Ze;function St(s){if(Pe===void 0)try{throw Error()}catch(m){var l=m.stack.trim().match(/\n( *(at )?)/);Pe=l&&l[1]||"",Ze=-1<m.stack.indexOf(`
184
+ aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",outline:"border bg-default border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});var h9="Toggle",g9=x.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[a,c]=Ao({prop:n,onChange:i,defaultProp:r??!1,caller:h9});return u.jsx(Ge.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:je(e.onClick,()=>{e.disabled||c(!a)})})});g9.displayName=h9;var BTe=g9;function HTe({className:e,variant:t,size:n,...r}){return u.jsx(BTe,{"data-slot":"toggle",className:ze(VTe({variant:t,size:n,className:e})),...r})}const g_={limit:"100",level:"undefined",from:"",until:""},qTe=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return u.jsx(Mo,{variant:m9(t),children:So(t)})}},{accessorKey:"timestamp",header:"Date",cell:({row:e})=>{const{timestamp:t}=e.original;return u.jsx("span",{children:new Date(t).toLocaleDateString()})}},{accessorKey:"time",header:"Time",cell:({row:e})=>{const{timestamp:t}=e.original;return u.jsx("span",{children:new Date(t).toLocaleTimeString()})}},{accessorKey:"thread",header:"Thread"},{accessorKey:"node",header:"Node",cell:({row:e})=>{const{node:t}=e.original,n=p9(t);return u.jsx(u.Fragment,{children:t?u.jsxs(wE,{children:[u.jsx(SE,{asChild:!0,children:u.jsxs(Mo,{variant:n,children:[t.split(".")[0],"..."]})}),u.jsx(_E,{className:"bg-grey-700",arrowClassName:"bg-grey-700 fill-grey-700",children:t})]}):null})}},{accessorKey:"tags",header:"Tags"},{accessorKey:"message",header:"Message",cell:({row:e})=>{const{message:t}=e.original;return e.getIsSelected(),u.jsx("pre",{children:u.jsx("code",{children:t})})}}],GTe=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),r=new Date(t);return n<=r};function KTe(){const[e,t]=x.useState(g_),[n,r]=x.useState(!1),[i,o]=x.useState(),[a,c]=x.useState(!1),d=Yt(),{data:f,isLoading:p,refetch:h,isFetching:v}=zt(LTe({logFilters:e,...d,replicated:d.entityType==="cluster",isAutoRefreshEnabled:a})),y=hn({resolver:wn(UTe),defaultValues:g_,mode:"onChange"}),b=k=>{o(k.original),r(!0)},S=async k=>{if(!GTe(k.from,k.until)){y.setError("from",{type:"onChange",message:"Start date must be before end date"}),y.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(k)},C=async()=>{y.reset(),t(g_)},E=Nc(h);return u.jsxs("div",{className:"grid grid-cols-1 gap-4 text-white md:grid-cols-12",children:[u.jsxs("section",{className:"col-span-1 md:col-span-4 lg:col-span-3 px-2 pt-4 md:pt-12",children:[u.jsx(FTe,{form:y,resetFilters:C,submitFilters:S}),u.jsxs("div",{className:"flex items-center justify-between space-x-2 mt-2",children:[u.jsxs(Se,{variant:"defaultOutline",onClick:E,disabled:v||p||a,className:"grow",children:[u.jsx(Ba,{}),"Refresh"]}),u.jsxs(HTe,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:c,children:[u.jsx(Ba,{}),"Auto Refresh ",a?"On":"Off"]})]})]}),u.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:p?u.jsx("div",{children:"Loading..."}):u.jsx("div",{children:u.jsx(MTe,{columns:qTe,data:f||[],onRowClick:b})})}),u.jsx(zTe,{isModalOpen:n,setIsModalOpen:r,data:i})]})}function ZTe(e){return nt({getParentRoute:()=>e,path:"logs",component:KTe})}function YTe(e){return nt({getParentRoute:()=>e,path:"status",component:JM(async()=>Ip(()=>import("./index-zg8oq7u7.js"),__vite__mapDeps([3,1])),"StatusIndex")})}function WTe(e){const t=$Te(),n=[ZTe(t),...zRe(t),u_e(t),YTe(t),yIe(t),jTe(t)];return t.addChildren(n)}nt({getParentRoute:()=>dx,path:"profile",component:JM(async()=>Ip(()=>import("./index-B9_qS7Kl.js"),[]),"ProfileIndex")});const XTe=db.addChildren([...cge,dx.addChildren([WTe()])]);function QTe({routeTree:e=XTe,authentication:t}){const n=YK();return TY({routeTree:e,history:n,defaultNotFoundComponent:kQ,defaultErrorComponent:Fv,defaultPreload:jQ()?!1:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:Vv,authentication:t||{}}})}function JTe(){const e=$Y(),t=QTe({authentication:e});return u.jsxs(u.Fragment,{children:[u.jsx(OY,{router:t,context:{authentication:e}}),!1]})}const eNe=({...e})=>u.jsx(eJ,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground font-medium"}},...e});var tNe=function(){return null};function nNe(){return Dle(),Ese(),u.jsxs(u.Fragment,{children:[u.jsxs(NK,{client:Vv,children:[u.jsx(JTe,{}),u.jsx(tNe,{buttonPosition:"bottom-right"})]}),u.jsx(eNe,{richColors:!0})]})}var v_={exports:{}},Sm={},y_={exports:{}},b_={};var H$;function rNe(){return H$||(H$=1,(function(e){function t(M,Z){var U=M.length;M.push(Z);e:for(;0<U;){var te=U-1>>>1,D=M[te];if(0<i(D,Z))M[te]=Z,M[U]=D,U=te;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var Z=M[0],U=M.pop();if(U!==Z){M[0]=U;e:for(var te=0,D=M.length,P=D>>>1;te<P;){var F=2*(te+1)-1,O=M[F],ee=F+1,ue=M[ee];if(0>i(O,U))ee<D&&0>i(ue,O)?(M[te]=ue,M[ee]=U,te=ee):(M[te]=O,M[F]=U,te=F);else if(ee<D&&0>i(ue,U))M[te]=ue,M[ee]=U,te=ee;else break e}}return Z}function i(M,Z){var U=M.sortIndex-Z.sortIndex;return U!==0?U:M.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],f=[],p=1,h=null,v=3,y=!1,b=!1,S=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function I(M){for(var Z=n(f);Z!==null;){if(Z.callback===null)r(f);else if(Z.startTime<=M)r(f),Z.sortIndex=Z.expirationTime,t(d,Z);else break;Z=n(f)}}function A(M){if(S=!1,I(M),!b)if(n(d)!==null)b=!0,T||(T=!0,H());else{var Z=n(f);Z!==null&&W(A,Z.startTime-M)}}var T=!1,N=-1,z=5,L=-1;function K(){return C?!0:!(e.unstable_now()-L<z)}function J(){if(C=!1,T){var M=e.unstable_now();L=M;var Z=!0;try{e:{b=!1,S&&(S=!1,k(N),N=-1),y=!0;var U=v;try{t:{for(I(M),h=n(d);h!==null&&!(h.expirationTime>M&&K());){var te=h.callback;if(typeof te=="function"){h.callback=null,v=h.priorityLevel;var D=te(h.expirationTime<=M);if(M=e.unstable_now(),typeof D=="function"){h.callback=D,I(M),Z=!0;break t}h===n(d)&&r(d),I(M)}else r(d);h=n(d)}if(h!==null)Z=!0;else{var P=n(f);P!==null&&W(A,P.startTime-M),Z=!1}}break e}finally{h=null,v=U,y=!1}Z=void 0}}finally{Z?H():T=!1}}}var H;if(typeof j=="function")H=function(){j(J)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,B=Y.port2;Y.port1.onmessage=J,H=function(){B.postMessage(null)}}else H=function(){E(J,0)};function W(M,Z){N=E(function(){M(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(M){switch(v){case 1:case 2:case 3:var Z=3;break;default:Z=v}var U=v;v=Z;try{return M()}finally{v=U}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(M,Z){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var U=v;v=M;try{return Z()}finally{v=U}},e.unstable_scheduleCallback=function(M,Z,U){var te=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?te+U:te):U=te,M){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=U+D,M={id:p++,callback:Z,priorityLevel:M,startTime:U,expirationTime:D,sortIndex:-1},U>te?(M.sortIndex=U,t(f,M),n(d)===null&&M===n(f)&&(S?(k(N),N=-1):S=!0,W(A,U-te))):(M.sortIndex=D,t(d,M),b||y||(b=!0,T||(T=!0,H()))),M},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(M){var Z=v;return function(){var U=v;v=Z;try{return M.apply(this,arguments)}finally{v=U}}}})(b_)),b_}var q$;function iNe(){return q$||(q$=1,y_.exports=rNe()),y_.exports}var G$;function oNe(){if(G$)return Sm;G$=1;var e=iNe(),t=gp(),n=QM();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)l+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var l=s,m=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(m=l.return),s=l.return;while(s)}return l.tag===3?m:null}function a(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function d(s){if(o(s)!==s)throw Error(r(188))}function f(s){var l=s.alternate;if(!l){if(l=o(s),l===null)throw Error(r(188));return l!==s?null:s}for(var m=s,g=l;;){var w=m.return;if(w===null)break;var _=w.alternate;if(_===null){if(g=w.return,g!==null){m=g;continue}break}if(w.child===_.child){for(_=w.child;_;){if(_===m)return d(w),s;if(_===g)return d(w),l;_=_.sibling}throw Error(r(188))}if(m.return!==g.return)m=w,g=_;else{for(var R=!1,$=w.child;$;){if($===m){R=!0,m=w,g=_;break}if($===g){R=!0,g=w,m=_;break}$=$.sibling}if(!R){for($=_.child;$;){if($===m){R=!0,m=_,g=w;break}if($===g){R=!0,g=_,m=w;break}$=$.sibling}if(!R)throw Error(r(189))}}if(m.alternate!==g)throw Error(r(190))}if(m.tag!==3)throw Error(r(188));return m.stateNode.current===m?s:l}function p(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=p(s),l!==null)return l;s=s.sibling}return null}var h=Object.assign,v=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),j=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function H(s){return s===null||typeof s!="object"?null:(s=J&&s[J]||s["@@iterator"],typeof s=="function"?s:null)}var Y=Symbol.for("react.client.reference");function B(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===Y?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case E:return"Profiler";case C:return"StrictMode";case A:return"Suspense";case T:return"SuspenseList";case L:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case j:return s.displayName||"Context";case k:return(s._context.displayName||"Context")+".Consumer";case I:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case N:return l=s.displayName||null,l!==null?l:B(s.type)||"Memo";case z:l=s._payload,s=s._init;try{return B(s(l))}catch{}}return null}var W=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},te=[],D=-1;function P(s){return{current:s}}function F(s){0>D||(s.current=te[D],te[D]=null,D--)}function O(s,l){D++,te[D]=s.current,s.current=l}var ee=P(null),ue=P(null),pe=P(null),V=P(null);function ie(s,l){switch(O(pe,l),O(ue,s),O(ee,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?ON(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=ON(l),s=DN(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}F(ee),O(ee,s)}function we(){F(ee),F(ue),F(pe)}function Ie(s){s.memoizedState!==null&&O(V,s);var l=ee.current,m=DN(l,s.type);l!==m&&(O(ue,s),O(ee,m))}function Ue(s){ue.current===s&&(F(ee),F(ue)),V.current===s&&(F(V),Gf._currentValue=U)}var Pe,Ze;function St(s){if(Pe===void 0)try{throw Error()}catch(m){var l=m.stack.trim().match(/\n( *(at )?)/);Pe=l&&l[1]||"",Ze=-1<m.stack.indexOf(`
185
185
  at`)?" (<anonymous>)":-1<m.stack.indexOf("@")?"@unknown:0:0":""}return`
186
186
  `+Pe+s+Ze}var un=!1;function Tn(s,l){if(!s||un)return"";un=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(l){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(me){var ce=me}Reflect.construct(s,[],be)}else{try{be.call()}catch(me){ce=me}s.call(be.prototype)}}else{try{throw Error()}catch(me){ce=me}(be=s())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(me){if(me&&ce&&typeof me.stack=="string")return[me.stack,ce.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var w=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");w&&w.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=g.DetermineComponentFrameRoot(),R=_[0],$=_[1];if(R&&$){var q=R.split(`
187
187
  `),le=$.split(`