From c1695df2d6fed3f9ed58b2c6818dcee8ab185a89 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 1 Nov 2023 13:49:42 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20small=20bug=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/webview/assets/index.js | 34 +++++++++---------- extensions/vscode/gui/assets/index.js | 34 +++++++++---------- extensions/vscode/src/continueIdeClient.ts | 2 +- server/continuedev/server/protocols/gui.py | 2 +- server/continuedev/server/window_manager.py | 11 +++--- 5 files changed, 42 insertions(+), 41 deletions(-) diff --git a/extensions/intellij/src/main/resources/webview/assets/index.js b/extensions/intellij/src/main/resources/webview/assets/index.js index ed209b663..bcc6ed6e2 100644 --- a/extensions/intellij/src/main/resources/webview/assets/index.js +++ b/extensions/intellij/src/main/resources/webview/assets/index.js @@ -45,7 +45,7 @@ Error generating stack: `+a.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var c9=Symbol.for("react.element"),d9=Symbol.for("react.portal"),wm=Symbol.for("react.fragment"),Am=Symbol.for("react.strict_mode"),Cm=Symbol.for("react.profiler"),km=Symbol.for("react.provider"),xm=Symbol.for("react.context"),YK=Symbol.for("react.server_context"),Im=Symbol.for("react.forward_ref"),Rm=Symbol.for("react.suspense"),Nm=Symbol.for("react.suspense_list"),Om=Symbol.for("react.memo"),Dm=Symbol.for("react.lazy"),XK=Symbol.for("react.offscreen"),qD;qD=Symbol.for("react.module.reference");function _a(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case c9:switch(e=e.type,e){case wm:case Cm:case Am:case Rm:case Nm:return e;default:switch(e=e&&e.$$typeof,e){case YK:case xm:case Im:case Dm:case Om:case km:return e;default:return t}}case d9:return t}}}sn.ContextConsumer=xm;sn.ContextProvider=km;sn.Element=c9;sn.ForwardRef=Im;sn.Fragment=wm;sn.Lazy=Dm;sn.Memo=Om;sn.Portal=d9;sn.Profiler=Cm;sn.StrictMode=Am;sn.Suspense=Rm;sn.SuspenseList=Nm;sn.isAsyncMode=function(){return!1};sn.isConcurrentMode=function(){return!1};sn.isContextConsumer=function(e){return _a(e)===xm};sn.isContextProvider=function(e){return _a(e)===km};sn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===c9};sn.isForwardRef=function(e){return _a(e)===Im};sn.isFragment=function(e){return _a(e)===wm};sn.isLazy=function(e){return _a(e)===Dm};sn.isMemo=function(e){return _a(e)===Om};sn.isPortal=function(e){return _a(e)===d9};sn.isProfiler=function(e){return _a(e)===Cm};sn.isStrictMode=function(e){return _a(e)===Am};sn.isSuspense=function(e){return _a(e)===Rm};sn.isSuspenseList=function(e){return _a(e)===Nm};sn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===wm||e===Cm||e===Am||e===Rm||e===Nm||e===XK||typeof e=="object"&&e!==null&&(e.$$typeof===Dm||e.$$typeof===Om||e.$$typeof===km||e.$$typeof===xm||e.$$typeof===Im||e.$$typeof===qD||e.getModuleId!==void 0)};sn.typeOf=_a;WD.exports=sn;var p9=WD.exports;const ZK=Vi(p9);function QK(e){function t(le,L,ie,Se,X){for(var ke=0,te=0,Me=0,Re=0,Ze,We,dt=0,ot=0,je,pt=je=Ze=0,U=0,re=0,de=0,xe=0,ye=ie.length,Te=ye-1,Le,ze="",Ye="",jt="",ue="",Ee;UZe)&&(xe=(ze=ze.replace(" ",":")).length),0Se&&(Se=(L=L.trim()).charCodeAt(0)),Se){case 38:return L.replace(E,"$1"+le.trim());case 58:return le.trim()+L.replace(E,"$1"+le.trim());default:if(0<1*ie&&0te.charCodeAt(8))break;case 115:X=X.replace(te,"-webkit-"+te)+";"+X;break;case 207:case 102:X=X.replace(te,"-webkit-"+(102ie.charCodeAt(0)&&(ie=ie.trim()),pe=ie,ie=[pe],0Ye)&&(xe=(ze=ze.replace(" ",":")).length),0Se&&(Se=(L=L.trim()).charCodeAt(0)),Se){case 38:return L.replace(E,"$1"+le.trim());case 58:return le.trim()+L.replace(E,"$1"+le.trim());default:if(0<1*ie&&0te.charCodeAt(8))break;case 115:X=X.replace(te,"-webkit-"+te)+";"+X;break;case 207:case 102:X=X.replace(te,"-webkit-"+(102ie.charCodeAt(0)&&(ie=ie.trim()),pe=ie,ie=[pe],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var yY=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,i=0;i=this.groupSizes.length){for(var i=this.groupSizes,a=i.length,o=a;n>=o;)(o<<=1)<0&&Bp(16,""+n);this.groupSizes=new Uint32Array(o),this.groupSizes.set(i),this.length=o;for(var s=a;s=this.length||this.groupSizes[n]===0)return r;for(var i=this.groupSizes[n],a=this.indexOfGroup(n),o=a+i,s=a;s=Pd&&(Pd=t+1),Ch.set(e,t),wg.set(t,e)},_Y="style["+rc+'][data-styled-version="5.3.11"]',TY=new RegExp("^"+rc+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),SY=function(e,t,n){for(var r,i=n.split(","),a=0,o=i.length;a=0;c--){var p=u[c];if(p&&p.nodeType===1&&p.hasAttribute(rc))return p}}(n),a=i!==void 0?i.nextSibling:null;r.setAttribute(rc,"active"),r.setAttribute("data-styled-version","5.3.11");var o=AY();return o&&r.setAttribute("nonce",o),n.insertBefore(r,a),r},CY=function(){function e(n){var r=this.element=QD(n);r.appendChild(document.createTextNode("")),this.sheet=function(i){if(i.sheet)return i.sheet;for(var a=document.styleSheets,o=0,s=a.length;o=0){var i=document.createTextNode(r),a=this.nodes[n];return this.element.insertBefore(i,a||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n0&&(f+=m+",")}),a+=""+c+p+'{content:"'+f+`"}/*!sc*/ -`}}}return a}(this)},e}(),RY=/(a)(d)/gi,NC=function(e){return String.fromCharCode(e+(e>25?39:97))};function qb(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=NC(t%52)+n;return(NC(t%52)+n).replace(RY,"$1-$2")}var A1=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},eL=function(e){return A1(5381,e)};function NY(e){for(var t=0;t>>0);if(!n.hasNameForId(i,s)){var u=r(o,"."+s,void 0,i);n.insertRules(i,s,u)}a.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,p=A1(this.baseHash,r.hash),f="",m=0;m>>0);if(!n.hasNameForId(i,T)){var E=r(f,"."+T,void 0,i);n.insertRules(i,T,E)}a.push(T)}}return a.join(" ")},e}(),LY=/^\s*\/\/.*$/gm,MY=[":","[",".","#"];function FY(e){var t,n,r,i,a=e===void 0?ul:e,o=a.options,s=o===void 0?ul:o,u=a.plugins,c=u===void 0?Sg:u,p=new QK(s),f=[],m=function(y){function T(E){if(E)try{y(E+"}")}catch{}}return function(E,v,w,A,R,k,N,B,q,P){switch(E){case 1:if(q===0&&v.charCodeAt(0)===64)return y(v+";"),"";break;case 2:if(B===0)return v+"/*|*/";break;case 3:switch(B){case 102:case 112:return y(w[0]+v),"";default:return v+(P===0?"/*|*/":"")}case-2:v.split("/*|*/}").forEach(T)}}}(function(y){f.push(y)}),g=function(y,T,E){return T===0&&MY.indexOf(E[n.length])!==-1||E.match(i)?y:"."+t};function b(y,T,E,v){v===void 0&&(v="&");var w=y.replace(LY,""),A=T&&E?E+" "+T+" { "+w+" }":w;return t=v,n=T,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),p(E||!T?"":T,A)}return p.use([].concat(c,[function(y,T,E){y===2&&E.length&&E[0].lastIndexOf(n)>0&&(E[0]=E[0].replace(r,g))},m,function(y){if(y===-2){var T=f;return f=[],T}}])),b.hash=c.length?c.reduce(function(y,T){return T.name||Bp(15),A1(y,T.name)},5381).toString():"",b}var tL=st.createContext();tL.Consumer;var nL=st.createContext(),PY=(nL.Consumer,new JD),Kb=FY();function BY(){return C.useContext(tL)||PY}function UY(){return C.useContext(nL)||Kb}var rL=function(){function e(t,n){var r=this;this.inject=function(i,a){a===void 0&&(a=Kb);var o=r.name+a.hash;i.hasNameForId(r.id,o)||i.insertRules(r.id,o,a(r.rules,o,"@keyframes"))},this.toString=function(){return Bp(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=Kb),this.name+t.hash},e}(),$Y=/([A-Z])/,zY=/([A-Z])/g,HY=/^ms-/,jY=function(e){return"-"+e.toLowerCase()};function OC(e){return $Y.test(e)?e.replace(zY,jY).replace(HY,"-ms-"):e}var DC=function(e){return e==null||e===!1||e===""};function ic(e,t,n,r){if(Array.isArray(e)){for(var i,a=[],o=0,s=e.length;o1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,WY=/(^-|-$)/g;function C3(e){return e.replace(VY,"-").replace(WY,"")}var aL=function(e){return qb(eL(e)>>>0)};function A0(e){return typeof e=="string"&&!0}var Yb=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},qY=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function KY(e,t,n){var r=e[n];Yb(t)&&Yb(r)?oL(r,t):e[n]=t}function oL(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(P[B]=k[B]);return P}(t,["componentId"]),R=w&&w+"-"+(A0(v)?v:C3(IC(v)));return lL(v,is({},A,{attrs:m,componentId:R}),n)},Object.defineProperty(b,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(v){this._foldedDefaultProps=r?oL({},e.defaultProps,v):v}}),Object.defineProperty(b,"toString",{value:function(){return"."+b.styledComponentId}}),i&&mY(b,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),b}var Xb=function(e){return function t(n,r,i){if(i===void 0&&(i=ul),!p9.isValidElementType(r))return Bp(1,String(r));var a=function(){return n(r,i,iL.apply(void 0,arguments))};return a.withConfig=function(o){return t(n,r,is({},i,{},o))},a.attrs=function(o){return t(n,r,is({},i,{attrs:Array.prototype.concat(i.attrs,o).filter(Boolean)}))},a}(lL,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Xb[e]=Xb(e)});function Gm(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r25?39:97))};function qb(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=NC(t%52)+n;return(NC(t%52)+n).replace(RY,"$1-$2")}var A1=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},eL=function(e){return A1(5381,e)};function NY(e){for(var t=0;t>>0);if(!n.hasNameForId(i,s)){var u=r(o,"."+s,void 0,i);n.insertRules(i,s,u)}a.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,p=A1(this.baseHash,r.hash),f="",m=0;m>>0);if(!n.hasNameForId(i,T)){var E=r(f,"."+T,void 0,i);n.insertRules(i,T,E)}a.push(T)}}return a.join(" ")},e}(),LY=/^\s*\/\/.*$/gm,MY=[":","[",".","#"];function FY(e){var t,n,r,i,a=e===void 0?ul:e,o=a.options,s=o===void 0?ul:o,u=a.plugins,c=u===void 0?Sg:u,p=new QK(s),f=[],m=function(y){function T(E){if(E)try{y(E+"}")}catch{}}return function(E,v,w,A,R,k,N,B,q,P){switch(E){case 1:if(q===0&&v.charCodeAt(0)===64)return y(v+";"),"";break;case 2:if(B===0)return v+"/*|*/";break;case 3:switch(B){case 102:case 112:return y(w[0]+v),"";default:return v+(P===0?"/*|*/":"")}case-2:v.split("/*|*/}").forEach(T)}}}(function(y){f.push(y)}),g=function(y,T,E){return T===0&&MY.indexOf(E[n.length])!==-1||E.match(i)?y:"."+t};function b(y,T,E,v){v===void 0&&(v="&");var w=y.replace(LY,""),A=T&&E?E+" "+T+" { "+w+" }":w;return t=v,n=T,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),p(E||!T?"":T,A)}return p.use([].concat(c,[function(y,T,E){y===2&&E.length&&E[0].lastIndexOf(n)>0&&(E[0]=E[0].replace(r,g))},m,function(y){if(y===-2){var T=f;return f=[],T}}])),b.hash=c.length?c.reduce(function(y,T){return T.name||Bp(15),A1(y,T.name)},5381).toString():"",b}var tL=st.createContext();tL.Consumer;var nL=st.createContext(),PY=(nL.Consumer,new JD),Kb=FY();function BY(){return C.useContext(tL)||PY}function UY(){return C.useContext(nL)||Kb}var rL=function(){function e(t,n){var r=this;this.inject=function(i,a){a===void 0&&(a=Kb);var o=r.name+a.hash;i.hasNameForId(r.id,o)||i.insertRules(r.id,o,a(r.rules,o,"@keyframes"))},this.toString=function(){return Bp(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=Kb),this.name+t.hash},e}(),$Y=/([A-Z])/,zY=/([A-Z])/g,HY=/^ms-/,jY=function(e){return"-"+e.toLowerCase()};function OC(e){return $Y.test(e)?e.replace(zY,jY).replace(HY,"-ms-"):e}var DC=function(e){return e==null||e===!1||e===""};function ic(e,t,n,r){if(Array.isArray(e)){for(var i,a=[],o=0,s=e.length;o1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,WY=/(^-|-$)/g;function C3(e){return e.replace(VY,"-").replace(WY,"")}var aL=function(e){return qb(eL(e)>>>0)};function A0(e){return typeof e=="string"&&!0}var Yb=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},qY=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function KY(e,t,n){var r=e[n];Yb(t)&&Yb(r)?oL(r,t):e[n]=t}function oL(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(P[B]=k[B]);return P}(t,["componentId"]),R=w&&w+"-"+(A0(v)?v:C3(IC(v)));return lL(v,is({},A,{attrs:m,componentId:R}),n)},Object.defineProperty(b,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(v){this._foldedDefaultProps=r?oL({},e.defaultProps,v):v}}),Object.defineProperty(b,"toString",{value:function(){return"."+b.styledComponentId}}),i&&mY(b,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),b}var Xb=function(e){return function t(n,r,i){if(i===void 0&&(i=ul),!p9.isValidElementType(r))return Bp(1,String(r));var a=function(){return n(r,i,iL.apply(void 0,arguments))};return a.withConfig=function(o){return t(n,r,is({},i,{},o))},a.attrs=function(o){return t(n,r,is({},i,{attrs:Array.prototype.concat(i.attrs,o).filter(Boolean)}))},a}(lL,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Xb[e]=Xb(e)});function Gm(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r"u"||zC[n]||n==="core"&&typeof process<"u"&&(!((i=process==null?void 0:process.env)===null||i===void 0)&&i.REACT_TOOLTIP_DISABLE_CORE_STYLES)||n!=="base"&&typeof process<"u"&&(!((a=process==null?void 0:process.env)===null||a===void 0)&&a.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;n==="core"&&(t=AX),r||(r={});const{insertAt:o}=r;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const s=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.id=t,u.type="text/css",o==="top"&&s.firstChild?s.insertBefore(u,s.firstChild):s.appendChild(u),u.styleSheet?u.styleSheet.cssText=e:u.appendChild(document.createTextNode(e)),zC[n]=!0}const jC=(e,t,n)=>{let r=null;return function(...i){const a=()=>{r=null,n||e.apply(this,i)};n&&!r&&(e.apply(this,i),r=setTimeout(a,t)),n||(r&&clearTimeout(r),r=setTimeout(a,t))}},kX="DEFAULT_TOOLTIP_ID",xX={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},IX=C.createContext({getTooltipData:()=>xX});function TL(e=kX){return C.useContext(IX).getTooltipData(e)}const RX=typeof window<"u"?C.useLayoutEffect:C.useEffect,NX=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some(n=>{const r=t.getPropertyValue(n);return r==="auto"||r==="scroll"})},GC=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(NX(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},VC=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:i=10,strategy:a="absolute",middlewares:o=[sX(Number(i)),aX(),lX({padding:5})],border:s})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(t===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const u=o;return n?(u.push(iX({element:n,padding:5})),$C(e,t,{placement:r,strategy:a,middleware:u}).then(({x:c,y:p,placement:f,middlewareData:m})=>{var g,b;const y={left:`${c}px`,top:`${p}px`,border:s},{x:T,y:E}=(g=m.arrow)!==null&&g!==void 0?g:{x:0,y:0},v=(b={top:"bottom",right:"left",bottom:"top",left:"right"}[f.split("-")[0]])!==null&&b!==void 0?b:"bottom",w=s&&{top:{borderBottom:s,borderRight:s},right:{borderBottom:s,borderLeft:s},bottom:{borderTop:s,borderLeft:s},left:{borderTop:s,borderRight:s}}[f.split("-")[0]];let A=0;if(s){const R=`${s}`.match(/(\d+)px/);A=R!=null&&R[1]?Number(R[1]):1}return{tooltipStyles:y,tooltipArrowStyles:{left:T!=null?`${T}px`:"",top:E!=null?`${E}px`:"",right:"",bottom:"",...w,[v]:`-${4+A}px`},place:f}})):$C(e,t,{placement:"bottom",strategy:a,middleware:u}).then(({x:c,y:p,placement:f})=>({tooltipStyles:{left:`${c}px`,top:`${p}px`},tooltipArrowStyles:{},place:f}))};var OX="core-styles-module_tooltip__3vRRp",DX="core-styles-module_fixed__pcSol",LX="core-styles-module_arrow__cvMwQ",MX="core-styles-module_noArrow__xock6",FX="core-styles-module_clickable__ZuTTB",PX="core-styles-module_show__Nt9eE",x3={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const BX=({id:e,className:t,classNameArrow:n,variant:r="dark",anchorId:i,anchorSelect:a,place:o="top",offset:s=10,events:u=["hover"],openOnClick:c=!1,positionStrategy:p="absolute",middlewares:f,wrapper:m,delayShow:g=0,delayHide:b=0,float:y=!1,hidden:T=!1,noArrow:E=!1,clickable:v=!1,closeOnEsc:w=!1,closeOnScroll:A=!1,closeOnResize:R=!1,style:k,position:N,afterShow:B,afterHide:q,content:P,contentWrapperRef:Q,isOpen:$,setIsOpen:oe,activeAnchor:fe,setActiveAnchor:ce,border:De,opacity:H})=>{const W=C.useRef(null),se=C.useRef(null),D=C.useRef(null),pe=C.useRef(null),[le,L]=C.useState(o),[ie,Se]=C.useState({}),[X,ke]=C.useState({}),[te,Me]=C.useState(!1),[Re,Ze]=C.useState(!1),We=C.useRef(!1),dt=C.useRef(null),{anchorRefs:ot,setActiveAnchor:je}=TL(e),pt=C.useRef(!1),[U,re]=C.useState([]),de=C.useRef(!1),xe=c||u.includes("click");RX(()=>(de.current=!0,()=>{de.current=!1}),[]),C.useEffect(()=>{if(!te){const ge=setTimeout(()=>{Ze(!1)},150);return()=>{clearTimeout(ge)}}return()=>null},[te]);const ye=ge=>{de.current&&(ge&&Ze(!0),setTimeout(()=>{de.current&&(oe==null||oe(ge),$===void 0&&Me(ge))},10))};C.useEffect(()=>{if($===void 0)return()=>null;$&&Ze(!0);const ge=setTimeout(()=>{Me($)},10);return()=>{clearTimeout(ge)}},[$]),C.useEffect(()=>{te!==We.current&&(We.current=te,te?B==null||B():q==null||q())},[te]);const Te=(ge=b)=>{pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>{pt.current||ye(!1)},ge)},Le=ge=>{var G;if(!ge)return;const K=(G=ge.currentTarget)!==null&&G!==void 0?G:ge.target;if(!(K!=null&&K.isConnected))return ce(null),void je({current:null});g?(D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{ye(!0)},g)):ye(!0),ce(K),je({current:K}),pe.current&&clearTimeout(pe.current)},ze=()=>{v?Te(b||100):b?Te():ye(!1),D.current&&clearTimeout(D.current)},Ye=({x:ge,y:G})=>{VC({place:o,offset:s,elementReference:{getBoundingClientRect:()=>({x:ge,y:G,width:0,height:0,top:G,left:ge,right:ge,bottom:G})},tooltipReference:W.current,tooltipArrowReference:se.current,strategy:p,middlewares:f,border:De}).then(K=>{Object.keys(K.tooltipStyles).length&&Se(K.tooltipStyles),Object.keys(K.tooltipArrowStyles).length&&ke(K.tooltipArrowStyles),L(K.place)})},jt=ge=>{if(!ge)return;const G=ge,K={x:G.clientX,y:G.clientY};Ye(K),dt.current=K},ue=ge=>{Le(ge),b&&Te()},Ee=ge=>{var G;[document.querySelector(`[id='${i}']`),...U].some(K=>K==null?void 0:K.contains(ge.target))||!((G=W.current)===null||G===void 0)&&G.contains(ge.target)||(ye(!1),D.current&&clearTimeout(D.current))},qe=jC(Le,50,!0),j=jC(ze,50,!0);C.useEffect(()=>{var ge,G;const K=new Set(ot);U.forEach(Qt=>{K.add({current:Qt})});const ne=document.querySelector(`[id='${i}']`);ne&&K.add({current:ne});const ve=()=>{ye(!1)},Qe=GC(fe),Fe=GC(W.current);A&&(window.addEventListener("scroll",ve),Qe==null||Qe.addEventListener("scroll",ve),Fe==null||Fe.addEventListener("scroll",ve)),R&&window.addEventListener("resize",ve);const at=Qt=>{Qt.key==="Escape"&&ye(!1)};w&&window.addEventListener("keydown",at);const rt=[];xe?(window.addEventListener("click",Ee),rt.push({event:"click",listener:ue})):(rt.push({event:"mouseenter",listener:qe},{event:"mouseleave",listener:j},{event:"focus",listener:qe},{event:"blur",listener:j}),y&&rt.push({event:"mousemove",listener:jt}));const Je=()=>{pt.current=!0},Rt=()=>{pt.current=!1,ze()};return v&&!xe&&((ge=W.current)===null||ge===void 0||ge.addEventListener("mouseenter",Je),(G=W.current)===null||G===void 0||G.addEventListener("mouseleave",Rt)),rt.forEach(({event:Qt,listener:kt})=>{K.forEach(rn=>{var Xt;(Xt=rn.current)===null||Xt===void 0||Xt.addEventListener(Qt,kt)})}),()=>{var Qt,kt;A&&(window.removeEventListener("scroll",ve),Qe==null||Qe.removeEventListener("scroll",ve),Fe==null||Fe.removeEventListener("scroll",ve)),R&&window.removeEventListener("resize",ve),xe&&window.removeEventListener("click",Ee),w&&window.removeEventListener("keydown",at),v&&!xe&&((Qt=W.current)===null||Qt===void 0||Qt.removeEventListener("mouseenter",Je),(kt=W.current)===null||kt===void 0||kt.removeEventListener("mouseleave",Rt)),rt.forEach(({event:rn,listener:Xt})=>{K.forEach(Wr=>{var qr;(qr=Wr.current)===null||qr===void 0||qr.removeEventListener(rn,Xt)})})}},[Re,ot,U,w,u]),C.useEffect(()=>{let ge=a??"";!ge&&e&&(ge=`[data-tooltip-id='${e}']`);const G=new MutationObserver(K=>{const ne=[];K.forEach(ve=>{if(ve.type==="attributes"&&ve.attributeName==="data-tooltip-id"&&ve.target.getAttribute("data-tooltip-id")===e&&ne.push(ve.target),ve.type==="childList"&&(fe&&[...ve.removedNodes].some(Qe=>{var Fe;return!!(!((Fe=Qe==null?void 0:Qe.contains)===null||Fe===void 0)&&Fe.call(Qe,fe))&&(Ze(!1),ye(!1),ce(null),D.current&&clearTimeout(D.current),pe.current&&clearTimeout(pe.current),!0)}),ge))try{const Qe=[...ve.addedNodes].filter(Fe=>Fe.nodeType===1);ne.push(...Qe.filter(Fe=>Fe.matches(ge))),ne.push(...Qe.flatMap(Fe=>[...Fe.querySelectorAll(ge)]))}catch{}}),ne.length&&re(ve=>[...ve,...ne])});return G.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{G.disconnect()}},[e,a,fe]);const me=()=>{N?Ye(N):y?dt.current&&Ye(dt.current):VC({place:o,offset:s,elementReference:fe,tooltipReference:W.current,tooltipArrowReference:se.current,strategy:p,middlewares:f,border:De}).then(ge=>{de.current&&(Object.keys(ge.tooltipStyles).length&&Se(ge.tooltipStyles),Object.keys(ge.tooltipArrowStyles).length&&ke(ge.tooltipArrowStyles),L(ge.place))})};C.useEffect(()=>{me()},[te,fe,P,k,o,s,p,N]),C.useEffect(()=>{if(!(Q!=null&&Q.current))return()=>null;const ge=new ResizeObserver(()=>{me()});return ge.observe(Q.current),()=>{ge.disconnect()}},[P,Q==null?void 0:Q.current]),C.useEffect(()=>{var ge;const G=document.querySelector(`[id='${i}']`),K=[...U,G];fe&&K.includes(fe)||ce((ge=U[0])!==null&&ge!==void 0?ge:G)},[i,U,fe]),C.useEffect(()=>()=>{D.current&&clearTimeout(D.current),pe.current&&clearTimeout(pe.current)},[]),C.useEffect(()=>{let ge=a;if(!ge&&e&&(ge=`[data-tooltip-id='${e}']`),ge)try{const G=Array.from(document.querySelectorAll(ge));re(G)}catch{re([])}},[e,a]);const Ve=!T&&P&&te&&Object.keys(ie).length>0;return Re?st.createElement(m,{id:e,role:"tooltip",className:MC("react-tooltip",OX,x3.tooltip,x3[r],t,`react-tooltip__place-${le}`,{[PX]:Ve,[DX]:p==="fixed",[FX]:v}),style:{...k,...ie,opacity:H!==void 0&&Ve?H:void 0},ref:W},P,st.createElement(m,{className:MC("react-tooltip-arrow",LX,x3.arrow,n,{[MX]:E}),style:X,ref:se})):null},UX=({content:e})=>st.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),$X=({id:e,anchorId:t,anchorSelect:n,content:r,html:i,render:a,className:o,classNameArrow:s,variant:u="dark",place:c="top",offset:p=10,wrapper:f="div",children:m=null,events:g=["hover"],openOnClick:b=!1,positionStrategy:y="absolute",middlewares:T,delayShow:E=0,delayHide:v=0,float:w=!1,hidden:A=!1,noArrow:R=!1,clickable:k=!1,closeOnEsc:N=!1,closeOnScroll:B=!1,closeOnResize:q=!1,style:P,position:Q,isOpen:$,disableStyleInjection:oe=!1,border:fe,opacity:ce,setIsOpen:De,afterShow:H,afterHide:W})=>{const[se,D]=C.useState(r),[pe,le]=C.useState(i),[L,ie]=C.useState(c),[Se,X]=C.useState(u),[ke,te]=C.useState(p),[Me,Re]=C.useState(E),[Ze,We]=C.useState(v),[dt,ot]=C.useState(w),[je,pt]=C.useState(A),[U,re]=C.useState(f),[de,xe]=C.useState(g),[ye,Te]=C.useState(y),[Le,ze]=C.useState(null),Ye=C.useRef(oe),{anchorRefs:jt,activeAnchor:ue}=TL(e),Ee=ge=>ge==null?void 0:ge.getAttributeNames().reduce((G,K)=>{var ne;return K.startsWith("data-tooltip-")&&(G[K.replace(/^data-tooltip-/,"")]=(ne=ge==null?void 0:ge.getAttribute(K))!==null&&ne!==void 0?ne:null),G},{}),qe=ge=>{const G={place:K=>{var ne;ie((ne=K)!==null&&ne!==void 0?ne:c)},content:K=>{D(K??r)},html:K=>{le(K??i)},variant:K=>{var ne;X((ne=K)!==null&&ne!==void 0?ne:u)},offset:K=>{te(K===null?p:Number(K))},wrapper:K=>{var ne;re((ne=K)!==null&&ne!==void 0?ne:f)},events:K=>{const ne=K==null?void 0:K.split(" ");xe(ne??g)},"position-strategy":K=>{var ne;Te((ne=K)!==null&&ne!==void 0?ne:y)},"delay-show":K=>{Re(K===null?E:Number(K))},"delay-hide":K=>{We(K===null?v:Number(K))},float:K=>{ot(K===null?w:K==="true")},hidden:K=>{pt(K===null?A:K==="true")}};Object.values(G).forEach(K=>K(null)),Object.entries(ge).forEach(([K,ne])=>{var ve;(ve=G[K])===null||ve===void 0||ve.call(G,ne)})};C.useEffect(()=>{D(r)},[r]),C.useEffect(()=>{le(i)},[i]),C.useEffect(()=>{ie(c)},[c]),C.useEffect(()=>{X(u)},[u]),C.useEffect(()=>{te(p)},[p]),C.useEffect(()=>{Re(E)},[E]),C.useEffect(()=>{We(v)},[v]),C.useEffect(()=>{ot(w)},[w]),C.useEffect(()=>{pt(A)},[A]),C.useEffect(()=>{Te(y)},[y]),C.useEffect(()=>{Ye.current!==oe&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")},[oe]),C.useEffect(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:oe==="core",disableBase:oe}}))},[]),C.useEffect(()=>{var ge;const G=new Set(jt);let K=n;if(!K&&e&&(K=`[data-tooltip-id='${e}']`),K)try{document.querySelectorAll(K).forEach(at=>{G.add({current:at})})}catch{console.warn(`[react-tooltip] "${K}" is not a valid CSS selector`)}const ne=document.querySelector(`[id='${t}']`);if(ne&&G.add({current:ne}),!G.size)return()=>null;const ve=(ge=Le??ne)!==null&&ge!==void 0?ge:ue.current,Qe=new MutationObserver(at=>{at.forEach(rt=>{var Je;if(!ve||rt.type!=="attributes"||!(!((Je=rt.attributeName)===null||Je===void 0)&&Je.startsWith("data-tooltip-")))return;const Rt=Ee(ve);qe(Rt)})}),Fe={attributes:!0,childList:!1,subtree:!1};if(ve){const at=Ee(ve);qe(at),Qe.observe(ve,Fe)}return()=>{Qe.disconnect()}},[jt,ue,Le,t,n]),C.useEffect(()=>{P!=null&&P.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),fe&&!CSS.supports("border",`${fe}`)&&console.warn(`[react-tooltip] "${fe}" is not a valid \`border\`.`),P!=null&&P.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),ce&&!CSS.supports("opacity",`${ce}`)&&console.warn(`[react-tooltip] "${ce}" is not a valid \`opacity\`.`)},[]);let j=m;const me=C.useRef(null);if(a){const ge=a({content:se??null,activeAnchor:Le});j=ge?st.createElement("div",{ref:me,className:"react-tooltip-content-wrapper"},ge):null}else se&&(j=se);pe&&(j=st.createElement(UX,{content:pe}));const Ve={id:e,anchorId:t,anchorSelect:n,className:o,classNameArrow:s,content:j,contentWrapperRef:me,place:L,variant:Se,offset:ke,wrapper:U,events:de,openOnClick:b,positionStrategy:ye,middlewares:T,delayShow:Me,delayHide:Ze,float:dt,hidden:je,noArrow:R,clickable:k,closeOnEsc:N,closeOnScroll:B,closeOnResize:q,style:P,position:Q,isOpen:$,border:fe,opacity:ce,setIsOpen:De,afterShow:H,afterHide:W,activeAnchor:Le,setActiveAnchor:ge=>ze(ge)};return st.createElement(BX,{...Ve})};typeof window<"u"&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||HC({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9}.core-styles-module_tooltip__3vRRp{visibility:hidden;position:absolute;top:0;left:0;pointer-events:none;opacity:0;transition:opacity 0.3s ease-out;will-change:opacity,visibility}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{visibility:visible;opacity:var(--rt-opacity)}",type:"core"}),e.detail.disableBase||HC({css:` +*/const AX="react-tooltip-core-styles",CX="react-tooltip-base-styles",zC={core:!1,base:!1};function HC({css:e,id:t=CX,type:n="base",ref:r}){var i,a;if(!e||typeof document>"u"||zC[n]||n==="core"&&typeof process<"u"&&(!((i=process==null?void 0:process.env)===null||i===void 0)&&i.REACT_TOOLTIP_DISABLE_CORE_STYLES)||n!=="base"&&typeof process<"u"&&(!((a=process==null?void 0:process.env)===null||a===void 0)&&a.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;n==="core"&&(t=AX),r||(r={});const{insertAt:o}=r;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const s=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.id=t,u.type="text/css",o==="top"&&s.firstChild?s.insertBefore(u,s.firstChild):s.appendChild(u),u.styleSheet?u.styleSheet.cssText=e:u.appendChild(document.createTextNode(e)),zC[n]=!0}const jC=(e,t,n)=>{let r=null;return function(...i){const a=()=>{r=null,n||e.apply(this,i)};n&&!r&&(e.apply(this,i),r=setTimeout(a,t)),n||(r&&clearTimeout(r),r=setTimeout(a,t))}},kX="DEFAULT_TOOLTIP_ID",xX={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},IX=C.createContext({getTooltipData:()=>xX});function TL(e=kX){return C.useContext(IX).getTooltipData(e)}const RX=typeof window<"u"?C.useLayoutEffect:C.useEffect,NX=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some(n=>{const r=t.getPropertyValue(n);return r==="auto"||r==="scroll"})},GC=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(NX(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},VC=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:i=10,strategy:a="absolute",middlewares:o=[sX(Number(i)),aX(),lX({padding:5})],border:s})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(t===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const u=o;return n?(u.push(iX({element:n,padding:5})),$C(e,t,{placement:r,strategy:a,middleware:u}).then(({x:c,y:p,placement:f,middlewareData:m})=>{var g,b;const y={left:`${c}px`,top:`${p}px`,border:s},{x:T,y:E}=(g=m.arrow)!==null&&g!==void 0?g:{x:0,y:0},v=(b={top:"bottom",right:"left",bottom:"top",left:"right"}[f.split("-")[0]])!==null&&b!==void 0?b:"bottom",w=s&&{top:{borderBottom:s,borderRight:s},right:{borderBottom:s,borderLeft:s},bottom:{borderTop:s,borderLeft:s},left:{borderTop:s,borderRight:s}}[f.split("-")[0]];let A=0;if(s){const R=`${s}`.match(/(\d+)px/);A=R!=null&&R[1]?Number(R[1]):1}return{tooltipStyles:y,tooltipArrowStyles:{left:T!=null?`${T}px`:"",top:E!=null?`${E}px`:"",right:"",bottom:"",...w,[v]:`-${4+A}px`},place:f}})):$C(e,t,{placement:"bottom",strategy:a,middleware:u}).then(({x:c,y:p,placement:f})=>({tooltipStyles:{left:`${c}px`,top:`${p}px`},tooltipArrowStyles:{},place:f}))};var OX="core-styles-module_tooltip__3vRRp",DX="core-styles-module_fixed__pcSol",LX="core-styles-module_arrow__cvMwQ",MX="core-styles-module_noArrow__xock6",FX="core-styles-module_clickable__ZuTTB",PX="core-styles-module_show__Nt9eE",x3={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const BX=({id:e,className:t,classNameArrow:n,variant:r="dark",anchorId:i,anchorSelect:a,place:o="top",offset:s=10,events:u=["hover"],openOnClick:c=!1,positionStrategy:p="absolute",middlewares:f,wrapper:m,delayShow:g=0,delayHide:b=0,float:y=!1,hidden:T=!1,noArrow:E=!1,clickable:v=!1,closeOnEsc:w=!1,closeOnScroll:A=!1,closeOnResize:R=!1,style:k,position:N,afterShow:B,afterHide:q,content:P,contentWrapperRef:Q,isOpen:$,setIsOpen:oe,activeAnchor:fe,setActiveAnchor:ce,border:De,opacity:H})=>{const W=C.useRef(null),se=C.useRef(null),D=C.useRef(null),pe=C.useRef(null),[le,L]=C.useState(o),[ie,Se]=C.useState({}),[X,ke]=C.useState({}),[te,Me]=C.useState(!1),[Re,Ye]=C.useState(!1),We=C.useRef(!1),dt=C.useRef(null),{anchorRefs:ot,setActiveAnchor:je}=TL(e),pt=C.useRef(!1),[U,re]=C.useState([]),de=C.useRef(!1),xe=c||u.includes("click");RX(()=>(de.current=!0,()=>{de.current=!1}),[]),C.useEffect(()=>{if(!te){const ge=setTimeout(()=>{Ye(!1)},150);return()=>{clearTimeout(ge)}}return()=>null},[te]);const ye=ge=>{de.current&&(ge&&Ye(!0),setTimeout(()=>{de.current&&(oe==null||oe(ge),$===void 0&&Me(ge))},10))};C.useEffect(()=>{if($===void 0)return()=>null;$&&Ye(!0);const ge=setTimeout(()=>{Me($)},10);return()=>{clearTimeout(ge)}},[$]),C.useEffect(()=>{te!==We.current&&(We.current=te,te?B==null||B():q==null||q())},[te]);const Te=(ge=b)=>{pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>{pt.current||ye(!1)},ge)},Le=ge=>{var G;if(!ge)return;const K=(G=ge.currentTarget)!==null&&G!==void 0?G:ge.target;if(!(K!=null&&K.isConnected))return ce(null),void je({current:null});g?(D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{ye(!0)},g)):ye(!0),ce(K),je({current:K}),pe.current&&clearTimeout(pe.current)},ze=()=>{v?Te(b||100):b?Te():ye(!1),D.current&&clearTimeout(D.current)},Xe=({x:ge,y:G})=>{VC({place:o,offset:s,elementReference:{getBoundingClientRect:()=>({x:ge,y:G,width:0,height:0,top:G,left:ge,right:ge,bottom:G})},tooltipReference:W.current,tooltipArrowReference:se.current,strategy:p,middlewares:f,border:De}).then(K=>{Object.keys(K.tooltipStyles).length&&Se(K.tooltipStyles),Object.keys(K.tooltipArrowStyles).length&&ke(K.tooltipArrowStyles),L(K.place)})},jt=ge=>{if(!ge)return;const G=ge,K={x:G.clientX,y:G.clientY};Xe(K),dt.current=K},ue=ge=>{Le(ge),b&&Te()},Ee=ge=>{var G;[document.querySelector(`[id='${i}']`),...U].some(K=>K==null?void 0:K.contains(ge.target))||!((G=W.current)===null||G===void 0)&&G.contains(ge.target)||(ye(!1),D.current&&clearTimeout(D.current))},qe=jC(Le,50,!0),j=jC(ze,50,!0);C.useEffect(()=>{var ge,G;const K=new Set(ot);U.forEach(Qt=>{K.add({current:Qt})});const ne=document.querySelector(`[id='${i}']`);ne&&K.add({current:ne});const ve=()=>{ye(!1)},Qe=GC(fe),Fe=GC(W.current);A&&(window.addEventListener("scroll",ve),Qe==null||Qe.addEventListener("scroll",ve),Fe==null||Fe.addEventListener("scroll",ve)),R&&window.addEventListener("resize",ve);const at=Qt=>{Qt.key==="Escape"&&ye(!1)};w&&window.addEventListener("keydown",at);const rt=[];xe?(window.addEventListener("click",Ee),rt.push({event:"click",listener:ue})):(rt.push({event:"mouseenter",listener:qe},{event:"mouseleave",listener:j},{event:"focus",listener:qe},{event:"blur",listener:j}),y&&rt.push({event:"mousemove",listener:jt}));const Je=()=>{pt.current=!0},Rt=()=>{pt.current=!1,ze()};return v&&!xe&&((ge=W.current)===null||ge===void 0||ge.addEventListener("mouseenter",Je),(G=W.current)===null||G===void 0||G.addEventListener("mouseleave",Rt)),rt.forEach(({event:Qt,listener:kt})=>{K.forEach(rn=>{var Xt;(Xt=rn.current)===null||Xt===void 0||Xt.addEventListener(Qt,kt)})}),()=>{var Qt,kt;A&&(window.removeEventListener("scroll",ve),Qe==null||Qe.removeEventListener("scroll",ve),Fe==null||Fe.removeEventListener("scroll",ve)),R&&window.removeEventListener("resize",ve),xe&&window.removeEventListener("click",Ee),w&&window.removeEventListener("keydown",at),v&&!xe&&((Qt=W.current)===null||Qt===void 0||Qt.removeEventListener("mouseenter",Je),(kt=W.current)===null||kt===void 0||kt.removeEventListener("mouseleave",Rt)),rt.forEach(({event:rn,listener:Xt})=>{K.forEach(Wr=>{var qr;(qr=Wr.current)===null||qr===void 0||qr.removeEventListener(rn,Xt)})})}},[Re,ot,U,w,u]),C.useEffect(()=>{let ge=a??"";!ge&&e&&(ge=`[data-tooltip-id='${e}']`);const G=new MutationObserver(K=>{const ne=[];K.forEach(ve=>{if(ve.type==="attributes"&&ve.attributeName==="data-tooltip-id"&&ve.target.getAttribute("data-tooltip-id")===e&&ne.push(ve.target),ve.type==="childList"&&(fe&&[...ve.removedNodes].some(Qe=>{var Fe;return!!(!((Fe=Qe==null?void 0:Qe.contains)===null||Fe===void 0)&&Fe.call(Qe,fe))&&(Ye(!1),ye(!1),ce(null),D.current&&clearTimeout(D.current),pe.current&&clearTimeout(pe.current),!0)}),ge))try{const Qe=[...ve.addedNodes].filter(Fe=>Fe.nodeType===1);ne.push(...Qe.filter(Fe=>Fe.matches(ge))),ne.push(...Qe.flatMap(Fe=>[...Fe.querySelectorAll(ge)]))}catch{}}),ne.length&&re(ve=>[...ve,...ne])});return G.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{G.disconnect()}},[e,a,fe]);const me=()=>{N?Xe(N):y?dt.current&&Xe(dt.current):VC({place:o,offset:s,elementReference:fe,tooltipReference:W.current,tooltipArrowReference:se.current,strategy:p,middlewares:f,border:De}).then(ge=>{de.current&&(Object.keys(ge.tooltipStyles).length&&Se(ge.tooltipStyles),Object.keys(ge.tooltipArrowStyles).length&&ke(ge.tooltipArrowStyles),L(ge.place))})};C.useEffect(()=>{me()},[te,fe,P,k,o,s,p,N]),C.useEffect(()=>{if(!(Q!=null&&Q.current))return()=>null;const ge=new ResizeObserver(()=>{me()});return ge.observe(Q.current),()=>{ge.disconnect()}},[P,Q==null?void 0:Q.current]),C.useEffect(()=>{var ge;const G=document.querySelector(`[id='${i}']`),K=[...U,G];fe&&K.includes(fe)||ce((ge=U[0])!==null&&ge!==void 0?ge:G)},[i,U,fe]),C.useEffect(()=>()=>{D.current&&clearTimeout(D.current),pe.current&&clearTimeout(pe.current)},[]),C.useEffect(()=>{let ge=a;if(!ge&&e&&(ge=`[data-tooltip-id='${e}']`),ge)try{const G=Array.from(document.querySelectorAll(ge));re(G)}catch{re([])}},[e,a]);const Ve=!T&&P&&te&&Object.keys(ie).length>0;return Re?st.createElement(m,{id:e,role:"tooltip",className:MC("react-tooltip",OX,x3.tooltip,x3[r],t,`react-tooltip__place-${le}`,{[PX]:Ve,[DX]:p==="fixed",[FX]:v}),style:{...k,...ie,opacity:H!==void 0&&Ve?H:void 0},ref:W},P,st.createElement(m,{className:MC("react-tooltip-arrow",LX,x3.arrow,n,{[MX]:E}),style:X,ref:se})):null},UX=({content:e})=>st.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),$X=({id:e,anchorId:t,anchorSelect:n,content:r,html:i,render:a,className:o,classNameArrow:s,variant:u="dark",place:c="top",offset:p=10,wrapper:f="div",children:m=null,events:g=["hover"],openOnClick:b=!1,positionStrategy:y="absolute",middlewares:T,delayShow:E=0,delayHide:v=0,float:w=!1,hidden:A=!1,noArrow:R=!1,clickable:k=!1,closeOnEsc:N=!1,closeOnScroll:B=!1,closeOnResize:q=!1,style:P,position:Q,isOpen:$,disableStyleInjection:oe=!1,border:fe,opacity:ce,setIsOpen:De,afterShow:H,afterHide:W})=>{const[se,D]=C.useState(r),[pe,le]=C.useState(i),[L,ie]=C.useState(c),[Se,X]=C.useState(u),[ke,te]=C.useState(p),[Me,Re]=C.useState(E),[Ye,We]=C.useState(v),[dt,ot]=C.useState(w),[je,pt]=C.useState(A),[U,re]=C.useState(f),[de,xe]=C.useState(g),[ye,Te]=C.useState(y),[Le,ze]=C.useState(null),Xe=C.useRef(oe),{anchorRefs:jt,activeAnchor:ue}=TL(e),Ee=ge=>ge==null?void 0:ge.getAttributeNames().reduce((G,K)=>{var ne;return K.startsWith("data-tooltip-")&&(G[K.replace(/^data-tooltip-/,"")]=(ne=ge==null?void 0:ge.getAttribute(K))!==null&&ne!==void 0?ne:null),G},{}),qe=ge=>{const G={place:K=>{var ne;ie((ne=K)!==null&&ne!==void 0?ne:c)},content:K=>{D(K??r)},html:K=>{le(K??i)},variant:K=>{var ne;X((ne=K)!==null&&ne!==void 0?ne:u)},offset:K=>{te(K===null?p:Number(K))},wrapper:K=>{var ne;re((ne=K)!==null&&ne!==void 0?ne:f)},events:K=>{const ne=K==null?void 0:K.split(" ");xe(ne??g)},"position-strategy":K=>{var ne;Te((ne=K)!==null&&ne!==void 0?ne:y)},"delay-show":K=>{Re(K===null?E:Number(K))},"delay-hide":K=>{We(K===null?v:Number(K))},float:K=>{ot(K===null?w:K==="true")},hidden:K=>{pt(K===null?A:K==="true")}};Object.values(G).forEach(K=>K(null)),Object.entries(ge).forEach(([K,ne])=>{var ve;(ve=G[K])===null||ve===void 0||ve.call(G,ne)})};C.useEffect(()=>{D(r)},[r]),C.useEffect(()=>{le(i)},[i]),C.useEffect(()=>{ie(c)},[c]),C.useEffect(()=>{X(u)},[u]),C.useEffect(()=>{te(p)},[p]),C.useEffect(()=>{Re(E)},[E]),C.useEffect(()=>{We(v)},[v]),C.useEffect(()=>{ot(w)},[w]),C.useEffect(()=>{pt(A)},[A]),C.useEffect(()=>{Te(y)},[y]),C.useEffect(()=>{Xe.current!==oe&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")},[oe]),C.useEffect(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:oe==="core",disableBase:oe}}))},[]),C.useEffect(()=>{var ge;const G=new Set(jt);let K=n;if(!K&&e&&(K=`[data-tooltip-id='${e}']`),K)try{document.querySelectorAll(K).forEach(at=>{G.add({current:at})})}catch{console.warn(`[react-tooltip] "${K}" is not a valid CSS selector`)}const ne=document.querySelector(`[id='${t}']`);if(ne&&G.add({current:ne}),!G.size)return()=>null;const ve=(ge=Le??ne)!==null&&ge!==void 0?ge:ue.current,Qe=new MutationObserver(at=>{at.forEach(rt=>{var Je;if(!ve||rt.type!=="attributes"||!(!((Je=rt.attributeName)===null||Je===void 0)&&Je.startsWith("data-tooltip-")))return;const Rt=Ee(ve);qe(Rt)})}),Fe={attributes:!0,childList:!1,subtree:!1};if(ve){const at=Ee(ve);qe(at),Qe.observe(ve,Fe)}return()=>{Qe.disconnect()}},[jt,ue,Le,t,n]),C.useEffect(()=>{P!=null&&P.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),fe&&!CSS.supports("border",`${fe}`)&&console.warn(`[react-tooltip] "${fe}" is not a valid \`border\`.`),P!=null&&P.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),ce&&!CSS.supports("opacity",`${ce}`)&&console.warn(`[react-tooltip] "${ce}" is not a valid \`opacity\`.`)},[]);let j=m;const me=C.useRef(null);if(a){const ge=a({content:se??null,activeAnchor:Le});j=ge?st.createElement("div",{ref:me,className:"react-tooltip-content-wrapper"},ge):null}else se&&(j=se);pe&&(j=st.createElement(UX,{content:pe}));const Ve={id:e,anchorId:t,anchorSelect:n,className:o,classNameArrow:s,content:j,contentWrapperRef:me,place:L,variant:Se,offset:ke,wrapper:U,events:de,openOnClick:b,positionStrategy:ye,middlewares:T,delayShow:Me,delayHide:Ye,float:dt,hidden:je,noArrow:R,clickable:k,closeOnEsc:N,closeOnScroll:B,closeOnResize:q,style:P,position:Q,isOpen:$,border:fe,opacity:ce,setIsOpen:De,afterShow:H,afterHide:W,activeAnchor:Le,setActiveAnchor:ge=>ze(ge)};return st.createElement(BX,{...Ve})};typeof window<"u"&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||HC({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9}.core-styles-module_tooltip__3vRRp{visibility:hidden;position:absolute;top:0;left:0;pointer-events:none;opacity:0;transition:opacity 0.3s ease-out;will-change:opacity,visibility}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{visibility:visible;opacity:var(--rt-opacity)}",type:"core"}),e.detail.disableBase||HC({css:` .styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px;transform:rotate(45deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})});function Km(){const e=window.navigator.platform.toUpperCase();return e.indexOf("MAC")>=0?"mac":e.indexOf("LINUX")>=0?"linux":e.indexOf("WIN")>=0?"windows":"unknown"}function xg(e){switch(Km()){case"mac":return e.metaKey;case"linux":case"windows":return e.ctrlKey;default:return e.metaKey}}function zX(){switch(Km()){case"mac":return"⌘";case"linux":case"windows":return"^";default:return"⌘"}}function pr(){const e=localStorage.getItem("fontSize");return e?parseInt(e):14}function WC(e){switch(e.split(".").pop()){case"py":return"python";case"js":return"javascript";case"ts":return"typescript";case"java":return"java";case"go":return"go";case"rb":return"ruby";case"rs":return"rust";case"c":return"c";case"cpp":return"cpp";case"cs":return"csharp";case"php":return"php";case"scala":return"scala";case"swift":return"swift";case"kt":return"kotlin";case"md":return"markdown";case"json":return"json";case"html":return"html";case"css":return"css";case"sh":return"shell";case"yaml":return"yaml";case"toml":return"toml";case"tex":return"latex";case"sql":return"sql";default:return""}}const It="5px",Et="#646464",ha="#1bbe84",Vt="var(--vscode-list-hoverBackground, rgb(45 45 45))",Ht="var(--vscode-editor-background, rgb(30 30 30))",Yt="var(--vscode-editor-foreground, #fff)";if(typeof document<"u"){const e=localStorage.getItem("--vscode-editor-foreground"),t=localStorage.getItem("--vscode-editor-background"),n=localStorage.getItem("--vscode-list-hoverBackground");e&&document.body.style.setProperty("--vscode-editor-foreground",e),t&&document.body.style.setProperty("--vscode-editor-background",t),n&&document.body.style.setProperty("--vscode-list-hoverBackground",n)}const oc=Ge.button` padding: 10px 12px; margin: 8px 0; @@ -240,9 +240,9 @@ Error generating stack: `+a.message+` * * @author Feross Aboukhadijeh * @license MIT - */var oQ=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)};const xL=Vi(oQ);function Bd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?YC(e.position):"start"in e||"end"in e?YC(e):"line"in e||"column"in e?Jb(e):""}function Jb(e){return XC(e&&e.line)+":"+XC(e&&e.column)}function YC(e){return Jb(e&&e.start)+"-"+Jb(e&&e.end)}function XC(e){return e&&typeof e=="number"?e:1}class Ta extends Error{constructor(t,n,r){const i=[null,null];let a={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const o=r.indexOf(":");o===-1?i[1]=r:(i[0]=r.slice(0,o),i[1]=r.slice(o+1))}n&&("type"in n||"position"in n?n.position&&(a=n.position):"start"in n||"end"in n?a=n:("line"in n||"column"in n)&&(a.start=n)),this.name=Bd(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack="",typeof t=="object"&&t.stack&&(this.stack=t.stack),this.reason=this.message,this.fatal,this.line=a.start.line,this.column=a.start.column,this.position=a,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}}Ta.prototype.file="";Ta.prototype.name="";Ta.prototype.reason="";Ta.prototype.message="";Ta.prototype.stack="";Ta.prototype.fatal=null;Ta.prototype.column=null;Ta.prototype.line=null;Ta.prototype.source=null;Ta.prototype.ruleId=null;Ta.prototype.position=null;const po={basename:sQ,dirname:lQ,extname:uQ,join:cQ,sep:"/"};function sQ(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hp(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,s=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.charCodeAt(i)===t.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function lQ(e){if(Hp(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function uQ(e){Hp(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const s=e.charCodeAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function cQ(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pQ(e,t){let n="",r=0,i=-1,a=0,o=-1,s,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Hp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fQ={cwd:hQ};function hQ(){return"/"}function ey(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function gQ(e){if(typeof e=="string")e=new URL(e);else if(!ey(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return mQ(e)}function mQ(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||kh.call(t,i)},rk=function(t,n){JC&&n.name==="__proto__"?JC(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ik=function(t,n){if(n==="__proto__")if(kh.call(t,n)){if(ek)return ek(t,n).value}else return;return t[n]},yQ=function e(){var t,n,r,i,a,o,s=arguments[0],u=1,c=arguments.length,p=!1;for(typeof s=="boolean"&&(p=s,s=arguments[1]||{},u=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});uo.length;let u;s&&o.push(i);try{u=e.apply(this,o)}catch(c){const p=c;if(s&&n)throw p;return i(p)}s||(u instanceof Promise?u.then(a,i):u instanceof Error?i(u):a(u))}function i(o,...s){n||(n=!0,t(o,...s))}function a(o){i(null,o)}}const _Q=OL().freeze(),NL={}.hasOwnProperty;function OL(){const e=EQ(),t=[];let n={},r,i=-1;return a.data=o,a.Parser=void 0,a.Compiler=void 0,a.freeze=s,a.attachers=t,a.use=u,a.parse=c,a.stringify=p,a.run=f,a.runSync=m,a.process=g,a.processSync=b,a;function a(){const y=OL();let T=-1;for(;++T{if(k||!N||!B)R(k);else{const q=a.stringify(N,B);q==null||(wQ(q)?B.value=q:B.result=q),R(k,B)}});function R(k,N){k||!N?w(k):v?v(N):T(null,N)}}}function b(y){let T;a.freeze(),D3("processSync",a.Parser),L3("processSync",a.Compiler);const E=ed(y);return a.process(E,v),sk("processSync","process",T),E;function v(w){T=!0,QC(w)}}}function ak(e,t){return typeof e=="function"&&e.prototype&&(TQ(e.prototype)||t in e.prototype)}function TQ(e){let t;for(t in e)if(NL.call(e,t))return!0;return!1}function D3(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function L3(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function M3(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ok(e){if(!ty(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function sk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ed(e){return SQ(e)?e:new IL(e)}function SQ(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wQ(e){return typeof e=="string"||xL(e)}const AQ={};function CQ(e,t){const n=t||AQ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return DL(e,r,i)}function DL(e,t,n){if(kQ(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 lk(e.children,t,n)}return Array.isArray(e)?lk(e,t,n):""}function lk(e,t,n){const r=[];let i=-1;for(;++ii?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(Bi(e,e.length,0,t),e):t}const uk={}.hasOwnProperty;function LL(e){const t={};let n=-1;for(;++no))return;const N=t.events.length;let B=N,q,P;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(q){P=t.events[B][1].end;break}q=!0}for(E(r),k=N;kw;){const R=n[A];t.containerState=R[1],R[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function BQ(e,t,n){return Gt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ng(e){if(e===null||gn(e)||_u(e))return 1;if(Ym(e))return 2}function Xm(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),m=Object.assign({},e[n][1].start);dk(f,-u),dk(m,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},s={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:m},a={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},s.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ca(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ca(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),c=ca(c,Xm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ca(c,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,c=ca(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Bi(e,r-1,n-r+3,c),n=r+c.length-p-2;break}}for(n=-1;++n0&&Dt(k)?Gt(e,v,"linePrefix",a+1)(k):v(k)}function v(k){return k===null||gt(k)?e.check(fk,y,A)(k):(e.enter("codeFlowValue"),w(k))}function w(k){return k===null||gt(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),w)}function A(k){return e.exit("codeFenced"),t(k)}function R(k,N,B){let q=0;return P;function P(ce){return k.enter("lineEnding"),k.consume(ce),k.exit("lineEnding"),Q}function Q(ce){return k.enter("codeFencedFence"),Dt(ce)?Gt(k,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ce):$(ce)}function $(ce){return ce===s?(k.enter("codeFencedFenceSequence"),oe(ce)):B(ce)}function oe(ce){return ce===s?(q++,k.consume(ce),oe):q>=o?(k.exit("codeFencedFenceSequence"),Dt(ce)?Gt(k,fe,"whitespace")(ce):fe(ce)):B(ce)}function fe(ce){return ce===null||gt(ce)?(k.exit("codeFencedFence"),N(ce)):B(ce)}}}function XQ(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const F3={name:"codeIndented",tokenize:QQ},ZQ={tokenize:JQ,partial:!0};function QQ(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Gt(e,a,"linePrefix",4+1)(c)}function a(c){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):gt(c)?e.attempt(ZQ,o,u)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||gt(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),s)}function u(c){return e.exit("codeIndented"),t(c)}}function JQ(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):gt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Gt(e,a,"linePrefix",4+1)(o)}function a(o){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):gt(o)?i(o):n(o)}}const eJ={name:"codeText",tokenize:rJ,resolve:tJ,previous:nJ};function tJ(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=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function UL(e,t,n,r,i,a,o,s,u){const c=u||Number.POSITIVE_INFINITY;let p=0;return f;function f(E){return E===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(E),e.exit(a),m):E===null||E===32||E===41||Rg(E)?n(E):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(E))}function m(E){return E===62?(e.enter(a),e.consume(E),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===62?(e.exit("chunkString"),e.exit(s),m(E)):E===null||E===60||gt(E)?n(E):(e.consume(E),E===92?b:g)}function b(E){return E===60||E===62||E===92?(e.consume(E),g):g(E)}function y(E){return!p&&(E===null||E===41||gn(E))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(E)):p999||g===null||g===91||g===93&&!u||g===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(g):g===93?(e.exit(a),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):gt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===null||g===91||g===93||gt(g)||s++>999?(e.exit("chunkString"),p(g)):(e.consume(g),u||(u=!Dt(g)),g===92?m:f)}function m(g){return g===91||g===92||g===93?(e.consume(g),s++,f):f(g)}}function zL(e,t,n,r,i,a){let o;return s;function s(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),o=m===40?41:m,u):n(m)}function u(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(a),c(m))}function c(m){return m===o?(e.exit(a),u(o)):m===null?n(m):gt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Gt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===o||m===null||gt(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?f:p)}function f(m){return m===o||m===92?(e.consume(m),p):p(m)}}function Ud(e,t){let n;return r;function r(i){return gt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Dt(i)?Gt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function Wa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const cJ={name:"definition",tokenize:pJ},dJ={tokenize:fJ,partial:!0};function pJ(e,t,n){const r=this;let i;return a;function a(g){return e.enter("definition"),o(g)}function o(g){return $L.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function s(g){return i=Wa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),u):n(g)}function u(g){return gn(g)?Ud(e,c)(g):c(g)}function c(g){return UL(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(dJ,f,f)(g)}function f(g){return Dt(g)?Gt(e,m,"whitespace")(g):m(g)}function m(g){return g===null||gt(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function fJ(e,t,n){return r;function r(s){return gn(s)?Ud(e,i)(s):n(s)}function i(s){return zL(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return Dt(s)?Gt(e,o,"whitespace")(s):o(s)}function o(s){return s===null||gt(s)?t(s):n(s)}}const hJ={name:"hardBreakEscape",tokenize:gJ};function gJ(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return gt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const mJ={name:"headingAtx",tokenize:yJ,resolve:bJ};function bJ(e,t){let n=e.length-2,r=3,i,a;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},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Bi(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function yJ(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||gn(p)?(e.exit("atxHeadingSequence"),s(p)):n(p)}function s(p){return p===35?(e.enter("atxHeadingSequence"),u(p)):p===null||gt(p)?(e.exit("atxHeading"),t(p)):Dt(p)?Gt(e,s,"whitespace")(p):(e.enter("atxHeadingText"),c(p))}function u(p){return p===35?(e.consume(p),u):(e.exit("atxHeadingSequence"),s(p))}function c(p){return p===null||p===35||gn(p)?(e.exit("atxHeadingText"),s(p)):(e.consume(p),c)}}const EJ=["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"],gk=["pre","script","style","textarea"],vJ={name:"htmlFlow",tokenize:wJ,resolveTo:SJ,concrete:!0},_J={tokenize:CJ,partial:!0},TJ={tokenize:AJ,partial:!0};function SJ(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 wJ(e,t,n){const r=this;let i,a,o,s,u;return c;function c(L){return p(L)}function p(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),f}function f(L){return L===33?(e.consume(L),m):L===47?(e.consume(L),a=!0,y):L===63?(e.consume(L),i=3,r.interrupt?t:D):ti(L)?(e.consume(L),o=String.fromCharCode(L),T):n(L)}function m(L){return L===45?(e.consume(L),i=2,g):L===91?(e.consume(L),i=5,s=0,b):ti(L)?(e.consume(L),i=4,r.interrupt?t:D):n(L)}function g(L){return L===45?(e.consume(L),r.interrupt?t:D):n(L)}function b(L){const ie="CDATA[";return L===ie.charCodeAt(s++)?(e.consume(L),s===ie.length?r.interrupt?t:$:b):n(L)}function y(L){return ti(L)?(e.consume(L),o=String.fromCharCode(L),T):n(L)}function T(L){if(L===null||L===47||L===62||gn(L)){const ie=L===47,Se=o.toLowerCase();return!ie&&!a&&gk.includes(Se)?(i=1,r.interrupt?t(L):$(L)):EJ.includes(o.toLowerCase())?(i=6,ie?(e.consume(L),E):r.interrupt?t(L):$(L)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):a?v(L):w(L))}return L===45||jr(L)?(e.consume(L),o+=String.fromCharCode(L),T):n(L)}function E(L){return L===62?(e.consume(L),r.interrupt?t:$):n(L)}function v(L){return Dt(L)?(e.consume(L),v):P(L)}function w(L){return L===47?(e.consume(L),P):L===58||L===95||ti(L)?(e.consume(L),A):Dt(L)?(e.consume(L),w):P(L)}function A(L){return L===45||L===46||L===58||L===95||jr(L)?(e.consume(L),A):R(L)}function R(L){return L===61?(e.consume(L),k):Dt(L)?(e.consume(L),R):w(L)}function k(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),u=L,N):Dt(L)?(e.consume(L),k):B(L)}function N(L){return L===u?(e.consume(L),u=null,q):L===null||gt(L)?n(L):(e.consume(L),N)}function B(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||gn(L)?R(L):(e.consume(L),B)}function q(L){return L===47||L===62||Dt(L)?w(L):n(L)}function P(L){return L===62?(e.consume(L),Q):n(L)}function Q(L){return L===null||gt(L)?$(L):Dt(L)?(e.consume(L),Q):n(L)}function $(L){return L===45&&i===2?(e.consume(L),De):L===60&&i===1?(e.consume(L),H):L===62&&i===4?(e.consume(L),pe):L===63&&i===3?(e.consume(L),D):L===93&&i===5?(e.consume(L),se):gt(L)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(_J,le,oe)(L)):L===null||gt(L)?(e.exit("htmlFlowData"),oe(L)):(e.consume(L),$)}function oe(L){return e.check(TJ,fe,le)(L)}function fe(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),ce}function ce(L){return L===null||gt(L)?oe(L):(e.enter("htmlFlowData"),$(L))}function De(L){return L===45?(e.consume(L),D):$(L)}function H(L){return L===47?(e.consume(L),o="",W):$(L)}function W(L){if(L===62){const ie=o.toLowerCase();return gk.includes(ie)?(e.consume(L),pe):$(L)}return ti(L)&&o.length<8?(e.consume(L),o+=String.fromCharCode(L),W):$(L)}function se(L){return L===93?(e.consume(L),D):$(L)}function D(L){return L===62?(e.consume(L),pe):L===45&&i===2?(e.consume(L),D):$(L)}function pe(L){return L===null||gt(L)?(e.exit("htmlFlowData"),le(L)):(e.consume(L),pe)}function le(L){return e.exit("htmlFlow"),t(L)}}function AJ(e,t,n){const r=this;return i;function i(o){return gt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function CJ(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(jp,t,n)}}const kJ={name:"htmlText",tokenize:xJ};function xJ(e,t,n){const r=this;let i,a,o;return s;function s(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),u}function u(D){return D===33?(e.consume(D),c):D===47?(e.consume(D),R):D===63?(e.consume(D),w):ti(D)?(e.consume(D),B):n(D)}function c(D){return D===45?(e.consume(D),p):D===91?(e.consume(D),a=0,b):ti(D)?(e.consume(D),v):n(D)}function p(D){return D===45?(e.consume(D),g):n(D)}function f(D){return D===null?n(D):D===45?(e.consume(D),m):gt(D)?(o=f,H(D)):(e.consume(D),f)}function m(D){return D===45?(e.consume(D),g):f(D)}function g(D){return D===62?De(D):D===45?m(D):f(D)}function b(D){const pe="CDATA[";return D===pe.charCodeAt(a++)?(e.consume(D),a===pe.length?y:b):n(D)}function y(D){return D===null?n(D):D===93?(e.consume(D),T):gt(D)?(o=y,H(D)):(e.consume(D),y)}function T(D){return D===93?(e.consume(D),E):y(D)}function E(D){return D===62?De(D):D===93?(e.consume(D),E):y(D)}function v(D){return D===null||D===62?De(D):gt(D)?(o=v,H(D)):(e.consume(D),v)}function w(D){return D===null?n(D):D===63?(e.consume(D),A):gt(D)?(o=w,H(D)):(e.consume(D),w)}function A(D){return D===62?De(D):w(D)}function R(D){return ti(D)?(e.consume(D),k):n(D)}function k(D){return D===45||jr(D)?(e.consume(D),k):N(D)}function N(D){return gt(D)?(o=N,H(D)):Dt(D)?(e.consume(D),N):De(D)}function B(D){return D===45||jr(D)?(e.consume(D),B):D===47||D===62||gn(D)?q(D):n(D)}function q(D){return D===47?(e.consume(D),De):D===58||D===95||ti(D)?(e.consume(D),P):gt(D)?(o=q,H(D)):Dt(D)?(e.consume(D),q):De(D)}function P(D){return D===45||D===46||D===58||D===95||jr(D)?(e.consume(D),P):Q(D)}function Q(D){return D===61?(e.consume(D),$):gt(D)?(o=Q,H(D)):Dt(D)?(e.consume(D),Q):q(D)}function $(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,oe):gt(D)?(o=$,H(D)):Dt(D)?(e.consume(D),$):(e.consume(D),fe)}function oe(D){return D===i?(e.consume(D),i=void 0,ce):D===null?n(D):gt(D)?(o=oe,H(D)):(e.consume(D),oe)}function fe(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||gn(D)?q(D):(e.consume(D),fe)}function ce(D){return D===47||D===62||gn(D)?q(D):n(D)}function De(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function H(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),W}function W(D){return Dt(D)?Gt(e,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):se(D)}function se(D){return e.enter("htmlTextData"),o(D)}}const A9={name:"labelEnd",tokenize:LJ,resolveTo:DJ,resolveAll:OJ},IJ={tokenize:MJ},RJ={tokenize:FJ},NJ={tokenize:PJ};function OJ(e){let t=-1;for(;++t=3&&(c===null||gt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),Dt(c)?Gt(e,s,"whitespace")(c):s(c))}}const pi={name:"list",tokenize:WJ,continuation:{tokenize:qJ},exit:YJ},GJ={tokenize:XJ,partial:!0},VJ={tokenize:KJ,partial:!0};function WJ(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(g){const b=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:ny(g)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(xh,n,c)(g):c(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(g)}return n(g)}function u(g){return ny(g)&&++o<10?(e.consume(g),u):(!r.interrupt||o<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),c(g)):n(g)}function c(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(jp,r.interrupt?n:p,e.attempt(GJ,m,f))}function p(g){return r.containerState.initialBlankLine=!0,a++,m(g)}function f(g){return Dt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),m):n(g)}function m(g){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function qJ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(jp,i,a);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Gt(e,t,"listItemIndent",r.containerState.size+1)(s)}function a(s){return r.containerState.furtherBlankLines||!Dt(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(VJ,t,o)(s))}function o(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Gt(e,e.attempt(pi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function KJ(e,t,n){const r=this;return Gt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function YJ(e){e.exit(this.containerState.type)}function XJ(e,t,n){const r=this;return Gt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(a){const o=r.events[r.events.length-1];return!Dt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const mk={name:"setextUnderline",tokenize:QJ,resolveTo:ZJ};function ZJ(e,t){let n=e.length,r,i,a;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),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[a][1].end)):e[r][1]=o,e.push(["exit",o,t]),e}function QJ(e,t,n){const r=this;let i;return a;function a(c){let p=r.events.length,f;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){f=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Dt(c)?Gt(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||gt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const JJ={tokenize:eee};function eee(e){const t=this,n=e.attempt(jp,r,e.attempt(this.parser.constructs.flowInitial,i,Gt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(aJ,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tee={resolveAll:jL()},nee=HL("string"),ree=HL("text");function HL(e){return{tokenize:t,resolveAll:jL(e==="text"?iee:void 0)};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,s);return o;function o(p){return c(p)?a(p):s(p)}function s(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),u}function u(p){return c(p)?(n.exit("data"),a(p)):(n.consume(p),u)}function c(p){if(p===null)return!0;const f=i[p];let m=-1;if(f)for(;++m-1){const s=o[0];typeof s=="string"?o[0]=s.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function see(e,t){let n=-1;const r=[];let i;for(;++ne.length){for(;i--;)if(e.charCodeAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,s=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.charCodeAt(i)===t.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function lQ(e){if(Hp(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function uQ(e){Hp(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const s=e.charCodeAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function cQ(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pQ(e,t){let n="",r=0,i=-1,a=0,o=-1,s,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Hp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fQ={cwd:hQ};function hQ(){return"/"}function ey(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function gQ(e){if(typeof e=="string")e=new URL(e);else if(!ey(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return mQ(e)}function mQ(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||kh.call(t,i)},rk=function(t,n){JC&&n.name==="__proto__"?JC(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ik=function(t,n){if(n==="__proto__")if(kh.call(t,n)){if(ek)return ek(t,n).value}else return;return t[n]},yQ=function e(){var t,n,r,i,a,o,s=arguments[0],u=1,c=arguments.length,p=!1;for(typeof s=="boolean"&&(p=s,s=arguments[1]||{},u=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});uo.length;let u;s&&o.push(i);try{u=e.apply(this,o)}catch(c){const p=c;if(s&&n)throw p;return i(p)}s||(u instanceof Promise?u.then(a,i):u instanceof Error?i(u):a(u))}function i(o,...s){n||(n=!0,t(o,...s))}function a(o){i(null,o)}}const _Q=OL().freeze(),NL={}.hasOwnProperty;function OL(){const e=EQ(),t=[];let n={},r,i=-1;return a.data=o,a.Parser=void 0,a.Compiler=void 0,a.freeze=s,a.attachers=t,a.use=u,a.parse=c,a.stringify=p,a.run=f,a.runSync=m,a.process=g,a.processSync=b,a;function a(){const y=OL();let T=-1;for(;++T{if(k||!N||!B)R(k);else{const q=a.stringify(N,B);q==null||(wQ(q)?B.value=q:B.result=q),R(k,B)}});function R(k,N){k||!N?w(k):v?v(N):T(null,N)}}}function b(y){let T;a.freeze(),D3("processSync",a.Parser),L3("processSync",a.Compiler);const E=ed(y);return a.process(E,v),sk("processSync","process",T),E;function v(w){T=!0,QC(w)}}}function ak(e,t){return typeof e=="function"&&e.prototype&&(TQ(e.prototype)||t in e.prototype)}function TQ(e){let t;for(t in e)if(NL.call(e,t))return!0;return!1}function D3(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function L3(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function M3(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ok(e){if(!ty(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function sk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ed(e){return SQ(e)?e:new IL(e)}function SQ(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wQ(e){return typeof e=="string"||xL(e)}const AQ={};function CQ(e,t){const n=t||AQ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return DL(e,r,i)}function DL(e,t,n){if(kQ(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 lk(e.children,t,n)}return Array.isArray(e)?lk(e,t,n):""}function lk(e,t,n){const r=[];let i=-1;for(;++ii?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(Bi(e,e.length,0,t),e):t}const uk={}.hasOwnProperty;function LL(e){const t={};let n=-1;for(;++no))return;const N=t.events.length;let B=N,q,P;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(q){P=t.events[B][1].end;break}q=!0}for(E(r),k=N;kw;){const R=n[A];t.containerState=R[1],R[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function BQ(e,t,n){return Gt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ng(e){if(e===null||gn(e)||_u(e))return 1;if(Ym(e))return 2}function Xm(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),m=Object.assign({},e[n][1].start);dk(f,-u),dk(m,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},s={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:m},a={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},s.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ca(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ca(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),c=ca(c,Xm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ca(c,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,c=ca(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Bi(e,r-1,n-r+3,c),n=r+c.length-p-2;break}}for(n=-1;++n0&&Dt(k)?Gt(e,v,"linePrefix",a+1)(k):v(k)}function v(k){return k===null||gt(k)?e.check(fk,y,A)(k):(e.enter("codeFlowValue"),w(k))}function w(k){return k===null||gt(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),w)}function A(k){return e.exit("codeFenced"),t(k)}function R(k,N,B){let q=0;return P;function P(ce){return k.enter("lineEnding"),k.consume(ce),k.exit("lineEnding"),Q}function Q(ce){return k.enter("codeFencedFence"),Dt(ce)?Gt(k,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ce):$(ce)}function $(ce){return ce===s?(k.enter("codeFencedFenceSequence"),oe(ce)):B(ce)}function oe(ce){return ce===s?(q++,k.consume(ce),oe):q>=o?(k.exit("codeFencedFenceSequence"),Dt(ce)?Gt(k,fe,"whitespace")(ce):fe(ce)):B(ce)}function fe(ce){return ce===null||gt(ce)?(k.exit("codeFencedFence"),N(ce)):B(ce)}}}function XQ(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const F3={name:"codeIndented",tokenize:QQ},ZQ={tokenize:JQ,partial:!0};function QQ(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Gt(e,a,"linePrefix",4+1)(c)}function a(c){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):gt(c)?e.attempt(ZQ,o,u)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||gt(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),s)}function u(c){return e.exit("codeIndented"),t(c)}}function JQ(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):gt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Gt(e,a,"linePrefix",4+1)(o)}function a(o){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):gt(o)?i(o):n(o)}}const eJ={name:"codeText",tokenize:rJ,resolve:tJ,previous:nJ};function tJ(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=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function UL(e,t,n,r,i,a,o,s,u){const c=u||Number.POSITIVE_INFINITY;let p=0;return f;function f(E){return E===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(E),e.exit(a),m):E===null||E===32||E===41||Rg(E)?n(E):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(E))}function m(E){return E===62?(e.enter(a),e.consume(E),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===62?(e.exit("chunkString"),e.exit(s),m(E)):E===null||E===60||gt(E)?n(E):(e.consume(E),E===92?b:g)}function b(E){return E===60||E===62||E===92?(e.consume(E),g):g(E)}function y(E){return!p&&(E===null||E===41||gn(E))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(E)):p999||g===null||g===91||g===93&&!u||g===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(g):g===93?(e.exit(a),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):gt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===null||g===91||g===93||gt(g)||s++>999?(e.exit("chunkString"),p(g)):(e.consume(g),u||(u=!Dt(g)),g===92?m:f)}function m(g){return g===91||g===92||g===93?(e.consume(g),s++,f):f(g)}}function zL(e,t,n,r,i,a){let o;return s;function s(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),o=m===40?41:m,u):n(m)}function u(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(a),c(m))}function c(m){return m===o?(e.exit(a),u(o)):m===null?n(m):gt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Gt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===o||m===null||gt(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?f:p)}function f(m){return m===o||m===92?(e.consume(m),p):p(m)}}function Ud(e,t){let n;return r;function r(i){return gt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Dt(i)?Gt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function Wa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const cJ={name:"definition",tokenize:pJ},dJ={tokenize:fJ,partial:!0};function pJ(e,t,n){const r=this;let i;return a;function a(g){return e.enter("definition"),o(g)}function o(g){return $L.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function s(g){return i=Wa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),u):n(g)}function u(g){return gn(g)?Ud(e,c)(g):c(g)}function c(g){return UL(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(dJ,f,f)(g)}function f(g){return Dt(g)?Gt(e,m,"whitespace")(g):m(g)}function m(g){return g===null||gt(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function fJ(e,t,n){return r;function r(s){return gn(s)?Ud(e,i)(s):n(s)}function i(s){return zL(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return Dt(s)?Gt(e,o,"whitespace")(s):o(s)}function o(s){return s===null||gt(s)?t(s):n(s)}}const hJ={name:"hardBreakEscape",tokenize:gJ};function gJ(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return gt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const mJ={name:"headingAtx",tokenize:yJ,resolve:bJ};function bJ(e,t){let n=e.length-2,r=3,i,a;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},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Bi(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function yJ(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||gn(p)?(e.exit("atxHeadingSequence"),s(p)):n(p)}function s(p){return p===35?(e.enter("atxHeadingSequence"),u(p)):p===null||gt(p)?(e.exit("atxHeading"),t(p)):Dt(p)?Gt(e,s,"whitespace")(p):(e.enter("atxHeadingText"),c(p))}function u(p){return p===35?(e.consume(p),u):(e.exit("atxHeadingSequence"),s(p))}function c(p){return p===null||p===35||gn(p)?(e.exit("atxHeadingText"),s(p)):(e.consume(p),c)}}const EJ=["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"],gk=["pre","script","style","textarea"],vJ={name:"htmlFlow",tokenize:wJ,resolveTo:SJ,concrete:!0},_J={tokenize:CJ,partial:!0},TJ={tokenize:AJ,partial:!0};function SJ(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 wJ(e,t,n){const r=this;let i,a,o,s,u;return c;function c(L){return p(L)}function p(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),f}function f(L){return L===33?(e.consume(L),m):L===47?(e.consume(L),a=!0,y):L===63?(e.consume(L),i=3,r.interrupt?t:D):ti(L)?(e.consume(L),o=String.fromCharCode(L),T):n(L)}function m(L){return L===45?(e.consume(L),i=2,g):L===91?(e.consume(L),i=5,s=0,b):ti(L)?(e.consume(L),i=4,r.interrupt?t:D):n(L)}function g(L){return L===45?(e.consume(L),r.interrupt?t:D):n(L)}function b(L){const ie="CDATA[";return L===ie.charCodeAt(s++)?(e.consume(L),s===ie.length?r.interrupt?t:$:b):n(L)}function y(L){return ti(L)?(e.consume(L),o=String.fromCharCode(L),T):n(L)}function T(L){if(L===null||L===47||L===62||gn(L)){const ie=L===47,Se=o.toLowerCase();return!ie&&!a&&gk.includes(Se)?(i=1,r.interrupt?t(L):$(L)):EJ.includes(o.toLowerCase())?(i=6,ie?(e.consume(L),E):r.interrupt?t(L):$(L)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):a?v(L):w(L))}return L===45||jr(L)?(e.consume(L),o+=String.fromCharCode(L),T):n(L)}function E(L){return L===62?(e.consume(L),r.interrupt?t:$):n(L)}function v(L){return Dt(L)?(e.consume(L),v):P(L)}function w(L){return L===47?(e.consume(L),P):L===58||L===95||ti(L)?(e.consume(L),A):Dt(L)?(e.consume(L),w):P(L)}function A(L){return L===45||L===46||L===58||L===95||jr(L)?(e.consume(L),A):R(L)}function R(L){return L===61?(e.consume(L),k):Dt(L)?(e.consume(L),R):w(L)}function k(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),u=L,N):Dt(L)?(e.consume(L),k):B(L)}function N(L){return L===u?(e.consume(L),u=null,q):L===null||gt(L)?n(L):(e.consume(L),N)}function B(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||gn(L)?R(L):(e.consume(L),B)}function q(L){return L===47||L===62||Dt(L)?w(L):n(L)}function P(L){return L===62?(e.consume(L),Q):n(L)}function Q(L){return L===null||gt(L)?$(L):Dt(L)?(e.consume(L),Q):n(L)}function $(L){return L===45&&i===2?(e.consume(L),De):L===60&&i===1?(e.consume(L),H):L===62&&i===4?(e.consume(L),pe):L===63&&i===3?(e.consume(L),D):L===93&&i===5?(e.consume(L),se):gt(L)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(_J,le,oe)(L)):L===null||gt(L)?(e.exit("htmlFlowData"),oe(L)):(e.consume(L),$)}function oe(L){return e.check(TJ,fe,le)(L)}function fe(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),ce}function ce(L){return L===null||gt(L)?oe(L):(e.enter("htmlFlowData"),$(L))}function De(L){return L===45?(e.consume(L),D):$(L)}function H(L){return L===47?(e.consume(L),o="",W):$(L)}function W(L){if(L===62){const ie=o.toLowerCase();return gk.includes(ie)?(e.consume(L),pe):$(L)}return ti(L)&&o.length<8?(e.consume(L),o+=String.fromCharCode(L),W):$(L)}function se(L){return L===93?(e.consume(L),D):$(L)}function D(L){return L===62?(e.consume(L),pe):L===45&&i===2?(e.consume(L),D):$(L)}function pe(L){return L===null||gt(L)?(e.exit("htmlFlowData"),le(L)):(e.consume(L),pe)}function le(L){return e.exit("htmlFlow"),t(L)}}function AJ(e,t,n){const r=this;return i;function i(o){return gt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function CJ(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(jp,t,n)}}const kJ={name:"htmlText",tokenize:xJ};function xJ(e,t,n){const r=this;let i,a,o;return s;function s(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),u}function u(D){return D===33?(e.consume(D),c):D===47?(e.consume(D),R):D===63?(e.consume(D),w):ti(D)?(e.consume(D),B):n(D)}function c(D){return D===45?(e.consume(D),p):D===91?(e.consume(D),a=0,b):ti(D)?(e.consume(D),v):n(D)}function p(D){return D===45?(e.consume(D),g):n(D)}function f(D){return D===null?n(D):D===45?(e.consume(D),m):gt(D)?(o=f,H(D)):(e.consume(D),f)}function m(D){return D===45?(e.consume(D),g):f(D)}function g(D){return D===62?De(D):D===45?m(D):f(D)}function b(D){const pe="CDATA[";return D===pe.charCodeAt(a++)?(e.consume(D),a===pe.length?y:b):n(D)}function y(D){return D===null?n(D):D===93?(e.consume(D),T):gt(D)?(o=y,H(D)):(e.consume(D),y)}function T(D){return D===93?(e.consume(D),E):y(D)}function E(D){return D===62?De(D):D===93?(e.consume(D),E):y(D)}function v(D){return D===null||D===62?De(D):gt(D)?(o=v,H(D)):(e.consume(D),v)}function w(D){return D===null?n(D):D===63?(e.consume(D),A):gt(D)?(o=w,H(D)):(e.consume(D),w)}function A(D){return D===62?De(D):w(D)}function R(D){return ti(D)?(e.consume(D),k):n(D)}function k(D){return D===45||jr(D)?(e.consume(D),k):N(D)}function N(D){return gt(D)?(o=N,H(D)):Dt(D)?(e.consume(D),N):De(D)}function B(D){return D===45||jr(D)?(e.consume(D),B):D===47||D===62||gn(D)?q(D):n(D)}function q(D){return D===47?(e.consume(D),De):D===58||D===95||ti(D)?(e.consume(D),P):gt(D)?(o=q,H(D)):Dt(D)?(e.consume(D),q):De(D)}function P(D){return D===45||D===46||D===58||D===95||jr(D)?(e.consume(D),P):Q(D)}function Q(D){return D===61?(e.consume(D),$):gt(D)?(o=Q,H(D)):Dt(D)?(e.consume(D),Q):q(D)}function $(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,oe):gt(D)?(o=$,H(D)):Dt(D)?(e.consume(D),$):(e.consume(D),fe)}function oe(D){return D===i?(e.consume(D),i=void 0,ce):D===null?n(D):gt(D)?(o=oe,H(D)):(e.consume(D),oe)}function fe(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||gn(D)?q(D):(e.consume(D),fe)}function ce(D){return D===47||D===62||gn(D)?q(D):n(D)}function De(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function H(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),W}function W(D){return Dt(D)?Gt(e,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):se(D)}function se(D){return e.enter("htmlTextData"),o(D)}}const A9={name:"labelEnd",tokenize:LJ,resolveTo:DJ,resolveAll:OJ},IJ={tokenize:MJ},RJ={tokenize:FJ},NJ={tokenize:PJ};function OJ(e){let t=-1;for(;++t=3&&(c===null||gt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),Dt(c)?Gt(e,s,"whitespace")(c):s(c))}}const pi={name:"list",tokenize:WJ,continuation:{tokenize:qJ},exit:YJ},GJ={tokenize:XJ,partial:!0},VJ={tokenize:KJ,partial:!0};function WJ(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(g){const b=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:ny(g)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(xh,n,c)(g):c(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(g)}return n(g)}function u(g){return ny(g)&&++o<10?(e.consume(g),u):(!r.interrupt||o<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),c(g)):n(g)}function c(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(jp,r.interrupt?n:p,e.attempt(GJ,m,f))}function p(g){return r.containerState.initialBlankLine=!0,a++,m(g)}function f(g){return Dt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),m):n(g)}function m(g){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function qJ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(jp,i,a);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Gt(e,t,"listItemIndent",r.containerState.size+1)(s)}function a(s){return r.containerState.furtherBlankLines||!Dt(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(VJ,t,o)(s))}function o(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Gt(e,e.attempt(pi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function KJ(e,t,n){const r=this;return Gt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function YJ(e){e.exit(this.containerState.type)}function XJ(e,t,n){const r=this;return Gt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(a){const o=r.events[r.events.length-1];return!Dt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const mk={name:"setextUnderline",tokenize:QJ,resolveTo:ZJ};function ZJ(e,t){let n=e.length,r,i,a;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),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[a][1].end)):e[r][1]=o,e.push(["exit",o,t]),e}function QJ(e,t,n){const r=this;let i;return a;function a(c){let p=r.events.length,f;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){f=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Dt(c)?Gt(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||gt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const JJ={tokenize:eee};function eee(e){const t=this,n=e.attempt(jp,r,e.attempt(this.parser.constructs.flowInitial,i,Gt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(aJ,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tee={resolveAll:jL()},nee=HL("string"),ree=HL("text");function HL(e){return{tokenize:t,resolveAll:jL(e==="text"?iee:void 0)};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,s);return o;function o(p){return c(p)?a(p):s(p)}function s(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),u}function u(p){return c(p)?(n.exit("data"),a(p)):(n.consume(p),u)}function c(p){if(p===null)return!0;const f=i[p];let m=-1;if(f)for(;++m-1){const s=o[0];typeof s=="string"?o[0]=s.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function see(e,t){let n=-1;const r=[];let i;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const _ee=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function VL(e){return e.replace(_ee,Tee)}function Tee(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return GL(n.slice(a?2:1),a?16:10)}return Tp(n)||e}const WL={}.hasOwnProperty,See=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),wee(n)(vee(yee(n).document().write(Eee()(e,t,!0))))};function wee(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(xe),autolinkProtocol:Q,autolinkEmail:Q,atxHeading:s(pt),blockQuote:s(Ze),characterEscape:Q,characterReference:Q,codeFenced:s(We),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(We,u),codeText:s(dt,u),codeTextData:Q,data:Q,codeFlowValue:Q,definition:s(ot),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(je),hardBreakEscape:s(U),hardBreakTrailing:s(U),htmlFlow:s(re,u),htmlFlowData:Q,htmlText:s(re,u),htmlTextData:Q,image:s(de),label:u,link:s(xe),listItem:s(Te),listItemValue:b,listOrdered:s(ye,g),listUnordered:s(ye),paragraph:s(Le),reference:Se,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(pt),strong:s(ze),thematicBreak:s(jt)},exit:{atxHeading:p(),atxHeadingSequence:N,autolink:p(),autolinkEmail:Re,autolinkProtocol:Me,blockQuote:p(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:te,codeFenced:p(v),codeFencedFence:E,codeFencedFenceInfo:y,codeFencedFenceMeta:T,codeFlowValue:$,codeIndented:p(w),codeText:p(H),codeTextData:$,data:$,definition:p(),definitionDestinationString:k,definitionLabelString:A,definitionTitleString:R,emphasis:p(),hardBreakEscape:p(fe),hardBreakTrailing:p(fe),htmlFlow:p(ce),htmlFlowData:$,htmlText:p(De),htmlTextData:$,image:p(se),label:pe,labelText:D,lineEnding:oe,link:p(W),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:X,resourceDestinationString:le,resourceTitleString:L,resource:ie,setextHeading:p(P),setextHeadingLineSequence:q,setextHeadingText:B,strong:p(),thematicBreak:p()}};qL(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ue){let Ee={type:"root",children:[]};const qe={stack:[Ee],tokenStack:[],config:t,enter:c,exit:f,buffer:u,resume:m,setData:a,getData:o},j=[];let me=-1;for(;++me0){const Ve=qe.tokenStack[qe.tokenStack.length-1];(Ve[1]||yk).call(qe,void 0,Ve[0])}for(Ee.position={start:Ds(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Ds(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me{const r=this.data("settings");return See(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function kee(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 xee(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` +`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}const lee={42:pi,43:pi,45:pi,48:pi,49:pi,50:pi,51:pi,52:pi,53:pi,54:pi,55:pi,56:pi,57:pi,62:ML},uee={91:cJ},cee={[-2]:F3,[-1]:F3,32:F3},dee={35:mJ,42:xh,45:[mk,xh],60:vJ,61:mk,95:xh,96:hk,126:hk},pee={38:PL,92:FL},fee={[-5]:P3,[-4]:P3,[-3]:P3,33:BJ,38:PL,42:ry,60:[zQ,kJ],91:$J,92:[hJ,FL],93:A9,95:ry,96:eJ},hee={null:[ry,tee]},gee={null:[42,95]},mee={null:[]},bee=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:gee,contentInitial:uee,disable:mee,document:lee,flow:dee,flowInitial:cee,insideSpan:hee,string:pee,text:fee},Symbol.toStringTag,{value:"Module"}));function yee(e){const n=LL([bee,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(LQ),document:i(FQ),flow:i(JJ),string:i(nee),text:i(ree)};return r;function i(a){return o;function o(s){return aee(r,a,s)}}}const bk=/[\0\t\n\r]/g;function Eee(){let e=1,t="",n=!0,r;return i;function i(a,o,s){const u=[];let c,p,f,m,g;for(a=t+a.toString(o),f=0,t="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const _ee=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function VL(e){return e.replace(_ee,Tee)}function Tee(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return GL(n.slice(a?2:1),a?16:10)}return Tp(n)||e}const WL={}.hasOwnProperty,See=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),wee(n)(vee(yee(n).document().write(Eee()(e,t,!0))))};function wee(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(xe),autolinkProtocol:Q,autolinkEmail:Q,atxHeading:s(pt),blockQuote:s(Ye),characterEscape:Q,characterReference:Q,codeFenced:s(We),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(We,u),codeText:s(dt,u),codeTextData:Q,data:Q,codeFlowValue:Q,definition:s(ot),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(je),hardBreakEscape:s(U),hardBreakTrailing:s(U),htmlFlow:s(re,u),htmlFlowData:Q,htmlText:s(re,u),htmlTextData:Q,image:s(de),label:u,link:s(xe),listItem:s(Te),listItemValue:b,listOrdered:s(ye,g),listUnordered:s(ye),paragraph:s(Le),reference:Se,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(pt),strong:s(ze),thematicBreak:s(jt)},exit:{atxHeading:p(),atxHeadingSequence:N,autolink:p(),autolinkEmail:Re,autolinkProtocol:Me,blockQuote:p(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:te,codeFenced:p(v),codeFencedFence:E,codeFencedFenceInfo:y,codeFencedFenceMeta:T,codeFlowValue:$,codeIndented:p(w),codeText:p(H),codeTextData:$,data:$,definition:p(),definitionDestinationString:k,definitionLabelString:A,definitionTitleString:R,emphasis:p(),hardBreakEscape:p(fe),hardBreakTrailing:p(fe),htmlFlow:p(ce),htmlFlowData:$,htmlText:p(De),htmlTextData:$,image:p(se),label:pe,labelText:D,lineEnding:oe,link:p(W),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:X,resourceDestinationString:le,resourceTitleString:L,resource:ie,setextHeading:p(P),setextHeadingLineSequence:q,setextHeadingText:B,strong:p(),thematicBreak:p()}};qL(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ue){let Ee={type:"root",children:[]};const qe={stack:[Ee],tokenStack:[],config:t,enter:c,exit:f,buffer:u,resume:m,setData:a,getData:o},j=[];let me=-1;for(;++me0){const Ve=qe.tokenStack[qe.tokenStack.length-1];(Ve[1]||yk).call(qe,void 0,Ve[0])}for(Ee.position={start:Ds(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Ds(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me{const r=this.data("settings");return See(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function kee(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 xee(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` `}]}function Iee(e,t){const n=t.value?t.value+` `:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,i={};r&&(i.className=["language-"+r]);let a={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Ree(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nee(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bc(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const s=e.charCodeAt(n+1);a<56320&&s>56319&&s<57344?(o=String.fromCharCode(a,s),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function KL(e,t){const n=String(t.identifier).toUpperCase(),r=bc(n.toLowerCase()),i=e.footnoteOrder.indexOf(n);let a;i===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,a=e.footnoteOrder.length):(e.footnoteCounts[n]++,a=i+1);const o=e.footnoteCounts[n],s={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,s);const u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,u),e.applyData(t,u)}function Oee(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:t.children}],position:t.position},KL(e,{type:"footnoteReference",identifier:i,position:t.position})}function Dee(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lee(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function YL(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return{type:"text",value:"!["+t.alt+r};const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Mee(e,t){const n=e.definition(t.identifier);if(!n)return YL(e,t);const r={src:bc(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function Fee(e,t){const n={src:bc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Pee(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Bee(e,t){const n=e.definition(t.identifier);if(!n)return YL(e,t);const r={href:bc(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Uee(e,t){const n={href:bc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function $ee(e,t,n){const r=e.all(t),i=n?zee(n):XL(t),a={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let f;p&&p.type==="element"&&p.tagName==="p"?f=p:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++stypeof e=="object"&&e!=null&&e.nodeType===1,bI=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",u4=(e,t)=>{if(e.clientHeight{let i=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeightat||a>e&&o=t&&s>=n?a-e-r:o>t&&sn?o-t+i:0,Xue=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)};var Zue=(e,t)=>{var n,r,i,a,o,s;if(typeof document>"u")return[];let{scrollMode:u,block:c,inline:p,boundary:f,skipOverflowHiddenElements:m}=t,g=typeof f=="function"?f:fe=>fe!==f;if(!mI(e))throw new TypeError("Invalid target");let b=document.scrollingElement||document.documentElement,y=[],T=e;for(;mI(T)&&g(T);){if(T=Xue(T),T===b){y.push(T);break}T!=null&&T===document.body&&u4(T)&&!u4(document.documentElement)||T!=null&&u4(T,m)&&y.push(T)}let E=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,v=(a=(i=window.visualViewport)==null?void 0:i.height)!=null?a:innerHeight,w=(o=window.scrollX)!=null?o:pageXOffset,A=(s=window.scrollY)!=null?s:pageYOffset,{height:R,width:k,top:N,right:B,bottom:q,left:P}=e.getBoundingClientRect(),Q=c==="start"||c==="nearest"?N:c==="end"?q:N+R/2,$=p==="center"?P+k/2:p==="end"?B:P,oe=[];for(let fe=0;fe=0&&P>=0&&q<=v&&B<=E&&N>=W&&q<=D&&P>=pe&&B<=se)return oe;let le=getComputedStyle(ce),L=parseInt(le.borderLeftWidth,10),ie=parseInt(le.borderTopWidth,10),Se=parseInt(le.borderRightWidth,10),X=parseInt(le.borderBottomWidth,10),ke=0,te=0,Me="offsetWidth"in ce?ce.offsetWidth-ce.clientWidth-L-Se:0,Re="offsetHeight"in ce?ce.offsetHeight-ce.clientHeight-ie-X:0,Ze="offsetWidth"in ce?ce.offsetWidth===0?0:H/ce.offsetWidth:0,We="offsetHeight"in ce?ce.offsetHeight===0?0:De/ce.offsetHeight:0;if(b===ce)ke=c==="start"?Q:c==="end"?Q-v:c==="nearest"?V0(A,A+v,v,ie,X,A+Q,A+Q+R,R):Q-v/2,te=p==="start"?$:p==="center"?$-E/2:p==="end"?$-E:V0(w,w+E,E,L,Se,w+$,w+$+k,k),ke=Math.max(0,ke+A),te=Math.max(0,te+w);else{ke=c==="start"?Q-W-ie:c==="end"?Q-D+X+Re:c==="nearest"?V0(W,D,De,ie,X+Re,Q,Q+R,R):Q-(W+De/2)+Re/2,te=p==="start"?$-pe-L:p==="center"?$-(pe+H/2)+Me/2:p==="end"?$-se+Se+Me:V0(pe,se,H,L,Se+Me,$,$+k,k);let{scrollLeft:dt,scrollTop:ot}=ce;ke=Math.max(0,Math.min(ot+ke/We,ce.scrollHeight-De/We+Re)),te=Math.max(0,Math.min(dt+te/Ze,ce.scrollWidth-H/Ze+Me)),Q+=ot-ke,$+=dt-te}oe.push({el:ce,top:ke,left:te})}return oe},$g=function(){return $g=Object.assign||function(t){for(var n,r=1,i=arguments.length;r1?i-1:0),o=1;o=37&&n<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function q0(e,t,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var a=n-1;(typeof t!="number"||t<0||t>=n)&&(t=e>0?-1:a+1);var o=t+e;o<0?o=i?a:0:o>a&&(o=i?0:a);var s=Ap(e,o,n,r,i);return s===-1?t>=n?-1:t:s}function Ap(e,t,n,r,i){var a=r(t);if(!a||!a.hasAttribute("disabled"))return t;if(e>0){for(var o=t+1;o=0;s--)if(!r(s).hasAttribute("disabled"))return s;return i?e>0?Ap(1,0,n,r,!1):Ap(-1,n-1,n,r,!1):-1}function EI(e,t,n,r){return r===void 0&&(r=!0),t.some(function(i){return i&&(yI(i,e,n)||r&&yI(i,n.document.activeElement,n))})}var r1e=LF(function(e){FF(e).textContent=""},500);function i1e(e,t){var n=FF(t);e&&(n.textContent=e,r1e(t))}function FF(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var a1e=["isInitialMount","highlightedIndex","items","environment"],PF={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function o1e(e,t,n){var r=e.props,i=e.type,a={};Object.keys(t).forEach(function(o){s1e(o,e,t,n),n[o]!==t[o]&&(a[o]=n[o])}),r.onStateChange&&Object.keys(a).length&&r.onStateChange(nn({type:i},a))}function s1e(e,t,n,r){var i=t.props,a=t.type,o="on"+P7(e)+"Change";i[o]&&r[e]!==void 0&&r[e]!==n[e]&&i[o](nn({type:a},r))}function l1e(e,t){return t.changes}function u1e(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""}var c1e=LF(function(e,t){i1e(e(),t)},200),d1e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.useLayoutEffect:C.useEffect;function p1e(e){var t=e.id,n=t===void 0?"downshift-"+e1e():t,r=e.labelId,i=e.menuId,a=e.getItemId,o=e.toggleButtonId,s=e.inputId,u=C.useRef({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:a||function(c){return n+"-item-"+c},toggleButtonId:o||n+"-toggle-button",inputId:s||n+"-input"});return u.current}function f1e(e,t,n,r){var i,a;if(e===void 0){if(t===void 0)throw new Error(r);i=n[t],a=t}else a=t===void 0?n.indexOf(e):t,i=e;return[i,a]}function h1e(e){return e?String(e):""}function P7(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function BF(e){var t=C.useRef(e);return t.current=e,t}function g1e(e,t,n){var r=C.useRef(),i=C.useRef(),a=C.useCallback(function(m,g){i.current=g,m=my(m,g.props);var b=e(m,g),y=g.props.stateReducer(m,nn({},g,{changes:b}));return y},[e]),o=C.useReducer(a,t),s=o[0],u=o[1],c=BF(n),p=C.useCallback(function(m){return u(nn({props:c.current},m))},[c]),f=i.current;return C.useEffect(function(){f&&r.current&&r.current!==s&&o1e(f,my(r.current,f.props),s),r.current=s},[s,n,f]),[s,p]}var Kd={itemToString:h1e,stateReducer:l1e,getA11ySelectionMessage:u1e,scrollIntoView:Jue,environment:typeof window>"u"?{}:window};function bo(e,t,n){n===void 0&&(n=PF);var r=e["default"+P7(t)];return r!==void 0?r:n[t]}function K0(e,t,n){n===void 0&&(n=PF);var r=e[t];if(r!==void 0)return r;var i=e["initial"+P7(t)];return i!==void 0?i:bo(e,t,n)}function m1e(e){var t=K0(e,"selectedItem"),n=K0(e,"isOpen"),r=K0(e,"highlightedIndex"),i=K0(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}function Yd(e,t,n){var r=e.items,i=e.initialHighlightedIndex,a=e.defaultHighlightedIndex,o=t.selectedItem,s=t.highlightedIndex;return r.length===0?-1:i!==void 0&&s===i?i:a!==void 0?a:o?r.indexOf(o):n===0?-1:n<0?r.length-1:0}function b1e(e,t,n,r){var i=C.useRef({isMouseDown:!1,isTouchMove:!1});return C.useEffect(function(){if((n==null?void 0:n.addEventListener)!=null){var a=function(){i.current.isMouseDown=!0},o=function(f){i.current.isMouseDown=!1,e&&!EI(f.target,t.map(function(m){return m.current}),n)&&r()},s=function(){i.current.isTouchMove=!1},u=function(){i.current.isTouchMove=!0},c=function(f){e&&!i.current.isTouchMove&&!EI(f.target,t.map(function(m){return m.current}),n,!1)&&r()};return n.addEventListener("mousedown",a),n.addEventListener("mouseup",o),n.addEventListener("touchstart",s),n.addEventListener("touchmove",u),n.addEventListener("touchend",c),function(){n.removeEventListener("mousedown",a),n.removeEventListener("mouseup",o),n.removeEventListener("touchstart",s),n.removeEventListener("touchmove",u),n.removeEventListener("touchend",c)}}},[e,n]),i}var y1e=function(){return DF};function vI(e,t,n){var r=n.isInitialMount,i=n.highlightedIndex,a=n.items,o=n.environment,s=C1(n,a1e);C.useEffect(function(){r||c1e(function(){return e(nn({highlightedIndex:i,highlightedItem:a[i],resultCount:a.length},s))},o.document)},t)}function E1e(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=C.useRef(!0);return d1e(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var v1e=DF;function _I(e,t,n){var r;n===void 0&&(n=!0);var i=((r=e.items)==null?void 0:r.length)&&t>=0;return nn({isOpen:!1,highlightedIndex:-1},i&&nn({selectedItem:e.items[t],isOpen:bo(e,"isOpen"),highlightedIndex:bo(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function _1e(e,t,n){var r=t.type,i=t.props,a;switch(r){case n.ItemMouseMove:a={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:a={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Yd(i,e,0)};break;case n.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:Yd(i,e,0)};break;case n.FunctionCloseMenu:a={isOpen:!1};break;case n.FunctionSetHighlightedIndex:a={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:a={inputValue:t.inputValue};break;case n.FunctionReset:a={highlightedIndex:bo(i,"highlightedIndex"),isOpen:bo(i,"isOpen"),selectedItem:bo(i,"selectedItem"),inputValue:bo(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return nn({},e,a)}be.array.isRequired,be.func,be.func,be.func,be.number,be.number,be.number,be.bool,be.bool,be.bool,be.any,be.any,be.any,be.string,be.string,be.string,be.func,be.string,be.func,be.func,be.func,be.func,be.func,be.shape({addEventListener:be.func,removeEventListener:be.func,document:be.shape({getElementById:be.func,activeElement:be.any,body:be.any})});function T1e(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(n===1?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}$g($g({},Kd),{getA11yStatusMessage:T1e});var B7=0,U7=1,$7=2,z7=3,H7=4,j7=5,G7=6,V7=7,W7=8,zg=9,q7=10,UF=11,$F=12,K7=13,zF=14,HF=15,jF=16,GF=17,VF=18,Y7=19,WF=20,qF=21,X7=22,KF=Object.freeze({__proto__:null,InputKeyDownArrowDown:B7,InputKeyDownArrowUp:U7,InputKeyDownEscape:$7,InputKeyDownHome:z7,InputKeyDownEnd:H7,InputKeyDownPageUp:j7,InputKeyDownPageDown:G7,InputKeyDownEnter:V7,InputChange:W7,InputBlur:zg,InputFocus:q7,MenuMouseLeave:UF,ItemMouseMove:$F,ItemClick:K7,ToggleButtonClick:zF,FunctionToggleMenu:HF,FunctionOpenMenu:jF,FunctionCloseMenu:GF,FunctionSetHighlightedIndex:VF,FunctionSelectItem:Y7,FunctionSetInputValue:WF,FunctionReset:qF,ControlledPropUpdatedSelectedItem:X7});function S1e(e){var t=m1e(e),n=t.selectedItem,r=t.inputValue;return r===""&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),nn({},t,{inputValue:r})}be.array.isRequired,be.func,be.func,be.func,be.func,be.number,be.number,be.number,be.bool,be.bool,be.bool,be.any,be.any,be.any,be.string,be.string,be.string,be.string,be.string,be.string,be.func,be.string,be.string,be.func,be.func,be.func,be.func,be.func,be.func,be.shape({addEventListener:be.func,removeEventListener:be.func,document:be.shape({getElementById:be.func,activeElement:be.any,body:be.any})});function w1e(e,t,n){var r=C.useRef(),i=g1e(e,t,n),a=i[0],o=i[1];return C.useEffect(function(){MF(n,"selectedItem")&&(n.selectedItemChanged(r.current,n.selectedItem)&&o({type:X7,inputValue:n.itemToString(n.selectedItem)}),r.current=a.selectedItem===r.current?n.selectedItem:a.selectedItem)},[a.selectedItem,n.selectedItem]),[my(a,n),o]}var A1e=nn({},Kd,{selectedItemChanged:function(t,n){return t!==n},getA11yStatusMessage:t1e});function C1e(e,t){var n,r=t.type,i=t.props,a=t.altKey,o;switch(r){case K7:o={isOpen:bo(i,"isOpen"),highlightedIndex:bo(i,"highlightedIndex"),selectedItem:i.items[t.index],inputValue:i.itemToString(i.items[t.index])};break;case B7:e.isOpen?o={highlightedIndex:q0(1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:o={highlightedIndex:a&&e.selectedItem==null?-1:Yd(i,e,1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case U7:e.isOpen?a?o=_I(i,e.highlightedIndex):o={highlightedIndex:q0(-1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:o={highlightedIndex:Yd(i,e,-1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case V7:o=_I(i,e.highlightedIndex);break;case $7:o=nn({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case j7:o={highlightedIndex:q0(-10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case G7:o={highlightedIndex:q0(10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case z7:o={highlightedIndex:Ap(1,0,i.items.length,t.getItemNodeFromIndex,!1)};break;case H7:o={highlightedIndex:Ap(-1,i.items.length-1,i.items.length,t.getItemNodeFromIndex,!1)};break;case zg:o=nn({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((n=i.items)==null?void 0:n.length)&&t.selectItem&&{selectedItem:i.items[e.highlightedIndex],inputValue:i.itemToString(i.items[e.highlightedIndex])});break;case W7:o={isOpen:!0,highlightedIndex:bo(i,"highlightedIndex"),inputValue:t.inputValue};break;case q7:o={isOpen:!0,highlightedIndex:Yd(i,e,0)};break;case Y7:o={selectedItem:t.selectedItem,inputValue:i.itemToString(t.selectedItem)};break;case X7:o={inputValue:t.inputValue};break;default:return _1e(e,t,KF)}return nn({},e,o)}var k1e=["onMouseLeave","refKey","ref"],x1e=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],I1e=["onClick","onPress","refKey","ref"],R1e=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];YF.stateChangeTypes=KF;function YF(e){e===void 0&&(e={});var t=nn({},A1e,e),n=t.initialIsOpen,r=t.defaultIsOpen,i=t.items,a=t.scrollIntoView,o=t.environment,s=t.getA11yStatusMessage,u=t.getA11ySelectionMessage,c=t.itemToString,p=S1e(t),f=w1e(C1e,p,t),m=f[0],g=f[1],b=m.isOpen,y=m.highlightedIndex,T=m.selectedItem,E=m.inputValue,v=C.useRef(null),w=C.useRef({}),A=C.useRef(null),R=C.useRef(null),k=C.useRef(!0),N=p1e(t),B=C.useRef(),q=BF({state:m,props:t}),P=C.useCallback(function(ke){return w.current[N.getItemId(ke)]},[N]);vI(s,[b,y,E,i],nn({isInitialMount:k.current,previousResultCount:B.current,items:i,environment:o,itemToString:c},m)),vI(u,[T],nn({isInitialMount:k.current,previousResultCount:B.current,items:i,environment:o,itemToString:c},m));var Q=E1e({menuElement:v.current,highlightedIndex:y,isOpen:b,itemRefs:w,scrollIntoView:a,getItemNodeFromIndex:P});v1e({isInitialMount:k.current,props:t,state:m}),C.useEffect(function(){var ke=n||r||b;ke&&A.current&&A.current.focus()},[]),C.useEffect(function(){k.current||(B.current=i.length)});var $=b1e(b,[A,v,R],o,function(){g({type:zg,selectItem:!1})}),oe=y1e();C.useEffect(function(){return k.current=!1,function(){k.current=!0}},[]),C.useEffect(function(){var ke;if(!b)w.current={};else if(((ke=o.document)==null?void 0:ke.activeElement)!==A.current){var te;A==null||(te=A.current)==null||te.focus()}},[b,o]);var fe=C.useMemo(function(){return{ArrowDown:function(te){te.preventDefault(),g({type:B7,altKey:te.altKey,getItemNodeFromIndex:P})},ArrowUp:function(te){te.preventDefault(),g({type:U7,altKey:te.altKey,getItemNodeFromIndex:P})},Home:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:z7,getItemNodeFromIndex:P}))},End:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:H7,getItemNodeFromIndex:P}))},Escape:function(te){var Me=q.current.state;(Me.isOpen||Me.inputValue||Me.selectedItem||Me.highlightedIndex>-1)&&(te.preventDefault(),g({type:$7}))},Enter:function(te){var Me=q.current.state;!Me.isOpen||te.which===229||(te.preventDefault(),g({type:V7,getItemNodeFromIndex:P}))},PageUp:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:j7,getItemNodeFromIndex:P}))},PageDown:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:G7,getItemNodeFromIndex:P}))}}},[g,q,P]),ce=C.useCallback(function(ke){return nn({id:N.labelId,htmlFor:N.inputId},ke)},[N]),De=C.useCallback(function(ke,te){var Me,Re=ke===void 0?{}:ke,Ze=Re.onMouseLeave,We=Re.refKey,dt=We===void 0?"ref":We,ot=Re.ref,je=C1(Re,k1e),pt=te===void 0?{}:te;return pt.suppressRefError,nn((Me={},Me[dt]=W0(ot,function(U){v.current=U}),Me.id=N.menuId,Me.role="listbox",Me["aria-labelledby"]=je&&je["aria-label"]?void 0:""+N.labelId,Me.onMouseLeave=qo(Ze,function(){g({type:UF})}),Me),je)},[g,oe,N]),H=C.useCallback(function(ke){var te,Me,Re=ke===void 0?{}:ke,Ze=Re.item,We=Re.index,dt=Re.refKey,ot=dt===void 0?"ref":dt,je=Re.ref,pt=Re.onMouseMove,U=Re.onMouseDown,re=Re.onClick;Re.onPress;var de=Re.disabled,xe=C1(Re,x1e),ye=q.current,Te=ye.props,Le=ye.state,ze=f1e(Ze,We,Te.items,"Pass either item or index to getItemProps!"),Ye=ze[1],jt="onClick",ue=re,Ee=function(){Ye!==Le.highlightedIndex&&(Q.current=!1,g({type:$F,index:Ye,disabled:de}))},qe=function(){g({type:K7,index:Ye})},j=function(Ve){return Ve.preventDefault()};return nn((te={},te[ot]=W0(je,function(me){me&&(w.current[N.getItemId(Ye)]=me)}),te.disabled=de,te.role="option",te["aria-selected"]=""+(Ye===Le.highlightedIndex),te.id=N.getItemId(Ye),te),!de&&(Me={},Me[jt]=qo(ue,qe),Me),{onMouseMove:qo(pt,Ee),onMouseDown:qo(U,j)},xe)},[g,q,Q,N]),W=C.useCallback(function(ke){var te,Me=ke===void 0?{}:ke,Re=Me.onClick;Me.onPress;var Ze=Me.refKey,We=Ze===void 0?"ref":Ze,dt=Me.ref,ot=C1(Me,I1e),je=q.current.state,pt=function(){g({type:zF})};return nn((te={},te[We]=W0(dt,function(U){R.current=U}),te["aria-controls"]=N.menuId,te["aria-expanded"]=je.isOpen,te.id=N.toggleButtonId,te.tabIndex=-1,te),!ot.disabled&&nn({},{onClick:qo(Re,pt)}),ot)},[g,q,N]),se=C.useCallback(function(ke,te){var Me,Re=ke===void 0?{}:ke,Ze=Re.onKeyDown,We=Re.onChange,dt=Re.onInput,ot=Re.onFocus,je=Re.onBlur;Re.onChangeText;var pt=Re.refKey,U=pt===void 0?"ref":pt,re=Re.ref,de=C1(Re,R1e),xe=te===void 0?{}:te;xe.suppressRefError;var ye=q.current.state,Te=function(j){var me=n1e(j);me&&fe[me]&&fe[me](j)},Le=function(j){g({type:W7,inputValue:j.target.value})},ze=function(j){if(ye.isOpen&&!$.current.isMouseDown){var me=j.relatedTarget===null&&o.document.activeElement!==o.document.body;g({type:zg,selectItem:!me})}},Ye=function(){ye.isOpen||g({type:q7})},jt="onChange",ue={};if(!de.disabled){var Ee;ue=(Ee={},Ee[jt]=qo(We,dt,Le),Ee.onKeyDown=qo(Ze,Te),Ee.onBlur=qo(je,ze),Ee.onFocus=qo(ot,Ye),Ee)}return nn((Me={},Me[U]=W0(re,function(qe){A.current=qe}),Me["aria-activedescendant"]=ye.isOpen&&ye.highlightedIndex>-1?N.getItemId(ye.highlightedIndex):"",Me["aria-autocomplete"]="list",Me["aria-controls"]=N.menuId,Me["aria-expanded"]=ye.isOpen,Me["aria-labelledby"]=de&&de["aria-label"]?void 0:""+N.labelId,Me.autoComplete="off",Me.id=N.inputId,Me.role="combobox",Me.value=ye.inputValue,Me),ue,de)},[oe,q,N,fe,g,$,o]),D=C.useCallback(function(){g({type:HF})},[g]),pe=C.useCallback(function(){g({type:GF})},[g]),le=C.useCallback(function(){g({type:jF})},[g]),L=C.useCallback(function(ke){g({type:VF,highlightedIndex:ke})},[g]),ie=C.useCallback(function(ke){g({type:Y7,selectedItem:ke})},[g]),Se=C.useCallback(function(ke){g({type:WF,inputValue:ke})},[g]),X=C.useCallback(function(){g({type:qF})},[g]);return{getItemProps:H,getLabelProps:ce,getMenuProps:De,getInputProps:se,getToggleButtonProps:W,toggleMenu:D,openMenu:le,closeMenu:pe,setHighlightedIndex:L,setInputValue:Se,selectItem:ie,reset:X,highlightedIndex:y,isOpen:b,selectedItem:T,inputValue:E}}function N1e(e){var t=e.removedSelectedItem,n=e.itemToString;return n(t)+" has been removed."}be.array,be.array,be.array,be.func,be.func,be.func,be.number,be.number,be.number,be.func,be.func,be.string,be.string,be.shape({addEventListener:be.func,removeEventListener:be.func,document:be.shape({getElementById:be.func,activeElement:be.any,body:be.any})});Kd.itemToString,Kd.stateReducer,Kd.environment;/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */const{entries:XF,setPrototypeOf:TI,isFrozen:O1e,getPrototypeOf:D1e,getOwnPropertyDescriptor:ZF}=Object;let{freeze:ii,seal:Ya,create:QF}=Object,{apply:by,construct:yy}=typeof Reflect<"u"&&Reflect;ii||(ii=function(t){return t});Ya||(Ya=function(t){return t});by||(by=function(t,n,r){return t.apply(n,r)});yy||(yy=function(t,n){return new t(...n)});const Y0=va(Array.prototype.forEach),SI=va(Array.prototype.pop),ld=va(Array.prototype.push),Fh=va(String.prototype.toLowerCase),c4=va(String.prototype.toString),L1e=va(String.prototype.match),ud=va(String.prototype.replace),M1e=va(String.prototype.indexOf),F1e=va(String.prototype.trim),Ni=va(RegExp.prototype.test),cd=P1e(TypeError);function va(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:Fh;TI&&TI(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(O1e(t)||(t[r]=a),i=a)}e[i]=!0}return e}function r1(e){const t=QF(null);for(const[n,r]of XF(e))ZF(e,n)!==void 0&&(t[n]=r);return t}function X0(e,t){for(;e!==null;){const r=ZF(e,t);if(r){if(r.get)return va(r.get);if(typeof r.value=="function")return va(r.value)}e=D1e(e)}function n(r){return console.warn("fallback value for",r),null}return n}const wI=ii(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),d4=ii(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),p4=ii(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),B1e=ii(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),f4=ii(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),U1e=ii(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),AI=ii(["#text"]),CI=ii(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),h4=ii(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),kI=ii(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Z0=ii(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$1e=Ya(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z1e=Ya(/<%[\w\W]*|[\w\W]*%>/gm),H1e=Ya(/\${[\w\W]*}/gm),j1e=Ya(/^data-[\-\w.\u00B7-\uFFFF]/),G1e=Ya(/^aria-[\-\w]+$/),JF=Ya(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V1e=Ya(/^(?:\w+script|data):/i),W1e=Ya(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),eP=Ya(/^html$/i);var xI=Object.freeze({__proto__:null,MUSTACHE_EXPR:$1e,ERB_EXPR:z1e,TMPLIT_EXPR:H1e,DATA_ATTR:j1e,ARIA_ATTR:G1e,IS_ALLOWED_URI:JF,IS_SCRIPT_OR_DATA:V1e,ATTR_WHITESPACE:W1e,DOCTYPE_NAME:eP});const q1e=function(){return typeof window>"u"?null:window},K1e=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function tP(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q1e();const t=Ke=>tP(Ke);if(t.version="3.0.6",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:u,NodeFilter:c,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:m,trustedTypes:g}=e,b=u.prototype,y=X0(b,"cloneNode"),T=X0(b,"nextSibling"),E=X0(b,"childNodes"),v=X0(b,"parentNode");if(typeof o=="function"){const Ke=n.createElement("template");Ke.content&&Ke.content.ownerDocument&&(n=Ke.content.ownerDocument)}let w,A="";const{implementation:R,createNodeIterator:k,createDocumentFragment:N,getElementsByTagName:B}=n,{importNode:q}=r;let P={};t.isSupported=typeof XF=="function"&&typeof v=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Q,ERB_EXPR:$,TMPLIT_EXPR:oe,DATA_ATTR:fe,ARIA_ATTR:ce,IS_SCRIPT_OR_DATA:De,ATTR_WHITESPACE:H}=xI;let{IS_ALLOWED_URI:W}=xI,se=null;const D=At({},[...wI,...d4,...p4,...f4,...AI]);let pe=null;const le=At({},[...CI,...h4,...kI,...Z0]);let L=Object.seal(QF(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ie=null,Se=null,X=!0,ke=!0,te=!1,Me=!0,Re=!1,Ze=!1,We=!1,dt=!1,ot=!1,je=!1,pt=!1,U=!0,re=!1;const de="user-content-";let xe=!0,ye=!1,Te={},Le=null;const ze=At({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const jt=At({},["audio","video","img","source","image","track"]);let ue=null;const Ee=At({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qe="http://www.w3.org/1998/Math/MathML",j="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let Ve=me,ge=!1,G=null;const K=At({},[qe,j,me],c4);let ne=null;const ve=["application/xhtml+xml","text/html"],Qe="text/html";let Fe=null,at=null;const rt=n.createElement("form"),Je=function(J){return J instanceof RegExp||J instanceof Function},Rt=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(at&&at===J)){if((!J||typeof J!="object")&&(J={}),J=r1(J),ne=ve.indexOf(J.PARSER_MEDIA_TYPE)===-1?ne=Qe:ne=J.PARSER_MEDIA_TYPE,Fe=ne==="application/xhtml+xml"?c4:Fh,se="ALLOWED_TAGS"in J?At({},J.ALLOWED_TAGS,Fe):D,pe="ALLOWED_ATTR"in J?At({},J.ALLOWED_ATTR,Fe):le,G="ALLOWED_NAMESPACES"in J?At({},J.ALLOWED_NAMESPACES,c4):K,ue="ADD_URI_SAFE_ATTR"in J?At(r1(Ee),J.ADD_URI_SAFE_ATTR,Fe):Ee,Ye="ADD_DATA_URI_TAGS"in J?At(r1(jt),J.ADD_DATA_URI_TAGS,Fe):jt,Le="FORBID_CONTENTS"in J?At({},J.FORBID_CONTENTS,Fe):ze,ie="FORBID_TAGS"in J?At({},J.FORBID_TAGS,Fe):{},Se="FORBID_ATTR"in J?At({},J.FORBID_ATTR,Fe):{},Te="USE_PROFILES"in J?J.USE_PROFILES:!1,X=J.ALLOW_ARIA_ATTR!==!1,ke=J.ALLOW_DATA_ATTR!==!1,te=J.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=J.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Re=J.SAFE_FOR_TEMPLATES||!1,Ze=J.WHOLE_DOCUMENT||!1,ot=J.RETURN_DOM||!1,je=J.RETURN_DOM_FRAGMENT||!1,pt=J.RETURN_TRUSTED_TYPE||!1,dt=J.FORCE_BODY||!1,U=J.SANITIZE_DOM!==!1,re=J.SANITIZE_NAMED_PROPS||!1,xe=J.KEEP_CONTENT!==!1,ye=J.IN_PLACE||!1,W=J.ALLOWED_URI_REGEXP||JF,Ve=J.NAMESPACE||me,L=J.CUSTOM_ELEMENT_HANDLING||{},J.CUSTOM_ELEMENT_HANDLING&&Je(J.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(L.tagNameCheck=J.CUSTOM_ELEMENT_HANDLING.tagNameCheck),J.CUSTOM_ELEMENT_HANDLING&&Je(J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(L.attributeNameCheck=J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),J.CUSTOM_ELEMENT_HANDLING&&typeof J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Re&&(ke=!1),je&&(ot=!0),Te&&(se=At({},[...AI]),pe=[],Te.html===!0&&(At(se,wI),At(pe,CI)),Te.svg===!0&&(At(se,d4),At(pe,h4),At(pe,Z0)),Te.svgFilters===!0&&(At(se,p4),At(pe,h4),At(pe,Z0)),Te.mathMl===!0&&(At(se,f4),At(pe,kI),At(pe,Z0))),J.ADD_TAGS&&(se===D&&(se=r1(se)),At(se,J.ADD_TAGS,Fe)),J.ADD_ATTR&&(pe===le&&(pe=r1(pe)),At(pe,J.ADD_ATTR,Fe)),J.ADD_URI_SAFE_ATTR&&At(ue,J.ADD_URI_SAFE_ATTR,Fe),J.FORBID_CONTENTS&&(Le===ze&&(Le=r1(Le)),At(Le,J.FORBID_CONTENTS,Fe)),xe&&(se["#text"]=!0),Ze&&At(se,["html","head","body"]),se.table&&(At(se,["tbody"]),delete ie.tbody),J.TRUSTED_TYPES_POLICY){if(typeof J.TRUSTED_TYPES_POLICY.createHTML!="function")throw cd('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof J.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw cd('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=J.TRUSTED_TYPES_POLICY,A=w.createHTML("")}else w===void 0&&(w=K1e(g,i)),w!==null&&typeof A=="string"&&(A=w.createHTML(""));ii&&ii(J),at=J}},Qt=At({},["mi","mo","mn","ms","mtext"]),kt=At({},["foreignobject","desc","title","annotation-xml"]),rn=At({},["title","style","font","a","script"]),Xt=At({},d4);At(Xt,p4),At(Xt,B1e);const Wr=At({},f4);At(Wr,U1e);const qr=function(J){let Be=v(J);(!Be||!Be.tagName)&&(Be={namespaceURI:Ve,tagName:"template"});const it=Fh(J.tagName),un=Fh(Be.tagName);return G[J.namespaceURI]?J.namespaceURI===j?Be.namespaceURI===me?it==="svg":Be.namespaceURI===qe?it==="svg"&&(un==="annotation-xml"||Qt[un]):!!Xt[it]:J.namespaceURI===qe?Be.namespaceURI===me?it==="math":Be.namespaceURI===j?it==="math"&&kt[un]:!!Wr[it]:J.namespaceURI===me?Be.namespaceURI===j&&!kt[un]||Be.namespaceURI===qe&&!Qt[un]?!1:!Wr[it]&&(rn[it]||!Xt[it]):!!(ne==="application/xhtml+xml"&&G[J.namespaceURI]):!1},Kr=function(J){ld(t.removed,{element:J});try{J.parentNode.removeChild(J)}catch{J.remove()}},Aa=function(J,Be){try{ld(t.removed,{attribute:Be.getAttributeNode(J),from:Be})}catch{ld(t.removed,{attribute:null,from:Be})}if(Be.removeAttribute(J),J==="is"&&!pe[J])if(ot||je)try{Kr(Be)}catch{}else try{Be.setAttribute(J,"")}catch{}},si=function(J){let Be=null,it=null;if(dt)J=""+J;else{const or=L1e(J,/^[\r\n\t ]+/);it=or&&or[0]}ne==="application/xhtml+xml"&&Ve===me&&(J=''+J+"");const un=w?w.createHTML(J):J;if(Ve===me)try{Be=new m().parseFromString(un,ne)}catch{}if(!Be||!Be.documentElement){Be=R.createDocument(Ve,"template",null);try{Be.documentElement.innerHTML=ge?A:un}catch{}}const ar=Be.body||Be.documentElement;return J&&it&&ar.insertBefore(n.createTextNode(it),ar.childNodes[0]||null),Ve===me?B.call(Be,Ze?"html":"body")[0]:Ze?Be.documentElement:ar},Or=function(J){return k.call(J.ownerDocument||J,J,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null)},Es=function(J){return J instanceof f&&(typeof J.nodeName!="string"||typeof J.textContent!="string"||typeof J.removeChild!="function"||!(J.attributes instanceof p)||typeof J.removeAttribute!="function"||typeof J.setAttribute!="function"||typeof J.namespaceURI!="string"||typeof J.insertBefore!="function"||typeof J.hasChildNodes!="function")},vs=function(J){return typeof s=="function"&&J instanceof s},Yr=function(J,Be,it){P[J]&&Y0(P[J],un=>{un.call(t,Be,it,at)})},_s=function(J){let Be=null;if(Yr("beforeSanitizeElements",J,null),Es(J))return Kr(J),!0;const it=Fe(J.nodeName);if(Yr("uponSanitizeElement",J,{tagName:it,allowedTags:se}),J.hasChildNodes()&&!vs(J.firstElementChild)&&Ni(/<[/\w]/g,J.innerHTML)&&Ni(/<[/\w]/g,J.textContent))return Kr(J),!0;if(!se[it]||ie[it]){if(!ie[it]&&Dr(it)&&(L.tagNameCheck instanceof RegExp&&Ni(L.tagNameCheck,it)||L.tagNameCheck instanceof Function&&L.tagNameCheck(it)))return!1;if(xe&&!Le[it]){const un=v(J)||J.parentNode,ar=E(J)||J.childNodes;if(ar&&un){const or=ar.length;for(let Zn=or-1;Zn>=0;--Zn)un.insertBefore(y(ar[Zn],!0),T(J))}}return Kr(J),!0}return J instanceof u&&!qr(J)||(it==="noscript"||it==="noembed"||it==="noframes")&&Ni(/<\/no(script|embed|frames)/i,J.innerHTML)?(Kr(J),!0):(Re&&J.nodeType===3&&(Be=J.textContent,Y0([Q,$,oe],un=>{Be=ud(Be,un," ")}),J.textContent!==Be&&(ld(t.removed,{element:J.cloneNode()}),J.textContent=Be)),Yr("afterSanitizeElements",J,null),!1)},qt=function(J,Be,it){if(U&&(Be==="id"||Be==="name")&&(it in n||it in rt))return!1;if(!(ke&&!Se[Be]&&Ni(fe,Be))){if(!(X&&Ni(ce,Be))){if(!pe[Be]||Se[Be]){if(!(Dr(J)&&(L.tagNameCheck instanceof RegExp&&Ni(L.tagNameCheck,J)||L.tagNameCheck instanceof Function&&L.tagNameCheck(J))&&(L.attributeNameCheck instanceof RegExp&&Ni(L.attributeNameCheck,Be)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(Be))||Be==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&Ni(L.tagNameCheck,it)||L.tagNameCheck instanceof Function&&L.tagNameCheck(it))))return!1}else if(!ue[Be]){if(!Ni(W,ud(it,H,""))){if(!((Be==="src"||Be==="xlink:href"||Be==="href")&&J!=="script"&&M1e(it,"data:")===0&&Ye[J])){if(!(te&&!Ni(De,ud(it,H,"")))){if(it)return!1}}}}}}return!0},Dr=function(J){return J.indexOf("-")>0},Si=function(J){Yr("beforeSanitizeAttributes",J,null);const{attributes:Be}=J;if(!Be)return;const it={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:pe};let un=Be.length;for(;un--;){const ar=Be[un],{name:or,namespaceURI:Zn,value:Oo}=ar,no=Fe(or);let Lr=or==="value"?Oo:F1e(Oo);if(it.attrName=no,it.attrValue=Lr,it.keepAttr=!0,it.forceKeepAttr=void 0,Yr("uponSanitizeAttribute",J,it),Lr=it.attrValue,it.forceKeepAttr||(Aa(or,J),!it.keepAttr))continue;if(!Me&&Ni(/\/>/i,Lr)){Aa(or,J);continue}Re&&Y0([Q,$,oe],vf=>{Lr=ud(Lr,vf," ")});const Ef=Fe(J.nodeName);if(qt(Ef,no,Lr)){if(re&&(no==="id"||no==="name")&&(Aa(or,J),Lr=de+Lr),w&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Zn)switch(g.getAttributeType(Ef,no)){case"TrustedHTML":{Lr=w.createHTML(Lr);break}case"TrustedScriptURL":{Lr=w.createScriptURL(Lr);break}}try{Zn?J.setAttributeNS(Zn,or,Lr):J.setAttribute(or,Lr),SI(t.removed)}catch{}}}Yr("afterSanitizeAttributes",J,null)},Nl=function Ke(J){let Be=null;const it=Or(J);for(Yr("beforeSanitizeShadowDOM",J,null);Be=it.nextNode();)Yr("uponSanitizeShadowNode",Be,null),!_s(Be)&&(Be.content instanceof a&&Ke(Be.content),Si(Be));Yr("afterSanitizeShadowDOM",J,null)};return t.sanitize=function(Ke){let J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Be=null,it=null,un=null,ar=null;if(ge=!Ke,ge&&(Ke=""),typeof Ke!="string"&&!vs(Ke))if(typeof Ke.toString=="function"){if(Ke=Ke.toString(),typeof Ke!="string")throw cd("dirty is not a string, aborting")}else throw cd("toString is not a function");if(!t.isSupported)return Ke;if(We||Rt(J),t.removed=[],typeof Ke=="string"&&(ye=!1),ye){if(Ke.nodeName){const Oo=Fe(Ke.nodeName);if(!se[Oo]||ie[Oo])throw cd("root node is forbidden and cannot be sanitized in-place")}}else if(Ke instanceof s)Be=si(""),it=Be.ownerDocument.importNode(Ke,!0),it.nodeType===1&&it.nodeName==="BODY"||it.nodeName==="HTML"?Be=it:Be.appendChild(it);else{if(!ot&&!Re&&!Ze&&Ke.indexOf("<")===-1)return w&&pt?w.createHTML(Ke):Ke;if(Be=si(Ke),!Be)return ot?null:pt?A:""}Be&&dt&&Kr(Be.firstChild);const or=Or(ye?Ke:Be);for(;un=or.nextNode();)_s(un)||(un.content instanceof a&&Nl(un.content),Si(un));if(ye)return Ke;if(ot){if(je)for(ar=N.call(Be.ownerDocument);Be.firstChild;)ar.appendChild(Be.firstChild);else ar=Be;return(pe.shadowroot||pe.shadowrootmode)&&(ar=q.call(r,ar,!0)),ar}let Zn=Ze?Be.outerHTML:Be.innerHTML;return Ze&&se["!doctype"]&&Be.ownerDocument&&Be.ownerDocument.doctype&&Be.ownerDocument.doctype.name&&Ni(eP,Be.ownerDocument.doctype.name)&&(Zn=" + */var R2=60103,N2=60106,nf=60107,rf=60108,af=60114,of=60109,sf=60110,lf=60112,uf=60113,F7=60120,cf=60115,df=60116,xF=60121,IF=60122,RF=60117,NF=60129,OF=60131;if(typeof Symbol=="function"&&Symbol.for){var yr=Symbol.for;R2=yr("react.element"),N2=yr("react.portal"),nf=yr("react.fragment"),rf=yr("react.strict_mode"),af=yr("react.profiler"),of=yr("react.provider"),sf=yr("react.context"),lf=yr("react.forward_ref"),uf=yr("react.suspense"),F7=yr("react.suspense_list"),cf=yr("react.memo"),df=yr("react.lazy"),xF=yr("react.block"),IF=yr("react.server.block"),RF=yr("react.fundamental"),NF=yr("react.debug_trace_mode"),OF=yr("react.legacy_hidden")}function Ja(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case R2:switch(e=e.type,e){case nf:case af:case rf:case uf:case F7:return e;default:switch(e=e&&e.$$typeof,e){case sf:case lf:case df:case cf:case of:return e;default:return t}}case N2:return t}}}var $ue=of,zue=R2,Hue=lf,jue=nf,Gue=df,Vue=cf,Wue=N2,que=af,Kue=rf,Yue=uf;yn.ContextConsumer=sf;yn.ContextProvider=$ue;yn.Element=zue;yn.ForwardRef=Hue;yn.Fragment=jue;yn.Lazy=Gue;yn.Memo=Vue;yn.Portal=Wue;yn.Profiler=que;yn.StrictMode=Kue;yn.Suspense=Yue;yn.isAsyncMode=function(){return!1};yn.isConcurrentMode=function(){return!1};yn.isContextConsumer=function(e){return Ja(e)===sf};yn.isContextProvider=function(e){return Ja(e)===of};yn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===R2};yn.isForwardRef=function(e){return Ja(e)===lf};yn.isFragment=function(e){return Ja(e)===nf};yn.isLazy=function(e){return Ja(e)===df};yn.isMemo=function(e){return Ja(e)===cf};yn.isPortal=function(e){return Ja(e)===N2};yn.isProfiler=function(e){return Ja(e)===af};yn.isStrictMode=function(e){return Ja(e)===rf};yn.isSuspense=function(e){return Ja(e)===uf};yn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===nf||e===af||e===NF||e===rf||e===uf||e===F7||e===OF||typeof e=="object"&&e!==null&&(e.$$typeof===df||e.$$typeof===cf||e.$$typeof===of||e.$$typeof===sf||e.$$typeof===lf||e.$$typeof===RF||e.$$typeof===xF||e[0]===IF)};yn.typeOf=Ja;let mI=e=>typeof e=="object"&&e!=null&&e.nodeType===1,bI=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",u4=(e,t)=>{if(e.clientHeight{let i=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeightat||a>e&&o=t&&s>=n?a-e-r:o>t&&sn?o-t+i:0,Xue=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)};var Zue=(e,t)=>{var n,r,i,a,o,s;if(typeof document>"u")return[];let{scrollMode:u,block:c,inline:p,boundary:f,skipOverflowHiddenElements:m}=t,g=typeof f=="function"?f:fe=>fe!==f;if(!mI(e))throw new TypeError("Invalid target");let b=document.scrollingElement||document.documentElement,y=[],T=e;for(;mI(T)&&g(T);){if(T=Xue(T),T===b){y.push(T);break}T!=null&&T===document.body&&u4(T)&&!u4(document.documentElement)||T!=null&&u4(T,m)&&y.push(T)}let E=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,v=(a=(i=window.visualViewport)==null?void 0:i.height)!=null?a:innerHeight,w=(o=window.scrollX)!=null?o:pageXOffset,A=(s=window.scrollY)!=null?s:pageYOffset,{height:R,width:k,top:N,right:B,bottom:q,left:P}=e.getBoundingClientRect(),Q=c==="start"||c==="nearest"?N:c==="end"?q:N+R/2,$=p==="center"?P+k/2:p==="end"?B:P,oe=[];for(let fe=0;fe=0&&P>=0&&q<=v&&B<=E&&N>=W&&q<=D&&P>=pe&&B<=se)return oe;let le=getComputedStyle(ce),L=parseInt(le.borderLeftWidth,10),ie=parseInt(le.borderTopWidth,10),Se=parseInt(le.borderRightWidth,10),X=parseInt(le.borderBottomWidth,10),ke=0,te=0,Me="offsetWidth"in ce?ce.offsetWidth-ce.clientWidth-L-Se:0,Re="offsetHeight"in ce?ce.offsetHeight-ce.clientHeight-ie-X:0,Ye="offsetWidth"in ce?ce.offsetWidth===0?0:H/ce.offsetWidth:0,We="offsetHeight"in ce?ce.offsetHeight===0?0:De/ce.offsetHeight:0;if(b===ce)ke=c==="start"?Q:c==="end"?Q-v:c==="nearest"?V0(A,A+v,v,ie,X,A+Q,A+Q+R,R):Q-v/2,te=p==="start"?$:p==="center"?$-E/2:p==="end"?$-E:V0(w,w+E,E,L,Se,w+$,w+$+k,k),ke=Math.max(0,ke+A),te=Math.max(0,te+w);else{ke=c==="start"?Q-W-ie:c==="end"?Q-D+X+Re:c==="nearest"?V0(W,D,De,ie,X+Re,Q,Q+R,R):Q-(W+De/2)+Re/2,te=p==="start"?$-pe-L:p==="center"?$-(pe+H/2)+Me/2:p==="end"?$-se+Se+Me:V0(pe,se,H,L,Se+Me,$,$+k,k);let{scrollLeft:dt,scrollTop:ot}=ce;ke=Math.max(0,Math.min(ot+ke/We,ce.scrollHeight-De/We+Re)),te=Math.max(0,Math.min(dt+te/Ye,ce.scrollWidth-H/Ye+Me)),Q+=ot-ke,$+=dt-te}oe.push({el:ce,top:ke,left:te})}return oe},$g=function(){return $g=Object.assign||function(t){for(var n,r=1,i=arguments.length;r1?i-1:0),o=1;o=37&&n<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function q0(e,t,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var a=n-1;(typeof t!="number"||t<0||t>=n)&&(t=e>0?-1:a+1);var o=t+e;o<0?o=i?a:0:o>a&&(o=i?0:a);var s=Ap(e,o,n,r,i);return s===-1?t>=n?-1:t:s}function Ap(e,t,n,r,i){var a=r(t);if(!a||!a.hasAttribute("disabled"))return t;if(e>0){for(var o=t+1;o=0;s--)if(!r(s).hasAttribute("disabled"))return s;return i?e>0?Ap(1,0,n,r,!1):Ap(-1,n-1,n,r,!1):-1}function EI(e,t,n,r){return r===void 0&&(r=!0),t.some(function(i){return i&&(yI(i,e,n)||r&&yI(i,n.document.activeElement,n))})}var r1e=LF(function(e){FF(e).textContent=""},500);function i1e(e,t){var n=FF(t);e&&(n.textContent=e,r1e(t))}function FF(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var a1e=["isInitialMount","highlightedIndex","items","environment"],PF={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function o1e(e,t,n){var r=e.props,i=e.type,a={};Object.keys(t).forEach(function(o){s1e(o,e,t,n),n[o]!==t[o]&&(a[o]=n[o])}),r.onStateChange&&Object.keys(a).length&&r.onStateChange(nn({type:i},a))}function s1e(e,t,n,r){var i=t.props,a=t.type,o="on"+P7(e)+"Change";i[o]&&r[e]!==void 0&&r[e]!==n[e]&&i[o](nn({type:a},r))}function l1e(e,t){return t.changes}function u1e(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""}var c1e=LF(function(e,t){i1e(e(),t)},200),d1e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.useLayoutEffect:C.useEffect;function p1e(e){var t=e.id,n=t===void 0?"downshift-"+e1e():t,r=e.labelId,i=e.menuId,a=e.getItemId,o=e.toggleButtonId,s=e.inputId,u=C.useRef({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:a||function(c){return n+"-item-"+c},toggleButtonId:o||n+"-toggle-button",inputId:s||n+"-input"});return u.current}function f1e(e,t,n,r){var i,a;if(e===void 0){if(t===void 0)throw new Error(r);i=n[t],a=t}else a=t===void 0?n.indexOf(e):t,i=e;return[i,a]}function h1e(e){return e?String(e):""}function P7(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function BF(e){var t=C.useRef(e);return t.current=e,t}function g1e(e,t,n){var r=C.useRef(),i=C.useRef(),a=C.useCallback(function(m,g){i.current=g,m=my(m,g.props);var b=e(m,g),y=g.props.stateReducer(m,nn({},g,{changes:b}));return y},[e]),o=C.useReducer(a,t),s=o[0],u=o[1],c=BF(n),p=C.useCallback(function(m){return u(nn({props:c.current},m))},[c]),f=i.current;return C.useEffect(function(){f&&r.current&&r.current!==s&&o1e(f,my(r.current,f.props),s),r.current=s},[s,n,f]),[s,p]}var Kd={itemToString:h1e,stateReducer:l1e,getA11ySelectionMessage:u1e,scrollIntoView:Jue,environment:typeof window>"u"?{}:window};function bo(e,t,n){n===void 0&&(n=PF);var r=e["default"+P7(t)];return r!==void 0?r:n[t]}function K0(e,t,n){n===void 0&&(n=PF);var r=e[t];if(r!==void 0)return r;var i=e["initial"+P7(t)];return i!==void 0?i:bo(e,t,n)}function m1e(e){var t=K0(e,"selectedItem"),n=K0(e,"isOpen"),r=K0(e,"highlightedIndex"),i=K0(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}function Yd(e,t,n){var r=e.items,i=e.initialHighlightedIndex,a=e.defaultHighlightedIndex,o=t.selectedItem,s=t.highlightedIndex;return r.length===0?-1:i!==void 0&&s===i?i:a!==void 0?a:o?r.indexOf(o):n===0?-1:n<0?r.length-1:0}function b1e(e,t,n,r){var i=C.useRef({isMouseDown:!1,isTouchMove:!1});return C.useEffect(function(){if((n==null?void 0:n.addEventListener)!=null){var a=function(){i.current.isMouseDown=!0},o=function(f){i.current.isMouseDown=!1,e&&!EI(f.target,t.map(function(m){return m.current}),n)&&r()},s=function(){i.current.isTouchMove=!1},u=function(){i.current.isTouchMove=!0},c=function(f){e&&!i.current.isTouchMove&&!EI(f.target,t.map(function(m){return m.current}),n,!1)&&r()};return n.addEventListener("mousedown",a),n.addEventListener("mouseup",o),n.addEventListener("touchstart",s),n.addEventListener("touchmove",u),n.addEventListener("touchend",c),function(){n.removeEventListener("mousedown",a),n.removeEventListener("mouseup",o),n.removeEventListener("touchstart",s),n.removeEventListener("touchmove",u),n.removeEventListener("touchend",c)}}},[e,n]),i}var y1e=function(){return DF};function vI(e,t,n){var r=n.isInitialMount,i=n.highlightedIndex,a=n.items,o=n.environment,s=C1(n,a1e);C.useEffect(function(){r||c1e(function(){return e(nn({highlightedIndex:i,highlightedItem:a[i],resultCount:a.length},s))},o.document)},t)}function E1e(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=C.useRef(!0);return d1e(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var v1e=DF;function _I(e,t,n){var r;n===void 0&&(n=!0);var i=((r=e.items)==null?void 0:r.length)&&t>=0;return nn({isOpen:!1,highlightedIndex:-1},i&&nn({selectedItem:e.items[t],isOpen:bo(e,"isOpen"),highlightedIndex:bo(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function _1e(e,t,n){var r=t.type,i=t.props,a;switch(r){case n.ItemMouseMove:a={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:a={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Yd(i,e,0)};break;case n.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:Yd(i,e,0)};break;case n.FunctionCloseMenu:a={isOpen:!1};break;case n.FunctionSetHighlightedIndex:a={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:a={inputValue:t.inputValue};break;case n.FunctionReset:a={highlightedIndex:bo(i,"highlightedIndex"),isOpen:bo(i,"isOpen"),selectedItem:bo(i,"selectedItem"),inputValue:bo(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return nn({},e,a)}be.array.isRequired,be.func,be.func,be.func,be.number,be.number,be.number,be.bool,be.bool,be.bool,be.any,be.any,be.any,be.string,be.string,be.string,be.func,be.string,be.func,be.func,be.func,be.func,be.func,be.shape({addEventListener:be.func,removeEventListener:be.func,document:be.shape({getElementById:be.func,activeElement:be.any,body:be.any})});function T1e(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(n===1?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}$g($g({},Kd),{getA11yStatusMessage:T1e});var B7=0,U7=1,$7=2,z7=3,H7=4,j7=5,G7=6,V7=7,W7=8,zg=9,q7=10,UF=11,$F=12,K7=13,zF=14,HF=15,jF=16,GF=17,VF=18,Y7=19,WF=20,qF=21,X7=22,KF=Object.freeze({__proto__:null,InputKeyDownArrowDown:B7,InputKeyDownArrowUp:U7,InputKeyDownEscape:$7,InputKeyDownHome:z7,InputKeyDownEnd:H7,InputKeyDownPageUp:j7,InputKeyDownPageDown:G7,InputKeyDownEnter:V7,InputChange:W7,InputBlur:zg,InputFocus:q7,MenuMouseLeave:UF,ItemMouseMove:$F,ItemClick:K7,ToggleButtonClick:zF,FunctionToggleMenu:HF,FunctionOpenMenu:jF,FunctionCloseMenu:GF,FunctionSetHighlightedIndex:VF,FunctionSelectItem:Y7,FunctionSetInputValue:WF,FunctionReset:qF,ControlledPropUpdatedSelectedItem:X7});function S1e(e){var t=m1e(e),n=t.selectedItem,r=t.inputValue;return r===""&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),nn({},t,{inputValue:r})}be.array.isRequired,be.func,be.func,be.func,be.func,be.number,be.number,be.number,be.bool,be.bool,be.bool,be.any,be.any,be.any,be.string,be.string,be.string,be.string,be.string,be.string,be.func,be.string,be.string,be.func,be.func,be.func,be.func,be.func,be.func,be.shape({addEventListener:be.func,removeEventListener:be.func,document:be.shape({getElementById:be.func,activeElement:be.any,body:be.any})});function w1e(e,t,n){var r=C.useRef(),i=g1e(e,t,n),a=i[0],o=i[1];return C.useEffect(function(){MF(n,"selectedItem")&&(n.selectedItemChanged(r.current,n.selectedItem)&&o({type:X7,inputValue:n.itemToString(n.selectedItem)}),r.current=a.selectedItem===r.current?n.selectedItem:a.selectedItem)},[a.selectedItem,n.selectedItem]),[my(a,n),o]}var A1e=nn({},Kd,{selectedItemChanged:function(t,n){return t!==n},getA11yStatusMessage:t1e});function C1e(e,t){var n,r=t.type,i=t.props,a=t.altKey,o;switch(r){case K7:o={isOpen:bo(i,"isOpen"),highlightedIndex:bo(i,"highlightedIndex"),selectedItem:i.items[t.index],inputValue:i.itemToString(i.items[t.index])};break;case B7:e.isOpen?o={highlightedIndex:q0(1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:o={highlightedIndex:a&&e.selectedItem==null?-1:Yd(i,e,1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case U7:e.isOpen?a?o=_I(i,e.highlightedIndex):o={highlightedIndex:q0(-1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:o={highlightedIndex:Yd(i,e,-1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case V7:o=_I(i,e.highlightedIndex);break;case $7:o=nn({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case j7:o={highlightedIndex:q0(-10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case G7:o={highlightedIndex:q0(10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case z7:o={highlightedIndex:Ap(1,0,i.items.length,t.getItemNodeFromIndex,!1)};break;case H7:o={highlightedIndex:Ap(-1,i.items.length-1,i.items.length,t.getItemNodeFromIndex,!1)};break;case zg:o=nn({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((n=i.items)==null?void 0:n.length)&&t.selectItem&&{selectedItem:i.items[e.highlightedIndex],inputValue:i.itemToString(i.items[e.highlightedIndex])});break;case W7:o={isOpen:!0,highlightedIndex:bo(i,"highlightedIndex"),inputValue:t.inputValue};break;case q7:o={isOpen:!0,highlightedIndex:Yd(i,e,0)};break;case Y7:o={selectedItem:t.selectedItem,inputValue:i.itemToString(t.selectedItem)};break;case X7:o={inputValue:t.inputValue};break;default:return _1e(e,t,KF)}return nn({},e,o)}var k1e=["onMouseLeave","refKey","ref"],x1e=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],I1e=["onClick","onPress","refKey","ref"],R1e=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];YF.stateChangeTypes=KF;function YF(e){e===void 0&&(e={});var t=nn({},A1e,e),n=t.initialIsOpen,r=t.defaultIsOpen,i=t.items,a=t.scrollIntoView,o=t.environment,s=t.getA11yStatusMessage,u=t.getA11ySelectionMessage,c=t.itemToString,p=S1e(t),f=w1e(C1e,p,t),m=f[0],g=f[1],b=m.isOpen,y=m.highlightedIndex,T=m.selectedItem,E=m.inputValue,v=C.useRef(null),w=C.useRef({}),A=C.useRef(null),R=C.useRef(null),k=C.useRef(!0),N=p1e(t),B=C.useRef(),q=BF({state:m,props:t}),P=C.useCallback(function(ke){return w.current[N.getItemId(ke)]},[N]);vI(s,[b,y,E,i],nn({isInitialMount:k.current,previousResultCount:B.current,items:i,environment:o,itemToString:c},m)),vI(u,[T],nn({isInitialMount:k.current,previousResultCount:B.current,items:i,environment:o,itemToString:c},m));var Q=E1e({menuElement:v.current,highlightedIndex:y,isOpen:b,itemRefs:w,scrollIntoView:a,getItemNodeFromIndex:P});v1e({isInitialMount:k.current,props:t,state:m}),C.useEffect(function(){var ke=n||r||b;ke&&A.current&&A.current.focus()},[]),C.useEffect(function(){k.current||(B.current=i.length)});var $=b1e(b,[A,v,R],o,function(){g({type:zg,selectItem:!1})}),oe=y1e();C.useEffect(function(){return k.current=!1,function(){k.current=!0}},[]),C.useEffect(function(){var ke;if(!b)w.current={};else if(((ke=o.document)==null?void 0:ke.activeElement)!==A.current){var te;A==null||(te=A.current)==null||te.focus()}},[b,o]);var fe=C.useMemo(function(){return{ArrowDown:function(te){te.preventDefault(),g({type:B7,altKey:te.altKey,getItemNodeFromIndex:P})},ArrowUp:function(te){te.preventDefault(),g({type:U7,altKey:te.altKey,getItemNodeFromIndex:P})},Home:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:z7,getItemNodeFromIndex:P}))},End:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:H7,getItemNodeFromIndex:P}))},Escape:function(te){var Me=q.current.state;(Me.isOpen||Me.inputValue||Me.selectedItem||Me.highlightedIndex>-1)&&(te.preventDefault(),g({type:$7}))},Enter:function(te){var Me=q.current.state;!Me.isOpen||te.which===229||(te.preventDefault(),g({type:V7,getItemNodeFromIndex:P}))},PageUp:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:j7,getItemNodeFromIndex:P}))},PageDown:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:G7,getItemNodeFromIndex:P}))}}},[g,q,P]),ce=C.useCallback(function(ke){return nn({id:N.labelId,htmlFor:N.inputId},ke)},[N]),De=C.useCallback(function(ke,te){var Me,Re=ke===void 0?{}:ke,Ye=Re.onMouseLeave,We=Re.refKey,dt=We===void 0?"ref":We,ot=Re.ref,je=C1(Re,k1e),pt=te===void 0?{}:te;return pt.suppressRefError,nn((Me={},Me[dt]=W0(ot,function(U){v.current=U}),Me.id=N.menuId,Me.role="listbox",Me["aria-labelledby"]=je&&je["aria-label"]?void 0:""+N.labelId,Me.onMouseLeave=qo(Ye,function(){g({type:UF})}),Me),je)},[g,oe,N]),H=C.useCallback(function(ke){var te,Me,Re=ke===void 0?{}:ke,Ye=Re.item,We=Re.index,dt=Re.refKey,ot=dt===void 0?"ref":dt,je=Re.ref,pt=Re.onMouseMove,U=Re.onMouseDown,re=Re.onClick;Re.onPress;var de=Re.disabled,xe=C1(Re,x1e),ye=q.current,Te=ye.props,Le=ye.state,ze=f1e(Ye,We,Te.items,"Pass either item or index to getItemProps!"),Xe=ze[1],jt="onClick",ue=re,Ee=function(){Xe!==Le.highlightedIndex&&(Q.current=!1,g({type:$F,index:Xe,disabled:de}))},qe=function(){g({type:K7,index:Xe})},j=function(Ve){return Ve.preventDefault()};return nn((te={},te[ot]=W0(je,function(me){me&&(w.current[N.getItemId(Xe)]=me)}),te.disabled=de,te.role="option",te["aria-selected"]=""+(Xe===Le.highlightedIndex),te.id=N.getItemId(Xe),te),!de&&(Me={},Me[jt]=qo(ue,qe),Me),{onMouseMove:qo(pt,Ee),onMouseDown:qo(U,j)},xe)},[g,q,Q,N]),W=C.useCallback(function(ke){var te,Me=ke===void 0?{}:ke,Re=Me.onClick;Me.onPress;var Ye=Me.refKey,We=Ye===void 0?"ref":Ye,dt=Me.ref,ot=C1(Me,I1e),je=q.current.state,pt=function(){g({type:zF})};return nn((te={},te[We]=W0(dt,function(U){R.current=U}),te["aria-controls"]=N.menuId,te["aria-expanded"]=je.isOpen,te.id=N.toggleButtonId,te.tabIndex=-1,te),!ot.disabled&&nn({},{onClick:qo(Re,pt)}),ot)},[g,q,N]),se=C.useCallback(function(ke,te){var Me,Re=ke===void 0?{}:ke,Ye=Re.onKeyDown,We=Re.onChange,dt=Re.onInput,ot=Re.onFocus,je=Re.onBlur;Re.onChangeText;var pt=Re.refKey,U=pt===void 0?"ref":pt,re=Re.ref,de=C1(Re,R1e),xe=te===void 0?{}:te;xe.suppressRefError;var ye=q.current.state,Te=function(j){var me=n1e(j);me&&fe[me]&&fe[me](j)},Le=function(j){g({type:W7,inputValue:j.target.value})},ze=function(j){if(ye.isOpen&&!$.current.isMouseDown){var me=j.relatedTarget===null&&o.document.activeElement!==o.document.body;g({type:zg,selectItem:!me})}},Xe=function(){ye.isOpen||g({type:q7})},jt="onChange",ue={};if(!de.disabled){var Ee;ue=(Ee={},Ee[jt]=qo(We,dt,Le),Ee.onKeyDown=qo(Ye,Te),Ee.onBlur=qo(je,ze),Ee.onFocus=qo(ot,Xe),Ee)}return nn((Me={},Me[U]=W0(re,function(qe){A.current=qe}),Me["aria-activedescendant"]=ye.isOpen&&ye.highlightedIndex>-1?N.getItemId(ye.highlightedIndex):"",Me["aria-autocomplete"]="list",Me["aria-controls"]=N.menuId,Me["aria-expanded"]=ye.isOpen,Me["aria-labelledby"]=de&&de["aria-label"]?void 0:""+N.labelId,Me.autoComplete="off",Me.id=N.inputId,Me.role="combobox",Me.value=ye.inputValue,Me),ue,de)},[oe,q,N,fe,g,$,o]),D=C.useCallback(function(){g({type:HF})},[g]),pe=C.useCallback(function(){g({type:GF})},[g]),le=C.useCallback(function(){g({type:jF})},[g]),L=C.useCallback(function(ke){g({type:VF,highlightedIndex:ke})},[g]),ie=C.useCallback(function(ke){g({type:Y7,selectedItem:ke})},[g]),Se=C.useCallback(function(ke){g({type:WF,inputValue:ke})},[g]),X=C.useCallback(function(){g({type:qF})},[g]);return{getItemProps:H,getLabelProps:ce,getMenuProps:De,getInputProps:se,getToggleButtonProps:W,toggleMenu:D,openMenu:le,closeMenu:pe,setHighlightedIndex:L,setInputValue:Se,selectItem:ie,reset:X,highlightedIndex:y,isOpen:b,selectedItem:T,inputValue:E}}function N1e(e){var t=e.removedSelectedItem,n=e.itemToString;return n(t)+" has been removed."}be.array,be.array,be.array,be.func,be.func,be.func,be.number,be.number,be.number,be.func,be.func,be.string,be.string,be.shape({addEventListener:be.func,removeEventListener:be.func,document:be.shape({getElementById:be.func,activeElement:be.any,body:be.any})});Kd.itemToString,Kd.stateReducer,Kd.environment;/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */const{entries:XF,setPrototypeOf:TI,isFrozen:O1e,getPrototypeOf:D1e,getOwnPropertyDescriptor:ZF}=Object;let{freeze:ii,seal:Ya,create:QF}=Object,{apply:by,construct:yy}=typeof Reflect<"u"&&Reflect;ii||(ii=function(t){return t});Ya||(Ya=function(t){return t});by||(by=function(t,n,r){return t.apply(n,r)});yy||(yy=function(t,n){return new t(...n)});const Y0=va(Array.prototype.forEach),SI=va(Array.prototype.pop),ld=va(Array.prototype.push),Fh=va(String.prototype.toLowerCase),c4=va(String.prototype.toString),L1e=va(String.prototype.match),ud=va(String.prototype.replace),M1e=va(String.prototype.indexOf),F1e=va(String.prototype.trim),Ni=va(RegExp.prototype.test),cd=P1e(TypeError);function va(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:Fh;TI&&TI(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(O1e(t)||(t[r]=a),i=a)}e[i]=!0}return e}function r1(e){const t=QF(null);for(const[n,r]of XF(e))ZF(e,n)!==void 0&&(t[n]=r);return t}function X0(e,t){for(;e!==null;){const r=ZF(e,t);if(r){if(r.get)return va(r.get);if(typeof r.value=="function")return va(r.value)}e=D1e(e)}function n(r){return console.warn("fallback value for",r),null}return n}const wI=ii(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),d4=ii(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),p4=ii(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),B1e=ii(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),f4=ii(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),U1e=ii(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),AI=ii(["#text"]),CI=ii(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),h4=ii(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),kI=ii(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Z0=ii(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$1e=Ya(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z1e=Ya(/<%[\w\W]*|[\w\W]*%>/gm),H1e=Ya(/\${[\w\W]*}/gm),j1e=Ya(/^data-[\-\w.\u00B7-\uFFFF]/),G1e=Ya(/^aria-[\-\w]+$/),JF=Ya(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V1e=Ya(/^(?:\w+script|data):/i),W1e=Ya(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),eP=Ya(/^html$/i);var xI=Object.freeze({__proto__:null,MUSTACHE_EXPR:$1e,ERB_EXPR:z1e,TMPLIT_EXPR:H1e,DATA_ATTR:j1e,ARIA_ATTR:G1e,IS_ALLOWED_URI:JF,IS_SCRIPT_OR_DATA:V1e,ATTR_WHITESPACE:W1e,DOCTYPE_NAME:eP});const q1e=function(){return typeof window>"u"?null:window},K1e=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function tP(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q1e();const t=Ke=>tP(Ke);if(t.version="3.0.6",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:u,NodeFilter:c,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:m,trustedTypes:g}=e,b=u.prototype,y=X0(b,"cloneNode"),T=X0(b,"nextSibling"),E=X0(b,"childNodes"),v=X0(b,"parentNode");if(typeof o=="function"){const Ke=n.createElement("template");Ke.content&&Ke.content.ownerDocument&&(n=Ke.content.ownerDocument)}let w,A="";const{implementation:R,createNodeIterator:k,createDocumentFragment:N,getElementsByTagName:B}=n,{importNode:q}=r;let P={};t.isSupported=typeof XF=="function"&&typeof v=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Q,ERB_EXPR:$,TMPLIT_EXPR:oe,DATA_ATTR:fe,ARIA_ATTR:ce,IS_SCRIPT_OR_DATA:De,ATTR_WHITESPACE:H}=xI;let{IS_ALLOWED_URI:W}=xI,se=null;const D=At({},[...wI,...d4,...p4,...f4,...AI]);let pe=null;const le=At({},[...CI,...h4,...kI,...Z0]);let L=Object.seal(QF(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ie=null,Se=null,X=!0,ke=!0,te=!1,Me=!0,Re=!1,Ye=!1,We=!1,dt=!1,ot=!1,je=!1,pt=!1,U=!0,re=!1;const de="user-content-";let xe=!0,ye=!1,Te={},Le=null;const ze=At({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Xe=null;const jt=At({},["audio","video","img","source","image","track"]);let ue=null;const Ee=At({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qe="http://www.w3.org/1998/Math/MathML",j="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let Ve=me,ge=!1,G=null;const K=At({},[qe,j,me],c4);let ne=null;const ve=["application/xhtml+xml","text/html"],Qe="text/html";let Fe=null,at=null;const rt=n.createElement("form"),Je=function(J){return J instanceof RegExp||J instanceof Function},Rt=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(at&&at===J)){if((!J||typeof J!="object")&&(J={}),J=r1(J),ne=ve.indexOf(J.PARSER_MEDIA_TYPE)===-1?ne=Qe:ne=J.PARSER_MEDIA_TYPE,Fe=ne==="application/xhtml+xml"?c4:Fh,se="ALLOWED_TAGS"in J?At({},J.ALLOWED_TAGS,Fe):D,pe="ALLOWED_ATTR"in J?At({},J.ALLOWED_ATTR,Fe):le,G="ALLOWED_NAMESPACES"in J?At({},J.ALLOWED_NAMESPACES,c4):K,ue="ADD_URI_SAFE_ATTR"in J?At(r1(Ee),J.ADD_URI_SAFE_ATTR,Fe):Ee,Xe="ADD_DATA_URI_TAGS"in J?At(r1(jt),J.ADD_DATA_URI_TAGS,Fe):jt,Le="FORBID_CONTENTS"in J?At({},J.FORBID_CONTENTS,Fe):ze,ie="FORBID_TAGS"in J?At({},J.FORBID_TAGS,Fe):{},Se="FORBID_ATTR"in J?At({},J.FORBID_ATTR,Fe):{},Te="USE_PROFILES"in J?J.USE_PROFILES:!1,X=J.ALLOW_ARIA_ATTR!==!1,ke=J.ALLOW_DATA_ATTR!==!1,te=J.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=J.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Re=J.SAFE_FOR_TEMPLATES||!1,Ye=J.WHOLE_DOCUMENT||!1,ot=J.RETURN_DOM||!1,je=J.RETURN_DOM_FRAGMENT||!1,pt=J.RETURN_TRUSTED_TYPE||!1,dt=J.FORCE_BODY||!1,U=J.SANITIZE_DOM!==!1,re=J.SANITIZE_NAMED_PROPS||!1,xe=J.KEEP_CONTENT!==!1,ye=J.IN_PLACE||!1,W=J.ALLOWED_URI_REGEXP||JF,Ve=J.NAMESPACE||me,L=J.CUSTOM_ELEMENT_HANDLING||{},J.CUSTOM_ELEMENT_HANDLING&&Je(J.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(L.tagNameCheck=J.CUSTOM_ELEMENT_HANDLING.tagNameCheck),J.CUSTOM_ELEMENT_HANDLING&&Je(J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(L.attributeNameCheck=J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),J.CUSTOM_ELEMENT_HANDLING&&typeof J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Re&&(ke=!1),je&&(ot=!0),Te&&(se=At({},[...AI]),pe=[],Te.html===!0&&(At(se,wI),At(pe,CI)),Te.svg===!0&&(At(se,d4),At(pe,h4),At(pe,Z0)),Te.svgFilters===!0&&(At(se,p4),At(pe,h4),At(pe,Z0)),Te.mathMl===!0&&(At(se,f4),At(pe,kI),At(pe,Z0))),J.ADD_TAGS&&(se===D&&(se=r1(se)),At(se,J.ADD_TAGS,Fe)),J.ADD_ATTR&&(pe===le&&(pe=r1(pe)),At(pe,J.ADD_ATTR,Fe)),J.ADD_URI_SAFE_ATTR&&At(ue,J.ADD_URI_SAFE_ATTR,Fe),J.FORBID_CONTENTS&&(Le===ze&&(Le=r1(Le)),At(Le,J.FORBID_CONTENTS,Fe)),xe&&(se["#text"]=!0),Ye&&At(se,["html","head","body"]),se.table&&(At(se,["tbody"]),delete ie.tbody),J.TRUSTED_TYPES_POLICY){if(typeof J.TRUSTED_TYPES_POLICY.createHTML!="function")throw cd('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof J.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw cd('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=J.TRUSTED_TYPES_POLICY,A=w.createHTML("")}else w===void 0&&(w=K1e(g,i)),w!==null&&typeof A=="string"&&(A=w.createHTML(""));ii&&ii(J),at=J}},Qt=At({},["mi","mo","mn","ms","mtext"]),kt=At({},["foreignobject","desc","title","annotation-xml"]),rn=At({},["title","style","font","a","script"]),Xt=At({},d4);At(Xt,p4),At(Xt,B1e);const Wr=At({},f4);At(Wr,U1e);const qr=function(J){let Be=v(J);(!Be||!Be.tagName)&&(Be={namespaceURI:Ve,tagName:"template"});const it=Fh(J.tagName),un=Fh(Be.tagName);return G[J.namespaceURI]?J.namespaceURI===j?Be.namespaceURI===me?it==="svg":Be.namespaceURI===qe?it==="svg"&&(un==="annotation-xml"||Qt[un]):!!Xt[it]:J.namespaceURI===qe?Be.namespaceURI===me?it==="math":Be.namespaceURI===j?it==="math"&&kt[un]:!!Wr[it]:J.namespaceURI===me?Be.namespaceURI===j&&!kt[un]||Be.namespaceURI===qe&&!Qt[un]?!1:!Wr[it]&&(rn[it]||!Xt[it]):!!(ne==="application/xhtml+xml"&&G[J.namespaceURI]):!1},Kr=function(J){ld(t.removed,{element:J});try{J.parentNode.removeChild(J)}catch{J.remove()}},Aa=function(J,Be){try{ld(t.removed,{attribute:Be.getAttributeNode(J),from:Be})}catch{ld(t.removed,{attribute:null,from:Be})}if(Be.removeAttribute(J),J==="is"&&!pe[J])if(ot||je)try{Kr(Be)}catch{}else try{Be.setAttribute(J,"")}catch{}},si=function(J){let Be=null,it=null;if(dt)J=""+J;else{const or=L1e(J,/^[\r\n\t ]+/);it=or&&or[0]}ne==="application/xhtml+xml"&&Ve===me&&(J=''+J+"");const un=w?w.createHTML(J):J;if(Ve===me)try{Be=new m().parseFromString(un,ne)}catch{}if(!Be||!Be.documentElement){Be=R.createDocument(Ve,"template",null);try{Be.documentElement.innerHTML=ge?A:un}catch{}}const ar=Be.body||Be.documentElement;return J&&it&&ar.insertBefore(n.createTextNode(it),ar.childNodes[0]||null),Ve===me?B.call(Be,Ye?"html":"body")[0]:Ye?Be.documentElement:ar},Or=function(J){return k.call(J.ownerDocument||J,J,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null)},Es=function(J){return J instanceof f&&(typeof J.nodeName!="string"||typeof J.textContent!="string"||typeof J.removeChild!="function"||!(J.attributes instanceof p)||typeof J.removeAttribute!="function"||typeof J.setAttribute!="function"||typeof J.namespaceURI!="string"||typeof J.insertBefore!="function"||typeof J.hasChildNodes!="function")},vs=function(J){return typeof s=="function"&&J instanceof s},Yr=function(J,Be,it){P[J]&&Y0(P[J],un=>{un.call(t,Be,it,at)})},_s=function(J){let Be=null;if(Yr("beforeSanitizeElements",J,null),Es(J))return Kr(J),!0;const it=Fe(J.nodeName);if(Yr("uponSanitizeElement",J,{tagName:it,allowedTags:se}),J.hasChildNodes()&&!vs(J.firstElementChild)&&Ni(/<[/\w]/g,J.innerHTML)&&Ni(/<[/\w]/g,J.textContent))return Kr(J),!0;if(!se[it]||ie[it]){if(!ie[it]&&Dr(it)&&(L.tagNameCheck instanceof RegExp&&Ni(L.tagNameCheck,it)||L.tagNameCheck instanceof Function&&L.tagNameCheck(it)))return!1;if(xe&&!Le[it]){const un=v(J)||J.parentNode,ar=E(J)||J.childNodes;if(ar&&un){const or=ar.length;for(let Zn=or-1;Zn>=0;--Zn)un.insertBefore(y(ar[Zn],!0),T(J))}}return Kr(J),!0}return J instanceof u&&!qr(J)||(it==="noscript"||it==="noembed"||it==="noframes")&&Ni(/<\/no(script|embed|frames)/i,J.innerHTML)?(Kr(J),!0):(Re&&J.nodeType===3&&(Be=J.textContent,Y0([Q,$,oe],un=>{Be=ud(Be,un," ")}),J.textContent!==Be&&(ld(t.removed,{element:J.cloneNode()}),J.textContent=Be)),Yr("afterSanitizeElements",J,null),!1)},qt=function(J,Be,it){if(U&&(Be==="id"||Be==="name")&&(it in n||it in rt))return!1;if(!(ke&&!Se[Be]&&Ni(fe,Be))){if(!(X&&Ni(ce,Be))){if(!pe[Be]||Se[Be]){if(!(Dr(J)&&(L.tagNameCheck instanceof RegExp&&Ni(L.tagNameCheck,J)||L.tagNameCheck instanceof Function&&L.tagNameCheck(J))&&(L.attributeNameCheck instanceof RegExp&&Ni(L.attributeNameCheck,Be)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(Be))||Be==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&Ni(L.tagNameCheck,it)||L.tagNameCheck instanceof Function&&L.tagNameCheck(it))))return!1}else if(!ue[Be]){if(!Ni(W,ud(it,H,""))){if(!((Be==="src"||Be==="xlink:href"||Be==="href")&&J!=="script"&&M1e(it,"data:")===0&&Xe[J])){if(!(te&&!Ni(De,ud(it,H,"")))){if(it)return!1}}}}}}return!0},Dr=function(J){return J.indexOf("-")>0},Si=function(J){Yr("beforeSanitizeAttributes",J,null);const{attributes:Be}=J;if(!Be)return;const it={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:pe};let un=Be.length;for(;un--;){const ar=Be[un],{name:or,namespaceURI:Zn,value:Oo}=ar,no=Fe(or);let Lr=or==="value"?Oo:F1e(Oo);if(it.attrName=no,it.attrValue=Lr,it.keepAttr=!0,it.forceKeepAttr=void 0,Yr("uponSanitizeAttribute",J,it),Lr=it.attrValue,it.forceKeepAttr||(Aa(or,J),!it.keepAttr))continue;if(!Me&&Ni(/\/>/i,Lr)){Aa(or,J);continue}Re&&Y0([Q,$,oe],vf=>{Lr=ud(Lr,vf," ")});const Ef=Fe(J.nodeName);if(qt(Ef,no,Lr)){if(re&&(no==="id"||no==="name")&&(Aa(or,J),Lr=de+Lr),w&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Zn)switch(g.getAttributeType(Ef,no)){case"TrustedHTML":{Lr=w.createHTML(Lr);break}case"TrustedScriptURL":{Lr=w.createScriptURL(Lr);break}}try{Zn?J.setAttributeNS(Zn,or,Lr):J.setAttribute(or,Lr),SI(t.removed)}catch{}}}Yr("afterSanitizeAttributes",J,null)},Nl=function Ke(J){let Be=null;const it=Or(J);for(Yr("beforeSanitizeShadowDOM",J,null);Be=it.nextNode();)Yr("uponSanitizeShadowNode",Be,null),!_s(Be)&&(Be.content instanceof a&&Ke(Be.content),Si(Be));Yr("afterSanitizeShadowDOM",J,null)};return t.sanitize=function(Ke){let J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Be=null,it=null,un=null,ar=null;if(ge=!Ke,ge&&(Ke=""),typeof Ke!="string"&&!vs(Ke))if(typeof Ke.toString=="function"){if(Ke=Ke.toString(),typeof Ke!="string")throw cd("dirty is not a string, aborting")}else throw cd("toString is not a function");if(!t.isSupported)return Ke;if(We||Rt(J),t.removed=[],typeof Ke=="string"&&(ye=!1),ye){if(Ke.nodeName){const Oo=Fe(Ke.nodeName);if(!se[Oo]||ie[Oo])throw cd("root node is forbidden and cannot be sanitized in-place")}}else if(Ke instanceof s)Be=si(""),it=Be.ownerDocument.importNode(Ke,!0),it.nodeType===1&&it.nodeName==="BODY"||it.nodeName==="HTML"?Be=it:Be.appendChild(it);else{if(!ot&&!Re&&!Ye&&Ke.indexOf("<")===-1)return w&&pt?w.createHTML(Ke):Ke;if(Be=si(Ke),!Be)return ot?null:pt?A:""}Be&&dt&&Kr(Be.firstChild);const or=Or(ye?Ke:Be);for(;un=or.nextNode();)_s(un)||(un.content instanceof a&&Nl(un.content),Si(un));if(ye)return Ke;if(ot){if(je)for(ar=N.call(Be.ownerDocument);Be.firstChild;)ar.appendChild(Be.firstChild);else ar=Be;return(pe.shadowroot||pe.shadowrootmode)&&(ar=q.call(r,ar,!0)),ar}let Zn=Ye?Be.outerHTML:Be.innerHTML;return Ye&&se["!doctype"]&&Be.ownerDocument&&Be.ownerDocument.doctype&&Be.ownerDocument.doctype.name&&Ni(eP,Be.ownerDocument.doctype.name)&&(Zn=" `+Zn),Re&&Y0([Q,$,oe],Oo=>{Zn=ud(Zn,Oo," ")}),w&&pt?w.createHTML(Zn):Zn},t.setConfig=function(){let Ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Rt(Ke),We=!0},t.clearConfig=function(){at=null,We=!1},t.isValidAttribute=function(Ke,J,Be){at||Rt({});const it=Fe(Ke),un=Fe(J);return qt(it,un,Be)},t.addHook=function(Ke,J){typeof J=="function"&&(P[Ke]=P[Ke]||[],ld(P[Ke],J))},t.removeHook=function(Ke){if(P[Ke])return SI(P[Ke])},t.removeHooks=function(Ke){P[Ke]&&(P[Ke]=[])},t.removeAllHooks=function(){P={}},t}var Y1e=tP(),Z7={};const X1e={folder:["folder","white"],"karma.conf.js":["karma","green"],"karma.conf.coffee":["karma","green"],"README.md":["info","blue"],"CHANGELOG.md":["clock","blue"],CHANGELOG:["clock","blue"],"CHANGES.md":["clock","blue"],"VERSION.md":["clock","blue"],VERSION:["clock","blue"],mvnw:["maven","red"],"tsconfig.json":["tsconfig","blue"],"swagger.json":["json","green"],"swagger.yml":["json","green"],"swagger.yaml":["json","green"],"mime.types":["config","grey-light"],Jenkinsfile:["jenkins","red"],"babel.config.js":["babel","yellow"],"babel.config.json":["babel","yellow"],"babel.config.cjs":["babel","yellow"],"bower.json":["bower","orange"],"Bower.json":["bower","orange"],"firebase.json":["firebase","orange"],geckodriver:["firefox","orange"],"Gruntfile.js":["grunt","orange"],"gruntfile.babel.js":["grunt","orange"],"Gruntfile.babel.js":["grunt","orange"],"gruntfile.js":["grunt","orange"],"Gruntfile.coffee":["grunt","orange"],"gruntfile.coffee":["grunt","orange"],"ionic.config.json":["ionic","blue"],"Ionic.config.json":["ionic","blue"],"ionic.project":["ionic","blue"],"Ionic.project":["ionic","blue"],"platformio.ini":["platformio","orange"],"rollup.config.js":["rollup","red"],"sass-lint.yml":["sass","pink"],"stylelint.config.js":["stylelint","white"],"stylelint.config.cjs":["stylelint","white"],"yarn.clean":["yarn","blue"],"yarn.lock":["yarn","blue"],"webpack.config.js":["webpack","blue"],"webpack.config.build.js":["webpack","blue"],"webpack.common.js":["webpack","blue"],"webpack.dev.js":["webpack","blue"],"webpack.prod.js":["webpack","blue"],"npm-debug.log":["npm_ignored","ignore"]},Z1e={".bsl":["bsl","red"],".mdo":["mdo","red"],".cls":["salesforce","blue"],".apex":["salesforce","blue"],".asm":["asm","red"],".s":["asm","red"],".bicep":["bicep","blue"],".c":["c","blue"],".h":["c","purple"],".m":["c","yellow"],".cs":["c-sharp","blue"],".cshtml":["html","blue"],".aspx":["html","blue"],".ascx":["html","green"],".asax":["html","yellow"],".master":["html","yellow"],".cc":["cpp","blue"],".cpp":["cpp","blue"],".cxx":["cpp","blue"],".c++":["cpp","blue"],".hh":["cpp","purple"],".hpp":["cpp","purple"],".hxx":["cpp","purple"],".h++":["cpp","purple"],".mm":["cpp","yellow"],".clj":["clojure","green"],".cljs":["clojure","green"],".cljc":["clojure","green"],".edn":["clojure","blue"],".cfc":["coldfusion","blue"],".cfm":["coldfusion","blue"],".coffee":["coffee","yellow"],".litcoffee":["coffee","yellow"],".config":["config","grey-light"],".cfg":["config","grey-light"],".conf":["config","grey-light"],".cr":["crystal","white"],".ecr":["crystal_embedded","white"],".slang":["crystal_embedded","white"],".cson":["json","yellow"],".css":["css","blue"],".css.map":["css","blue"],".sss":["css","blue"],".csv":["csv","green"],".xls":["xls","green"],".xlsx":["xls","green"],".cu":["cu","green"],".cuh":["cu","purple"],".hu":["cu","purple"],".cake":["cake","red"],".ctp":["cake_php","red"],".d":["d","red"],".doc":["word","blue"],".docx":["word","blue"],".ejs":["ejs","yellow"],".ex":["elixir","purple"],".exs":["elixir_script","purple"],".elm":["elm","blue"],".ico":["favicon","yellow"],".fs":["f-sharp","blue"],".fsx":["f-sharp","blue"],".gitignore":["git","ignore"],".gitconfig":["git","ignore"],".gitkeep":["git","ignore"],".gitattributes":["git","ignore"],".gitmodules":["git","ignore"],".go":["go2","blue"],".slide":["go","blue"],".article":["go","blue"],".gd":["godot","blue"],".godot":["godot","red"],".tres":["godot","yellow"],".tscn":["godot","purple"],".gradle":["gradle","blue"],".groovy":["grails","green"],".gsp":["grails","green"],".gql":["graphql","pink"],".graphql":["graphql","pink"],".graphqls":["graphql","pink"],".hack":["hacklang","orange"],".haml":["haml","red"],".handlebars":["mustache","orange"],".hbs":["mustache","orange"],".hjs":["mustache","orange"],".hs":["haskell","purple"],".lhs":["haskell","purple"],".hx":["haxe","orange"],".hxs":["haxe","yellow"],".hxp":["haxe","blue"],".hxml":["haxe","purple"],".html":["html","orange"],".jade":["jade","red"],".java":["java","red"],".class":["java","red"],".classpath":["java","red"],".properties":["java","red"],".js":["javascript","yellow"],".js.map":["javascript","yellow"],".spec.js":["javascript","orange"],".test.js":["javascript","orange"],".es":["javascript","yellow"],".es5":["javascript","yellow"],".es6":["javascript","yellow"],".es7":["javascript","yellow"],".jinja":["jinja","red"],".jinja2":["jinja","red"],".json":["json","yellow"],".jl":["julia","purple"],".kt":["kotlin","orange"],".kts":["kotlin","orange"],".dart":["dart","blue"],".less":["less","blue"],".liquid":["liquid","green"],".ls":["livescript","blue"],".lua":["lua","blue"],".markdown":["markdown","blue"],".md":["markdown","blue"],".argdown":["argdown","blue"],".ad":["argdown","blue"],".mustache":["mustache","orange"],".stache":["mustache","orange"],".nim":["nim","yellow"],".nims":["nim","yellow"],".github-issues":["github","white"],".ipynb":["notebook","blue"],".njk":["nunjucks","green"],".nunjucks":["nunjucks","green"],".nunjs":["nunjucks","green"],".nunj":["nunjucks","green"],".njs":["nunjucks","green"],".nj":["nunjucks","green"],".npm-debug.log":["npm","ignore"],".npmignore":["npm","red"],".npmrc":["npm","red"],".ml":["ocaml","orange"],".mli":["ocaml","orange"],".cmx":["ocaml","orange"],".cmxa":["ocaml","orange"],".odata":["odata","orange"],".pl":["perl","blue"],".php":["php","purple"],".php.inc":["php","purple"],".pipeline":["pipeline","orange"],".pddl":["pddl","purple"],".plan":["plan","green"],".happenings":["happenings","blue"],".ps1":["powershell","blue"],".psd1":["powershell","blue"],".psm1":["powershell","blue"],".prisma":["prisma","blue"],".pug":["pug","red"],".pp":["puppet","yellow"],".epp":["puppet","yellow"],".purs":["purescript","white"],".py":["python","blue"],".jsx":["react","blue"],".spec.jsx":["react","orange"],".test.jsx":["react","orange"],".cjsx":["react","blue"],".spec.tsx":["react","orange"],".test.tsx":["react","orange"],".re":["reasonml","red"],".res":["rescript","red"],".resi":["rescript","pink"],".R":["R","blue"],".rmd":["R","blue"],".rb":["ruby","red"],".erb":["html_erb","red"],".erb.html":["html_erb","red"],".html.erb":["html_erb","red"],".rs":["rust","grey-light"],".sass":["sass","pink"],".scss":["sass","pink"],".springBeans":["spring","green"],".slim":["slim","orange"],".smarty.tpl":["smarty","yellow"],".tpl":["smarty","yellow"],".sbt":["sbt","blue"],".scala":["scala","red"],".sol":["ethereum","blue"],".styl":["stylus","green"],".svelte":["svelte","red"],".swift":["swift","orange"],".sql":["db","pink"],".soql":["db","blue"],".tf":["terraform","purple"],".tf.json":["terraform","purple"],".tfvars":["terraform","purple"],".tex":["tex","blue"],".sty":["tex","yellow"],".dtx":["tex","orange"],".ins":["tex","white"],".txt":["default","white"],".toml":["config","grey-light"],".twig":["twig","green"],".ts":["typescript","blue"],".tsx":["typescript","blue"],".spec.ts":["typescript","orange"],".test.ts":["typescript","orange"],".vala":["vala","grey-light"],".vapi":["vala","grey-light"],".component":["html","orange"],".vue":["vue","green"],".wasm":["wasm","purple"],".wat":["wat","purple"],".xml":["xml","orange"],".yml":["yml","purple"],".yaml":["yml","purple"],".pro":["prolog","orange"],".jar":["zip","red"],".zip":["zip","grey-light"],".wgt":["wgt","blue"],".ai":["illustrator","yellow"],".psd":["photoshop","blue"],".pdf":["pdf","red"],".eot":["font","red"],".ttf":["font","red"],".woff":["font","red"],".woff2":["font","red"],".gif":["image","purple"],".jpg":["image","purple"],".jpeg":["image","purple"],".png":["image","purple"],".pxm":["image","purple"],".svg":["svg","purple"],".svgx":["image","purple"],".tiff":["image","purple"],".webp":["image","purple"],".sublime-project":["sublime","orange"],".sublime-workspace":["sublime","orange"],".code-search":["code-search","purple"],".sh":["shell","green"],".zsh":["shell","green"],".fish":["shell","green"],".zshrc":["shell","green"],".bashrc":["shell","green"],".mov":["video","pink"],".ogv":["video","pink"],".webm":["video","pink"],".avi":["video","pink"],".mpg":["video","pink"],".mp4":["video","pink"],".mp3":["audio","purple"],".ogg":["audio","purple"],".wav":["audio","purple"],".flac":["audio","purple"],".3ds":["svg","blue"],".3dm":["svg","blue"],".stl":["svg","blue"],".obj":["svg","blue"],".dae":["svg","blue"],".bat":["windows","blue"],".cmd":["windows","blue"],".babelrc":["babel","yellow"],".babelrc.js":["babel","yellow"],".babelrc.cjs":["babel","yellow"],".bowerrc":["bower","orange"],".codeclimate.yml":["code-climate","green"],".eslintrc":["eslint","purple"],".eslintrc.js":["eslint","purple"],".eslintrc.cjs":["eslint","purple"],".eslintrc.yaml":["eslint","purple"],".eslintrc.yml":["eslint","purple"],".eslintrc.json":["eslint","purple"],".eslintignore":["eslint","grey"],".firebaserc":["firebase","orange"],".jshintrc":["javascript","blue"],".jscsrc":["javascript","blue"],".stylelintrc":["stylelint","white"],".stylelintrc.json":["stylelint","white"],".stylelintrc.yaml":["stylelint","white"],".stylelintrc.yml":["stylelint","white"],".stylelintrc.js":["stylelint","white"],".stylelintignore":["stylelint","grey"],".direnv":["config","grey-light"],".env":["config","grey-light"],".static":["config","grey-light"],".editorconfig":["config","grey-light"],".slugignore":["config","grey-light"],".tmp":["clock","grey-light"],".htaccess":["config","grey-light"],".key":["lock","green"],".cert":["lock","green"],".cer":["lock","green"],".crt":["lock","green"],".pem":["lock","green"],".DS_Store":["ignored","ignore"]},Q1e=[["TODO",["todo","blue"]],["Procfile",["heroku","purple"]],["cmakelists.txt",["makefile","blue"]],["CMakeLists.txt",["makefile","blue"]],["CMAKELISTS.txt",["makefile","blue"]],["CMAKELISTS.TXT",["makefile","blue"]],["omakefile",["makefile","grey-light"]],["OMakefile",["makefile","grey-light"]],["OMAKEFILE",["makefile","grey-light"]],["qmakefile",["makefile","purple"]],["QMakefile",["makefile","purple"]],["QMAKEFILE",["makefile","purple"]],["makefile",["makefile","orange"]],["Makefile",["makefile","orange"]],["MAKEFILE",["makefile","orange"]],["CONTRIBUTING",["license","red"]],["COMPILING",["license","orange"]],["COPYING",["license","yellow"]],["LICENCE.md",["license","yellow"]],["LICENSE.md",["license","yellow"]],["LICENCE",["license","yellow"]],["LICENSE",["license","yellow"]],["gulpfile.js",["gulp","red"]],["gulpfile",["gulp","red"]],["Gulpfile",["gulp","red"]],["GULPFILE",["gulp","red"]],["docker-compose.override.yaml",["docker","pink"]],["docker-compose.override.yml",["docker","pink"]],["docker-compose.yaml",["docker","pink"]],["docker-compose.yml",["docker","pink"]],["docker-healthcheck",["docker","green"]],[".dockerignore",["docker","grey"]],["DOCKERFILE",["docker","blue"]],["Dockerfile",["docker","blue"]],["dockerfile",["docker","blue"]],["gemfile",["ruby","red"]],["Gemfile",["ruby","red"]],["mix",["hex","red"]]],J1e={files:X1e,extensions:Z1e,partials:Q1e,default:["default","white"]},ece='',tce='',nce='',rce='',ice='',ace='',oce='',sce='',lce='',uce='',cce='',dce='',pce='',fce='',hce='',gce='',mce='',bce='',yce='',Ece='',vce='',_ce='',Tce='',Sce='',wce='',Ace='',Cce='',kce='',xce='',Ice='',Rce='',Nce='',Oce='',Dce='',Lce='',Mce='',Fce='',Pce='',Bce='',Uce='',$ce='',zce='',Hce='',jce='',Gce='',Vce='',Wce='',qce='',Kce='',Yce='',Xce='',Zce='',Qce='',Jce='',ede='',tde='',nde='',rde='',ide='',ade='',ode='',sde='',lde='',ude='',cde='',dde='',pde='',fde='',hde='',gde='',mde='',bde='',yde='',Ede='',vde='',_de='',Tde='',Sde='',wde='',Ade='',Cde='',kde='',xde='',Ide='',Rde='',Nde='',Ode='',Dde='',Lde='',Mde='',Fde='',Pde='',Bde='',Ude='',$de='',zde='',Hde='',jde='',Gde='',Vde='',Wde='',qde='',Kde='',Yde='',Xde='',Zde='',Qde='',Jde='',epe='',tpe='',npe='',rpe='',ipe='',ape='',ope='',spe='',lpe='',upe='',cpe='',dpe='',ppe='',fpe='',hpe='',gpe='',mpe='',bpe='',ype='',Epe='',vpe='',_pe='',Tpe='',Spe='',wpe='',Ape='',Cpe='',kpe='',xpe='',Ipe='',Rpe='',Npe='',Ope='',Dpe='',Lpe='',Mpe={folder:ece,bsl:tce,mdo:nce,salesforce:rce,asm:ice,bicep:ace,c:oce,"c-sharp":'',html:sce,cpp:lce,clojure:uce,coldfusion:cce,coffee:dce,config:pce,crystal:fce,crystal_embedded:hce,json:gce,css:mce,csv:bce,xls:yce,cu:Ece,cake:vce,cake_php:_ce,d:Tce,word:Sce,ejs:wce,elixir:Ace,elixir_script:Cce,hex:kce,elm:xce,favicon:Ice,"f-sharp":'',git:Rce,go2:Nce,go:Oce,godot:Dce,gradle:Lce,grails:Mce,graphql:Fce,hacklang:Pce,haml:Bce,mustache:Uce,haskell:$ce,haxe:zce,jade:Hce,java:jce,javascript:Gce,jinja:Vce,julia:Wce,karma:qce,kotlin:Kce,dart:Yce,less:Xce,liquid:Zce,livescript:Qce,lua:Jce,markdown:ede,argdown:tde,info:nde,clock:rde,maven:ide,nim:ade,github:ode,notebook:sde,nunjucks:lde,npm:ude,ocaml:cde,odata:dde,perl:pde,php:fde,pipeline:hde,pddl:gde,plan:mde,happenings:bde,powershell:yde,prisma:Ede,pug:vde,puppet:_de,purescript:Tde,python:Sde,react:wde,reasonml:Ade,rescript:Cde,R:kde,ruby:xde,html_erb:Ide,rust:Rde,sass:Nde,spring:Ode,slim:Dde,smarty:Lde,sbt:Mde,scala:Fde,ethereum:Pde,stylus:Bde,svelte:Ude,swift:$de,db:zde,terraform:Hde,tex:jde,default:'',twig:Gde,typescript:Vde,tsconfig:Wde,vala:qde,vue:Kde,wasm:Yde,wat:Xde,xml:Zde,yml:Qde,prolog:Jde,zip:epe,wgt:tpe,illustrator:npe,photoshop:rpe,pdf:ipe,font:ape,image:ope,svg:spe,sublime:lpe,"code-search":'',shell:upe,video:cpe,audio:dpe,windows:ppe,jenkins:fpe,babel:hpe,bower:gpe,docker:mpe,"code-climate":'',eslint:bpe,firebase:ype,firefox:Epe,grunt:vpe,gulp:_pe,ionic:Tpe,platformio:Spe,rollup:wpe,stylelint:Ape,yarn:Cpe,webpack:kpe,lock:xpe,license:Ipe,makefile:Rpe,heroku:Npe,todo:Ope,npm_ignored:Dpe,ignored:Lpe};var Hg=Jl&&Jl.__assign||function(){return Hg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1)return i[1]}return i1.default},nP=function(e){var t=Upe(e),n=t[0],r=t[1];return{svg:Bpe[n],color:r}};Z7.getIcon=nP;var $pe=function(e){return function(t){var n=nP(t);return Hg(Hg({},n),{color:e[n.color]})}},zpe=Z7.themeIcons=$pe;const Ey=({filename:e,height:t,width:n})=>{const r=zpe({blue:"#268bd2",grey:"#657b83","grey-light":"#839496",green:"#859900",orange:"#cb4b16",pink:"#d33682",purple:"#6c71c4",red:"#dc322f",white:"#fdf6e3",yellow:"#b58900",ignore:"#586e75"}),{svg:i,color:a}=r(e),o=Y1e.sanitize(i);return I.jsx("div",{dangerouslySetInnerHTML:{__html:o},style:{width:n,height:t,fill:a}})};var Q7={};Object.defineProperty(Q7,"__esModule",{value:!0});Q7.testFunc=void 0;var Hpe=function(){console.log("test")};Q7.testFunc=Hpe;function jpe(e,t){var n;if(typeof vscode>"u"){if(localStorage.getItem("ide"),window.postIntellijMessage===void 0)throw console.log("Unable to send message: postIntellijMessage is undefined. ",e,t),new Error("postIntellijMessage is undefined");(n=window.postIntellijMessage)==null||n.call(window,e,t);return}vscode.postMessage({type:e,...t})}function qa(e,t,n=0){try{jpe(e,t)}catch(r){n<5?(console.log(`Attempt ${n} failed. Retrying...`),setTimeout(()=>qa(e,t,n+1),Math.pow(2,n)*1e3)):console.error("Max attempts reached. Message could not be sent.",r)}}var rP={exports:{}},iP={};/** * @license React * use-sync-external-store-shim.production.min.js @@ -606,11 +606,11 @@ Hint: It might not be working because maybe you're not up to date with the Meili ${({isLastItem:e})=>e&&"border-bottom: 1px solid gray;"} cursor: pointer; z-index: 500; -`,QI=st.forwardRef((e,t)=>{var Te,Le,ze,Ye,jt,ue,Ee,qe;const n=zt(j=>j.serverState.meilisearchUrl||"http://127.0.0.1:7700"),[r,i]=C.useState(void 0);C.useEffect(()=>{const j=new G0e({host:n});i(j)},[n]);const a=C.useContext(to),o=eo(),s=zt(j=>j.config.workspacePaths);zt(j=>j.sessionState.history);const[u,c]=st.useState([]),[p,f]=st.useState(0),[m,g]=st.useState([]),b=st.useRef(null);C.useEffect(()=>{b.current&&(b.current.style.height="auto",b.current.style.height=Math.min(b.current.scrollHeight,300)+"px")},[(Te=b.current)==null?void 0:Te.scrollHeight,(Le=b.current)==null?void 0:Le.clientHeight,(ze=b.current)==null?void 0:ze.value]);const[y,T]=C.useState(!1),[E,v]=C.useState(void 0),[w,A]=C.useState(void 0),R=zt(j=>{var me;return((me=j.serverState.slashCommands)==null?void 0:me.map(Ve=>({name:`/${Ve.name}`,description:Ve.description})))||[]}),k=zt(j=>typeof e.index<"u"?j.sessionState.contextItemsAtIndex[e.index]||[]:j.sessionState.context_items||[]),N=zt(j=>j.sessionState.history),B=zt(j=>j.sessionState.active);C.useEffect(()=>{y||(v(void 0),A(void 0))},[y]);const q=zt(j=>j.serverState.contextProviders),P=()=>{T(!1),v(void 0),A(void 0),H.setInputValue("@")};C.useEffect(()=>{E||g((q==null?void 0:q.map(j=>({name:j.display_title,description:j.description,id:j.title})).sort((j,me)=>j.id==="file"?-1:1))||[])},[E]);const[Q,$]=C.useState(""),oe=C.useCallback(async(j,me)=>{const Ve=await(a==null?void 0:a.getContextItem(j,me));e.isMainInput?o(TP(Ve)):typeof e.index<"u"&&o(SP({item:Ve,index:e.index}))},[a,e.index]),fe=C.useCallback(({inputValue:j,highlightedIndex:me})=>{var Ve;if(!j){g([]),v(void 0),T(!1);return}if(Q===""&&(q!=null&&q.some(ge=>ge.display_title===j))){H.setInputValue(""),$("");return}if($(j),w&&!j.startsWith(`@${w.title}`)&&A(void 0),(Ve=e.onInputValueChange)==null||Ve.call(e,j),j.endsWith("@")||y){const ge=(j==null?void 0:j.split("@"))||[];if(ge.length>1){T(!0);const G=ge[ge.length-1]||"";if(E&&!j.endsWith("@")){const K=G.split(" ");ce(E.title,K.length>1?K[1]:"").then(ne=>{g(ne)})}else{const K=(q==null?void 0:q.filter(ne=>`@${ne.title}`.toLowerCase().startsWith(j.toLowerCase())||`@${ne.display_title}`.toLowerCase().startsWith(j.toLowerCase())).map(ne=>({name:ne.display_title,description:ne.description,id:ne.title})).sort((ne,ve)=>ne.id==="file"?-1:1))||[];g(K),T(!0)}return}else T(!1),v(void 0)}v(void 0),g((R==null?void 0:R.filter(ge=>{const G=ge.name.toLowerCase(),K=j.toLowerCase();return G.startsWith(K)&&G!==K}))||[]),(j.startsWith("/")||j.startsWith("@"))&&o(Ad(null))},[R,y,E,w]),ce=async(j,me)=>{const Ve=s&&s.length>0?`workspace_dir IN [ ${s.map(ge=>`"${ge}"`).join(", ")} ] AND provider_name = '${j}'`:void 0;try{const ge=await(r==null?void 0:r.index(J0e).search(me,{filter:Ve}));return(ge==null?void 0:ge.hits.map(G=>({name:G.name,description:G.description,id:G.id,content:G.content})))||[]}catch(ge){return console.log("Error searching context items",ge),[]}},{getInputProps:De,...H}=YF({onInputValueChange:fe,items:m,itemToString(j){return j?j.name:""}});C.useEffect(()=>{H.highlightedIndex<0&&H.setHighlightedIndex(0)},[H.inputValue]);const W=st.useRef(null),se=st.useRef(null),D=()=>{var j;return(((j=W.current)==null?void 0:j.getBoundingClientRect().top)||Number.MAX_SAFE_INTEGER)>RP};C.useImperativeHandle(t,()=>H,[H]);const pe=st.useRef(null),le=C.useCallback(()=>{var ge;if(ye(!0),!pe.current)return;const j=pe.current.querySelectorAll(`.pill-button-${e.index||"main"}`),me=Array.from(j),Ve=me.findIndex(G=>G===document.activeElement);if(Ve===me.length-1)(ge=b.current)==null||ge.focus();else if(Ve!==-1){const G=me[(Ve+1)%me.length];G==null||G.focus()}else{const G=me[0];G==null||G.focus()}},[e.index]);C.useEffect(()=>{if(b.current){const j=me=>{me.key==="Tab"&&(me.preventDefault(),le())};return b.current.addEventListener("keydown",j),()=>{var me;(me=b.current)==null||me.removeEventListener("keydown",j)}}},[b.current]),C.useEffect(()=>{e.value&&H.setInputValue(e.value)},[e.value,H.setInputValue]);const[L,ie]=C.useState(!1);C.useLayoutEffect(()=>{se.current&&H.setHighlightedIndex(0)},[m,H.setHighlightedIndex,se.current]);const[Se,X]=C.useState(!1),[ke,te]=C.useState(!1);C.useEffect(()=>{const j=Ve=>{Ve.key==="Meta"&&X(!0)},me=Ve=>{Ve.key==="Meta"&&X(!1)};return window.addEventListener("keydown",j),window.addEventListener("keyup",me),()=>{window.removeEventListener("keydown",j),window.removeEventListener("keyup",me)}},[]),C.useEffect(()=>{if(!b.current||!e.isMainInput)return;e.isMainInput&&b.current.focus();const j=me=>{var Ve;me.data.type==="focusContinueInput"?(b.current.focus(),o(Ad(null))):me.data.type==="focusContinueInputWithEdit"?(b.current.focus(),(Ve=b.current)!=null&&Ve.value.startsWith("/edit")||H.setInputValue("/edit "),o(Ad(null))):me.data.type==="focusContinueInputWithNewSession"&&(a==null||a.stopSession(),o(uc()),o(Ad(null)))};return window.addEventListener("message",j),()=>{window.removeEventListener("message",j)}},[b.current,e.isMainInput]);const Me=st.useRef(null),Re=C.useCallback(j=>{const me=m[H.highlightedIndex],Ve=me==null?void 0:me.name,ge=q.find(G=>G.display_title===Ve);if(ge){if(ge.dynamic&&ge.requires_query){A(ge),H.setInputValue(`@${ge.title} `),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}else if(ge.dynamic){if(!me.id)return;const G=H.inputValue.split("@"),K=G[G.length-1];if(oe(me.id,K),H.inputValue.includes("@")){const ne=q.find(ve=>ve.title===me.id);!E&&!(ne!=null&&ne.dynamic)?(H.setInputValue(`@${me.id} `),v(ne)):H.setInputValue("")}H.setInputValue(""),T(!1),v(void 0),A(void 0),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}}else{if(E&&me.id){oe(me.id,""),H.setInputValue(""),T(!1),v(void 0),A(void 0),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}v(ge),H.setInputValue(`@${ge.title} `),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault(),ce(ge.title,"").then(G=>g(G))},[m,H.highlightedIndex,q,E,H.inputValue,oe]),[Ze,We]=C.useState(!1),[dt,ot]=C.useState(!1),[je,pt]=C.useState(void 0),[U,re]=C.useState(void 0),de=st.useRef(null),[xe,ye]=C.useState(!1);return C.useEffect(()=>{ke||ye(!1)},[ke]),I.jsxs("div",{ref:de,style:{paddingTop:"4px",backgroundColor:Ht},children:[k.length===0&&e.isMainInput&&I.jsxs("div",{style:{color:Et,fontSize:"10px",backgroundColor:Ht,paddingLeft:"12px",paddingTop:pr(),width:"calc(100% - 24px)"},children:[I.jsx("span",{onClick:()=>{var j;H.setInputValue("@"),(j=b.current)==null||j.focus()},className:"hover:underline cursor-pointer",children:"+ Add Context"}),(((Ye=H.inputValue)==null?void 0:Ye.startsWith("/edit"))||ke&&Se&&((jt=H.inputValue)==null?void 0:jt.length)>0)&&I.jsx("span",{className:"float-right",children:"Inserting at cursor"})]}),e.isMainInput||k.length>0&&xe?I.jsxs("div",{className:"px-2 flex gap-2 items-center flex-wrap",ref:pe,style:{backgroundColor:Ht},children:[k.length>0&&I.jsx("div",{className:"cursor-pointer",onClick:j=>{ot(me=>!me)},id:"toggle-context-div",children:dt?I.jsx(gZ,{width:"14px",height:"14px",color:Et}):I.jsx(yZ,{width:"14px",height:"14px",color:Et})}),I.jsx(nhe,{className:k.length>0?`pill-button-${e.index||"main"}`:"",onClick:()=>{var j;o(w4({ids:k.map(me=>me.description.id),index:e.index})),(j=b.current)==null||j.focus(),pt(void 0),re(void 0)},onKeyDown:j=>{var me;j.key==="Backspace"&&(o(w4({ids:k.map(Ve=>Ve.description.id),index:e.index})),(me=b.current)==null||me.focus(),pt(void 0),re(void 0))},children:I.jsx(kL,{width:"1.4em",height:"1.4em"})}),k.map((j,me)=>{var Ve,ge,G,K;return I.jsx(A0e,{inputIndex:e.index,areMultipleItems:k.length>1,item:j,editing:j.editing&&((ge=(Ve=b.current)==null?void 0:Ve.value)==null?void 0:ge.startsWith("/edit")),editingAny:(K=(G=b.current)==null?void 0:G.value)==null?void 0:K.startsWith("/edit"),stepIndex:e.index,index:me,onDelete:()=>{var ne;o(w4({ids:[j.description.id],index:e.index})),(ne=b.current)==null||ne.focus(),(j.description.id.item_id===(U==null?void 0:U.description.id.item_id)&&(U==null?void 0:U.description.id.provider_name)===j.description.id.provider_name||j.description.id.item_id===(je==null?void 0:je.description.id.item_id)&&(je==null?void 0:je.description.id.provider_name)===j.description.id.provider_name)&&(pt(void 0),re(void 0))},onClick:ne=>{j.description.id.item_id===(U==null?void 0:U.description.id.item_id)&&(U==null?void 0:U.description.id.provider_name)===j.description.id.provider_name?re(void 0):re(j)},onBlur:()=>{re(void 0)},toggleViewContent:()=>{pt(ne=>{if(!ne)return j;if(!(ne.description.id.item_id===j.description.id.item_id&&ne.description.id.provider_name===j.description.id.provider_name))return j})},previewing:j.description.id.item_id===(je==null?void 0:je.description.id.item_id)&&(je==null?void 0:je.description.id.provider_name)===j.description.id.provider_name,focusing:j.description.id.item_id===(U==null?void 0:U.description.id.item_id)&&(U==null?void 0:U.description.id.provider_name)===j.description.id.provider_name,prefixInputWithEdit:ne=>{var ve,Qe,Fe;!ne&&((ve=b.current)!=null&&ve.value.startsWith("/edit"))&&H.setInputValue((Qe=b.current)==null?void 0:Qe.value.replace("/edit ","")),!H.inputValue.startsWith("/edit")&&(H.setInputValue(`/edit ${H.inputValue}`),(Fe=b.current)==null||Fe.focus())}},`${j.description.id.item_id}${me}`)})]}):k.length>0&&I.jsxs("div",{onClick:()=>{var j;(j=b.current)==null||j.focus(),ye(!0)},style:{color:Et,fontSize:"10px",backgroundColor:Ht,paddingLeft:"12px",cursor:"default",paddingTop:pr(),width:"fit-content"},children:[e.active?"Using":"Used"," ",k.length," ","context item",k.length===1?"":"s"]}),je&&I.jsx("pre",{className:"m-0",children:I.jsx(Ug,{source:`\`\`\`${WC(je.description.description)} +`,QI=st.forwardRef((e,t)=>{var Te,Le,ze,Xe,jt,ue,Ee,qe;const n=zt(j=>j.serverState.meilisearchUrl||"http://127.0.0.1:7700"),[r,i]=C.useState(void 0);C.useEffect(()=>{const j=new G0e({host:n});i(j)},[n]);const a=C.useContext(to),o=eo(),s=zt(j=>j.config.workspacePaths);zt(j=>j.sessionState.history);const[u,c]=st.useState([]),[p,f]=st.useState(0),[m,g]=st.useState([]),b=st.useRef(null);C.useEffect(()=>{b.current&&(b.current.style.height="auto",b.current.style.height=Math.min(b.current.scrollHeight,300)+"px")},[(Te=b.current)==null?void 0:Te.scrollHeight,(Le=b.current)==null?void 0:Le.clientHeight,(ze=b.current)==null?void 0:ze.value]);const[y,T]=C.useState(!1),[E,v]=C.useState(void 0),[w,A]=C.useState(void 0),R=zt(j=>{var me;return((me=j.serverState.slashCommands)==null?void 0:me.map(Ve=>({name:`/${Ve.name}`,description:Ve.description})))||[]}),k=zt(j=>typeof e.index<"u"?j.sessionState.contextItemsAtIndex[e.index]||[]:j.sessionState.context_items||[]),N=zt(j=>j.sessionState.history),B=zt(j=>j.sessionState.active);C.useEffect(()=>{y||(v(void 0),A(void 0))},[y]);const q=zt(j=>j.serverState.contextProviders),P=()=>{T(!1),v(void 0),A(void 0),H.setInputValue("@")};C.useEffect(()=>{E||g((q==null?void 0:q.map(j=>({name:j.display_title,description:j.description,id:j.title})).sort((j,me)=>j.id==="file"?-1:1))||[])},[E]);const[Q,$]=C.useState(""),oe=C.useCallback(async(j,me)=>{const Ve=await(a==null?void 0:a.getContextItem(j,me));e.isMainInput?o(TP(Ve)):typeof e.index<"u"&&o(SP({item:Ve,index:e.index}))},[a,e.index]),fe=C.useCallback(({inputValue:j,highlightedIndex:me})=>{var Ve;if(!j){g([]),v(void 0),T(!1);return}if(Q===""&&(q!=null&&q.some(ge=>ge.display_title===j))){H.setInputValue(""),$("");return}if($(j),w&&!j.startsWith(`@${w.title}`)&&A(void 0),(Ve=e.onInputValueChange)==null||Ve.call(e,j),j.endsWith("@")||y){const ge=(j==null?void 0:j.split("@"))||[];if(ge.length>1){T(!0);const G=ge[ge.length-1]||"";if(E&&!j.endsWith("@")){const K=G.split(" ");ce(E.title,K.length>1?K[1]:"").then(ne=>{g(ne)})}else{const K=(q==null?void 0:q.filter(ne=>`@${ne.title}`.toLowerCase().startsWith(j.toLowerCase())||`@${ne.display_title}`.toLowerCase().startsWith(j.toLowerCase())).map(ne=>({name:ne.display_title,description:ne.description,id:ne.title})).sort((ne,ve)=>ne.id==="file"?-1:1))||[];g(K),T(!0)}return}else T(!1),v(void 0)}v(void 0),g((R==null?void 0:R.filter(ge=>{const G=ge.name.toLowerCase(),K=j.toLowerCase();return G.startsWith(K)&&G!==K}))||[]),(j.startsWith("/")||j.startsWith("@"))&&o(Ad(null))},[R,y,E,w]),ce=async(j,me)=>{const Ve=s&&s.length>0?`workspace_dir IN [ ${s.map(ge=>`"${ge}"`).join(", ")} ] AND provider_name = '${j}'`:void 0;try{const ge=await(r==null?void 0:r.index(J0e).search(me,{filter:Ve}));return(ge==null?void 0:ge.hits.map(G=>({name:G.name,description:G.description,id:G.id,content:G.content})))||[]}catch(ge){return console.log("Error searching context items",ge),[]}},{getInputProps:De,...H}=YF({onInputValueChange:fe,items:m,itemToString(j){return j?j.name:""}});C.useEffect(()=>{H.highlightedIndex<0&&H.setHighlightedIndex(0)},[H.inputValue]);const W=st.useRef(null),se=st.useRef(null),D=()=>{var j;return(((j=W.current)==null?void 0:j.getBoundingClientRect().top)||Number.MAX_SAFE_INTEGER)>RP};C.useImperativeHandle(t,()=>H,[H]);const pe=st.useRef(null),le=C.useCallback(()=>{var ge;if(ye(!0),!pe.current)return;const j=pe.current.querySelectorAll(`.pill-button-${e.index||"main"}`),me=Array.from(j),Ve=me.findIndex(G=>G===document.activeElement);if(Ve===me.length-1)(ge=b.current)==null||ge.focus();else if(Ve!==-1){const G=me[(Ve+1)%me.length];G==null||G.focus()}else{const G=me[0];G==null||G.focus()}},[e.index]);C.useEffect(()=>{if(b.current){const j=me=>{me.key==="Tab"&&(me.preventDefault(),le())};return b.current.addEventListener("keydown",j),()=>{var me;(me=b.current)==null||me.removeEventListener("keydown",j)}}},[b.current]),C.useEffect(()=>{e.value&&H.setInputValue(e.value)},[e.value,H.setInputValue]);const[L,ie]=C.useState(!1);C.useLayoutEffect(()=>{se.current&&H.setHighlightedIndex(0)},[m,H.setHighlightedIndex,se.current]);const[Se,X]=C.useState(!1),[ke,te]=C.useState(!1);C.useEffect(()=>{const j=Ve=>{Ve.key==="Meta"&&X(!0)},me=Ve=>{Ve.key==="Meta"&&X(!1)};return window.addEventListener("keydown",j),window.addEventListener("keyup",me),()=>{window.removeEventListener("keydown",j),window.removeEventListener("keyup",me)}},[]),C.useEffect(()=>{if(!b.current||!e.isMainInput)return;e.isMainInput&&b.current.focus();const j=me=>{var Ve;me.data.type==="focusContinueInput"?(b.current.focus(),o(Ad(null))):me.data.type==="focusContinueInputWithEdit"?(b.current.focus(),(Ve=b.current)!=null&&Ve.value.startsWith("/edit")||H.setInputValue("/edit "),o(Ad(null))):me.data.type==="focusContinueInputWithNewSession"&&(a==null||a.stopSession(),o(uc()),o(Ad(null)))};return window.addEventListener("message",j),()=>{window.removeEventListener("message",j)}},[b.current,e.isMainInput]);const Me=st.useRef(null),Re=C.useCallback(j=>{const me=m[H.highlightedIndex],Ve=me==null?void 0:me.name,ge=q.find(G=>G.display_title===Ve);if(ge){if(ge.dynamic&&ge.requires_query){A(ge),H.setInputValue(`@${ge.title} `),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}else if(ge.dynamic){if(!me.id)return;const G=H.inputValue.split("@"),K=G[G.length-1];if(oe(me.id,K),H.inputValue.includes("@")){const ne=q.find(ve=>ve.title===me.id);!E&&!(ne!=null&&ne.dynamic)?(H.setInputValue(`@${me.id} `),v(ne)):H.setInputValue("")}H.setInputValue(""),T(!1),v(void 0),A(void 0),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}}else{if(E&&me.id){oe(me.id,""),H.setInputValue(""),T(!1),v(void 0),A(void 0),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}v(ge),H.setInputValue(`@${ge.title} `),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault(),ce(ge.title,"").then(G=>g(G))},[m,H.highlightedIndex,q,E,H.inputValue,oe]),[Ye,We]=C.useState(!1),[dt,ot]=C.useState(!1),[je,pt]=C.useState(void 0),[U,re]=C.useState(void 0),de=st.useRef(null),[xe,ye]=C.useState(!1);return C.useEffect(()=>{ke||ye(!1)},[ke]),I.jsxs("div",{ref:de,style:{paddingTop:"4px",backgroundColor:Ht},children:[k.length===0&&e.isMainInput&&I.jsxs("div",{style:{color:Et,fontSize:"10px",backgroundColor:Ht,paddingLeft:"12px",paddingTop:pr(),width:"calc(100% - 24px)"},children:[I.jsx("span",{onClick:()=>{var j;H.setInputValue("@"),(j=b.current)==null||j.focus()},className:"hover:underline cursor-pointer",children:"+ Add Context"}),(((Xe=H.inputValue)==null?void 0:Xe.startsWith("/edit"))||ke&&Se&&((jt=H.inputValue)==null?void 0:jt.length)>0)&&I.jsx("span",{className:"float-right",children:"Inserting at cursor"})]}),e.isMainInput||k.length>0&&xe?I.jsxs("div",{className:"px-2 flex gap-2 items-center flex-wrap",ref:pe,style:{backgroundColor:Ht},children:[k.length>0&&I.jsx("div",{className:"cursor-pointer",onClick:j=>{ot(me=>!me)},id:"toggle-context-div",children:dt?I.jsx(gZ,{width:"14px",height:"14px",color:Et}):I.jsx(yZ,{width:"14px",height:"14px",color:Et})}),I.jsx(nhe,{className:k.length>0?`pill-button-${e.index||"main"}`:"",onClick:()=>{var j;o(w4({ids:k.map(me=>me.description.id),index:e.index})),(j=b.current)==null||j.focus(),pt(void 0),re(void 0)},onKeyDown:j=>{var me;j.key==="Backspace"&&(o(w4({ids:k.map(Ve=>Ve.description.id),index:e.index})),(me=b.current)==null||me.focus(),pt(void 0),re(void 0))},children:I.jsx(kL,{width:"1.4em",height:"1.4em"})}),k.map((j,me)=>{var Ve,ge,G,K;return I.jsx(A0e,{inputIndex:e.index,areMultipleItems:k.length>1,item:j,editing:j.editing&&((ge=(Ve=b.current)==null?void 0:Ve.value)==null?void 0:ge.startsWith("/edit")),editingAny:(K=(G=b.current)==null?void 0:G.value)==null?void 0:K.startsWith("/edit"),stepIndex:e.index,index:me,onDelete:()=>{var ne;o(w4({ids:[j.description.id],index:e.index})),(ne=b.current)==null||ne.focus(),(j.description.id.item_id===(U==null?void 0:U.description.id.item_id)&&(U==null?void 0:U.description.id.provider_name)===j.description.id.provider_name||j.description.id.item_id===(je==null?void 0:je.description.id.item_id)&&(je==null?void 0:je.description.id.provider_name)===j.description.id.provider_name)&&(pt(void 0),re(void 0))},onClick:ne=>{j.description.id.item_id===(U==null?void 0:U.description.id.item_id)&&(U==null?void 0:U.description.id.provider_name)===j.description.id.provider_name?re(void 0):re(j)},onBlur:()=>{re(void 0)},toggleViewContent:()=>{pt(ne=>{if(!ne)return j;if(!(ne.description.id.item_id===j.description.id.item_id&&ne.description.id.provider_name===j.description.id.provider_name))return j})},previewing:j.description.id.item_id===(je==null?void 0:je.description.id.item_id)&&(je==null?void 0:je.description.id.provider_name)===j.description.id.provider_name,focusing:j.description.id.item_id===(U==null?void 0:U.description.id.item_id)&&(U==null?void 0:U.description.id.provider_name)===j.description.id.provider_name,prefixInputWithEdit:ne=>{var ve,Qe,Fe;!ne&&((ve=b.current)!=null&&ve.value.startsWith("/edit"))&&H.setInputValue((Qe=b.current)==null?void 0:Qe.value.replace("/edit ","")),!H.inputValue.startsWith("/edit")&&(H.setInputValue(`/edit ${H.inputValue}`),(Fe=b.current)==null||Fe.focus())}},`${j.description.id.item_id}${me}`)})]}):k.length>0&&I.jsxs("div",{onClick:()=>{var j;(j=b.current)==null||j.focus(),ye(!0)},style:{color:Et,fontSize:"10px",backgroundColor:Ht,paddingLeft:"12px",cursor:"default",paddingTop:pr(),width:"fit-content"},children:[e.active?"Using":"Used"," ",k.length," ","context item",k.length===1?"":"s"]}),je&&I.jsx("pre",{className:"m-0",children:I.jsx(Ug,{source:`\`\`\`${WC(je.description.description)} ${je.content} \`\`\``,maxHeight:200})}),dt&&I.jsx("div",{children:k.map(j=>I.jsxs(rhe,{children:[I.jsxs(ihe,{children:[I.jsx(Ey,{height:"20px",width:"20px",filename:j.description.name}),j.description.name]}),I.jsx("pre",{className:"m-0",children:I.jsx(Ug,{source:`\`\`\`${WC(j.description.description)} ${j.content} -\`\`\``,maxHeight:200})})]}))}),I.jsxs("div",{className:"flex px-2 relative",style:{backgroundColor:Ht},ref:W,children:[I.jsxs(the,{loading:e.active||!1,isFirst:!1,isLast:!1,borderColor:e.active?void 0:Ht,borderRadius:It,children:[I.jsx(ahe,{onClick:()=>{var j;(j=b.current)==null||j.focus()},onMouseEnter:()=>ie(!0),onMouseLeave:j=>{var me;j.relatedTarget===Me.current||j.relatedTarget instanceof Node&&((me=Me.current)!=null&&me.contains(j.relatedTarget))||ie(!1)},rows:e.isMainInput?void 0:1,inQueryForDynamicProvider:typeof w<"u",fontSize:pr(),disabled:e.disabled,placeholder:"Ask a question, '/' for slash commands, '@' to add context",...De({onCompositionStart:()=>We(!0),onCompositionEnd:()=>We(!1),onChange:j=>{},onFocus:j=>{te(!0),o(pu(void 0))},onBlur:j=>{var me,Ve;(me=de.current)!=null&&me.contains(j.relatedTarget)||(Ve=document.getElementById("toggle-context-div"))!=null&&Ve.contains(j.relatedTarget)||te(!1)},onKeyDown:j=>{var me,Ve;if(o(pu(void 0)),j.key==="Enter"&&j.shiftKey)j.nativeEvent.preventDownshiftDefault=!0,T(!1);else if(j.key==="Enter"&&(!H.isOpen||m.length===0)&&!Ze){const ge=H.inputValue;if(w){const G=ge.split("@");oe(w.title,G[G.length-1]),T(!1),H.setInputValue("");return}else ge!==""&&(f(u.length+1),c([...u,ge])),j.nativeEvent.preventDownshiftDefault=!0,e.onEnter&&e.onEnter(j,ge);T(!1)}else if(j.key==="Enter"&&y)Re(j);else if(j.key==="Tab"&&H.isOpen&&m.length>0&&((me=m[H.highlightedIndex])!=null&&me.name.startsWith("/")))H.setInputValue(m[0].name),j.preventDefault();else if(j.key==="Tab")j.nativeEvent.preventDownshiftDefault=!0;else{if((j.key==="ArrowUp"||j.key==="ArrowDown")&&m.length>0)return;if(j.key==="ArrowUp"){if(p==0||j.currentTarget.selectionStart!==0){j.nativeEvent.preventDownshiftDefault=!0;return}else p==u.length&&(u.length===0||u[u.length-1]!==j.currentTarget.value)&&c([...u,j.currentTarget.value]);H.setInputValue(u[p-1]),f(ge=>ge-1),T(!1)}else if(j.key==="ArrowDown"){if(p===u.length||j.currentTarget.selectionStart!==j.currentTarget.value.length){j.nativeEvent.preventDownshiftDefault=!0;return}pMath.min(ge+1,u.length)),T(!1)}else if(j.key==="Escape"){if(E){P(),j.nativeEvent.preventDownshiftDefault=!0;return}else if(w){P(),j.nativeEvent.preventDownshiftDefault=!0;return}T(!1),H.isOpen&&m.length>0?(H.closeMenu(),j.nativeEvent.preventDownshiftDefault=!0):(j.nativeEvent.preventDownshiftDefault=!0,(Ve=b.current)==null||Ve.blur(),qa("focusEditor",{}))}else j.key==="Home"||j.key==="End"?j.nativeEvent.preventDownshiftDefault=!0:localStorage.getItem("ide")==="jetbrains"&&(Km()==="mac"?Z0e(j,H.inputValue,H.setInputValue):Q0e(j,H.inputValue,H.setInputValue))}},onClick:()=>{o(pu(void 0))},ref:b})}),e.isMainInput||I.jsx(ohe,{ref:Me,children:L&&I.jsx("div",{className:"flex",children:I.jsxs(I.Fragment,{children:[N.filter((j,me)=>{var Ve;return((Ve=e.groupIndices)==null?void 0:Ve.includes(me))&&j.logs}).some(j=>j.logs.length>0)&&I.jsx(zi,{onClick:j=>{if(j.stopPropagation(),e.groupIndices){const me=`This is the exact prompt sent to the LLM: +\`\`\``,maxHeight:200})})]}))}),I.jsxs("div",{className:"flex px-2 relative",style:{backgroundColor:Ht},ref:W,children:[I.jsxs(the,{loading:e.active||!1,isFirst:!1,isLast:!1,borderColor:e.active?void 0:Ht,borderRadius:It,children:[I.jsx(ahe,{onClick:()=>{var j;(j=b.current)==null||j.focus()},onMouseEnter:()=>ie(!0),onMouseLeave:j=>{var me;j.relatedTarget===Me.current||j.relatedTarget instanceof Node&&((me=Me.current)!=null&&me.contains(j.relatedTarget))||ie(!1)},rows:e.isMainInput?void 0:1,inQueryForDynamicProvider:typeof w<"u",fontSize:pr(),disabled:e.disabled,placeholder:"Ask a question, '/' for slash commands, '@' to add context",...De({onCompositionStart:()=>We(!0),onCompositionEnd:()=>We(!1),onChange:j=>{},onFocus:j=>{te(!0),o(pu(void 0))},onBlur:j=>{var me,Ve;(me=de.current)!=null&&me.contains(j.relatedTarget)||(Ve=document.getElementById("toggle-context-div"))!=null&&Ve.contains(j.relatedTarget)||te(!1)},onKeyDown:j=>{var me,Ve;if(!Ye)if(o(pu(void 0)),j.key==="Enter"&&j.shiftKey)j.nativeEvent.preventDownshiftDefault=!0,T(!1);else if(j.key==="Enter"&&(!H.isOpen||m.length===0)&&!Ye){const ge=H.inputValue;if(w){const G=ge.split("@");oe(w.title,G[G.length-1]),T(!1),H.setInputValue("");return}else ge!==""&&(f(u.length+1),c([...u,ge])),j.nativeEvent.preventDownshiftDefault=!0,e.onEnter&&e.onEnter(j,ge);T(!1)}else if(j.key==="Enter"&&y)Re(j);else if(j.key==="Tab"&&H.isOpen&&m.length>0&&((me=m[H.highlightedIndex])!=null&&me.name.startsWith("/")))H.setInputValue(m[0].name),j.preventDefault();else if(j.key==="Tab")j.nativeEvent.preventDownshiftDefault=!0;else{if((j.key==="ArrowUp"||j.key==="ArrowDown")&&m.length>0)return;if(j.key==="ArrowUp"){if(p==0||j.currentTarget.selectionStart!==0){j.nativeEvent.preventDownshiftDefault=!0;return}else p==u.length&&(u.length===0||u[u.length-1]!==j.currentTarget.value)&&c([...u,j.currentTarget.value]);H.setInputValue(u[p-1]),f(ge=>ge-1),T(!1)}else if(j.key==="ArrowDown"){if(p===u.length||j.currentTarget.selectionStart!==j.currentTarget.value.length){j.nativeEvent.preventDownshiftDefault=!0;return}pMath.min(ge+1,u.length)),T(!1)}else if(j.key==="Escape"){if(E){P(),j.nativeEvent.preventDownshiftDefault=!0;return}else if(w){P(),j.nativeEvent.preventDownshiftDefault=!0;return}T(!1),H.isOpen&&m.length>0?(H.closeMenu(),j.nativeEvent.preventDownshiftDefault=!0):(j.nativeEvent.preventDownshiftDefault=!0,(Ve=b.current)==null||Ve.blur(),qa("focusEditor",{}))}else j.key==="Home"||j.key==="End"?j.nativeEvent.preventDownshiftDefault=!0:localStorage.getItem("ide")==="jetbrains"&&(Km()==="mac"?Z0e(j,H.inputValue,H.setInputValue):Q0e(j,H.inputValue,H.setInputValue))}},onClick:()=>{o(pu(void 0))},ref:b})}),e.isMainInput||I.jsx(ohe,{ref:Me,children:L&&I.jsx("div",{className:"flex",children:I.jsxs(I.Fragment,{children:[N.filter((j,me)=>{var Ve;return((Ve=e.groupIndices)==null?void 0:Ve.includes(me))&&j.logs}).some(j=>j.logs.length>0)&&I.jsx(zi,{onClick:j=>{if(j.stopPropagation(),e.groupIndices){const me=`This is the exact prompt sent to the LLM: `+N.filter((Ve,ge)=>{var G;return(G=e.groupIndices)==null?void 0:G.includes(ge)}).flatMap(Ve=>Ve.logs||[]).join(` `);qa("showVirtualFile",{name:"inspect_prompt.md",content:me})}},text:"Inspect Prompt",children:I.jsx(iZ,{width:"1.3em",height:"1.3em"})}),I.jsx(zi,{onClick:j=>{var me;j.stopPropagation(),e.active&&e.groupIndices?a==null||a.stopSession():(me=e.onDelete)==null||me.call(e)},text:e.active?`Stop (${zX()}⌫)`:"Delete",children:e.active?null:I.jsx(w9,{width:"1.4em",height:"1.4em"})})]})})})]}),w&&I.jsxs(she,{children:["Enter ",w.display_title," Query"]}),I.jsxs(lhe,{...H.getMenuProps({ref:se}),isMainInput:e.isMainInput,showAbove:D(),ulHeightPixels:((ue=se.current)==null?void 0:ue.getBoundingClientRect().height)||0,hidden:!H.isOpen||m.length===0||((Ee=b.current)==null?void 0:Ee.value)==="",fontSize:pr(),children:[E&&I.jsxs("div",{style:{backgroundColor:Vt,borderBottom:`0.5px solid ${Et}`,display:"flex",gap:"4px",position:"sticky",top:"0px"},className:"py-2 px-4 my-0",children:[I.jsx(mc,{width:"1.4em",height:"1.4em",className:"cursor-pointer",onClick:j=>{var me;P(),(me=b.current)==null||me.focus()}}),E.display_title," -"," ",E.description]}),H.isOpen&&m.map((j,me)=>I.jsxs(ZI,{style:{borderTop:me===0?"none":`0.5px solid ${Et}`},...H.getItemProps({item:j,index:me}),highlighted:H.highlightedIndex===me,selected:H.selectedItem===j,onClick:Ve=>{var ge;Re(Ve),Ve.stopPropagation(),Ve.preventDefault(),(ge=b.current)==null||ge.focus()},children:[I.jsxs("span",{className:"flex justify-between w-full items-center",children:[I.jsxs("div",{className:"flex items-center justify-center",children:[E&&I.jsx(Ey,{height:"20px",width:"20px",filename:j.name}),j.name," "]}),I.jsx("span",{style:{color:Et,float:"right",textAlign:"right"},children:j.description})]}),(q==null?void 0:q.filter(Ve=>!Ve.dynamic||Ve.requires_query).find(Ve=>Ve.title===j.id))&&I.jsx(tZ,{width:"1.2em",height:"1.2em",color:Et,className:"ml-2 flex-shrink-0"})]},`${j.name}${me}`)),H.isOpen&&m.length===0&&I.jsx(ZI,{highlighted:!1,selected:!1,isLastItem:!1,children:I.jsx("span",{style:{color:Et,float:"right",textAlign:"right",display:"flex",width:"100%",cursor:"default"},children:"No items found"})},"empty-items-li")]})]}),e.isMainInput&&I.jsx(xP,{disabled:!B&&(!((qe=b.current)!=null&&qe.value)||typeof a>"u"),onClick:()=>{var j;B?(a==null||a.stopSession(),o(Zd(!1))):(j=e.onEnter)==null||j.call(e,void 0)},showStop:B})]})});function JI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vt(e){for(var t=1;t=0||(p[u]=o[u]);return p}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function che(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(e)}function OP(e){var t=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=Xg(e);if(t){var i=Xg(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return che(this,n)}}function Co(e,t){return function(n){if(Array.isArray(n))return n}(e)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var a,o,s=[],u=!0,c=!1;try{for(i=i.call(n);!(u=(a=i.next()).done)&&(s.push(a.value),!r||s.length!==r);u=!0);}catch(p){c=!0,o=p}finally{try{u||i.return==null||i.return()}finally{if(c)throw o}}return s}}(e,t)||lT(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. @@ -626,7 +626,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * from https://github.com/LiosK/uuidv7/blob/e501462ea3d23241de13192ceae726956f9b3b7d/src/index.ts */Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e});var tR="0123456789abcdef",dhe=function(){function e(t){if(Un(this,e),this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}return $n(e,[{key:"toString",value:function(){for(var t="",n=0;n>>4)+tR.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(t){return this.compareTo(t)===0}},{key:"compareTo",value:function(t){for(var n=0;n<16;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var a=new Uint8Array(16);return a[0]=t/Math.pow(2,40),a[1]=t/Math.pow(2,32),a[2]=t/Math.pow(2,24),a[3]=t/Math.pow(2,16),a[4]=t/Math.pow(2,8),a[5]=t,a[6]=112|n>>>8,a[7]=n,a[8]=128|r>>>24,a[9]=r>>>16,a[10]=r>>>8,a[11]=r,a[12]=i>>>24,a[13]=i>>>16,a[14]=i>>>8,a[15]=i,new e(a)}}]),e}(),phe=function(){function e(){Un(this,e),ct(this,"timestamp",0),ct(this,"counter",0),ct(this,"random",new fhe)}return $n(e,[{key:"generate",value:function(){var t=this.generateOrAbort();if(t!==void 0)return t;this.timestamp=0;var n=this.generateOrAbort();if(n===void 0)throw new Error("Could not generate UUID after timestamp reset");return n}},{key:"generateOrAbort",value:function(){var t=Date.now();if(t>this.timestamp)this.timestamp=t,this.resetCounter();else{if(!(t+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return dhe.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),DP=function(e){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t=this.buffer.length&&(DP(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),hhe=function(){return(nR||(nR=new phe)).generate()},LP=Array.prototype,MP=Object.prototype,uT=MP.toString,ghe=MP.hasOwnProperty,ht=typeof window<"u"?window:{},Ql=ht.navigator||{userAgent:""},jn=ht.document||{},aa=Ql.userAgent,mhe=["localhost","127.0.0.1"],rR=LP.forEach,iR=LP.indexOf,bhe=Array.isArray,cT={},In={log:function(){if(ma.DEBUG&&!ja(window.console)&&window.console){for(var e=("__rrweb_original__"in window.console.log)?window.console.log.__rrweb_original__:window.console.log,t=arguments.length,n=new Array(t),r=0;r1?t-1:0),r=1;r0&&(t[r]=n)}),t},Ehe=["$performance_raw"];function vhe(e,t){return n=e,r=function(a,o){return o&&Ehe.indexOf(o)>-1?a:typeof a=="string"&&t!==null?a.slice(0,t):a},i=new Set,function a(o,s){return o!==Object(o)?r?r(o,s):o:i.has(o)?void 0:(i.add(o),ts(o)?(u=[],os(o,function(c){u.push(a(c))})):(u={},hn(o,function(c,p){i.has(c)||(u[p]=a(c,p))})),u);var u}(n);var n,r,i}function dT(e){var t,n,r,i,a,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,c="",p=[];if(!e)return e;e=_he(e);do t=(a=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=a>>12&63,r=a>>6&63,i=63&a,p[u++]=o.charAt(t)+o.charAt(n)+o.charAt(r)+o.charAt(i);while(s127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),s!==null&&(n>t&&(a+=e.substring(t,n)),a+=s,t=n=i+1)}return n>t&&(a+=e.substring(t,e.length)),a},aR=function(e){var t=function(){var n=new Date().valueOf(),r=0;if(ht.performance&&ht.performance.now)r=1e4*ht.performance.now();else for(;n==new Date().valueOf();)r++;return n.toString(16)+Math.floor(r).toString(16)};return function(n){if(n==="og"||e==="og"){var r=typeof window<"u"?(window.screen.height*window.screen.width).toString(16):"0";return t()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var i,a,o=aa,s=0,u=[];function c(p,f){var m,g=0;for(m=0;m=4&&(s=c(s,u),u=[]);return u.length>0&&(s=c(s,u)),s.toString(16)}()+"-"+r+"-"+t()}return hhe().toString()}},The=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog|applebot|semrushbot|duckduckbot|twitterbot|rogerbot|linkedinbot|mj12bot|sitebulb|bot.htm|bot.php|hubspot|crawler|prerender)/i.test(e)},oR=function(e,t){var n=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),r=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(e);if(r===null||r&&typeof r[1]!="string"&&r[1].length)return"";var i=r[1];try{i=decodeURIComponent(i)}catch{In.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},sR=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Qd=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,a){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!a);else{var o="on"+n,s=t[o];t[o]=function(u,c,p){return function(f){if(f=f||e(window.event)){var m,g=!0;FP(p)&&(m=p(f));var b=c.call(u,f);return m!==!1&&b!==!1||(g=!1),g}}}(t,r,s)}else In.error("No valid element provided to register_event")}}();function pT(e,t){var n=function(){var r=jn.createElement("script");r.type="text/javascript",r.src=e,r.onload=function(o){return t(void 0,o)},r.onerror=function(o){return t(o)};var i,a=jn.querySelectorAll("body > script");a.length>0?(i=a[0].parentNode)===null||i===void 0||i.insertBefore(r,a[0]):jn.body.appendChild(r)};jn.body?n():jn.addEventListener("DOMContentLoaded",n)}var Sr={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(e||[]),n={};return hn(t,function(r){var i=oR(jn.URL,r);i.length&&(n[r]=i)}),n},searchEngine:function(){var e=jn.referrer;return e?e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null},searchInfo:function(){var e=Sr.searchEngine(),t=e!="yahoo"?"q":"p",n={};if(e!==null){n.$search_engine=e;var r=oR(jn.referrer,t);r.length&&(n.ph_keyword=r)}return n},browser:function(e,t,n){return t=t||"",n||fn(e," OPR/")?fn(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":fn(e,"IEMobile")||fn(e,"WPDesktop")?"Internet Explorer Mobile":fn(e,"SamsungBrowser/")?"Samsung Internet":fn(e,"Edge")||fn(e,"Edg/")?"Microsoft Edge":fn(e,"FBIOS")?"Facebook Mobile":fn(e,"Chrome")?"Chrome":fn(e,"CriOS")?"Chrome iOS":fn(e,"UCWEB")||fn(e,"UCBrowser")?"UC Browser":fn(e,"FxiOS")?"Firefox iOS":fn(t,"Apple")?fn(e,"Mobile")?"Mobile Safari":"Safari":fn(e,"Android")?"Android Mobile":fn(e,"Konqueror")?"Konqueror":fn(e,"Firefox")?"Firefox":fn(e,"MSIE")||fn(e,"Trident/")?"Internet Explorer":fn(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[Sr.browser(e,t,n)];if(r===void 0)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},browserLanguage:function(){return Ql.language||Ql.userLanguage},os:function(e){if(/Windows/i.test(e)){if(/Phone/.test(e)||/WPDesktop/.test(e))return{os_name:"Windows Phone",os_version:""};var t=/Windows NT ([0-9.]+)/i.exec(e);return t&&t[1]?{os_name:"Windows",os_version:t[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(e)){var n=/OS (\d+)_(\d+)_?(\d+)?/i.exec(e);return n&&n[1]?{os_name:"iOS",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(e)){var r=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(e);return r&&r[1]?{os_name:"Android",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(e))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(e)){var i=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(e);return i&&i[1]?{os_name:"Mac OS X",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(e)?{os_name:"Linux",os_version:""}:/CrOS/.test(e)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return t==="iPad"||t==="Android Tablet"?"Tablet":t?"Mobile":"Desktop"},referrer:function(){return jn.referrer||"$direct"},referringDomain:function(){if(!jn.referrer)return"$direct";var e=jn.createElement("a");return e.href=jn.referrer,e.host},properties:function(){var e=Sr.os(aa),t=e.os_name,n=e.os_version;return $r(Oy({$os:t,$os_version:n,$browser:Sr.browser(aa,Ql.vendor,ht.opera),$device:Sr.device(aa),$device_type:Sr.deviceType(aa)}),{$current_url:ht==null?void 0:ht.location.href,$host:ht==null?void 0:ht.location.host,$pathname:ht==null?void 0:ht.location.pathname,$browser_version:Sr.browserVersion(aa,Ql.vendor,ht.opera),$browser_language:Sr.browserLanguage(),$screen_height:ht==null?void 0:ht.screen.height,$screen_width:ht==null?void 0:ht.screen.width,$viewport_height:ht==null?void 0:ht.innerHeight,$viewport_width:ht==null?void 0:ht.innerWidth,$lib:"web",$lib_version:ma.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:BP()/1e3})},people_properties:function(){var e=Sr.os(aa),t=e.os_name,n=e.os_version;return $r(Oy({$os:t,$os_version:n,$browser:Sr.browser(aa,Ql.vendor,ht.opera)}),{$browser_version:Sr.browserVersion(aa,Ql.vendor,ht.opera)})}};function Zg(e){switch(pl(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function Qg(e){var t="";return Ph(e)&&!zP(e)&&e.childNodes&&e.childNodes.length&&hn(e.childNodes,function(n){$P(n)&&n.textContent&&(t+=Ry(n.textContent).split(/(\s+)/).filter(N1).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),Ry(t)}function lR(e){return!!e&&e.nodeType===1}function fu(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function $P(e){return!!e&&e.nodeType===3}function uR(e){return!!e&&e.nodeType===11}var k4=["a","button","form","input","select","textarea","label"];function Ph(e){for(var t=e;t.parentNode&&!fu(t,"body");t=t.parentNode){var n=Zg(t).split(" ");if(fn(n,"ph-sensitive")||fn(n,"ph-no-capture"))return!1}if(fn(Zg(e).split(" "),"ph-include"))return!0;var r=e.type||"";if(typeof r=="string")switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!(typeof i=="string"&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function zP(e){return!!(fu(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||fu(e,"select")||fu(e,"textarea")||e.getAttribute("contenteditable")==="true")}function N1(e){return!(e===null||ja(e)||typeof e=="string"&&(e=Ry(e),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(e)))}function cR(e){var t=Qg(e);return N1(t="".concat(t," ").concat(HP(e)).trim())?t:""}function HP(e){var t="";return e&&e.childNodes&&e.childNodes.length&&hn(e.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{var i=Qg(n);t="".concat(t," ").concat(i).trim(),n.childNodes&&n.childNodes.length&&(t="".concat(t," ").concat(HP(n)).trim())}catch(a){console.error(a)}}),t}var She=function(){function e(t){Un(this,e),this.clicks=[],this.enabled=t}return $n(e,[{key:"isRageClick",value:function(t,n,r){if(!this.enabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(n-i.y)<30&&r-i.timestamp<1e3){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}]),e}(),whe=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,yo={is_supported:function(){return!0},error:function(e){In.error("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?i.$el_text=cR(e):i.$el_text=Qg(e));var a=Zg(e);a.length>0&&(i.classes=a.split(" ").filter(function(c){return c!==""})),hn(e.attributes,function(c){var p;zP(e)&&["name","id","class"].indexOf(c.name)===-1||!t&&N1(c.value)&&(typeof(p=c.name)!="string"||p.substring(0,10)!=="_ngcontent"&&p.substring(0,7)!=="_nghost")&&(i["attr__"+c.name]=c.value)});for(var o=1,s=1,u=e;u=this._previousElementSibling(u);)o++,u.tagName===e.tagName&&s++;return i.nth_child=o,i.nth_of_type=s,i},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return hn(document.querySelectorAll(e.css_selector),function(n){var r;["input","select"].indexOf(n.tagName.toLowerCase())>-1?r=n.value:n.textContent&&(r=n.textContent),N1(r)&&t.push(r)}),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return hn(this._customProperties,function(r){hn(r.event_selectors,function(i){hn(document.querySelectorAll(i),function(a){fn(e,a)&&Ph(a)&&(n[r.name]=t._extractCustomPropertyValue(r))})})}),n},_getEventTarget:function(e){return e.target===void 0?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"$autocapture",a=this._getEventTarget(e);if($P(a)&&(a=a.parentNode||null),i==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&(n=this.rageclicks)!==null&&n!==void 0&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,t,"$rageclick"),a&&function(g,b){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!g||fu(g,"html")||!lR(g))return!1;if(y!=null&&y.url_allowlist){var T=window.location.href,E=y.url_allowlist;if(E&&!E.some(function($){return T.match($)}))return!1}if(y!=null&&y.dom_event_allowlist){var v=y.dom_event_allowlist;if(v&&!v.some(function($){return b.type===$}))return!1}if(y!=null&&y.element_allowlist){var w=y.element_allowlist;if(w&&!w.some(function($){return g.tagName.toLowerCase()===$}))return!1}if(y!=null&&y.css_selector_allowlist){var A=y.css_selector_allowlist;if(A&&!A.some(function($){return g.matches($)}))return!1}for(var R=!1,k=[g],N=!0,B=g;B.parentNode&&!fu(B,"body");)if(uR(B.parentNode))k.push(B.parentNode.host),B=B.parentNode.host;else{if(!(N=B.parentNode||!1))break;if(k4.indexOf(N.tagName.toLowerCase())>-1)R=!0;else{var q=window.getComputedStyle(N);q&&q.getPropertyValue("cursor")==="pointer"&&(R=!0)}k.push(N),B=N}var P=window.getComputedStyle(g);if(P&&P.getPropertyValue("cursor")==="pointer"&&b.type==="click")return!0;var Q=g.tagName.toLowerCase();switch(Q){case"html":return!1;case"form":return b.type==="submit";case"input":case"select":case"textarea":return b.type==="change"||b.type==="click";default:return R?b.type==="click":b.type==="click"&&(k4.indexOf(Q)>-1||g.getAttribute("contenteditable")==="true")}}(a,e,this.config)){for(var o=[a],s=a;s.parentNode&&!fu(s,"body");)uR(s.parentNode)?(o.push(s.parentNode.host),s=s.parentNode.host):(o.push(s.parentNode),s=s.parentNode);var u,c=[],p={},f=!1;if(hn(o,function(g){var b=Ph(g);g.tagName.toLowerCase()==="a"&&(u=g.getAttribute("href"),u=b&&N1(u)&&u),fn(Zg(g).split(" "),"ph-no-capture")&&(f=!0),c.push(r._getPropertiesFromElement(g,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")));var y=r._getAugmentPropertiesFromElement(g);$r(p,y)}),t.get_config("mask_all_text")||(a.tagName.toLowerCase()==="a"||a.tagName.toLowerCase()==="button"?c[0].$el_text=cR(a):c[0].$el_text=Qg(a)),u&&(c[0].attr__href=u),f)return!1;var m=$r(this._getDefaultProperties(e.type),{$elements:c},this._getCustomProperties(o),p);return t.capture(i,m),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,n=function(r){r=r||window.event,t._captureEvent(r,e)};Qd(document,"submit",n,!1,!0),Qd(document,"change",n,!1,!0),Qd(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;typeof e.__autocapture!="boolean"&&(this.config=e.__autocapture),(t=this.config)!==null&&t!==void 0&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map(function(n){return new RegExp(n)})),this.rageclicks=new She(e.get_config("rageclick"))},afterDecideResponse:function(e,t){var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?In.log('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(ct({},dR,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=ja(t)?10:t,n=ja(n)?10:n;for(var r=0,i=0;i1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],i="".concat(r),a=this.instance.get_property(Jg)||{};return!n.send_event&&"send_event"in n||t in a&&a[t].includes(i)||(Array.isArray(a[t])?a[t].push(i):a[t]=[i],this.instance.persistence.register(ct({},Jg,a)),this.instance.capture("$feature_flag_called",{$feature_flag:t,$feature_flag_response:r})),r}console.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(t){return this.getFlagPayloads()[t]}},{key:"isFeatureEnabled",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(t,n);console.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(t){this.featureFlagEventHandlers.push(t)}},{key:"removeFeatureFlagsHandler",value:function(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(n){return n!==t})}},{key:"receivedFeatureFlags",value:function(t){this.instance.decideEndpointWasHit=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads();(function(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=i.featureFlags,c=i.featureFlagPayloads;if(u)if(Array.isArray(u)){var p,f={};if(u)for(var m=0;m1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(Fy);if(i&&!r)return t(i);this.instance._send_request("".concat(this.instance.get_config("api_host"),"/api/early_access_features/?token=").concat(this.instance.get_config("token")),{},{method:"GET"},function(a){var o=a.earlyAccessFeatures;return n.instance.persistence.register(ct({},Fy,o)),t(o)})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter(function(r){return n[r]}),flagVariants:Object.keys(n).filter(function(r){return n[r]}).reduce(function(r,i){return r[i]=n[i],r},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(function(i){return i(n,r)})}},{key:"setPersonPropertiesForFlags",value:function(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(D1)||{};this.instance.register(ct({},D1,vt(vt({},r),t))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(D1)}},{key:"setGroupPropertiesForFlags",value:function(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Vs)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(function(i){r[i]=vt(vt({},r[i]),t[i]),delete t[i]}),this.instance.register(ct({},Vs,vt(vt({},r),t))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(t){if(t){var n=this.instance.get_property(Vs)||{};this.instance.register(ct({},Vs,vt(vt({},n),{},ct({},t,{}))))}else this.instance.unregister(Vs)}}]),e}(),Ihe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==",bR=2,Rhe=4,GP=3,Nhe=6,Ohe=0,Dhe=5e6,Lhe="rrweb/console@1",fo,Mhe=$n(function e(t){var n,r,i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Un(this,e),ct(this,"bucketSize",100),ct(this,"refillRate",10),ct(this,"mutationBuckets",{}),ct(this,"loggedTracker",{}),ct(this,"refillBuckets",function(){Object.keys(i.mutationBuckets).forEach(function(o){i.mutationBuckets[o]=i.mutationBuckets[o]+i.refillRate,i.mutationBuckets[o]>=i.bucketSize&&delete i.mutationBuckets[o]})}),ct(this,"getNodeOrRelevantParent",function(o){var s=i.rrweb.mirror.getNode(o);if((s==null?void 0:s.nodeName)!=="svg"&&s instanceof Element){var u=s.closest("svg");if(u)return[i.rrweb.mirror.getId(u),u]}return[o,s]}),ct(this,"numberOfChanges",function(o){var s,u,c,p,f,m,g,b;return((s=(u=o.removes)===null||u===void 0?void 0:u.length)!==null&&s!==void 0?s:0)+((c=(p=o.attributes)===null||p===void 0?void 0:p.length)!==null&&c!==void 0?c:0)+((f=(m=o.texts)===null||m===void 0?void 0:m.length)!==null&&f!==void 0?f:0)+((g=(b=o.adds)===null||b===void 0?void 0:b.length)!==null&&g!==void 0?g:0)}),ct(this,"throttleMutations",function(o){if(o.type!==GP||o.data.source!==Ohe)return o;var s=o.data,u=i.numberOfChanges(s);s.attributes&&(s.attributes=s.attributes.filter(function(p){var f,m,g,b=Co(i.getNodeOrRelevantParent(p.id),2),y=b[0],T=b[1];return i.mutationBuckets[y]===0?!1:(i.mutationBuckets[y]=(f=i.mutationBuckets[y])!==null&&f!==void 0?f:i.bucketSize,i.mutationBuckets[y]=Math.max(i.mutationBuckets[y]-1,0),i.mutationBuckets[y]===0&&(i.loggedTracker[y]||(i.loggedTracker[y]=!0,(m=(g=i.options).onBlockedNode)===null||m===void 0||m.call(g,y,T))),p)}));var c=i.numberOfChanges(s);return c!==0||u===c?o:void 0}),this.rrweb=t,this.options=a,this.refillRate=(n=this.options.refillRate)!==null&&n!==void 0?n:this.refillRate,this.bucketSize=(r=this.options.bucketSize)!==null&&r!==void 0?r:this.bucketSize,setInterval(function(){i.refillBuckets()},1e3)}),Fhe="/s/",VP="sessionRecording";(function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"})(fo||(fo={}));var Phe=[fo.MouseMove,fo.MouseInteraction,fo.Scroll,fo.ViewportResize,fo.Input,fo.TouchMove,fo.MediaInteraction,fo.Drag],Bhe=function(){function e(t){var n=this;Un(this,e),ct(this,"lastActivityTimestamp",Date.now()),ct(this,"isIdle",!1),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint=Fhe,this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1,window.addEventListener("beforeunload",function(){n._flushBuffer()})}return $n(e,[{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var t=!!this.instance.get_property(Ly),n=!this.instance.get_config("disable_session_recording");return t&&n}},{key:"isConsoleLogCaptureEnabled",value:function(){var t=!!this.instance.get_property(pR),n=this.instance.get_config("enable_recording_console_log");return n??t}},{key:"getRecordingVersion",value:function(){var t,n=this.instance.get_property(fR);return((t=this.instance.get_config("session_recording"))===null||t===void 0?void 0:t.recorderVersion)||n||"v1"}},{key:"afterDecideResponse",value:function(t){var n,r,i,a,o,s;this.receivedDecide=!0,this.instance.persistence&&this.instance.persistence.register((ct(o={},Ly,!!t.sessionRecording),ct(o,pR,(i=t.sessionRecording)===null||i===void 0?void 0:i.consoleLogRecordingEnabled),ct(o,fR,(a=t.sessionRecording)===null||a===void 0?void 0:a.recorderVersion),o)),(n=t.sessionRecording)!==null&&n!==void 0&&n.endpoint&&(this.endpoint=(s=t.sessionRecording)===null||s===void 0?void 0:s.endpoint),(r=t.sessionRecording)!==null&&r!==void 0&&r.recorderVersion&&(this.recorderVersion=t.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"log",value:function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(n=this.instance.sessionRecording)===null||n===void 0||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:r,trace:[],payload:[JSON.stringify(t)]}},timestamp:BP()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var t=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach(function(n){return t._captureSnapshotBuffered(n)})),this._startCapture()}},{key:"_startCapture",value:function(){var t=this;if(Object.assign!==void 0&&!this.captureStarted&&!this.instance.get_config("disable_session_recording")){this.captureStarted=!0,this.instance.sessionManager.checkAndGetSessionAndWindowId();var n=this.getRecordingVersion()==="v2"?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.getRecordingVersion()?pT(this.instance.get_config("api_host")+"/static/".concat(n,"?v=").concat(ma.LIB_VERSION),function(r){if(r)return In.error("Could not load ".concat(n),r);t._onScriptLoaded()}):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(t){var n;return t.type===GP&&Phe.indexOf((n=t.data)===null||n===void 0?void 0:n.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(t){var n=this._isInteractiveEvent(t);if(n||this.isIdle||t.timestamp-this.lastActivityTimestamp>3e5&&(this.isIdle=!0),n&&(this.lastActivityTimestamp=t.timestamp,this.isIdle&&(this.isIdle=!1,this._tryTakeFullSnapshot())),!this.isIdle){var r=this.instance.sessionManager.checkAndGetSessionAndWindowId(!n,t.timestamp),i=r.windowId,a=r.sessionId;[bR,Rhe].indexOf(t.type)!==-1||this.windowId===i&&this.sessionId===a||this._tryTakeFullSnapshot(),this.windowId=i,this.sessionId=a}}},{key:"_tryTakeFullSnapshot",value:function(){if(!this.captureStarted)return!1;try{var t;return(t=this.rrwebRecord)===null||t===void 0||t.takeFullSnapshot(),!0}catch(n){return In.error("Error taking full snapshot.",n),!1}}},{key:"_onScriptLoaded",value:function(){var t,n=this,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var i=this.instance.get_config("session_recording"),a=0,o=Object.entries(i||{});aDhe){var c,p=hs(u.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(p.s();!(c=p.n()).done;){var f=c.value;u=f[1].toLocaleLowerCase().slice(0,6)==="image/"?u.replace(f[0],Ihe):u.replace(f[0],"")}}catch(m){p.e(m)}finally{p.f()}}return{event:JSON.parse(u),size:u.length}}(function(s){var u=s;if(u&&pl(u)==="object"&&u.type===Nhe&&pl(u.data)==="object"&&u.data.plugin===Lhe){u.data.payload.payload.length>10&&(u.data.payload.payload=u.data.payload.payload.slice(0,10),u.data.payload.payload.push("...[truncated]"));for(var c=[],p=0;p2e3?c.push(u.data.payload.payload[p].slice(0,2e3)+"...[truncated]"):c.push(u.data.payload.payload[p]);return u.data.payload.payload=c,s}return s}(n)),i=r.event,a=r.size;if(this._updateWindowAndSessionIds(i),!this.isIdle){var o={$snapshot_bytes:a,$snapshot_data:i,$session_id:this.sessionId,$window_id:this.windowId};this.instance._captureMetrics.incr("rrweb-record"),this.instance._captureMetrics.incr("rrweb-record-".concat(i.type)),this.emit?this._captureSnapshotBuffered(o):this.snapshots.push(o)}}}}},{key:"_flushBuffer",value:function(){return this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0),this.buffer&&this.buffer.data.length!==0&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_captureSnapshotBuffered",value:function(t){var n,r=this,i=2+(((n=this.buffer)===null||n===void 0?void 0:n.data.length)||0);(!this.buffer||this.buffer.size+t.$snapshot_bytes+i>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=t.$snapshot_bytes,this.buffer.data.push(t.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){r._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(t){this.instance.capture("$snapshot",t,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:VP,_metrics:{rrweb_full_snapshot:t.$snapshot_data.type===bR}})}}]),e}(),lo={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},Uhe=["first-input","navigation","paint","resource"],$he=["/s/","/e/"],zhe=function(){function e(t){Un(this,e),ct(this,"_forceAllowLocalhost",!1),this.instance=t}return $n(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var t,n,r=this;if(!this.observer)if(((t=window)===null||t===void 0||(n=t.PerformanceObserver)===null||n===void 0?void 0:n.supportedEntryTypes)!==void 0)if(!mhe.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver(function(a){a.getEntries().forEach(function(o){r._capturePerformanceEvent(o)})});var i=PerformanceObserver.supportedEntryTypes.filter(function(a){return Uhe.includes(a)});i.forEach(function(a){var o;(o=r.observer)===null||o===void 0||o.observe({type:a,buffered:!0})})}catch(a){console.error("PostHog failed to start performance observer",a),this.stopObserving()}else In.log("PostHog Peformance observer not started because we are on localhost.");else In.log("PostHog Performance observer not started because PerformanceObserver is not supported by this browser.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var t,n;return(t=(n=this.instance.get_config("capture_performance"))!==null&&n!==void 0?n:this.remoteEnabled)!==null&&t!==void 0&&t}},{key:"afterDecideResponse",value:function(t){this.remoteEnabled=t.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(t){if(t.name.indexOf(this.instance.get_config("api_host"))===0){var n=t.name.replace(this.instance.get_config("api_host"),"");if($he.find(function(g){return n.indexOf(g)===0}))return}var r={url:t.name},i=this.instance.get_config("session_recording");if(i.maskNetworkRequestFn&&(r=i.maskNetworkRequestFn(r)),r){var a=t.toJSON();a.name=r.url;var o={},s=Math.floor(Date.now()-performance.now());for(var u in o[lo.timeOrigin]=s,o[lo.timestamp]=Math.floor(s+t.startTime),lo)a[u]!==void 0&&(o[lo[u]]=a[u]);if(this.capturePerformanceEvent(o),Hhe(t)){var c,p=hs(t.serverTiming||[]);try{for(p.s();!(c=p.n()).done;){var f,m=c.value;this.capturePerformanceEvent((ct(f={},lo.timeOrigin,s),ct(f,lo.timestamp,Math.floor(s+t.startTime)),ct(f,lo.name,m.name),ct(f,lo.duration,m.duration),ct(f,lo.entryType,"serverTiming"),f))}}catch(g){p.e(g)}finally{p.f()}}}}},{key:"capturePerformanceEvent",value:function(t){var n,r=t[lo.timestamp];(n=this.instance.sessionRecording)===null||n===void 0||n.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:t},timestamp:r})}}]),e}(),Hhe=function(e){return e.entryType==="navigation"||e.entryType==="resource"},jhe=function(){function e(t){Un(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return $n(e,[{key:"call",value:function(){var t=this,n=dT(JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(D1),group_properties:this.instance.get_property(Vs),disable_flags:this.instance.get_config("advanced_disable_feature_flags")||this.instance.get_config("advanced_disable_feature_flags_on_first_load")||void 0}));this.instance._send_request("".concat(this.instance.get_config("api_host"),"/decide/?v=3"),{data:n,verbose:!0},{method:"POST"},function(r){return t.parseDecideResponse(r)})}},{key:"parseDecideResponse",value:function(t){var n,r,i,a=this;if((t==null?void 0:t.status)!==0){if(!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){a.parseDecideResponse(t)},500);if(this.instance.toolbar.afterDecideResponse(t),(n=this.instance.sessionRecording)===null||n===void 0||n.afterDecideResponse(t),Ys.afterDecideResponse(t,this.instance),(r=this.instance.webPerformance)===null||r===void 0||r.afterDecideResponse(t),(i=this.instance.exceptionAutocapture)===null||i===void 0||i.afterDecideResponse(t),this.instance.get_config("advanced_disable_feature_flags_on_first_load")||this.instance.featureFlags.receivedFeatureFlags(t),this.instance.compression={},t.supportedCompression&&!this.instance.get_config("disable_compression")){var o,s={},u=hs(t.supportedCompression);try{for(u.s();!(o=u.n()).done;)s[o.value]=!0}catch(g){u.e(g)}finally{u.f()}this.instance.compression=s}if(t.siteApps)if(this.instance.get_config("opt_in_site_apps")){var c,p=this.instance.get_config("api_host"),f=hs(t.siteApps);try{var m=function(){var g=c.value,b=g.id,y=g.url,T=[p,p[p.length-1]==="/"&&y[0]==="/"?y.substring(1):y].join("");window["__$$ph_site_app_".concat(b)]=a.instance,pT(T,function(E){E&&console.error("Error while initializing PostHog app with config id ".concat(b),E)})};for(f.s();!(c=f.n()).done;)m()}catch(g){f.e(g)}finally{f.f()}}else t.siteApps.length>0&&console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),Ghe=["https://app.posthog.com","https://eu.posthog.com"],Vhe=["source"],Whe=function(){function e(t){Un(this,e),this.instance=t}return $n(e,[{key:"afterDecideResponse",value:function(t){var n=t.toolbarParams||t.editorParams||(t.toolbarVersion?{toolbarVersion:t.toolbarVersion}:{});t.isAuthenticated&&n.toolbarVersion&&n.toolbarVersion.indexOf("toolbar")===0&&this.loadToolbar(vt({},n))}},{key:"maybeLoadToolbar",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window.history;try{if(!n){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch{return!1}n=window.localStorage}var i,a=sR(t.hash,"__posthog")||sR(t.hash,"state"),o=a?JSON.parse(decodeURIComponent(a)):null;return o&&o.action==="ph_authorize"?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState("",document.title,t.pathname+t.search):t.hash="")):((i=JSON.parse(n.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.get_config("token")!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}},{key:"loadToolbar",value:function(t){var n=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var r=this.instance.get_config("api_host"),i=3e4*Math.floor(Date.now()/3e4),a="".concat(r).concat(r.endsWith("/")?"":"/","static/toolbar.js?_ts=").concat(i),o=!Ghe.includes(this.instance.get_config("api_host"))&&this.instance.get_config("advanced_disable_toolbar_metrics"),s=vt(vt({token:this.instance.get_config("token")},t),{},{apiURL:r},o?{instrument:!1}:{});s.source;var u=uhe(s,Vhe);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),pT(a,function(c){c?In.error("Failed to load toolbar",c):(window.ph_load_toolbar||window.ph_load_editor)(s,n.instance)}),Qd(window,"turbolinks:load",function(){window._postHogToolbarLoaded=!1,n.loadToolbar(s)}),!0}},{key:"_loadEditor",value:function(t){return this.loadToolbar(t)}},{key:"maybeLoadEditor",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window.history;return this.maybeLoadToolbar(t,n,r)}}]),e}(),qhe="__ph_opt_in_out_";function Khe(e,t){qP(!0,e,t)}function Yhe(e,t){qP(!1,e,t)}function Xhe(e,t){return WP(e,t)==="1"}function yR(e,t){return!!function(n){if(n&&n.respectDnt){var r=n&&n.window||ht,i=r.navigator||{},a=!1;return hn([i.doNotTrack,i.msDoNotTrack,r.doNotTrack],function(o){fn([!0,1,"1","yes"],o)&&(a=!0)}),a}return!1}(t)||WP(e,t)==="0"}function Zhe(e,t){fT(t=t||{}).remove(hT(e,t),!!t.crossSubdomainCookie)}function fT(e){return(e=e||{}).persistenceType==="localStorage"?Kn:e.persistenceType==="localStorage+cookie"?Dy:yo}function hT(e,t){return((t=t||{}).persistencePrefix||qhe)+e}function WP(e,t){return fT(t).get(hT(e,t))}function qP(e,t,n){PP(t)&&t.length?(fT(n=n||{}).set(hT(t,n),e?1:0,yhe(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}var KP=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:3e3;Un(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return $n(e,[{key:"setPollInterval",value:function(t){this._pollInterval=t,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return new Date().getTime()}}]),e}(),Qhe=function(e){NP(n,KP);var t=OP(n);function n(r,i){var a,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:3e3;return Un(this,n),(a=t.call(this,o)).handlePollRequest=i,a.captureMetrics=r,a}return $n(n,[{key:"enqueue",value:function(r,i,a){this.captureMetrics.incr("batch-enqueue"),this._event_queue.push({url:r,data:i,options:a}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var r=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(r._event_queue.length>0){var i=r.formatQueue(),a=function(s){var u=i[s],c=u.url,p=u.data,f=u.options;hn(p,function(m,g){p[g].offset=Math.abs(p[g].timestamp-r.getTime()),delete p[g].timestamp}),r.handlePollRequest(c,p,f),r.captureMetrics.incr("batch-requests"),r.captureMetrics.incr("batch-requests-".concat(c.slice(c.length-2))),r.captureMetrics.incr("batch-handle",p.length),r.captureMetrics.incr("batch-handle-".concat(c.slice(c.length-2)),p.length)};for(var o in i)a(o);r._event_queue.length=0,r._empty_queue_count=0}else r._empty_queue_count++;r._empty_queue_count>4&&(r.isPolling=!1,r._empty_queue_count=0),r.isPolling&&r.poll()},this._pollInterval)}},{key:"updateUnloadMetrics",value:function(){var r=this.formatQueue();for(var i in r){var a=r[i],o=a.url,s=a.data;this.captureMetrics.incr("batch-unload-requests"),this.captureMetrics.incr("batch-unload-requests-".concat(o.slice(o.length-2))),this.captureMetrics.incr("batch-unload",s.length),this.captureMetrics.incr("batch-unload-".concat(o.slice(o.length-2)),s.length)}}},{key:"unload",value:function(){var r=this;clearTimeout(this._poller);var i=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var a=Object.values(i);[].concat(xy(a.filter(function(o){return o.url.indexOf("/e")===0})),xy(a.filter(function(o){return o.url.indexOf("/e")!==0}))).map(function(o){var s=o.url,u=o.data,c=o.options;r.handlePollRequest(s,u,vt(vt({},c),{},{transport:"sendBeacon"}))})}},{key:"formatQueue",value:function(){var r={};return hn(this._event_queue,function(i){var a=i.url,o=i.data,s=i.options,u=(s?s._batchKey:null)||a;r[u]===void 0&&(r[u]={data:[],url:a,options:s}),s&&r[u].options&&r[u].options._metrics&&!r[u].options._metrics.rrweb_full_snapshot&&(r[u].options._metrics.rrweb_full_snapshot=s._metrics.rrweb_full_snapshot),r[u].data.push(o)}),r}}]),n}(),Jhe=function(){function e(t){Un(this,e),this.enabled=t,this.metrics={}}return $n(e,[{key:"incr",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.enabled&&(t="phjs-".concat(t),this.metrics[t]=(this.metrics[t]||0)+n)}},{key:"decr",value:function(t){this.enabled&&(t="phjs-".concat(t),this.metrics[t]=(this.metrics[t]||0)-1)}}]),e}(),Ui=Uint8Array,ni=Uint16Array,dc=Uint32Array,gT=new Ui([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mT=new Ui([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ER=new Ui([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),YP=function(e,t){for(var n=new ni(31),r=0;r<31;++r)n[r]=t+=1<>>1|(21845&Sn)<<1;ql=(61680&(ql=(52428&ql)>>>2|(13107&ql)<<2))>>>4|(3855&ql)<<4,zy[Sn]=((65280&ql)>>>8|(255&ql)<<8)>>>1}var Jd=function(e,t,n){for(var r=e.length,i=0,a=new ni(t);i>>u]=c}else for(o=new ni(r),i=0;i>>15-e[i];return o},wu=new Ui(288);for(Sn=0;Sn<144;++Sn)wu[Sn]=8;for(Sn=144;Sn<256;++Sn)wu[Sn]=9;for(Sn=256;Sn<280;++Sn)wu[Sn]=7;for(Sn=280;Sn<288;++Sn)wu[Sn]=8;var em=new Ui(32);for(Sn=0;Sn<32;++Sn)em[Sn]=5;var tu,tge=Jd(wu,9,0),nge=Jd(em,5,0),ZP=function(e){return(e/8>>0)+(7&e&&1)},QP=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof ni?ni:e instanceof dc?dc:Ui)(n-t);return r.set(e.subarray(t,n)),r},Ko=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},dd=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},R4=function(e,t){for(var n=[],r=0;rm&&(m=a[r].s);var g=new ni(m+1),b=rge(n[p-1],g,0);if(b>t){r=0;var y=0,T=b-t,E=1<t))break;y+=E-(1<>>=T;y>0;){var w=a[r].s;g[w]=0&&y;--r){var A=a[r].s;g[A]==t&&(--g[A],++y)}b=t}return[new Ui(g),b]},rge=function e(t,n,r){return t.s==-1?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},_R=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ni(++t),r=0,i=e[0],a=1,o=function(u){n[r++]=u},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},pd=function(e,t){for(var n=0,r=0;r>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;a4&&!P[ER[$-1]];--$);var oe,fe,ce,De,H=c+5<<3,W=pd(i,wu)+pd(a,em)+o,se=pd(i,m)+pd(a,y)+o+14+3*$+pd(N,P)+(2*N[16]+3*N[17]+7*N[18]);if(H<=W&&H<=se)return Uh(t,p,e.subarray(u,u+c));if(Ko(t,p,1+(se15&&(Ko(t,p,L[B]>>>5&127),p+=L[B]>>>12)}}}else oe=tge,fe=wu,ce=nge,De=em;for(B=0;B255){ie=r[B]>>>18&31,dd(t,p,oe[ie+257]),p+=fe[ie+257],ie>7&&(Ko(t,p,r[B]>>>23&31),p+=gT[ie]);var Se=31&r[B];dd(t,p,ce[Se]),p+=De[Se],Se>3&&(dd(t,p,r[B]>>>5&8191),p+=mT[Se])}else dd(t,p,oe[r[B]]),p+=fe[r[B]];return dd(t,p,oe[256]),p+fe[256]},ige=new dc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),age=new Ui(0),oge=function(){for(var e=new dc(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),sge=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r>>8;e=n},d:function(){return 4294967295^e}}},lge=function(e,t,n,r,i){return function(a,o,s,u,c,p){var f=a.length,m=new Ui(u+f+5*(1+Math.floor(f/7e3))+c),g=m.subarray(u,m.length-c),b=0;if(!o||f<8)for(var y=0;y<=f;y+=65535){var T=y+65535;T>>13,w=8191&E,A=(1<7e3||ce>24576)&&pe>423){b=TR(a,g,0,P,Q,$,fe,ce,H,y-H,b),ce=oe=fe=0,H=y;for(var le=0;le<286;++le)Q[le]=0;for(le=0;le<30;++le)$[le]=0}var L=2,ie=0,Se=w,X=se-D&32767;if(pe>2&&W==q(y-X))for(var ke=Math.min(v,pe)-1,te=Math.min(32767,y),Me=Math.min(258,pe);X<=te&&--Se&&se!=D;){if(a[y+L]==a[y+L-X]){for(var Re=0;ReL){if(L=Re,ie=X,Re>ke)break;var Ze=Math.min(X,Re-2),We=0;for(le=0;leWe&&(We=ot,D=dt)}}}X+=(se=D)-(D=R[se])+32768&32767}if(ie){P[ce++]=268435456|$y[L]<<18|vR[ie];var je=31&$y[L],pt=31&vR[ie];fe+=gT[je]+mT[pt],++Q[257+je],++$[pt],De=y+L,++oe}else P[ce++]=a[y],++Q[a[y]]}}b=TR(a,g,p,P,Q,$,fe,ce,H,y-H,b),p||(b=Uh(g,b,age))}return QP(m,0,u+ZP(b)+c)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Hy=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},uge=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Hy(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},cge=function(e){return 10+(e.filename&&e.filename.length+1||0)};function dge(e,t){t===void 0&&(t={});var n=sge(),r=e.length;n.p(e);var i=lge(e,t,cge(t),8),a=i.length;return uge(i,t),Hy(i,a-8,n.d()),Hy(i,a-4,r),i}function pge(e,t){var n=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new Ui(e.length+(e.length>>>1)),i=0,a=function(c){r[i++]=c},o=0;or.length){var s=new Ui(i+8+(n-o<<1));s.set(r),r=s}var u=e.charCodeAt(o);u<128||t?a(u):u<2048?(a(192|u>>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++o))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return QP(r,0,i)}(function(e){e.GZipJS="gzip-js",e.Base64="base64"})(tu||(tu={}));var fge=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=new Date().getTime().toString(),r.ver=ma.LIB_VERSION;var i=e.split("?");if(i.length>1){var a,o=hs(i[1].split("&"));try{for(o.s();!(a=o.n()).done;){var s=a.value.split("=")[0];r[s]&&delete r[s]}}catch(c){o.e(c)}finally{o.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(c){var p,f,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",g=[];return hn(c,function(b,y){p=encodeURIComponent(b.toString()),f=encodeURIComponent(y),g[g.length]=f+"="+p}),g.join(m)}(r)},bT=function e(t,n){if(n.blob&&t.buffer)return new Blob([t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r=e(t,{method:"POST"});return new Blob([r],{type:"application/x-www-form-urlencoded"})}if(n.method!=="POST")return null;var i,a;return i=Array.isArray(t)||(a=t,Object.prototype.toString.call(a)==="[object Uint8Array]")?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i},JP=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,a=e.captureMetrics,o=e.callback,s=e.retriesPerformedSoFar,u=e.retryQueue,c=e.onXHRError,p=e.timeout,f=p===void 0?1e4:p,m=e.onRateLimited,g=new XMLHttpRequest;g.open(i.method||"GET",t,!0);var b=bT(n,i);a.incr("_send_request"),a.incr("_send_request_inflight"),hn(r,function(y,T){g.setRequestHeader(T,y)}),i.method!=="POST"||i.blob||g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.timeout=f,g.withCredentials=!0,g.onreadystatechange=function(){if(g.readyState===4)if(a.incr("xhr-response"),a.incr("xhr-response-".concat(g.status)),a.decr("_send_request_inflight"),g.status===200){if(o){var y;try{y=JSON.parse(g.responseText)}catch(T){return void In.error(T)}o(y)}}else typeof c=="function"&&c(g),[401,403,404,500].indexOf(g.status)<0&&u.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(s||0)+1,callback:o}),g.status===429&&(m==null||m(g)),o&&o({status:0})},g.send(b)},hge=18e5,gge=function(e){NP(n,KP);var t=OP(n);function n(r,i,a){var o;return Un(this,n),(o=t.call(this)).captureMetrics=r,o.isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=i,o.rateLimiter=a,typeof window<"u"&&"onLine"in window.navigator&&(o.areWeOnline=window.navigator.onLine,window.addEventListener("online",function(){o._handleWeAreNowOnline()}),window.addEventListener("offline",function(){o.areWeOnline=!1})),o}return $n(n,[{key:"enqueue",value:function(r){var i=r.retriesPerformedSoFar||0;if(!(i>=10)){var a=function(s){var u=3e3*Math.pow(2,s),c=u/2,p=Math.min(hge,u),f=(Math.random()-.5)*(p-c);return Math.ceil(p+f)}(i),o=new Date(Date.now()+a);this.queue.push({retryAt:o,requestData:r}),console.warn("Enqueued failed request for retry in ".concat(a)),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var r=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){r.areWeOnline&&r.queue.length>0&&r.flush(),r.poll()},this._pollInterval)}},{key:"flush",value:function(){var r=new Date(Date.now()),i=this.queue.filter(function(u){return u.retryAt0){this.queue=this.queue.filter(function(u){return u.retryAt>=r});var a,o=hs(i);try{for(o.s();!(a=o.n()).done;){var s=a.value.requestData;this._executeXhrRequest(s)}}catch(u){o.e(u)}finally{o.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var r,i=hs(this.queue);try{for(i.s();!(r=i.n()).done;){var a=r.value.requestData,o=a.url,s=a.data,u=a.options;if(this.rateLimiter.isRateLimited(u._batchKey))ma.DEBUG&&console.warn("[PostHog RetryQueue] is quota limited. Dropping request.");else try{window.navigator.sendBeacon(o,bT(s,vt(vt({},u),{},{sendBeacon:!0})))}catch(c){ma.DEBUG&&console.error(c)}}}catch(c){i.e(c)}finally{i.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(r){var i=r.url,a=r.data,o=r.options,s=r.headers,u=r.callback,c=r.retriesPerformedSoFar;this.rateLimiter.isRateLimited(o._batchKey)?ma.DEBUG&&console.warn("[PostHog RetryQueue] in quota limited mode. Dropping request."):JP({url:i,data:a||{},options:o||{},headers:s||{},retriesPerformedSoFar:c||0,callback:u,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError,onRateLimited:this.rateLimiter.on429Response})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),n}(),rh=1800,SR=60,mge=864e5,bge=function(){function e(t,n,r){Un(this,e),ct(this,"_sessionIdChangedHandlers",[]),this.uuidFn=r,this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null;var i=t.persistence_name||t.token,a=t.session_idle_timeout_seconds||rh;if(typeof a!="number"?(console.warn("[PostHog] session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=rh):a>rh?console.warn("[PostHog] session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a0&&arguments[0]!==void 0&&arguments[0],n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),r=Co(this._getSessionId(),3),i=r[0],a=r[1],o=r[2],s=this._getWindowId(),u=o&&o>0&&Math.abs(n-o)>mge,c=!1;!a||!t&&Math.abs(n-i)>this._sessionTimeoutMs||u?(a=this.uuidFn(),s=this.uuidFn(),o=n,c=!0):s||(s=this.uuidFn(),c=!0);var p=i===0||!t||u?n:i,f=o===0?new Date().getTime():o;return this._setWindowId(s),this._setSessionId(a,p,f),c&&this._sessionIdChangedHandlers.forEach(function(m){return m(a,s)}),{sessionId:a,windowId:s,sessionStartTimestamp:f}}}]),e}(),yge=$n(function e(t,n,r,i){Un(this,e),this.name="posthog-js",this.setupOnce=function(a){a(function(o){var s,u,c,p,f;if(o.level!=="error"||!t.__loaded)return o;o.tags||(o.tags={});var m=t.config.ui_host||t.config.api_host;o.tags["PostHog Person URL"]=m+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var g=((s=o.exception)===null||s===void 0?void 0:s.values)||[],b={$exception_message:(u=g[0])===null||u===void 0?void 0:u.value,$exception_type:(c=g[0])===null||c===void 0?void 0:c.type,$exception_personURL:m+"/person/"+t.get_distinct_id(),$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(p=g[0])===null||p===void 0?void 0:p.value,$sentry_exception_type:(f=g[0])===null||f===void 0?void 0:f.type,$sentry_tags:o.tags};return n&&r&&(b.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+o.event_id),t.capture("$exception",b),o})}}),Ege=function(e){Promise&&Promise.resolve||console.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(n,r){n.event.userId||n.event.anonymousId===e.get_distinct_id()||e.reset(),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:n.event.userId}),e.reloadFeatureFlags());var i=e._calculate_event_properties(r,n.event.properties);return n.event.properties=Object.assign({},i,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(n){return t(n,n.event.event)},page:function(n){return t(n,"$pageview")},identify:function(n){return t(n,"$identify")},screen:function(n){return t(n,"$screen")}}},vge=function(){function e(t){Un(this,e),ct(this,"_seenFirstPageView",!1),this.uuidFn=t}return $n(e,[{key:"onPageview",value:function(){this._seenFirstPageView&&(this._pageViewId=this.uuidFn()),this._seenFirstPageView=!0}},{key:"getPageViewId",value:function(){return this._pageViewId||(this._pageViewId=this.uuidFn()),this._pageViewId}}]),e}();function wR(e){return typeof Event<"u"&&eB(e,Event)}function eB(e,t){try{return e instanceof t}catch{return!1}}function AR(e){return e===null||pl(e)!=="object"&&typeof e!="function"}function $h(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function N4(e){return $h(e,"DOMError")}var CR=/\(error: (.*)\)/,kR=50,zh="?";function O4(e,t,n,r){var i={filename:e,function:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var _ge=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Tge=/\((\S*)(?::(\d+))(?::(\d+))\)/,Sge=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wge=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Age=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Cge=(function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:0,o=[],s=i.split(` +`)).length,i=0;i127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),s!==null&&(n>t&&(a+=e.substring(t,n)),a+=s,t=n=i+1)}return n>t&&(a+=e.substring(t,e.length)),a},aR=function(e){var t=function(){var n=new Date().valueOf(),r=0;if(ht.performance&&ht.performance.now)r=1e4*ht.performance.now();else for(;n==new Date().valueOf();)r++;return n.toString(16)+Math.floor(r).toString(16)};return function(n){if(n==="og"||e==="og"){var r=typeof window<"u"?(window.screen.height*window.screen.width).toString(16):"0";return t()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var i,a,o=aa,s=0,u=[];function c(p,f){var m,g=0;for(m=0;m=4&&(s=c(s,u),u=[]);return u.length>0&&(s=c(s,u)),s.toString(16)}()+"-"+r+"-"+t()}return hhe().toString()}},The=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog|applebot|semrushbot|duckduckbot|twitterbot|rogerbot|linkedinbot|mj12bot|sitebulb|bot.htm|bot.php|hubspot|crawler|prerender)/i.test(e)},oR=function(e,t){var n=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),r=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(e);if(r===null||r&&typeof r[1]!="string"&&r[1].length)return"";var i=r[1];try{i=decodeURIComponent(i)}catch{In.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},sR=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Qd=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,a){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!a);else{var o="on"+n,s=t[o];t[o]=function(u,c,p){return function(f){if(f=f||e(window.event)){var m,g=!0;FP(p)&&(m=p(f));var b=c.call(u,f);return m!==!1&&b!==!1||(g=!1),g}}}(t,r,s)}else In.error("No valid element provided to register_event")}}();function pT(e,t){var n=function(){var r=jn.createElement("script");r.type="text/javascript",r.src=e,r.onload=function(o){return t(void 0,o)},r.onerror=function(o){return t(o)};var i,a=jn.querySelectorAll("body > script");a.length>0?(i=a[0].parentNode)===null||i===void 0||i.insertBefore(r,a[0]):jn.body.appendChild(r)};jn.body?n():jn.addEventListener("DOMContentLoaded",n)}var Sr={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(e||[]),n={};return hn(t,function(r){var i=oR(jn.URL,r);i.length&&(n[r]=i)}),n},searchEngine:function(){var e=jn.referrer;return e?e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null},searchInfo:function(){var e=Sr.searchEngine(),t=e!="yahoo"?"q":"p",n={};if(e!==null){n.$search_engine=e;var r=oR(jn.referrer,t);r.length&&(n.ph_keyword=r)}return n},browser:function(e,t,n){return t=t||"",n||fn(e," OPR/")?fn(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":fn(e,"IEMobile")||fn(e,"WPDesktop")?"Internet Explorer Mobile":fn(e,"SamsungBrowser/")?"Samsung Internet":fn(e,"Edge")||fn(e,"Edg/")?"Microsoft Edge":fn(e,"FBIOS")?"Facebook Mobile":fn(e,"Chrome")?"Chrome":fn(e,"CriOS")?"Chrome iOS":fn(e,"UCWEB")||fn(e,"UCBrowser")?"UC Browser":fn(e,"FxiOS")?"Firefox iOS":fn(t,"Apple")?fn(e,"Mobile")?"Mobile Safari":"Safari":fn(e,"Android")?"Android Mobile":fn(e,"Konqueror")?"Konqueror":fn(e,"Firefox")?"Firefox":fn(e,"MSIE")||fn(e,"Trident/")?"Internet Explorer":fn(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[Sr.browser(e,t,n)];if(r===void 0)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},browserLanguage:function(){return Ql.language||Ql.userLanguage},os:function(e){if(/Windows/i.test(e)){if(/Phone/.test(e)||/WPDesktop/.test(e))return{os_name:"Windows Phone",os_version:""};var t=/Windows NT ([0-9.]+)/i.exec(e);return t&&t[1]?{os_name:"Windows",os_version:t[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(e)){var n=/OS (\d+)_(\d+)_?(\d+)?/i.exec(e);return n&&n[1]?{os_name:"iOS",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(e)){var r=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(e);return r&&r[1]?{os_name:"Android",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(e))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(e)){var i=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(e);return i&&i[1]?{os_name:"Mac OS X",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(e)?{os_name:"Linux",os_version:""}:/CrOS/.test(e)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return t==="iPad"||t==="Android Tablet"?"Tablet":t?"Mobile":"Desktop"},referrer:function(){return jn.referrer||"$direct"},referringDomain:function(){if(!jn.referrer)return"$direct";var e=jn.createElement("a");return e.href=jn.referrer,e.host},properties:function(){var e=Sr.os(aa),t=e.os_name,n=e.os_version;return $r(Oy({$os:t,$os_version:n,$browser:Sr.browser(aa,Ql.vendor,ht.opera),$device:Sr.device(aa),$device_type:Sr.deviceType(aa)}),{$current_url:ht==null?void 0:ht.location.href,$host:ht==null?void 0:ht.location.host,$pathname:ht==null?void 0:ht.location.pathname,$browser_version:Sr.browserVersion(aa,Ql.vendor,ht.opera),$browser_language:Sr.browserLanguage(),$screen_height:ht==null?void 0:ht.screen.height,$screen_width:ht==null?void 0:ht.screen.width,$viewport_height:ht==null?void 0:ht.innerHeight,$viewport_width:ht==null?void 0:ht.innerWidth,$lib:"web",$lib_version:ma.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:BP()/1e3})},people_properties:function(){var e=Sr.os(aa),t=e.os_name,n=e.os_version;return $r(Oy({$os:t,$os_version:n,$browser:Sr.browser(aa,Ql.vendor,ht.opera)}),{$browser_version:Sr.browserVersion(aa,Ql.vendor,ht.opera)})}};function Zg(e){switch(pl(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function Qg(e){var t="";return Ph(e)&&!zP(e)&&e.childNodes&&e.childNodes.length&&hn(e.childNodes,function(n){$P(n)&&n.textContent&&(t+=Ry(n.textContent).split(/(\s+)/).filter(N1).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),Ry(t)}function lR(e){return!!e&&e.nodeType===1}function fu(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function $P(e){return!!e&&e.nodeType===3}function uR(e){return!!e&&e.nodeType===11}var k4=["a","button","form","input","select","textarea","label"];function Ph(e){for(var t=e;t.parentNode&&!fu(t,"body");t=t.parentNode){var n=Zg(t).split(" ");if(fn(n,"ph-sensitive")||fn(n,"ph-no-capture"))return!1}if(fn(Zg(e).split(" "),"ph-include"))return!0;var r=e.type||"";if(typeof r=="string")switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!(typeof i=="string"&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function zP(e){return!!(fu(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||fu(e,"select")||fu(e,"textarea")||e.getAttribute("contenteditable")==="true")}function N1(e){return!(e===null||ja(e)||typeof e=="string"&&(e=Ry(e),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(e)))}function cR(e){var t=Qg(e);return N1(t="".concat(t," ").concat(HP(e)).trim())?t:""}function HP(e){var t="";return e&&e.childNodes&&e.childNodes.length&&hn(e.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{var i=Qg(n);t="".concat(t," ").concat(i).trim(),n.childNodes&&n.childNodes.length&&(t="".concat(t," ").concat(HP(n)).trim())}catch(a){console.error(a)}}),t}var She=function(){function e(t){Un(this,e),this.clicks=[],this.enabled=t}return $n(e,[{key:"isRageClick",value:function(t,n,r){if(!this.enabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(n-i.y)<30&&r-i.timestamp<1e3){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}]),e}(),whe=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,yo={is_supported:function(){return!0},error:function(e){In.error("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?i.$el_text=cR(e):i.$el_text=Qg(e));var a=Zg(e);a.length>0&&(i.classes=a.split(" ").filter(function(c){return c!==""})),hn(e.attributes,function(c){var p;zP(e)&&["name","id","class"].indexOf(c.name)===-1||!t&&N1(c.value)&&(typeof(p=c.name)!="string"||p.substring(0,10)!=="_ngcontent"&&p.substring(0,7)!=="_nghost")&&(i["attr__"+c.name]=c.value)});for(var o=1,s=1,u=e;u=this._previousElementSibling(u);)o++,u.tagName===e.tagName&&s++;return i.nth_child=o,i.nth_of_type=s,i},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return hn(document.querySelectorAll(e.css_selector),function(n){var r;["input","select"].indexOf(n.tagName.toLowerCase())>-1?r=n.value:n.textContent&&(r=n.textContent),N1(r)&&t.push(r)}),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return hn(this._customProperties,function(r){hn(r.event_selectors,function(i){hn(document.querySelectorAll(i),function(a){fn(e,a)&&Ph(a)&&(n[r.name]=t._extractCustomPropertyValue(r))})})}),n},_getEventTarget:function(e){return e.target===void 0?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"$autocapture",a=this._getEventTarget(e);if($P(a)&&(a=a.parentNode||null),i==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&(n=this.rageclicks)!==null&&n!==void 0&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,t,"$rageclick"),a&&function(g,b){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!g||fu(g,"html")||!lR(g))return!1;if(y!=null&&y.url_allowlist){var T=window.location.href,E=y.url_allowlist;if(E&&!E.some(function($){return T.match($)}))return!1}if(y!=null&&y.dom_event_allowlist){var v=y.dom_event_allowlist;if(v&&!v.some(function($){return b.type===$}))return!1}if(y!=null&&y.element_allowlist){var w=y.element_allowlist;if(w&&!w.some(function($){return g.tagName.toLowerCase()===$}))return!1}if(y!=null&&y.css_selector_allowlist){var A=y.css_selector_allowlist;if(A&&!A.some(function($){return g.matches($)}))return!1}for(var R=!1,k=[g],N=!0,B=g;B.parentNode&&!fu(B,"body");)if(uR(B.parentNode))k.push(B.parentNode.host),B=B.parentNode.host;else{if(!(N=B.parentNode||!1))break;if(k4.indexOf(N.tagName.toLowerCase())>-1)R=!0;else{var q=window.getComputedStyle(N);q&&q.getPropertyValue("cursor")==="pointer"&&(R=!0)}k.push(N),B=N}var P=window.getComputedStyle(g);if(P&&P.getPropertyValue("cursor")==="pointer"&&b.type==="click")return!0;var Q=g.tagName.toLowerCase();switch(Q){case"html":return!1;case"form":return b.type==="submit";case"input":case"select":case"textarea":return b.type==="change"||b.type==="click";default:return R?b.type==="click":b.type==="click"&&(k4.indexOf(Q)>-1||g.getAttribute("contenteditable")==="true")}}(a,e,this.config)){for(var o=[a],s=a;s.parentNode&&!fu(s,"body");)uR(s.parentNode)?(o.push(s.parentNode.host),s=s.parentNode.host):(o.push(s.parentNode),s=s.parentNode);var u,c=[],p={},f=!1;if(hn(o,function(g){var b=Ph(g);g.tagName.toLowerCase()==="a"&&(u=g.getAttribute("href"),u=b&&N1(u)&&u),fn(Zg(g).split(" "),"ph-no-capture")&&(f=!0),c.push(r._getPropertiesFromElement(g,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")));var y=r._getAugmentPropertiesFromElement(g);$r(p,y)}),t.get_config("mask_all_text")||(a.tagName.toLowerCase()==="a"||a.tagName.toLowerCase()==="button"?c[0].$el_text=cR(a):c[0].$el_text=Qg(a)),u&&(c[0].attr__href=u),f)return!1;var m=$r(this._getDefaultProperties(e.type),{$elements:c},this._getCustomProperties(o),p);return t.capture(i,m),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,n=function(r){r=r||window.event,t._captureEvent(r,e)};Qd(document,"submit",n,!1,!0),Qd(document,"change",n,!1,!0),Qd(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;typeof e.__autocapture!="boolean"&&(this.config=e.__autocapture),(t=this.config)!==null&&t!==void 0&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map(function(n){return new RegExp(n)})),this.rageclicks=new She(e.get_config("rageclick"))},afterDecideResponse:function(e,t){var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?In.log('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(ct({},dR,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=ja(t)?10:t,n=ja(n)?10:n;for(var r=0,i=0;i1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],i="".concat(r),a=this.instance.get_property(Jg)||{};return!n.send_event&&"send_event"in n||t in a&&a[t].includes(i)||(Array.isArray(a[t])?a[t].push(i):a[t]=[i],this.instance.persistence.register(ct({},Jg,a)),this.instance.capture("$feature_flag_called",{$feature_flag:t,$feature_flag_response:r})),r}console.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(t){return this.getFlagPayloads()[t]}},{key:"isFeatureEnabled",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(t,n);console.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(t){this.featureFlagEventHandlers.push(t)}},{key:"removeFeatureFlagsHandler",value:function(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(n){return n!==t})}},{key:"receivedFeatureFlags",value:function(t){this.instance.decideEndpointWasHit=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads();(function(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=i.featureFlags,c=i.featureFlagPayloads;if(u)if(Array.isArray(u)){var p,f={};if(u)for(var m=0;m1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(Fy);if(i&&!r)return t(i);this.instance._send_request("".concat(this.instance.get_config("api_host"),"/api/early_access_features/?token=").concat(this.instance.get_config("token")),{},{method:"GET"},function(a){var o=a.earlyAccessFeatures;return n.instance.persistence.register(ct({},Fy,o)),t(o)})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter(function(r){return n[r]}),flagVariants:Object.keys(n).filter(function(r){return n[r]}).reduce(function(r,i){return r[i]=n[i],r},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(function(i){return i(n,r)})}},{key:"setPersonPropertiesForFlags",value:function(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(D1)||{};this.instance.register(ct({},D1,vt(vt({},r),t))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(D1)}},{key:"setGroupPropertiesForFlags",value:function(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Vs)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(function(i){r[i]=vt(vt({},r[i]),t[i]),delete t[i]}),this.instance.register(ct({},Vs,vt(vt({},r),t))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(t){if(t){var n=this.instance.get_property(Vs)||{};this.instance.register(ct({},Vs,vt(vt({},n),{},ct({},t,{}))))}else this.instance.unregister(Vs)}}]),e}(),Ihe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==",bR=2,Rhe=4,GP=3,Nhe=6,Ohe=0,Dhe=5e6,Lhe="rrweb/console@1",fo,Mhe=$n(function e(t){var n,r,i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Un(this,e),ct(this,"bucketSize",100),ct(this,"refillRate",10),ct(this,"mutationBuckets",{}),ct(this,"loggedTracker",{}),ct(this,"refillBuckets",function(){Object.keys(i.mutationBuckets).forEach(function(o){i.mutationBuckets[o]=i.mutationBuckets[o]+i.refillRate,i.mutationBuckets[o]>=i.bucketSize&&delete i.mutationBuckets[o]})}),ct(this,"getNodeOrRelevantParent",function(o){var s=i.rrweb.mirror.getNode(o);if((s==null?void 0:s.nodeName)!=="svg"&&s instanceof Element){var u=s.closest("svg");if(u)return[i.rrweb.mirror.getId(u),u]}return[o,s]}),ct(this,"numberOfChanges",function(o){var s,u,c,p,f,m,g,b;return((s=(u=o.removes)===null||u===void 0?void 0:u.length)!==null&&s!==void 0?s:0)+((c=(p=o.attributes)===null||p===void 0?void 0:p.length)!==null&&c!==void 0?c:0)+((f=(m=o.texts)===null||m===void 0?void 0:m.length)!==null&&f!==void 0?f:0)+((g=(b=o.adds)===null||b===void 0?void 0:b.length)!==null&&g!==void 0?g:0)}),ct(this,"throttleMutations",function(o){if(o.type!==GP||o.data.source!==Ohe)return o;var s=o.data,u=i.numberOfChanges(s);s.attributes&&(s.attributes=s.attributes.filter(function(p){var f,m,g,b=Co(i.getNodeOrRelevantParent(p.id),2),y=b[0],T=b[1];return i.mutationBuckets[y]===0?!1:(i.mutationBuckets[y]=(f=i.mutationBuckets[y])!==null&&f!==void 0?f:i.bucketSize,i.mutationBuckets[y]=Math.max(i.mutationBuckets[y]-1,0),i.mutationBuckets[y]===0&&(i.loggedTracker[y]||(i.loggedTracker[y]=!0,(m=(g=i.options).onBlockedNode)===null||m===void 0||m.call(g,y,T))),p)}));var c=i.numberOfChanges(s);return c!==0||u===c?o:void 0}),this.rrweb=t,this.options=a,this.refillRate=(n=this.options.refillRate)!==null&&n!==void 0?n:this.refillRate,this.bucketSize=(r=this.options.bucketSize)!==null&&r!==void 0?r:this.bucketSize,setInterval(function(){i.refillBuckets()},1e3)}),Fhe="/s/",VP="sessionRecording";(function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"})(fo||(fo={}));var Phe=[fo.MouseMove,fo.MouseInteraction,fo.Scroll,fo.ViewportResize,fo.Input,fo.TouchMove,fo.MediaInteraction,fo.Drag],Bhe=function(){function e(t){var n=this;Un(this,e),ct(this,"lastActivityTimestamp",Date.now()),ct(this,"isIdle",!1),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint=Fhe,this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1,window.addEventListener("beforeunload",function(){n._flushBuffer()})}return $n(e,[{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var t=!!this.instance.get_property(Ly),n=!this.instance.get_config("disable_session_recording");return t&&n}},{key:"isConsoleLogCaptureEnabled",value:function(){var t=!!this.instance.get_property(pR),n=this.instance.get_config("enable_recording_console_log");return n??t}},{key:"getRecordingVersion",value:function(){var t,n=this.instance.get_property(fR);return((t=this.instance.get_config("session_recording"))===null||t===void 0?void 0:t.recorderVersion)||n||"v1"}},{key:"afterDecideResponse",value:function(t){var n,r,i,a,o,s;this.receivedDecide=!0,this.instance.persistence&&this.instance.persistence.register((ct(o={},Ly,!!t.sessionRecording),ct(o,pR,(i=t.sessionRecording)===null||i===void 0?void 0:i.consoleLogRecordingEnabled),ct(o,fR,(a=t.sessionRecording)===null||a===void 0?void 0:a.recorderVersion),o)),(n=t.sessionRecording)!==null&&n!==void 0&&n.endpoint&&(this.endpoint=(s=t.sessionRecording)===null||s===void 0?void 0:s.endpoint),(r=t.sessionRecording)!==null&&r!==void 0&&r.recorderVersion&&(this.recorderVersion=t.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"log",value:function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(n=this.instance.sessionRecording)===null||n===void 0||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:r,trace:[],payload:[JSON.stringify(t)]}},timestamp:BP()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var t=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach(function(n){return t._captureSnapshotBuffered(n)})),this._startCapture()}},{key:"_startCapture",value:function(){var t=this;if(Object.assign!==void 0&&!this.captureStarted&&!this.instance.get_config("disable_session_recording")){this.captureStarted=!0,this.instance.sessionManager.checkAndGetSessionAndWindowId();var n=this.getRecordingVersion()==="v2"?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.getRecordingVersion()?pT(this.instance.get_config("api_host")+"/static/".concat(n,"?v=").concat(ma.LIB_VERSION),function(r){if(r)return In.error("Could not load ".concat(n),r);t._onScriptLoaded()}):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(t){var n;return t.type===GP&&Phe.indexOf((n=t.data)===null||n===void 0?void 0:n.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(t){var n=this._isInteractiveEvent(t);if(n||this.isIdle||t.timestamp-this.lastActivityTimestamp>3e5&&(this.isIdle=!0),n&&(this.lastActivityTimestamp=t.timestamp,this.isIdle&&(this.isIdle=!1,this._tryTakeFullSnapshot())),!this.isIdle){var r=this.instance.sessionManager.checkAndGetSessionAndWindowId(!n,t.timestamp),i=r.windowId,a=r.sessionId;[bR,Rhe].indexOf(t.type)!==-1||this.windowId===i&&this.sessionId===a||this._tryTakeFullSnapshot(),this.windowId=i,this.sessionId=a}}},{key:"_tryTakeFullSnapshot",value:function(){if(!this.captureStarted)return!1;try{var t;return(t=this.rrwebRecord)===null||t===void 0||t.takeFullSnapshot(),!0}catch(n){return In.error("Error taking full snapshot.",n),!1}}},{key:"_onScriptLoaded",value:function(){var t,n=this,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var i=this.instance.get_config("session_recording"),a=0,o=Object.entries(i||{});aDhe){var c,p=hs(u.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(p.s();!(c=p.n()).done;){var f=c.value;u=f[1].toLocaleLowerCase().slice(0,6)==="image/"?u.replace(f[0],Ihe):u.replace(f[0],"")}}catch(m){p.e(m)}finally{p.f()}}return{event:JSON.parse(u),size:u.length}}(function(s){var u=s;if(u&&pl(u)==="object"&&u.type===Nhe&&pl(u.data)==="object"&&u.data.plugin===Lhe){u.data.payload.payload.length>10&&(u.data.payload.payload=u.data.payload.payload.slice(0,10),u.data.payload.payload.push("...[truncated]"));for(var c=[],p=0;p2e3?c.push(u.data.payload.payload[p].slice(0,2e3)+"...[truncated]"):c.push(u.data.payload.payload[p]);return u.data.payload.payload=c,s}return s}(n)),i=r.event,a=r.size;if(this._updateWindowAndSessionIds(i),!this.isIdle){var o={$snapshot_bytes:a,$snapshot_data:i,$session_id:this.sessionId,$window_id:this.windowId};this.instance._captureMetrics.incr("rrweb-record"),this.instance._captureMetrics.incr("rrweb-record-".concat(i.type)),this.emit?this._captureSnapshotBuffered(o):this.snapshots.push(o)}}}}},{key:"_flushBuffer",value:function(){return this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0),this.buffer&&this.buffer.data.length!==0&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_captureSnapshotBuffered",value:function(t){var n,r=this,i=2+(((n=this.buffer)===null||n===void 0?void 0:n.data.length)||0);(!this.buffer||this.buffer.size+t.$snapshot_bytes+i>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=t.$snapshot_bytes,this.buffer.data.push(t.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){r._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(t){this.instance.capture("$snapshot",t,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:VP,_metrics:{rrweb_full_snapshot:t.$snapshot_data.type===bR}})}}]),e}(),lo={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},Uhe=["first-input","navigation","paint","resource"],$he=["/s/","/e/"],zhe=function(){function e(t){Un(this,e),ct(this,"_forceAllowLocalhost",!1),this.instance=t}return $n(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var t,n,r=this;if(!this.observer)if(((t=window)===null||t===void 0||(n=t.PerformanceObserver)===null||n===void 0?void 0:n.supportedEntryTypes)!==void 0)if(!mhe.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver(function(a){a.getEntries().forEach(function(o){r._capturePerformanceEvent(o)})});var i=PerformanceObserver.supportedEntryTypes.filter(function(a){return Uhe.includes(a)});i.forEach(function(a){var o;(o=r.observer)===null||o===void 0||o.observe({type:a,buffered:!0})})}catch(a){console.error("PostHog failed to start performance observer",a),this.stopObserving()}else In.log("PostHog Peformance observer not started because we are on localhost.");else In.log("PostHog Performance observer not started because PerformanceObserver is not supported by this browser.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var t,n;return(t=(n=this.instance.get_config("capture_performance"))!==null&&n!==void 0?n:this.remoteEnabled)!==null&&t!==void 0&&t}},{key:"afterDecideResponse",value:function(t){this.remoteEnabled=t.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(t){if(t.name.indexOf(this.instance.get_config("api_host"))===0){var n=t.name.replace(this.instance.get_config("api_host"),"");if($he.find(function(g){return n.indexOf(g)===0}))return}var r={url:t.name},i=this.instance.get_config("session_recording");if(i.maskNetworkRequestFn&&(r=i.maskNetworkRequestFn(r)),r){var a=t.toJSON();a.name=r.url;var o={},s=Math.floor(Date.now()-performance.now());for(var u in o[lo.timeOrigin]=s,o[lo.timestamp]=Math.floor(s+t.startTime),lo)a[u]!==void 0&&(o[lo[u]]=a[u]);if(this.capturePerformanceEvent(o),Hhe(t)){var c,p=hs(t.serverTiming||[]);try{for(p.s();!(c=p.n()).done;){var f,m=c.value;this.capturePerformanceEvent((ct(f={},lo.timeOrigin,s),ct(f,lo.timestamp,Math.floor(s+t.startTime)),ct(f,lo.name,m.name),ct(f,lo.duration,m.duration),ct(f,lo.entryType,"serverTiming"),f))}}catch(g){p.e(g)}finally{p.f()}}}}},{key:"capturePerformanceEvent",value:function(t){var n,r=t[lo.timestamp];(n=this.instance.sessionRecording)===null||n===void 0||n.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:t},timestamp:r})}}]),e}(),Hhe=function(e){return e.entryType==="navigation"||e.entryType==="resource"},jhe=function(){function e(t){Un(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return $n(e,[{key:"call",value:function(){var t=this,n=dT(JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(D1),group_properties:this.instance.get_property(Vs),disable_flags:this.instance.get_config("advanced_disable_feature_flags")||this.instance.get_config("advanced_disable_feature_flags_on_first_load")||void 0}));this.instance._send_request("".concat(this.instance.get_config("api_host"),"/decide/?v=3"),{data:n,verbose:!0},{method:"POST"},function(r){return t.parseDecideResponse(r)})}},{key:"parseDecideResponse",value:function(t){var n,r,i,a=this;if((t==null?void 0:t.status)!==0){if(!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){a.parseDecideResponse(t)},500);if(this.instance.toolbar.afterDecideResponse(t),(n=this.instance.sessionRecording)===null||n===void 0||n.afterDecideResponse(t),Ys.afterDecideResponse(t,this.instance),(r=this.instance.webPerformance)===null||r===void 0||r.afterDecideResponse(t),(i=this.instance.exceptionAutocapture)===null||i===void 0||i.afterDecideResponse(t),this.instance.get_config("advanced_disable_feature_flags_on_first_load")||this.instance.featureFlags.receivedFeatureFlags(t),this.instance.compression={},t.supportedCompression&&!this.instance.get_config("disable_compression")){var o,s={},u=hs(t.supportedCompression);try{for(u.s();!(o=u.n()).done;)s[o.value]=!0}catch(g){u.e(g)}finally{u.f()}this.instance.compression=s}if(t.siteApps)if(this.instance.get_config("opt_in_site_apps")){var c,p=this.instance.get_config("api_host"),f=hs(t.siteApps);try{var m=function(){var g=c.value,b=g.id,y=g.url,T=[p,p[p.length-1]==="/"&&y[0]==="/"?y.substring(1):y].join("");window["__$$ph_site_app_".concat(b)]=a.instance,pT(T,function(E){E&&console.error("Error while initializing PostHog app with config id ".concat(b),E)})};for(f.s();!(c=f.n()).done;)m()}catch(g){f.e(g)}finally{f.f()}}else t.siteApps.length>0&&console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),Ghe=["https://app.posthog.com","https://eu.posthog.com"],Vhe=["source"],Whe=function(){function e(t){Un(this,e),this.instance=t}return $n(e,[{key:"afterDecideResponse",value:function(t){var n=t.toolbarParams||t.editorParams||(t.toolbarVersion?{toolbarVersion:t.toolbarVersion}:{});t.isAuthenticated&&n.toolbarVersion&&n.toolbarVersion.indexOf("toolbar")===0&&this.loadToolbar(vt({},n))}},{key:"maybeLoadToolbar",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window.history;try{if(!n){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch{return!1}n=window.localStorage}var i,a=sR(t.hash,"__posthog")||sR(t.hash,"state"),o=a?JSON.parse(decodeURIComponent(a)):null;return o&&o.action==="ph_authorize"?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState("",document.title,t.pathname+t.search):t.hash="")):((i=JSON.parse(n.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.get_config("token")!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}},{key:"loadToolbar",value:function(t){var n=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var r=this.instance.get_config("api_host"),i=3e4*Math.floor(Date.now()/3e4),a="".concat(r).concat(r.endsWith("/")?"":"/","static/toolbar.js?_ts=").concat(i),o=!Ghe.includes(this.instance.get_config("api_host"))&&this.instance.get_config("advanced_disable_toolbar_metrics"),s=vt(vt({token:this.instance.get_config("token")},t),{},{apiURL:r},o?{instrument:!1}:{});s.source;var u=uhe(s,Vhe);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),pT(a,function(c){c?In.error("Failed to load toolbar",c):(window.ph_load_toolbar||window.ph_load_editor)(s,n.instance)}),Qd(window,"turbolinks:load",function(){window._postHogToolbarLoaded=!1,n.loadToolbar(s)}),!0}},{key:"_loadEditor",value:function(t){return this.loadToolbar(t)}},{key:"maybeLoadEditor",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window.history;return this.maybeLoadToolbar(t,n,r)}}]),e}(),qhe="__ph_opt_in_out_";function Khe(e,t){qP(!0,e,t)}function Yhe(e,t){qP(!1,e,t)}function Xhe(e,t){return WP(e,t)==="1"}function yR(e,t){return!!function(n){if(n&&n.respectDnt){var r=n&&n.window||ht,i=r.navigator||{},a=!1;return hn([i.doNotTrack,i.msDoNotTrack,r.doNotTrack],function(o){fn([!0,1,"1","yes"],o)&&(a=!0)}),a}return!1}(t)||WP(e,t)==="0"}function Zhe(e,t){fT(t=t||{}).remove(hT(e,t),!!t.crossSubdomainCookie)}function fT(e){return(e=e||{}).persistenceType==="localStorage"?Kn:e.persistenceType==="localStorage+cookie"?Dy:yo}function hT(e,t){return((t=t||{}).persistencePrefix||qhe)+e}function WP(e,t){return fT(t).get(hT(e,t))}function qP(e,t,n){PP(t)&&t.length?(fT(n=n||{}).set(hT(t,n),e?1:0,yhe(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}var KP=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:3e3;Un(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return $n(e,[{key:"setPollInterval",value:function(t){this._pollInterval=t,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return new Date().getTime()}}]),e}(),Qhe=function(e){NP(n,KP);var t=OP(n);function n(r,i){var a,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:3e3;return Un(this,n),(a=t.call(this,o)).handlePollRequest=i,a.captureMetrics=r,a}return $n(n,[{key:"enqueue",value:function(r,i,a){this.captureMetrics.incr("batch-enqueue"),this._event_queue.push({url:r,data:i,options:a}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var r=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(r._event_queue.length>0){var i=r.formatQueue(),a=function(s){var u=i[s],c=u.url,p=u.data,f=u.options;hn(p,function(m,g){p[g].offset=Math.abs(p[g].timestamp-r.getTime()),delete p[g].timestamp}),r.handlePollRequest(c,p,f),r.captureMetrics.incr("batch-requests"),r.captureMetrics.incr("batch-requests-".concat(c.slice(c.length-2))),r.captureMetrics.incr("batch-handle",p.length),r.captureMetrics.incr("batch-handle-".concat(c.slice(c.length-2)),p.length)};for(var o in i)a(o);r._event_queue.length=0,r._empty_queue_count=0}else r._empty_queue_count++;r._empty_queue_count>4&&(r.isPolling=!1,r._empty_queue_count=0),r.isPolling&&r.poll()},this._pollInterval)}},{key:"updateUnloadMetrics",value:function(){var r=this.formatQueue();for(var i in r){var a=r[i],o=a.url,s=a.data;this.captureMetrics.incr("batch-unload-requests"),this.captureMetrics.incr("batch-unload-requests-".concat(o.slice(o.length-2))),this.captureMetrics.incr("batch-unload",s.length),this.captureMetrics.incr("batch-unload-".concat(o.slice(o.length-2)),s.length)}}},{key:"unload",value:function(){var r=this;clearTimeout(this._poller);var i=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var a=Object.values(i);[].concat(xy(a.filter(function(o){return o.url.indexOf("/e")===0})),xy(a.filter(function(o){return o.url.indexOf("/e")!==0}))).map(function(o){var s=o.url,u=o.data,c=o.options;r.handlePollRequest(s,u,vt(vt({},c),{},{transport:"sendBeacon"}))})}},{key:"formatQueue",value:function(){var r={};return hn(this._event_queue,function(i){var a=i.url,o=i.data,s=i.options,u=(s?s._batchKey:null)||a;r[u]===void 0&&(r[u]={data:[],url:a,options:s}),s&&r[u].options&&r[u].options._metrics&&!r[u].options._metrics.rrweb_full_snapshot&&(r[u].options._metrics.rrweb_full_snapshot=s._metrics.rrweb_full_snapshot),r[u].data.push(o)}),r}}]),n}(),Jhe=function(){function e(t){Un(this,e),this.enabled=t,this.metrics={}}return $n(e,[{key:"incr",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.enabled&&(t="phjs-".concat(t),this.metrics[t]=(this.metrics[t]||0)+n)}},{key:"decr",value:function(t){this.enabled&&(t="phjs-".concat(t),this.metrics[t]=(this.metrics[t]||0)-1)}}]),e}(),Ui=Uint8Array,ni=Uint16Array,dc=Uint32Array,gT=new Ui([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mT=new Ui([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ER=new Ui([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),YP=function(e,t){for(var n=new ni(31),r=0;r<31;++r)n[r]=t+=1<>>1|(21845&Sn)<<1;ql=(61680&(ql=(52428&ql)>>>2|(13107&ql)<<2))>>>4|(3855&ql)<<4,zy[Sn]=((65280&ql)>>>8|(255&ql)<<8)>>>1}var Jd=function(e,t,n){for(var r=e.length,i=0,a=new ni(t);i>>u]=c}else for(o=new ni(r),i=0;i>>15-e[i];return o},wu=new Ui(288);for(Sn=0;Sn<144;++Sn)wu[Sn]=8;for(Sn=144;Sn<256;++Sn)wu[Sn]=9;for(Sn=256;Sn<280;++Sn)wu[Sn]=7;for(Sn=280;Sn<288;++Sn)wu[Sn]=8;var em=new Ui(32);for(Sn=0;Sn<32;++Sn)em[Sn]=5;var tu,tge=Jd(wu,9,0),nge=Jd(em,5,0),ZP=function(e){return(e/8>>0)+(7&e&&1)},QP=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof ni?ni:e instanceof dc?dc:Ui)(n-t);return r.set(e.subarray(t,n)),r},Ko=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},dd=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},R4=function(e,t){for(var n=[],r=0;rm&&(m=a[r].s);var g=new ni(m+1),b=rge(n[p-1],g,0);if(b>t){r=0;var y=0,T=b-t,E=1<t))break;y+=E-(1<>>=T;y>0;){var w=a[r].s;g[w]=0&&y;--r){var A=a[r].s;g[A]==t&&(--g[A],++y)}b=t}return[new Ui(g),b]},rge=function e(t,n,r){return t.s==-1?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},_R=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ni(++t),r=0,i=e[0],a=1,o=function(u){n[r++]=u},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},pd=function(e,t){for(var n=0,r=0;r>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;a4&&!P[ER[$-1]];--$);var oe,fe,ce,De,H=c+5<<3,W=pd(i,wu)+pd(a,em)+o,se=pd(i,m)+pd(a,y)+o+14+3*$+pd(N,P)+(2*N[16]+3*N[17]+7*N[18]);if(H<=W&&H<=se)return Uh(t,p,e.subarray(u,u+c));if(Ko(t,p,1+(se15&&(Ko(t,p,L[B]>>>5&127),p+=L[B]>>>12)}}}else oe=tge,fe=wu,ce=nge,De=em;for(B=0;B255){ie=r[B]>>>18&31,dd(t,p,oe[ie+257]),p+=fe[ie+257],ie>7&&(Ko(t,p,r[B]>>>23&31),p+=gT[ie]);var Se=31&r[B];dd(t,p,ce[Se]),p+=De[Se],Se>3&&(dd(t,p,r[B]>>>5&8191),p+=mT[Se])}else dd(t,p,oe[r[B]]),p+=fe[r[B]];return dd(t,p,oe[256]),p+fe[256]},ige=new dc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),age=new Ui(0),oge=function(){for(var e=new dc(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),sge=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r>>8;e=n},d:function(){return 4294967295^e}}},lge=function(e,t,n,r,i){return function(a,o,s,u,c,p){var f=a.length,m=new Ui(u+f+5*(1+Math.floor(f/7e3))+c),g=m.subarray(u,m.length-c),b=0;if(!o||f<8)for(var y=0;y<=f;y+=65535){var T=y+65535;T>>13,w=8191&E,A=(1<7e3||ce>24576)&&pe>423){b=TR(a,g,0,P,Q,$,fe,ce,H,y-H,b),ce=oe=fe=0,H=y;for(var le=0;le<286;++le)Q[le]=0;for(le=0;le<30;++le)$[le]=0}var L=2,ie=0,Se=w,X=se-D&32767;if(pe>2&&W==q(y-X))for(var ke=Math.min(v,pe)-1,te=Math.min(32767,y),Me=Math.min(258,pe);X<=te&&--Se&&se!=D;){if(a[y+L]==a[y+L-X]){for(var Re=0;ReL){if(L=Re,ie=X,Re>ke)break;var Ye=Math.min(X,Re-2),We=0;for(le=0;leWe&&(We=ot,D=dt)}}}X+=(se=D)-(D=R[se])+32768&32767}if(ie){P[ce++]=268435456|$y[L]<<18|vR[ie];var je=31&$y[L],pt=31&vR[ie];fe+=gT[je]+mT[pt],++Q[257+je],++$[pt],De=y+L,++oe}else P[ce++]=a[y],++Q[a[y]]}}b=TR(a,g,p,P,Q,$,fe,ce,H,y-H,b),p||(b=Uh(g,b,age))}return QP(m,0,u+ZP(b)+c)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Hy=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},uge=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Hy(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},cge=function(e){return 10+(e.filename&&e.filename.length+1||0)};function dge(e,t){t===void 0&&(t={});var n=sge(),r=e.length;n.p(e);var i=lge(e,t,cge(t),8),a=i.length;return uge(i,t),Hy(i,a-8,n.d()),Hy(i,a-4,r),i}function pge(e,t){var n=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new Ui(e.length+(e.length>>>1)),i=0,a=function(c){r[i++]=c},o=0;or.length){var s=new Ui(i+8+(n-o<<1));s.set(r),r=s}var u=e.charCodeAt(o);u<128||t?a(u):u<2048?(a(192|u>>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++o))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return QP(r,0,i)}(function(e){e.GZipJS="gzip-js",e.Base64="base64"})(tu||(tu={}));var fge=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=new Date().getTime().toString(),r.ver=ma.LIB_VERSION;var i=e.split("?");if(i.length>1){var a,o=hs(i[1].split("&"));try{for(o.s();!(a=o.n()).done;){var s=a.value.split("=")[0];r[s]&&delete r[s]}}catch(c){o.e(c)}finally{o.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(c){var p,f,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",g=[];return hn(c,function(b,y){p=encodeURIComponent(b.toString()),f=encodeURIComponent(y),g[g.length]=f+"="+p}),g.join(m)}(r)},bT=function e(t,n){if(n.blob&&t.buffer)return new Blob([t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r=e(t,{method:"POST"});return new Blob([r],{type:"application/x-www-form-urlencoded"})}if(n.method!=="POST")return null;var i,a;return i=Array.isArray(t)||(a=t,Object.prototype.toString.call(a)==="[object Uint8Array]")?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i},JP=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,a=e.captureMetrics,o=e.callback,s=e.retriesPerformedSoFar,u=e.retryQueue,c=e.onXHRError,p=e.timeout,f=p===void 0?1e4:p,m=e.onRateLimited,g=new XMLHttpRequest;g.open(i.method||"GET",t,!0);var b=bT(n,i);a.incr("_send_request"),a.incr("_send_request_inflight"),hn(r,function(y,T){g.setRequestHeader(T,y)}),i.method!=="POST"||i.blob||g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.timeout=f,g.withCredentials=!0,g.onreadystatechange=function(){if(g.readyState===4)if(a.incr("xhr-response"),a.incr("xhr-response-".concat(g.status)),a.decr("_send_request_inflight"),g.status===200){if(o){var y;try{y=JSON.parse(g.responseText)}catch(T){return void In.error(T)}o(y)}}else typeof c=="function"&&c(g),[401,403,404,500].indexOf(g.status)<0&&u.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(s||0)+1,callback:o}),g.status===429&&(m==null||m(g)),o&&o({status:0})},g.send(b)},hge=18e5,gge=function(e){NP(n,KP);var t=OP(n);function n(r,i,a){var o;return Un(this,n),(o=t.call(this)).captureMetrics=r,o.isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=i,o.rateLimiter=a,typeof window<"u"&&"onLine"in window.navigator&&(o.areWeOnline=window.navigator.onLine,window.addEventListener("online",function(){o._handleWeAreNowOnline()}),window.addEventListener("offline",function(){o.areWeOnline=!1})),o}return $n(n,[{key:"enqueue",value:function(r){var i=r.retriesPerformedSoFar||0;if(!(i>=10)){var a=function(s){var u=3e3*Math.pow(2,s),c=u/2,p=Math.min(hge,u),f=(Math.random()-.5)*(p-c);return Math.ceil(p+f)}(i),o=new Date(Date.now()+a);this.queue.push({retryAt:o,requestData:r}),console.warn("Enqueued failed request for retry in ".concat(a)),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var r=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){r.areWeOnline&&r.queue.length>0&&r.flush(),r.poll()},this._pollInterval)}},{key:"flush",value:function(){var r=new Date(Date.now()),i=this.queue.filter(function(u){return u.retryAt0){this.queue=this.queue.filter(function(u){return u.retryAt>=r});var a,o=hs(i);try{for(o.s();!(a=o.n()).done;){var s=a.value.requestData;this._executeXhrRequest(s)}}catch(u){o.e(u)}finally{o.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var r,i=hs(this.queue);try{for(i.s();!(r=i.n()).done;){var a=r.value.requestData,o=a.url,s=a.data,u=a.options;if(this.rateLimiter.isRateLimited(u._batchKey))ma.DEBUG&&console.warn("[PostHog RetryQueue] is quota limited. Dropping request.");else try{window.navigator.sendBeacon(o,bT(s,vt(vt({},u),{},{sendBeacon:!0})))}catch(c){ma.DEBUG&&console.error(c)}}}catch(c){i.e(c)}finally{i.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(r){var i=r.url,a=r.data,o=r.options,s=r.headers,u=r.callback,c=r.retriesPerformedSoFar;this.rateLimiter.isRateLimited(o._batchKey)?ma.DEBUG&&console.warn("[PostHog RetryQueue] in quota limited mode. Dropping request."):JP({url:i,data:a||{},options:o||{},headers:s||{},retriesPerformedSoFar:c||0,callback:u,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError,onRateLimited:this.rateLimiter.on429Response})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),n}(),rh=1800,SR=60,mge=864e5,bge=function(){function e(t,n,r){Un(this,e),ct(this,"_sessionIdChangedHandlers",[]),this.uuidFn=r,this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null;var i=t.persistence_name||t.token,a=t.session_idle_timeout_seconds||rh;if(typeof a!="number"?(console.warn("[PostHog] session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=rh):a>rh?console.warn("[PostHog] session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a0&&arguments[0]!==void 0&&arguments[0],n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),r=Co(this._getSessionId(),3),i=r[0],a=r[1],o=r[2],s=this._getWindowId(),u=o&&o>0&&Math.abs(n-o)>mge,c=!1;!a||!t&&Math.abs(n-i)>this._sessionTimeoutMs||u?(a=this.uuidFn(),s=this.uuidFn(),o=n,c=!0):s||(s=this.uuidFn(),c=!0);var p=i===0||!t||u?n:i,f=o===0?new Date().getTime():o;return this._setWindowId(s),this._setSessionId(a,p,f),c&&this._sessionIdChangedHandlers.forEach(function(m){return m(a,s)}),{sessionId:a,windowId:s,sessionStartTimestamp:f}}}]),e}(),yge=$n(function e(t,n,r,i){Un(this,e),this.name="posthog-js",this.setupOnce=function(a){a(function(o){var s,u,c,p,f;if(o.level!=="error"||!t.__loaded)return o;o.tags||(o.tags={});var m=t.config.ui_host||t.config.api_host;o.tags["PostHog Person URL"]=m+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var g=((s=o.exception)===null||s===void 0?void 0:s.values)||[],b={$exception_message:(u=g[0])===null||u===void 0?void 0:u.value,$exception_type:(c=g[0])===null||c===void 0?void 0:c.type,$exception_personURL:m+"/person/"+t.get_distinct_id(),$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(p=g[0])===null||p===void 0?void 0:p.value,$sentry_exception_type:(f=g[0])===null||f===void 0?void 0:f.type,$sentry_tags:o.tags};return n&&r&&(b.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+o.event_id),t.capture("$exception",b),o})}}),Ege=function(e){Promise&&Promise.resolve||console.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(n,r){n.event.userId||n.event.anonymousId===e.get_distinct_id()||e.reset(),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:n.event.userId}),e.reloadFeatureFlags());var i=e._calculate_event_properties(r,n.event.properties);return n.event.properties=Object.assign({},i,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(n){return t(n,n.event.event)},page:function(n){return t(n,"$pageview")},identify:function(n){return t(n,"$identify")},screen:function(n){return t(n,"$screen")}}},vge=function(){function e(t){Un(this,e),ct(this,"_seenFirstPageView",!1),this.uuidFn=t}return $n(e,[{key:"onPageview",value:function(){this._seenFirstPageView&&(this._pageViewId=this.uuidFn()),this._seenFirstPageView=!0}},{key:"getPageViewId",value:function(){return this._pageViewId||(this._pageViewId=this.uuidFn()),this._pageViewId}}]),e}();function wR(e){return typeof Event<"u"&&eB(e,Event)}function eB(e,t){try{return e instanceof t}catch{return!1}}function AR(e){return e===null||pl(e)!=="object"&&typeof e!="function"}function $h(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function N4(e){return $h(e,"DOMError")}var CR=/\(error: (.*)\)/,kR=50,zh="?";function O4(e,t,n,r){var i={filename:e,function:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var _ge=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Tge=/\((\S*)(?::(\d+))(?::(\d+))\)/,Sge=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wge=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Age=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Cge=(function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:0,o=[],s=i.split(` `),u=a;u1024)){var p=CR.test(c)?c.replace(CR,"$1"):c;if(!p.match(/\S*Error: /)){var f,m=hs(r);try{for(m.s();!(f=m.n()).done;){var g=(0,f.value)(p);if(g){o.push(g);break}}}catch(b){m.e(b)}finally{m.f()}if(o.length>=kR)break}}}return function(b){if(!b.length)return[];var y=b.slice(0,kR);return y.reverse(),y.map(function(T){return vt(vt({},T),{},{filename:T.filename||y[y.length-1].filename,function:T.function||"?"})})}(o)}}).apply(void 0,[[30,function(e){var t=_ge.exec(e);if(t){if(t[2]&&t[2].indexOf("eval")===0){var n=Tge.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}var r=Co(xR(t[1]||zh,t[2]),2),i=r[0];return O4(r[1],i,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,function(e){var t=Sge.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=wge.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],i=t[1]||zh,a=Co(xR(i,r),2);return i=a[0],O4(r=a[1],i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],[40,function(e){var t=Age.exec(e);return t?O4(t[2],t[1]||zh,+t[3],t[4]?+t[4]:void 0):void 0}]]),xR=function(e,t){var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:zh,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]},kge=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,xge=/Minified React error #\d+;/i;function Ige(e){var t=e.stacktrace||e.stack||"",n=function(r){if(r){if(typeof r.framesToPop=="number")return r.framesToPop;if(xge.test(r.message))return 1}return 0}(e);try{return Cge(t,n)}catch{}return[]}function D4(e){var t=Ige(e);return{$exception_type:e.name,$exception_message:e.message,$exception_stack_trace_raw:JSON.stringify(t)}}function Rge(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:40,n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>t))return r===n.length||i.length<=t?i:"".concat(i.slice(0,t),"...")}return""}function IR(e){var t=Co(e,5),n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s={};if(o===void 0&&typeof n=="string"){var u="Error",c=n,p=n.match(kge);p&&(u=p[1],c=p[2]),s={$exception_type:u,$exception_message:c}}var f=o||n;if(N4(f)||function(y){return $h(y,"DOMException")}(f)){var m=f;if(function(y){return"stack"in y}(f))s=D4(f);else{var g=m.name||(N4(m)?"DOMError":"DOMException"),b=m.message?"".concat(g,": ").concat(m.message):g;s=function(y){return{$exception_type:"Error",$exception_message:y}}(b),s.$exception_type=N4(m)?"DOMError":"DOMException",s.$exception_message=s.$exception_message||b}"code"in m&&(s.$exception_DOMException_code="".concat(m.code))}else(function(y){return $h(y,"ErrorEvent")})(f)&&f.error?s=D4(f.error):function(y){switch(Object.prototype.toString.call(y)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return eB(y,Error)}}(f)?s=D4(f):function(y){return $h(y,"Object")}(f)||wR(f)?(s=function(y){return{$exception_type:wR(y)?y.constructor.name:"Error",$exception_message:"Non-Error ".concat("exception"," captured with keys: ",Rge(y))}}(f),s.$exception_is_synthetic=!0):(s.$exception_type=s.$exception_type||"Error",s.$exception_message=s.$exception_message||f,s.$exception_is_synthetic=!0);return vt(vt(vt(vt({},s),{},{$exception_type:s.$exception_type||"UnknownErrorType",$exception_message:s.$exception_message||""},r?{$exception_source:r}:{}),i?{$exception_lineno:i}:{}),a?{$exception_colno:a}:{})}var RR,NR,Nge=function(){function e(t){Un(this,e),ct(this,"originalOnErrorHandler",void 0),ct(this,"originalOnUnhandledRejectionHandler",void 0),ct(this,"errorsToIgnore",[]),this.instance=t}return $n(e,[{key:"debugLog",value:function(){if(this.instance.get_config("debug")){for(var t,n=arguments.length,r=new Array(n),i=0;i1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(Py);if(i&&!r)return t(i);this.instance._send_request("".concat(this.instance.get_config("api_host"),"/api/surveys/?token=").concat(this.instance.get_config("token")),{},{method:"GET"},function(a){var o=a.surveys;return n.instance.persistence.register(ct({},Py,o)),t(o)})}},{key:"getActiveMatchingSurveys",value:function(t){var n=this,r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(i){var a=i.filter(function(o){return!(!o.start_date||o.end_date)}).filter(function(o){var s,u;if(!o.conditions)return!0;var c=(s=o.conditions)===null||s===void 0||!s.url||window.location.href.indexOf(o.conditions.url)>-1,p=(u=o.conditions)===null||u===void 0||!u.selector||document.querySelector(o.conditions.selector);return c&&p}).filter(function(o){if(!o.linked_flag_key&&!o.targeting_flag_key)return!0;var s=!o.linked_flag_key||n.instance.featureFlags.isFeatureEnabled(o.linked_flag_key),u=!o.targeting_flag_key||n.instance.featureFlags.isFeatureEnabled(o.targeting_flag_key);return s&&u});return t(a)},r)}}]),e}(),Dge={"X-PostHog-Retry-After-Recordings":VP,"X-PostHog-Retry-After-Events":"events"},Lge=function(){function e(){Un(this,e),ct(this,"limits",{})}return $n(e,[{key:"isRateLimited",value:function(t){var n=this.limits[t||"events"]||!1;return n!==!1&&new Date().getTime()1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var u,c={segmentRegister:!1,syncCode:!1},p=function(A){return function(){c[A]||(c[A]=!0,c.segmentRegister&&c.syncCode&&(s==null||s(i)))}};if(this.set_config($r({},OR(),a,{name:o,token:t,callback_fn:(o===gi?o:gi+"."+o)+"._jsc"})),this.uuidFn=aR(this.config.uuid_version||"og"),this._jsc=function(){},(ht!=null&&(n=ht.rrweb)!==null&&n!==void 0&&n.record||ht!=null&&ht.rrwebRecord)&&(this.__loaded_recorder_version=ht==null||(u=ht.rrweb)===null||u===void 0?void 0:u.version),this.persistence=new hR(this.config),this._captureMetrics=new Jhe(this.get_config("_capture_metrics")),this._requestQueue=new Qhe(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new gge(this._captureMetrics,this.get_config("on_xhr_error"),this.rateLimiter),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new bge(this.config,this.persistence,this.uuidFn),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new hR(vt(vt({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),a.segment?(this.config.get_device_id=function(){return a.segment.user().anonymousId()},a.segment.user().id()&&(this.register({distinct_id:a.segment.user().id()}),this.persistence.set_user_state("identified")),a.segment.register(this.segmentIntegration()).then(p("segmentRegister"))):p("segmentRegister")(),((r=a.bootstrap)===null||r===void 0?void 0:r.distinctID)!==void 0){var f,m,g=this.get_config("get_device_id")(this.uuidFn()),b=(f=a.bootstrap)!==null&&f!==void 0&&f.isIdentifiedID?g:a.bootstrap.distinctID;this.persistence.set_user_state((m=a.bootstrap)!==null&&m!==void 0&&m.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:b})}if(this._hasBootstrappedFeatureFlags()){var y,T,E=Object.keys(((y=a.bootstrap)===null||y===void 0?void 0:y.featureFlags)||{}).filter(function(A){var R,k;return!((R=a.bootstrap)===null||R===void 0||(k=R.featureFlags)===null||k===void 0||!k[A])}).reduce(function(A,R){var k,N;return A[R]=((k=a.bootstrap)===null||k===void 0||(N=k.featureFlags)===null||N===void 0?void 0:N[R])||!1,A},{}),v=Object.keys(((T=a.bootstrap)===null||T===void 0?void 0:T.featureFlagPayloads)||{}).filter(function(A){return E[A]}).reduce(function(A,R){var k,N,B,q;return(k=a.bootstrap)!==null&&k!==void 0&&(N=k.featureFlagPayloads)!==null&&N!==void 0&&N[R]&&(A[R]=(B=a.bootstrap)===null||B===void 0||(q=B.featureFlagPayloads)===null||q===void 0?void 0:q[R]),A},{});this.featureFlags.receivedFeatureFlags({featureFlags:E,featureFlagPayloads:v})}if(!this.get_distinct_id()){var w=this.get_config("get_device_id")(this.uuidFn());this.register_once({distinct_id:w,$device_id:w},""),this.persistence.set_user_state("anonymous")}ht.addEventListener&&ht.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),p("syncCode")()}},{key:"_loaded",value:function(){this.featureFlags.setReloadingPaused(!0);try{this.get_config("loaded")(this)}catch(t){console.error("`loaded` function failed",t)}this._start_queue_if_opted_in(),this.get_config("capture_pageview")&&this.capture("$pageview",{title:jn.title},{send_instantly:!0}),this.get_config("advanced_disable_decide")||new jhe(this).call(),this.featureFlags.resetRequestQueue(),this.featureFlags.setReloadingPaused(!1)}},{key:"_start_queue_if_opted_in",value:function(){this.has_opted_out_capturing()||this.get_config("request_batching")&&this._requestQueue.poll()}},{key:"_dom_loaded",value:function(){var t=this;this.has_opted_out_capturing()||os(this.__request_queue,function(n){t._send_request.apply(t,xy(n))}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(t,n){if(ja(t))return null;if(Hh)return function(o){t(o,n)};var r=this._jsc,i=""+Math.floor(1e8*Math.random()),a=this.get_config("callback_fn")+"["+i+"]";return r[i]=function(o){delete r[i],t(o,n)},a}},{key:"_handle_unload",value:function(){this.get_config("request_batching")?(this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave"),this.get_config("_capture_metrics")&&(this._requestQueue.updateUnloadMetrics(),this.capture("$capture_metrics",this._captureMetrics.metrics)),this._requestQueue.unload(),this._retryQueue.unload()):this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(t,n,r){var i=JSON.stringify(n);this.__compress_and_send_json_request(t,i,r||ih,jy)}},{key:"__compress_and_send_json_request",value:function(t,n,r,i){var a=function(c,p,f){return c===tu.GZipJS?[dge(pge(p),{mtime:0}),vt(vt({},f),{},{blob:!0,urlQueryArgs:{compression:tu.GZipJS}})]:[{data:dT(p)},f]}(this.compression[tu.GZipJS]?tu.GZipJS:tu.Base64,n,r),o=Co(a,2),s=o[0],u=o[1];this._send_request(t,s,u,i)}},{key:"_send_request",value:function(t,n,r,i){if(this.rateLimiter.isRateLimited(r._batchKey))this.get_config("debug")&&console.warn("[PostHog SendRequest] is quota limited. Dropping request.");else if(tB)this.__request_queue.push([t,n,r,i]);else{var a={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")};r=$r(a,r||{}),Hh||(r.method="GET");var o="sendBeacon"in ht.navigator&&r.transport==="sendBeacon";if(t=fge(t,r.urlQueryArgs||{},{ip:this.get_config("ip")}),o)try{ht.navigator.sendBeacon(t,bT(n,vt(vt({},r),{},{sendBeacon:!0})))}catch{}else if(Hh)try{JP({url:t,data:n,headers:this.get_config("xhr_headers"),options:r,captureMetrics:this._captureMetrics,callback:i,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.get_config("on_xhr_error"),onRateLimited:this.rateLimiter.on429Response})}catch(p){console.error(p)}else{var s,u=jn.createElement("script");u.type="text/javascript",u.async=!0,u.defer=!0,u.src=t;var c=jn.getElementsByTagName("script")[0];(s=c.parentNode)===null||s===void 0||s.insertBefore(u,c)}}}},{key:"_execute_array",value:function(t){var n,r=this,i=[],a=[],o=[];os(t,function(u){u&&(n=u[0],ts(n)?o.push(u):typeof u=="function"?u.call(r):ts(u)&&n==="alias"?i.push(u):ts(u)&&n.indexOf("capture")!==-1&&typeof r[n]=="function"?o.push(u):a.push(u))});var s=function(u,c){os(u,function(p){if(ts(p[0])){var f=c;hn(p,function(m){f=f[m[0]].apply(f,m.slice(1))})}else this[p[0]].apply(this,p.slice(1))},c)};s(i,this),s(a,this),s(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var t,n;return((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags)&&Object.keys((n=this.config.bootstrap)===null||n===void 0?void 0:n.featureFlags).length>0||!1}},{key:"push",value:function(t){this._execute_array([t])}},{key:"captureException",value:function(t,n){var r;(r=this.exceptionAutocapture)===null||r===void 0||r.captureException([t.name,void 0,void 0,void 0,t],n)}},{key:"capture",value:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ih;if(this.__loaded&&!function(c,p){var f=!1;try{var m=c.get_config("token"),g=c.get_config("respect_dnt"),b=c.get_config("opt_out_capturing_persistence_type"),y=c.get_config("opt_out_capturing_cookie_prefix")||void 0,T=c.get_config("window");m&&(f=yR(m,{respectDnt:g,persistenceType:b,persistencePrefix:y,window:T}))}catch(E){p||console.error("Unexpected error when checking capturing opt-out status: "+E)}return f}(this,!1)){this._captureMetrics.incr("capture"),t==="$snapshot"&&this._captureMetrics.incr("snapshot");var i=(r=r||ih).transport;if(i&&(r.transport=i),ja(t)||typeof t!="string")console.error("No event name provided to posthog.capture");else if(!The(aa)){this.sessionPersistence.update_search_keyword(),this.get_config("store_google")&&this.sessionPersistence.update_campaign_params(),this.get_config("save_referrer")&&this.sessionPersistence.update_referrer_info();var a={uuid:this.uuidFn("v7"),event:t,properties:this._calculate_event_properties(t,n||{})};t==="$identify"&&(a.$set=r.$set,a.$set_once=r.$set_once),(a=vhe(a,r._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=r.timestamp||new Date,this.get_config("debug")&&In.log("PostHog.js send",a);var o=JSON.stringify(a),s=this.get_config("api_host")+(r.endpoint||"/e/"),u=r!==ih;return!this.get_config("request_batching")||u&&!r._batchKey||r.send_instantly?this.__compress_and_send_json_request(s,o,r):this._requestQueue.enqueue(s,a,r),this._invokeCaptureHooks(t,a),a}}}},{key:"_addCaptureHook",value:function(t){this.__captureHooks.push(t)}},{key:"_invokeCaptureHooks",value:function(t,n){this.config._onCapture(t,n),hn(this.__captureHooks,function(r){return r(t)})}},{key:"_calculate_event_properties",value:function(t,n){var r,i=this.persistence.remove_event_timer(t),a=vt({},n);if(a.token=this.get_config("token"),t==="$snapshot"){var o=vt(vt({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=o.distinct_id,a}var s=Sr.properties();if(this.sessionManager){var u=this.sessionManager.checkAndGetSessionAndWindowId(),c=u.sessionId,p=u.windowId;a.$session_id=c,a.$window_id=p}if((r=this.webPerformance)!==null&&r!==void 0&&r.isEnabled&&(t==="$pageview"&&this.pageViewIdManager.onPageview(),a=$r(a,{$pageview_id:this.pageViewIdManager.getPageViewId()})),t==="$pageview"&&(a.title=jn.title),t==="$performance_event"){var f=this.persistence.properties();return a.distinct_id=f.distinct_id,a.$current_url=s.$current_url,a}if(i!==void 0){var m=new Date().getTime()-i;a.$duration=parseFloat((m/1e3).toFixed(3))}a=$r({},Sr.properties(),this.persistence.properties(),this.sessionPersistence.properties(),a);var g=this.get_config("property_blacklist");ts(g)?hn(g,function(y){delete a[y]}):console.error("Invalid value for property_blacklist config: "+g);var b=this.get_config("sanitize_properties");return b&&(a=b(a,t)),a}},{key:"register",value:function(t,n){this.persistence.register(t,n)}},{key:"register_once",value:function(t,n,r){this.persistence.register_once(t,n,r)}},{key:"register_for_session",value:function(t){this.sessionPersistence.register(t)}},{key:"unregister",value:function(t){this.persistence.unregister(t)}},{key:"unregister_for_session",value:function(t){this.sessionPersistence.unregister(t)}},{key:"_register_single",value:function(t,n){this.register(ct({},t,n))}},{key:"getFeatureFlag",value:function(t,n){return this.featureFlags.getFeatureFlag(t,n)}},{key:"getFeatureFlagPayload",value:function(t){var n=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(n)}catch{return n}}},{key:"isFeatureEnabled",value:function(t,n){return this.featureFlags.isFeatureEnabled(t,n)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(t,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,n)}},{key:"getEarlyAccessFeatures",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(t,n)}},{key:"onFeatureFlags",value:function(t){return this.featureFlags.onFeatureFlags(t)}},{key:"onSessionId",value:function(t){return this.sessionManager.onSessionId(t)}},{key:"getSurveys",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(t,n)}},{key:"getActiveMatchingSurveys",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(t,n)}},{key:"identify",value:function(t,n,r){if(t){this._captureMetrics.incr("identify");var i=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var a=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:a},"")}t!==i&&t!==this.get_property(Bh)&&(this.unregister(Bh),this.register({distinct_id:t}));var o=this.persistence.get_user_state()==="anonymous";t!==i&&o?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(n||{},!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this.featureFlags.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(Jg))}else console.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(t,n){(t||n)&&(this.setPersonPropertiesForFlags(t||{}),this.capture("$set",{$set:t||{},$set_once:n||{}}))}},{key:"group",value:function(t,n,r){if(t&&n){this._captureMetrics.incr("group");var i=this.getGroups();i[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:vt(vt({},i),{},ct({},t,n))}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags(ct({},t,r))),i[t]===n||r||this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(t,n)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setGroupPropertiesForFlags(t,n)}},{key:"resetGroupPropertiesForFlags",value:function(t){this.featureFlags.resetGroupPropertiesForFlags(t)}},{key:"reset",value:function(t){var n=this.get_property("$device_id");this.persistence.clear(),this.sessionPersistence.clear(),this.persistence.set_user_state("anonymous"),this.sessionManager.resetSessionId();var r=this.get_config("get_device_id")(this.uuidFn());this.register_once({distinct_id:r,$device_id:t?r:n},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){return this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId}},{key:"get_session_replay_url",value:function(t){var n=this.config.ui_host||this.config.api_host,r=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=r.sessionId,a=r.sessionStartTimestamp,o=n+"/replay/"+i;if(t!=null&&t.withTimestamp&&a){var s,u=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!a)return o;var c=Math.max(Math.floor((new Date().getTime()-a)/1e3)-u,0);o+="?t=".concat(c)}return o}},{key:"alias",value:function(t,n){return t===this.get_property(jP)?(In.critical("Attempting to create alias for existing People user - aborting."),-2):(ja(n)&&(n=this.get_distinct_id()),t!==n?(this._register_single(Bh,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(console.error("alias matches current distinct_id - skipping api call."),this.identify(t),-1))}},{key:"set_config",value:function(t){var n=vt({},this.config);Ny(t)&&($r(this.config,t),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),this.sessionPersistence&&this.sessionPersistence.update_config(this.config),Kn.is_supported()&&Kn.get("ph_debug")==="true"&&(this.config.debug=!0),this.get_config("debug")&&(ma.DEBUG=!0),this.sessionRecording&&t.disable_session_recording!==void 0&&n.disable_session_recording!==t.disable_session_recording&&(t.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var t;return!((t=this.sessionRecording)===null||t===void 0||!t.started())}},{key:"loadToolbar",value:function(t){return this.toolbar.loadToolbar(t)}},{key:"get_config",value:function(t){var n;return(n=this.config)===null||n===void 0?void 0:n[t]}},{key:"get_property",value:function(t){return this.persistence.props[t]}},{key:"getSessionProperty",value:function(t){return this.sessionPersistence.props[t]}},{key:"toString",value:function(){var t,n=(t=this.get_config("name"))!==null&&t!==void 0?t:gi;return n!==gi&&(n=gi+"."+n),n}},{key:"_gdpr_init",value:function(){this.get_config("opt_out_capturing_persistence_type")==="localStorage"&&Kn.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.get_config("opt_out_capturing_by_default")&&!yo.get("ph_optout")||(yo.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))}},{key:"_gdpr_update_persistence",value:function(t){var n;if(t&&t.clear_persistence)n=!0;else{if(!t||!t.enable_persistence)return;n=!1}this.get_config("disable_persistence")||this.persistence.disabled===n||this.persistence.set_disabled(n),this.get_config("disable_persistence")||this.sessionPersistence.disabled===n||this.sessionPersistence.set_disabled(n)}},{key:"_gdpr_call_func",value:function(t,n){return n=$r({capture:this.capture.bind(this),persistence_type:this.get_config("opt_out_capturing_persistence_type"),cookie_prefix:this.get_config("opt_out_capturing_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),secure_cookie:this.get_config("secure_cookie")},n||{}),Kn.is_supported()||n.persistence_type!=="localStorage"||(n.persistence_type="cookie"),t(this.get_config("token"),{capture:n.capture,captureEventName:n.capture_event_name,captureProperties:n.capture_properties,persistenceType:n.persistence_type,persistencePrefix:n.cookie_prefix,cookieExpiration:n.cookie_expiration,crossSubdomainCookie:n.cross_subdomain_cookie,secureCookie:n.secure_cookie})}},{key:"opt_in_capturing",value:function(t){t=$r({enable_persistence:!0},t||{}),this._gdpr_call_func(Khe,t),this._gdpr_update_persistence(t)}},{key:"opt_out_capturing",value:function(t){var n=$r({clear_persistence:!0},t||{});this._gdpr_call_func(Yhe,n),this._gdpr_update_persistence(n)}},{key:"has_opted_in_capturing",value:function(t){return this._gdpr_call_func(Xhe,t)}},{key:"has_opted_out_capturing",value:function(t){return this._gdpr_call_func(yR,t)}},{key:"clear_opt_in_out_capturing",value:function(t){var n=$r({enable_persistence:!0},t??{});this._gdpr_call_func(Zhe,n),this._gdpr_update_persistence(n)}},{key:"debug",value:function(t){t===!1?(ht.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(ht.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),e}();(function(e,t){for(var n=0;np(g,typeof g=="string"?null:g.state,b===0?"default":void 0));let a=u(n??i.length-1),o=Wn.Pop,s=null;function u(g){return Math.min(Math.max(g,0),i.length-1)}function c(){return i[a]}function p(g,b,y){b===void 0&&(b=null);let T=Vy(i?c().pathname:"/",g,b,y);return Au(T.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(g)),T}function f(g){return typeof g=="string"?g:D2(g)}return{get index(){return a},get action(){return o},get location(){return c()},createHref:f,createURL(g){return new URL(f(g),"http://localhost")},encodeLocation(g){let b=typeof g=="string"?Ro(g):g;return{pathname:b.pathname||"",search:b.search||"",hash:b.hash||""}},push(g,b){o=Wn.Push;let y=p(g,b);a+=1,i.splice(a,i.length,y),r&&s&&s({action:o,location:y,delta:1})},replace(g,b){o=Wn.Replace;let y=p(g,b);i[a]=y,r&&s&&s({action:o,location:y,delta:0})},go(g){o=Wn.Pop;let b=u(a+g),y=i[b];a=b,s&&s({action:o,location:y,delta:g})},listen(g){return s=g,()=>{s=null}}}}function $t(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Au(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Kge(){return Math.random().toString(36).substr(2,8)}function Vy(e,t,n,r){return n===void 0&&(n=null),Nn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ro(t):t,{state:n,key:t&&t.key||r||Kge()})}function D2(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ro(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var tr;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(tr||(tr={}));const Yge=new Set(["lazy","caseSensitive","path","id","index","children"]);function Xge(e){return e.index===!0}function Wy(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,a)=>{let o=[...n,a],s=typeof i.id=="string"?i.id:o.join("-");if($t(i.index!==!0||!i.children,"Cannot specify children on an index route"),$t(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),Xge(i)){let u=Nn({},i,t(i),{id:s});return r[s]=u,u}else{let u=Nn({},i,t(i),{id:s,children:void 0});return r[s]=u,i.children&&(u.children=Wy(i.children,t,o,r)),u}})}function L1(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Ro(t):t,i=hf(r.pathname||"/",n);if(i==null)return null;let a=rB(e);Zge(a);let o=null;for(let s=0;o==null&&s{let u={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};u.relativePath.startsWith("/")&&($t(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=fl([r,u.relativePath]),p=n.concat(u);a.children&&a.children.length>0&&($t(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),rB(a.children,t,p,c)),!(a.path==null&&!a.index)&&t.push({path:c,score:ime(c,a.index),routesMeta:p})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let u of iB(a.path))i(a,o,u)}),t}function iB(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=iB(r.join("/")),s=[];return s.push(...o.map(u=>u===""?a:[a,u].join("/"))),i&&s.push(...o),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function Zge(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ame(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Qge=/^:\w+$/,Jge=3,eme=2,tme=1,nme=10,rme=-2,DR=e=>e==="*";function ime(e,t){let n=e.split("/"),r=n.length;return n.some(DR)&&(r+=rme),t&&(r+=eme),n.filter(i=>!DR(i)).reduce((i,a)=>i+(Qge.test(a)?Jge:a===""?tme:nme),r)}function ame(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function ome(e,t){let{routesMeta:n}=e,r={},i="/",a=[];for(let o=0;o{if(p==="*"){let m=s[f]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}return c[p]=cme(s[f]||"",p),c},{}),pathname:a,pathnameBase:o,pattern:e}}function lme(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Au(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,s)=>(r.push(s),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function ume(e){try{return decodeURI(e)}catch(t){return Au(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function cme(e,t){try{return decodeURIComponent(e)}catch(n){return Au(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function hf(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function dme(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ro(e):e;return{pathname:n?n.startsWith("/")?n:pme(n,t):t,search:hme(r),hash:gme(i)}}function pme(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function L4(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function vT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function aB(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ro(e):(i=Nn({},e),$t(!i.pathname||!i.pathname.includes("?"),L4("?","pathname","search",i)),$t(!i.pathname||!i.pathname.includes("#"),L4("#","pathname","hash",i)),$t(!i.search||!i.search.includes("#"),L4("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(r||o==null)s=n;else{let f=t.length-1;if(o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),f-=1;i.pathname=m.join("/")}s=f>=0?t[f]:"/"}let u=dme(i,s),c=o&&o!=="/"&&o.endsWith("/"),p=(a||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||p)&&(u.pathname+="/"),u}const fl=e=>e.join("/").replace(/\/\/+/g,"/"),fme=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hme=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,gme=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class oB{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function sB(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lB=["post","put","patch","delete"],mme=new Set(lB),bme=["get",...lB],yme=new Set(bme),Eme=new Set([301,302,303,307,308]),vme=new Set([307,308]),M4={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},_me={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fd={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},uB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Tme=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function Sme(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;$t(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let G=e.detectErrorBoundary;i=K=>({hasErrorBoundary:G(K)})}else i=Tme;let a={},o=Wy(e.routes,i,void 0,a),s,u=e.basename||"/",c=Nn({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),p=null,f=new Set,m=null,g=null,b=null,y=e.hydrationData!=null,T=L1(o,e.history.location,u),E=null;if(T==null){let G=oa(404,{pathname:e.history.location.pathname}),{matches:K,route:ne}=zR(o);T=K,E={[ne.id]:G}}let v=!T.some(G=>G.route.lazy)&&(!T.some(G=>G.route.loader)||e.hydrationData!=null),w,A={historyAction:e.history.action,location:e.history.location,matches:T,initialized:v,navigation:M4,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},R=Wn.Pop,k=!1,N,B=!1,q=!1,P=[],Q=[],$=new Map,oe=0,fe=-1,ce=new Map,De=new Set,H=new Map,W=new Map,se=new Map,D=!1;function pe(){return p=e.history.listen(G=>{let{action:K,location:ne,delta:ve}=G;if(D){D=!1;return}Au(se.size===0||ve!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Qe=ue({currentLocation:A.location,nextLocation:ne,historyAction:K});if(Qe&&ve!=null){D=!0,e.history.go(ve*-1),jt(Qe,{state:"blocked",location:ne,proceed(){jt(Qe,{state:"proceeding",proceed:void 0,reset:void 0,location:ne}),e.history.go(ve)},reset(){let Fe=new Map(A.blockers);Fe.set(Qe,fd),ie({blockers:Fe})}});return}return te(K,ne)}),A.initialized||te(Wn.Pop,A.location),w}function le(){p&&p(),f.clear(),N&&N.abort(),A.fetchers.forEach((G,K)=>de(K)),A.blockers.forEach((G,K)=>Ye(K))}function L(G){return f.add(G),()=>f.delete(G)}function ie(G){A=Nn({},A,G),f.forEach(K=>K(A))}function Se(G,K){var ne,ve;let Qe=A.actionData!=null&&A.navigation.formMethod!=null&&Ba(A.navigation.formMethod)&&A.navigation.state==="loading"&&((ne=G.state)==null?void 0:ne._isRedirect)!==!0,Fe;K.actionData?Object.keys(K.actionData).length>0?Fe=K.actionData:Fe=null:Qe?Fe=A.actionData:Fe=null;let at=K.loaderData?$R(A.loaderData,K.loaderData,K.matches||[],K.errors):A.loaderData,rt=A.blockers;rt.size>0&&(rt=new Map(rt),rt.forEach((Rt,Qt)=>rt.set(Qt,fd)));let Je=k===!0||A.navigation.formMethod!=null&&Ba(A.navigation.formMethod)&&((ve=G.state)==null?void 0:ve._isRedirect)!==!0;s&&(o=s,s=void 0),B||R===Wn.Pop||(R===Wn.Push?e.history.push(G,G.state):R===Wn.Replace&&e.history.replace(G,G.state)),ie(Nn({},K,{actionData:Fe,loaderData:at,historyAction:R,location:G,initialized:!0,navigation:M4,revalidation:"idle",restoreScrollPosition:Ve(G,K.matches||A.matches),preventScrollReset:Je,blockers:rt})),R=Wn.Pop,k=!1,B=!1,q=!1,P=[],Q=[]}async function X(G,K){if(typeof G=="number"){e.history.go(G);return}let ne=qy(A.location,A.matches,u,c.v7_prependBasename,G,K==null?void 0:K.fromRouteId,K==null?void 0:K.relative),{path:ve,submission:Qe,error:Fe}=LR(c.v7_normalizeFormMethod,!1,ne,K),at=A.location,rt=Vy(A.location,ve,K&&K.state);rt=Nn({},rt,e.history.encodeLocation(rt));let Je=K&&K.replace!=null?K.replace:void 0,Rt=Wn.Push;Je===!0?Rt=Wn.Replace:Je===!1||Qe!=null&&Ba(Qe.formMethod)&&Qe.formAction===A.location.pathname+A.location.search&&(Rt=Wn.Replace);let Qt=K&&"preventScrollReset"in K?K.preventScrollReset===!0:void 0,kt=ue({currentLocation:at,nextLocation:rt,historyAction:Rt});if(kt){jt(kt,{state:"blocked",location:rt,proceed(){jt(kt,{state:"proceeding",proceed:void 0,reset:void 0,location:rt}),X(G,K)},reset(){let rn=new Map(A.blockers);rn.set(kt,fd),ie({blockers:rn})}});return}return await te(Rt,rt,{submission:Qe,pendingError:Fe,preventScrollReset:Qt,replace:K&&K.replace})}function ke(){if(U(),ie({revalidation:"loading"}),A.navigation.state!=="submitting"){if(A.navigation.state==="idle"){te(A.historyAction,A.location,{startUninterruptedRevalidation:!0});return}te(R||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation})}}async function te(G,K,ne){N&&N.abort(),N=null,R=G,B=(ne&&ne.startUninterruptedRevalidation)===!0,me(A.location,A.matches),k=(ne&&ne.preventScrollReset)===!0;let ve=s||o,Qe=ne&&ne.overrideNavigation,Fe=L1(ve,K,u);if(!Fe){let rn=oa(404,{pathname:K.pathname}),{matches:Xt,route:Wr}=zR(ve);Ee(),Se(K,{matches:Xt,loaderData:{},errors:{[Wr.id]:rn}});return}if(A.initialized&&!q&&xme(A.location,K)&&!(ne&&ne.submission&&Ba(ne.submission.formMethod))){Se(K,{matches:Fe});return}N=new AbortController;let at=gd(e.history,K,N.signal,ne&&ne.submission),rt,Je;if(ne&&ne.pendingError)Je={[M1(Fe).route.id]:ne.pendingError};else if(ne&&ne.submission&&Ba(ne.submission.formMethod)){let rn=await Me(at,K,ne.submission,Fe,{replace:ne.replace});if(rn.shortCircuited)return;rt=rn.pendingActionData,Je=rn.pendingActionError,Qe=ah(K,ne.submission),at=new Request(at.url,{signal:at.signal})}let{shortCircuited:Rt,loaderData:Qt,errors:kt}=await Re(at,K,Fe,Qe,ne&&ne.submission,ne&&ne.fetcherSubmission,ne&&ne.replace,rt,Je);Rt||(N=null,Se(K,Nn({matches:Fe},rt?{actionData:rt}:{},{loaderData:Qt,errors:kt})))}async function Me(G,K,ne,ve,Qe){Qe===void 0&&(Qe={}),U();let Fe=Dme(K,ne);ie({navigation:Fe});let at,rt=Yy(ve,K);if(!rt.route.action&&!rt.route.lazy)at={type:tr.error,error:oa(405,{method:G.method,pathname:K.pathname,routeId:rt.route.id})};else if(at=await hd("action",G,rt,ve,a,i,u),G.signal.aborted)return{shortCircuited:!0};if(K1(at)){let Je;return Qe&&Qe.replace!=null?Je=Qe.replace:Je=at.location===A.location.pathname+A.location.search,await je(A,at,{submission:ne,replace:Je}),{shortCircuited:!0}}if(tp(at)){let Je=M1(ve,rt.route.id);return(Qe&&Qe.replace)!==!0&&(R=Wn.Push),{pendingActionData:{},pendingActionError:{[Je.route.id]:at.error}}}if(su(at))throw oa(400,{type:"defer-action"});return{pendingActionData:{[rt.route.id]:at.data}}}async function Re(G,K,ne,ve,Qe,Fe,at,rt,Je){let Rt=ve||ah(K,Qe),Qt=Qe||Fe||GR(Rt),kt=s||o,[rn,Xt]=MR(e.history,A,ne,Qt,K,q,P,Q,H,De,kt,u,rt,Je);if(Ee(qt=>!(ne&&ne.some(Dr=>Dr.route.id===qt))||rn&&rn.some(Dr=>Dr.route.id===qt)),fe=++oe,rn.length===0&&Xt.length===0){let qt=Te();return Se(K,Nn({matches:ne,loaderData:{},errors:Je||null},rt?{actionData:rt}:{},qt?{fetchers:new Map(A.fetchers)}:{})),{shortCircuited:!0}}if(!B){Xt.forEach(Dr=>{let Si=A.fetchers.get(Dr.key),Nl=md(void 0,Si?Si.data:void 0);A.fetchers.set(Dr.key,Nl)});let qt=rt||A.actionData;ie(Nn({navigation:Rt},qt?Object.keys(qt).length===0?{actionData:null}:{actionData:qt}:{},Xt.length>0?{fetchers:new Map(A.fetchers)}:{}))}Xt.forEach(qt=>{$.has(qt.key)&&xe(qt.key),qt.controller&&$.set(qt.key,qt.controller)});let Wr=()=>Xt.forEach(qt=>xe(qt.key));N&&N.signal.addEventListener("abort",Wr);let{results:qr,loaderResults:Kr,fetcherResults:Aa}=await pt(A.matches,ne,rn,Xt,G);if(G.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",Wr),Xt.forEach(qt=>$.delete(qt.key));let si=HR(qr);if(si){if(si.idx>=rn.length){let qt=Xt[si.idx-rn.length].key;De.add(qt)}return await je(A,si.result,{replace:at}),{shortCircuited:!0}}let{loaderData:Or,errors:Es}=UR(A,ne,rn,Kr,Je,Xt,Aa,W);W.forEach((qt,Dr)=>{qt.subscribe(Si=>{(Si||qt.done)&&W.delete(Dr)})});let vs=Te(),Yr=Le(fe),_s=vs||Yr||Xt.length>0;return Nn({loaderData:Or,errors:Es},_s?{fetchers:new Map(A.fetchers)}:{})}function Ze(G){return A.fetchers.get(G)||_me}function We(G,K,ne,ve){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");$.has(G)&&xe(G);let Qe=s||o,Fe=qy(A.location,A.matches,u,c.v7_prependBasename,ne,K,ve==null?void 0:ve.relative),at=L1(Qe,Fe,u);if(!at){re(G,K,oa(404,{pathname:Fe}));return}let{path:rt,submission:Je,error:Rt}=LR(c.v7_normalizeFormMethod,!0,Fe,ve);if(Rt){re(G,K,Rt);return}let Qt=Yy(at,rt);if(k=(ve&&ve.preventScrollReset)===!0,Je&&Ba(Je.formMethod)){dt(G,K,rt,Qt,at,Je);return}H.set(G,{routeId:K,path:rt}),ot(G,K,rt,Qt,at,Je)}async function dt(G,K,ne,ve,Qe,Fe){if(U(),H.delete(G),!ve.route.action&&!ve.route.lazy){let Ke=oa(405,{method:Fe.formMethod,pathname:ne,routeId:K});re(G,K,Ke);return}let at=A.fetchers.get(G),rt=Lme(Fe,at);A.fetchers.set(G,rt),ie({fetchers:new Map(A.fetchers)});let Je=new AbortController,Rt=gd(e.history,ne,Je.signal,Fe);$.set(G,Je);let Qt=oe,kt=await hd("action",Rt,ve,Qe,a,i,u);if(Rt.signal.aborted){$.get(G)===Je&&$.delete(G);return}if(K1(kt))if($.delete(G),fe>Qt){let Ke=d1(void 0);A.fetchers.set(G,Ke),ie({fetchers:new Map(A.fetchers)});return}else{De.add(G);let Ke=md(Fe);return A.fetchers.set(G,Ke),ie({fetchers:new Map(A.fetchers)}),je(A,kt,{submission:Fe,isFetchActionRedirect:!0})}if(tp(kt)){re(G,K,kt.error);return}if(su(kt))throw oa(400,{type:"defer-action"});let rn=A.navigation.location||A.location,Xt=gd(e.history,rn,Je.signal),Wr=s||o,qr=A.navigation.state!=="idle"?L1(Wr,A.navigation.location,u):A.matches;$t(qr,"Didn't find any matches after fetcher action");let Kr=++oe;ce.set(G,Kr);let Aa=md(Fe,kt.data);A.fetchers.set(G,Aa);let[si,Or]=MR(e.history,A,qr,Fe,rn,q,P,Q,H,De,Wr,u,{[ve.route.id]:kt.data},void 0);Or.filter(Ke=>Ke.key!==G).forEach(Ke=>{let J=Ke.key,Be=A.fetchers.get(J),it=md(void 0,Be?Be.data:void 0);A.fetchers.set(J,it),$.has(J)&&xe(J),Ke.controller&&$.set(J,Ke.controller)}),ie({fetchers:new Map(A.fetchers)});let Es=()=>Or.forEach(Ke=>xe(Ke.key));Je.signal.addEventListener("abort",Es);let{results:vs,loaderResults:Yr,fetcherResults:_s}=await pt(A.matches,qr,si,Or,Xt);if(Je.signal.aborted)return;Je.signal.removeEventListener("abort",Es),ce.delete(G),$.delete(G),Or.forEach(Ke=>$.delete(Ke.key));let qt=HR(vs);if(qt){if(qt.idx>=si.length){let Ke=Or[qt.idx-si.length].key;De.add(Ke)}return je(A,qt.result)}let{loaderData:Dr,errors:Si}=UR(A,A.matches,si,Yr,void 0,Or,_s,W);if(A.fetchers.has(G)){let Ke=d1(kt.data);A.fetchers.set(G,Ke)}let Nl=Le(Kr);A.navigation.state==="loading"&&Kr>fe?($t(R,"Expected pending action"),N&&N.abort(),Se(A.navigation.location,{matches:qr,loaderData:Dr,errors:Si,fetchers:new Map(A.fetchers)})):(ie(Nn({errors:Si,loaderData:$R(A.loaderData,Dr,qr,Si)},Nl||Or.length>0?{fetchers:new Map(A.fetchers)}:{})),q=!1)}async function ot(G,K,ne,ve,Qe,Fe){let at=A.fetchers.get(G),rt=md(Fe,at?at.data:void 0);A.fetchers.set(G,rt),ie({fetchers:new Map(A.fetchers)});let Je=new AbortController,Rt=gd(e.history,ne,Je.signal);$.set(G,Je);let Qt=oe,kt=await hd("loader",Rt,ve,Qe,a,i,u);if(su(kt)&&(kt=await pB(kt,Rt.signal,!0)||kt),$.get(G)===Je&&$.delete(G),Rt.signal.aborted)return;if(K1(kt))if(fe>Qt){let Xt=d1(void 0);A.fetchers.set(G,Xt),ie({fetchers:new Map(A.fetchers)});return}else{De.add(G),await je(A,kt);return}if(tp(kt)){let Xt=M1(A.matches,K);A.fetchers.delete(G),ie({fetchers:new Map(A.fetchers),errors:{[Xt.route.id]:kt.error}});return}$t(!su(kt),"Unhandled fetcher deferred data");let rn=d1(kt.data);A.fetchers.set(G,rn),ie({fetchers:new Map(A.fetchers)})}async function je(G,K,ne){let{submission:ve,replace:Qe,isFetchActionRedirect:Fe}=ne===void 0?{}:ne;K.revalidate&&(q=!0);let at=Vy(G.location,K.location,Nn({_isRedirect:!0},Fe?{_isFetchActionRedirect:!0}:{}));if($t(at,"Expected a location on the redirect navigation"),uB.test(K.location)&&n){let Rt=e.history.createURL(K.location),Qt=hf(Rt.pathname,u)==null;if(t.location.origin!==Rt.origin||Qt){Qe?t.location.replace(K.location):t.location.assign(K.location);return}}N=null;let rt=Qe===!0?Wn.Replace:Wn.Push,Je=ve||GR(G.navigation);if(vme.has(K.status)&&Je&&Ba(Je.formMethod))await te(rt,at,{submission:Nn({},Je,{formAction:K.location}),preventScrollReset:k});else if(Fe)await te(rt,at,{overrideNavigation:ah(at),fetcherSubmission:Je,preventScrollReset:k});else{let Rt=ah(at,Je);await te(rt,at,{overrideNavigation:Rt,preventScrollReset:k})}}async function pt(G,K,ne,ve,Qe){let Fe=await Promise.all([...ne.map(Je=>hd("loader",Qe,Je,K,a,i,u)),...ve.map(Je=>Je.matches&&Je.match&&Je.controller?hd("loader",gd(e.history,Je.path,Je.controller.signal),Je.match,Je.matches,a,i,u):{type:tr.error,error:oa(404,{pathname:Je.path})})]),at=Fe.slice(0,ne.length),rt=Fe.slice(ne.length);return await Promise.all([jR(G,ne,at,at.map(()=>Qe.signal),!1,A.loaderData),jR(G,ve.map(Je=>Je.match),rt,ve.map(Je=>Je.controller?Je.controller.signal:null),!0)]),{results:Fe,loaderResults:at,fetcherResults:rt}}function U(){q=!0,P.push(...Ee()),H.forEach((G,K)=>{$.has(K)&&(Q.push(K),xe(K))})}function re(G,K,ne){let ve=M1(A.matches,K);de(G),ie({errors:{[ve.route.id]:ne},fetchers:new Map(A.fetchers)})}function de(G){let K=A.fetchers.get(G);$.has(G)&&!(K&&K.state==="loading"&&ce.has(G))&&xe(G),H.delete(G),ce.delete(G),De.delete(G),A.fetchers.delete(G)}function xe(G){let K=$.get(G);$t(K,"Expected fetch controller: "+G),K.abort(),$.delete(G)}function ye(G){for(let K of G){let ne=Ze(K),ve=d1(ne.data);A.fetchers.set(K,ve)}}function Te(){let G=[],K=!1;for(let ne of De){let ve=A.fetchers.get(ne);$t(ve,"Expected fetcher: "+ne),ve.state==="loading"&&(De.delete(ne),G.push(ne),K=!0)}return ye(G),K}function Le(G){let K=[];for(let[ne,ve]of ce)if(ve0}function ze(G,K){let ne=A.blockers.get(G)||fd;return se.get(G)!==K&&se.set(G,K),ne}function Ye(G){A.blockers.delete(G),se.delete(G)}function jt(G,K){let ne=A.blockers.get(G)||fd;$t(ne.state==="unblocked"&&K.state==="blocked"||ne.state==="blocked"&&K.state==="blocked"||ne.state==="blocked"&&K.state==="proceeding"||ne.state==="blocked"&&K.state==="unblocked"||ne.state==="proceeding"&&K.state==="unblocked","Invalid blocker state transition: "+ne.state+" -> "+K.state);let ve=new Map(A.blockers);ve.set(G,K),ie({blockers:ve})}function ue(G){let{currentLocation:K,nextLocation:ne,historyAction:ve}=G;if(se.size===0)return;se.size>1&&Au(!1,"A router only supports one blocker at a time");let Qe=Array.from(se.entries()),[Fe,at]=Qe[Qe.length-1],rt=A.blockers.get(Fe);if(!(rt&&rt.state==="proceeding")&&at({currentLocation:K,nextLocation:ne,historyAction:ve}))return Fe}function Ee(G){let K=[];return W.forEach((ne,ve)=>{(!G||G(ve))&&(ne.cancel(),K.push(ve),W.delete(ve))}),K}function qe(G,K,ne){if(m=G,b=K,g=ne||null,!y&&A.navigation===M4){y=!0;let ve=Ve(A.location,A.matches);ve!=null&&ie({restoreScrollPosition:ve})}return()=>{m=null,b=null,g=null}}function j(G,K){return g&&g(G,K.map(ve=>Ome(ve,A.loaderData)))||G.key}function me(G,K){if(m&&b){let ne=j(G,K);m[ne]=b()}}function Ve(G,K){if(m){let ne=j(G,K),ve=m[ne];if(typeof ve=="number")return ve}return null}function ge(G){a={},s=Wy(G,i,void 0,a)}return w={get basename(){return u},get state(){return A},get routes(){return o},initialize:pe,subscribe:L,enableScrollRestoration:qe,navigate:X,fetch:We,revalidate:ke,createHref:G=>e.history.createHref(G),encodeLocation:G=>e.history.encodeLocation(G),getFetcher:Ze,deleteFetcher:de,dispose:le,getBlocker:ze,deleteBlocker:Ye,_internalFetchControllers:$,_internalActiveDeferreds:W,_internalSetRoutes:ge},w}function wme(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function qy(e,t,n,r,i,a,o){let s,u;if(a!=null&&o!=="path"){s=[];for(let p of t)if(s.push(p),p.route.id===a){u=p;break}}else s=t,u=t[t.length-1];let c=aB(i||".",vT(s).map(p=>p.pathnameBase),hf(e.pathname,n)||e.pathname,o==="path");return i==null&&(c.search=e.search,c.hash=e.hash),(i==null||i===""||i===".")&&u&&u.route.index&&!_T(c.search)&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(c.pathname=c.pathname==="/"?n:fl([n,c.pathname])),D2(c)}function LR(e,t,n,r){if(!r||!wme(r))return{path:n};if(r.formMethod&&!Nme(r.formMethod))return{path:n,error:oa(405,{method:r.formMethod})};let i=()=>({path:n,error:oa(400,{type:"invalid-body"})}),a=r.formMethod||"get",o=e?a.toUpperCase():a.toLowerCase(),s=dB(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Ba(o))return i();let m=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,b)=>{let[y,T]=b;return""+g+y+"="+T+` + */function Nn(){return Nn=Object.assign?Object.assign.bind():function(e){for(var t=1;tp(g,typeof g=="string"?null:g.state,b===0?"default":void 0));let a=u(n??i.length-1),o=Wn.Pop,s=null;function u(g){return Math.min(Math.max(g,0),i.length-1)}function c(){return i[a]}function p(g,b,y){b===void 0&&(b=null);let T=Vy(i?c().pathname:"/",g,b,y);return Au(T.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(g)),T}function f(g){return typeof g=="string"?g:D2(g)}return{get index(){return a},get action(){return o},get location(){return c()},createHref:f,createURL(g){return new URL(f(g),"http://localhost")},encodeLocation(g){let b=typeof g=="string"?Ro(g):g;return{pathname:b.pathname||"",search:b.search||"",hash:b.hash||""}},push(g,b){o=Wn.Push;let y=p(g,b);a+=1,i.splice(a,i.length,y),r&&s&&s({action:o,location:y,delta:1})},replace(g,b){o=Wn.Replace;let y=p(g,b);i[a]=y,r&&s&&s({action:o,location:y,delta:0})},go(g){o=Wn.Pop;let b=u(a+g),y=i[b];a=b,s&&s({action:o,location:y,delta:g})},listen(g){return s=g,()=>{s=null}}}}function $t(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Au(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Kge(){return Math.random().toString(36).substr(2,8)}function Vy(e,t,n,r){return n===void 0&&(n=null),Nn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ro(t):t,{state:n,key:t&&t.key||r||Kge()})}function D2(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ro(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var tr;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(tr||(tr={}));const Yge=new Set(["lazy","caseSensitive","path","id","index","children"]);function Xge(e){return e.index===!0}function Wy(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,a)=>{let o=[...n,a],s=typeof i.id=="string"?i.id:o.join("-");if($t(i.index!==!0||!i.children,"Cannot specify children on an index route"),$t(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),Xge(i)){let u=Nn({},i,t(i),{id:s});return r[s]=u,u}else{let u=Nn({},i,t(i),{id:s,children:void 0});return r[s]=u,i.children&&(u.children=Wy(i.children,t,o,r)),u}})}function L1(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Ro(t):t,i=hf(r.pathname||"/",n);if(i==null)return null;let a=rB(e);Zge(a);let o=null;for(let s=0;o==null&&s{let u={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};u.relativePath.startsWith("/")&&($t(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=fl([r,u.relativePath]),p=n.concat(u);a.children&&a.children.length>0&&($t(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),rB(a.children,t,p,c)),!(a.path==null&&!a.index)&&t.push({path:c,score:ime(c,a.index),routesMeta:p})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let u of iB(a.path))i(a,o,u)}),t}function iB(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=iB(r.join("/")),s=[];return s.push(...o.map(u=>u===""?a:[a,u].join("/"))),i&&s.push(...o),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function Zge(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ame(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Qge=/^:\w+$/,Jge=3,eme=2,tme=1,nme=10,rme=-2,DR=e=>e==="*";function ime(e,t){let n=e.split("/"),r=n.length;return n.some(DR)&&(r+=rme),t&&(r+=eme),n.filter(i=>!DR(i)).reduce((i,a)=>i+(Qge.test(a)?Jge:a===""?tme:nme),r)}function ame(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function ome(e,t){let{routesMeta:n}=e,r={},i="/",a=[];for(let o=0;o{if(p==="*"){let m=s[f]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}return c[p]=cme(s[f]||"",p),c},{}),pathname:a,pathnameBase:o,pattern:e}}function lme(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Au(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,s)=>(r.push(s),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function ume(e){try{return decodeURI(e)}catch(t){return Au(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function cme(e,t){try{return decodeURIComponent(e)}catch(n){return Au(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function hf(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function dme(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ro(e):e;return{pathname:n?n.startsWith("/")?n:pme(n,t):t,search:hme(r),hash:gme(i)}}function pme(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function L4(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function vT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function aB(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ro(e):(i=Nn({},e),$t(!i.pathname||!i.pathname.includes("?"),L4("?","pathname","search",i)),$t(!i.pathname||!i.pathname.includes("#"),L4("#","pathname","hash",i)),$t(!i.search||!i.search.includes("#"),L4("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(r||o==null)s=n;else{let f=t.length-1;if(o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),f-=1;i.pathname=m.join("/")}s=f>=0?t[f]:"/"}let u=dme(i,s),c=o&&o!=="/"&&o.endsWith("/"),p=(a||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||p)&&(u.pathname+="/"),u}const fl=e=>e.join("/").replace(/\/\/+/g,"/"),fme=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hme=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,gme=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class oB{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function sB(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lB=["post","put","patch","delete"],mme=new Set(lB),bme=["get",...lB],yme=new Set(bme),Eme=new Set([301,302,303,307,308]),vme=new Set([307,308]),M4={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},_me={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fd={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},uB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Tme=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function Sme(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;$t(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let G=e.detectErrorBoundary;i=K=>({hasErrorBoundary:G(K)})}else i=Tme;let a={},o=Wy(e.routes,i,void 0,a),s,u=e.basename||"/",c=Nn({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),p=null,f=new Set,m=null,g=null,b=null,y=e.hydrationData!=null,T=L1(o,e.history.location,u),E=null;if(T==null){let G=oa(404,{pathname:e.history.location.pathname}),{matches:K,route:ne}=zR(o);T=K,E={[ne.id]:G}}let v=!T.some(G=>G.route.lazy)&&(!T.some(G=>G.route.loader)||e.hydrationData!=null),w,A={historyAction:e.history.action,location:e.history.location,matches:T,initialized:v,navigation:M4,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},R=Wn.Pop,k=!1,N,B=!1,q=!1,P=[],Q=[],$=new Map,oe=0,fe=-1,ce=new Map,De=new Set,H=new Map,W=new Map,se=new Map,D=!1;function pe(){return p=e.history.listen(G=>{let{action:K,location:ne,delta:ve}=G;if(D){D=!1;return}Au(se.size===0||ve!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Qe=ue({currentLocation:A.location,nextLocation:ne,historyAction:K});if(Qe&&ve!=null){D=!0,e.history.go(ve*-1),jt(Qe,{state:"blocked",location:ne,proceed(){jt(Qe,{state:"proceeding",proceed:void 0,reset:void 0,location:ne}),e.history.go(ve)},reset(){let Fe=new Map(A.blockers);Fe.set(Qe,fd),ie({blockers:Fe})}});return}return te(K,ne)}),A.initialized||te(Wn.Pop,A.location),w}function le(){p&&p(),f.clear(),N&&N.abort(),A.fetchers.forEach((G,K)=>de(K)),A.blockers.forEach((G,K)=>Xe(K))}function L(G){return f.add(G),()=>f.delete(G)}function ie(G){A=Nn({},A,G),f.forEach(K=>K(A))}function Se(G,K){var ne,ve;let Qe=A.actionData!=null&&A.navigation.formMethod!=null&&Ba(A.navigation.formMethod)&&A.navigation.state==="loading"&&((ne=G.state)==null?void 0:ne._isRedirect)!==!0,Fe;K.actionData?Object.keys(K.actionData).length>0?Fe=K.actionData:Fe=null:Qe?Fe=A.actionData:Fe=null;let at=K.loaderData?$R(A.loaderData,K.loaderData,K.matches||[],K.errors):A.loaderData,rt=A.blockers;rt.size>0&&(rt=new Map(rt),rt.forEach((Rt,Qt)=>rt.set(Qt,fd)));let Je=k===!0||A.navigation.formMethod!=null&&Ba(A.navigation.formMethod)&&((ve=G.state)==null?void 0:ve._isRedirect)!==!0;s&&(o=s,s=void 0),B||R===Wn.Pop||(R===Wn.Push?e.history.push(G,G.state):R===Wn.Replace&&e.history.replace(G,G.state)),ie(Nn({},K,{actionData:Fe,loaderData:at,historyAction:R,location:G,initialized:!0,navigation:M4,revalidation:"idle",restoreScrollPosition:Ve(G,K.matches||A.matches),preventScrollReset:Je,blockers:rt})),R=Wn.Pop,k=!1,B=!1,q=!1,P=[],Q=[]}async function X(G,K){if(typeof G=="number"){e.history.go(G);return}let ne=qy(A.location,A.matches,u,c.v7_prependBasename,G,K==null?void 0:K.fromRouteId,K==null?void 0:K.relative),{path:ve,submission:Qe,error:Fe}=LR(c.v7_normalizeFormMethod,!1,ne,K),at=A.location,rt=Vy(A.location,ve,K&&K.state);rt=Nn({},rt,e.history.encodeLocation(rt));let Je=K&&K.replace!=null?K.replace:void 0,Rt=Wn.Push;Je===!0?Rt=Wn.Replace:Je===!1||Qe!=null&&Ba(Qe.formMethod)&&Qe.formAction===A.location.pathname+A.location.search&&(Rt=Wn.Replace);let Qt=K&&"preventScrollReset"in K?K.preventScrollReset===!0:void 0,kt=ue({currentLocation:at,nextLocation:rt,historyAction:Rt});if(kt){jt(kt,{state:"blocked",location:rt,proceed(){jt(kt,{state:"proceeding",proceed:void 0,reset:void 0,location:rt}),X(G,K)},reset(){let rn=new Map(A.blockers);rn.set(kt,fd),ie({blockers:rn})}});return}return await te(Rt,rt,{submission:Qe,pendingError:Fe,preventScrollReset:Qt,replace:K&&K.replace})}function ke(){if(U(),ie({revalidation:"loading"}),A.navigation.state!=="submitting"){if(A.navigation.state==="idle"){te(A.historyAction,A.location,{startUninterruptedRevalidation:!0});return}te(R||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation})}}async function te(G,K,ne){N&&N.abort(),N=null,R=G,B=(ne&&ne.startUninterruptedRevalidation)===!0,me(A.location,A.matches),k=(ne&&ne.preventScrollReset)===!0;let ve=s||o,Qe=ne&&ne.overrideNavigation,Fe=L1(ve,K,u);if(!Fe){let rn=oa(404,{pathname:K.pathname}),{matches:Xt,route:Wr}=zR(ve);Ee(),Se(K,{matches:Xt,loaderData:{},errors:{[Wr.id]:rn}});return}if(A.initialized&&!q&&xme(A.location,K)&&!(ne&&ne.submission&&Ba(ne.submission.formMethod))){Se(K,{matches:Fe});return}N=new AbortController;let at=gd(e.history,K,N.signal,ne&&ne.submission),rt,Je;if(ne&&ne.pendingError)Je={[M1(Fe).route.id]:ne.pendingError};else if(ne&&ne.submission&&Ba(ne.submission.formMethod)){let rn=await Me(at,K,ne.submission,Fe,{replace:ne.replace});if(rn.shortCircuited)return;rt=rn.pendingActionData,Je=rn.pendingActionError,Qe=ah(K,ne.submission),at=new Request(at.url,{signal:at.signal})}let{shortCircuited:Rt,loaderData:Qt,errors:kt}=await Re(at,K,Fe,Qe,ne&&ne.submission,ne&&ne.fetcherSubmission,ne&&ne.replace,rt,Je);Rt||(N=null,Se(K,Nn({matches:Fe},rt?{actionData:rt}:{},{loaderData:Qt,errors:kt})))}async function Me(G,K,ne,ve,Qe){Qe===void 0&&(Qe={}),U();let Fe=Dme(K,ne);ie({navigation:Fe});let at,rt=Yy(ve,K);if(!rt.route.action&&!rt.route.lazy)at={type:tr.error,error:oa(405,{method:G.method,pathname:K.pathname,routeId:rt.route.id})};else if(at=await hd("action",G,rt,ve,a,i,u),G.signal.aborted)return{shortCircuited:!0};if(K1(at)){let Je;return Qe&&Qe.replace!=null?Je=Qe.replace:Je=at.location===A.location.pathname+A.location.search,await je(A,at,{submission:ne,replace:Je}),{shortCircuited:!0}}if(tp(at)){let Je=M1(ve,rt.route.id);return(Qe&&Qe.replace)!==!0&&(R=Wn.Push),{pendingActionData:{},pendingActionError:{[Je.route.id]:at.error}}}if(su(at))throw oa(400,{type:"defer-action"});return{pendingActionData:{[rt.route.id]:at.data}}}async function Re(G,K,ne,ve,Qe,Fe,at,rt,Je){let Rt=ve||ah(K,Qe),Qt=Qe||Fe||GR(Rt),kt=s||o,[rn,Xt]=MR(e.history,A,ne,Qt,K,q,P,Q,H,De,kt,u,rt,Je);if(Ee(qt=>!(ne&&ne.some(Dr=>Dr.route.id===qt))||rn&&rn.some(Dr=>Dr.route.id===qt)),fe=++oe,rn.length===0&&Xt.length===0){let qt=Te();return Se(K,Nn({matches:ne,loaderData:{},errors:Je||null},rt?{actionData:rt}:{},qt?{fetchers:new Map(A.fetchers)}:{})),{shortCircuited:!0}}if(!B){Xt.forEach(Dr=>{let Si=A.fetchers.get(Dr.key),Nl=md(void 0,Si?Si.data:void 0);A.fetchers.set(Dr.key,Nl)});let qt=rt||A.actionData;ie(Nn({navigation:Rt},qt?Object.keys(qt).length===0?{actionData:null}:{actionData:qt}:{},Xt.length>0?{fetchers:new Map(A.fetchers)}:{}))}Xt.forEach(qt=>{$.has(qt.key)&&xe(qt.key),qt.controller&&$.set(qt.key,qt.controller)});let Wr=()=>Xt.forEach(qt=>xe(qt.key));N&&N.signal.addEventListener("abort",Wr);let{results:qr,loaderResults:Kr,fetcherResults:Aa}=await pt(A.matches,ne,rn,Xt,G);if(G.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",Wr),Xt.forEach(qt=>$.delete(qt.key));let si=HR(qr);if(si){if(si.idx>=rn.length){let qt=Xt[si.idx-rn.length].key;De.add(qt)}return await je(A,si.result,{replace:at}),{shortCircuited:!0}}let{loaderData:Or,errors:Es}=UR(A,ne,rn,Kr,Je,Xt,Aa,W);W.forEach((qt,Dr)=>{qt.subscribe(Si=>{(Si||qt.done)&&W.delete(Dr)})});let vs=Te(),Yr=Le(fe),_s=vs||Yr||Xt.length>0;return Nn({loaderData:Or,errors:Es},_s?{fetchers:new Map(A.fetchers)}:{})}function Ye(G){return A.fetchers.get(G)||_me}function We(G,K,ne,ve){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");$.has(G)&&xe(G);let Qe=s||o,Fe=qy(A.location,A.matches,u,c.v7_prependBasename,ne,K,ve==null?void 0:ve.relative),at=L1(Qe,Fe,u);if(!at){re(G,K,oa(404,{pathname:Fe}));return}let{path:rt,submission:Je,error:Rt}=LR(c.v7_normalizeFormMethod,!0,Fe,ve);if(Rt){re(G,K,Rt);return}let Qt=Yy(at,rt);if(k=(ve&&ve.preventScrollReset)===!0,Je&&Ba(Je.formMethod)){dt(G,K,rt,Qt,at,Je);return}H.set(G,{routeId:K,path:rt}),ot(G,K,rt,Qt,at,Je)}async function dt(G,K,ne,ve,Qe,Fe){if(U(),H.delete(G),!ve.route.action&&!ve.route.lazy){let Ke=oa(405,{method:Fe.formMethod,pathname:ne,routeId:K});re(G,K,Ke);return}let at=A.fetchers.get(G),rt=Lme(Fe,at);A.fetchers.set(G,rt),ie({fetchers:new Map(A.fetchers)});let Je=new AbortController,Rt=gd(e.history,ne,Je.signal,Fe);$.set(G,Je);let Qt=oe,kt=await hd("action",Rt,ve,Qe,a,i,u);if(Rt.signal.aborted){$.get(G)===Je&&$.delete(G);return}if(K1(kt))if($.delete(G),fe>Qt){let Ke=d1(void 0);A.fetchers.set(G,Ke),ie({fetchers:new Map(A.fetchers)});return}else{De.add(G);let Ke=md(Fe);return A.fetchers.set(G,Ke),ie({fetchers:new Map(A.fetchers)}),je(A,kt,{submission:Fe,isFetchActionRedirect:!0})}if(tp(kt)){re(G,K,kt.error);return}if(su(kt))throw oa(400,{type:"defer-action"});let rn=A.navigation.location||A.location,Xt=gd(e.history,rn,Je.signal),Wr=s||o,qr=A.navigation.state!=="idle"?L1(Wr,A.navigation.location,u):A.matches;$t(qr,"Didn't find any matches after fetcher action");let Kr=++oe;ce.set(G,Kr);let Aa=md(Fe,kt.data);A.fetchers.set(G,Aa);let[si,Or]=MR(e.history,A,qr,Fe,rn,q,P,Q,H,De,Wr,u,{[ve.route.id]:kt.data},void 0);Or.filter(Ke=>Ke.key!==G).forEach(Ke=>{let J=Ke.key,Be=A.fetchers.get(J),it=md(void 0,Be?Be.data:void 0);A.fetchers.set(J,it),$.has(J)&&xe(J),Ke.controller&&$.set(J,Ke.controller)}),ie({fetchers:new Map(A.fetchers)});let Es=()=>Or.forEach(Ke=>xe(Ke.key));Je.signal.addEventListener("abort",Es);let{results:vs,loaderResults:Yr,fetcherResults:_s}=await pt(A.matches,qr,si,Or,Xt);if(Je.signal.aborted)return;Je.signal.removeEventListener("abort",Es),ce.delete(G),$.delete(G),Or.forEach(Ke=>$.delete(Ke.key));let qt=HR(vs);if(qt){if(qt.idx>=si.length){let Ke=Or[qt.idx-si.length].key;De.add(Ke)}return je(A,qt.result)}let{loaderData:Dr,errors:Si}=UR(A,A.matches,si,Yr,void 0,Or,_s,W);if(A.fetchers.has(G)){let Ke=d1(kt.data);A.fetchers.set(G,Ke)}let Nl=Le(Kr);A.navigation.state==="loading"&&Kr>fe?($t(R,"Expected pending action"),N&&N.abort(),Se(A.navigation.location,{matches:qr,loaderData:Dr,errors:Si,fetchers:new Map(A.fetchers)})):(ie(Nn({errors:Si,loaderData:$R(A.loaderData,Dr,qr,Si)},Nl||Or.length>0?{fetchers:new Map(A.fetchers)}:{})),q=!1)}async function ot(G,K,ne,ve,Qe,Fe){let at=A.fetchers.get(G),rt=md(Fe,at?at.data:void 0);A.fetchers.set(G,rt),ie({fetchers:new Map(A.fetchers)});let Je=new AbortController,Rt=gd(e.history,ne,Je.signal);$.set(G,Je);let Qt=oe,kt=await hd("loader",Rt,ve,Qe,a,i,u);if(su(kt)&&(kt=await pB(kt,Rt.signal,!0)||kt),$.get(G)===Je&&$.delete(G),Rt.signal.aborted)return;if(K1(kt))if(fe>Qt){let Xt=d1(void 0);A.fetchers.set(G,Xt),ie({fetchers:new Map(A.fetchers)});return}else{De.add(G),await je(A,kt);return}if(tp(kt)){let Xt=M1(A.matches,K);A.fetchers.delete(G),ie({fetchers:new Map(A.fetchers),errors:{[Xt.route.id]:kt.error}});return}$t(!su(kt),"Unhandled fetcher deferred data");let rn=d1(kt.data);A.fetchers.set(G,rn),ie({fetchers:new Map(A.fetchers)})}async function je(G,K,ne){let{submission:ve,replace:Qe,isFetchActionRedirect:Fe}=ne===void 0?{}:ne;K.revalidate&&(q=!0);let at=Vy(G.location,K.location,Nn({_isRedirect:!0},Fe?{_isFetchActionRedirect:!0}:{}));if($t(at,"Expected a location on the redirect navigation"),uB.test(K.location)&&n){let Rt=e.history.createURL(K.location),Qt=hf(Rt.pathname,u)==null;if(t.location.origin!==Rt.origin||Qt){Qe?t.location.replace(K.location):t.location.assign(K.location);return}}N=null;let rt=Qe===!0?Wn.Replace:Wn.Push,Je=ve||GR(G.navigation);if(vme.has(K.status)&&Je&&Ba(Je.formMethod))await te(rt,at,{submission:Nn({},Je,{formAction:K.location}),preventScrollReset:k});else if(Fe)await te(rt,at,{overrideNavigation:ah(at),fetcherSubmission:Je,preventScrollReset:k});else{let Rt=ah(at,Je);await te(rt,at,{overrideNavigation:Rt,preventScrollReset:k})}}async function pt(G,K,ne,ve,Qe){let Fe=await Promise.all([...ne.map(Je=>hd("loader",Qe,Je,K,a,i,u)),...ve.map(Je=>Je.matches&&Je.match&&Je.controller?hd("loader",gd(e.history,Je.path,Je.controller.signal),Je.match,Je.matches,a,i,u):{type:tr.error,error:oa(404,{pathname:Je.path})})]),at=Fe.slice(0,ne.length),rt=Fe.slice(ne.length);return await Promise.all([jR(G,ne,at,at.map(()=>Qe.signal),!1,A.loaderData),jR(G,ve.map(Je=>Je.match),rt,ve.map(Je=>Je.controller?Je.controller.signal:null),!0)]),{results:Fe,loaderResults:at,fetcherResults:rt}}function U(){q=!0,P.push(...Ee()),H.forEach((G,K)=>{$.has(K)&&(Q.push(K),xe(K))})}function re(G,K,ne){let ve=M1(A.matches,K);de(G),ie({errors:{[ve.route.id]:ne},fetchers:new Map(A.fetchers)})}function de(G){let K=A.fetchers.get(G);$.has(G)&&!(K&&K.state==="loading"&&ce.has(G))&&xe(G),H.delete(G),ce.delete(G),De.delete(G),A.fetchers.delete(G)}function xe(G){let K=$.get(G);$t(K,"Expected fetch controller: "+G),K.abort(),$.delete(G)}function ye(G){for(let K of G){let ne=Ye(K),ve=d1(ne.data);A.fetchers.set(K,ve)}}function Te(){let G=[],K=!1;for(let ne of De){let ve=A.fetchers.get(ne);$t(ve,"Expected fetcher: "+ne),ve.state==="loading"&&(De.delete(ne),G.push(ne),K=!0)}return ye(G),K}function Le(G){let K=[];for(let[ne,ve]of ce)if(ve0}function ze(G,K){let ne=A.blockers.get(G)||fd;return se.get(G)!==K&&se.set(G,K),ne}function Xe(G){A.blockers.delete(G),se.delete(G)}function jt(G,K){let ne=A.blockers.get(G)||fd;$t(ne.state==="unblocked"&&K.state==="blocked"||ne.state==="blocked"&&K.state==="blocked"||ne.state==="blocked"&&K.state==="proceeding"||ne.state==="blocked"&&K.state==="unblocked"||ne.state==="proceeding"&&K.state==="unblocked","Invalid blocker state transition: "+ne.state+" -> "+K.state);let ve=new Map(A.blockers);ve.set(G,K),ie({blockers:ve})}function ue(G){let{currentLocation:K,nextLocation:ne,historyAction:ve}=G;if(se.size===0)return;se.size>1&&Au(!1,"A router only supports one blocker at a time");let Qe=Array.from(se.entries()),[Fe,at]=Qe[Qe.length-1],rt=A.blockers.get(Fe);if(!(rt&&rt.state==="proceeding")&&at({currentLocation:K,nextLocation:ne,historyAction:ve}))return Fe}function Ee(G){let K=[];return W.forEach((ne,ve)=>{(!G||G(ve))&&(ne.cancel(),K.push(ve),W.delete(ve))}),K}function qe(G,K,ne){if(m=G,b=K,g=ne||null,!y&&A.navigation===M4){y=!0;let ve=Ve(A.location,A.matches);ve!=null&&ie({restoreScrollPosition:ve})}return()=>{m=null,b=null,g=null}}function j(G,K){return g&&g(G,K.map(ve=>Ome(ve,A.loaderData)))||G.key}function me(G,K){if(m&&b){let ne=j(G,K);m[ne]=b()}}function Ve(G,K){if(m){let ne=j(G,K),ve=m[ne];if(typeof ve=="number")return ve}return null}function ge(G){a={},s=Wy(G,i,void 0,a)}return w={get basename(){return u},get state(){return A},get routes(){return o},initialize:pe,subscribe:L,enableScrollRestoration:qe,navigate:X,fetch:We,revalidate:ke,createHref:G=>e.history.createHref(G),encodeLocation:G=>e.history.encodeLocation(G),getFetcher:Ye,deleteFetcher:de,dispose:le,getBlocker:ze,deleteBlocker:Xe,_internalFetchControllers:$,_internalActiveDeferreds:W,_internalSetRoutes:ge},w}function wme(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function qy(e,t,n,r,i,a,o){let s,u;if(a!=null&&o!=="path"){s=[];for(let p of t)if(s.push(p),p.route.id===a){u=p;break}}else s=t,u=t[t.length-1];let c=aB(i||".",vT(s).map(p=>p.pathnameBase),hf(e.pathname,n)||e.pathname,o==="path");return i==null&&(c.search=e.search,c.hash=e.hash),(i==null||i===""||i===".")&&u&&u.route.index&&!_T(c.search)&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(c.pathname=c.pathname==="/"?n:fl([n,c.pathname])),D2(c)}function LR(e,t,n,r){if(!r||!wme(r))return{path:n};if(r.formMethod&&!Nme(r.formMethod))return{path:n,error:oa(405,{method:r.formMethod})};let i=()=>({path:n,error:oa(400,{type:"invalid-body"})}),a=r.formMethod||"get",o=e?a.toUpperCase():a.toLowerCase(),s=dB(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Ba(o))return i();let m=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,b)=>{let[y,T]=b;return""+g+y+"="+T+` `},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:m}}}else if(r.formEncType==="application/json"){if(!Ba(o))return i();try{let m=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:m,text:void 0}}}catch{return i()}}}$t(typeof FormData=="function","FormData is not available in this environment");let u,c;if(r.formData)u=Ky(r.formData),c=r.formData;else if(r.body instanceof FormData)u=Ky(r.body),c=r.body;else if(r.body instanceof URLSearchParams)u=r.body,c=BR(u);else if(r.body==null)u=new URLSearchParams,c=new FormData;else try{u=new URLSearchParams(r.body),c=BR(u)}catch{return i()}let p={formMethod:o,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(Ba(p.formMethod))return{path:n,submission:p};let f=Ro(n);return t&&f.search&&_T(f.search)&&u.append("index",""),f.search="?"+u,{path:D2(f),submission:p}}function Ame(e,t){let n=e;if(t){let r=e.findIndex(i=>i.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function MR(e,t,n,r,i,a,o,s,u,c,p,f,m,g){let b=g?Object.values(g)[0]:m?Object.values(m)[0]:void 0,y=e.createURL(t.location),T=e.createURL(i),E=g?Object.keys(g)[0]:void 0,w=Ame(n,E).filter((R,k)=>{if(R.route.lazy)return!0;if(R.route.loader==null)return!1;if(Cme(t.loaderData,t.matches[k],R)||o.some(q=>q===R.route.id))return!0;let N=t.matches[k],B=R;return FR(R,Nn({currentUrl:y,currentParams:N.params,nextUrl:T,nextParams:B.params},r,{actionResult:b,defaultShouldRevalidate:a||y.pathname+y.search===T.pathname+T.search||y.search!==T.search||cB(N,B)}))}),A=[];return u.forEach((R,k)=>{if(!n.some(Q=>Q.route.id===R.routeId))return;let N=L1(p,R.path,f);if(!N){A.push({key:k,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let B=t.fetchers.get(k),q=Yy(N,R.path),P=!1;c.has(k)?P=!1:s.includes(k)?P=!0:B&&B.state!=="idle"&&B.data===void 0?P=a:P=FR(q,Nn({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:T,nextParams:n[n.length-1].params},r,{actionResult:b,defaultShouldRevalidate:a})),P&&A.push({key:k,routeId:R.routeId,path:R.path,matches:N,match:q,controller:new AbortController})}),[w,A]}function Cme(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function cB(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function FR(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function PR(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];$t(i,"No route found in manifest");let a={};for(let o in r){let u=i[o]!==void 0&&o!=="hasErrorBoundary";Au(!u,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!u&&!Yge.has(o)&&(a[o]=r[o])}Object.assign(i,a),Object.assign(i,Nn({},t(i),{lazy:void 0}))}async function hd(e,t,n,r,i,a,o,s){s===void 0&&(s={});let u,c,p,f=b=>{let y,T=new Promise((E,v)=>y=v);return p=()=>y(),t.signal.addEventListener("abort",p),Promise.race([b({request:t,params:n.params,context:s.requestContext}),T])};try{let b=n.route[e];if(n.route.lazy)if(b)c=(await Promise.all([f(b),PR(n.route,a,i)]))[0];else if(await PR(n.route,a,i),b=n.route[e],b)c=await f(b);else if(e==="action"){let y=new URL(t.url),T=y.pathname+y.search;throw oa(405,{method:t.method,pathname:T,routeId:n.route.id})}else return{type:tr.data,data:void 0};else if(b)c=await f(b);else{let y=new URL(t.url),T=y.pathname+y.search;throw oa(404,{pathname:T})}$t(c!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(b){u=tr.error,c=b}finally{p&&t.signal.removeEventListener("abort",p)}if(Rme(c)){let b=c.status;if(Eme.has(b)){let E=c.headers.get("Location");if($t(E,"Redirects returned/thrown from loaders/actions must have a Location header"),!uB.test(E))E=qy(new URL(t.url),r.slice(0,r.indexOf(n)+1),o,!0,E);else if(!s.isStaticRequest){let v=new URL(t.url),w=E.startsWith("//")?new URL(v.protocol+E):new URL(E),A=hf(w.pathname,o)!=null;w.origin===v.origin&&A&&(E=w.pathname+w.search+w.hash)}if(s.isStaticRequest)throw c.headers.set("Location",E),c;return{type:tr.redirect,status:b,location:E,revalidate:c.headers.get("X-Remix-Revalidate")!==null}}if(s.isRouteRequest)throw{type:u||tr.data,response:c};let y,T=c.headers.get("Content-Type");return T&&/\bapplication\/json\b/.test(T)?y=await c.json():y=await c.text(),u===tr.error?{type:u,error:new oB(b,c.statusText,y),headers:c.headers}:{type:tr.data,data:y,statusCode:c.status,headers:c.headers}}if(u===tr.error)return{type:u,error:c};if(Ime(c)){var m,g;return{type:tr.deferred,deferredData:c,statusCode:(m=c.init)==null?void 0:m.status,headers:((g=c.init)==null?void 0:g.headers)&&new Headers(c.init.headers)}}return{type:tr.data,data:c}}function gd(e,t,n,r){let i=e.createURL(dB(t)).toString(),a={signal:n};if(r&&Ba(r.formMethod)){let{formMethod:o,formEncType:s}=r;a.method=o.toUpperCase(),s==="application/json"?(a.headers=new Headers({"Content-Type":s}),a.body=JSON.stringify(r.json)):s==="text/plain"?a.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?a.body=Ky(r.formData):a.body=r.formData}return new Request(i,a)}function Ky(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function BR(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function kme(e,t,n,r,i){let a={},o=null,s,u=!1,c={};return n.forEach((p,f)=>{let m=t[f].route.id;if($t(!K1(p),"Cannot handle redirect results in processLoaderData"),tp(p)){let g=M1(e,m),b=p.error;r&&(b=Object.values(r)[0],r=void 0),o=o||{},o[g.route.id]==null&&(o[g.route.id]=b),a[m]=void 0,u||(u=!0,s=sB(p.error)?p.error.status:500),p.headers&&(c[m]=p.headers)}else su(p)?(i.set(m,p.deferredData),a[m]=p.deferredData.data):a[m]=p.data,p.statusCode!=null&&p.statusCode!==200&&!u&&(s=p.statusCode),p.headers&&(c[m]=p.headers)}),r&&(o=r,a[Object.keys(r)[0]]=void 0),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:c}}function UR(e,t,n,r,i,a,o,s){let{loaderData:u,errors:c}=kme(t,n,r,i,s);for(let p=0;pr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function zR(e){let t=e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function oa(e,t){let{pathname:n,routeId:r,method:i,type:a}=t===void 0?{}:t,o="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(o="Bad Request",i&&n&&r?s="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":a==="defer-action"?s="defer() is not supported in actions":a==="invalid-body"&&(s="Unable to encode submission body")):e===403?(o="Forbidden",s='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",s='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",i&&n&&r?s="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(s='Invalid request method "'+i.toUpperCase()+'"')),new oB(e||500,o,new Error(s),!0)}function HR(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(K1(n))return{result:n,idx:t}}}function dB(e){let t=typeof e=="string"?Ro(e):e;return D2(Nn({},t,{hash:""}))}function xme(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function su(e){return e.type===tr.deferred}function tp(e){return e.type===tr.error}function K1(e){return(e&&e.type)===tr.redirect}function Ime(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Rme(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Nme(e){return yme.has(e.toLowerCase())}function Ba(e){return mme.has(e.toLowerCase())}async function jR(e,t,n,r,i,a){for(let o=0;of.route.id===u.route.id),p=c!=null&&!cB(c,u)&&(a&&a[u.route.id])!==void 0;if(su(s)&&(i||p)){let f=r[o];$t(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await pB(s,f,i).then(m=>{m&&(n[o]=m||n[o])})}}}async function pB(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:tr.data,data:e.deferredData.unwrappedData}}catch(i){return{type:tr.error,error:i}}return{type:tr.data,data:e.deferredData.data}}}function _T(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ome(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function Yy(e,t){let n=typeof t=="string"?Ro(t).search:t.search;if(e[e.length-1].route.index&&_T(n||""))return e[e.length-1];let r=vT(e);return r[r.length-1]}function GR(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function ah(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Dme(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function md(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t," _hasFetcherDoneAnything ":!0}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t," _hasFetcherDoneAnything ":!0}}function Lme(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0," _hasFetcherDoneAnything ":!0}}function d1(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e," _hasFetcherDoneAnything ":!0}}/** * React Router v6.14.2 * @@ -755,7 +755,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho top: 0; z-index: 100; background-color: ${Ht}; -`;function l2e({error:e,resetErrorBoundary:t}){return I.jsxs("div",{role:"alert",children:[I.jsx("p",{children:"Something went wrong:"}),I.jsx("pre",{style:{color:"red"},children:e.message}),I.jsx(oc,{onClick:t,children:"Restart"})]})}function qR(e){var ce,De;const t=C.useContext(to),n=Bge(),r=eo(),i=No(),a=zt(H=>H.sessionState),o=zt(H=>{var W;return(W=H.serverState.config.models)==null?void 0:W.default}),s=zt(H=>H.misc.serverStatusMessage),u=zt(H=>H.sessionState.title),c=zt(H=>H.sessionState.active),[p,f]=C.useState(!1),[m,g]=C.useState([]);C.useState(!0);const[b,y]=C.useState(!1);C.useEffect(()=>{setTimeout(()=>{y(!0)},5e3)},[]);const T=C.useRef(null),E=C.useRef(null),v=C.useRef(null),w=zt(H=>H.uiState.bottomMessage),A=zt(H=>H.misc.takenAction);C.useEffect(()=>{v.current&&r(W0e(v.current.getBoundingClientRect().top{var W;const H=()=>{var L,ie;const D=((L=E.current)==null?void 0:L.scrollTop)||0,pe=((ie=E.current)==null?void 0:ie.scrollHeight)||0,le=window.innerHeight||0;D+le+-25>=pe?k(!1):k(!0)};return(W=E.current)==null||W.addEventListener("scroll",H),()=>{window.removeEventListener("scroll",H)}},[E.current]),C.useLayoutEffect(()=>{var H,W;R||(W=E.current)==null||W.scrollTo({top:(H=E.current)==null?void 0:H.scrollHeight,behavior:"instant"})},[(ce=E.current)==null?void 0:ce.scrollHeight,a.history]),C.useEffect(()=>{const H=W=>{W.key==="Backspace"&&xg(W)&&!W.shiftKey?(t==null||t.stopSession(),r(Zd(!1))):W.key==="Escape"&&r(pu(void 0))};return window.addEventListener("keydown",H),()=>{window.removeEventListener("keydown",H)}},[t,c]);const N=C.useCallback(H=>{if((o==null?void 0:o.class_name)==="OpenAIFreeTrial"&&(o==null?void 0:o.api_key)===""&&(!H.startsWith("/")||H.startsWith("/edit"))){const pe=localStorage.getItem("ftc");if(pe){const le=parseInt(pe);if(localStorage.setItem("ftc",(le+1).toString()),le>=250){console.log(o,"FTC"),r(cc(!0)),r(C4(I.jsx(r2e,{}))),n==null||n.capture("ftc_reached");return}}else localStorage.setItem("ftc","1")}f(!0);const W=[...a.history,{name:"User Input",description:H,observations:[],logs:[],step_type:"UserInputStep",params:{user_input:H},hide:!1,depth:0}],se={history:W,context_items:a.context_items};for(let pe of a.context_items)r(SP({item:pe,index:W.length-1}));t.runFromState(se),W.push({name:"Generating Response...",description:" ",observations:[],logs:[],step_type:"SimpleChatStep",params:{},hide:!1,depth:0}),r(KI(W)),r(Zd(!0));const D=localStorage.getItem("mainTextEntryCounter");if(D){let pe=parseInt(D);localStorage.setItem("mainTextEntryCounter",(pe+1).toString()),pe===300&&(r(C4(I.jsxs("div",{className:"text-center p-4",children:["👋 Thanks for using Continue. We are a beta product and love working closely with our first users. If you're interested in speaking, enter your name and email. We won't use this information for anything other than reaching out.",I.jsx("br",{}),I.jsx("br",{}),I.jsxs("form",{onSubmit:le=>{le.preventDefault(),n==null||n.capture("user_interest_form",{name:le.target.elements[0].value,email:le.target.elements[1].value}),r(C4(I.jsx("div",{className:"text-center p-4",children:"Thanks! We'll be in touch soon."})))},style:{display:"flex",flexDirection:"column",gap:"10px"},children:[I.jsx("input",{style:{padding:"10px",borderRadius:"5px"},type:"text",name:"name",placeholder:"Name",required:!0}),I.jsx("input",{style:{padding:"10px",borderRadius:"5px"},type:"email",name:"email",placeholder:"Email",required:!0}),I.jsx("button",{style:{padding:"10px",borderRadius:"5px",cursor:"pointer"},type:"submit",children:"Submit"})]})]}))),r(V0e(!1)),r(cc(!0)))}else localStorage.setItem("mainTextEntryCounter","1")},[t,a.history,a.context_items,o]);C.useEffect(()=>{const H=W=>{W.data.type==="userInput"&&N(W.data.input)};return window.addEventListener("message",H),()=>window.removeEventListener("message",H)},[N]);const B=H=>{if(r(Ad(null)),T.current&&t){let W=T.current.inputValue;if(W.trim()==="")return;if(W.startsWith("#")&&(W.length===7||W.length===4)){localStorage.setItem("continueButtonColor",W),T.current.setInputValue("");return}H&&xg(H)&&(W=`/edit ${W}`),T.current.setInputValue(""),N(W)}},q=(H,W)=>{t&&t.sendStepUserInput(H,W)},P=C.useCallback(H=>{let W=!1;for(let se=H+1;se{const W=[];let se=-1;for(let D=H;D>=0;D--)if(typeof a.history[D]<"u"&&a.history[D].name==="User Input"&&a.history[D].hide===!1){W.push(D),se=D;break}if(W.length===0)return[];for(let D=se+1;D{const W=Q(H),se=W[0];g(D=>{const pe=[...D];return pe[H]=!pe[H],!W.some((L,ie)=>ie>0&&pe[L])?pe[se]=!1:!W.some((ie,Se)=>Se>0&&!pe[ie])&&(pe[se]=!0),pe})},[Q]);C.useEffect(()=>{u&&fe(u)},[u]);const[oe,fe]=C.useState(u||"New Session");return I.jsxs(i2e,{ref:E,onKeyDown:H=>{H.key==="Enter"&&H.ctrlKey&&B()},children:[I.jsxs(s2e,{children:[I.jsx(a2e,{onClick:H=>{H.target.setSelectionRange(0,H.target.value.length)},value:oe,onChange:H=>fe(H.target.value),onBlur:H=>{H.target.value===u||typeof u>"u"&&H.target.value==="New Session"||r(wP(H.target.value))},onKeyDown:H=>{H.key==="Enter"?(H.preventDefault(),H.target.blur()):H.key==="Escape"&&(fe(u||"New Session"),H.target.blur())}}),I.jsxs("div",{className:"flex gap-2",children:[I.jsx(zi,{onClick:()=>{t==null||t.stopSession(),r(uc())},text:"New Session (⌥⌘N)",children:I.jsx(CL,{width:"1.4em",height:"1.4em"})}),I.jsx(zi,{onClick:()=>{i("/history")},text:"History",children:I.jsx(OZ,{width:"1.4em",height:"1.4em"})})]})]}),A&&b&&typeof t>"u"&&I.jsxs(I.Fragment,{children:[I.jsx(zge,{}),I.jsx("p",{style:{textAlign:"center",margin:"0px",fontSize:"14px"},children:s}),I.jsxs("div",{className:"flex mx-8 my-2",children:[I.jsx("p",{style:{margin:"auto",textAlign:"center",marginTop:"4px",fontSize:"12px",cursor:"pointer",opacity:.7},children:I.jsx("u",{children:I.jsx("a",{style:{color:"inherit"},href:"https://continue.dev/docs/troubleshooting",target:"_blank",children:"Troubleshooting help"})})}),I.jsx("p",{style:{margin:"auto",textAlign:"center",marginTop:"4px",fontSize:"12px",cursor:"pointer",opacity:.7},onClick:()=>{qa("toggleDevTools",{})},children:I.jsx("u",{children:"View logs"})}),I.jsx("p",{style:{margin:"auto",textAlign:"center",marginTop:"4px",fontSize:"12px",cursor:"pointer",opacity:.7},children:I.jsx("u",{children:I.jsx("a",{style:{color:"inherit"},href:"https://continue.dev/docs/walkthroughs/manually-run-continue#recommended-use-the-continuedev-pypi-package",target:"_blank",children:"Manually start server"})})})]})]}),I.jsx("br",{}),I.jsx(o2e,{children:(De=a==null?void 0:a.history)==null?void 0:De.map((H,W)=>H.hide?null:I.jsx(C.Fragment,{children:I.jsx(WX,{FallbackComponent:l2e,onReset:()=>{t==null||t.stopSession(),r(uc())},children:H.name==="User Input"?H.hide||I.jsx(QI,{isMainInput:!1,value:H.description,active:c&&P(W),onEnter:(se,D)=>{if(D){t==null||t.stopSession();const pe=[...a.history.slice(0,W),{name:"User Input",description:D,observations:[],logs:[],step_type:"UserInputStep",params:{user_input:D},hide:!1,depth:0}];r(KI(pe)),r(Zd(!0));const le={history:pe,context_items:a.context_items};console.log("State: ",le),t.runFromState(le)}se==null||se.stopPropagation(),se==null||se.preventDefault()},groupIndices:Q(W),onToggle:se=>{g(D=>{const pe=[...D];return Q(W).forEach(le=>{pe[le]=se}),pe})},onToggleAll:se=>{g(D=>D.map(pe=>se))},isToggleOpen:typeof m[W]>"u"?!0:m[W],index:W,onDelete:()=>{Q(W).forEach(se=>{console.log(se),r(S4(se))})}}):I.jsx(Gge,{historyNode:H,iconElement:H.step_type==="DefaultModelEditCodeStep"?I.jsx(wZ,{width:"16px",height:"16px"}):H.error?I.jsx(wL,{width:"16px",height:"16px",color:"red"}):I.jsx(SL,{width:"16px",height:"16px"}),open:typeof m[W]>"u"?!H.error:m[W],onToggle:()=>$(W),children:H.error?I.jsx(Wge,{onClose:()=>$(W),error:H.error,onDelete:()=>{r(S4(W))}}):I.jsx(Uue,{index:W,isLast:W===a.history.length-1,isFirst:W===0,open:typeof m[W]>"u"?!0:m[W],onUserInput:se=>{q(se,W)},step:H,onReverse:()=>{t==null||t.reverseToIndex(W)},onRetry:()=>{t==null||t.retryAtIndex(W),f(!0)},onDelete:()=>{r(S4(W))},noUserInputParent:Q(W).length===0},W)})})},W))}),I.jsx("div",{ref:v}),I.jsx(QI,{isMainInput:!0,ref:T,onEnter:(H,W)=>{B(H),H==null||H.stopPropagation(),H==null||H.preventDefault()},onInputValueChange:()=>{},onToggleAddContext:()=>{t==null||t.toggleAddingHighlightedCode()}})]})}const u2e=Ge.div` +`;function l2e({error:e,resetErrorBoundary:t}){return I.jsxs("div",{role:"alert",children:[I.jsx("p",{children:"Something went wrong:"}),I.jsx("pre",{style:{color:"red"},children:e.message}),I.jsx(oc,{onClick:t,children:"Restart"})]})}function qR(e){var ce,De;const t=C.useContext(to),n=Bge(),r=eo(),i=No(),a=zt(H=>H.sessionState),o=zt(H=>{var W;return(W=H.serverState.config.models)==null?void 0:W.default}),s=zt(H=>H.misc.serverStatusMessage),u=zt(H=>H.sessionState.title),c=zt(H=>H.sessionState.active),[p,f]=C.useState(!1),[m,g]=C.useState([]);C.useState(!0);const[b,y]=C.useState(!1);C.useEffect(()=>{setTimeout(()=>{y(!0)},5e3)},[]);const T=C.useRef(null),E=C.useRef(null),v=C.useRef(null),w=zt(H=>H.uiState.bottomMessage),A=zt(H=>H.misc.takenAction);C.useEffect(()=>{v.current&&r(W0e(v.current.getBoundingClientRect().top{var W;const H=()=>{var L,ie;const D=((L=E.current)==null?void 0:L.scrollTop)||0,pe=((ie=E.current)==null?void 0:ie.scrollHeight)||0,le=window.innerHeight||0;D+le+-25>=pe?k(!1):k(!0)};return(W=E.current)==null||W.addEventListener("scroll",H),()=>{window.removeEventListener("scroll",H)}},[E.current]),C.useLayoutEffect(()=>{var H,W;R||(W=E.current)==null||W.scrollTo({top:(H=E.current)==null?void 0:H.scrollHeight,behavior:"instant"})},[(ce=E.current)==null?void 0:ce.scrollHeight,a.history]),C.useEffect(()=>{const H=W=>{W.key==="Backspace"&&xg(W)&&!W.shiftKey?(t==null||t.stopSession(),r(Zd(!1))):W.key==="Escape"&&r(pu(void 0))};return window.addEventListener("keydown",H),()=>{window.removeEventListener("keydown",H)}},[t,c]);const N=C.useCallback(H=>{if((o==null?void 0:o.class_name)==="OpenAIFreeTrial"&&(o==null?void 0:o.api_key)===""&&(!H.startsWith("/")||H.startsWith("/edit"))){const pe=localStorage.getItem("ftc");if(pe){const le=parseInt(pe);if(localStorage.setItem("ftc",(le+1).toString()),le>=250){r(cc(!0)),r(C4(I.jsx(r2e,{}))),n==null||n.capture("ftc_reached");return}}else localStorage.setItem("ftc","1")}f(!0);const W=[...a.history,{name:"User Input",description:H,observations:[],logs:[],step_type:"UserInputStep",params:{user_input:H},hide:!1,depth:0}],se={history:W,context_items:a.context_items};for(let pe of a.context_items)r(SP({item:pe,index:W.length-1}));t.runFromState(se),W.push({name:"Generating Response...",description:" ",observations:[],logs:[],step_type:"SimpleChatStep",params:{},hide:!1,depth:0}),r(KI(W)),r(Zd(!0));const D=localStorage.getItem("mainTextEntryCounter");if(D){let pe=parseInt(D);localStorage.setItem("mainTextEntryCounter",(pe+1).toString()),pe===300&&(r(C4(I.jsxs("div",{className:"text-center p-4",children:["👋 Thanks for using Continue. We are a beta product and love working closely with our first users. If you're interested in speaking, enter your name and email. We won't use this information for anything other than reaching out.",I.jsx("br",{}),I.jsx("br",{}),I.jsxs("form",{onSubmit:le=>{le.preventDefault(),n==null||n.capture("user_interest_form",{name:le.target.elements[0].value,email:le.target.elements[1].value}),r(C4(I.jsx("div",{className:"text-center p-4",children:"Thanks! We'll be in touch soon."})))},style:{display:"flex",flexDirection:"column",gap:"10px"},children:[I.jsx("input",{style:{padding:"10px",borderRadius:"5px"},type:"text",name:"name",placeholder:"Name",required:!0}),I.jsx("input",{style:{padding:"10px",borderRadius:"5px"},type:"email",name:"email",placeholder:"Email",required:!0}),I.jsx("button",{style:{padding:"10px",borderRadius:"5px",cursor:"pointer"},type:"submit",children:"Submit"})]})]}))),r(V0e(!1)),r(cc(!0)))}else localStorage.setItem("mainTextEntryCounter","1")},[t,a.history,a.context_items,o]);C.useEffect(()=>{const H=W=>{W.data.type==="userInput"&&N(W.data.input)};return window.addEventListener("message",H),()=>window.removeEventListener("message",H)},[N]);const B=H=>{if(r(Ad(null)),T.current&&t){let W=T.current.inputValue;if(W.trim()==="")return;if(W.startsWith("#")&&(W.length===7||W.length===4)){localStorage.setItem("continueButtonColor",W),T.current.setInputValue("");return}H&&xg(H)&&(W=`/edit ${W}`),T.current.setInputValue(""),N(W)}},q=(H,W)=>{t&&t.sendStepUserInput(H,W)},P=C.useCallback(H=>{let W=!1;for(let se=H+1;se{const W=[];let se=-1;for(let D=H;D>=0;D--)if(typeof a.history[D]<"u"&&a.history[D].name==="User Input"&&a.history[D].hide===!1){W.push(D),se=D;break}if(W.length===0)return[];for(let D=se+1;D{const W=Q(H),se=W[0];g(D=>{const pe=[...D];return pe[H]=!pe[H],!W.some((L,ie)=>ie>0&&pe[L])?pe[se]=!1:!W.some((ie,Se)=>Se>0&&!pe[ie])&&(pe[se]=!0),pe})},[Q]);C.useEffect(()=>{u&&fe(u)},[u]);const[oe,fe]=C.useState(u||"New Session");return I.jsxs(i2e,{ref:E,onKeyDown:H=>{H.key==="Enter"&&H.ctrlKey&&B()},children:[I.jsxs(s2e,{children:[I.jsx(a2e,{onClick:H=>{H.target.setSelectionRange(0,H.target.value.length)},value:oe,onChange:H=>fe(H.target.value),onBlur:H=>{H.target.value===u||typeof u>"u"&&H.target.value==="New Session"||r(wP(H.target.value))},onKeyDown:H=>{H.key==="Enter"?(H.preventDefault(),H.target.blur()):H.key==="Escape"&&(fe(u||"New Session"),H.target.blur())}}),I.jsxs("div",{className:"flex gap-2",children:[I.jsx(zi,{onClick:()=>{t==null||t.stopSession(),r(uc())},text:"New Session (⌥⌘N)",children:I.jsx(CL,{width:"1.4em",height:"1.4em"})}),I.jsx(zi,{onClick:()=>{i("/history")},text:"History",children:I.jsx(OZ,{width:"1.4em",height:"1.4em"})})]})]}),A&&b&&typeof t>"u"&&I.jsxs(I.Fragment,{children:[I.jsx(zge,{}),I.jsx("p",{style:{textAlign:"center",margin:"0px",fontSize:"14px"},children:s}),I.jsxs("div",{className:"flex mx-8 my-2",children:[I.jsx("p",{style:{margin:"auto",textAlign:"center",marginTop:"4px",fontSize:"12px",cursor:"pointer",opacity:.7},children:I.jsx("u",{children:I.jsx("a",{style:{color:"inherit"},href:"https://continue.dev/docs/troubleshooting",target:"_blank",children:"Troubleshooting help"})})}),I.jsx("p",{style:{margin:"auto",textAlign:"center",marginTop:"4px",fontSize:"12px",cursor:"pointer",opacity:.7},onClick:()=>{qa("toggleDevTools",{})},children:I.jsx("u",{children:"View logs"})}),I.jsx("p",{style:{margin:"auto",textAlign:"center",marginTop:"4px",fontSize:"12px",cursor:"pointer",opacity:.7},children:I.jsx("u",{children:I.jsx("a",{style:{color:"inherit"},href:"https://continue.dev/docs/walkthroughs/manually-run-continue#recommended-use-the-continuedev-pypi-package",target:"_blank",children:"Manually start server"})})})]})]}),I.jsx("br",{}),I.jsx(o2e,{children:(De=a==null?void 0:a.history)==null?void 0:De.map((H,W)=>H.hide?null:I.jsx(C.Fragment,{children:I.jsx(WX,{FallbackComponent:l2e,onReset:()=>{t==null||t.stopSession(),r(uc())},children:H.name==="User Input"?H.hide||I.jsx(QI,{isMainInput:!1,value:H.description,active:c&&P(W),onEnter:(se,D)=>{if(D){t==null||t.stopSession();const pe=[...a.history.slice(0,W),{name:"User Input",description:D,observations:[],logs:[],step_type:"UserInputStep",params:{user_input:D},hide:!1,depth:0}];r(KI(pe)),r(Zd(!0));const le={history:pe,context_items:a.context_items};console.log("State: ",le),t.runFromState(le)}se==null||se.stopPropagation(),se==null||se.preventDefault()},groupIndices:Q(W),onToggle:se=>{g(D=>{const pe=[...D];return Q(W).forEach(le=>{pe[le]=se}),pe})},onToggleAll:se=>{g(D=>D.map(pe=>se))},isToggleOpen:typeof m[W]>"u"?!0:m[W],index:W,onDelete:()=>{Q(W).forEach(se=>{console.log(se),r(S4(se))})}}):I.jsx(Gge,{historyNode:H,iconElement:H.step_type==="DefaultModelEditCodeStep"?I.jsx(wZ,{width:"16px",height:"16px"}):H.error?I.jsx(wL,{width:"16px",height:"16px",color:"red"}):I.jsx(SL,{width:"16px",height:"16px"}),open:typeof m[W]>"u"?!H.error:m[W],onToggle:()=>$(W),children:H.error?I.jsx(Wge,{onClose:()=>$(W),error:H.error,onDelete:()=>{r(S4(W))}}):I.jsx(Uue,{index:W,isLast:W===a.history.length-1,isFirst:W===0,open:typeof m[W]>"u"?!0:m[W],onUserInput:se=>{q(se,W)},step:H,onReverse:()=>{t==null||t.reverseToIndex(W)},onRetry:()=>{t==null||t.retryAtIndex(W),f(!0)},onDelete:()=>{r(S4(W))},noUserInputParent:Q(W).length===0},W)})})},W))}),I.jsx("div",{ref:v}),I.jsx(QI,{isMainInput:!0,ref:T,onEnter:(H,W)=>{B(H),H==null||H.stopPropagation(),H==null||H.preventDefault()},onInputValueChange:()=>{},onToggleAddContext:()=>{t==null||t.toggleAddingHighlightedCode()}})]})}const u2e=Ge.div` display: flex; flex-direction: row; align-items: center; @@ -873,7 +873,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `;Ge.p` color: ${Yt}; margin: 8px auto; -`;const S2e=e=>(C.useEffect(()=>{const t=n=>{n.key==="Escape"&&e.onClose()};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[e]),I.jsx(v2e,{onClick:()=>{e.onClose()},hidden:!e.showDialog,children:I.jsx(_2e,{onClick:t=>{t.stopPropagation()},children:I.jsx(T2e,{children:typeof e.message=="string"?I.jsx(N9,{children:e.message||""}):st.isValidElement(e.message)?e.message:null})})}));var w2e=Object.defineProperty,A2e=(e,t,n)=>t in e?w2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P4=(e,t,n)=>(A2e(e,typeof t!="symbol"?t+"":t,n),n);let C2e=class{constructor(){P4(this,"current",this.detect()),P4(this,"handoffState","pending"),P4(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},hu=new C2e,Gi=(e,t)=>{hu.isServer?C.useEffect(e,t):C.useLayoutEffect(e,t)};function wo(e){let t=C.useRef(e);return Gi(()=>{t.current=e},[e]),t}function yB(e,t){let[n,r]=C.useState(e),i=wo(e);return Gi(()=>r(i.current),[i,r,...t]),n}function k2e(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function vl(){let e=[],t={addEventListener(n,r,i,a){return n.addEventListener(r,i,a),t.add(()=>n.removeEventListener(r,i,a))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return k2e(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,i){let a=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:a})})},group(n){let r=vl();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let i of e.splice(r,1))i()}},dispose(){for(let n of e.splice(0))n()}};return t}function pc(){let[e]=C.useState(vl);return C.useEffect(()=>()=>e.dispose(),[e]),e}let Zt=function(e){let t=wo(e);return st.useCallback((...n)=>t.current(...n),[t])};function x2e(){let e=typeof document>"u";return"useSyncExternalStore"in Q4?(t=>t.useSyncExternalStore)(Q4)(()=>()=>{},()=>!1,()=>!e):!1}function ST(){let e=x2e(),[t,n]=C.useState(hu.isHandoffComplete);return t&&hu.isHandoffComplete===!1&&n(!1),C.useEffect(()=>{t!==!0&&n(!0)},[t]),C.useEffect(()=>hu.handoff(),[]),e?!1:t}var XR;let B2=(XR=st.useId)!=null?XR:function(){let e=ST(),[t,n]=st.useState(e?()=>hu.nextId():null);return Gi(()=>{t===null&&n(hu.nextId())},[t]),t!=null?""+t:void 0};function Cr(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Cr),r}function EB(e){return hu.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let ZR=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var I2e=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(I2e||{}),R2e=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(R2e||{}),N2e=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(N2e||{}),wT=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(wT||{});function vB(e,t=0){var n;return e===((n=EB(e))==null?void 0:n.body)?!1:Cr(t,{0(){return e.matches(ZR)},1(){let r=e;for(;r!==null;){if(r.matches(ZR))return!0;r=r.parentElement}return!1}})}var O2e=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(O2e||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function D2e(e,t=n=>n){return e.slice().sort((n,r)=>{let i=t(n),a=t(r);if(i===null||a===null)return 0;let o=i.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function lh(e,t,n){let r=wo(t);C.useEffect(()=>{function i(a){r.current(a)}return document.addEventListener(e,i,n),()=>document.removeEventListener(e,i,n)},[e,n])}function L2e(e,t,n){let r=wo(t);C.useEffect(()=>{function i(a){r.current(a)}return window.addEventListener(e,i,n),()=>window.removeEventListener(e,i,n)},[e,n])}function M2e(e,t,n=!0){let r=C.useRef(!1);C.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function i(o,s){if(!r.current||o.defaultPrevented)return;let u=s(o);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let c=function p(f){return typeof f=="function"?p(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let p of c){if(p===null)continue;let f=p instanceof HTMLElement?p:p.current;if(f!=null&&f.contains(u)||o.composed&&o.composedPath().includes(f))return}return!vB(u,wT.Loose)&&u.tabIndex!==-1&&o.preventDefault(),t(o,u)}let a=C.useRef(null);lh("pointerdown",o=>{var s,u;r.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),lh("mousedown",o=>{var s,u;r.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),lh("click",o=>{a.current&&(i(o,()=>a.current),a.current=null)},!0),lh("touchend",o=>i(o,()=>o.target instanceof HTMLElement?o.target:null),!0),L2e("blur",o=>i(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function QR(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function F2e(e,t){let[n,r]=C.useState(()=>QR(e));return Gi(()=>{r(QR(e))},[e.type,e.as]),Gi(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let P2e=Symbol();function Pu(...e){let t=C.useRef(e);C.useEffect(()=>{t.current=e},[e]);let n=Zt(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[P2e]))?void 0:n}function B2e(e){throw new Error("Unexpected object: "+e)}var yi=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(yi||{});function U2e(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1,a=(()=>{switch(e.focus){case 0:return n.findIndex(o=>!t.resolveDisabled(o));case 1:{let o=n.slice().reverse().findIndex((s,u,c)=>i!==-1&&c.length-u-1>=i?!1:!t.resolveDisabled(s));return o===-1?o:n.length-1-o}case 2:return n.findIndex((o,s)=>s<=i?!1:!t.resolveDisabled(o));case 3:{let o=n.slice().reverse().findIndex(s=>!t.resolveDisabled(s));return o===-1?o:n.length-1-o}case 4:return n.findIndex(o=>t.resolveId(o)===e.id);case 5:return null;default:B2e(e)}})();return a===-1?r:a}function tm(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var nm=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(nm||{}),Qs=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Qs||{});function Rl({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:a=!0,name:o}){let s=_B(t,e);if(a)return uh(s,n,r,o);let u=i??0;if(u&2){let{static:c=!1,...p}=s;if(c)return uh(p,n,r,o)}if(u&1){let{unmount:c=!0,...p}=s;return Cr(c?0:1,{0(){return null},1(){return uh({...p,hidden:!0,style:{display:"none"}},n,r,o)}})}return uh(s,n,r,o)}function uh(e,t={},n,r){let{as:i=n,children:a,refName:o="ref",...s}=B4(e,["unmount","static"]),u=e.ref!==void 0?{[o]:e.ref}:{},c=typeof a=="function"?a(t):a;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(t));let p={};if(t){let f=!1,m=[];for(let[g,b]of Object.entries(t))typeof b=="boolean"&&(f=!0),b===!0&&m.push(g);f&&(p["data-headlessui-state"]=m.join(" "))}if(i===C.Fragment&&Object.keys(Zy(s)).length>0){if(!C.isValidElement(c)||Array.isArray(c)&&c.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(b=>` - ${b}`).join(` +`;const S2e=e=>(C.useEffect(()=>{const t=n=>{n.key==="Escape"&&e.onClose()};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[e]),!C.isValidElement(e.message)&&typeof e.message!="string"?null:I.jsx(v2e,{onClick:()=>{e.onClose()},hidden:!e.showDialog,children:I.jsx(_2e,{onClick:t=>{t.stopPropagation()},children:I.jsx(T2e,{children:typeof e.message=="string"?I.jsx(N9,{children:e.message||""}):st.isValidElement(e.message)?e.message:null})})}));var w2e=Object.defineProperty,A2e=(e,t,n)=>t in e?w2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P4=(e,t,n)=>(A2e(e,typeof t!="symbol"?t+"":t,n),n);let C2e=class{constructor(){P4(this,"current",this.detect()),P4(this,"handoffState","pending"),P4(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},hu=new C2e,Gi=(e,t)=>{hu.isServer?C.useEffect(e,t):C.useLayoutEffect(e,t)};function wo(e){let t=C.useRef(e);return Gi(()=>{t.current=e},[e]),t}function yB(e,t){let[n,r]=C.useState(e),i=wo(e);return Gi(()=>r(i.current),[i,r,...t]),n}function k2e(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function vl(){let e=[],t={addEventListener(n,r,i,a){return n.addEventListener(r,i,a),t.add(()=>n.removeEventListener(r,i,a))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return k2e(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,i){let a=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:a})})},group(n){let r=vl();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let i of e.splice(r,1))i()}},dispose(){for(let n of e.splice(0))n()}};return t}function pc(){let[e]=C.useState(vl);return C.useEffect(()=>()=>e.dispose(),[e]),e}let Zt=function(e){let t=wo(e);return st.useCallback((...n)=>t.current(...n),[t])};function x2e(){let e=typeof document>"u";return"useSyncExternalStore"in Q4?(t=>t.useSyncExternalStore)(Q4)(()=>()=>{},()=>!1,()=>!e):!1}function ST(){let e=x2e(),[t,n]=C.useState(hu.isHandoffComplete);return t&&hu.isHandoffComplete===!1&&n(!1),C.useEffect(()=>{t!==!0&&n(!0)},[t]),C.useEffect(()=>hu.handoff(),[]),e?!1:t}var XR;let B2=(XR=st.useId)!=null?XR:function(){let e=ST(),[t,n]=st.useState(e?()=>hu.nextId():null);return Gi(()=>{t===null&&n(hu.nextId())},[t]),t!=null?""+t:void 0};function Cr(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Cr),r}function EB(e){return hu.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let ZR=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var I2e=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(I2e||{}),R2e=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(R2e||{}),N2e=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(N2e||{}),wT=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(wT||{});function vB(e,t=0){var n;return e===((n=EB(e))==null?void 0:n.body)?!1:Cr(t,{0(){return e.matches(ZR)},1(){let r=e;for(;r!==null;){if(r.matches(ZR))return!0;r=r.parentElement}return!1}})}var O2e=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(O2e||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function D2e(e,t=n=>n){return e.slice().sort((n,r)=>{let i=t(n),a=t(r);if(i===null||a===null)return 0;let o=i.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function lh(e,t,n){let r=wo(t);C.useEffect(()=>{function i(a){r.current(a)}return document.addEventListener(e,i,n),()=>document.removeEventListener(e,i,n)},[e,n])}function L2e(e,t,n){let r=wo(t);C.useEffect(()=>{function i(a){r.current(a)}return window.addEventListener(e,i,n),()=>window.removeEventListener(e,i,n)},[e,n])}function M2e(e,t,n=!0){let r=C.useRef(!1);C.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function i(o,s){if(!r.current||o.defaultPrevented)return;let u=s(o);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let c=function p(f){return typeof f=="function"?p(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let p of c){if(p===null)continue;let f=p instanceof HTMLElement?p:p.current;if(f!=null&&f.contains(u)||o.composed&&o.composedPath().includes(f))return}return!vB(u,wT.Loose)&&u.tabIndex!==-1&&o.preventDefault(),t(o,u)}let a=C.useRef(null);lh("pointerdown",o=>{var s,u;r.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),lh("mousedown",o=>{var s,u;r.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),lh("click",o=>{a.current&&(i(o,()=>a.current),a.current=null)},!0),lh("touchend",o=>i(o,()=>o.target instanceof HTMLElement?o.target:null),!0),L2e("blur",o=>i(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function QR(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function F2e(e,t){let[n,r]=C.useState(()=>QR(e));return Gi(()=>{r(QR(e))},[e.type,e.as]),Gi(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let P2e=Symbol();function Pu(...e){let t=C.useRef(e);C.useEffect(()=>{t.current=e},[e]);let n=Zt(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[P2e]))?void 0:n}function B2e(e){throw new Error("Unexpected object: "+e)}var yi=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(yi||{});function U2e(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1,a=(()=>{switch(e.focus){case 0:return n.findIndex(o=>!t.resolveDisabled(o));case 1:{let o=n.slice().reverse().findIndex((s,u,c)=>i!==-1&&c.length-u-1>=i?!1:!t.resolveDisabled(s));return o===-1?o:n.length-1-o}case 2:return n.findIndex((o,s)=>s<=i?!1:!t.resolveDisabled(o));case 3:{let o=n.slice().reverse().findIndex(s=>!t.resolveDisabled(s));return o===-1?o:n.length-1-o}case 4:return n.findIndex(o=>t.resolveId(o)===e.id);case 5:return null;default:B2e(e)}})();return a===-1?r:a}function tm(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var nm=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(nm||{}),Qs=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Qs||{});function Rl({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:a=!0,name:o}){let s=_B(t,e);if(a)return uh(s,n,r,o);let u=i??0;if(u&2){let{static:c=!1,...p}=s;if(c)return uh(p,n,r,o)}if(u&1){let{unmount:c=!0,...p}=s;return Cr(c?0:1,{0(){return null},1(){return uh({...p,hidden:!0,style:{display:"none"}},n,r,o)}})}return uh(s,n,r,o)}function uh(e,t={},n,r){let{as:i=n,children:a,refName:o="ref",...s}=B4(e,["unmount","static"]),u=e.ref!==void 0?{[o]:e.ref}:{},c=typeof a=="function"?a(t):a;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(t));let p={};if(t){let f=!1,m=[];for(let[g,b]of Object.entries(t))typeof b=="boolean"&&(f=!0),b===!0&&m.push(g);f&&(p["data-headlessui-state"]=m.join(" "))}if(i===C.Fragment&&Object.keys(Zy(s)).length>0){if(!C.isValidElement(c)||Array.isArray(c)&&c.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(b=>` - ${b}`).join(` `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(b=>` - ${b}`).join(` `)].join(` `));let f=c.props,m=typeof(f==null?void 0:f.className)=="function"?(...b)=>tm(f==null?void 0:f.className(...b),s.className):tm(f==null?void 0:f.className,s.className),g=m?{className:m}:{};return C.cloneElement(c,Object.assign({},_B(c.props,Zy(B4(s,["ref"]))),p,u,$2e(c.ref,u.ref),g))}return C.createElement(i,Object.assign({},B4(s,["ref"]),i!==C.Fragment&&u,i!==C.Fragment&&p),c)}function $2e(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}}function _B(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](i,...a){let o=n[r];for(let s of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;s(i,...a)}}});return t}function ys(e){var t;return Object.assign(C.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Zy(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function B4(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function z2e(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&H2e(n)?!1:r}function H2e(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function TB(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))wB(n,SB(t,r),i);return n}function SB(e,t){return e?e+"["+t+"]":t}function wB(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())wB(e,SB(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):TB(n,t,e)}let j2e="div";var AB=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(AB||{});function G2e(e,t){let{features:n=1,...r}=e,i={ref:t,"aria-hidden":(n&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Rl({ourProps:i,theirProps:r,slot:{},defaultTag:j2e,name:"Hidden"})}let V2e=ys(G2e),AT=C.createContext(null);AT.displayName="OpenClosedContext";var Li=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Li||{});function CT(){return C.useContext(AT)}function CB({value:e,children:t}){return st.createElement(AT.Provider,{value:e},t)}var ur=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(ur||{});function W2e(e,t,n){let[r,i]=C.useState(n),a=e!==void 0,o=C.useRef(a),s=C.useRef(!1),u=C.useRef(!1);return a&&!o.current&&!s.current?(s.current=!0,o.current=a,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!a&&o.current&&!u.current&&(u.current=!0,o.current=a,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[a?e:r,Zt(c=>(a||i(c),t==null?void 0:t(c)))]}function JR(e){return[e.screenX,e.screenY]}function q2e(){let e=C.useRef([-1,-1]);return{wasMoved(t){let n=JR(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=JR(t)}}}function kT(){let e=C.useRef(!1);return Gi(()=>(e.current=!0,()=>{e.current=!1}),[]),e}let eN=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function tN(e){var t,n;let r=(t=e.innerText)!=null?t:"",i=e.cloneNode(!0);if(!(i instanceof HTMLElement))return r;let a=!1;for(let s of i.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),a=!0;let o=a?(n=i.innerText)!=null?n:"":r;return eN.test(o)&&(o=o.replace(eN,"")),o}function K2e(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(i=>{let a=document.getElementById(i);if(a){let o=a.getAttribute("aria-label");return typeof o=="string"?o.trim():tN(a).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return tN(e).trim()}function Y2e(e){let t=C.useRef(""),n=C.useRef("");return Zt(()=>{let r=e.current;if(!r)return"";let i=r.innerText;if(t.current===i)return n.current;let a=K2e(r).trim().toLowerCase();return t.current=i,n.current=a,a})}var X2e=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(X2e||{}),Z2e=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Z2e||{}),Q2e=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Q2e||{}),J2e=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.RegisterLabel=7]="RegisterLabel",e))(J2e||{});function U4(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=D2e(t(e.options.slice()),a=>a.dataRef.current.domRef.current),i=n?r.indexOf(n):null;return i===-1&&(i=null),{options:r,activeOptionIndex:i}}let e5e={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1}},0(e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex(i=>n(i.dataRef.current.value));return r!==-1&&(t=r),{...e,listboxState:0,activeOptionIndex:t}},2(e,t){var n;if(e.dataRef.current.disabled||e.listboxState===1)return e;let r=U4(e),i=U2e(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:i,activationTrigger:(n=t.trigger)!=null?n:1}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(o=>{var s;return!o.dataRef.current.disabled&&((s=o.dataRef.current.textValue)==null?void 0:s.startsWith(r))}),a=i?e.options.indexOf(i):-1;return a===-1||a===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:a,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=U4(e,i=>[...i,n]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...e,...r}},6:(e,t)=>{let n=U4(e,r=>{let i=r.findIndex(a=>a.id===t.id);return i!==-1&&r.splice(i,1),r});return{...e,...n,activationTrigger:1}},7:(e,t)=>({...e,labelId:t.id})},xT=C.createContext(null);xT.displayName="ListboxActionsContext";function gf(e){let t=C.useContext(xT);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,gf),n}return t}let IT=C.createContext(null);IT.displayName="ListboxDataContext";function mf(e){let t=C.useContext(IT);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,mf),n}return t}function t5e(e,t){return Cr(t.type,e5e,e,t)}let n5e=C.Fragment;function r5e(e,t){let{value:n,defaultValue:r,form:i,name:a,onChange:o,by:s=(ie,Se)=>ie===Se,disabled:u=!1,horizontal:c=!1,multiple:p=!1,...f}=e;const m=c?"horizontal":"vertical";let g=Pu(t),[b=p?[]:void 0,y]=W2e(n,o,r),[T,E]=C.useReducer(t5e,{dataRef:C.createRef(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),v=C.useRef({static:!1,hold:!1}),w=C.useRef(null),A=C.useRef(null),R=C.useRef(null),k=Zt(typeof s=="string"?(ie,Se)=>{let X=s;return(ie==null?void 0:ie[X])===(Se==null?void 0:Se[X])}:s),N=C.useCallback(ie=>Cr(B.mode,{1:()=>b.some(Se=>k(Se,ie)),0:()=>k(b,ie)}),[b]),B=C.useMemo(()=>({...T,value:b,disabled:u,mode:p?1:0,orientation:m,compare:k,isSelected:N,optionsPropsRef:v,labelRef:w,buttonRef:A,optionsRef:R}),[b,u,p,T]);Gi(()=>{T.dataRef.current=B},[B]),M2e([B.buttonRef,B.optionsRef],(ie,Se)=>{var X;E({type:1}),vB(Se,wT.Loose)||(ie.preventDefault(),(X=B.buttonRef.current)==null||X.focus())},B.listboxState===0);let q=C.useMemo(()=>({open:B.listboxState===0,disabled:u,value:b}),[B,u,b]),P=Zt(ie=>{let Se=B.options.find(X=>X.id===ie);Se&&H(Se.dataRef.current.value)}),Q=Zt(()=>{if(B.activeOptionIndex!==null){let{dataRef:ie,id:Se}=B.options[B.activeOptionIndex];H(ie.current.value),E({type:2,focus:yi.Specific,id:Se})}}),$=Zt(()=>E({type:0})),oe=Zt(()=>E({type:1})),fe=Zt((ie,Se,X)=>ie===yi.Specific?E({type:2,focus:yi.Specific,id:Se,trigger:X}):E({type:2,focus:ie,trigger:X})),ce=Zt((ie,Se)=>(E({type:5,id:ie,dataRef:Se}),()=>E({type:6,id:ie}))),De=Zt(ie=>(E({type:7,id:ie}),()=>E({type:7,id:null}))),H=Zt(ie=>Cr(B.mode,{0(){return y==null?void 0:y(ie)},1(){let Se=B.value.slice(),X=Se.findIndex(ke=>k(ke,ie));return X===-1?Se.push(ie):Se.splice(X,1),y==null?void 0:y(Se)}})),W=Zt(ie=>E({type:3,value:ie})),se=Zt(()=>E({type:4})),D=C.useMemo(()=>({onChange:H,registerOption:ce,registerLabel:De,goToOption:fe,closeListbox:oe,openListbox:$,selectActiveOption:Q,selectOption:P,search:W,clearSearch:se}),[]),pe={ref:g},le=C.useRef(null),L=pc();return C.useEffect(()=>{le.current&&r!==void 0&&L.addEventListener(le.current,"reset",()=>{y==null||y(r)})},[le,y]),st.createElement(xT.Provider,{value:D},st.createElement(IT.Provider,{value:B},st.createElement(CB,{value:Cr(B.listboxState,{0:Li.Open,1:Li.Closed})},a!=null&&b!=null&&TB({[a]:b}).map(([ie,Se],X)=>st.createElement(V2e,{features:AB.Hidden,ref:X===0?ke=>{var te;le.current=(te=ke==null?void 0:ke.closest("form"))!=null?te:null}:void 0,...Zy({key:ie,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:ie,value:Se})})),Rl({ourProps:pe,theirProps:f,slot:q,defaultTag:n5e,name:"Listbox"}))))}let i5e="button";function a5e(e,t){var n;let r=B2(),{id:i=`headlessui-listbox-button-${r}`,...a}=e,o=mf("Listbox.Button"),s=gf("Listbox.Button"),u=Pu(o.buttonRef,t),c=pc(),p=Zt(T=>{switch(T.key){case ur.Space:case ur.Enter:case ur.ArrowDown:T.preventDefault(),s.openListbox(),c.nextFrame(()=>{o.value||s.goToOption(yi.First)});break;case ur.ArrowUp:T.preventDefault(),s.openListbox(),c.nextFrame(()=>{o.value||s.goToOption(yi.Last)});break}}),f=Zt(T=>{switch(T.key){case ur.Space:T.preventDefault();break}}),m=Zt(T=>{if(z2e(T.currentTarget))return T.preventDefault();o.listboxState===0?(s.closeListbox(),c.nextFrame(()=>{var E;return(E=o.buttonRef.current)==null?void 0:E.focus({preventScroll:!0})})):(T.preventDefault(),s.openListbox())}),g=yB(()=>{if(o.labelId)return[o.labelId,i].join(" ")},[o.labelId,i]),b=C.useMemo(()=>({open:o.listboxState===0,disabled:o.disabled,value:o.value}),[o]),y={ref:u,id:i,type:F2e(e,o.buttonRef),"aria-haspopup":"listbox","aria-controls":(n=o.optionsRef.current)==null?void 0:n.id,"aria-expanded":o.listboxState===0,"aria-labelledby":g,disabled:o.disabled,onKeyDown:p,onKeyUp:f,onClick:m};return Rl({ourProps:y,theirProps:a,slot:b,defaultTag:i5e,name:"Listbox.Button"})}let o5e="label";function s5e(e,t){let n=B2(),{id:r=`headlessui-listbox-label-${n}`,...i}=e,a=mf("Listbox.Label"),o=gf("Listbox.Label"),s=Pu(a.labelRef,t);Gi(()=>o.registerLabel(r),[r]);let u=Zt(()=>{var p;return(p=a.buttonRef.current)==null?void 0:p.focus({preventScroll:!0})}),c=C.useMemo(()=>({open:a.listboxState===0,disabled:a.disabled}),[a]);return Rl({ourProps:{ref:s,id:r,onClick:u},theirProps:i,slot:c,defaultTag:o5e,name:"Listbox.Label"})}let l5e="ul",u5e=nm.RenderStrategy|nm.Static;function c5e(e,t){var n;let r=B2(),{id:i=`headlessui-listbox-options-${r}`,...a}=e,o=mf("Listbox.Options"),s=gf("Listbox.Options"),u=Pu(o.optionsRef,t),c=pc(),p=pc(),f=CT(),m=(()=>f!==null?(f&Li.Open)===Li.Open:o.listboxState===0)();C.useEffect(()=>{var E;let v=o.optionsRef.current;v&&o.listboxState===0&&v!==((E=EB(v))==null?void 0:E.activeElement)&&v.focus({preventScroll:!0})},[o.listboxState,o.optionsRef]);let g=Zt(E=>{switch(p.dispose(),E.key){case ur.Space:if(o.searchQuery!=="")return E.preventDefault(),E.stopPropagation(),s.search(E.key);case ur.Enter:if(E.preventDefault(),E.stopPropagation(),o.activeOptionIndex!==null){let{dataRef:v}=o.options[o.activeOptionIndex];s.onChange(v.current.value)}o.mode===0&&(s.closeListbox(),vl().nextFrame(()=>{var v;return(v=o.buttonRef.current)==null?void 0:v.focus({preventScroll:!0})}));break;case Cr(o.orientation,{vertical:ur.ArrowDown,horizontal:ur.ArrowRight}):return E.preventDefault(),E.stopPropagation(),s.goToOption(yi.Next);case Cr(o.orientation,{vertical:ur.ArrowUp,horizontal:ur.ArrowLeft}):return E.preventDefault(),E.stopPropagation(),s.goToOption(yi.Previous);case ur.Home:case ur.PageUp:return E.preventDefault(),E.stopPropagation(),s.goToOption(yi.First);case ur.End:case ur.PageDown:return E.preventDefault(),E.stopPropagation(),s.goToOption(yi.Last);case ur.Escape:return E.preventDefault(),E.stopPropagation(),s.closeListbox(),c.nextFrame(()=>{var v;return(v=o.buttonRef.current)==null?void 0:v.focus({preventScroll:!0})});case ur.Tab:E.preventDefault(),E.stopPropagation();break;default:E.key.length===1&&(s.search(E.key),p.setTimeout(()=>s.clearSearch(),350));break}}),b=yB(()=>{var E,v,w;return(w=(E=o.labelRef.current)==null?void 0:E.id)!=null?w:(v=o.buttonRef.current)==null?void 0:v.id},[o.labelRef.current,o.buttonRef.current]),y=C.useMemo(()=>({open:o.listboxState===0}),[o]),T={"aria-activedescendant":o.activeOptionIndex===null||(n=o.options[o.activeOptionIndex])==null?void 0:n.id,"aria-multiselectable":o.mode===1?!0:void 0,"aria-labelledby":b,"aria-orientation":o.orientation,id:i,onKeyDown:g,role:"listbox",tabIndex:0,ref:u};return Rl({ourProps:T,theirProps:a,slot:y,defaultTag:l5e,features:u5e,visible:m,name:"Listbox.Options"})}let d5e="li";function p5e(e,t){let n=B2(),{id:r=`headlessui-listbox-option-${n}`,disabled:i=!1,value:a,...o}=e,s=mf("Listbox.Option"),u=gf("Listbox.Option"),c=s.activeOptionIndex!==null?s.options[s.activeOptionIndex].id===r:!1,p=s.isSelected(a),f=C.useRef(null),m=Y2e(f),g=wo({disabled:i,value:a,domRef:f,get textValue(){return m()}}),b=Pu(t,f);Gi(()=>{if(s.listboxState!==0||!c||s.activationTrigger===0)return;let k=vl();return k.requestAnimationFrame(()=>{var N,B;(B=(N=f.current)==null?void 0:N.scrollIntoView)==null||B.call(N,{block:"nearest"})}),k.dispose},[f,c,s.listboxState,s.activationTrigger,s.activeOptionIndex]),Gi(()=>u.registerOption(r,g),[g,r]);let y=Zt(k=>{if(i)return k.preventDefault();u.onChange(a),s.mode===0&&(u.closeListbox(),vl().nextFrame(()=>{var N;return(N=s.buttonRef.current)==null?void 0:N.focus({preventScroll:!0})}))}),T=Zt(()=>{if(i)return u.goToOption(yi.Nothing);u.goToOption(yi.Specific,r)}),E=q2e(),v=Zt(k=>E.update(k)),w=Zt(k=>{E.wasMoved(k)&&(i||c||u.goToOption(yi.Specific,r,0))}),A=Zt(k=>{E.wasMoved(k)&&(i||c&&u.goToOption(yi.Nothing))}),R=C.useMemo(()=>({active:c,selected:p,disabled:i}),[c,p,i]);return Rl({ourProps:{id:r,ref:b,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":p,disabled:void 0,onClick:y,onFocus:T,onPointerEnter:v,onMouseEnter:v,onPointerMove:w,onMouseMove:w,onPointerLeave:A,onMouseLeave:A},theirProps:o,slot:R,defaultTag:d5e,name:"Listbox.Option"})}let f5e=ys(r5e),h5e=ys(a5e),g5e=ys(s5e),m5e=ys(c5e),b5e=ys(p5e),U2=Object.assign(f5e,{Button:h5e,Label:g5e,Options:m5e,Option:b5e});function y5e(e=0){let[t,n]=C.useState(e),r=kT(),i=C.useCallback(u=>{r.current&&n(c=>c|u)},[t,r]),a=C.useCallback(u=>!!(t&u),[t]),o=C.useCallback(u=>{r.current&&n(c=>c&~u)},[n,r]),s=C.useCallback(u=>{r.current&&n(c=>c^u)},[n]);return{flags:t,addFlag:i,hasFlag:a,removeFlag:o,toggleFlag:s}}function E5e(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function $4(e,...t){e&&t.length>0&&e.classList.add(...t)}function z4(e,...t){e&&t.length>0&&e.classList.remove(...t)}function v5e(e,t){let n=vl();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[a,o]=[r,i].map(u=>{let[c=0]=u.split(",").filter(Boolean).map(p=>p.includes("ms")?parseFloat(p):parseFloat(p)*1e3).sort((p,f)=>f-p);return c}),s=a+o;if(s!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},s),c.addEventListener(e,"transitionrun",p=>{p.target===p.currentTarget&&c.dispose()})});let u=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),u())})}else t();return n.add(()=>t()),n.dispose}function _5e(e,t,n,r){let i=n?"enter":"leave",a=vl(),o=r!==void 0?E5e(r):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=Cr(i,{enter:()=>t.enter,leave:()=>t.leave}),u=Cr(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Cr(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return z4(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),$4(e,...t.base,...s,...c),a.nextFrame(()=>{z4(e,...t.base,...s,...c),$4(e,...t.base,...s,...u),v5e(e,()=>(z4(e,...t.base,...s),$4(e,...t.base,...t.entered),o()))}),a.dispose}function T5e({immediate:e,container:t,direction:n,classes:r,onStart:i,onStop:a}){let o=kT(),s=pc(),u=wo(n);Gi(()=>{e&&(u.current="enter")},[e]),Gi(()=>{let c=vl();s.add(c.dispose);let p=t.current;if(p&&u.current!=="idle"&&o.current)return c.dispose(),i.current(u.current),c.add(_5e(p,r.current,u.current==="enter",()=>{c.dispose(),a.current(u.current)})),c.dispose},[n])}function Bs(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let $2=C.createContext(null);$2.displayName="TransitionContext";var S5e=(e=>(e.Visible="visible",e.Hidden="hidden",e))(S5e||{});function w5e(){let e=C.useContext($2);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}function A5e(){let e=C.useContext(z2);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}let z2=C.createContext(null);z2.displayName="NestingContext";function H2(e){return"children"in e?H2(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function kB(e,t){let n=wo(e),r=C.useRef([]),i=kT(),a=pc(),o=Zt((g,b=Qs.Hidden)=>{let y=r.current.findIndex(({el:T})=>T===g);y!==-1&&(Cr(b,{[Qs.Unmount](){r.current.splice(y,1)},[Qs.Hidden](){r.current[y].state="hidden"}}),a.microTask(()=>{var T;!H2(r)&&i.current&&((T=n.current)==null||T.call(n))}))}),s=Zt(g=>{let b=r.current.find(({el:y})=>y===g);return b?b.state!=="visible"&&(b.state="visible"):r.current.push({el:g,state:"visible"}),()=>o(g,Qs.Unmount)}),u=C.useRef([]),c=C.useRef(Promise.resolve()),p=C.useRef({enter:[],leave:[],idle:[]}),f=Zt((g,b,y)=>{u.current.splice(0),t&&(t.chains.current[b]=t.chains.current[b].filter(([T])=>T!==g)),t==null||t.chains.current[b].push([g,new Promise(T=>{u.current.push(T)})]),t==null||t.chains.current[b].push([g,new Promise(T=>{Promise.all(p.current[b].map(([E,v])=>v)).then(()=>T())})]),b==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(b)):y(b)}),m=Zt((g,b,y)=>{Promise.all(p.current[b].splice(0).map(([T,E])=>E)).then(()=>{var T;(T=u.current.shift())==null||T()}).then(()=>y(b))});return C.useMemo(()=>({children:r,register:s,unregister:o,onStart:f,onStop:m,wait:c,chains:p}),[s,o,r,f,m,p,c])}function C5e(){}let k5e=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function nN(e){var t;let n={};for(let r of k5e)n[r]=(t=e[r])!=null?t:C5e;return n}function x5e(e){let t=C.useRef(nN(e));return C.useEffect(()=>{t.current=nN(e)},[e]),t}let I5e="div",xB=nm.RenderStrategy;function R5e(e,t){var n,r;let{beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s,enter:u,enterFrom:c,enterTo:p,entered:f,leave:m,leaveFrom:g,leaveTo:b,...y}=e,T=C.useRef(null),E=Pu(T,t),v=(n=y.unmount)==null||n?Qs.Unmount:Qs.Hidden,{show:w,appear:A,initial:R}=w5e(),[k,N]=C.useState(w?"visible":"hidden"),B=A5e(),{register:q,unregister:P}=B;C.useEffect(()=>q(T),[q,T]),C.useEffect(()=>{if(v===Qs.Hidden&&T.current){if(w&&k!=="visible"){N("visible");return}return Cr(k,{hidden:()=>P(T),visible:()=>q(T)})}},[k,T,q,P,w,v]);let Q=wo({base:Bs(y.className),enter:Bs(u),enterFrom:Bs(c),enterTo:Bs(p),entered:Bs(f),leave:Bs(m),leaveFrom:Bs(g),leaveTo:Bs(b)}),$=x5e({beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s}),oe=ST();C.useEffect(()=>{if(oe&&k==="visible"&&T.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[T,k,oe]);let fe=R&&!A,ce=A&&w&&R,De=(()=>!oe||fe?"idle":w?"enter":"leave")(),H=y5e(0),W=Zt(L=>Cr(L,{enter:()=>{H.addFlag(Li.Opening),$.current.beforeEnter()},leave:()=>{H.addFlag(Li.Closing),$.current.beforeLeave()},idle:()=>{}})),se=Zt(L=>Cr(L,{enter:()=>{H.removeFlag(Li.Opening),$.current.afterEnter()},leave:()=>{H.removeFlag(Li.Closing),$.current.afterLeave()},idle:()=>{}})),D=kB(()=>{N("hidden"),P(T)},B);T5e({immediate:ce,container:T,classes:Q,direction:De,onStart:wo(L=>{D.onStart(T,L,W)}),onStop:wo(L=>{D.onStop(T,L,se),L==="leave"&&!H2(D)&&(N("hidden"),P(T))})});let pe=y,le={ref:E};return ce?pe={...pe,className:tm(y.className,...Q.current.enter,...Q.current.enterFrom)}:(pe.className=tm(y.className,(r=T.current)==null?void 0:r.className),pe.className===""&&delete pe.className),st.createElement(z2.Provider,{value:D},st.createElement(CB,{value:Cr(k,{visible:Li.Open,hidden:Li.Closed})|H.flags},Rl({ourProps:le,theirProps:pe,defaultTag:I5e,features:xB,visible:k==="visible",name:"Transition.Child"})))}function N5e(e,t){let{show:n,appear:r=!1,unmount:i=!0,...a}=e,o=C.useRef(null),s=Pu(o,t);ST();let u=CT();if(n===void 0&&u!==null&&(n=(u&Li.Open)===Li.Open),![!0,!1].includes(n))throw new Error("A is used but it is missing a `show={true | false}` prop.");let[c,p]=C.useState(n?"visible":"hidden"),f=kB(()=>{p("hidden")}),[m,g]=C.useState(!0),b=C.useRef([n]);Gi(()=>{m!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),g(!1))},[b,n]);let y=C.useMemo(()=>({show:n,appear:r,initial:m}),[n,r,m]);C.useEffect(()=>{if(n)p("visible");else if(!H2(f))p("hidden");else{let w=o.current;if(!w)return;let A=w.getBoundingClientRect();A.x===0&&A.y===0&&A.width===0&&A.height===0&&p("hidden")}},[n,f]);let T={unmount:i},E=Zt(()=>{var w;m&&g(!1),(w=e.beforeEnter)==null||w.call(e)}),v=Zt(()=>{var w;m&&g(!1),(w=e.beforeLeave)==null||w.call(e)});return st.createElement(z2.Provider,{value:f},st.createElement($2.Provider,{value:y},Rl({ourProps:{...T,as:C.Fragment,children:st.createElement(IB,{ref:s,...T,...a,beforeEnter:E,beforeLeave:v})},theirProps:{},defaultTag:C.Fragment,features:xB,visible:c==="visible",name:"Transition"})))}function O5e(e,t){let n=C.useContext($2)!==null,r=CT()!==null;return st.createElement(st.Fragment,null,!n&&r?st.createElement(Qy,{ref:t,...e}):st.createElement(IB,{ref:t,...e}))}let Qy=ys(N5e),IB=ys(R5e),D5e=ys(O5e),L5e=Object.assign(Qy,{Child:D5e,Root:Qy});const M5e=Ge.div` @@ -1069,7 +1069,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho opacity: 0.4; } } -`;function Y3e(e){const t=window.vscMediaUrl;return I.jsx(K3e,{children:t?I.jsx("img",{src:`${t}/play_button.png`,width:"22px"}):I.jsx(AL,{width:e.size||WB})})}const aE=({msg:e})=>{const t="info-hover",n=document.getElementById("tooltip-portal-div");return I.jsxs(I.Fragment,{children:[I.jsx(MZ,{"data-tooltip-id":t,className:"h-5 w-5 text-gray-500 cursor-help"}),n&&u9.createPortal(I.jsx(au,{id:t,place:"bottom",children:e}),n)]})};var bf=e=>e.type==="checkbox",F1=e=>e instanceof Date,ei=e=>e==null;const qB=e=>typeof e=="object";var ir=e=>!ei(e)&&!Array.isArray(e)&&qB(e)&&!F1(e),X3e=e=>ir(e)&&e.target?bf(e.target)?e.target.checked:e.target.value:e,Z3e=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Q3e=(e,t)=>e.has(Z3e(t)),J3e=e=>{const t=e.constructor&&e.constructor.prototype;return ir(t)&&t.hasOwnProperty("isPrototypeOf")},FT=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Qo(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(FT&&(e instanceof Blob||e instanceof FileList))&&(n||ir(e)))if(t=n?[]:{},!n&&!J3e(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Qo(e[r]));else return e;return t}var yf=e=>Array.isArray(e)?e.filter(Boolean):[],qn=e=>e===void 0,ut=(e,t,n)=>{if(!t||!ir(e))return n;const r=yf(t.split(/[,[\].]+?/)).reduce((i,a)=>ei(i)?i:i[a],e);return qn(r)||r===e?qn(e[t])?n:e[t]:r},lu=e=>typeof e=="boolean";const fN={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ha={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Yo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},e4e=st.createContext(null),KB=e=>{const{children:t,...n}=e;return st.createElement(e4e.Provider,{value:n},t)};var t4e=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Ha.all&&(t._proxyFormState[o]=!r||Ha.all),n&&(n[o]=!0),e[o]}});return i},sa=e=>ir(e)&&!Object.keys(e).length,n4e=(e,t,n,r)=>{n(e);const{name:i,...a}=e;return sa(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!r||Ha.all))},V4=e=>Array.isArray(e)?e:[e];function r4e(e){const t=st.useRef(e);t.current=e,st.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var Eo=e=>typeof e=="string",i4e=(e,t,n,r,i)=>Eo(e)?(r&&t.watch.add(e),ut(n,e,i)):Array.isArray(e)?e.map(a=>(r&&t.watch.add(a),ut(n,a))):(r&&(t.watchAll=!0),n),PT=e=>/^\w*$/.test(e),YB=e=>yf(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Cn(e,t,n){let r=-1;const i=PT(t)?[t]:YB(t),a=i.length,o=a-1;for(;++rt?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{};const oE=(e,t,n)=>{for(const r of n||Object.keys(e)){const i=ut(e,r);if(i){const{_f:a,...o}=i;if(a&&t(a.name)){if(a.ref.focus){a.ref.focus();break}else if(a.refs&&a.refs[0].focus){a.refs[0].focus();break}}else ir(o)&&oE(o,t)}}};var hN=e=>({isOnSubmit:!e||e===Ha.onSubmit,isOnBlur:e===Ha.onBlur,isOnChange:e===Ha.onChange,isOnAll:e===Ha.all,isOnTouch:e===Ha.onTouched}),gN=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length)))),o4e=(e,t,n)=>{const r=yf(ut(e,n));return Cn(r,"root",t[n]),Cn(e,n,r),e},BT=e=>e.type==="file",Js=e=>typeof e=="function",rm=e=>{if(!FT)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},qh=e=>Eo(e),UT=e=>e.type==="radio",im=e=>e instanceof RegExp;const mN={value:!1,isValid:!1},bN={value:!0,isValid:!0};var XB=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&&!qn(e[0].attributes.value)?qn(e[0].value)||e[0].value===""?bN:{value:e[0].value,isValid:!0}:bN:mN}return mN};const yN={isValid:!1,value:null};var ZB=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,yN):yN;function EN(e,t,n="validate"){if(qh(e)||Array.isArray(e)&&e.every(qh)||lu(e)&&!e)return{type:n,message:qh(e)?e:"",ref:t}}var a1=e=>ir(e)&&!im(e)?e:{value:e,message:""},vN=async(e,t,n,r,i)=>{const{ref:a,refs:o,required:s,maxLength:u,minLength:c,min:p,max:f,pattern:m,validate:g,name:b,valueAsNumber:y,mount:T,disabled:E}=e._f,v=ut(t,b);if(!T||E)return{};const w=o?o[0]:a,A=$=>{r&&w.reportValidity&&(w.setCustomValidity(lu($)?"":$||""),w.reportValidity())},R={},k=UT(a),N=bf(a),B=k||N,q=(y||BT(a))&&qn(a.value)&&qn(v)||rm(a)&&a.value===""||v===""||Array.isArray(v)&&!v.length,P=a4e.bind(null,b,n,R),Q=($,oe,fe,ce=Yo.maxLength,De=Yo.minLength)=>{const H=$?oe:fe;R[b]={type:$?ce:De,message:H,ref:a,...P($?ce:De,H)}};if(i?!Array.isArray(v)||!v.length:s&&(!B&&(q||ei(v))||lu(v)&&!v||N&&!XB(o).isValid||k&&!ZB(o).isValid)){const{value:$,message:oe}=qh(s)?{value:!!s,message:s}:a1(s);if($&&(R[b]={type:Yo.required,message:oe,ref:w,...P(Yo.required,oe)},!n))return A(oe),R}if(!q&&(!ei(p)||!ei(f))){let $,oe;const fe=a1(f),ce=a1(p);if(!ei(v)&&!isNaN(v)){const De=a.valueAsNumber||v&&+v;ei(fe.value)||($=De>fe.value),ei(ce.value)||(oe=Denew Date(new Date().toDateString()+" "+D),W=a.type=="time",se=a.type=="week";Eo(fe.value)&&v&&($=W?H(v)>H(fe.value):se?v>fe.value:De>new Date(fe.value)),Eo(ce.value)&&v&&(oe=W?H(v)+$.value,ce=!ei(oe.value)&&v.length<+oe.value;if((fe||ce)&&(Q(fe,$.message,oe.message),!n))return A(R[b].message),R}if(m&&!q&&Eo(v)){const{value:$,message:oe}=a1(m);if(im($)&&!v.match($)&&(R[b]={type:Yo.pattern,message:oe,ref:a,...P(Yo.pattern,oe)},!n))return A(oe),R}if(g){if(Js(g)){const $=await g(v,t),oe=EN($,w);if(oe&&(R[b]={...oe,...P(Yo.validate,oe.message)},!n))return A(oe.message),R}else if(ir(g)){let $={};for(const oe in g){if(!sa($)&&!n)break;const fe=EN(await g[oe](v,t),w,oe);fe&&($={...fe,...P(oe,fe.message)},A(fe.message),n&&(R[b]=$))}if(!sa($)&&(R[b]={ref:w,...$},!n))return R}}return A(!0),R};function s4e(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}}var am=e=>ei(e)||!qB(e);function uu(e,t){if(am(e)||am(t))return e===t;if(F1(e)&&F1(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const a=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=t[i];if(F1(a)&&F1(o)||ir(a)&&ir(o)||Array.isArray(a)&&Array.isArray(o)?!uu(a,o):a!==o)return!1}}return!0}var QB=e=>e.type==="select-multiple",u4e=e=>UT(e)||bf(e),q4=e=>rm(e)&&e.isConnected,JB=e=>{for(const t in e)if(Js(e[t]))return!0;return!1};function om(e,t={}){const n=Array.isArray(e);if(ir(e)||n)for(const r in e)Array.isArray(e[r])||ir(e[r])&&!JB(e[r])?(t[r]=Array.isArray(e[r])?[]:{},om(e[r],t[r])):ei(e[r])||(t[r]=!0);return t}function eU(e,t,n){const r=Array.isArray(e);if(ir(e)||r)for(const i in e)Array.isArray(e[i])||ir(e[i])&&!JB(e[i])?qn(t)||am(n[i])?n[i]=Array.isArray(e[i])?om(e[i],[]):{...om(e[i])}:eU(e[i],ei(t)?{}:t[i],n[i]):n[i]=!uu(e[i],t[i]);return n}var K4=(e,t)=>eU(e,t,om(t)),tU=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>qn(e)?e:t?e===""?NaN:e&&+e:n&&Eo(e)?new Date(e):r?r(e):e;function Y4(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return BT(t)?t.files:UT(t)?ZB(e.refs).value:QB(t)?[...t.selectedOptions].map(({value:n})=>n):bf(t)?XB(e.refs).value:tU(qn(t.value)?e.ref.value:t.value,e)}var c4e=(e,t,n,r)=>{const i={};for(const a of e){const o=ut(t,a);o&&Cn(i,a,o._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},yd=e=>qn(e)?e:im(e)?e.source:ir(e)?im(e.value)?e.value.source:e.value:e,d4e=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function _N(e,t,n){const r=ut(e,n);if(r||PT(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const a=i.join("."),o=ut(t,a),s=ut(e,a);if(o&&!Array.isArray(o)&&n!==a)return{name:n};if(s&&s.type)return{name:a,error:s};i.pop()}return{name:n}}var p4e=(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,f4e=(e,t)=>!yf(ut(e,t)).length&&vr(e,t);const h4e={mode:Ha.onSubmit,reValidateMode:Ha.onChange,shouldFocusError:!0};function g4e(e={},t){let n={...h4e,...e},r={submitCount:0,isDirty:!1,isLoading:Js(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},i={},a=ir(n.defaultValues)||ir(n.values)?Qo(n.defaultValues||n.values)||{}:{},o=n.shouldUnregister?{}:Qo(a),s={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,p=0;const f={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={values:W4(),array:W4(),state:W4()},g=e.resetOptions&&e.resetOptions.keepDirtyValues,b=hN(n.mode),y=hN(n.reValidateMode),T=n.criteriaMode===Ha.all,E=U=>re=>{clearTimeout(p),p=setTimeout(U,re)},v=async U=>{if(f.isValid||U){const re=n.resolver?sa((await q()).errors):await Q(i,!0);re!==r.isValid&&m.state.next({isValid:re})}},w=U=>f.isValidating&&m.state.next({isValidating:U}),A=(U,re=[],de,xe,ye=!0,Te=!0)=>{if(xe&&de){if(s.action=!0,Te&&Array.isArray(ut(i,U))){const Le=de(ut(i,U),xe.argA,xe.argB);ye&&Cn(i,U,Le)}if(Te&&Array.isArray(ut(r.errors,U))){const Le=de(ut(r.errors,U),xe.argA,xe.argB);ye&&Cn(r.errors,U,Le),f4e(r.errors,U)}if(f.touchedFields&&Te&&Array.isArray(ut(r.touchedFields,U))){const Le=de(ut(r.touchedFields,U),xe.argA,xe.argB);ye&&Cn(r.touchedFields,U,Le)}f.dirtyFields&&(r.dirtyFields=K4(a,o)),m.state.next({name:U,isDirty:oe(U,re),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Cn(o,U,re)},R=(U,re)=>{Cn(r.errors,U,re),m.state.next({errors:r.errors})},k=(U,re,de,xe)=>{const ye=ut(i,U);if(ye){const Te=ut(o,U,qn(de)?ut(a,U):de);qn(Te)||xe&&xe.defaultChecked||re?Cn(o,U,re?Te:Y4(ye._f)):De(U,Te),s.mount&&v()}},N=(U,re,de,xe,ye)=>{let Te=!1,Le=!1;const ze={name:U};if(!de||xe){f.isDirty&&(Le=r.isDirty,r.isDirty=ze.isDirty=oe(),Te=Le!==ze.isDirty);const Ye=uu(ut(a,U),re);Le=ut(r.dirtyFields,U),Ye?vr(r.dirtyFields,U):Cn(r.dirtyFields,U,!0),ze.dirtyFields=r.dirtyFields,Te=Te||f.dirtyFields&&Le!==!Ye}if(de){const Ye=ut(r.touchedFields,U);Ye||(Cn(r.touchedFields,U,de),ze.touchedFields=r.touchedFields,Te=Te||f.touchedFields&&Ye!==de)}return Te&&ye&&m.state.next(ze),Te?ze:{}},B=(U,re,de,xe)=>{const ye=ut(r.errors,U),Te=f.isValid&&lu(re)&&r.isValid!==re;if(e.delayError&&de?(c=E(()=>R(U,de)),c(e.delayError)):(clearTimeout(p),c=null,de?Cn(r.errors,U,de):vr(r.errors,U)),(de?!uu(ye,de):ye)||!sa(xe)||Te){const Le={...xe,...Te&&lu(re)?{isValid:re}:{},errors:r.errors,name:U};r={...r,...Le},m.state.next(Le)}w(!1)},q=async U=>n.resolver(o,n.context,c4e(U||u.mount,i,n.criteriaMode,n.shouldUseNativeValidation)),P=async U=>{const{errors:re}=await q(U);if(U)for(const de of U){const xe=ut(re,de);xe?Cn(r.errors,de,xe):vr(r.errors,de)}else r.errors=re;return re},Q=async(U,re,de={valid:!0})=>{for(const xe in U){const ye=U[xe];if(ye){const{_f:Te,...Le}=ye;if(Te){const ze=u.array.has(Te.name),Ye=await vN(ye,o,T,n.shouldUseNativeValidation&&!re,ze);if(Ye[Te.name]&&(de.valid=!1,re))break;!re&&(ut(Ye,Te.name)?ze?o4e(r.errors,Ye,Te.name):Cn(r.errors,Te.name,Ye[Te.name]):vr(r.errors,Te.name))}Le&&await Q(Le,re,de)}}return de.valid},$=()=>{for(const U of u.unMount){const re=ut(i,U);re&&(re._f.refs?re._f.refs.every(de=>!q4(de)):!q4(re._f.ref))&&X(U)}u.unMount=new Set},oe=(U,re)=>(U&&re&&Cn(o,U,re),!uu(pe(),a)),fe=(U,re,de)=>i4e(U,u,{...s.mount?o:qn(re)?a:Eo(U)?{[U]:re}:re},de,re),ce=U=>yf(ut(s.mount?o:a,U,e.shouldUnregister?ut(a,U,[]):[])),De=(U,re,de={})=>{const xe=ut(i,U);let ye=re;if(xe){const Te=xe._f;Te&&(!Te.disabled&&Cn(o,U,tU(re,Te)),ye=rm(Te.ref)&&ei(re)?"":re,QB(Te.ref)?[...Te.ref.options].forEach(Le=>Le.selected=ye.includes(Le.value)):Te.refs?bf(Te.ref)?Te.refs.length>1?Te.refs.forEach(Le=>(!Le.defaultChecked||!Le.disabled)&&(Le.checked=Array.isArray(ye)?!!ye.find(ze=>ze===Le.value):ye===Le.value)):Te.refs[0]&&(Te.refs[0].checked=!!ye):Te.refs.forEach(Le=>Le.checked=Le.value===ye):BT(Te.ref)?Te.ref.value="":(Te.ref.value=ye,Te.ref.type||m.values.next({name:U,values:{...o}})))}(de.shouldDirty||de.shouldTouch)&&N(U,ye,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&D(U)},H=(U,re,de)=>{for(const xe in re){const ye=re[xe],Te=`${U}.${xe}`,Le=ut(i,Te);(u.array.has(U)||!am(ye)||Le&&!Le._f)&&!F1(ye)?H(Te,ye,de):De(Te,ye,de)}},W=(U,re,de={})=>{const xe=ut(i,U),ye=u.array.has(U),Te=Qo(re);Cn(o,U,Te),ye?(m.array.next({name:U,values:{...o}}),(f.isDirty||f.dirtyFields)&&de.shouldDirty&&m.state.next({name:U,dirtyFields:K4(a,o),isDirty:oe(U,Te)})):xe&&!xe._f&&!ei(Te)?H(U,Te,de):De(U,Te,de),gN(U,u)&&m.state.next({...r}),m.values.next({name:U,values:{...o}}),!s.mount&&t()},se=async U=>{const re=U.target;let de=re.name,xe=!0;const ye=ut(i,de),Te=()=>re.type?Y4(ye._f):X3e(U);if(ye){let Le,ze;const Ye=Te(),jt=U.type===fN.BLUR||U.type===fN.FOCUS_OUT,ue=!d4e(ye._f)&&!n.resolver&&!ut(r.errors,de)&&!ye._f.deps||p4e(jt,ut(r.touchedFields,de),r.isSubmitted,y,b),Ee=gN(de,u,jt);Cn(o,de,Ye),jt?(ye._f.onBlur&&ye._f.onBlur(U),c&&c(0)):ye._f.onChange&&ye._f.onChange(U);const qe=N(de,Ye,jt,!1),j=!sa(qe)||Ee;if(!jt&&m.values.next({name:de,type:U.type,values:{...o}}),ue)return f.isValid&&v(),j&&m.state.next({name:de,...Ee?{}:qe});if(!jt&&Ee&&m.state.next({...r}),w(!0),n.resolver){const{errors:me}=await q([de]),Ve=_N(r.errors,i,de),ge=_N(me,i,Ve.name||de);Le=ge.error,de=ge.name,ze=sa(me)}else Le=(await vN(ye,o,T,n.shouldUseNativeValidation))[de],xe=Number.isNaN(Ye)||Ye===ut(o,de,Ye),xe&&(Le?ze=!1:f.isValid&&(ze=await Q(i,!0)));xe&&(ye._f.deps&&D(ye._f.deps),B(de,ze,Le,qe))}},D=async(U,re={})=>{let de,xe;const ye=V4(U);if(w(!0),n.resolver){const Te=await P(qn(U)?U:ye);de=sa(Te),xe=U?!ye.some(Le=>ut(Te,Le)):de}else U?(xe=(await Promise.all(ye.map(async Te=>{const Le=ut(i,Te);return await Q(Le&&Le._f?{[Te]:Le}:Le)}))).every(Boolean),!(!xe&&!r.isValid)&&v()):xe=de=await Q(i);return m.state.next({...!Eo(U)||f.isValid&&de!==r.isValid?{}:{name:U},...n.resolver||!U?{isValid:de}:{},errors:r.errors,isValidating:!1}),re.shouldFocus&&!xe&&oE(i,Te=>Te&&ut(r.errors,Te),U?ye:u.mount),xe},pe=U=>{const re={...a,...s.mount?o:{}};return qn(U)?re:Eo(U)?ut(re,U):U.map(de=>ut(re,de))},le=(U,re)=>({invalid:!!ut((re||r).errors,U),isDirty:!!ut((re||r).dirtyFields,U),isTouched:!!ut((re||r).touchedFields,U),error:ut((re||r).errors,U)}),L=U=>{U&&V4(U).forEach(re=>vr(r.errors,re)),m.state.next({errors:U?r.errors:{}})},ie=(U,re,de)=>{const xe=(ut(i,U,{_f:{}})._f||{}).ref;Cn(r.errors,U,{...re,ref:xe}),m.state.next({name:U,errors:r.errors,isValid:!1}),de&&de.shouldFocus&&xe&&xe.focus&&xe.focus()},Se=(U,re)=>Js(U)?m.values.subscribe({next:de=>U(fe(void 0,re),de)}):fe(U,re,!0),X=(U,re={})=>{for(const de of U?V4(U):u.mount)u.mount.delete(de),u.array.delete(de),re.keepValue||(vr(i,de),vr(o,de)),!re.keepError&&vr(r.errors,de),!re.keepDirty&&vr(r.dirtyFields,de),!re.keepTouched&&vr(r.touchedFields,de),!n.shouldUnregister&&!re.keepDefaultValue&&vr(a,de);m.values.next({values:{...o}}),m.state.next({...r,...re.keepDirty?{isDirty:oe()}:{}}),!re.keepIsValid&&v()},ke=({disabled:U,name:re,field:de,fields:xe})=>{if(lu(U)){const ye=U?void 0:ut(o,re,Y4(de?de._f:ut(xe,re)._f));Cn(o,re,ye),N(re,ye,!1,!1,!0)}},te=(U,re={})=>{let de=ut(i,U);const xe=lu(re.disabled);return Cn(i,U,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:U}},name:U,mount:!0,...re}}),u.mount.add(U),de?ke({field:de,disabled:re.disabled,name:U}):k(U,!0,re.value),{...xe?{disabled:re.disabled}:{},...n.progressive?{required:!!re.required,min:yd(re.min),max:yd(re.max),minLength:yd(re.minLength),maxLength:yd(re.maxLength),pattern:yd(re.pattern)}:{},name:U,onChange:se,onBlur:se,ref:ye=>{if(ye){te(U,re),de=ut(i,U);const Te=qn(ye.value)&&ye.querySelectorAll&&ye.querySelectorAll("input,select,textarea")[0]||ye,Le=u4e(Te),ze=de._f.refs||[];if(Le?ze.find(Ye=>Ye===Te):Te===de._f.ref)return;Cn(i,U,{_f:{...de._f,...Le?{refs:[...ze.filter(q4),Te,...Array.isArray(ut(a,U))?[{}]:[]],ref:{type:Te.type,name:U}}:{ref:Te}}}),k(U,!1,void 0,Te)}else de=ut(i,U,{}),de._f&&(de._f.mount=!1),(n.shouldUnregister||re.shouldUnregister)&&!(Q3e(u.array,U)&&s.action)&&u.unMount.add(U)}}},Me=()=>n.shouldFocusError&&oE(i,U=>U&&ut(r.errors,U),u.mount),Re=(U,re)=>async de=>{de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let xe=Qo(o);if(m.state.next({isSubmitting:!0}),n.resolver){const{errors:ye,values:Te}=await q();r.errors=ye,xe=Te}else await Q(i);vr(r.errors,"root"),sa(r.errors)?(m.state.next({errors:{}}),await U(xe,de)):(re&&await re({...r.errors},de),Me(),setTimeout(Me)),m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:sa(r.errors),submitCount:r.submitCount+1,errors:r.errors})},Ze=(U,re={})=>{ut(i,U)&&(qn(re.defaultValue)?W(U,ut(a,U)):(W(U,re.defaultValue),Cn(a,U,re.defaultValue)),re.keepTouched||vr(r.touchedFields,U),re.keepDirty||(vr(r.dirtyFields,U),r.isDirty=re.defaultValue?oe(U,ut(a,U)):oe()),re.keepError||(vr(r.errors,U),f.isValid&&v()),m.state.next({...r}))},We=(U,re={})=>{const de=U?Qo(U):a,xe=Qo(de),ye=U&&!sa(U)?xe:a;if(re.keepDefaultValues||(a=de),!re.keepValues){if(re.keepDirtyValues||g)for(const Te of u.mount)ut(r.dirtyFields,Te)?Cn(ye,Te,ut(o,Te)):W(Te,ut(ye,Te));else{if(FT&&qn(U))for(const Te of u.mount){const Le=ut(i,Te);if(Le&&Le._f){const ze=Array.isArray(Le._f.refs)?Le._f.refs[0]:Le._f.ref;if(rm(ze)){const Ye=ze.closest("form");if(Ye){Ye.reset();break}}}}i={}}o=e.shouldUnregister?re.keepDefaultValues?Qo(a):{}:Qo(ye),m.array.next({values:{...ye}}),m.values.next({values:{...ye}})}u={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!s.mount&&t(),s.mount=!f.isValid||!!re.keepIsValid,s.watch=!!e.shouldUnregister,m.state.next({submitCount:re.keepSubmitCount?r.submitCount:0,isDirty:re.keepDirty?r.isDirty:!!(re.keepDefaultValues&&!uu(U,a)),isSubmitted:re.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:re.keepDirtyValues?r.dirtyFields:re.keepDefaultValues&&U?K4(a,U):{},touchedFields:re.keepTouched?r.touchedFields:{},errors:re.keepErrors?r.errors:{},isSubmitSuccessful:re.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},dt=(U,re)=>We(Js(U)?U(o):U,re);return{control:{register:te,unregister:X,getFieldState:le,handleSubmit:Re,setError:ie,_executeSchema:q,_getWatch:fe,_getDirty:oe,_updateValid:v,_removeUnmounted:$,_updateFieldArray:A,_updateDisabledField:ke,_getFieldArray:ce,_reset:We,_resetDefaultValues:()=>Js(n.defaultValues)&&n.defaultValues().then(U=>{dt(U,n.resetOptions),m.state.next({isLoading:!1})}),_updateFormState:U=>{r={...r,...U}},_subjects:m,_proxyFormState:f,get _fields(){return i},get _formValues(){return o},get _state(){return s},set _state(U){s=U},get _defaultValues(){return a},get _names(){return u},set _names(U){u=U},get _formState(){return r},set _formState(U){r=U},get _options(){return n},set _options(U){n={...n,...U}}},trigger:D,register:te,handleSubmit:Re,watch:Se,setValue:W,getValues:pe,reset:dt,resetField:Ze,clearErrors:L,unregister:X,setError:ie,setFocus:(U,re={})=>{const de=ut(i,U),xe=de&&de._f;if(xe){const ye=xe.refs?xe.refs[0]:xe.ref;ye.focus&&(ye.focus(),re.shouldSelect&&ye.select())}},getFieldState:le}}function nU(e={}){const t=st.useRef(),n=st.useRef(),[r,i]=st.useState({isDirty:!1,isValidating:!1,isLoading:Js(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Js(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...g4e(e,()=>i(o=>({...o}))),formState:r});const a=t.current.control;return a._options=e,r4e({subject:a._subjects.state,next:o=>{n4e(o,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),st.useEffect(()=>{e.values&&!uu(e.values,n.current)?(a._reset(e.values,a._options.resetOptions),n.current=e.values):a._resetDefaultValues()},[e.values,a]),st.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=t4e(r,a),t.current}const TN=Ge.hr` +`;function Y3e(e){const t=window.vscMediaUrl;return I.jsx(K3e,{children:t?I.jsx("img",{src:`${t}/play_button.png`,width:"22px"}):I.jsx(AL,{width:e.size||WB})})}const aE=({msg:e})=>{const t="info-hover",n=document.getElementById("tooltip-portal-div");return I.jsxs(I.Fragment,{children:[I.jsx(MZ,{"data-tooltip-id":t,className:"h-5 w-5 text-gray-500 cursor-help"}),n&&u9.createPortal(I.jsx(au,{id:t,place:"bottom",children:e}),n)]})};var bf=e=>e.type==="checkbox",F1=e=>e instanceof Date,ei=e=>e==null;const qB=e=>typeof e=="object";var ir=e=>!ei(e)&&!Array.isArray(e)&&qB(e)&&!F1(e),X3e=e=>ir(e)&&e.target?bf(e.target)?e.target.checked:e.target.value:e,Z3e=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Q3e=(e,t)=>e.has(Z3e(t)),J3e=e=>{const t=e.constructor&&e.constructor.prototype;return ir(t)&&t.hasOwnProperty("isPrototypeOf")},FT=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Qo(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(FT&&(e instanceof Blob||e instanceof FileList))&&(n||ir(e)))if(t=n?[]:{},!n&&!J3e(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Qo(e[r]));else return e;return t}var yf=e=>Array.isArray(e)?e.filter(Boolean):[],qn=e=>e===void 0,ut=(e,t,n)=>{if(!t||!ir(e))return n;const r=yf(t.split(/[,[\].]+?/)).reduce((i,a)=>ei(i)?i:i[a],e);return qn(r)||r===e?qn(e[t])?n:e[t]:r},lu=e=>typeof e=="boolean";const fN={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ha={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Yo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},e4e=st.createContext(null),KB=e=>{const{children:t,...n}=e;return st.createElement(e4e.Provider,{value:n},t)};var t4e=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Ha.all&&(t._proxyFormState[o]=!r||Ha.all),n&&(n[o]=!0),e[o]}});return i},sa=e=>ir(e)&&!Object.keys(e).length,n4e=(e,t,n,r)=>{n(e);const{name:i,...a}=e;return sa(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!r||Ha.all))},V4=e=>Array.isArray(e)?e:[e];function r4e(e){const t=st.useRef(e);t.current=e,st.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var Eo=e=>typeof e=="string",i4e=(e,t,n,r,i)=>Eo(e)?(r&&t.watch.add(e),ut(n,e,i)):Array.isArray(e)?e.map(a=>(r&&t.watch.add(a),ut(n,a))):(r&&(t.watchAll=!0),n),PT=e=>/^\w*$/.test(e),YB=e=>yf(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Cn(e,t,n){let r=-1;const i=PT(t)?[t]:YB(t),a=i.length,o=a-1;for(;++rt?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{};const oE=(e,t,n)=>{for(const r of n||Object.keys(e)){const i=ut(e,r);if(i){const{_f:a,...o}=i;if(a&&t(a.name)){if(a.ref.focus){a.ref.focus();break}else if(a.refs&&a.refs[0].focus){a.refs[0].focus();break}}else ir(o)&&oE(o,t)}}};var hN=e=>({isOnSubmit:!e||e===Ha.onSubmit,isOnBlur:e===Ha.onBlur,isOnChange:e===Ha.onChange,isOnAll:e===Ha.all,isOnTouch:e===Ha.onTouched}),gN=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length)))),o4e=(e,t,n)=>{const r=yf(ut(e,n));return Cn(r,"root",t[n]),Cn(e,n,r),e},BT=e=>e.type==="file",Js=e=>typeof e=="function",rm=e=>{if(!FT)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},qh=e=>Eo(e),UT=e=>e.type==="radio",im=e=>e instanceof RegExp;const mN={value:!1,isValid:!1},bN={value:!0,isValid:!0};var XB=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&&!qn(e[0].attributes.value)?qn(e[0].value)||e[0].value===""?bN:{value:e[0].value,isValid:!0}:bN:mN}return mN};const yN={isValid:!1,value:null};var ZB=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,yN):yN;function EN(e,t,n="validate"){if(qh(e)||Array.isArray(e)&&e.every(qh)||lu(e)&&!e)return{type:n,message:qh(e)?e:"",ref:t}}var a1=e=>ir(e)&&!im(e)?e:{value:e,message:""},vN=async(e,t,n,r,i)=>{const{ref:a,refs:o,required:s,maxLength:u,minLength:c,min:p,max:f,pattern:m,validate:g,name:b,valueAsNumber:y,mount:T,disabled:E}=e._f,v=ut(t,b);if(!T||E)return{};const w=o?o[0]:a,A=$=>{r&&w.reportValidity&&(w.setCustomValidity(lu($)?"":$||""),w.reportValidity())},R={},k=UT(a),N=bf(a),B=k||N,q=(y||BT(a))&&qn(a.value)&&qn(v)||rm(a)&&a.value===""||v===""||Array.isArray(v)&&!v.length,P=a4e.bind(null,b,n,R),Q=($,oe,fe,ce=Yo.maxLength,De=Yo.minLength)=>{const H=$?oe:fe;R[b]={type:$?ce:De,message:H,ref:a,...P($?ce:De,H)}};if(i?!Array.isArray(v)||!v.length:s&&(!B&&(q||ei(v))||lu(v)&&!v||N&&!XB(o).isValid||k&&!ZB(o).isValid)){const{value:$,message:oe}=qh(s)?{value:!!s,message:s}:a1(s);if($&&(R[b]={type:Yo.required,message:oe,ref:w,...P(Yo.required,oe)},!n))return A(oe),R}if(!q&&(!ei(p)||!ei(f))){let $,oe;const fe=a1(f),ce=a1(p);if(!ei(v)&&!isNaN(v)){const De=a.valueAsNumber||v&&+v;ei(fe.value)||($=De>fe.value),ei(ce.value)||(oe=Denew Date(new Date().toDateString()+" "+D),W=a.type=="time",se=a.type=="week";Eo(fe.value)&&v&&($=W?H(v)>H(fe.value):se?v>fe.value:De>new Date(fe.value)),Eo(ce.value)&&v&&(oe=W?H(v)+$.value,ce=!ei(oe.value)&&v.length<+oe.value;if((fe||ce)&&(Q(fe,$.message,oe.message),!n))return A(R[b].message),R}if(m&&!q&&Eo(v)){const{value:$,message:oe}=a1(m);if(im($)&&!v.match($)&&(R[b]={type:Yo.pattern,message:oe,ref:a,...P(Yo.pattern,oe)},!n))return A(oe),R}if(g){if(Js(g)){const $=await g(v,t),oe=EN($,w);if(oe&&(R[b]={...oe,...P(Yo.validate,oe.message)},!n))return A(oe.message),R}else if(ir(g)){let $={};for(const oe in g){if(!sa($)&&!n)break;const fe=EN(await g[oe](v,t),w,oe);fe&&($={...fe,...P(oe,fe.message)},A(fe.message),n&&(R[b]=$))}if(!sa($)&&(R[b]={ref:w,...$},!n))return R}}return A(!0),R};function s4e(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}}var am=e=>ei(e)||!qB(e);function uu(e,t){if(am(e)||am(t))return e===t;if(F1(e)&&F1(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const a=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=t[i];if(F1(a)&&F1(o)||ir(a)&&ir(o)||Array.isArray(a)&&Array.isArray(o)?!uu(a,o):a!==o)return!1}}return!0}var QB=e=>e.type==="select-multiple",u4e=e=>UT(e)||bf(e),q4=e=>rm(e)&&e.isConnected,JB=e=>{for(const t in e)if(Js(e[t]))return!0;return!1};function om(e,t={}){const n=Array.isArray(e);if(ir(e)||n)for(const r in e)Array.isArray(e[r])||ir(e[r])&&!JB(e[r])?(t[r]=Array.isArray(e[r])?[]:{},om(e[r],t[r])):ei(e[r])||(t[r]=!0);return t}function eU(e,t,n){const r=Array.isArray(e);if(ir(e)||r)for(const i in e)Array.isArray(e[i])||ir(e[i])&&!JB(e[i])?qn(t)||am(n[i])?n[i]=Array.isArray(e[i])?om(e[i],[]):{...om(e[i])}:eU(e[i],ei(t)?{}:t[i],n[i]):n[i]=!uu(e[i],t[i]);return n}var K4=(e,t)=>eU(e,t,om(t)),tU=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>qn(e)?e:t?e===""?NaN:e&&+e:n&&Eo(e)?new Date(e):r?r(e):e;function Y4(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return BT(t)?t.files:UT(t)?ZB(e.refs).value:QB(t)?[...t.selectedOptions].map(({value:n})=>n):bf(t)?XB(e.refs).value:tU(qn(t.value)?e.ref.value:t.value,e)}var c4e=(e,t,n,r)=>{const i={};for(const a of e){const o=ut(t,a);o&&Cn(i,a,o._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},yd=e=>qn(e)?e:im(e)?e.source:ir(e)?im(e.value)?e.value.source:e.value:e,d4e=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function _N(e,t,n){const r=ut(e,n);if(r||PT(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const a=i.join("."),o=ut(t,a),s=ut(e,a);if(o&&!Array.isArray(o)&&n!==a)return{name:n};if(s&&s.type)return{name:a,error:s};i.pop()}return{name:n}}var p4e=(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,f4e=(e,t)=>!yf(ut(e,t)).length&&vr(e,t);const h4e={mode:Ha.onSubmit,reValidateMode:Ha.onChange,shouldFocusError:!0};function g4e(e={},t){let n={...h4e,...e},r={submitCount:0,isDirty:!1,isLoading:Js(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},i={},a=ir(n.defaultValues)||ir(n.values)?Qo(n.defaultValues||n.values)||{}:{},o=n.shouldUnregister?{}:Qo(a),s={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,p=0;const f={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={values:W4(),array:W4(),state:W4()},g=e.resetOptions&&e.resetOptions.keepDirtyValues,b=hN(n.mode),y=hN(n.reValidateMode),T=n.criteriaMode===Ha.all,E=U=>re=>{clearTimeout(p),p=setTimeout(U,re)},v=async U=>{if(f.isValid||U){const re=n.resolver?sa((await q()).errors):await Q(i,!0);re!==r.isValid&&m.state.next({isValid:re})}},w=U=>f.isValidating&&m.state.next({isValidating:U}),A=(U,re=[],de,xe,ye=!0,Te=!0)=>{if(xe&&de){if(s.action=!0,Te&&Array.isArray(ut(i,U))){const Le=de(ut(i,U),xe.argA,xe.argB);ye&&Cn(i,U,Le)}if(Te&&Array.isArray(ut(r.errors,U))){const Le=de(ut(r.errors,U),xe.argA,xe.argB);ye&&Cn(r.errors,U,Le),f4e(r.errors,U)}if(f.touchedFields&&Te&&Array.isArray(ut(r.touchedFields,U))){const Le=de(ut(r.touchedFields,U),xe.argA,xe.argB);ye&&Cn(r.touchedFields,U,Le)}f.dirtyFields&&(r.dirtyFields=K4(a,o)),m.state.next({name:U,isDirty:oe(U,re),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Cn(o,U,re)},R=(U,re)=>{Cn(r.errors,U,re),m.state.next({errors:r.errors})},k=(U,re,de,xe)=>{const ye=ut(i,U);if(ye){const Te=ut(o,U,qn(de)?ut(a,U):de);qn(Te)||xe&&xe.defaultChecked||re?Cn(o,U,re?Te:Y4(ye._f)):De(U,Te),s.mount&&v()}},N=(U,re,de,xe,ye)=>{let Te=!1,Le=!1;const ze={name:U};if(!de||xe){f.isDirty&&(Le=r.isDirty,r.isDirty=ze.isDirty=oe(),Te=Le!==ze.isDirty);const Xe=uu(ut(a,U),re);Le=ut(r.dirtyFields,U),Xe?vr(r.dirtyFields,U):Cn(r.dirtyFields,U,!0),ze.dirtyFields=r.dirtyFields,Te=Te||f.dirtyFields&&Le!==!Xe}if(de){const Xe=ut(r.touchedFields,U);Xe||(Cn(r.touchedFields,U,de),ze.touchedFields=r.touchedFields,Te=Te||f.touchedFields&&Xe!==de)}return Te&&ye&&m.state.next(ze),Te?ze:{}},B=(U,re,de,xe)=>{const ye=ut(r.errors,U),Te=f.isValid&&lu(re)&&r.isValid!==re;if(e.delayError&&de?(c=E(()=>R(U,de)),c(e.delayError)):(clearTimeout(p),c=null,de?Cn(r.errors,U,de):vr(r.errors,U)),(de?!uu(ye,de):ye)||!sa(xe)||Te){const Le={...xe,...Te&&lu(re)?{isValid:re}:{},errors:r.errors,name:U};r={...r,...Le},m.state.next(Le)}w(!1)},q=async U=>n.resolver(o,n.context,c4e(U||u.mount,i,n.criteriaMode,n.shouldUseNativeValidation)),P=async U=>{const{errors:re}=await q(U);if(U)for(const de of U){const xe=ut(re,de);xe?Cn(r.errors,de,xe):vr(r.errors,de)}else r.errors=re;return re},Q=async(U,re,de={valid:!0})=>{for(const xe in U){const ye=U[xe];if(ye){const{_f:Te,...Le}=ye;if(Te){const ze=u.array.has(Te.name),Xe=await vN(ye,o,T,n.shouldUseNativeValidation&&!re,ze);if(Xe[Te.name]&&(de.valid=!1,re))break;!re&&(ut(Xe,Te.name)?ze?o4e(r.errors,Xe,Te.name):Cn(r.errors,Te.name,Xe[Te.name]):vr(r.errors,Te.name))}Le&&await Q(Le,re,de)}}return de.valid},$=()=>{for(const U of u.unMount){const re=ut(i,U);re&&(re._f.refs?re._f.refs.every(de=>!q4(de)):!q4(re._f.ref))&&X(U)}u.unMount=new Set},oe=(U,re)=>(U&&re&&Cn(o,U,re),!uu(pe(),a)),fe=(U,re,de)=>i4e(U,u,{...s.mount?o:qn(re)?a:Eo(U)?{[U]:re}:re},de,re),ce=U=>yf(ut(s.mount?o:a,U,e.shouldUnregister?ut(a,U,[]):[])),De=(U,re,de={})=>{const xe=ut(i,U);let ye=re;if(xe){const Te=xe._f;Te&&(!Te.disabled&&Cn(o,U,tU(re,Te)),ye=rm(Te.ref)&&ei(re)?"":re,QB(Te.ref)?[...Te.ref.options].forEach(Le=>Le.selected=ye.includes(Le.value)):Te.refs?bf(Te.ref)?Te.refs.length>1?Te.refs.forEach(Le=>(!Le.defaultChecked||!Le.disabled)&&(Le.checked=Array.isArray(ye)?!!ye.find(ze=>ze===Le.value):ye===Le.value)):Te.refs[0]&&(Te.refs[0].checked=!!ye):Te.refs.forEach(Le=>Le.checked=Le.value===ye):BT(Te.ref)?Te.ref.value="":(Te.ref.value=ye,Te.ref.type||m.values.next({name:U,values:{...o}})))}(de.shouldDirty||de.shouldTouch)&&N(U,ye,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&D(U)},H=(U,re,de)=>{for(const xe in re){const ye=re[xe],Te=`${U}.${xe}`,Le=ut(i,Te);(u.array.has(U)||!am(ye)||Le&&!Le._f)&&!F1(ye)?H(Te,ye,de):De(Te,ye,de)}},W=(U,re,de={})=>{const xe=ut(i,U),ye=u.array.has(U),Te=Qo(re);Cn(o,U,Te),ye?(m.array.next({name:U,values:{...o}}),(f.isDirty||f.dirtyFields)&&de.shouldDirty&&m.state.next({name:U,dirtyFields:K4(a,o),isDirty:oe(U,Te)})):xe&&!xe._f&&!ei(Te)?H(U,Te,de):De(U,Te,de),gN(U,u)&&m.state.next({...r}),m.values.next({name:U,values:{...o}}),!s.mount&&t()},se=async U=>{const re=U.target;let de=re.name,xe=!0;const ye=ut(i,de),Te=()=>re.type?Y4(ye._f):X3e(U);if(ye){let Le,ze;const Xe=Te(),jt=U.type===fN.BLUR||U.type===fN.FOCUS_OUT,ue=!d4e(ye._f)&&!n.resolver&&!ut(r.errors,de)&&!ye._f.deps||p4e(jt,ut(r.touchedFields,de),r.isSubmitted,y,b),Ee=gN(de,u,jt);Cn(o,de,Xe),jt?(ye._f.onBlur&&ye._f.onBlur(U),c&&c(0)):ye._f.onChange&&ye._f.onChange(U);const qe=N(de,Xe,jt,!1),j=!sa(qe)||Ee;if(!jt&&m.values.next({name:de,type:U.type,values:{...o}}),ue)return f.isValid&&v(),j&&m.state.next({name:de,...Ee?{}:qe});if(!jt&&Ee&&m.state.next({...r}),w(!0),n.resolver){const{errors:me}=await q([de]),Ve=_N(r.errors,i,de),ge=_N(me,i,Ve.name||de);Le=ge.error,de=ge.name,ze=sa(me)}else Le=(await vN(ye,o,T,n.shouldUseNativeValidation))[de],xe=Number.isNaN(Xe)||Xe===ut(o,de,Xe),xe&&(Le?ze=!1:f.isValid&&(ze=await Q(i,!0)));xe&&(ye._f.deps&&D(ye._f.deps),B(de,ze,Le,qe))}},D=async(U,re={})=>{let de,xe;const ye=V4(U);if(w(!0),n.resolver){const Te=await P(qn(U)?U:ye);de=sa(Te),xe=U?!ye.some(Le=>ut(Te,Le)):de}else U?(xe=(await Promise.all(ye.map(async Te=>{const Le=ut(i,Te);return await Q(Le&&Le._f?{[Te]:Le}:Le)}))).every(Boolean),!(!xe&&!r.isValid)&&v()):xe=de=await Q(i);return m.state.next({...!Eo(U)||f.isValid&&de!==r.isValid?{}:{name:U},...n.resolver||!U?{isValid:de}:{},errors:r.errors,isValidating:!1}),re.shouldFocus&&!xe&&oE(i,Te=>Te&&ut(r.errors,Te),U?ye:u.mount),xe},pe=U=>{const re={...a,...s.mount?o:{}};return qn(U)?re:Eo(U)?ut(re,U):U.map(de=>ut(re,de))},le=(U,re)=>({invalid:!!ut((re||r).errors,U),isDirty:!!ut((re||r).dirtyFields,U),isTouched:!!ut((re||r).touchedFields,U),error:ut((re||r).errors,U)}),L=U=>{U&&V4(U).forEach(re=>vr(r.errors,re)),m.state.next({errors:U?r.errors:{}})},ie=(U,re,de)=>{const xe=(ut(i,U,{_f:{}})._f||{}).ref;Cn(r.errors,U,{...re,ref:xe}),m.state.next({name:U,errors:r.errors,isValid:!1}),de&&de.shouldFocus&&xe&&xe.focus&&xe.focus()},Se=(U,re)=>Js(U)?m.values.subscribe({next:de=>U(fe(void 0,re),de)}):fe(U,re,!0),X=(U,re={})=>{for(const de of U?V4(U):u.mount)u.mount.delete(de),u.array.delete(de),re.keepValue||(vr(i,de),vr(o,de)),!re.keepError&&vr(r.errors,de),!re.keepDirty&&vr(r.dirtyFields,de),!re.keepTouched&&vr(r.touchedFields,de),!n.shouldUnregister&&!re.keepDefaultValue&&vr(a,de);m.values.next({values:{...o}}),m.state.next({...r,...re.keepDirty?{isDirty:oe()}:{}}),!re.keepIsValid&&v()},ke=({disabled:U,name:re,field:de,fields:xe})=>{if(lu(U)){const ye=U?void 0:ut(o,re,Y4(de?de._f:ut(xe,re)._f));Cn(o,re,ye),N(re,ye,!1,!1,!0)}},te=(U,re={})=>{let de=ut(i,U);const xe=lu(re.disabled);return Cn(i,U,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:U}},name:U,mount:!0,...re}}),u.mount.add(U),de?ke({field:de,disabled:re.disabled,name:U}):k(U,!0,re.value),{...xe?{disabled:re.disabled}:{},...n.progressive?{required:!!re.required,min:yd(re.min),max:yd(re.max),minLength:yd(re.minLength),maxLength:yd(re.maxLength),pattern:yd(re.pattern)}:{},name:U,onChange:se,onBlur:se,ref:ye=>{if(ye){te(U,re),de=ut(i,U);const Te=qn(ye.value)&&ye.querySelectorAll&&ye.querySelectorAll("input,select,textarea")[0]||ye,Le=u4e(Te),ze=de._f.refs||[];if(Le?ze.find(Xe=>Xe===Te):Te===de._f.ref)return;Cn(i,U,{_f:{...de._f,...Le?{refs:[...ze.filter(q4),Te,...Array.isArray(ut(a,U))?[{}]:[]],ref:{type:Te.type,name:U}}:{ref:Te}}}),k(U,!1,void 0,Te)}else de=ut(i,U,{}),de._f&&(de._f.mount=!1),(n.shouldUnregister||re.shouldUnregister)&&!(Q3e(u.array,U)&&s.action)&&u.unMount.add(U)}}},Me=()=>n.shouldFocusError&&oE(i,U=>U&&ut(r.errors,U),u.mount),Re=(U,re)=>async de=>{de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let xe=Qo(o);if(m.state.next({isSubmitting:!0}),n.resolver){const{errors:ye,values:Te}=await q();r.errors=ye,xe=Te}else await Q(i);vr(r.errors,"root"),sa(r.errors)?(m.state.next({errors:{}}),await U(xe,de)):(re&&await re({...r.errors},de),Me(),setTimeout(Me)),m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:sa(r.errors),submitCount:r.submitCount+1,errors:r.errors})},Ye=(U,re={})=>{ut(i,U)&&(qn(re.defaultValue)?W(U,ut(a,U)):(W(U,re.defaultValue),Cn(a,U,re.defaultValue)),re.keepTouched||vr(r.touchedFields,U),re.keepDirty||(vr(r.dirtyFields,U),r.isDirty=re.defaultValue?oe(U,ut(a,U)):oe()),re.keepError||(vr(r.errors,U),f.isValid&&v()),m.state.next({...r}))},We=(U,re={})=>{const de=U?Qo(U):a,xe=Qo(de),ye=U&&!sa(U)?xe:a;if(re.keepDefaultValues||(a=de),!re.keepValues){if(re.keepDirtyValues||g)for(const Te of u.mount)ut(r.dirtyFields,Te)?Cn(ye,Te,ut(o,Te)):W(Te,ut(ye,Te));else{if(FT&&qn(U))for(const Te of u.mount){const Le=ut(i,Te);if(Le&&Le._f){const ze=Array.isArray(Le._f.refs)?Le._f.refs[0]:Le._f.ref;if(rm(ze)){const Xe=ze.closest("form");if(Xe){Xe.reset();break}}}}i={}}o=e.shouldUnregister?re.keepDefaultValues?Qo(a):{}:Qo(ye),m.array.next({values:{...ye}}),m.values.next({values:{...ye}})}u={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!s.mount&&t(),s.mount=!f.isValid||!!re.keepIsValid,s.watch=!!e.shouldUnregister,m.state.next({submitCount:re.keepSubmitCount?r.submitCount:0,isDirty:re.keepDirty?r.isDirty:!!(re.keepDefaultValues&&!uu(U,a)),isSubmitted:re.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:re.keepDirtyValues?r.dirtyFields:re.keepDefaultValues&&U?K4(a,U):{},touchedFields:re.keepTouched?r.touchedFields:{},errors:re.keepErrors?r.errors:{},isSubmitSuccessful:re.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},dt=(U,re)=>We(Js(U)?U(o):U,re);return{control:{register:te,unregister:X,getFieldState:le,handleSubmit:Re,setError:ie,_executeSchema:q,_getWatch:fe,_getDirty:oe,_updateValid:v,_removeUnmounted:$,_updateFieldArray:A,_updateDisabledField:ke,_getFieldArray:ce,_reset:We,_resetDefaultValues:()=>Js(n.defaultValues)&&n.defaultValues().then(U=>{dt(U,n.resetOptions),m.state.next({isLoading:!1})}),_updateFormState:U=>{r={...r,...U}},_subjects:m,_proxyFormState:f,get _fields(){return i},get _formValues(){return o},get _state(){return s},set _state(U){s=U},get _defaultValues(){return a},get _names(){return u},set _names(U){u=U},get _formState(){return r},set _formState(U){r=U},get _options(){return n},set _options(U){n={...n,...U}}},trigger:D,register:te,handleSubmit:Re,watch:Se,setValue:W,getValues:pe,reset:dt,resetField:Ye,clearErrors:L,unregister:X,setError:ie,setFocus:(U,re={})=>{const de=ut(i,U),xe=de&&de._f;if(xe){const ye=xe.refs?xe.refs[0]:xe.ref;ye.focus&&(ye.focus(),re.shouldSelect&&ye.select())}},getFieldState:le}}function nU(e={}){const t=st.useRef(),n=st.useRef(),[r,i]=st.useState({isDirty:!1,isValidating:!1,isLoading:Js(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Js(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...g4e(e,()=>i(o=>({...o}))),formState:r});const a=t.current.control;return a._options=e,r4e({subject:a._subjects.state,next:o=>{n4e(o,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),st.useEffect(()=>{e.values&&!uu(e.values,n.current)?(a._reset(e.values,a._options.resetOptions),n.current=e.values):a._resetDefaultValues()},[e.values,a]),st.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=t4e(r,a),t.current}const TN=Ge.hr` border: 0.5px solid ${Et}; `,m4e=Ge(oc)` background-color: transparent; @@ -1132,10 +1132,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */sm.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",c=500,p="__lodash_placeholder__",f=1,m=2,g=4,b=1,y=2,T=1,E=2,v=4,w=8,A=16,R=32,k=64,N=128,B=256,q=512,P=30,Q="...",$=800,oe=16,fe=1,ce=2,De=3,H=1/0,W=9007199254740991,se=17976931348623157e292,D=0/0,pe=4294967295,le=pe-1,L=pe>>>1,ie=[["ary",N],["bind",T],["bindKey",E],["curry",w],["curryRight",A],["flip",q],["partial",R],["partialRight",k],["rearg",B]],Se="[object Arguments]",X="[object Array]",ke="[object AsyncFunction]",te="[object Boolean]",Me="[object Date]",Re="[object DOMException]",Ze="[object Error]",We="[object Function]",dt="[object GeneratorFunction]",ot="[object Map]",je="[object Number]",pt="[object Null]",U="[object Object]",re="[object Promise]",de="[object Proxy]",xe="[object RegExp]",ye="[object Set]",Te="[object String]",Le="[object Symbol]",ze="[object Undefined]",Ye="[object WeakMap]",jt="[object WeakSet]",ue="[object ArrayBuffer]",Ee="[object DataView]",qe="[object Float32Array]",j="[object Float64Array]",me="[object Int8Array]",Ve="[object Int16Array]",ge="[object Int32Array]",G="[object Uint8Array]",K="[object Uint8ClampedArray]",ne="[object Uint16Array]",ve="[object Uint32Array]",Qe=/\b__p \+= '';/g,Fe=/\b(__p \+=) '' \+/g,at=/(__e\(.*?\)|\b__t\)) \+\n'';/g,rt=/&(?:amp|lt|gt|quot|#39);/g,Je=/[&<>"']/g,Rt=RegExp(rt.source),Qt=RegExp(Je.source),kt=/<%-([\s\S]+?)%>/g,rn=/<%([\s\S]+?)%>/g,Xt=/<%=([\s\S]+?)%>/g,Wr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qr=/^\w*$/,Kr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Aa=/[\\^$.*+?()[\]{}|]/g,si=RegExp(Aa.source),Or=/^\s+/,Es=/\s/,vs=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Yr=/\{\n\/\* \[wrapped with (.+)\] \*/,_s=/,? & /,qt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dr=/[()=,{}\[\]\/\s]/,Si=/\\(\\)?/g,Nl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ke=/\w*$/,J=/^[-+]0x[0-9a-f]+$/i,Be=/^0b[01]+$/i,it=/^\[object .+?Constructor\]$/,un=/^0o[0-7]+$/i,ar=/^(?:0|[1-9]\d*)$/,or=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zn=/($^)/,Oo=/['\n\r\u2028\u2029\\]/g,no="\\ud800-\\udfff",Lr="\\u0300-\\u036f",Ef="\\ufe20-\\ufe2f",vf="\\u20d0-\\u20ff",GT=Lr+Ef+vf,VT="\\u2700-\\u27bf",WT="a-z\\xdf-\\xf6\\xf8-\\xff",yU="\\xac\\xb1\\xd7\\xf7",EU="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vU="\\u2000-\\u206f",_U=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",qT="A-Z\\xc0-\\xd6\\xd8-\\xde",KT="\\ufe0e\\ufe0f",YT=yU+EU+vU+_U,G2="['’]",TU="["+no+"]",XT="["+YT+"]",_f="["+GT+"]",ZT="\\d+",SU="["+VT+"]",QT="["+WT+"]",JT="[^"+no+YT+ZT+VT+WT+qT+"]",V2="\\ud83c[\\udffb-\\udfff]",wU="(?:"+_f+"|"+V2+")",eS="[^"+no+"]",W2="(?:\\ud83c[\\udde6-\\uddff]){2}",q2="[\\ud800-\\udbff][\\udc00-\\udfff]",Bu="["+qT+"]",tS="\\u200d",nS="(?:"+QT+"|"+JT+")",AU="(?:"+Bu+"|"+JT+")",rS="(?:"+G2+"(?:d|ll|m|re|s|t|ve))?",iS="(?:"+G2+"(?:D|LL|M|RE|S|T|VE))?",aS=wU+"?",oS="["+KT+"]?",CU="(?:"+tS+"(?:"+[eS,W2,q2].join("|")+")"+oS+aS+")*",kU="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xU="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sS=oS+aS+CU,IU="(?:"+[SU,W2,q2].join("|")+")"+sS,RU="(?:"+[eS+_f+"?",_f,W2,q2,TU].join("|")+")",NU=RegExp(G2,"g"),OU=RegExp(_f,"g"),K2=RegExp(V2+"(?="+V2+")|"+RU+sS,"g"),DU=RegExp([Bu+"?"+QT+"+"+rS+"(?="+[XT,Bu,"$"].join("|")+")",AU+"+"+iS+"(?="+[XT,Bu+nS,"$"].join("|")+")",Bu+"?"+nS+"+"+rS,Bu+"+"+iS,xU,kU,ZT,IU].join("|"),"g"),LU=RegExp("["+tS+no+GT+KT+"]"),MU=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,FU=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],PU=-1,En={};En[qe]=En[j]=En[me]=En[Ve]=En[ge]=En[G]=En[K]=En[ne]=En[ve]=!0,En[Se]=En[X]=En[ue]=En[te]=En[Ee]=En[Me]=En[Ze]=En[We]=En[ot]=En[je]=En[U]=En[xe]=En[ye]=En[Te]=En[Ye]=!1;var mn={};mn[Se]=mn[X]=mn[ue]=mn[Ee]=mn[te]=mn[Me]=mn[qe]=mn[j]=mn[me]=mn[Ve]=mn[ge]=mn[ot]=mn[je]=mn[U]=mn[xe]=mn[ye]=mn[Te]=mn[Le]=mn[G]=mn[K]=mn[ne]=mn[ve]=!0,mn[Ze]=mn[We]=mn[Ye]=!1;var BU={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},UU={"&":"&","<":"<",">":">",'"':""","'":"'"},$U={"&":"&","<":"<",">":">",""":'"',"'":"'"},zU={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},HU=parseFloat,jU=parseInt,lS=typeof Jl=="object"&&Jl&&Jl.Object===Object&&Jl,GU=typeof self=="object"&&self&&self.Object===Object&&self,mr=lS||GU||Function("return this")(),Y2=t&&!t.nodeType&&t,Ol=Y2&&!0&&e&&!e.nodeType&&e,uS=Ol&&Ol.exports===Y2,X2=uS&&lS.process,Yi=function(){try{var ee=Ol&&Ol.require&&Ol.require("util").types;return ee||X2&&X2.binding&&X2.binding("util")}catch{}}(),cS=Yi&&Yi.isArrayBuffer,dS=Yi&&Yi.isDate,pS=Yi&&Yi.isMap,fS=Yi&&Yi.isRegExp,hS=Yi&&Yi.isSet,gS=Yi&&Yi.isTypedArray;function wi(ee,_e,he){switch(he.length){case 0:return ee.call(_e);case 1:return ee.call(_e,he[0]);case 2:return ee.call(_e,he[0],he[1]);case 3:return ee.call(_e,he[0],he[1],he[2])}return ee.apply(_e,he)}function VU(ee,_e,he,et){for(var _t=-1,Jt=ee==null?0:ee.length;++_t-1}function Z2(ee,_e,he){for(var et=-1,_t=ee==null?0:ee.length;++et<_t;)if(he(_e,ee[et]))return!0;return!1}function An(ee,_e){for(var he=-1,et=ee==null?0:ee.length,_t=Array(et);++he-1;);return he}function SS(ee,_e){for(var he=ee.length;he--&&Uu(_e,ee[he],0)>-1;);return he}function e$(ee,_e){for(var he=ee.length,et=0;he--;)ee[he]===_e&&++et;return et}var t$=t5(BU),n$=t5(UU);function r$(ee){return"\\"+zU[ee]}function i$(ee,_e){return ee==null?n:ee[_e]}function $u(ee){return LU.test(ee)}function a$(ee){return MU.test(ee)}function o$(ee){for(var _e,he=[];!(_e=ee.next()).done;)he.push(_e.value);return he}function a5(ee){var _e=-1,he=Array(ee.size);return ee.forEach(function(et,_t){he[++_e]=[_t,et]}),he}function wS(ee,_e){return function(he){return ee(_e(he))}}function ws(ee,_e){for(var he=-1,et=ee.length,_t=0,Jt=[];++he-1}function q$(l,d){var h=this.__data__,_=Uf(h,l);return _<0?(++this.size,h.push([l,d])):h[_][1]=d,this}Do.prototype.clear=j$,Do.prototype.delete=G$,Do.prototype.get=V$,Do.prototype.has=W$,Do.prototype.set=q$;function Lo(l){var d=-1,h=l==null?0:l.length;for(this.clear();++d=d?l:d)),l}function Ji(l,d,h,_,x,F){var z,Z=d&f,ae=d&m,we=d&g;if(h&&(z=x?h(l,_,x,F):h(l)),z!==n)return z;if(!Rn(l))return l;var Ce=Tt(l);if(Ce){if(z=Zz(l),!Z)return li(l,z)}else{var Ie=Fr(l),Xe=Ie==We||Ie==dt;if(Rs(l))return ow(l,Z);if(Ie==U||Ie==Se||Xe&&!x){if(z=ae||Xe?{}:Aw(l),!Z)return ae?$z(l,uz(z,l)):Uz(l,FS(z,l))}else{if(!mn[Ie])return x?l:{};z=Qz(l,Ie,Z)}}F||(F=new ka);var lt=F.get(l);if(lt)return lt;F.set(l,z),eA(l)?l.forEach(function(yt){z.add(Ji(yt,d,h,yt,l,F))}):Qw(l)&&l.forEach(function(yt,Nt){z.set(Nt,Ji(yt,d,h,Nt,l,F))});var bt=we?ae?N5:R5:ae?ci:sr,wt=Ce?n:bt(l);return Xi(wt||l,function(yt,Nt){wt&&(Nt=yt,yt=l[Nt]),Pc(z,Nt,Ji(yt,d,h,Nt,l,F))}),z}function cz(l){var d=sr(l);return function(h){return PS(h,l,d)}}function PS(l,d,h){var _=h.length;if(l==null)return!_;for(l=pn(l);_--;){var x=h[_],F=d[x],z=l[x];if(z===n&&!(x in l)||!F(z))return!1}return!0}function BS(l,d,h){if(typeof l!="function")throw new Zi(o);return Gc(function(){l.apply(n,h)},d)}function Bc(l,d,h,_){var x=-1,F=Tf,z=!0,Z=l.length,ae=[],we=d.length;if(!Z)return ae;h&&(d=An(d,Ai(h))),_?(F=Z2,z=!1):d.length>=i&&(F=Nc,z=!1,d=new Ml(d));e:for(;++xx?0:x+h),_=_===n||_>x?x:St(_),_<0&&(_+=x),_=h>_?0:nA(_);h<_;)l[h++]=d;return l}function $S(l,d){var h=[];return Cs(l,function(_,x,F){d(_,x,F)&&h.push(_)}),h}function br(l,d,h,_,x){var F=-1,z=l.length;for(h||(h=eH),x||(x=[]);++F0&&h(Z)?d>1?br(Z,d-1,h,_,x):Ss(x,Z):_||(x[x.length]=Z)}return x}var p5=pw(),zS=pw(!0);function ro(l,d){return l&&p5(l,d,sr)}function f5(l,d){return l&&zS(l,d,sr)}function zf(l,d){return Ts(d,function(h){return Uo(l[h])})}function Pl(l,d){d=xs(d,l);for(var h=0,_=d.length;l!=null&&h<_;)l=l[ao(d[h++])];return h&&h==_?l:n}function HS(l,d,h){var _=d(l);return Tt(l)?_:Ss(_,h(l))}function Xr(l){return l==null?l===n?ze:pt:Dl&&Dl in pn(l)?Kz(l):sH(l)}function h5(l,d){return l>d}function fz(l,d){return l!=null&&an.call(l,d)}function hz(l,d){return l!=null&&d in pn(l)}function gz(l,d,h){return l>=Mr(d,h)&&l=120&&Ce.length>=120)?new Ml(z&&Ce):n}Ce=l[0];var Ie=-1,Xe=Z[0];e:for(;++Ie-1;)Z!==l&&Of.call(Z,ae,1),Of.call(l,ae,1);return l}function QS(l,d){for(var h=l?d.length:0,_=h-1;h--;){var x=d[h];if(h==_||x!==F){var F=x;Bo(x)?Of.call(l,x,1):S5(l,x)}}return l}function v5(l,d){return l+Mf(OS()*(d-l+1))}function xz(l,d,h,_){for(var x=-1,F=Jn(Lf((d-l)/(h||1)),0),z=he(F);F--;)z[_?F:++x]=l,l+=h;return z}function _5(l,d){var h="";if(!l||d<1||d>W)return h;do d%2&&(h+=l),d=Mf(d/2),d&&(l+=l);while(d);return h}function xt(l,d){return B5(xw(l,d,di),l+"")}function Iz(l){return MS(Zu(l))}function Rz(l,d){var h=Zu(l);return Qf(h,Fl(d,0,h.length))}function zc(l,d,h,_){if(!Rn(l))return l;d=xs(d,l);for(var x=-1,F=d.length,z=F-1,Z=l;Z!=null&&++xx?0:x+d),h=h>x?x:h,h<0&&(h+=x),x=d>h?0:h-d>>>0,d>>>=0;for(var F=he(x);++_>>1,z=l[F];z!==null&&!ki(z)&&(h?z<=d:z=i){var we=d?null:Gz(l);if(we)return wf(we);z=!1,x=Nc,ae=new Ml}else ae=d?[]:Z;e:for(;++_=_?l:ea(l,d,h)}var aw=_$||function(l){return mr.clearTimeout(l)};function ow(l,d){if(d)return l.slice();var h=l.length,_=kS?kS(h):new l.constructor(h);return l.copy(_),_}function k5(l){var d=new l.constructor(l.byteLength);return new Rf(d).set(new Rf(l)),d}function Mz(l,d){var h=d?k5(l.buffer):l.buffer;return new l.constructor(h,l.byteOffset,l.byteLength)}function Fz(l){var d=new l.constructor(l.source,Ke.exec(l));return d.lastIndex=l.lastIndex,d}function Pz(l){return Fc?pn(Fc.call(l)):{}}function sw(l,d){var h=d?k5(l.buffer):l.buffer;return new l.constructor(h,l.byteOffset,l.length)}function lw(l,d){if(l!==d){var h=l!==n,_=l===null,x=l===l,F=ki(l),z=d!==n,Z=d===null,ae=d===d,we=ki(d);if(!Z&&!we&&!F&&l>d||F&&z&&ae&&!Z&&!we||_&&z&&ae||!h&&ae||!x)return 1;if(!_&&!F&&!we&&l=Z)return ae;var we=h[_];return ae*(we=="desc"?-1:1)}}return l.index-d.index}function uw(l,d,h,_){for(var x=-1,F=l.length,z=h.length,Z=-1,ae=d.length,we=Jn(F-z,0),Ce=he(ae+we),Ie=!_;++Z1?h[x-1]:n,z=x>2?h[2]:n;for(F=l.length>3&&typeof F=="function"?(x--,F):n,z&&Zr(h[0],h[1],z)&&(F=x<3?n:F,x=1),d=pn(d);++_-1?x[F?d[z]:z]:n}}function gw(l){return Po(function(d){var h=d.length,_=h,x=Qi.prototype.thru;for(l&&d.reverse();_--;){var F=d[_];if(typeof F!="function")throw new Zi(o);if(x&&!z&&Xf(F)=="wrapper")var z=new Qi([],!0)}for(_=z?_:h;++_1&&Bt.reverse(),Ce&&aeZ))return!1;var we=F.get(l),Ce=F.get(d);if(we&&Ce)return we==d&&Ce==l;var Ie=-1,Xe=!0,lt=h&y?new Ml:n;for(F.set(l,d),F.set(d,l);++Ie1?"& ":"")+d[_],d=d.join(h>2?", ":" "),l.replace(vs,`{ + */sm.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",c=500,p="__lodash_placeholder__",f=1,m=2,g=4,b=1,y=2,T=1,E=2,v=4,w=8,A=16,R=32,k=64,N=128,B=256,q=512,P=30,Q="...",$=800,oe=16,fe=1,ce=2,De=3,H=1/0,W=9007199254740991,se=17976931348623157e292,D=0/0,pe=4294967295,le=pe-1,L=pe>>>1,ie=[["ary",N],["bind",T],["bindKey",E],["curry",w],["curryRight",A],["flip",q],["partial",R],["partialRight",k],["rearg",B]],Se="[object Arguments]",X="[object Array]",ke="[object AsyncFunction]",te="[object Boolean]",Me="[object Date]",Re="[object DOMException]",Ye="[object Error]",We="[object Function]",dt="[object GeneratorFunction]",ot="[object Map]",je="[object Number]",pt="[object Null]",U="[object Object]",re="[object Promise]",de="[object Proxy]",xe="[object RegExp]",ye="[object Set]",Te="[object String]",Le="[object Symbol]",ze="[object Undefined]",Xe="[object WeakMap]",jt="[object WeakSet]",ue="[object ArrayBuffer]",Ee="[object DataView]",qe="[object Float32Array]",j="[object Float64Array]",me="[object Int8Array]",Ve="[object Int16Array]",ge="[object Int32Array]",G="[object Uint8Array]",K="[object Uint8ClampedArray]",ne="[object Uint16Array]",ve="[object Uint32Array]",Qe=/\b__p \+= '';/g,Fe=/\b(__p \+=) '' \+/g,at=/(__e\(.*?\)|\b__t\)) \+\n'';/g,rt=/&(?:amp|lt|gt|quot|#39);/g,Je=/[&<>"']/g,Rt=RegExp(rt.source),Qt=RegExp(Je.source),kt=/<%-([\s\S]+?)%>/g,rn=/<%([\s\S]+?)%>/g,Xt=/<%=([\s\S]+?)%>/g,Wr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qr=/^\w*$/,Kr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Aa=/[\\^$.*+?()[\]{}|]/g,si=RegExp(Aa.source),Or=/^\s+/,Es=/\s/,vs=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Yr=/\{\n\/\* \[wrapped with (.+)\] \*/,_s=/,? & /,qt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dr=/[()=,{}\[\]\/\s]/,Si=/\\(\\)?/g,Nl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ke=/\w*$/,J=/^[-+]0x[0-9a-f]+$/i,Be=/^0b[01]+$/i,it=/^\[object .+?Constructor\]$/,un=/^0o[0-7]+$/i,ar=/^(?:0|[1-9]\d*)$/,or=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zn=/($^)/,Oo=/['\n\r\u2028\u2029\\]/g,no="\\ud800-\\udfff",Lr="\\u0300-\\u036f",Ef="\\ufe20-\\ufe2f",vf="\\u20d0-\\u20ff",GT=Lr+Ef+vf,VT="\\u2700-\\u27bf",WT="a-z\\xdf-\\xf6\\xf8-\\xff",yU="\\xac\\xb1\\xd7\\xf7",EU="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vU="\\u2000-\\u206f",_U=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",qT="A-Z\\xc0-\\xd6\\xd8-\\xde",KT="\\ufe0e\\ufe0f",YT=yU+EU+vU+_U,G2="['’]",TU="["+no+"]",XT="["+YT+"]",_f="["+GT+"]",ZT="\\d+",SU="["+VT+"]",QT="["+WT+"]",JT="[^"+no+YT+ZT+VT+WT+qT+"]",V2="\\ud83c[\\udffb-\\udfff]",wU="(?:"+_f+"|"+V2+")",eS="[^"+no+"]",W2="(?:\\ud83c[\\udde6-\\uddff]){2}",q2="[\\ud800-\\udbff][\\udc00-\\udfff]",Bu="["+qT+"]",tS="\\u200d",nS="(?:"+QT+"|"+JT+")",AU="(?:"+Bu+"|"+JT+")",rS="(?:"+G2+"(?:d|ll|m|re|s|t|ve))?",iS="(?:"+G2+"(?:D|LL|M|RE|S|T|VE))?",aS=wU+"?",oS="["+KT+"]?",CU="(?:"+tS+"(?:"+[eS,W2,q2].join("|")+")"+oS+aS+")*",kU="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xU="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sS=oS+aS+CU,IU="(?:"+[SU,W2,q2].join("|")+")"+sS,RU="(?:"+[eS+_f+"?",_f,W2,q2,TU].join("|")+")",NU=RegExp(G2,"g"),OU=RegExp(_f,"g"),K2=RegExp(V2+"(?="+V2+")|"+RU+sS,"g"),DU=RegExp([Bu+"?"+QT+"+"+rS+"(?="+[XT,Bu,"$"].join("|")+")",AU+"+"+iS+"(?="+[XT,Bu+nS,"$"].join("|")+")",Bu+"?"+nS+"+"+rS,Bu+"+"+iS,xU,kU,ZT,IU].join("|"),"g"),LU=RegExp("["+tS+no+GT+KT+"]"),MU=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,FU=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],PU=-1,En={};En[qe]=En[j]=En[me]=En[Ve]=En[ge]=En[G]=En[K]=En[ne]=En[ve]=!0,En[Se]=En[X]=En[ue]=En[te]=En[Ee]=En[Me]=En[Ye]=En[We]=En[ot]=En[je]=En[U]=En[xe]=En[ye]=En[Te]=En[Xe]=!1;var mn={};mn[Se]=mn[X]=mn[ue]=mn[Ee]=mn[te]=mn[Me]=mn[qe]=mn[j]=mn[me]=mn[Ve]=mn[ge]=mn[ot]=mn[je]=mn[U]=mn[xe]=mn[ye]=mn[Te]=mn[Le]=mn[G]=mn[K]=mn[ne]=mn[ve]=!0,mn[Ye]=mn[We]=mn[Xe]=!1;var BU={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},UU={"&":"&","<":"<",">":">",'"':""","'":"'"},$U={"&":"&","<":"<",">":">",""":'"',"'":"'"},zU={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},HU=parseFloat,jU=parseInt,lS=typeof Jl=="object"&&Jl&&Jl.Object===Object&&Jl,GU=typeof self=="object"&&self&&self.Object===Object&&self,mr=lS||GU||Function("return this")(),Y2=t&&!t.nodeType&&t,Ol=Y2&&!0&&e&&!e.nodeType&&e,uS=Ol&&Ol.exports===Y2,X2=uS&&lS.process,Yi=function(){try{var ee=Ol&&Ol.require&&Ol.require("util").types;return ee||X2&&X2.binding&&X2.binding("util")}catch{}}(),cS=Yi&&Yi.isArrayBuffer,dS=Yi&&Yi.isDate,pS=Yi&&Yi.isMap,fS=Yi&&Yi.isRegExp,hS=Yi&&Yi.isSet,gS=Yi&&Yi.isTypedArray;function wi(ee,_e,he){switch(he.length){case 0:return ee.call(_e);case 1:return ee.call(_e,he[0]);case 2:return ee.call(_e,he[0],he[1]);case 3:return ee.call(_e,he[0],he[1],he[2])}return ee.apply(_e,he)}function VU(ee,_e,he,et){for(var _t=-1,Jt=ee==null?0:ee.length;++_t-1}function Z2(ee,_e,he){for(var et=-1,_t=ee==null?0:ee.length;++et<_t;)if(he(_e,ee[et]))return!0;return!1}function An(ee,_e){for(var he=-1,et=ee==null?0:ee.length,_t=Array(et);++he-1;);return he}function SS(ee,_e){for(var he=ee.length;he--&&Uu(_e,ee[he],0)>-1;);return he}function e$(ee,_e){for(var he=ee.length,et=0;he--;)ee[he]===_e&&++et;return et}var t$=t5(BU),n$=t5(UU);function r$(ee){return"\\"+zU[ee]}function i$(ee,_e){return ee==null?n:ee[_e]}function $u(ee){return LU.test(ee)}function a$(ee){return MU.test(ee)}function o$(ee){for(var _e,he=[];!(_e=ee.next()).done;)he.push(_e.value);return he}function a5(ee){var _e=-1,he=Array(ee.size);return ee.forEach(function(et,_t){he[++_e]=[_t,et]}),he}function wS(ee,_e){return function(he){return ee(_e(he))}}function ws(ee,_e){for(var he=-1,et=ee.length,_t=0,Jt=[];++he-1}function q$(l,d){var h=this.__data__,_=Uf(h,l);return _<0?(++this.size,h.push([l,d])):h[_][1]=d,this}Do.prototype.clear=j$,Do.prototype.delete=G$,Do.prototype.get=V$,Do.prototype.has=W$,Do.prototype.set=q$;function Lo(l){var d=-1,h=l==null?0:l.length;for(this.clear();++d=d?l:d)),l}function Ji(l,d,h,_,x,F){var z,Z=d&f,ae=d&m,we=d&g;if(h&&(z=x?h(l,_,x,F):h(l)),z!==n)return z;if(!Rn(l))return l;var Ce=Tt(l);if(Ce){if(z=Zz(l),!Z)return li(l,z)}else{var Ie=Fr(l),Ze=Ie==We||Ie==dt;if(Rs(l))return ow(l,Z);if(Ie==U||Ie==Se||Ze&&!x){if(z=ae||Ze?{}:Aw(l),!Z)return ae?$z(l,uz(z,l)):Uz(l,FS(z,l))}else{if(!mn[Ie])return x?l:{};z=Qz(l,Ie,Z)}}F||(F=new ka);var lt=F.get(l);if(lt)return lt;F.set(l,z),eA(l)?l.forEach(function(yt){z.add(Ji(yt,d,h,yt,l,F))}):Qw(l)&&l.forEach(function(yt,Nt){z.set(Nt,Ji(yt,d,h,Nt,l,F))});var bt=we?ae?N5:R5:ae?ci:sr,wt=Ce?n:bt(l);return Xi(wt||l,function(yt,Nt){wt&&(Nt=yt,yt=l[Nt]),Pc(z,Nt,Ji(yt,d,h,Nt,l,F))}),z}function cz(l){var d=sr(l);return function(h){return PS(h,l,d)}}function PS(l,d,h){var _=h.length;if(l==null)return!_;for(l=pn(l);_--;){var x=h[_],F=d[x],z=l[x];if(z===n&&!(x in l)||!F(z))return!1}return!0}function BS(l,d,h){if(typeof l!="function")throw new Zi(o);return Gc(function(){l.apply(n,h)},d)}function Bc(l,d,h,_){var x=-1,F=Tf,z=!0,Z=l.length,ae=[],we=d.length;if(!Z)return ae;h&&(d=An(d,Ai(h))),_?(F=Z2,z=!1):d.length>=i&&(F=Nc,z=!1,d=new Ml(d));e:for(;++xx?0:x+h),_=_===n||_>x?x:St(_),_<0&&(_+=x),_=h>_?0:nA(_);h<_;)l[h++]=d;return l}function $S(l,d){var h=[];return Cs(l,function(_,x,F){d(_,x,F)&&h.push(_)}),h}function br(l,d,h,_,x){var F=-1,z=l.length;for(h||(h=eH),x||(x=[]);++F0&&h(Z)?d>1?br(Z,d-1,h,_,x):Ss(x,Z):_||(x[x.length]=Z)}return x}var p5=pw(),zS=pw(!0);function ro(l,d){return l&&p5(l,d,sr)}function f5(l,d){return l&&zS(l,d,sr)}function zf(l,d){return Ts(d,function(h){return Uo(l[h])})}function Pl(l,d){d=xs(d,l);for(var h=0,_=d.length;l!=null&&h<_;)l=l[ao(d[h++])];return h&&h==_?l:n}function HS(l,d,h){var _=d(l);return Tt(l)?_:Ss(_,h(l))}function Xr(l){return l==null?l===n?ze:pt:Dl&&Dl in pn(l)?Kz(l):sH(l)}function h5(l,d){return l>d}function fz(l,d){return l!=null&&an.call(l,d)}function hz(l,d){return l!=null&&d in pn(l)}function gz(l,d,h){return l>=Mr(d,h)&&l=120&&Ce.length>=120)?new Ml(z&&Ce):n}Ce=l[0];var Ie=-1,Ze=Z[0];e:for(;++Ie-1;)Z!==l&&Of.call(Z,ae,1),Of.call(l,ae,1);return l}function QS(l,d){for(var h=l?d.length:0,_=h-1;h--;){var x=d[h];if(h==_||x!==F){var F=x;Bo(x)?Of.call(l,x,1):S5(l,x)}}return l}function v5(l,d){return l+Mf(OS()*(d-l+1))}function xz(l,d,h,_){for(var x=-1,F=Jn(Lf((d-l)/(h||1)),0),z=he(F);F--;)z[_?F:++x]=l,l+=h;return z}function _5(l,d){var h="";if(!l||d<1||d>W)return h;do d%2&&(h+=l),d=Mf(d/2),d&&(l+=l);while(d);return h}function xt(l,d){return B5(xw(l,d,di),l+"")}function Iz(l){return MS(Zu(l))}function Rz(l,d){var h=Zu(l);return Qf(h,Fl(d,0,h.length))}function zc(l,d,h,_){if(!Rn(l))return l;d=xs(d,l);for(var x=-1,F=d.length,z=F-1,Z=l;Z!=null&&++xx?0:x+d),h=h>x?x:h,h<0&&(h+=x),x=d>h?0:h-d>>>0,d>>>=0;for(var F=he(x);++_>>1,z=l[F];z!==null&&!ki(z)&&(h?z<=d:z=i){var we=d?null:Gz(l);if(we)return wf(we);z=!1,x=Nc,ae=new Ml}else ae=d?[]:Z;e:for(;++_=_?l:ea(l,d,h)}var aw=_$||function(l){return mr.clearTimeout(l)};function ow(l,d){if(d)return l.slice();var h=l.length,_=kS?kS(h):new l.constructor(h);return l.copy(_),_}function k5(l){var d=new l.constructor(l.byteLength);return new Rf(d).set(new Rf(l)),d}function Mz(l,d){var h=d?k5(l.buffer):l.buffer;return new l.constructor(h,l.byteOffset,l.byteLength)}function Fz(l){var d=new l.constructor(l.source,Ke.exec(l));return d.lastIndex=l.lastIndex,d}function Pz(l){return Fc?pn(Fc.call(l)):{}}function sw(l,d){var h=d?k5(l.buffer):l.buffer;return new l.constructor(h,l.byteOffset,l.length)}function lw(l,d){if(l!==d){var h=l!==n,_=l===null,x=l===l,F=ki(l),z=d!==n,Z=d===null,ae=d===d,we=ki(d);if(!Z&&!we&&!F&&l>d||F&&z&&ae&&!Z&&!we||_&&z&&ae||!h&&ae||!x)return 1;if(!_&&!F&&!we&&l=Z)return ae;var we=h[_];return ae*(we=="desc"?-1:1)}}return l.index-d.index}function uw(l,d,h,_){for(var x=-1,F=l.length,z=h.length,Z=-1,ae=d.length,we=Jn(F-z,0),Ce=he(ae+we),Ie=!_;++Z1?h[x-1]:n,z=x>2?h[2]:n;for(F=l.length>3&&typeof F=="function"?(x--,F):n,z&&Zr(h[0],h[1],z)&&(F=x<3?n:F,x=1),d=pn(d);++_-1?x[F?d[z]:z]:n}}function gw(l){return Po(function(d){var h=d.length,_=h,x=Qi.prototype.thru;for(l&&d.reverse();_--;){var F=d[_];if(typeof F!="function")throw new Zi(o);if(x&&!z&&Xf(F)=="wrapper")var z=new Qi([],!0)}for(_=z?_:h;++_1&&Bt.reverse(),Ce&&aeZ))return!1;var we=F.get(l),Ce=F.get(d);if(we&&Ce)return we==d&&Ce==l;var Ie=-1,Ze=!0,lt=h&y?new Ml:n;for(F.set(l,d),F.set(d,l);++Ie1?"& ":"")+d[_],d=d.join(h>2?", ":" "),l.replace(vs,`{ /* [wrapped with `+d+`] */ -`)}function eH(l){return Tt(l)||$l(l)||!!(RS&&l&&l[RS])}function Bo(l,d){var h=typeof l;return d=d??W,!!d&&(h=="number"||h!="symbol"&&ar.test(l))&&l>-1&&l%1==0&&l0){if(++d>=$)return arguments[0]}else d=0;return l.apply(n,arguments)}}function Qf(l,d){var h=-1,_=l.length,x=_-1;for(d=d===n?_:d;++h1?l[d-1]:n;return h=typeof h=="function"?(l.pop(),h):n,$w(l,h)});function zw(l){var d=M(l);return d.__chain__=!0,d}function dj(l,d){return d(l),l}function Jf(l,d){return d(l)}var pj=Po(function(l){var d=l.length,h=d?l[0]:0,_=this.__wrapped__,x=function(F){return d5(F,l)};return d>1||this.__actions__.length||!(_ instanceof Mt)||!Bo(h)?this.thru(x):(_=_.slice(h,+h+(d?1:0)),_.__actions__.push({func:Jf,args:[x],thisArg:n}),new Qi(_,this.__chain__).thru(function(F){return d&&!F.length&&F.push(n),F}))});function fj(){return zw(this)}function hj(){return new Qi(this.value(),this.__chain__)}function gj(){this.__values__===n&&(this.__values__=tA(this.value()));var l=this.__index__>=this.__values__.length,d=l?n:this.__values__[this.__index__++];return{done:l,value:d}}function mj(){return this}function bj(l){for(var d,h=this;h instanceof Bf;){var _=Lw(h);_.__index__=0,_.__values__=n,d?x.__wrapped__=_:d=_;var x=_;h=h.__wrapped__}return x.__wrapped__=l,d}function yj(){var l=this.__wrapped__;if(l instanceof Mt){var d=l;return this.__actions__.length&&(d=new Mt(this)),d=d.reverse(),d.__actions__.push({func:Jf,args:[U5],thisArg:n}),new Qi(d,this.__chain__)}return this.thru(U5)}function Ej(){return rw(this.__wrapped__,this.__actions__)}var vj=Vf(function(l,d,h){an.call(l,h)?++l[h]:Mo(l,h,1)});function _j(l,d,h){var _=Tt(l)?mS:dz;return h&&Zr(l,d,h)&&(d=n),_(l,mt(d,3))}function Tj(l,d){var h=Tt(l)?Ts:$S;return h(l,mt(d,3))}var Sj=hw(Mw),wj=hw(Fw);function Aj(l,d){return br(e0(l,d),1)}function Cj(l,d){return br(e0(l,d),H)}function kj(l,d,h){return h=h===n?1:St(h),br(e0(l,d),h)}function Hw(l,d){var h=Tt(l)?Xi:Cs;return h(l,mt(d,3))}function jw(l,d){var h=Tt(l)?WU:US;return h(l,mt(d,3))}var xj=Vf(function(l,d,h){an.call(l,h)?l[h].push(d):Mo(l,h,[d])});function Ij(l,d,h,_){l=ui(l)?l:Zu(l),h=h&&!_?St(h):0;var x=l.length;return h<0&&(h=Jn(x+h,0)),a0(l)?h<=x&&l.indexOf(d,h)>-1:!!x&&Uu(l,d,h)>-1}var Rj=xt(function(l,d,h){var _=-1,x=typeof d=="function",F=ui(l)?he(l.length):[];return Cs(l,function(z){F[++_]=x?wi(d,z,h):Uc(z,d,h)}),F}),Nj=Vf(function(l,d,h){Mo(l,h,d)});function e0(l,d){var h=Tt(l)?An:WS;return h(l,mt(d,3))}function Oj(l,d,h,_){return l==null?[]:(Tt(d)||(d=d==null?[]:[d]),h=_?n:h,Tt(h)||(h=h==null?[]:[h]),XS(l,d,h))}var Dj=Vf(function(l,d,h){l[h?0:1].push(d)},function(){return[[],[]]});function Lj(l,d,h){var _=Tt(l)?Q2:vS,x=arguments.length<3;return _(l,mt(d,4),h,x,Cs)}function Mj(l,d,h){var _=Tt(l)?qU:vS,x=arguments.length<3;return _(l,mt(d,4),h,x,US)}function Fj(l,d){var h=Tt(l)?Ts:$S;return h(l,r0(mt(d,3)))}function Pj(l){var d=Tt(l)?MS:Iz;return d(l)}function Bj(l,d,h){(h?Zr(l,d,h):d===n)?d=1:d=St(d);var _=Tt(l)?oz:Rz;return _(l,d)}function Uj(l){var d=Tt(l)?sz:Oz;return d(l)}function $j(l){if(l==null)return 0;if(ui(l))return a0(l)?zu(l):l.length;var d=Fr(l);return d==ot||d==ye?l.size:b5(l).length}function zj(l,d,h){var _=Tt(l)?J2:Dz;return h&&Zr(l,d,h)&&(d=n),_(l,mt(d,3))}var Hj=xt(function(l,d){if(l==null)return[];var h=d.length;return h>1&&Zr(l,d[0],d[1])?d=[]:h>2&&Zr(d[0],d[1],d[2])&&(d=[d[0]]),XS(l,br(d,1),[])}),t0=T$||function(){return mr.Date.now()};function jj(l,d){if(typeof d!="function")throw new Zi(o);return l=St(l),function(){if(--l<1)return d.apply(this,arguments)}}function Gw(l,d,h){return d=h?n:d,d=l&&d==null?l.length:d,Fo(l,N,n,n,n,n,d)}function Vw(l,d){var h;if(typeof d!="function")throw new Zi(o);return l=St(l),function(){return--l>0&&(h=d.apply(this,arguments)),l<=1&&(d=n),h}}var z5=xt(function(l,d,h){var _=T;if(h.length){var x=ws(h,Yu(z5));_|=R}return Fo(l,_,d,h,x)}),Ww=xt(function(l,d,h){var _=T|E;if(h.length){var x=ws(h,Yu(Ww));_|=R}return Fo(d,_,l,h,x)});function qw(l,d,h){d=h?n:d;var _=Fo(l,w,n,n,n,n,n,d);return _.placeholder=qw.placeholder,_}function Kw(l,d,h){d=h?n:d;var _=Fo(l,A,n,n,n,n,n,d);return _.placeholder=Kw.placeholder,_}function Yw(l,d,h){var _,x,F,z,Z,ae,we=0,Ce=!1,Ie=!1,Xe=!0;if(typeof l!="function")throw new Zi(o);d=na(d)||0,Rn(h)&&(Ce=!!h.leading,Ie="maxWait"in h,F=Ie?Jn(na(h.maxWait)||0,d):F,Xe="trailing"in h?!!h.trailing:Xe);function lt(Hn){var Ia=_,zo=x;return _=x=n,we=Hn,z=l.apply(zo,Ia),z}function bt(Hn){return we=Hn,Z=Gc(Nt,d),Ce?lt(Hn):z}function wt(Hn){var Ia=Hn-ae,zo=Hn-we,hA=d-Ia;return Ie?Mr(hA,F-zo):hA}function yt(Hn){var Ia=Hn-ae,zo=Hn-we;return ae===n||Ia>=d||Ia<0||Ie&&zo>=F}function Nt(){var Hn=t0();if(yt(Hn))return Bt(Hn);Z=Gc(Nt,wt(Hn))}function Bt(Hn){return Z=n,Xe&&_?lt(Hn):(_=x=n,z)}function xi(){Z!==n&&aw(Z),we=0,_=ae=x=Z=n}function Qr(){return Z===n?z:Bt(t0())}function Ii(){var Hn=t0(),Ia=yt(Hn);if(_=arguments,x=this,ae=Hn,Ia){if(Z===n)return bt(ae);if(Ie)return aw(Z),Z=Gc(Nt,d),lt(ae)}return Z===n&&(Z=Gc(Nt,d)),z}return Ii.cancel=xi,Ii.flush=Qr,Ii}var Gj=xt(function(l,d){return BS(l,1,d)}),Vj=xt(function(l,d,h){return BS(l,na(d)||0,h)});function Wj(l){return Fo(l,q)}function n0(l,d){if(typeof l!="function"||d!=null&&typeof d!="function")throw new Zi(o);var h=function(){var _=arguments,x=d?d.apply(this,_):_[0],F=h.cache;if(F.has(x))return F.get(x);var z=l.apply(this,_);return h.cache=F.set(x,z)||F,z};return h.cache=new(n0.Cache||Lo),h}n0.Cache=Lo;function r0(l){if(typeof l!="function")throw new Zi(o);return function(){var d=arguments;switch(d.length){case 0:return!l.call(this);case 1:return!l.call(this,d[0]);case 2:return!l.call(this,d[0],d[1]);case 3:return!l.call(this,d[0],d[1],d[2])}return!l.apply(this,d)}}function qj(l){return Vw(2,l)}var Kj=Lz(function(l,d){d=d.length==1&&Tt(d[0])?An(d[0],Ai(mt())):An(br(d,1),Ai(mt()));var h=d.length;return xt(function(_){for(var x=-1,F=Mr(_.length,h);++x=d}),$l=jS(function(){return arguments}())?jS:function(l){return Mn(l)&&an.call(l,"callee")&&!IS.call(l,"callee")},Tt=he.isArray,uG=cS?Ai(cS):bz;function ui(l){return l!=null&&i0(l.length)&&!Uo(l)}function zn(l){return Mn(l)&&ui(l)}function cG(l){return l===!0||l===!1||Mn(l)&&Xr(l)==te}var Rs=w$||J5,dG=dS?Ai(dS):yz;function pG(l){return Mn(l)&&l.nodeType===1&&!Vc(l)}function fG(l){if(l==null)return!0;if(ui(l)&&(Tt(l)||typeof l=="string"||typeof l.splice=="function"||Rs(l)||Xu(l)||$l(l)))return!l.length;var d=Fr(l);if(d==ot||d==ye)return!l.size;if(jc(l))return!b5(l).length;for(var h in l)if(an.call(l,h))return!1;return!0}function hG(l,d){return $c(l,d)}function gG(l,d,h){h=typeof h=="function"?h:n;var _=h?h(l,d):n;return _===n?$c(l,d,n,h):!!_}function j5(l){if(!Mn(l))return!1;var d=Xr(l);return d==Ze||d==Re||typeof l.message=="string"&&typeof l.name=="string"&&!Vc(l)}function mG(l){return typeof l=="number"&&NS(l)}function Uo(l){if(!Rn(l))return!1;var d=Xr(l);return d==We||d==dt||d==ke||d==de}function Zw(l){return typeof l=="number"&&l==St(l)}function i0(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=W}function Rn(l){var d=typeof l;return l!=null&&(d=="object"||d=="function")}function Mn(l){return l!=null&&typeof l=="object"}var Qw=pS?Ai(pS):vz;function bG(l,d){return l===d||m5(l,d,D5(d))}function yG(l,d,h){return h=typeof h=="function"?h:n,m5(l,d,D5(d),h)}function EG(l){return Jw(l)&&l!=+l}function vG(l){if(rH(l))throw new _t(a);return GS(l)}function _G(l){return l===null}function TG(l){return l==null}function Jw(l){return typeof l=="number"||Mn(l)&&Xr(l)==je}function Vc(l){if(!Mn(l)||Xr(l)!=U)return!1;var d=Nf(l);if(d===null)return!0;var h=an.call(d,"constructor")&&d.constructor;return typeof h=="function"&&h instanceof h&&kf.call(h)==y$}var G5=fS?Ai(fS):_z;function SG(l){return Zw(l)&&l>=-W&&l<=W}var eA=hS?Ai(hS):Tz;function a0(l){return typeof l=="string"||!Tt(l)&&Mn(l)&&Xr(l)==Te}function ki(l){return typeof l=="symbol"||Mn(l)&&Xr(l)==Le}var Xu=gS?Ai(gS):Sz;function wG(l){return l===n}function AG(l){return Mn(l)&&Fr(l)==Ye}function CG(l){return Mn(l)&&Xr(l)==jt}var kG=Yf(y5),xG=Yf(function(l,d){return l<=d});function tA(l){if(!l)return[];if(ui(l))return a0(l)?Ca(l):li(l);if(Oc&&l[Oc])return o$(l[Oc]());var d=Fr(l),h=d==ot?a5:d==ye?wf:Zu;return h(l)}function $o(l){if(!l)return l===0?l:0;if(l=na(l),l===H||l===-H){var d=l<0?-1:1;return d*se}return l===l?l:0}function St(l){var d=$o(l),h=d%1;return d===d?h?d-h:d:0}function nA(l){return l?Fl(St(l),0,pe):0}function na(l){if(typeof l=="number")return l;if(ki(l))return D;if(Rn(l)){var d=typeof l.valueOf=="function"?l.valueOf():l;l=Rn(d)?d+"":d}if(typeof l!="string")return l===0?l:+l;l=_S(l);var h=Be.test(l);return h||un.test(l)?jU(l.slice(2),h?2:8):J.test(l)?D:+l}function rA(l){return io(l,ci(l))}function IG(l){return l?Fl(St(l),-W,W):l===0?l:0}function en(l){return l==null?"":Ci(l)}var RG=qu(function(l,d){if(jc(d)||ui(d)){io(d,sr(d),l);return}for(var h in d)an.call(d,h)&&Pc(l,h,d[h])}),iA=qu(function(l,d){io(d,ci(d),l)}),o0=qu(function(l,d,h,_){io(d,ci(d),l,_)}),NG=qu(function(l,d,h,_){io(d,sr(d),l,_)}),OG=Po(d5);function DG(l,d){var h=Wu(l);return d==null?h:FS(h,d)}var LG=xt(function(l,d){l=pn(l);var h=-1,_=d.length,x=_>2?d[2]:n;for(x&&Zr(d[0],d[1],x)&&(_=1);++h<_;)for(var F=d[h],z=ci(F),Z=-1,ae=z.length;++Z1),F}),io(l,N5(l),h),_&&(h=Ji(h,f|m|g,Vz));for(var x=d.length;x--;)S5(h,d[x]);return h});function QG(l,d){return oA(l,r0(mt(d)))}var JG=Po(function(l,d){return l==null?{}:Cz(l,d)});function oA(l,d){if(l==null)return{};var h=An(N5(l),function(_){return[_]});return d=mt(d),ZS(l,h,function(_,x){return d(_,x[0])})}function eV(l,d,h){d=xs(d,l);var _=-1,x=d.length;for(x||(x=1,l=n);++_d){var _=l;l=d,d=_}if(h||l%1||d%1){var x=OS();return Mr(l+x*(d-l+HU("1e-"+((x+"").length-1))),d)}return v5(l,d)}var dV=Ku(function(l,d,h){return d=d.toLowerCase(),l+(h?uA(d):d)});function uA(l){return q5(en(l).toLowerCase())}function cA(l){return l=en(l),l&&l.replace(or,t$).replace(OU,"")}function pV(l,d,h){l=en(l),d=Ci(d);var _=l.length;h=h===n?_:Fl(St(h),0,_);var x=h;return h-=d.length,h>=0&&l.slice(h,x)==d}function fV(l){return l=en(l),l&&Qt.test(l)?l.replace(Je,n$):l}function hV(l){return l=en(l),l&&si.test(l)?l.replace(Aa,"\\$&"):l}var gV=Ku(function(l,d,h){return l+(h?"-":"")+d.toLowerCase()}),mV=Ku(function(l,d,h){return l+(h?" ":"")+d.toLowerCase()}),bV=fw("toLowerCase");function yV(l,d,h){l=en(l),d=St(d);var _=d?zu(l):0;if(!d||_>=d)return l;var x=(d-_)/2;return Kf(Mf(x),h)+l+Kf(Lf(x),h)}function EV(l,d,h){l=en(l),d=St(d);var _=d?zu(l):0;return d&&_>>0,h?(l=en(l),l&&(typeof d=="string"||d!=null&&!G5(d))&&(d=Ci(d),!d&&$u(l))?Is(Ca(l),0,h):l.split(d,h)):[]}var CV=Ku(function(l,d,h){return l+(h?" ":"")+q5(d)});function kV(l,d,h){return l=en(l),h=h==null?0:Fl(St(h),0,l.length),d=Ci(d),l.slice(h,h+d.length)==d}function xV(l,d,h){var _=M.templateSettings;h&&Zr(l,d,h)&&(d=n),l=en(l),d=o0({},d,_,vw);var x=o0({},d.imports,_.imports,vw),F=sr(x),z=i5(x,F),Z,ae,we=0,Ce=d.interpolate||Zn,Ie="__p += '",Xe=o5((d.escape||Zn).source+"|"+Ce.source+"|"+(Ce===Xt?Nl:Zn).source+"|"+(d.evaluate||Zn).source+"|$","g"),lt="//# sourceURL="+(an.call(d,"sourceURL")?(d.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++PU+"]")+` -`;l.replace(Xe,function(yt,Nt,Bt,xi,Qr,Ii){return Bt||(Bt=xi),Ie+=l.slice(we,Ii).replace(Oo,r$),Nt&&(Z=!0,Ie+=`' + +`)}function eH(l){return Tt(l)||$l(l)||!!(RS&&l&&l[RS])}function Bo(l,d){var h=typeof l;return d=d??W,!!d&&(h=="number"||h!="symbol"&&ar.test(l))&&l>-1&&l%1==0&&l0){if(++d>=$)return arguments[0]}else d=0;return l.apply(n,arguments)}}function Qf(l,d){var h=-1,_=l.length,x=_-1;for(d=d===n?_:d;++h1?l[d-1]:n;return h=typeof h=="function"?(l.pop(),h):n,$w(l,h)});function zw(l){var d=M(l);return d.__chain__=!0,d}function dj(l,d){return d(l),l}function Jf(l,d){return d(l)}var pj=Po(function(l){var d=l.length,h=d?l[0]:0,_=this.__wrapped__,x=function(F){return d5(F,l)};return d>1||this.__actions__.length||!(_ instanceof Mt)||!Bo(h)?this.thru(x):(_=_.slice(h,+h+(d?1:0)),_.__actions__.push({func:Jf,args:[x],thisArg:n}),new Qi(_,this.__chain__).thru(function(F){return d&&!F.length&&F.push(n),F}))});function fj(){return zw(this)}function hj(){return new Qi(this.value(),this.__chain__)}function gj(){this.__values__===n&&(this.__values__=tA(this.value()));var l=this.__index__>=this.__values__.length,d=l?n:this.__values__[this.__index__++];return{done:l,value:d}}function mj(){return this}function bj(l){for(var d,h=this;h instanceof Bf;){var _=Lw(h);_.__index__=0,_.__values__=n,d?x.__wrapped__=_:d=_;var x=_;h=h.__wrapped__}return x.__wrapped__=l,d}function yj(){var l=this.__wrapped__;if(l instanceof Mt){var d=l;return this.__actions__.length&&(d=new Mt(this)),d=d.reverse(),d.__actions__.push({func:Jf,args:[U5],thisArg:n}),new Qi(d,this.__chain__)}return this.thru(U5)}function Ej(){return rw(this.__wrapped__,this.__actions__)}var vj=Vf(function(l,d,h){an.call(l,h)?++l[h]:Mo(l,h,1)});function _j(l,d,h){var _=Tt(l)?mS:dz;return h&&Zr(l,d,h)&&(d=n),_(l,mt(d,3))}function Tj(l,d){var h=Tt(l)?Ts:$S;return h(l,mt(d,3))}var Sj=hw(Mw),wj=hw(Fw);function Aj(l,d){return br(e0(l,d),1)}function Cj(l,d){return br(e0(l,d),H)}function kj(l,d,h){return h=h===n?1:St(h),br(e0(l,d),h)}function Hw(l,d){var h=Tt(l)?Xi:Cs;return h(l,mt(d,3))}function jw(l,d){var h=Tt(l)?WU:US;return h(l,mt(d,3))}var xj=Vf(function(l,d,h){an.call(l,h)?l[h].push(d):Mo(l,h,[d])});function Ij(l,d,h,_){l=ui(l)?l:Zu(l),h=h&&!_?St(h):0;var x=l.length;return h<0&&(h=Jn(x+h,0)),a0(l)?h<=x&&l.indexOf(d,h)>-1:!!x&&Uu(l,d,h)>-1}var Rj=xt(function(l,d,h){var _=-1,x=typeof d=="function",F=ui(l)?he(l.length):[];return Cs(l,function(z){F[++_]=x?wi(d,z,h):Uc(z,d,h)}),F}),Nj=Vf(function(l,d,h){Mo(l,h,d)});function e0(l,d){var h=Tt(l)?An:WS;return h(l,mt(d,3))}function Oj(l,d,h,_){return l==null?[]:(Tt(d)||(d=d==null?[]:[d]),h=_?n:h,Tt(h)||(h=h==null?[]:[h]),XS(l,d,h))}var Dj=Vf(function(l,d,h){l[h?0:1].push(d)},function(){return[[],[]]});function Lj(l,d,h){var _=Tt(l)?Q2:vS,x=arguments.length<3;return _(l,mt(d,4),h,x,Cs)}function Mj(l,d,h){var _=Tt(l)?qU:vS,x=arguments.length<3;return _(l,mt(d,4),h,x,US)}function Fj(l,d){var h=Tt(l)?Ts:$S;return h(l,r0(mt(d,3)))}function Pj(l){var d=Tt(l)?MS:Iz;return d(l)}function Bj(l,d,h){(h?Zr(l,d,h):d===n)?d=1:d=St(d);var _=Tt(l)?oz:Rz;return _(l,d)}function Uj(l){var d=Tt(l)?sz:Oz;return d(l)}function $j(l){if(l==null)return 0;if(ui(l))return a0(l)?zu(l):l.length;var d=Fr(l);return d==ot||d==ye?l.size:b5(l).length}function zj(l,d,h){var _=Tt(l)?J2:Dz;return h&&Zr(l,d,h)&&(d=n),_(l,mt(d,3))}var Hj=xt(function(l,d){if(l==null)return[];var h=d.length;return h>1&&Zr(l,d[0],d[1])?d=[]:h>2&&Zr(d[0],d[1],d[2])&&(d=[d[0]]),XS(l,br(d,1),[])}),t0=T$||function(){return mr.Date.now()};function jj(l,d){if(typeof d!="function")throw new Zi(o);return l=St(l),function(){if(--l<1)return d.apply(this,arguments)}}function Gw(l,d,h){return d=h?n:d,d=l&&d==null?l.length:d,Fo(l,N,n,n,n,n,d)}function Vw(l,d){var h;if(typeof d!="function")throw new Zi(o);return l=St(l),function(){return--l>0&&(h=d.apply(this,arguments)),l<=1&&(d=n),h}}var z5=xt(function(l,d,h){var _=T;if(h.length){var x=ws(h,Yu(z5));_|=R}return Fo(l,_,d,h,x)}),Ww=xt(function(l,d,h){var _=T|E;if(h.length){var x=ws(h,Yu(Ww));_|=R}return Fo(d,_,l,h,x)});function qw(l,d,h){d=h?n:d;var _=Fo(l,w,n,n,n,n,n,d);return _.placeholder=qw.placeholder,_}function Kw(l,d,h){d=h?n:d;var _=Fo(l,A,n,n,n,n,n,d);return _.placeholder=Kw.placeholder,_}function Yw(l,d,h){var _,x,F,z,Z,ae,we=0,Ce=!1,Ie=!1,Ze=!0;if(typeof l!="function")throw new Zi(o);d=na(d)||0,Rn(h)&&(Ce=!!h.leading,Ie="maxWait"in h,F=Ie?Jn(na(h.maxWait)||0,d):F,Ze="trailing"in h?!!h.trailing:Ze);function lt(Hn){var Ia=_,zo=x;return _=x=n,we=Hn,z=l.apply(zo,Ia),z}function bt(Hn){return we=Hn,Z=Gc(Nt,d),Ce?lt(Hn):z}function wt(Hn){var Ia=Hn-ae,zo=Hn-we,hA=d-Ia;return Ie?Mr(hA,F-zo):hA}function yt(Hn){var Ia=Hn-ae,zo=Hn-we;return ae===n||Ia>=d||Ia<0||Ie&&zo>=F}function Nt(){var Hn=t0();if(yt(Hn))return Bt(Hn);Z=Gc(Nt,wt(Hn))}function Bt(Hn){return Z=n,Ze&&_?lt(Hn):(_=x=n,z)}function xi(){Z!==n&&aw(Z),we=0,_=ae=x=Z=n}function Qr(){return Z===n?z:Bt(t0())}function Ii(){var Hn=t0(),Ia=yt(Hn);if(_=arguments,x=this,ae=Hn,Ia){if(Z===n)return bt(ae);if(Ie)return aw(Z),Z=Gc(Nt,d),lt(ae)}return Z===n&&(Z=Gc(Nt,d)),z}return Ii.cancel=xi,Ii.flush=Qr,Ii}var Gj=xt(function(l,d){return BS(l,1,d)}),Vj=xt(function(l,d,h){return BS(l,na(d)||0,h)});function Wj(l){return Fo(l,q)}function n0(l,d){if(typeof l!="function"||d!=null&&typeof d!="function")throw new Zi(o);var h=function(){var _=arguments,x=d?d.apply(this,_):_[0],F=h.cache;if(F.has(x))return F.get(x);var z=l.apply(this,_);return h.cache=F.set(x,z)||F,z};return h.cache=new(n0.Cache||Lo),h}n0.Cache=Lo;function r0(l){if(typeof l!="function")throw new Zi(o);return function(){var d=arguments;switch(d.length){case 0:return!l.call(this);case 1:return!l.call(this,d[0]);case 2:return!l.call(this,d[0],d[1]);case 3:return!l.call(this,d[0],d[1],d[2])}return!l.apply(this,d)}}function qj(l){return Vw(2,l)}var Kj=Lz(function(l,d){d=d.length==1&&Tt(d[0])?An(d[0],Ai(mt())):An(br(d,1),Ai(mt()));var h=d.length;return xt(function(_){for(var x=-1,F=Mr(_.length,h);++x=d}),$l=jS(function(){return arguments}())?jS:function(l){return Mn(l)&&an.call(l,"callee")&&!IS.call(l,"callee")},Tt=he.isArray,uG=cS?Ai(cS):bz;function ui(l){return l!=null&&i0(l.length)&&!Uo(l)}function zn(l){return Mn(l)&&ui(l)}function cG(l){return l===!0||l===!1||Mn(l)&&Xr(l)==te}var Rs=w$||J5,dG=dS?Ai(dS):yz;function pG(l){return Mn(l)&&l.nodeType===1&&!Vc(l)}function fG(l){if(l==null)return!0;if(ui(l)&&(Tt(l)||typeof l=="string"||typeof l.splice=="function"||Rs(l)||Xu(l)||$l(l)))return!l.length;var d=Fr(l);if(d==ot||d==ye)return!l.size;if(jc(l))return!b5(l).length;for(var h in l)if(an.call(l,h))return!1;return!0}function hG(l,d){return $c(l,d)}function gG(l,d,h){h=typeof h=="function"?h:n;var _=h?h(l,d):n;return _===n?$c(l,d,n,h):!!_}function j5(l){if(!Mn(l))return!1;var d=Xr(l);return d==Ye||d==Re||typeof l.message=="string"&&typeof l.name=="string"&&!Vc(l)}function mG(l){return typeof l=="number"&&NS(l)}function Uo(l){if(!Rn(l))return!1;var d=Xr(l);return d==We||d==dt||d==ke||d==de}function Zw(l){return typeof l=="number"&&l==St(l)}function i0(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=W}function Rn(l){var d=typeof l;return l!=null&&(d=="object"||d=="function")}function Mn(l){return l!=null&&typeof l=="object"}var Qw=pS?Ai(pS):vz;function bG(l,d){return l===d||m5(l,d,D5(d))}function yG(l,d,h){return h=typeof h=="function"?h:n,m5(l,d,D5(d),h)}function EG(l){return Jw(l)&&l!=+l}function vG(l){if(rH(l))throw new _t(a);return GS(l)}function _G(l){return l===null}function TG(l){return l==null}function Jw(l){return typeof l=="number"||Mn(l)&&Xr(l)==je}function Vc(l){if(!Mn(l)||Xr(l)!=U)return!1;var d=Nf(l);if(d===null)return!0;var h=an.call(d,"constructor")&&d.constructor;return typeof h=="function"&&h instanceof h&&kf.call(h)==y$}var G5=fS?Ai(fS):_z;function SG(l){return Zw(l)&&l>=-W&&l<=W}var eA=hS?Ai(hS):Tz;function a0(l){return typeof l=="string"||!Tt(l)&&Mn(l)&&Xr(l)==Te}function ki(l){return typeof l=="symbol"||Mn(l)&&Xr(l)==Le}var Xu=gS?Ai(gS):Sz;function wG(l){return l===n}function AG(l){return Mn(l)&&Fr(l)==Xe}function CG(l){return Mn(l)&&Xr(l)==jt}var kG=Yf(y5),xG=Yf(function(l,d){return l<=d});function tA(l){if(!l)return[];if(ui(l))return a0(l)?Ca(l):li(l);if(Oc&&l[Oc])return o$(l[Oc]());var d=Fr(l),h=d==ot?a5:d==ye?wf:Zu;return h(l)}function $o(l){if(!l)return l===0?l:0;if(l=na(l),l===H||l===-H){var d=l<0?-1:1;return d*se}return l===l?l:0}function St(l){var d=$o(l),h=d%1;return d===d?h?d-h:d:0}function nA(l){return l?Fl(St(l),0,pe):0}function na(l){if(typeof l=="number")return l;if(ki(l))return D;if(Rn(l)){var d=typeof l.valueOf=="function"?l.valueOf():l;l=Rn(d)?d+"":d}if(typeof l!="string")return l===0?l:+l;l=_S(l);var h=Be.test(l);return h||un.test(l)?jU(l.slice(2),h?2:8):J.test(l)?D:+l}function rA(l){return io(l,ci(l))}function IG(l){return l?Fl(St(l),-W,W):l===0?l:0}function en(l){return l==null?"":Ci(l)}var RG=qu(function(l,d){if(jc(d)||ui(d)){io(d,sr(d),l);return}for(var h in d)an.call(d,h)&&Pc(l,h,d[h])}),iA=qu(function(l,d){io(d,ci(d),l)}),o0=qu(function(l,d,h,_){io(d,ci(d),l,_)}),NG=qu(function(l,d,h,_){io(d,sr(d),l,_)}),OG=Po(d5);function DG(l,d){var h=Wu(l);return d==null?h:FS(h,d)}var LG=xt(function(l,d){l=pn(l);var h=-1,_=d.length,x=_>2?d[2]:n;for(x&&Zr(d[0],d[1],x)&&(_=1);++h<_;)for(var F=d[h],z=ci(F),Z=-1,ae=z.length;++Z1),F}),io(l,N5(l),h),_&&(h=Ji(h,f|m|g,Vz));for(var x=d.length;x--;)S5(h,d[x]);return h});function QG(l,d){return oA(l,r0(mt(d)))}var JG=Po(function(l,d){return l==null?{}:Cz(l,d)});function oA(l,d){if(l==null)return{};var h=An(N5(l),function(_){return[_]});return d=mt(d),ZS(l,h,function(_,x){return d(_,x[0])})}function eV(l,d,h){d=xs(d,l);var _=-1,x=d.length;for(x||(x=1,l=n);++_d){var _=l;l=d,d=_}if(h||l%1||d%1){var x=OS();return Mr(l+x*(d-l+HU("1e-"+((x+"").length-1))),d)}return v5(l,d)}var dV=Ku(function(l,d,h){return d=d.toLowerCase(),l+(h?uA(d):d)});function uA(l){return q5(en(l).toLowerCase())}function cA(l){return l=en(l),l&&l.replace(or,t$).replace(OU,"")}function pV(l,d,h){l=en(l),d=Ci(d);var _=l.length;h=h===n?_:Fl(St(h),0,_);var x=h;return h-=d.length,h>=0&&l.slice(h,x)==d}function fV(l){return l=en(l),l&&Qt.test(l)?l.replace(Je,n$):l}function hV(l){return l=en(l),l&&si.test(l)?l.replace(Aa,"\\$&"):l}var gV=Ku(function(l,d,h){return l+(h?"-":"")+d.toLowerCase()}),mV=Ku(function(l,d,h){return l+(h?" ":"")+d.toLowerCase()}),bV=fw("toLowerCase");function yV(l,d,h){l=en(l),d=St(d);var _=d?zu(l):0;if(!d||_>=d)return l;var x=(d-_)/2;return Kf(Mf(x),h)+l+Kf(Lf(x),h)}function EV(l,d,h){l=en(l),d=St(d);var _=d?zu(l):0;return d&&_>>0,h?(l=en(l),l&&(typeof d=="string"||d!=null&&!G5(d))&&(d=Ci(d),!d&&$u(l))?Is(Ca(l),0,h):l.split(d,h)):[]}var CV=Ku(function(l,d,h){return l+(h?" ":"")+q5(d)});function kV(l,d,h){return l=en(l),h=h==null?0:Fl(St(h),0,l.length),d=Ci(d),l.slice(h,h+d.length)==d}function xV(l,d,h){var _=M.templateSettings;h&&Zr(l,d,h)&&(d=n),l=en(l),d=o0({},d,_,vw);var x=o0({},d.imports,_.imports,vw),F=sr(x),z=i5(x,F),Z,ae,we=0,Ce=d.interpolate||Zn,Ie="__p += '",Ze=o5((d.escape||Zn).source+"|"+Ce.source+"|"+(Ce===Xt?Nl:Zn).source+"|"+(d.evaluate||Zn).source+"|$","g"),lt="//# sourceURL="+(an.call(d,"sourceURL")?(d.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++PU+"]")+` +`;l.replace(Ze,function(yt,Nt,Bt,xi,Qr,Ii){return Bt||(Bt=xi),Ie+=l.slice(we,Ii).replace(Oo,r$),Nt&&(Z=!0,Ie+=`' + __e(`+Nt+`) + '`),Qr&&(ae=!0,Ie+=`'; `+Qr+`; @@ -1151,7 +1151,7 @@ __p += '`),Bt&&(Ie+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Ie+`return __p -}`;var wt=pA(function(){return Jt(F,lt+"return "+Ie).apply(n,z)});if(wt.source=Ie,j5(wt))throw wt;return wt}function IV(l){return en(l).toLowerCase()}function RV(l){return en(l).toUpperCase()}function NV(l,d,h){if(l=en(l),l&&(h||d===n))return _S(l);if(!l||!(d=Ci(d)))return l;var _=Ca(l),x=Ca(d),F=TS(_,x),z=SS(_,x)+1;return Is(_,F,z).join("")}function OV(l,d,h){if(l=en(l),l&&(h||d===n))return l.slice(0,AS(l)+1);if(!l||!(d=Ci(d)))return l;var _=Ca(l),x=SS(_,Ca(d))+1;return Is(_,0,x).join("")}function DV(l,d,h){if(l=en(l),l&&(h||d===n))return l.replace(Or,"");if(!l||!(d=Ci(d)))return l;var _=Ca(l),x=TS(_,Ca(d));return Is(_,x).join("")}function LV(l,d){var h=P,_=Q;if(Rn(d)){var x="separator"in d?d.separator:x;h="length"in d?St(d.length):h,_="omission"in d?Ci(d.omission):_}l=en(l);var F=l.length;if($u(l)){var z=Ca(l);F=z.length}if(h>=F)return l;var Z=h-zu(_);if(Z<1)return _;var ae=z?Is(z,0,Z).join(""):l.slice(0,Z);if(x===n)return ae+_;if(z&&(Z+=ae.length-Z),G5(x)){if(l.slice(Z).search(x)){var we,Ce=ae;for(x.global||(x=o5(x.source,en(Ke.exec(x))+"g")),x.lastIndex=0;we=x.exec(Ce);)var Ie=we.index;ae=ae.slice(0,Ie===n?Z:Ie)}}else if(l.indexOf(Ci(x),Z)!=Z){var Xe=ae.lastIndexOf(x);Xe>-1&&(ae=ae.slice(0,Xe))}return ae+_}function MV(l){return l=en(l),l&&Rt.test(l)?l.replace(rt,c$):l}var FV=Ku(function(l,d,h){return l+(h?" ":"")+d.toUpperCase()}),q5=fw("toUpperCase");function dA(l,d,h){return l=en(l),d=h?n:d,d===n?a$(l)?f$(l):XU(l):l.match(d)||[]}var pA=xt(function(l,d){try{return wi(l,n,d)}catch(h){return j5(h)?h:new _t(h)}}),PV=Po(function(l,d){return Xi(d,function(h){h=ao(h),Mo(l,h,z5(l[h],l))}),l});function BV(l){var d=l==null?0:l.length,h=mt();return l=d?An(l,function(_){if(typeof _[1]!="function")throw new Zi(o);return[h(_[0]),_[1]]}):[],xt(function(_){for(var x=-1;++xW)return[];var h=pe,_=Mr(l,pe);d=mt(d),l-=pe;for(var x=r5(_,d);++h0||d<0)?new Mt(h):(l<0?h=h.takeRight(-l):l&&(h=h.drop(l)),d!==n&&(d=St(d),h=d<0?h.dropRight(-d):h.take(d-l)),h)},Mt.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Mt.prototype.toArray=function(){return this.take(pe)},ro(Mt.prototype,function(l,d){var h=/^(?:filter|find|map|reject)|While$/.test(d),_=/^(?:head|last)$/.test(d),x=M[_?"take"+(d=="last"?"Right":""):d],F=_||/^find/.test(d);x&&(M.prototype[d]=function(){var z=this.__wrapped__,Z=_?[1]:arguments,ae=z instanceof Mt,we=Z[0],Ce=ae||Tt(z),Ie=function(Nt){var Bt=x.apply(M,Ss([Nt],Z));return _&&Xe?Bt[0]:Bt};Ce&&h&&typeof we=="function"&&we.length!=1&&(ae=Ce=!1);var Xe=this.__chain__,lt=!!this.__actions__.length,bt=F&&!Xe,wt=ae&&!lt;if(!F&&Ce){z=wt?z:new Mt(this);var yt=l.apply(z,Z);return yt.__actions__.push({func:Jf,args:[Ie],thisArg:n}),new Qi(yt,Xe)}return bt&&wt?l.apply(this,Z):(yt=this.thru(Ie),bt?_?yt.value()[0]:yt.value():yt)})}),Xi(["pop","push","shift","sort","splice","unshift"],function(l){var d=Af[l],h=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",_=/^(?:pop|shift)$/.test(l);M.prototype[l]=function(){var x=arguments;if(_&&!this.__chain__){var F=this.value();return d.apply(Tt(F)?F:[],x)}return this[h](function(z){return d.apply(Tt(z)?z:[],x)})}}),ro(Mt.prototype,function(l,d){var h=M[d];if(h){var _=h.name+"";an.call(Vu,_)||(Vu[_]=[]),Vu[_].push({name:d,func:h})}}),Vu[Wf(n,E).name]=[{name:"wrapper",func:n}],Mt.prototype.clone=M$,Mt.prototype.reverse=F$,Mt.prototype.value=P$,M.prototype.at=pj,M.prototype.chain=fj,M.prototype.commit=hj,M.prototype.next=gj,M.prototype.plant=bj,M.prototype.reverse=yj,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=Ej,M.prototype.first=M.prototype.head,Oc&&(M.prototype[Oc]=mj),M},Hu=h$();Ol?((Ol.exports=Hu)._=Hu,Y2._=Hu):mr._=Hu}).call(Jl)})(sm,sm.exports);var v4e=sm.exports;const el=Vi(v4e);function uo(e,t){const n=el.cloneDeep(e);for(const r in t)typeof t[r]=="function"?el.updateWith(n,r,t[r]):el.updateWith(n,r,i=>t[r]);return n}const Rc={};Rc["Requires API Key"]="#FF0000";Rc.Local="#00bb00";Rc["Open-Source"]="#0033FF";Rc.Free="#ffff00";const _4e={inputType:"number",key:"context_length",label:"Context Length",defaultValue:2048,required:!1},T4e={inputType:"number",key:"temperature",label:"Temperature",defaultValue:void 0,required:!1,min:0,max:1,step:.01},S4e={inputType:"number",key:"top_p",label:"Top-P",defaultValue:void 0,required:!1,min:0,max:1,step:.01},w4e={inputType:"number",key:"top_k",label:"Top-K",defaultValue:void 0,required:!1,min:0,max:1,step:.01},A4e={inputType:"number",key:"presence_penalty",label:"Presence Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},C4e={inputType:"number",key:"frequency_penalty",label:"Frequency Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},Da=[_4e,T4e,w4e,S4e,A4e,C4e],SN={inputType:"text",key:"server_url",label:"Server URL",placeholder:"e.g. http://localhost:8080",required:!1},sE={title:"CodeLlama Instruct",description:"A model from Meta, fine-tuned for code generation and conversation",refUrl:"",params:{title:"CodeLlama-7b-Instruct",model:"codellama:7b-instruct",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"codellama:7b-instruct",title:"CodeLlama-7b-Instruct"},"13b":{model:"codellama:13b-instruct",title:"CodeLlama-13b-Instruct"},"34b":{model:"codellama:34b-instruct",title:"CodeLlama-34b-Instruct"}}}]},lE={title:"Llama2 Chat",description:"The latest Llama model from Meta, fine-tuned for chat",refUrl:"",params:{title:"Llama2-7b-Chat",model:"llama2:7b-chat",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"llama2:7b-chat",title:"Llama2-7b-Chat"},"13b":{model:"llama2:13b-chat",title:"Llama2-13b-Chat"},"34b":{model:"llama2:34b-chat",title:"Llama2-34b-Chat"}}}]},uE={title:"WizardCoder",description:"A CodeLlama-based code generation model from WizardLM, focused on Python",refUrl:"",params:{title:"WizardCoder-7b-Python",model:"wizardcoder:7b-python",context_length:2048,template_messages:"template_alpaca_messages",prompt_templates:{edit:"alpaca_edit_prompt"}},icon:"wizardlm.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"wizardcoder:7b-python",title:"WizardCoder-7b-Python"},"13b":{model:"wizardcoder:13b-python",title:"WizardCoder-13b-Python"},"34b":{model:"wizardcoder:34b-python",title:"WizardCoder-34b-Python"}}}]},rU={title:"Phind CodeLlama (34b)",description:"A finetune of CodeLlama by Phind",params:{title:"Phind CodeLlama",model:"phind-codellama",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}}},cE={title:"Mistral (7b)",description:"A 7b parameter base model created by Mistral AI, very competent for code generation and other tasks",params:{title:"Mistral",model:"mistral",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},icon:"mistral.png"},iU={title:"SQLCoder",description:"A finetune of StarCoder by Defog.ai, focused specifically on SQL",params:{title:"SQLCoder",model:"sqlcoder",context_length:2048,template_messages:"sqlcoder_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"sqlcoder:7b",title:"SQLCoder-7b"},"13b":{model:"sqlcoder:15b",title:"SQLCoder-15b"}}}]},k4e={title:"CodeUp (13b)",description:"An open-source coding model based on Llama2",params:{title:"CodeUp",model:"codeup",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"alpaca_edit_prompt"}}},o1=[sE,lE,uE,rU,iU,cE,k4e],wN={title:"GPT-4",description:"The latest model from OpenAI",params:{model:"gpt-4",context_length:8096,api_key:"",title:"GPT-4"}},AN={title:"GPT-3.5-Turbo",description:"A faster, cheaper OpenAI model with slightly lower capabilities",params:{model:"gpt-3.5-turbo",context_length:8096,title:"GPT-3.5-Turbo",api_key:""}},x4e={"codellama:7b-instruct":"meta/codellama-7b-instruct:6527b83e01e41412db37de5110a8670e3701ee95872697481a355e05ce12af0e","codellama:13b-instruct":"meta/codellama-13b-instruct:1f01a52ff933873dff339d5fb5e1fd6f24f77456836f514fa05e91c1a42699c7","codellama:34b-instruct":"meta/codellama-34b-instruct:8281a5c610f6e88237ff3ddaf3c33b56f60809e2bdd19fbec2fda742aa18167e","llama2:7b-chat":"meta/llama-2-7b-chat:8e6975e5ed6174911a6ff3d60540dfd4844201974602551e10e9e87ab143d81e","llama2:13b-chat":"meta/llama-2-13b-chat:f4e2de70d66816a838a89eeeb621910adffb0dd0baba3976c96980970978018d"};function CN(e){return x4e[e]||e}const aU={openai:{title:"OpenAI",class:"OpenAI",description:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model",longDescription:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.",icon:"openai.png",tags:["Requires API Key"],packages:[wN,AN],collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your OpenAI API key",required:!0},...Da]},anthropic:{title:"Anthropic",class:"AnthropicLLM",description:"Claude-2 is a highly capable model with a 100k context length",icon:"anthropic.png",tags:["Requires API Key"],longDescription:"To get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.",collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your Anthropic API key",required:!0},...Da],packages:[{title:"Claude-2",description:"A highly capable model with a 100k context length",params:{model:"claude-2",context_length:1e5,title:"Claude-2"}}]},ollama:{title:"Ollama",class:"Ollama",description:"One of the fastest ways to get started with local models on Mac or Linux",longDescription:'To get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama pull `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model="codellama:7b-instruct"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.',icon:"ollama.png",tags:["Local","Open-Source"],packages:o1,collectInputFor:[...Da]},together:{title:"TogetherAI",class:"TogetherLLM",description:"Use the TogetherAI API for extremely fast streaming of open-source models",icon:"together.png",longDescription:`Together is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together: +}`;var wt=pA(function(){return Jt(F,lt+"return "+Ie).apply(n,z)});if(wt.source=Ie,j5(wt))throw wt;return wt}function IV(l){return en(l).toLowerCase()}function RV(l){return en(l).toUpperCase()}function NV(l,d,h){if(l=en(l),l&&(h||d===n))return _S(l);if(!l||!(d=Ci(d)))return l;var _=Ca(l),x=Ca(d),F=TS(_,x),z=SS(_,x)+1;return Is(_,F,z).join("")}function OV(l,d,h){if(l=en(l),l&&(h||d===n))return l.slice(0,AS(l)+1);if(!l||!(d=Ci(d)))return l;var _=Ca(l),x=SS(_,Ca(d))+1;return Is(_,0,x).join("")}function DV(l,d,h){if(l=en(l),l&&(h||d===n))return l.replace(Or,"");if(!l||!(d=Ci(d)))return l;var _=Ca(l),x=TS(_,Ca(d));return Is(_,x).join("")}function LV(l,d){var h=P,_=Q;if(Rn(d)){var x="separator"in d?d.separator:x;h="length"in d?St(d.length):h,_="omission"in d?Ci(d.omission):_}l=en(l);var F=l.length;if($u(l)){var z=Ca(l);F=z.length}if(h>=F)return l;var Z=h-zu(_);if(Z<1)return _;var ae=z?Is(z,0,Z).join(""):l.slice(0,Z);if(x===n)return ae+_;if(z&&(Z+=ae.length-Z),G5(x)){if(l.slice(Z).search(x)){var we,Ce=ae;for(x.global||(x=o5(x.source,en(Ke.exec(x))+"g")),x.lastIndex=0;we=x.exec(Ce);)var Ie=we.index;ae=ae.slice(0,Ie===n?Z:Ie)}}else if(l.indexOf(Ci(x),Z)!=Z){var Ze=ae.lastIndexOf(x);Ze>-1&&(ae=ae.slice(0,Ze))}return ae+_}function MV(l){return l=en(l),l&&Rt.test(l)?l.replace(rt,c$):l}var FV=Ku(function(l,d,h){return l+(h?" ":"")+d.toUpperCase()}),q5=fw("toUpperCase");function dA(l,d,h){return l=en(l),d=h?n:d,d===n?a$(l)?f$(l):XU(l):l.match(d)||[]}var pA=xt(function(l,d){try{return wi(l,n,d)}catch(h){return j5(h)?h:new _t(h)}}),PV=Po(function(l,d){return Xi(d,function(h){h=ao(h),Mo(l,h,z5(l[h],l))}),l});function BV(l){var d=l==null?0:l.length,h=mt();return l=d?An(l,function(_){if(typeof _[1]!="function")throw new Zi(o);return[h(_[0]),_[1]]}):[],xt(function(_){for(var x=-1;++xW)return[];var h=pe,_=Mr(l,pe);d=mt(d),l-=pe;for(var x=r5(_,d);++h0||d<0)?new Mt(h):(l<0?h=h.takeRight(-l):l&&(h=h.drop(l)),d!==n&&(d=St(d),h=d<0?h.dropRight(-d):h.take(d-l)),h)},Mt.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Mt.prototype.toArray=function(){return this.take(pe)},ro(Mt.prototype,function(l,d){var h=/^(?:filter|find|map|reject)|While$/.test(d),_=/^(?:head|last)$/.test(d),x=M[_?"take"+(d=="last"?"Right":""):d],F=_||/^find/.test(d);x&&(M.prototype[d]=function(){var z=this.__wrapped__,Z=_?[1]:arguments,ae=z instanceof Mt,we=Z[0],Ce=ae||Tt(z),Ie=function(Nt){var Bt=x.apply(M,Ss([Nt],Z));return _&&Ze?Bt[0]:Bt};Ce&&h&&typeof we=="function"&&we.length!=1&&(ae=Ce=!1);var Ze=this.__chain__,lt=!!this.__actions__.length,bt=F&&!Ze,wt=ae&&!lt;if(!F&&Ce){z=wt?z:new Mt(this);var yt=l.apply(z,Z);return yt.__actions__.push({func:Jf,args:[Ie],thisArg:n}),new Qi(yt,Ze)}return bt&&wt?l.apply(this,Z):(yt=this.thru(Ie),bt?_?yt.value()[0]:yt.value():yt)})}),Xi(["pop","push","shift","sort","splice","unshift"],function(l){var d=Af[l],h=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",_=/^(?:pop|shift)$/.test(l);M.prototype[l]=function(){var x=arguments;if(_&&!this.__chain__){var F=this.value();return d.apply(Tt(F)?F:[],x)}return this[h](function(z){return d.apply(Tt(z)?z:[],x)})}}),ro(Mt.prototype,function(l,d){var h=M[d];if(h){var _=h.name+"";an.call(Vu,_)||(Vu[_]=[]),Vu[_].push({name:d,func:h})}}),Vu[Wf(n,E).name]=[{name:"wrapper",func:n}],Mt.prototype.clone=M$,Mt.prototype.reverse=F$,Mt.prototype.value=P$,M.prototype.at=pj,M.prototype.chain=fj,M.prototype.commit=hj,M.prototype.next=gj,M.prototype.plant=bj,M.prototype.reverse=yj,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=Ej,M.prototype.first=M.prototype.head,Oc&&(M.prototype[Oc]=mj),M},Hu=h$();Ol?((Ol.exports=Hu)._=Hu,Y2._=Hu):mr._=Hu}).call(Jl)})(sm,sm.exports);var v4e=sm.exports;const el=Vi(v4e);function uo(e,t){const n=el.cloneDeep(e);for(const r in t)typeof t[r]=="function"?el.updateWith(n,r,t[r]):el.updateWith(n,r,i=>t[r]);return n}const Rc={};Rc["Requires API Key"]="#FF0000";Rc.Local="#00bb00";Rc["Open-Source"]="#0033FF";Rc.Free="#ffff00";const _4e={inputType:"number",key:"context_length",label:"Context Length",defaultValue:2048,required:!1},T4e={inputType:"number",key:"temperature",label:"Temperature",defaultValue:void 0,required:!1,min:0,max:1,step:.01},S4e={inputType:"number",key:"top_p",label:"Top-P",defaultValue:void 0,required:!1,min:0,max:1,step:.01},w4e={inputType:"number",key:"top_k",label:"Top-K",defaultValue:void 0,required:!1,min:0,max:1,step:.01},A4e={inputType:"number",key:"presence_penalty",label:"Presence Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},C4e={inputType:"number",key:"frequency_penalty",label:"Frequency Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},Da=[_4e,T4e,w4e,S4e,A4e,C4e],SN={inputType:"text",key:"server_url",label:"Server URL",placeholder:"e.g. http://localhost:8080",required:!1},sE={title:"CodeLlama Instruct",description:"A model from Meta, fine-tuned for code generation and conversation",refUrl:"",params:{title:"CodeLlama-7b-Instruct",model:"codellama:7b-instruct",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"codellama:7b-instruct",title:"CodeLlama-7b-Instruct"},"13b":{model:"codellama:13b-instruct",title:"CodeLlama-13b-Instruct"},"34b":{model:"codellama:34b-instruct",title:"CodeLlama-34b-Instruct"}}}]},lE={title:"Llama2 Chat",description:"The latest Llama model from Meta, fine-tuned for chat",refUrl:"",params:{title:"Llama2-7b-Chat",model:"llama2:7b-chat",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"llama2:7b-chat",title:"Llama2-7b-Chat"},"13b":{model:"llama2:13b-chat",title:"Llama2-13b-Chat"},"34b":{model:"llama2:34b-chat",title:"Llama2-34b-Chat"}}}]},uE={title:"WizardCoder",description:"A CodeLlama-based code generation model from WizardLM, focused on Python",refUrl:"",params:{title:"WizardCoder-7b-Python",model:"wizardcoder:7b-python",context_length:2048,template_messages:"template_alpaca_messages",prompt_templates:{edit:"alpaca_edit_prompt"}},icon:"wizardlm.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"wizardcoder:7b-python",title:"WizardCoder-7b-Python"},"13b":{model:"wizardcoder:13b-python",title:"WizardCoder-13b-Python"},"34b":{model:"wizardcoder:34b-python",title:"WizardCoder-34b-Python"}}}]},rU={title:"Phind CodeLlama (34b)",description:"A finetune of CodeLlama by Phind",params:{title:"Phind CodeLlama",model:"phind-codellama",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}}},cE={title:"Mistral (7b)",description:"A 7b parameter base model created by Mistral AI, very competent for code generation and other tasks",params:{title:"Mistral",model:"mistral",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},icon:"mistral.png"},iU={title:"SQLCoder",description:"A finetune of StarCoder by Defog.ai, focused specifically on SQL",params:{title:"SQLCoder",model:"sqlcoder",context_length:2048,template_messages:"sqlcoder_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"sqlcoder:7b",title:"SQLCoder-7b"},"13b":{model:"sqlcoder:15b",title:"SQLCoder-15b"}}}]},k4e={title:"CodeUp (13b)",description:"An open-source coding model based on Llama2",params:{title:"CodeUp",model:"codeup",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"alpaca_edit_prompt"}}},o1=[sE,lE,uE,rU,iU,cE,k4e],wN={title:"GPT-4",description:"The latest model from OpenAI",params:{model:"gpt-4",context_length:8096,api_key:"",title:"GPT-4"}},AN={title:"GPT-3.5-Turbo",description:"A faster, cheaper OpenAI model with slightly lower capabilities",params:{model:"gpt-3.5-turbo",context_length:8096,title:"GPT-3.5-Turbo",api_key:""}},x4e={"codellama:7b-instruct":"meta/codellama-7b-instruct:6527b83e01e41412db37de5110a8670e3701ee95872697481a355e05ce12af0e","codellama:13b-instruct":"meta/codellama-13b-instruct:1f01a52ff933873dff339d5fb5e1fd6f24f77456836f514fa05e91c1a42699c7","codellama:34b-instruct":"meta/codellama-34b-instruct:8281a5c610f6e88237ff3ddaf3c33b56f60809e2bdd19fbec2fda742aa18167e","llama2:7b-chat":"meta/llama-2-7b-chat:8e6975e5ed6174911a6ff3d60540dfd4844201974602551e10e9e87ab143d81e","llama2:13b-chat":"meta/llama-2-13b-chat:f4e2de70d66816a838a89eeeb621910adffb0dd0baba3976c96980970978018d"};function CN(e){return x4e[e]||e}const aU={openai:{title:"OpenAI",class:"OpenAI",description:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model",longDescription:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.",icon:"openai.png",tags:["Requires API Key"],packages:[wN,AN],collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your OpenAI API key",required:!0},...Da]},anthropic:{title:"Anthropic",class:"AnthropicLLM",description:"Claude-2 is a highly capable model with a 100k context length",icon:"anthropic.png",tags:["Requires API Key"],longDescription:"To get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.",collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your Anthropic API key",required:!0},...Da],packages:[{title:"Claude-2",description:"A highly capable model with a 100k context length",params:{model:"claude-2",context_length:1e5,title:"Claude-2"}}]},ollama:{title:"Ollama",class:"Ollama",description:"One of the fastest ways to get started with local models on Mac or Linux",longDescription:'To get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama pull `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model="codellama:7b-instruct"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.',icon:"ollama.png",tags:["Local","Open-Source"],packages:o1,collectInputFor:[...Da]},together:{title:"TogetherAI",class:"TogetherLLM",description:"Use the TogetherAI API for extremely fast streaming of open-source models",icon:"together.png",longDescription:`Together is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together: 1. Obtain an API key from [here](https://together.ai) 2. Paste below 3. Select a model preset`,tags:["Requires API Key","Open-Source"],params:{api_key:""},collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your TogetherAI API key",required:!0},...Da],packages:[uo(lE,{"dimensions[0].options":e=>el.mapValues(e,t=>el.assign({},t,{model:"togethercomputer/"+t.model.replace("llama2","llama-2").replace(":","-")}))}),uo(sE,{"dimensions[0].options":e=>el.mapValues(e,t=>el.assign({},t,{model:"togethercomputer/"+t.model.replace("codellama","CodeLlama").replace(":","-").replace("instruct","Instruct")}))}),uo(uE,{"params.model":"WizardLM/WizardCoder-15B-V1.0","params.title":"WizardCoder-15b","dimensions[0].options":{"15b":{model:"WizardLM/WizardCoder-15B-V1.0",title:"WizardCoder-15b"},"34b (Python)":{model:"WizardLM/WizardCoder-Python-34B-V1.0",title:"WizardCoder-34b-Python"}}}),uo(rU,{"params.model":"Phind/Phind-CodeLlama-34B-Python-v1"}),uo(cE,{"params.model":"mistralai/Mistral-7B-Instruct-v0.1"})].map(e=>(e.params.context_length=4096,e))},lmstudio:{title:"LM Studio",class:"GGML",description:"One of the fastest ways to get started with local models on Mac or Windows",longDescription:`LMStudio provides a professional and well-designed GUI for exploring, configuring, and serving LLMs. It is available on both Mac and Windows. To get started: diff --git a/extensions/vscode/gui/assets/index.js b/extensions/vscode/gui/assets/index.js index ed209b663..bcc6ed6e2 100644 --- a/extensions/vscode/gui/assets/index.js +++ b/extensions/vscode/gui/assets/index.js @@ -45,7 +45,7 @@ Error generating stack: `+a.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var c9=Symbol.for("react.element"),d9=Symbol.for("react.portal"),wm=Symbol.for("react.fragment"),Am=Symbol.for("react.strict_mode"),Cm=Symbol.for("react.profiler"),km=Symbol.for("react.provider"),xm=Symbol.for("react.context"),YK=Symbol.for("react.server_context"),Im=Symbol.for("react.forward_ref"),Rm=Symbol.for("react.suspense"),Nm=Symbol.for("react.suspense_list"),Om=Symbol.for("react.memo"),Dm=Symbol.for("react.lazy"),XK=Symbol.for("react.offscreen"),qD;qD=Symbol.for("react.module.reference");function _a(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case c9:switch(e=e.type,e){case wm:case Cm:case Am:case Rm:case Nm:return e;default:switch(e=e&&e.$$typeof,e){case YK:case xm:case Im:case Dm:case Om:case km:return e;default:return t}}case d9:return t}}}sn.ContextConsumer=xm;sn.ContextProvider=km;sn.Element=c9;sn.ForwardRef=Im;sn.Fragment=wm;sn.Lazy=Dm;sn.Memo=Om;sn.Portal=d9;sn.Profiler=Cm;sn.StrictMode=Am;sn.Suspense=Rm;sn.SuspenseList=Nm;sn.isAsyncMode=function(){return!1};sn.isConcurrentMode=function(){return!1};sn.isContextConsumer=function(e){return _a(e)===xm};sn.isContextProvider=function(e){return _a(e)===km};sn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===c9};sn.isForwardRef=function(e){return _a(e)===Im};sn.isFragment=function(e){return _a(e)===wm};sn.isLazy=function(e){return _a(e)===Dm};sn.isMemo=function(e){return _a(e)===Om};sn.isPortal=function(e){return _a(e)===d9};sn.isProfiler=function(e){return _a(e)===Cm};sn.isStrictMode=function(e){return _a(e)===Am};sn.isSuspense=function(e){return _a(e)===Rm};sn.isSuspenseList=function(e){return _a(e)===Nm};sn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===wm||e===Cm||e===Am||e===Rm||e===Nm||e===XK||typeof e=="object"&&e!==null&&(e.$$typeof===Dm||e.$$typeof===Om||e.$$typeof===km||e.$$typeof===xm||e.$$typeof===Im||e.$$typeof===qD||e.getModuleId!==void 0)};sn.typeOf=_a;WD.exports=sn;var p9=WD.exports;const ZK=Vi(p9);function QK(e){function t(le,L,ie,Se,X){for(var ke=0,te=0,Me=0,Re=0,Ze,We,dt=0,ot=0,je,pt=je=Ze=0,U=0,re=0,de=0,xe=0,ye=ie.length,Te=ye-1,Le,ze="",Ye="",jt="",ue="",Ee;UZe)&&(xe=(ze=ze.replace(" ",":")).length),0Se&&(Se=(L=L.trim()).charCodeAt(0)),Se){case 38:return L.replace(E,"$1"+le.trim());case 58:return le.trim()+L.replace(E,"$1"+le.trim());default:if(0<1*ie&&0te.charCodeAt(8))break;case 115:X=X.replace(te,"-webkit-"+te)+";"+X;break;case 207:case 102:X=X.replace(te,"-webkit-"+(102ie.charCodeAt(0)&&(ie=ie.trim()),pe=ie,ie=[pe],0Ye)&&(xe=(ze=ze.replace(" ",":")).length),0Se&&(Se=(L=L.trim()).charCodeAt(0)),Se){case 38:return L.replace(E,"$1"+le.trim());case 58:return le.trim()+L.replace(E,"$1"+le.trim());default:if(0<1*ie&&0te.charCodeAt(8))break;case 115:X=X.replace(te,"-webkit-"+te)+";"+X;break;case 207:case 102:X=X.replace(te,"-webkit-"+(102ie.charCodeAt(0)&&(ie=ie.trim()),pe=ie,ie=[pe],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var yY=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,i=0;i=this.groupSizes.length){for(var i=this.groupSizes,a=i.length,o=a;n>=o;)(o<<=1)<0&&Bp(16,""+n);this.groupSizes=new Uint32Array(o),this.groupSizes.set(i),this.length=o;for(var s=a;s=this.length||this.groupSizes[n]===0)return r;for(var i=this.groupSizes[n],a=this.indexOfGroup(n),o=a+i,s=a;s=Pd&&(Pd=t+1),Ch.set(e,t),wg.set(t,e)},_Y="style["+rc+'][data-styled-version="5.3.11"]',TY=new RegExp("^"+rc+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),SY=function(e,t,n){for(var r,i=n.split(","),a=0,o=i.length;a=0;c--){var p=u[c];if(p&&p.nodeType===1&&p.hasAttribute(rc))return p}}(n),a=i!==void 0?i.nextSibling:null;r.setAttribute(rc,"active"),r.setAttribute("data-styled-version","5.3.11");var o=AY();return o&&r.setAttribute("nonce",o),n.insertBefore(r,a),r},CY=function(){function e(n){var r=this.element=QD(n);r.appendChild(document.createTextNode("")),this.sheet=function(i){if(i.sheet)return i.sheet;for(var a=document.styleSheets,o=0,s=a.length;o=0){var i=document.createTextNode(r),a=this.nodes[n];return this.element.insertBefore(i,a||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n0&&(f+=m+",")}),a+=""+c+p+'{content:"'+f+`"}/*!sc*/ -`}}}return a}(this)},e}(),RY=/(a)(d)/gi,NC=function(e){return String.fromCharCode(e+(e>25?39:97))};function qb(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=NC(t%52)+n;return(NC(t%52)+n).replace(RY,"$1-$2")}var A1=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},eL=function(e){return A1(5381,e)};function NY(e){for(var t=0;t>>0);if(!n.hasNameForId(i,s)){var u=r(o,"."+s,void 0,i);n.insertRules(i,s,u)}a.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,p=A1(this.baseHash,r.hash),f="",m=0;m>>0);if(!n.hasNameForId(i,T)){var E=r(f,"."+T,void 0,i);n.insertRules(i,T,E)}a.push(T)}}return a.join(" ")},e}(),LY=/^\s*\/\/.*$/gm,MY=[":","[",".","#"];function FY(e){var t,n,r,i,a=e===void 0?ul:e,o=a.options,s=o===void 0?ul:o,u=a.plugins,c=u===void 0?Sg:u,p=new QK(s),f=[],m=function(y){function T(E){if(E)try{y(E+"}")}catch{}}return function(E,v,w,A,R,k,N,B,q,P){switch(E){case 1:if(q===0&&v.charCodeAt(0)===64)return y(v+";"),"";break;case 2:if(B===0)return v+"/*|*/";break;case 3:switch(B){case 102:case 112:return y(w[0]+v),"";default:return v+(P===0?"/*|*/":"")}case-2:v.split("/*|*/}").forEach(T)}}}(function(y){f.push(y)}),g=function(y,T,E){return T===0&&MY.indexOf(E[n.length])!==-1||E.match(i)?y:"."+t};function b(y,T,E,v){v===void 0&&(v="&");var w=y.replace(LY,""),A=T&&E?E+" "+T+" { "+w+" }":w;return t=v,n=T,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),p(E||!T?"":T,A)}return p.use([].concat(c,[function(y,T,E){y===2&&E.length&&E[0].lastIndexOf(n)>0&&(E[0]=E[0].replace(r,g))},m,function(y){if(y===-2){var T=f;return f=[],T}}])),b.hash=c.length?c.reduce(function(y,T){return T.name||Bp(15),A1(y,T.name)},5381).toString():"",b}var tL=st.createContext();tL.Consumer;var nL=st.createContext(),PY=(nL.Consumer,new JD),Kb=FY();function BY(){return C.useContext(tL)||PY}function UY(){return C.useContext(nL)||Kb}var rL=function(){function e(t,n){var r=this;this.inject=function(i,a){a===void 0&&(a=Kb);var o=r.name+a.hash;i.hasNameForId(r.id,o)||i.insertRules(r.id,o,a(r.rules,o,"@keyframes"))},this.toString=function(){return Bp(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=Kb),this.name+t.hash},e}(),$Y=/([A-Z])/,zY=/([A-Z])/g,HY=/^ms-/,jY=function(e){return"-"+e.toLowerCase()};function OC(e){return $Y.test(e)?e.replace(zY,jY).replace(HY,"-ms-"):e}var DC=function(e){return e==null||e===!1||e===""};function ic(e,t,n,r){if(Array.isArray(e)){for(var i,a=[],o=0,s=e.length;o1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,WY=/(^-|-$)/g;function C3(e){return e.replace(VY,"-").replace(WY,"")}var aL=function(e){return qb(eL(e)>>>0)};function A0(e){return typeof e=="string"&&!0}var Yb=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},qY=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function KY(e,t,n){var r=e[n];Yb(t)&&Yb(r)?oL(r,t):e[n]=t}function oL(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(P[B]=k[B]);return P}(t,["componentId"]),R=w&&w+"-"+(A0(v)?v:C3(IC(v)));return lL(v,is({},A,{attrs:m,componentId:R}),n)},Object.defineProperty(b,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(v){this._foldedDefaultProps=r?oL({},e.defaultProps,v):v}}),Object.defineProperty(b,"toString",{value:function(){return"."+b.styledComponentId}}),i&&mY(b,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),b}var Xb=function(e){return function t(n,r,i){if(i===void 0&&(i=ul),!p9.isValidElementType(r))return Bp(1,String(r));var a=function(){return n(r,i,iL.apply(void 0,arguments))};return a.withConfig=function(o){return t(n,r,is({},i,{},o))},a.attrs=function(o){return t(n,r,is({},i,{attrs:Array.prototype.concat(i.attrs,o).filter(Boolean)}))},a}(lL,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Xb[e]=Xb(e)});function Gm(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r25?39:97))};function qb(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=NC(t%52)+n;return(NC(t%52)+n).replace(RY,"$1-$2")}var A1=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},eL=function(e){return A1(5381,e)};function NY(e){for(var t=0;t>>0);if(!n.hasNameForId(i,s)){var u=r(o,"."+s,void 0,i);n.insertRules(i,s,u)}a.push(s),this.staticRulesId=s}else{for(var c=this.rules.length,p=A1(this.baseHash,r.hash),f="",m=0;m>>0);if(!n.hasNameForId(i,T)){var E=r(f,"."+T,void 0,i);n.insertRules(i,T,E)}a.push(T)}}return a.join(" ")},e}(),LY=/^\s*\/\/.*$/gm,MY=[":","[",".","#"];function FY(e){var t,n,r,i,a=e===void 0?ul:e,o=a.options,s=o===void 0?ul:o,u=a.plugins,c=u===void 0?Sg:u,p=new QK(s),f=[],m=function(y){function T(E){if(E)try{y(E+"}")}catch{}}return function(E,v,w,A,R,k,N,B,q,P){switch(E){case 1:if(q===0&&v.charCodeAt(0)===64)return y(v+";"),"";break;case 2:if(B===0)return v+"/*|*/";break;case 3:switch(B){case 102:case 112:return y(w[0]+v),"";default:return v+(P===0?"/*|*/":"")}case-2:v.split("/*|*/}").forEach(T)}}}(function(y){f.push(y)}),g=function(y,T,E){return T===0&&MY.indexOf(E[n.length])!==-1||E.match(i)?y:"."+t};function b(y,T,E,v){v===void 0&&(v="&");var w=y.replace(LY,""),A=T&&E?E+" "+T+" { "+w+" }":w;return t=v,n=T,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),p(E||!T?"":T,A)}return p.use([].concat(c,[function(y,T,E){y===2&&E.length&&E[0].lastIndexOf(n)>0&&(E[0]=E[0].replace(r,g))},m,function(y){if(y===-2){var T=f;return f=[],T}}])),b.hash=c.length?c.reduce(function(y,T){return T.name||Bp(15),A1(y,T.name)},5381).toString():"",b}var tL=st.createContext();tL.Consumer;var nL=st.createContext(),PY=(nL.Consumer,new JD),Kb=FY();function BY(){return C.useContext(tL)||PY}function UY(){return C.useContext(nL)||Kb}var rL=function(){function e(t,n){var r=this;this.inject=function(i,a){a===void 0&&(a=Kb);var o=r.name+a.hash;i.hasNameForId(r.id,o)||i.insertRules(r.id,o,a(r.rules,o,"@keyframes"))},this.toString=function(){return Bp(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=Kb),this.name+t.hash},e}(),$Y=/([A-Z])/,zY=/([A-Z])/g,HY=/^ms-/,jY=function(e){return"-"+e.toLowerCase()};function OC(e){return $Y.test(e)?e.replace(zY,jY).replace(HY,"-ms-"):e}var DC=function(e){return e==null||e===!1||e===""};function ic(e,t,n,r){if(Array.isArray(e)){for(var i,a=[],o=0,s=e.length;o1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,WY=/(^-|-$)/g;function C3(e){return e.replace(VY,"-").replace(WY,"")}var aL=function(e){return qb(eL(e)>>>0)};function A0(e){return typeof e=="string"&&!0}var Yb=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},qY=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function KY(e,t,n){var r=e[n];Yb(t)&&Yb(r)?oL(r,t):e[n]=t}function oL(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(P[B]=k[B]);return P}(t,["componentId"]),R=w&&w+"-"+(A0(v)?v:C3(IC(v)));return lL(v,is({},A,{attrs:m,componentId:R}),n)},Object.defineProperty(b,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(v){this._foldedDefaultProps=r?oL({},e.defaultProps,v):v}}),Object.defineProperty(b,"toString",{value:function(){return"."+b.styledComponentId}}),i&&mY(b,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),b}var Xb=function(e){return function t(n,r,i){if(i===void 0&&(i=ul),!p9.isValidElementType(r))return Bp(1,String(r));var a=function(){return n(r,i,iL.apply(void 0,arguments))};return a.withConfig=function(o){return t(n,r,is({},i,{},o))},a.attrs=function(o){return t(n,r,is({},i,{attrs:Array.prototype.concat(i.attrs,o).filter(Boolean)}))},a}(lL,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Xb[e]=Xb(e)});function Gm(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r"u"||zC[n]||n==="core"&&typeof process<"u"&&(!((i=process==null?void 0:process.env)===null||i===void 0)&&i.REACT_TOOLTIP_DISABLE_CORE_STYLES)||n!=="base"&&typeof process<"u"&&(!((a=process==null?void 0:process.env)===null||a===void 0)&&a.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;n==="core"&&(t=AX),r||(r={});const{insertAt:o}=r;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const s=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.id=t,u.type="text/css",o==="top"&&s.firstChild?s.insertBefore(u,s.firstChild):s.appendChild(u),u.styleSheet?u.styleSheet.cssText=e:u.appendChild(document.createTextNode(e)),zC[n]=!0}const jC=(e,t,n)=>{let r=null;return function(...i){const a=()=>{r=null,n||e.apply(this,i)};n&&!r&&(e.apply(this,i),r=setTimeout(a,t)),n||(r&&clearTimeout(r),r=setTimeout(a,t))}},kX="DEFAULT_TOOLTIP_ID",xX={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},IX=C.createContext({getTooltipData:()=>xX});function TL(e=kX){return C.useContext(IX).getTooltipData(e)}const RX=typeof window<"u"?C.useLayoutEffect:C.useEffect,NX=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some(n=>{const r=t.getPropertyValue(n);return r==="auto"||r==="scroll"})},GC=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(NX(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},VC=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:i=10,strategy:a="absolute",middlewares:o=[sX(Number(i)),aX(),lX({padding:5})],border:s})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(t===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const u=o;return n?(u.push(iX({element:n,padding:5})),$C(e,t,{placement:r,strategy:a,middleware:u}).then(({x:c,y:p,placement:f,middlewareData:m})=>{var g,b;const y={left:`${c}px`,top:`${p}px`,border:s},{x:T,y:E}=(g=m.arrow)!==null&&g!==void 0?g:{x:0,y:0},v=(b={top:"bottom",right:"left",bottom:"top",left:"right"}[f.split("-")[0]])!==null&&b!==void 0?b:"bottom",w=s&&{top:{borderBottom:s,borderRight:s},right:{borderBottom:s,borderLeft:s},bottom:{borderTop:s,borderLeft:s},left:{borderTop:s,borderRight:s}}[f.split("-")[0]];let A=0;if(s){const R=`${s}`.match(/(\d+)px/);A=R!=null&&R[1]?Number(R[1]):1}return{tooltipStyles:y,tooltipArrowStyles:{left:T!=null?`${T}px`:"",top:E!=null?`${E}px`:"",right:"",bottom:"",...w,[v]:`-${4+A}px`},place:f}})):$C(e,t,{placement:"bottom",strategy:a,middleware:u}).then(({x:c,y:p,placement:f})=>({tooltipStyles:{left:`${c}px`,top:`${p}px`},tooltipArrowStyles:{},place:f}))};var OX="core-styles-module_tooltip__3vRRp",DX="core-styles-module_fixed__pcSol",LX="core-styles-module_arrow__cvMwQ",MX="core-styles-module_noArrow__xock6",FX="core-styles-module_clickable__ZuTTB",PX="core-styles-module_show__Nt9eE",x3={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const BX=({id:e,className:t,classNameArrow:n,variant:r="dark",anchorId:i,anchorSelect:a,place:o="top",offset:s=10,events:u=["hover"],openOnClick:c=!1,positionStrategy:p="absolute",middlewares:f,wrapper:m,delayShow:g=0,delayHide:b=0,float:y=!1,hidden:T=!1,noArrow:E=!1,clickable:v=!1,closeOnEsc:w=!1,closeOnScroll:A=!1,closeOnResize:R=!1,style:k,position:N,afterShow:B,afterHide:q,content:P,contentWrapperRef:Q,isOpen:$,setIsOpen:oe,activeAnchor:fe,setActiveAnchor:ce,border:De,opacity:H})=>{const W=C.useRef(null),se=C.useRef(null),D=C.useRef(null),pe=C.useRef(null),[le,L]=C.useState(o),[ie,Se]=C.useState({}),[X,ke]=C.useState({}),[te,Me]=C.useState(!1),[Re,Ze]=C.useState(!1),We=C.useRef(!1),dt=C.useRef(null),{anchorRefs:ot,setActiveAnchor:je}=TL(e),pt=C.useRef(!1),[U,re]=C.useState([]),de=C.useRef(!1),xe=c||u.includes("click");RX(()=>(de.current=!0,()=>{de.current=!1}),[]),C.useEffect(()=>{if(!te){const ge=setTimeout(()=>{Ze(!1)},150);return()=>{clearTimeout(ge)}}return()=>null},[te]);const ye=ge=>{de.current&&(ge&&Ze(!0),setTimeout(()=>{de.current&&(oe==null||oe(ge),$===void 0&&Me(ge))},10))};C.useEffect(()=>{if($===void 0)return()=>null;$&&Ze(!0);const ge=setTimeout(()=>{Me($)},10);return()=>{clearTimeout(ge)}},[$]),C.useEffect(()=>{te!==We.current&&(We.current=te,te?B==null||B():q==null||q())},[te]);const Te=(ge=b)=>{pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>{pt.current||ye(!1)},ge)},Le=ge=>{var G;if(!ge)return;const K=(G=ge.currentTarget)!==null&&G!==void 0?G:ge.target;if(!(K!=null&&K.isConnected))return ce(null),void je({current:null});g?(D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{ye(!0)},g)):ye(!0),ce(K),je({current:K}),pe.current&&clearTimeout(pe.current)},ze=()=>{v?Te(b||100):b?Te():ye(!1),D.current&&clearTimeout(D.current)},Ye=({x:ge,y:G})=>{VC({place:o,offset:s,elementReference:{getBoundingClientRect:()=>({x:ge,y:G,width:0,height:0,top:G,left:ge,right:ge,bottom:G})},tooltipReference:W.current,tooltipArrowReference:se.current,strategy:p,middlewares:f,border:De}).then(K=>{Object.keys(K.tooltipStyles).length&&Se(K.tooltipStyles),Object.keys(K.tooltipArrowStyles).length&&ke(K.tooltipArrowStyles),L(K.place)})},jt=ge=>{if(!ge)return;const G=ge,K={x:G.clientX,y:G.clientY};Ye(K),dt.current=K},ue=ge=>{Le(ge),b&&Te()},Ee=ge=>{var G;[document.querySelector(`[id='${i}']`),...U].some(K=>K==null?void 0:K.contains(ge.target))||!((G=W.current)===null||G===void 0)&&G.contains(ge.target)||(ye(!1),D.current&&clearTimeout(D.current))},qe=jC(Le,50,!0),j=jC(ze,50,!0);C.useEffect(()=>{var ge,G;const K=new Set(ot);U.forEach(Qt=>{K.add({current:Qt})});const ne=document.querySelector(`[id='${i}']`);ne&&K.add({current:ne});const ve=()=>{ye(!1)},Qe=GC(fe),Fe=GC(W.current);A&&(window.addEventListener("scroll",ve),Qe==null||Qe.addEventListener("scroll",ve),Fe==null||Fe.addEventListener("scroll",ve)),R&&window.addEventListener("resize",ve);const at=Qt=>{Qt.key==="Escape"&&ye(!1)};w&&window.addEventListener("keydown",at);const rt=[];xe?(window.addEventListener("click",Ee),rt.push({event:"click",listener:ue})):(rt.push({event:"mouseenter",listener:qe},{event:"mouseleave",listener:j},{event:"focus",listener:qe},{event:"blur",listener:j}),y&&rt.push({event:"mousemove",listener:jt}));const Je=()=>{pt.current=!0},Rt=()=>{pt.current=!1,ze()};return v&&!xe&&((ge=W.current)===null||ge===void 0||ge.addEventListener("mouseenter",Je),(G=W.current)===null||G===void 0||G.addEventListener("mouseleave",Rt)),rt.forEach(({event:Qt,listener:kt})=>{K.forEach(rn=>{var Xt;(Xt=rn.current)===null||Xt===void 0||Xt.addEventListener(Qt,kt)})}),()=>{var Qt,kt;A&&(window.removeEventListener("scroll",ve),Qe==null||Qe.removeEventListener("scroll",ve),Fe==null||Fe.removeEventListener("scroll",ve)),R&&window.removeEventListener("resize",ve),xe&&window.removeEventListener("click",Ee),w&&window.removeEventListener("keydown",at),v&&!xe&&((Qt=W.current)===null||Qt===void 0||Qt.removeEventListener("mouseenter",Je),(kt=W.current)===null||kt===void 0||kt.removeEventListener("mouseleave",Rt)),rt.forEach(({event:rn,listener:Xt})=>{K.forEach(Wr=>{var qr;(qr=Wr.current)===null||qr===void 0||qr.removeEventListener(rn,Xt)})})}},[Re,ot,U,w,u]),C.useEffect(()=>{let ge=a??"";!ge&&e&&(ge=`[data-tooltip-id='${e}']`);const G=new MutationObserver(K=>{const ne=[];K.forEach(ve=>{if(ve.type==="attributes"&&ve.attributeName==="data-tooltip-id"&&ve.target.getAttribute("data-tooltip-id")===e&&ne.push(ve.target),ve.type==="childList"&&(fe&&[...ve.removedNodes].some(Qe=>{var Fe;return!!(!((Fe=Qe==null?void 0:Qe.contains)===null||Fe===void 0)&&Fe.call(Qe,fe))&&(Ze(!1),ye(!1),ce(null),D.current&&clearTimeout(D.current),pe.current&&clearTimeout(pe.current),!0)}),ge))try{const Qe=[...ve.addedNodes].filter(Fe=>Fe.nodeType===1);ne.push(...Qe.filter(Fe=>Fe.matches(ge))),ne.push(...Qe.flatMap(Fe=>[...Fe.querySelectorAll(ge)]))}catch{}}),ne.length&&re(ve=>[...ve,...ne])});return G.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{G.disconnect()}},[e,a,fe]);const me=()=>{N?Ye(N):y?dt.current&&Ye(dt.current):VC({place:o,offset:s,elementReference:fe,tooltipReference:W.current,tooltipArrowReference:se.current,strategy:p,middlewares:f,border:De}).then(ge=>{de.current&&(Object.keys(ge.tooltipStyles).length&&Se(ge.tooltipStyles),Object.keys(ge.tooltipArrowStyles).length&&ke(ge.tooltipArrowStyles),L(ge.place))})};C.useEffect(()=>{me()},[te,fe,P,k,o,s,p,N]),C.useEffect(()=>{if(!(Q!=null&&Q.current))return()=>null;const ge=new ResizeObserver(()=>{me()});return ge.observe(Q.current),()=>{ge.disconnect()}},[P,Q==null?void 0:Q.current]),C.useEffect(()=>{var ge;const G=document.querySelector(`[id='${i}']`),K=[...U,G];fe&&K.includes(fe)||ce((ge=U[0])!==null&&ge!==void 0?ge:G)},[i,U,fe]),C.useEffect(()=>()=>{D.current&&clearTimeout(D.current),pe.current&&clearTimeout(pe.current)},[]),C.useEffect(()=>{let ge=a;if(!ge&&e&&(ge=`[data-tooltip-id='${e}']`),ge)try{const G=Array.from(document.querySelectorAll(ge));re(G)}catch{re([])}},[e,a]);const Ve=!T&&P&&te&&Object.keys(ie).length>0;return Re?st.createElement(m,{id:e,role:"tooltip",className:MC("react-tooltip",OX,x3.tooltip,x3[r],t,`react-tooltip__place-${le}`,{[PX]:Ve,[DX]:p==="fixed",[FX]:v}),style:{...k,...ie,opacity:H!==void 0&&Ve?H:void 0},ref:W},P,st.createElement(m,{className:MC("react-tooltip-arrow",LX,x3.arrow,n,{[MX]:E}),style:X,ref:se})):null},UX=({content:e})=>st.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),$X=({id:e,anchorId:t,anchorSelect:n,content:r,html:i,render:a,className:o,classNameArrow:s,variant:u="dark",place:c="top",offset:p=10,wrapper:f="div",children:m=null,events:g=["hover"],openOnClick:b=!1,positionStrategy:y="absolute",middlewares:T,delayShow:E=0,delayHide:v=0,float:w=!1,hidden:A=!1,noArrow:R=!1,clickable:k=!1,closeOnEsc:N=!1,closeOnScroll:B=!1,closeOnResize:q=!1,style:P,position:Q,isOpen:$,disableStyleInjection:oe=!1,border:fe,opacity:ce,setIsOpen:De,afterShow:H,afterHide:W})=>{const[se,D]=C.useState(r),[pe,le]=C.useState(i),[L,ie]=C.useState(c),[Se,X]=C.useState(u),[ke,te]=C.useState(p),[Me,Re]=C.useState(E),[Ze,We]=C.useState(v),[dt,ot]=C.useState(w),[je,pt]=C.useState(A),[U,re]=C.useState(f),[de,xe]=C.useState(g),[ye,Te]=C.useState(y),[Le,ze]=C.useState(null),Ye=C.useRef(oe),{anchorRefs:jt,activeAnchor:ue}=TL(e),Ee=ge=>ge==null?void 0:ge.getAttributeNames().reduce((G,K)=>{var ne;return K.startsWith("data-tooltip-")&&(G[K.replace(/^data-tooltip-/,"")]=(ne=ge==null?void 0:ge.getAttribute(K))!==null&&ne!==void 0?ne:null),G},{}),qe=ge=>{const G={place:K=>{var ne;ie((ne=K)!==null&&ne!==void 0?ne:c)},content:K=>{D(K??r)},html:K=>{le(K??i)},variant:K=>{var ne;X((ne=K)!==null&&ne!==void 0?ne:u)},offset:K=>{te(K===null?p:Number(K))},wrapper:K=>{var ne;re((ne=K)!==null&&ne!==void 0?ne:f)},events:K=>{const ne=K==null?void 0:K.split(" ");xe(ne??g)},"position-strategy":K=>{var ne;Te((ne=K)!==null&&ne!==void 0?ne:y)},"delay-show":K=>{Re(K===null?E:Number(K))},"delay-hide":K=>{We(K===null?v:Number(K))},float:K=>{ot(K===null?w:K==="true")},hidden:K=>{pt(K===null?A:K==="true")}};Object.values(G).forEach(K=>K(null)),Object.entries(ge).forEach(([K,ne])=>{var ve;(ve=G[K])===null||ve===void 0||ve.call(G,ne)})};C.useEffect(()=>{D(r)},[r]),C.useEffect(()=>{le(i)},[i]),C.useEffect(()=>{ie(c)},[c]),C.useEffect(()=>{X(u)},[u]),C.useEffect(()=>{te(p)},[p]),C.useEffect(()=>{Re(E)},[E]),C.useEffect(()=>{We(v)},[v]),C.useEffect(()=>{ot(w)},[w]),C.useEffect(()=>{pt(A)},[A]),C.useEffect(()=>{Te(y)},[y]),C.useEffect(()=>{Ye.current!==oe&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")},[oe]),C.useEffect(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:oe==="core",disableBase:oe}}))},[]),C.useEffect(()=>{var ge;const G=new Set(jt);let K=n;if(!K&&e&&(K=`[data-tooltip-id='${e}']`),K)try{document.querySelectorAll(K).forEach(at=>{G.add({current:at})})}catch{console.warn(`[react-tooltip] "${K}" is not a valid CSS selector`)}const ne=document.querySelector(`[id='${t}']`);if(ne&&G.add({current:ne}),!G.size)return()=>null;const ve=(ge=Le??ne)!==null&&ge!==void 0?ge:ue.current,Qe=new MutationObserver(at=>{at.forEach(rt=>{var Je;if(!ve||rt.type!=="attributes"||!(!((Je=rt.attributeName)===null||Je===void 0)&&Je.startsWith("data-tooltip-")))return;const Rt=Ee(ve);qe(Rt)})}),Fe={attributes:!0,childList:!1,subtree:!1};if(ve){const at=Ee(ve);qe(at),Qe.observe(ve,Fe)}return()=>{Qe.disconnect()}},[jt,ue,Le,t,n]),C.useEffect(()=>{P!=null&&P.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),fe&&!CSS.supports("border",`${fe}`)&&console.warn(`[react-tooltip] "${fe}" is not a valid \`border\`.`),P!=null&&P.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),ce&&!CSS.supports("opacity",`${ce}`)&&console.warn(`[react-tooltip] "${ce}" is not a valid \`opacity\`.`)},[]);let j=m;const me=C.useRef(null);if(a){const ge=a({content:se??null,activeAnchor:Le});j=ge?st.createElement("div",{ref:me,className:"react-tooltip-content-wrapper"},ge):null}else se&&(j=se);pe&&(j=st.createElement(UX,{content:pe}));const Ve={id:e,anchorId:t,anchorSelect:n,className:o,classNameArrow:s,content:j,contentWrapperRef:me,place:L,variant:Se,offset:ke,wrapper:U,events:de,openOnClick:b,positionStrategy:ye,middlewares:T,delayShow:Me,delayHide:Ze,float:dt,hidden:je,noArrow:R,clickable:k,closeOnEsc:N,closeOnScroll:B,closeOnResize:q,style:P,position:Q,isOpen:$,border:fe,opacity:ce,setIsOpen:De,afterShow:H,afterHide:W,activeAnchor:Le,setActiveAnchor:ge=>ze(ge)};return st.createElement(BX,{...Ve})};typeof window<"u"&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||HC({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9}.core-styles-module_tooltip__3vRRp{visibility:hidden;position:absolute;top:0;left:0;pointer-events:none;opacity:0;transition:opacity 0.3s ease-out;will-change:opacity,visibility}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{visibility:visible;opacity:var(--rt-opacity)}",type:"core"}),e.detail.disableBase||HC({css:` +*/const AX="react-tooltip-core-styles",CX="react-tooltip-base-styles",zC={core:!1,base:!1};function HC({css:e,id:t=CX,type:n="base",ref:r}){var i,a;if(!e||typeof document>"u"||zC[n]||n==="core"&&typeof process<"u"&&(!((i=process==null?void 0:process.env)===null||i===void 0)&&i.REACT_TOOLTIP_DISABLE_CORE_STYLES)||n!=="base"&&typeof process<"u"&&(!((a=process==null?void 0:process.env)===null||a===void 0)&&a.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;n==="core"&&(t=AX),r||(r={});const{insertAt:o}=r;if(document.getElementById(t))return void console.warn(`[react-tooltip] Element with id '${t}' already exists. Call \`removeStyle()\` first`);const s=document.head||document.getElementsByTagName("head")[0],u=document.createElement("style");u.id=t,u.type="text/css",o==="top"&&s.firstChild?s.insertBefore(u,s.firstChild):s.appendChild(u),u.styleSheet?u.styleSheet.cssText=e:u.appendChild(document.createTextNode(e)),zC[n]=!0}const jC=(e,t,n)=>{let r=null;return function(...i){const a=()=>{r=null,n||e.apply(this,i)};n&&!r&&(e.apply(this,i),r=setTimeout(a,t)),n||(r&&clearTimeout(r),r=setTimeout(a,t))}},kX="DEFAULT_TOOLTIP_ID",xX={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},IX=C.createContext({getTooltipData:()=>xX});function TL(e=kX){return C.useContext(IX).getTooltipData(e)}const RX=typeof window<"u"?C.useLayoutEffect:C.useEffect,NX=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some(n=>{const r=t.getPropertyValue(n);return r==="auto"||r==="scroll"})},GC=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(NX(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},VC=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:i=10,strategy:a="absolute",middlewares:o=[sX(Number(i)),aX(),lX({padding:5})],border:s})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};if(t===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:r};const u=o;return n?(u.push(iX({element:n,padding:5})),$C(e,t,{placement:r,strategy:a,middleware:u}).then(({x:c,y:p,placement:f,middlewareData:m})=>{var g,b;const y={left:`${c}px`,top:`${p}px`,border:s},{x:T,y:E}=(g=m.arrow)!==null&&g!==void 0?g:{x:0,y:0},v=(b={top:"bottom",right:"left",bottom:"top",left:"right"}[f.split("-")[0]])!==null&&b!==void 0?b:"bottom",w=s&&{top:{borderBottom:s,borderRight:s},right:{borderBottom:s,borderLeft:s},bottom:{borderTop:s,borderLeft:s},left:{borderTop:s,borderRight:s}}[f.split("-")[0]];let A=0;if(s){const R=`${s}`.match(/(\d+)px/);A=R!=null&&R[1]?Number(R[1]):1}return{tooltipStyles:y,tooltipArrowStyles:{left:T!=null?`${T}px`:"",top:E!=null?`${E}px`:"",right:"",bottom:"",...w,[v]:`-${4+A}px`},place:f}})):$C(e,t,{placement:"bottom",strategy:a,middleware:u}).then(({x:c,y:p,placement:f})=>({tooltipStyles:{left:`${c}px`,top:`${p}px`},tooltipArrowStyles:{},place:f}))};var OX="core-styles-module_tooltip__3vRRp",DX="core-styles-module_fixed__pcSol",LX="core-styles-module_arrow__cvMwQ",MX="core-styles-module_noArrow__xock6",FX="core-styles-module_clickable__ZuTTB",PX="core-styles-module_show__Nt9eE",x3={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const BX=({id:e,className:t,classNameArrow:n,variant:r="dark",anchorId:i,anchorSelect:a,place:o="top",offset:s=10,events:u=["hover"],openOnClick:c=!1,positionStrategy:p="absolute",middlewares:f,wrapper:m,delayShow:g=0,delayHide:b=0,float:y=!1,hidden:T=!1,noArrow:E=!1,clickable:v=!1,closeOnEsc:w=!1,closeOnScroll:A=!1,closeOnResize:R=!1,style:k,position:N,afterShow:B,afterHide:q,content:P,contentWrapperRef:Q,isOpen:$,setIsOpen:oe,activeAnchor:fe,setActiveAnchor:ce,border:De,opacity:H})=>{const W=C.useRef(null),se=C.useRef(null),D=C.useRef(null),pe=C.useRef(null),[le,L]=C.useState(o),[ie,Se]=C.useState({}),[X,ke]=C.useState({}),[te,Me]=C.useState(!1),[Re,Ye]=C.useState(!1),We=C.useRef(!1),dt=C.useRef(null),{anchorRefs:ot,setActiveAnchor:je}=TL(e),pt=C.useRef(!1),[U,re]=C.useState([]),de=C.useRef(!1),xe=c||u.includes("click");RX(()=>(de.current=!0,()=>{de.current=!1}),[]),C.useEffect(()=>{if(!te){const ge=setTimeout(()=>{Ye(!1)},150);return()=>{clearTimeout(ge)}}return()=>null},[te]);const ye=ge=>{de.current&&(ge&&Ye(!0),setTimeout(()=>{de.current&&(oe==null||oe(ge),$===void 0&&Me(ge))},10))};C.useEffect(()=>{if($===void 0)return()=>null;$&&Ye(!0);const ge=setTimeout(()=>{Me($)},10);return()=>{clearTimeout(ge)}},[$]),C.useEffect(()=>{te!==We.current&&(We.current=te,te?B==null||B():q==null||q())},[te]);const Te=(ge=b)=>{pe.current&&clearTimeout(pe.current),pe.current=setTimeout(()=>{pt.current||ye(!1)},ge)},Le=ge=>{var G;if(!ge)return;const K=(G=ge.currentTarget)!==null&&G!==void 0?G:ge.target;if(!(K!=null&&K.isConnected))return ce(null),void je({current:null});g?(D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{ye(!0)},g)):ye(!0),ce(K),je({current:K}),pe.current&&clearTimeout(pe.current)},ze=()=>{v?Te(b||100):b?Te():ye(!1),D.current&&clearTimeout(D.current)},Xe=({x:ge,y:G})=>{VC({place:o,offset:s,elementReference:{getBoundingClientRect:()=>({x:ge,y:G,width:0,height:0,top:G,left:ge,right:ge,bottom:G})},tooltipReference:W.current,tooltipArrowReference:se.current,strategy:p,middlewares:f,border:De}).then(K=>{Object.keys(K.tooltipStyles).length&&Se(K.tooltipStyles),Object.keys(K.tooltipArrowStyles).length&&ke(K.tooltipArrowStyles),L(K.place)})},jt=ge=>{if(!ge)return;const G=ge,K={x:G.clientX,y:G.clientY};Xe(K),dt.current=K},ue=ge=>{Le(ge),b&&Te()},Ee=ge=>{var G;[document.querySelector(`[id='${i}']`),...U].some(K=>K==null?void 0:K.contains(ge.target))||!((G=W.current)===null||G===void 0)&&G.contains(ge.target)||(ye(!1),D.current&&clearTimeout(D.current))},qe=jC(Le,50,!0),j=jC(ze,50,!0);C.useEffect(()=>{var ge,G;const K=new Set(ot);U.forEach(Qt=>{K.add({current:Qt})});const ne=document.querySelector(`[id='${i}']`);ne&&K.add({current:ne});const ve=()=>{ye(!1)},Qe=GC(fe),Fe=GC(W.current);A&&(window.addEventListener("scroll",ve),Qe==null||Qe.addEventListener("scroll",ve),Fe==null||Fe.addEventListener("scroll",ve)),R&&window.addEventListener("resize",ve);const at=Qt=>{Qt.key==="Escape"&&ye(!1)};w&&window.addEventListener("keydown",at);const rt=[];xe?(window.addEventListener("click",Ee),rt.push({event:"click",listener:ue})):(rt.push({event:"mouseenter",listener:qe},{event:"mouseleave",listener:j},{event:"focus",listener:qe},{event:"blur",listener:j}),y&&rt.push({event:"mousemove",listener:jt}));const Je=()=>{pt.current=!0},Rt=()=>{pt.current=!1,ze()};return v&&!xe&&((ge=W.current)===null||ge===void 0||ge.addEventListener("mouseenter",Je),(G=W.current)===null||G===void 0||G.addEventListener("mouseleave",Rt)),rt.forEach(({event:Qt,listener:kt})=>{K.forEach(rn=>{var Xt;(Xt=rn.current)===null||Xt===void 0||Xt.addEventListener(Qt,kt)})}),()=>{var Qt,kt;A&&(window.removeEventListener("scroll",ve),Qe==null||Qe.removeEventListener("scroll",ve),Fe==null||Fe.removeEventListener("scroll",ve)),R&&window.removeEventListener("resize",ve),xe&&window.removeEventListener("click",Ee),w&&window.removeEventListener("keydown",at),v&&!xe&&((Qt=W.current)===null||Qt===void 0||Qt.removeEventListener("mouseenter",Je),(kt=W.current)===null||kt===void 0||kt.removeEventListener("mouseleave",Rt)),rt.forEach(({event:rn,listener:Xt})=>{K.forEach(Wr=>{var qr;(qr=Wr.current)===null||qr===void 0||qr.removeEventListener(rn,Xt)})})}},[Re,ot,U,w,u]),C.useEffect(()=>{let ge=a??"";!ge&&e&&(ge=`[data-tooltip-id='${e}']`);const G=new MutationObserver(K=>{const ne=[];K.forEach(ve=>{if(ve.type==="attributes"&&ve.attributeName==="data-tooltip-id"&&ve.target.getAttribute("data-tooltip-id")===e&&ne.push(ve.target),ve.type==="childList"&&(fe&&[...ve.removedNodes].some(Qe=>{var Fe;return!!(!((Fe=Qe==null?void 0:Qe.contains)===null||Fe===void 0)&&Fe.call(Qe,fe))&&(Ye(!1),ye(!1),ce(null),D.current&&clearTimeout(D.current),pe.current&&clearTimeout(pe.current),!0)}),ge))try{const Qe=[...ve.addedNodes].filter(Fe=>Fe.nodeType===1);ne.push(...Qe.filter(Fe=>Fe.matches(ge))),ne.push(...Qe.flatMap(Fe=>[...Fe.querySelectorAll(ge)]))}catch{}}),ne.length&&re(ve=>[...ve,...ne])});return G.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"]}),()=>{G.disconnect()}},[e,a,fe]);const me=()=>{N?Xe(N):y?dt.current&&Xe(dt.current):VC({place:o,offset:s,elementReference:fe,tooltipReference:W.current,tooltipArrowReference:se.current,strategy:p,middlewares:f,border:De}).then(ge=>{de.current&&(Object.keys(ge.tooltipStyles).length&&Se(ge.tooltipStyles),Object.keys(ge.tooltipArrowStyles).length&&ke(ge.tooltipArrowStyles),L(ge.place))})};C.useEffect(()=>{me()},[te,fe,P,k,o,s,p,N]),C.useEffect(()=>{if(!(Q!=null&&Q.current))return()=>null;const ge=new ResizeObserver(()=>{me()});return ge.observe(Q.current),()=>{ge.disconnect()}},[P,Q==null?void 0:Q.current]),C.useEffect(()=>{var ge;const G=document.querySelector(`[id='${i}']`),K=[...U,G];fe&&K.includes(fe)||ce((ge=U[0])!==null&&ge!==void 0?ge:G)},[i,U,fe]),C.useEffect(()=>()=>{D.current&&clearTimeout(D.current),pe.current&&clearTimeout(pe.current)},[]),C.useEffect(()=>{let ge=a;if(!ge&&e&&(ge=`[data-tooltip-id='${e}']`),ge)try{const G=Array.from(document.querySelectorAll(ge));re(G)}catch{re([])}},[e,a]);const Ve=!T&&P&&te&&Object.keys(ie).length>0;return Re?st.createElement(m,{id:e,role:"tooltip",className:MC("react-tooltip",OX,x3.tooltip,x3[r],t,`react-tooltip__place-${le}`,{[PX]:Ve,[DX]:p==="fixed",[FX]:v}),style:{...k,...ie,opacity:H!==void 0&&Ve?H:void 0},ref:W},P,st.createElement(m,{className:MC("react-tooltip-arrow",LX,x3.arrow,n,{[MX]:E}),style:X,ref:se})):null},UX=({content:e})=>st.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),$X=({id:e,anchorId:t,anchorSelect:n,content:r,html:i,render:a,className:o,classNameArrow:s,variant:u="dark",place:c="top",offset:p=10,wrapper:f="div",children:m=null,events:g=["hover"],openOnClick:b=!1,positionStrategy:y="absolute",middlewares:T,delayShow:E=0,delayHide:v=0,float:w=!1,hidden:A=!1,noArrow:R=!1,clickable:k=!1,closeOnEsc:N=!1,closeOnScroll:B=!1,closeOnResize:q=!1,style:P,position:Q,isOpen:$,disableStyleInjection:oe=!1,border:fe,opacity:ce,setIsOpen:De,afterShow:H,afterHide:W})=>{const[se,D]=C.useState(r),[pe,le]=C.useState(i),[L,ie]=C.useState(c),[Se,X]=C.useState(u),[ke,te]=C.useState(p),[Me,Re]=C.useState(E),[Ye,We]=C.useState(v),[dt,ot]=C.useState(w),[je,pt]=C.useState(A),[U,re]=C.useState(f),[de,xe]=C.useState(g),[ye,Te]=C.useState(y),[Le,ze]=C.useState(null),Xe=C.useRef(oe),{anchorRefs:jt,activeAnchor:ue}=TL(e),Ee=ge=>ge==null?void 0:ge.getAttributeNames().reduce((G,K)=>{var ne;return K.startsWith("data-tooltip-")&&(G[K.replace(/^data-tooltip-/,"")]=(ne=ge==null?void 0:ge.getAttribute(K))!==null&&ne!==void 0?ne:null),G},{}),qe=ge=>{const G={place:K=>{var ne;ie((ne=K)!==null&&ne!==void 0?ne:c)},content:K=>{D(K??r)},html:K=>{le(K??i)},variant:K=>{var ne;X((ne=K)!==null&&ne!==void 0?ne:u)},offset:K=>{te(K===null?p:Number(K))},wrapper:K=>{var ne;re((ne=K)!==null&&ne!==void 0?ne:f)},events:K=>{const ne=K==null?void 0:K.split(" ");xe(ne??g)},"position-strategy":K=>{var ne;Te((ne=K)!==null&&ne!==void 0?ne:y)},"delay-show":K=>{Re(K===null?E:Number(K))},"delay-hide":K=>{We(K===null?v:Number(K))},float:K=>{ot(K===null?w:K==="true")},hidden:K=>{pt(K===null?A:K==="true")}};Object.values(G).forEach(K=>K(null)),Object.entries(ge).forEach(([K,ne])=>{var ve;(ve=G[K])===null||ve===void 0||ve.call(G,ne)})};C.useEffect(()=>{D(r)},[r]),C.useEffect(()=>{le(i)},[i]),C.useEffect(()=>{ie(c)},[c]),C.useEffect(()=>{X(u)},[u]),C.useEffect(()=>{te(p)},[p]),C.useEffect(()=>{Re(E)},[E]),C.useEffect(()=>{We(v)},[v]),C.useEffect(()=>{ot(w)},[w]),C.useEffect(()=>{pt(A)},[A]),C.useEffect(()=>{Te(y)},[y]),C.useEffect(()=>{Xe.current!==oe&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")},[oe]),C.useEffect(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:oe==="core",disableBase:oe}}))},[]),C.useEffect(()=>{var ge;const G=new Set(jt);let K=n;if(!K&&e&&(K=`[data-tooltip-id='${e}']`),K)try{document.querySelectorAll(K).forEach(at=>{G.add({current:at})})}catch{console.warn(`[react-tooltip] "${K}" is not a valid CSS selector`)}const ne=document.querySelector(`[id='${t}']`);if(ne&&G.add({current:ne}),!G.size)return()=>null;const ve=(ge=Le??ne)!==null&&ge!==void 0?ge:ue.current,Qe=new MutationObserver(at=>{at.forEach(rt=>{var Je;if(!ve||rt.type!=="attributes"||!(!((Je=rt.attributeName)===null||Je===void 0)&&Je.startsWith("data-tooltip-")))return;const Rt=Ee(ve);qe(Rt)})}),Fe={attributes:!0,childList:!1,subtree:!1};if(ve){const at=Ee(ve);qe(at),Qe.observe(ve,Fe)}return()=>{Qe.disconnect()}},[jt,ue,Le,t,n]),C.useEffect(()=>{P!=null&&P.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),fe&&!CSS.supports("border",`${fe}`)&&console.warn(`[react-tooltip] "${fe}" is not a valid \`border\`.`),P!=null&&P.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),ce&&!CSS.supports("opacity",`${ce}`)&&console.warn(`[react-tooltip] "${ce}" is not a valid \`opacity\`.`)},[]);let j=m;const me=C.useRef(null);if(a){const ge=a({content:se??null,activeAnchor:Le});j=ge?st.createElement("div",{ref:me,className:"react-tooltip-content-wrapper"},ge):null}else se&&(j=se);pe&&(j=st.createElement(UX,{content:pe}));const Ve={id:e,anchorId:t,anchorSelect:n,className:o,classNameArrow:s,content:j,contentWrapperRef:me,place:L,variant:Se,offset:ke,wrapper:U,events:de,openOnClick:b,positionStrategy:ye,middlewares:T,delayShow:Me,delayHide:Ye,float:dt,hidden:je,noArrow:R,clickable:k,closeOnEsc:N,closeOnScroll:B,closeOnResize:q,style:P,position:Q,isOpen:$,border:fe,opacity:ce,setIsOpen:De,afterShow:H,afterHide:W,activeAnchor:Le,setActiveAnchor:ge=>ze(ge)};return st.createElement(BX,{...Ve})};typeof window<"u"&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||HC({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9}.core-styles-module_tooltip__3vRRp{visibility:hidden;position:absolute;top:0;left:0;pointer-events:none;opacity:0;transition:opacity 0.3s ease-out;will-change:opacity,visibility}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{visibility:visible;opacity:var(--rt-opacity)}",type:"core"}),e.detail.disableBase||HC({css:` .styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px;transform:rotate(45deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})});function Km(){const e=window.navigator.platform.toUpperCase();return e.indexOf("MAC")>=0?"mac":e.indexOf("LINUX")>=0?"linux":e.indexOf("WIN")>=0?"windows":"unknown"}function xg(e){switch(Km()){case"mac":return e.metaKey;case"linux":case"windows":return e.ctrlKey;default:return e.metaKey}}function zX(){switch(Km()){case"mac":return"⌘";case"linux":case"windows":return"^";default:return"⌘"}}function pr(){const e=localStorage.getItem("fontSize");return e?parseInt(e):14}function WC(e){switch(e.split(".").pop()){case"py":return"python";case"js":return"javascript";case"ts":return"typescript";case"java":return"java";case"go":return"go";case"rb":return"ruby";case"rs":return"rust";case"c":return"c";case"cpp":return"cpp";case"cs":return"csharp";case"php":return"php";case"scala":return"scala";case"swift":return"swift";case"kt":return"kotlin";case"md":return"markdown";case"json":return"json";case"html":return"html";case"css":return"css";case"sh":return"shell";case"yaml":return"yaml";case"toml":return"toml";case"tex":return"latex";case"sql":return"sql";default:return""}}const It="5px",Et="#646464",ha="#1bbe84",Vt="var(--vscode-list-hoverBackground, rgb(45 45 45))",Ht="var(--vscode-editor-background, rgb(30 30 30))",Yt="var(--vscode-editor-foreground, #fff)";if(typeof document<"u"){const e=localStorage.getItem("--vscode-editor-foreground"),t=localStorage.getItem("--vscode-editor-background"),n=localStorage.getItem("--vscode-list-hoverBackground");e&&document.body.style.setProperty("--vscode-editor-foreground",e),t&&document.body.style.setProperty("--vscode-editor-background",t),n&&document.body.style.setProperty("--vscode-list-hoverBackground",n)}const oc=Ge.button` padding: 10px 12px; margin: 8px 0; @@ -240,9 +240,9 @@ Error generating stack: `+a.message+` * * @author Feross Aboukhadijeh * @license MIT - */var oQ=function(t){return t!=null&&t.constructor!=null&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)};const xL=Vi(oQ);function Bd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?YC(e.position):"start"in e||"end"in e?YC(e):"line"in e||"column"in e?Jb(e):""}function Jb(e){return XC(e&&e.line)+":"+XC(e&&e.column)}function YC(e){return Jb(e&&e.start)+"-"+Jb(e&&e.end)}function XC(e){return e&&typeof e=="number"?e:1}class Ta extends Error{constructor(t,n,r){const i=[null,null];let a={start:{line:null,column:null},end:{line:null,column:null}};if(super(),typeof n=="string"&&(r=n,n=void 0),typeof r=="string"){const o=r.indexOf(":");o===-1?i[1]=r:(i[0]=r.slice(0,o),i[1]=r.slice(o+1))}n&&("type"in n||"position"in n?n.position&&(a=n.position):"start"in n||"end"in n?a=n:("line"in n||"column"in n)&&(a.start=n)),this.name=Bd(n)||"1:1",this.message=typeof t=="object"?t.message:t,this.stack="",typeof t=="object"&&t.stack&&(this.stack=t.stack),this.reason=this.message,this.fatal,this.line=a.start.line,this.column=a.start.column,this.position=a,this.source=i[0],this.ruleId=i[1],this.file,this.actual,this.expected,this.url,this.note}}Ta.prototype.file="";Ta.prototype.name="";Ta.prototype.reason="";Ta.prototype.message="";Ta.prototype.stack="";Ta.prototype.fatal=null;Ta.prototype.column=null;Ta.prototype.line=null;Ta.prototype.source=null;Ta.prototype.ruleId=null;Ta.prototype.position=null;const po={basename:sQ,dirname:lQ,extname:uQ,join:cQ,sep:"/"};function sQ(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hp(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.charCodeAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,s=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.charCodeAt(i)===t.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function lQ(e){if(Hp(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function uQ(e){Hp(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const s=e.charCodeAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function cQ(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pQ(e,t){let n="",r=0,i=-1,a=0,o=-1,s,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Hp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fQ={cwd:hQ};function hQ(){return"/"}function ey(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function gQ(e){if(typeof e=="string")e=new URL(e);else if(!ey(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return mQ(e)}function mQ(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||kh.call(t,i)},rk=function(t,n){JC&&n.name==="__proto__"?JC(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ik=function(t,n){if(n==="__proto__")if(kh.call(t,n)){if(ek)return ek(t,n).value}else return;return t[n]},yQ=function e(){var t,n,r,i,a,o,s=arguments[0],u=1,c=arguments.length,p=!1;for(typeof s=="boolean"&&(p=s,s=arguments[1]||{},u=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});uo.length;let u;s&&o.push(i);try{u=e.apply(this,o)}catch(c){const p=c;if(s&&n)throw p;return i(p)}s||(u instanceof Promise?u.then(a,i):u instanceof Error?i(u):a(u))}function i(o,...s){n||(n=!0,t(o,...s))}function a(o){i(null,o)}}const _Q=OL().freeze(),NL={}.hasOwnProperty;function OL(){const e=EQ(),t=[];let n={},r,i=-1;return a.data=o,a.Parser=void 0,a.Compiler=void 0,a.freeze=s,a.attachers=t,a.use=u,a.parse=c,a.stringify=p,a.run=f,a.runSync=m,a.process=g,a.processSync=b,a;function a(){const y=OL();let T=-1;for(;++T{if(k||!N||!B)R(k);else{const q=a.stringify(N,B);q==null||(wQ(q)?B.value=q:B.result=q),R(k,B)}});function R(k,N){k||!N?w(k):v?v(N):T(null,N)}}}function b(y){let T;a.freeze(),D3("processSync",a.Parser),L3("processSync",a.Compiler);const E=ed(y);return a.process(E,v),sk("processSync","process",T),E;function v(w){T=!0,QC(w)}}}function ak(e,t){return typeof e=="function"&&e.prototype&&(TQ(e.prototype)||t in e.prototype)}function TQ(e){let t;for(t in e)if(NL.call(e,t))return!0;return!1}function D3(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function L3(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function M3(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ok(e){if(!ty(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function sk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ed(e){return SQ(e)?e:new IL(e)}function SQ(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wQ(e){return typeof e=="string"||xL(e)}const AQ={};function CQ(e,t){const n=t||AQ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return DL(e,r,i)}function DL(e,t,n){if(kQ(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 lk(e.children,t,n)}return Array.isArray(e)?lk(e,t,n):""}function lk(e,t,n){const r=[];let i=-1;for(;++ii?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(Bi(e,e.length,0,t),e):t}const uk={}.hasOwnProperty;function LL(e){const t={};let n=-1;for(;++no))return;const N=t.events.length;let B=N,q,P;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(q){P=t.events[B][1].end;break}q=!0}for(E(r),k=N;kw;){const R=n[A];t.containerState=R[1],R[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function BQ(e,t,n){return Gt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ng(e){if(e===null||gn(e)||_u(e))return 1;if(Ym(e))return 2}function Xm(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),m=Object.assign({},e[n][1].start);dk(f,-u),dk(m,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},s={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:m},a={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},s.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ca(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ca(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),c=ca(c,Xm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ca(c,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,c=ca(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Bi(e,r-1,n-r+3,c),n=r+c.length-p-2;break}}for(n=-1;++n0&&Dt(k)?Gt(e,v,"linePrefix",a+1)(k):v(k)}function v(k){return k===null||gt(k)?e.check(fk,y,A)(k):(e.enter("codeFlowValue"),w(k))}function w(k){return k===null||gt(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),w)}function A(k){return e.exit("codeFenced"),t(k)}function R(k,N,B){let q=0;return P;function P(ce){return k.enter("lineEnding"),k.consume(ce),k.exit("lineEnding"),Q}function Q(ce){return k.enter("codeFencedFence"),Dt(ce)?Gt(k,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ce):$(ce)}function $(ce){return ce===s?(k.enter("codeFencedFenceSequence"),oe(ce)):B(ce)}function oe(ce){return ce===s?(q++,k.consume(ce),oe):q>=o?(k.exit("codeFencedFenceSequence"),Dt(ce)?Gt(k,fe,"whitespace")(ce):fe(ce)):B(ce)}function fe(ce){return ce===null||gt(ce)?(k.exit("codeFencedFence"),N(ce)):B(ce)}}}function XQ(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const F3={name:"codeIndented",tokenize:QQ},ZQ={tokenize:JQ,partial:!0};function QQ(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Gt(e,a,"linePrefix",4+1)(c)}function a(c){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):gt(c)?e.attempt(ZQ,o,u)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||gt(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),s)}function u(c){return e.exit("codeIndented"),t(c)}}function JQ(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):gt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Gt(e,a,"linePrefix",4+1)(o)}function a(o){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):gt(o)?i(o):n(o)}}const eJ={name:"codeText",tokenize:rJ,resolve:tJ,previous:nJ};function tJ(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=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function UL(e,t,n,r,i,a,o,s,u){const c=u||Number.POSITIVE_INFINITY;let p=0;return f;function f(E){return E===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(E),e.exit(a),m):E===null||E===32||E===41||Rg(E)?n(E):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(E))}function m(E){return E===62?(e.enter(a),e.consume(E),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===62?(e.exit("chunkString"),e.exit(s),m(E)):E===null||E===60||gt(E)?n(E):(e.consume(E),E===92?b:g)}function b(E){return E===60||E===62||E===92?(e.consume(E),g):g(E)}function y(E){return!p&&(E===null||E===41||gn(E))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(E)):p999||g===null||g===91||g===93&&!u||g===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(g):g===93?(e.exit(a),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):gt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===null||g===91||g===93||gt(g)||s++>999?(e.exit("chunkString"),p(g)):(e.consume(g),u||(u=!Dt(g)),g===92?m:f)}function m(g){return g===91||g===92||g===93?(e.consume(g),s++,f):f(g)}}function zL(e,t,n,r,i,a){let o;return s;function s(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),o=m===40?41:m,u):n(m)}function u(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(a),c(m))}function c(m){return m===o?(e.exit(a),u(o)):m===null?n(m):gt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Gt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===o||m===null||gt(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?f:p)}function f(m){return m===o||m===92?(e.consume(m),p):p(m)}}function Ud(e,t){let n;return r;function r(i){return gt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Dt(i)?Gt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function Wa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const cJ={name:"definition",tokenize:pJ},dJ={tokenize:fJ,partial:!0};function pJ(e,t,n){const r=this;let i;return a;function a(g){return e.enter("definition"),o(g)}function o(g){return $L.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function s(g){return i=Wa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),u):n(g)}function u(g){return gn(g)?Ud(e,c)(g):c(g)}function c(g){return UL(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(dJ,f,f)(g)}function f(g){return Dt(g)?Gt(e,m,"whitespace")(g):m(g)}function m(g){return g===null||gt(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function fJ(e,t,n){return r;function r(s){return gn(s)?Ud(e,i)(s):n(s)}function i(s){return zL(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return Dt(s)?Gt(e,o,"whitespace")(s):o(s)}function o(s){return s===null||gt(s)?t(s):n(s)}}const hJ={name:"hardBreakEscape",tokenize:gJ};function gJ(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return gt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const mJ={name:"headingAtx",tokenize:yJ,resolve:bJ};function bJ(e,t){let n=e.length-2,r=3,i,a;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},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Bi(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function yJ(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||gn(p)?(e.exit("atxHeadingSequence"),s(p)):n(p)}function s(p){return p===35?(e.enter("atxHeadingSequence"),u(p)):p===null||gt(p)?(e.exit("atxHeading"),t(p)):Dt(p)?Gt(e,s,"whitespace")(p):(e.enter("atxHeadingText"),c(p))}function u(p){return p===35?(e.consume(p),u):(e.exit("atxHeadingSequence"),s(p))}function c(p){return p===null||p===35||gn(p)?(e.exit("atxHeadingText"),s(p)):(e.consume(p),c)}}const EJ=["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"],gk=["pre","script","style","textarea"],vJ={name:"htmlFlow",tokenize:wJ,resolveTo:SJ,concrete:!0},_J={tokenize:CJ,partial:!0},TJ={tokenize:AJ,partial:!0};function SJ(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 wJ(e,t,n){const r=this;let i,a,o,s,u;return c;function c(L){return p(L)}function p(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),f}function f(L){return L===33?(e.consume(L),m):L===47?(e.consume(L),a=!0,y):L===63?(e.consume(L),i=3,r.interrupt?t:D):ti(L)?(e.consume(L),o=String.fromCharCode(L),T):n(L)}function m(L){return L===45?(e.consume(L),i=2,g):L===91?(e.consume(L),i=5,s=0,b):ti(L)?(e.consume(L),i=4,r.interrupt?t:D):n(L)}function g(L){return L===45?(e.consume(L),r.interrupt?t:D):n(L)}function b(L){const ie="CDATA[";return L===ie.charCodeAt(s++)?(e.consume(L),s===ie.length?r.interrupt?t:$:b):n(L)}function y(L){return ti(L)?(e.consume(L),o=String.fromCharCode(L),T):n(L)}function T(L){if(L===null||L===47||L===62||gn(L)){const ie=L===47,Se=o.toLowerCase();return!ie&&!a&&gk.includes(Se)?(i=1,r.interrupt?t(L):$(L)):EJ.includes(o.toLowerCase())?(i=6,ie?(e.consume(L),E):r.interrupt?t(L):$(L)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):a?v(L):w(L))}return L===45||jr(L)?(e.consume(L),o+=String.fromCharCode(L),T):n(L)}function E(L){return L===62?(e.consume(L),r.interrupt?t:$):n(L)}function v(L){return Dt(L)?(e.consume(L),v):P(L)}function w(L){return L===47?(e.consume(L),P):L===58||L===95||ti(L)?(e.consume(L),A):Dt(L)?(e.consume(L),w):P(L)}function A(L){return L===45||L===46||L===58||L===95||jr(L)?(e.consume(L),A):R(L)}function R(L){return L===61?(e.consume(L),k):Dt(L)?(e.consume(L),R):w(L)}function k(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),u=L,N):Dt(L)?(e.consume(L),k):B(L)}function N(L){return L===u?(e.consume(L),u=null,q):L===null||gt(L)?n(L):(e.consume(L),N)}function B(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||gn(L)?R(L):(e.consume(L),B)}function q(L){return L===47||L===62||Dt(L)?w(L):n(L)}function P(L){return L===62?(e.consume(L),Q):n(L)}function Q(L){return L===null||gt(L)?$(L):Dt(L)?(e.consume(L),Q):n(L)}function $(L){return L===45&&i===2?(e.consume(L),De):L===60&&i===1?(e.consume(L),H):L===62&&i===4?(e.consume(L),pe):L===63&&i===3?(e.consume(L),D):L===93&&i===5?(e.consume(L),se):gt(L)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(_J,le,oe)(L)):L===null||gt(L)?(e.exit("htmlFlowData"),oe(L)):(e.consume(L),$)}function oe(L){return e.check(TJ,fe,le)(L)}function fe(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),ce}function ce(L){return L===null||gt(L)?oe(L):(e.enter("htmlFlowData"),$(L))}function De(L){return L===45?(e.consume(L),D):$(L)}function H(L){return L===47?(e.consume(L),o="",W):$(L)}function W(L){if(L===62){const ie=o.toLowerCase();return gk.includes(ie)?(e.consume(L),pe):$(L)}return ti(L)&&o.length<8?(e.consume(L),o+=String.fromCharCode(L),W):$(L)}function se(L){return L===93?(e.consume(L),D):$(L)}function D(L){return L===62?(e.consume(L),pe):L===45&&i===2?(e.consume(L),D):$(L)}function pe(L){return L===null||gt(L)?(e.exit("htmlFlowData"),le(L)):(e.consume(L),pe)}function le(L){return e.exit("htmlFlow"),t(L)}}function AJ(e,t,n){const r=this;return i;function i(o){return gt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function CJ(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(jp,t,n)}}const kJ={name:"htmlText",tokenize:xJ};function xJ(e,t,n){const r=this;let i,a,o;return s;function s(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),u}function u(D){return D===33?(e.consume(D),c):D===47?(e.consume(D),R):D===63?(e.consume(D),w):ti(D)?(e.consume(D),B):n(D)}function c(D){return D===45?(e.consume(D),p):D===91?(e.consume(D),a=0,b):ti(D)?(e.consume(D),v):n(D)}function p(D){return D===45?(e.consume(D),g):n(D)}function f(D){return D===null?n(D):D===45?(e.consume(D),m):gt(D)?(o=f,H(D)):(e.consume(D),f)}function m(D){return D===45?(e.consume(D),g):f(D)}function g(D){return D===62?De(D):D===45?m(D):f(D)}function b(D){const pe="CDATA[";return D===pe.charCodeAt(a++)?(e.consume(D),a===pe.length?y:b):n(D)}function y(D){return D===null?n(D):D===93?(e.consume(D),T):gt(D)?(o=y,H(D)):(e.consume(D),y)}function T(D){return D===93?(e.consume(D),E):y(D)}function E(D){return D===62?De(D):D===93?(e.consume(D),E):y(D)}function v(D){return D===null||D===62?De(D):gt(D)?(o=v,H(D)):(e.consume(D),v)}function w(D){return D===null?n(D):D===63?(e.consume(D),A):gt(D)?(o=w,H(D)):(e.consume(D),w)}function A(D){return D===62?De(D):w(D)}function R(D){return ti(D)?(e.consume(D),k):n(D)}function k(D){return D===45||jr(D)?(e.consume(D),k):N(D)}function N(D){return gt(D)?(o=N,H(D)):Dt(D)?(e.consume(D),N):De(D)}function B(D){return D===45||jr(D)?(e.consume(D),B):D===47||D===62||gn(D)?q(D):n(D)}function q(D){return D===47?(e.consume(D),De):D===58||D===95||ti(D)?(e.consume(D),P):gt(D)?(o=q,H(D)):Dt(D)?(e.consume(D),q):De(D)}function P(D){return D===45||D===46||D===58||D===95||jr(D)?(e.consume(D),P):Q(D)}function Q(D){return D===61?(e.consume(D),$):gt(D)?(o=Q,H(D)):Dt(D)?(e.consume(D),Q):q(D)}function $(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,oe):gt(D)?(o=$,H(D)):Dt(D)?(e.consume(D),$):(e.consume(D),fe)}function oe(D){return D===i?(e.consume(D),i=void 0,ce):D===null?n(D):gt(D)?(o=oe,H(D)):(e.consume(D),oe)}function fe(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||gn(D)?q(D):(e.consume(D),fe)}function ce(D){return D===47||D===62||gn(D)?q(D):n(D)}function De(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function H(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),W}function W(D){return Dt(D)?Gt(e,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):se(D)}function se(D){return e.enter("htmlTextData"),o(D)}}const A9={name:"labelEnd",tokenize:LJ,resolveTo:DJ,resolveAll:OJ},IJ={tokenize:MJ},RJ={tokenize:FJ},NJ={tokenize:PJ};function OJ(e){let t=-1;for(;++t=3&&(c===null||gt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),Dt(c)?Gt(e,s,"whitespace")(c):s(c))}}const pi={name:"list",tokenize:WJ,continuation:{tokenize:qJ},exit:YJ},GJ={tokenize:XJ,partial:!0},VJ={tokenize:KJ,partial:!0};function WJ(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(g){const b=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:ny(g)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(xh,n,c)(g):c(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(g)}return n(g)}function u(g){return ny(g)&&++o<10?(e.consume(g),u):(!r.interrupt||o<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),c(g)):n(g)}function c(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(jp,r.interrupt?n:p,e.attempt(GJ,m,f))}function p(g){return r.containerState.initialBlankLine=!0,a++,m(g)}function f(g){return Dt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),m):n(g)}function m(g){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function qJ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(jp,i,a);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Gt(e,t,"listItemIndent",r.containerState.size+1)(s)}function a(s){return r.containerState.furtherBlankLines||!Dt(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(VJ,t,o)(s))}function o(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Gt(e,e.attempt(pi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function KJ(e,t,n){const r=this;return Gt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function YJ(e){e.exit(this.containerState.type)}function XJ(e,t,n){const r=this;return Gt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(a){const o=r.events[r.events.length-1];return!Dt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const mk={name:"setextUnderline",tokenize:QJ,resolveTo:ZJ};function ZJ(e,t){let n=e.length,r,i,a;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),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[a][1].end)):e[r][1]=o,e.push(["exit",o,t]),e}function QJ(e,t,n){const r=this;let i;return a;function a(c){let p=r.events.length,f;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){f=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Dt(c)?Gt(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||gt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const JJ={tokenize:eee};function eee(e){const t=this,n=e.attempt(jp,r,e.attempt(this.parser.constructs.flowInitial,i,Gt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(aJ,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tee={resolveAll:jL()},nee=HL("string"),ree=HL("text");function HL(e){return{tokenize:t,resolveAll:jL(e==="text"?iee:void 0)};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,s);return o;function o(p){return c(p)?a(p):s(p)}function s(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),u}function u(p){return c(p)?(n.exit("data"),a(p)):(n.consume(p),u)}function c(p){if(p===null)return!0;const f=i[p];let m=-1;if(f)for(;++m-1){const s=o[0];typeof s=="string"?o[0]=s.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function see(e,t){let n=-1;const r=[];let i;for(;++ne.length){for(;i--;)if(e.charCodeAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,s=t.length-1;for(;i--;)if(e.charCodeAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.charCodeAt(i)===t.charCodeAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function lQ(e){if(Hp(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.charCodeAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.charCodeAt(0)===47?"/":".":t===1&&e.charCodeAt(0)===47?"//":e.slice(0,t)}function uQ(e){Hp(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const s=e.charCodeAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function cQ(...e){let t=-1,n;for(;++t0&&e.charCodeAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function pQ(e,t){let n="",r=0,i=-1,a=0,o=-1,s,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Hp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const fQ={cwd:hQ};function hQ(){return"/"}function ey(e){return e!==null&&typeof e=="object"&&e.href&&e.origin}function gQ(e){if(typeof e=="string")e=new URL(e);else if(!ey(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return mQ(e)}function mQ(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n"u"||kh.call(t,i)},rk=function(t,n){JC&&n.name==="__proto__"?JC(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ik=function(t,n){if(n==="__proto__")if(kh.call(t,n)){if(ek)return ek(t,n).value}else return;return t[n]},yQ=function e(){var t,n,r,i,a,o,s=arguments[0],u=1,c=arguments.length,p=!1;for(typeof s=="boolean"&&(p=s,s=arguments[1]||{},u=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});uo.length;let u;s&&o.push(i);try{u=e.apply(this,o)}catch(c){const p=c;if(s&&n)throw p;return i(p)}s||(u instanceof Promise?u.then(a,i):u instanceof Error?i(u):a(u))}function i(o,...s){n||(n=!0,t(o,...s))}function a(o){i(null,o)}}const _Q=OL().freeze(),NL={}.hasOwnProperty;function OL(){const e=EQ(),t=[];let n={},r,i=-1;return a.data=o,a.Parser=void 0,a.Compiler=void 0,a.freeze=s,a.attachers=t,a.use=u,a.parse=c,a.stringify=p,a.run=f,a.runSync=m,a.process=g,a.processSync=b,a;function a(){const y=OL();let T=-1;for(;++T{if(k||!N||!B)R(k);else{const q=a.stringify(N,B);q==null||(wQ(q)?B.value=q:B.result=q),R(k,B)}});function R(k,N){k||!N?w(k):v?v(N):T(null,N)}}}function b(y){let T;a.freeze(),D3("processSync",a.Parser),L3("processSync",a.Compiler);const E=ed(y);return a.process(E,v),sk("processSync","process",T),E;function v(w){T=!0,QC(w)}}}function ak(e,t){return typeof e=="function"&&e.prototype&&(TQ(e.prototype)||t in e.prototype)}function TQ(e){let t;for(t in e)if(NL.call(e,t))return!0;return!1}function D3(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Parser`")}function L3(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `Compiler`")}function M3(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ok(e){if(!ty(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function sk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ed(e){return SQ(e)?e:new IL(e)}function SQ(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function wQ(e){return typeof e=="string"||xL(e)}const AQ={};function CQ(e,t){const n=t||AQ,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return DL(e,r,i)}function DL(e,t,n){if(kQ(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 lk(e.children,t,n)}return Array.isArray(e)?lk(e,t,n):""}function lk(e,t,n){const r=[];let i=-1;for(;++ii?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(Bi(e,e.length,0,t),e):t}const uk={}.hasOwnProperty;function LL(e){const t={};let n=-1;for(;++no))return;const N=t.events.length;let B=N,q,P;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(q){P=t.events[B][1].end;break}q=!0}for(E(r),k=N;kw;){const R=n[A];t.containerState=R[1],R[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function BQ(e,t,n){return Gt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ng(e){if(e===null||gn(e)||_u(e))return 1;if(Ym(e))return 2}function Xm(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),m=Object.assign({},e[n][1].start);dk(f,-u),dk(m,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},s={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:m},a={type:u>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},s.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ca(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ca(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),c=ca(c,Xm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ca(c,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,c=ca(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Bi(e,r-1,n-r+3,c),n=r+c.length-p-2;break}}for(n=-1;++n0&&Dt(k)?Gt(e,v,"linePrefix",a+1)(k):v(k)}function v(k){return k===null||gt(k)?e.check(fk,y,A)(k):(e.enter("codeFlowValue"),w(k))}function w(k){return k===null||gt(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),w)}function A(k){return e.exit("codeFenced"),t(k)}function R(k,N,B){let q=0;return P;function P(ce){return k.enter("lineEnding"),k.consume(ce),k.exit("lineEnding"),Q}function Q(ce){return k.enter("codeFencedFence"),Dt(ce)?Gt(k,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ce):$(ce)}function $(ce){return ce===s?(k.enter("codeFencedFenceSequence"),oe(ce)):B(ce)}function oe(ce){return ce===s?(q++,k.consume(ce),oe):q>=o?(k.exit("codeFencedFenceSequence"),Dt(ce)?Gt(k,fe,"whitespace")(ce):fe(ce)):B(ce)}function fe(ce){return ce===null||gt(ce)?(k.exit("codeFencedFence"),N(ce)):B(ce)}}}function XQ(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const F3={name:"codeIndented",tokenize:QQ},ZQ={tokenize:JQ,partial:!0};function QQ(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Gt(e,a,"linePrefix",4+1)(c)}function a(c){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):gt(c)?e.attempt(ZQ,o,u)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||gt(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),s)}function u(c){return e.exit("codeIndented"),t(c)}}function JQ(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):gt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Gt(e,a,"linePrefix",4+1)(o)}function a(o){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):gt(o)?i(o):n(o)}}const eJ={name:"codeText",tokenize:rJ,resolve:tJ,previous:nJ};function tJ(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=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function UL(e,t,n,r,i,a,o,s,u){const c=u||Number.POSITIVE_INFINITY;let p=0;return f;function f(E){return E===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(E),e.exit(a),m):E===null||E===32||E===41||Rg(E)?n(E):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),y(E))}function m(E){return E===62?(e.enter(a),e.consume(E),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===62?(e.exit("chunkString"),e.exit(s),m(E)):E===null||E===60||gt(E)?n(E):(e.consume(E),E===92?b:g)}function b(E){return E===60||E===62||E===92?(e.consume(E),g):g(E)}function y(E){return!p&&(E===null||E===41||gn(E))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(E)):p999||g===null||g===91||g===93&&!u||g===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(g):g===93?(e.exit(a),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):gt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===null||g===91||g===93||gt(g)||s++>999?(e.exit("chunkString"),p(g)):(e.consume(g),u||(u=!Dt(g)),g===92?m:f)}function m(g){return g===91||g===92||g===93?(e.consume(g),s++,f):f(g)}}function zL(e,t,n,r,i,a){let o;return s;function s(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),o=m===40?41:m,u):n(m)}function u(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(a),c(m))}function c(m){return m===o?(e.exit(a),u(o)):m===null?n(m):gt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Gt(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===o||m===null||gt(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?f:p)}function f(m){return m===o||m===92?(e.consume(m),p):p(m)}}function Ud(e,t){let n;return r;function r(i){return gt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Dt(i)?Gt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function Wa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const cJ={name:"definition",tokenize:pJ},dJ={tokenize:fJ,partial:!0};function pJ(e,t,n){const r=this;let i;return a;function a(g){return e.enter("definition"),o(g)}function o(g){return $L.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function s(g){return i=Wa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),u):n(g)}function u(g){return gn(g)?Ud(e,c)(g):c(g)}function c(g){return UL(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(dJ,f,f)(g)}function f(g){return Dt(g)?Gt(e,m,"whitespace")(g):m(g)}function m(g){return g===null||gt(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function fJ(e,t,n){return r;function r(s){return gn(s)?Ud(e,i)(s):n(s)}function i(s){return zL(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function a(s){return Dt(s)?Gt(e,o,"whitespace")(s):o(s)}function o(s){return s===null||gt(s)?t(s):n(s)}}const hJ={name:"hardBreakEscape",tokenize:gJ};function gJ(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return gt(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const mJ={name:"headingAtx",tokenize:yJ,resolve:bJ};function bJ(e,t){let n=e.length-2,r=3,i,a;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},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Bi(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function yJ(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||gn(p)?(e.exit("atxHeadingSequence"),s(p)):n(p)}function s(p){return p===35?(e.enter("atxHeadingSequence"),u(p)):p===null||gt(p)?(e.exit("atxHeading"),t(p)):Dt(p)?Gt(e,s,"whitespace")(p):(e.enter("atxHeadingText"),c(p))}function u(p){return p===35?(e.consume(p),u):(e.exit("atxHeadingSequence"),s(p))}function c(p){return p===null||p===35||gn(p)?(e.exit("atxHeadingText"),s(p)):(e.consume(p),c)}}const EJ=["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"],gk=["pre","script","style","textarea"],vJ={name:"htmlFlow",tokenize:wJ,resolveTo:SJ,concrete:!0},_J={tokenize:CJ,partial:!0},TJ={tokenize:AJ,partial:!0};function SJ(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 wJ(e,t,n){const r=this;let i,a,o,s,u;return c;function c(L){return p(L)}function p(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),f}function f(L){return L===33?(e.consume(L),m):L===47?(e.consume(L),a=!0,y):L===63?(e.consume(L),i=3,r.interrupt?t:D):ti(L)?(e.consume(L),o=String.fromCharCode(L),T):n(L)}function m(L){return L===45?(e.consume(L),i=2,g):L===91?(e.consume(L),i=5,s=0,b):ti(L)?(e.consume(L),i=4,r.interrupt?t:D):n(L)}function g(L){return L===45?(e.consume(L),r.interrupt?t:D):n(L)}function b(L){const ie="CDATA[";return L===ie.charCodeAt(s++)?(e.consume(L),s===ie.length?r.interrupt?t:$:b):n(L)}function y(L){return ti(L)?(e.consume(L),o=String.fromCharCode(L),T):n(L)}function T(L){if(L===null||L===47||L===62||gn(L)){const ie=L===47,Se=o.toLowerCase();return!ie&&!a&&gk.includes(Se)?(i=1,r.interrupt?t(L):$(L)):EJ.includes(o.toLowerCase())?(i=6,ie?(e.consume(L),E):r.interrupt?t(L):$(L)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):a?v(L):w(L))}return L===45||jr(L)?(e.consume(L),o+=String.fromCharCode(L),T):n(L)}function E(L){return L===62?(e.consume(L),r.interrupt?t:$):n(L)}function v(L){return Dt(L)?(e.consume(L),v):P(L)}function w(L){return L===47?(e.consume(L),P):L===58||L===95||ti(L)?(e.consume(L),A):Dt(L)?(e.consume(L),w):P(L)}function A(L){return L===45||L===46||L===58||L===95||jr(L)?(e.consume(L),A):R(L)}function R(L){return L===61?(e.consume(L),k):Dt(L)?(e.consume(L),R):w(L)}function k(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),u=L,N):Dt(L)?(e.consume(L),k):B(L)}function N(L){return L===u?(e.consume(L),u=null,q):L===null||gt(L)?n(L):(e.consume(L),N)}function B(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||gn(L)?R(L):(e.consume(L),B)}function q(L){return L===47||L===62||Dt(L)?w(L):n(L)}function P(L){return L===62?(e.consume(L),Q):n(L)}function Q(L){return L===null||gt(L)?$(L):Dt(L)?(e.consume(L),Q):n(L)}function $(L){return L===45&&i===2?(e.consume(L),De):L===60&&i===1?(e.consume(L),H):L===62&&i===4?(e.consume(L),pe):L===63&&i===3?(e.consume(L),D):L===93&&i===5?(e.consume(L),se):gt(L)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(_J,le,oe)(L)):L===null||gt(L)?(e.exit("htmlFlowData"),oe(L)):(e.consume(L),$)}function oe(L){return e.check(TJ,fe,le)(L)}function fe(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),ce}function ce(L){return L===null||gt(L)?oe(L):(e.enter("htmlFlowData"),$(L))}function De(L){return L===45?(e.consume(L),D):$(L)}function H(L){return L===47?(e.consume(L),o="",W):$(L)}function W(L){if(L===62){const ie=o.toLowerCase();return gk.includes(ie)?(e.consume(L),pe):$(L)}return ti(L)&&o.length<8?(e.consume(L),o+=String.fromCharCode(L),W):$(L)}function se(L){return L===93?(e.consume(L),D):$(L)}function D(L){return L===62?(e.consume(L),pe):L===45&&i===2?(e.consume(L),D):$(L)}function pe(L){return L===null||gt(L)?(e.exit("htmlFlowData"),le(L)):(e.consume(L),pe)}function le(L){return e.exit("htmlFlow"),t(L)}}function AJ(e,t,n){const r=this;return i;function i(o){return gt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function CJ(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(jp,t,n)}}const kJ={name:"htmlText",tokenize:xJ};function xJ(e,t,n){const r=this;let i,a,o;return s;function s(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),u}function u(D){return D===33?(e.consume(D),c):D===47?(e.consume(D),R):D===63?(e.consume(D),w):ti(D)?(e.consume(D),B):n(D)}function c(D){return D===45?(e.consume(D),p):D===91?(e.consume(D),a=0,b):ti(D)?(e.consume(D),v):n(D)}function p(D){return D===45?(e.consume(D),g):n(D)}function f(D){return D===null?n(D):D===45?(e.consume(D),m):gt(D)?(o=f,H(D)):(e.consume(D),f)}function m(D){return D===45?(e.consume(D),g):f(D)}function g(D){return D===62?De(D):D===45?m(D):f(D)}function b(D){const pe="CDATA[";return D===pe.charCodeAt(a++)?(e.consume(D),a===pe.length?y:b):n(D)}function y(D){return D===null?n(D):D===93?(e.consume(D),T):gt(D)?(o=y,H(D)):(e.consume(D),y)}function T(D){return D===93?(e.consume(D),E):y(D)}function E(D){return D===62?De(D):D===93?(e.consume(D),E):y(D)}function v(D){return D===null||D===62?De(D):gt(D)?(o=v,H(D)):(e.consume(D),v)}function w(D){return D===null?n(D):D===63?(e.consume(D),A):gt(D)?(o=w,H(D)):(e.consume(D),w)}function A(D){return D===62?De(D):w(D)}function R(D){return ti(D)?(e.consume(D),k):n(D)}function k(D){return D===45||jr(D)?(e.consume(D),k):N(D)}function N(D){return gt(D)?(o=N,H(D)):Dt(D)?(e.consume(D),N):De(D)}function B(D){return D===45||jr(D)?(e.consume(D),B):D===47||D===62||gn(D)?q(D):n(D)}function q(D){return D===47?(e.consume(D),De):D===58||D===95||ti(D)?(e.consume(D),P):gt(D)?(o=q,H(D)):Dt(D)?(e.consume(D),q):De(D)}function P(D){return D===45||D===46||D===58||D===95||jr(D)?(e.consume(D),P):Q(D)}function Q(D){return D===61?(e.consume(D),$):gt(D)?(o=Q,H(D)):Dt(D)?(e.consume(D),Q):q(D)}function $(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),i=D,oe):gt(D)?(o=$,H(D)):Dt(D)?(e.consume(D),$):(e.consume(D),fe)}function oe(D){return D===i?(e.consume(D),i=void 0,ce):D===null?n(D):gt(D)?(o=oe,H(D)):(e.consume(D),oe)}function fe(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||gn(D)?q(D):(e.consume(D),fe)}function ce(D){return D===47||D===62||gn(D)?q(D):n(D)}function De(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function H(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),W}function W(D){return Dt(D)?Gt(e,se,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):se(D)}function se(D){return e.enter("htmlTextData"),o(D)}}const A9={name:"labelEnd",tokenize:LJ,resolveTo:DJ,resolveAll:OJ},IJ={tokenize:MJ},RJ={tokenize:FJ},NJ={tokenize:PJ};function OJ(e){let t=-1;for(;++t=3&&(c===null||gt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),Dt(c)?Gt(e,s,"whitespace")(c):s(c))}}const pi={name:"list",tokenize:WJ,continuation:{tokenize:qJ},exit:YJ},GJ={tokenize:XJ,partial:!0},VJ={tokenize:KJ,partial:!0};function WJ(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(g){const b=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:ny(g)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(xh,n,c)(g):c(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(g)}return n(g)}function u(g){return ny(g)&&++o<10?(e.consume(g),u):(!r.interrupt||o<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),c(g)):n(g)}function c(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(jp,r.interrupt?n:p,e.attempt(GJ,m,f))}function p(g){return r.containerState.initialBlankLine=!0,a++,m(g)}function f(g){return Dt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),m):n(g)}function m(g){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function qJ(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(jp,i,a);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Gt(e,t,"listItemIndent",r.containerState.size+1)(s)}function a(s){return r.containerState.furtherBlankLines||!Dt(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(VJ,t,o)(s))}function o(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,Gt(e,e.attempt(pi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function KJ(e,t,n){const r=this;return Gt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function YJ(e){e.exit(this.containerState.type)}function XJ(e,t,n){const r=this;return Gt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(a){const o=r.events[r.events.length-1];return!Dt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const mk={name:"setextUnderline",tokenize:QJ,resolveTo:ZJ};function ZJ(e,t){let n=e.length,r,i,a;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),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[a][1].end)):e[r][1]=o,e.push(["exit",o,t]),e}function QJ(e,t,n){const r=this;let i;return a;function a(c){let p=r.events.length,f;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){f=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===i?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Dt(c)?Gt(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||gt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const JJ={tokenize:eee};function eee(e){const t=this,n=e.attempt(jp,r,e.attempt(this.parser.constructs.flowInitial,i,Gt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(aJ,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const tee={resolveAll:jL()},nee=HL("string"),ree=HL("text");function HL(e){return{tokenize:t,resolveAll:jL(e==="text"?iee:void 0)};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,s);return o;function o(p){return c(p)?a(p):s(p)}function s(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),u}function u(p){return c(p)?(n.exit("data"),a(p)):(n.consume(p),u)}function c(p){if(p===null)return!0;const f=i[p];let m=-1;if(f)for(;++m-1){const s=o[0];typeof s=="string"?o[0]=s.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function see(e,t){let n=-1;const r=[];let i;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const _ee=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function VL(e){return e.replace(_ee,Tee)}function Tee(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return GL(n.slice(a?2:1),a?16:10)}return Tp(n)||e}const WL={}.hasOwnProperty,See=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),wee(n)(vee(yee(n).document().write(Eee()(e,t,!0))))};function wee(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(xe),autolinkProtocol:Q,autolinkEmail:Q,atxHeading:s(pt),blockQuote:s(Ze),characterEscape:Q,characterReference:Q,codeFenced:s(We),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(We,u),codeText:s(dt,u),codeTextData:Q,data:Q,codeFlowValue:Q,definition:s(ot),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(je),hardBreakEscape:s(U),hardBreakTrailing:s(U),htmlFlow:s(re,u),htmlFlowData:Q,htmlText:s(re,u),htmlTextData:Q,image:s(de),label:u,link:s(xe),listItem:s(Te),listItemValue:b,listOrdered:s(ye,g),listUnordered:s(ye),paragraph:s(Le),reference:Se,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(pt),strong:s(ze),thematicBreak:s(jt)},exit:{atxHeading:p(),atxHeadingSequence:N,autolink:p(),autolinkEmail:Re,autolinkProtocol:Me,blockQuote:p(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:te,codeFenced:p(v),codeFencedFence:E,codeFencedFenceInfo:y,codeFencedFenceMeta:T,codeFlowValue:$,codeIndented:p(w),codeText:p(H),codeTextData:$,data:$,definition:p(),definitionDestinationString:k,definitionLabelString:A,definitionTitleString:R,emphasis:p(),hardBreakEscape:p(fe),hardBreakTrailing:p(fe),htmlFlow:p(ce),htmlFlowData:$,htmlText:p(De),htmlTextData:$,image:p(se),label:pe,labelText:D,lineEnding:oe,link:p(W),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:X,resourceDestinationString:le,resourceTitleString:L,resource:ie,setextHeading:p(P),setextHeadingLineSequence:q,setextHeadingText:B,strong:p(),thematicBreak:p()}};qL(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ue){let Ee={type:"root",children:[]};const qe={stack:[Ee],tokenStack:[],config:t,enter:c,exit:f,buffer:u,resume:m,setData:a,getData:o},j=[];let me=-1;for(;++me0){const Ve=qe.tokenStack[qe.tokenStack.length-1];(Ve[1]||yk).call(qe,void 0,Ve[0])}for(Ee.position={start:Ds(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Ds(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me{const r=this.data("settings");return See(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function kee(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 xee(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` +`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}const lee={42:pi,43:pi,45:pi,48:pi,49:pi,50:pi,51:pi,52:pi,53:pi,54:pi,55:pi,56:pi,57:pi,62:ML},uee={91:cJ},cee={[-2]:F3,[-1]:F3,32:F3},dee={35:mJ,42:xh,45:[mk,xh],60:vJ,61:mk,95:xh,96:hk,126:hk},pee={38:PL,92:FL},fee={[-5]:P3,[-4]:P3,[-3]:P3,33:BJ,38:PL,42:ry,60:[zQ,kJ],91:$J,92:[hJ,FL],93:A9,95:ry,96:eJ},hee={null:[ry,tee]},gee={null:[42,95]},mee={null:[]},bee=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:gee,contentInitial:uee,disable:mee,document:lee,flow:dee,flowInitial:cee,insideSpan:hee,string:pee,text:fee},Symbol.toStringTag,{value:"Module"}));function yee(e){const n=LL([bee,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(LQ),document:i(FQ),flow:i(JJ),string:i(nee),text:i(ree)};return r;function i(a){return o;function o(s){return aee(r,a,s)}}}const bk=/[\0\t\n\r]/g;function Eee(){let e=1,t="",n=!0,r;return i;function i(a,o,s){const u=[];let c,p,f,m,g;for(a=t+a.toString(o),f=0,t="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCharCode(n)}const _ee=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function VL(e){return e.replace(_ee,Tee)}function Tee(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return GL(n.slice(a?2:1),a?16:10)}return Tp(n)||e}const WL={}.hasOwnProperty,See=function(e,t,n){return typeof t!="string"&&(n=t,t=void 0),wee(n)(vee(yee(n).document().write(Eee()(e,t,!0))))};function wee(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(xe),autolinkProtocol:Q,autolinkEmail:Q,atxHeading:s(pt),blockQuote:s(Ye),characterEscape:Q,characterReference:Q,codeFenced:s(We),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(We,u),codeText:s(dt,u),codeTextData:Q,data:Q,codeFlowValue:Q,definition:s(ot),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(je),hardBreakEscape:s(U),hardBreakTrailing:s(U),htmlFlow:s(re,u),htmlFlowData:Q,htmlText:s(re,u),htmlTextData:Q,image:s(de),label:u,link:s(xe),listItem:s(Te),listItemValue:b,listOrdered:s(ye,g),listUnordered:s(ye),paragraph:s(Le),reference:Se,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(pt),strong:s(ze),thematicBreak:s(jt)},exit:{atxHeading:p(),atxHeadingSequence:N,autolink:p(),autolinkEmail:Re,autolinkProtocol:Me,blockQuote:p(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:te,codeFenced:p(v),codeFencedFence:E,codeFencedFenceInfo:y,codeFencedFenceMeta:T,codeFlowValue:$,codeIndented:p(w),codeText:p(H),codeTextData:$,data:$,definition:p(),definitionDestinationString:k,definitionLabelString:A,definitionTitleString:R,emphasis:p(),hardBreakEscape:p(fe),hardBreakTrailing:p(fe),htmlFlow:p(ce),htmlFlowData:$,htmlText:p(De),htmlTextData:$,image:p(se),label:pe,labelText:D,lineEnding:oe,link:p(W),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:X,resourceDestinationString:le,resourceTitleString:L,resource:ie,setextHeading:p(P),setextHeadingLineSequence:q,setextHeadingText:B,strong:p(),thematicBreak:p()}};qL(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ue){let Ee={type:"root",children:[]};const qe={stack:[Ee],tokenStack:[],config:t,enter:c,exit:f,buffer:u,resume:m,setData:a,getData:o},j=[];let me=-1;for(;++me0){const Ve=qe.tokenStack[qe.tokenStack.length-1];(Ve[1]||yk).call(qe,void 0,Ve[0])}for(Ee.position={start:Ds(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Ds(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},me=-1;++me{const r=this.data("settings");return See(n,Object.assign({},r,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function kee(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 xee(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:` `}]}function Iee(e,t){const n=t.value?t.value+` `:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,i={};r&&(i.className=["language-"+r]);let a={type:"element",tagName:"code",properties:i,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Ree(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nee(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bc(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&a<57344){const s=e.charCodeAt(n+1);a<56320&&s>56319&&s<57344?(o=String.fromCharCode(a,s),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function KL(e,t){const n=String(t.identifier).toUpperCase(),r=bc(n.toLowerCase()),i=e.footnoteOrder.indexOf(n);let a;i===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,a=e.footnoteOrder.length):(e.footnoteCounts[n]++,a=i+1);const o=e.footnoteCounts[n],s={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,s);const u={type:"element",tagName:"sup",properties:{},children:[s]};return e.patch(t,u),e.applyData(t,u)}function Oee(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const i=String(r);return n[i]={type:"footnoteDefinition",identifier:i,children:[{type:"paragraph",children:t.children}],position:t.position},KL(e,{type:"footnoteReference",identifier:i,position:t.position})}function Dee(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Lee(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function YL(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return{type:"text",value:"!["+t.alt+r};const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Mee(e,t){const n=e.definition(t.identifier);if(!n)return YL(e,t);const r={src:bc(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,i),e.applyData(t,i)}function Fee(e,t){const n={src:bc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Pee(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Bee(e,t){const n=e.definition(t.identifier);if(!n)return YL(e,t);const r={href:bc(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const i={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Uee(e,t){const n={href:bc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function $ee(e,t,n){const r=e.all(t),i=n?zee(n):XL(t),a={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let f;p&&p.type==="element"&&p.tagName==="p"?f=p:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let s=-1;for(;++stypeof e=="object"&&e!=null&&e.nodeType===1,bI=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",u4=(e,t)=>{if(e.clientHeight{let i=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeightat||a>e&&o=t&&s>=n?a-e-r:o>t&&sn?o-t+i:0,Xue=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)};var Zue=(e,t)=>{var n,r,i,a,o,s;if(typeof document>"u")return[];let{scrollMode:u,block:c,inline:p,boundary:f,skipOverflowHiddenElements:m}=t,g=typeof f=="function"?f:fe=>fe!==f;if(!mI(e))throw new TypeError("Invalid target");let b=document.scrollingElement||document.documentElement,y=[],T=e;for(;mI(T)&&g(T);){if(T=Xue(T),T===b){y.push(T);break}T!=null&&T===document.body&&u4(T)&&!u4(document.documentElement)||T!=null&&u4(T,m)&&y.push(T)}let E=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,v=(a=(i=window.visualViewport)==null?void 0:i.height)!=null?a:innerHeight,w=(o=window.scrollX)!=null?o:pageXOffset,A=(s=window.scrollY)!=null?s:pageYOffset,{height:R,width:k,top:N,right:B,bottom:q,left:P}=e.getBoundingClientRect(),Q=c==="start"||c==="nearest"?N:c==="end"?q:N+R/2,$=p==="center"?P+k/2:p==="end"?B:P,oe=[];for(let fe=0;fe=0&&P>=0&&q<=v&&B<=E&&N>=W&&q<=D&&P>=pe&&B<=se)return oe;let le=getComputedStyle(ce),L=parseInt(le.borderLeftWidth,10),ie=parseInt(le.borderTopWidth,10),Se=parseInt(le.borderRightWidth,10),X=parseInt(le.borderBottomWidth,10),ke=0,te=0,Me="offsetWidth"in ce?ce.offsetWidth-ce.clientWidth-L-Se:0,Re="offsetHeight"in ce?ce.offsetHeight-ce.clientHeight-ie-X:0,Ze="offsetWidth"in ce?ce.offsetWidth===0?0:H/ce.offsetWidth:0,We="offsetHeight"in ce?ce.offsetHeight===0?0:De/ce.offsetHeight:0;if(b===ce)ke=c==="start"?Q:c==="end"?Q-v:c==="nearest"?V0(A,A+v,v,ie,X,A+Q,A+Q+R,R):Q-v/2,te=p==="start"?$:p==="center"?$-E/2:p==="end"?$-E:V0(w,w+E,E,L,Se,w+$,w+$+k,k),ke=Math.max(0,ke+A),te=Math.max(0,te+w);else{ke=c==="start"?Q-W-ie:c==="end"?Q-D+X+Re:c==="nearest"?V0(W,D,De,ie,X+Re,Q,Q+R,R):Q-(W+De/2)+Re/2,te=p==="start"?$-pe-L:p==="center"?$-(pe+H/2)+Me/2:p==="end"?$-se+Se+Me:V0(pe,se,H,L,Se+Me,$,$+k,k);let{scrollLeft:dt,scrollTop:ot}=ce;ke=Math.max(0,Math.min(ot+ke/We,ce.scrollHeight-De/We+Re)),te=Math.max(0,Math.min(dt+te/Ze,ce.scrollWidth-H/Ze+Me)),Q+=ot-ke,$+=dt-te}oe.push({el:ce,top:ke,left:te})}return oe},$g=function(){return $g=Object.assign||function(t){for(var n,r=1,i=arguments.length;r1?i-1:0),o=1;o=37&&n<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function q0(e,t,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var a=n-1;(typeof t!="number"||t<0||t>=n)&&(t=e>0?-1:a+1);var o=t+e;o<0?o=i?a:0:o>a&&(o=i?0:a);var s=Ap(e,o,n,r,i);return s===-1?t>=n?-1:t:s}function Ap(e,t,n,r,i){var a=r(t);if(!a||!a.hasAttribute("disabled"))return t;if(e>0){for(var o=t+1;o=0;s--)if(!r(s).hasAttribute("disabled"))return s;return i?e>0?Ap(1,0,n,r,!1):Ap(-1,n-1,n,r,!1):-1}function EI(e,t,n,r){return r===void 0&&(r=!0),t.some(function(i){return i&&(yI(i,e,n)||r&&yI(i,n.document.activeElement,n))})}var r1e=LF(function(e){FF(e).textContent=""},500);function i1e(e,t){var n=FF(t);e&&(n.textContent=e,r1e(t))}function FF(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var a1e=["isInitialMount","highlightedIndex","items","environment"],PF={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function o1e(e,t,n){var r=e.props,i=e.type,a={};Object.keys(t).forEach(function(o){s1e(o,e,t,n),n[o]!==t[o]&&(a[o]=n[o])}),r.onStateChange&&Object.keys(a).length&&r.onStateChange(nn({type:i},a))}function s1e(e,t,n,r){var i=t.props,a=t.type,o="on"+P7(e)+"Change";i[o]&&r[e]!==void 0&&r[e]!==n[e]&&i[o](nn({type:a},r))}function l1e(e,t){return t.changes}function u1e(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""}var c1e=LF(function(e,t){i1e(e(),t)},200),d1e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.useLayoutEffect:C.useEffect;function p1e(e){var t=e.id,n=t===void 0?"downshift-"+e1e():t,r=e.labelId,i=e.menuId,a=e.getItemId,o=e.toggleButtonId,s=e.inputId,u=C.useRef({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:a||function(c){return n+"-item-"+c},toggleButtonId:o||n+"-toggle-button",inputId:s||n+"-input"});return u.current}function f1e(e,t,n,r){var i,a;if(e===void 0){if(t===void 0)throw new Error(r);i=n[t],a=t}else a=t===void 0?n.indexOf(e):t,i=e;return[i,a]}function h1e(e){return e?String(e):""}function P7(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function BF(e){var t=C.useRef(e);return t.current=e,t}function g1e(e,t,n){var r=C.useRef(),i=C.useRef(),a=C.useCallback(function(m,g){i.current=g,m=my(m,g.props);var b=e(m,g),y=g.props.stateReducer(m,nn({},g,{changes:b}));return y},[e]),o=C.useReducer(a,t),s=o[0],u=o[1],c=BF(n),p=C.useCallback(function(m){return u(nn({props:c.current},m))},[c]),f=i.current;return C.useEffect(function(){f&&r.current&&r.current!==s&&o1e(f,my(r.current,f.props),s),r.current=s},[s,n,f]),[s,p]}var Kd={itemToString:h1e,stateReducer:l1e,getA11ySelectionMessage:u1e,scrollIntoView:Jue,environment:typeof window>"u"?{}:window};function bo(e,t,n){n===void 0&&(n=PF);var r=e["default"+P7(t)];return r!==void 0?r:n[t]}function K0(e,t,n){n===void 0&&(n=PF);var r=e[t];if(r!==void 0)return r;var i=e["initial"+P7(t)];return i!==void 0?i:bo(e,t,n)}function m1e(e){var t=K0(e,"selectedItem"),n=K0(e,"isOpen"),r=K0(e,"highlightedIndex"),i=K0(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}function Yd(e,t,n){var r=e.items,i=e.initialHighlightedIndex,a=e.defaultHighlightedIndex,o=t.selectedItem,s=t.highlightedIndex;return r.length===0?-1:i!==void 0&&s===i?i:a!==void 0?a:o?r.indexOf(o):n===0?-1:n<0?r.length-1:0}function b1e(e,t,n,r){var i=C.useRef({isMouseDown:!1,isTouchMove:!1});return C.useEffect(function(){if((n==null?void 0:n.addEventListener)!=null){var a=function(){i.current.isMouseDown=!0},o=function(f){i.current.isMouseDown=!1,e&&!EI(f.target,t.map(function(m){return m.current}),n)&&r()},s=function(){i.current.isTouchMove=!1},u=function(){i.current.isTouchMove=!0},c=function(f){e&&!i.current.isTouchMove&&!EI(f.target,t.map(function(m){return m.current}),n,!1)&&r()};return n.addEventListener("mousedown",a),n.addEventListener("mouseup",o),n.addEventListener("touchstart",s),n.addEventListener("touchmove",u),n.addEventListener("touchend",c),function(){n.removeEventListener("mousedown",a),n.removeEventListener("mouseup",o),n.removeEventListener("touchstart",s),n.removeEventListener("touchmove",u),n.removeEventListener("touchend",c)}}},[e,n]),i}var y1e=function(){return DF};function vI(e,t,n){var r=n.isInitialMount,i=n.highlightedIndex,a=n.items,o=n.environment,s=C1(n,a1e);C.useEffect(function(){r||c1e(function(){return e(nn({highlightedIndex:i,highlightedItem:a[i],resultCount:a.length},s))},o.document)},t)}function E1e(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=C.useRef(!0);return d1e(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var v1e=DF;function _I(e,t,n){var r;n===void 0&&(n=!0);var i=((r=e.items)==null?void 0:r.length)&&t>=0;return nn({isOpen:!1,highlightedIndex:-1},i&&nn({selectedItem:e.items[t],isOpen:bo(e,"isOpen"),highlightedIndex:bo(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function _1e(e,t,n){var r=t.type,i=t.props,a;switch(r){case n.ItemMouseMove:a={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:a={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Yd(i,e,0)};break;case n.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:Yd(i,e,0)};break;case n.FunctionCloseMenu:a={isOpen:!1};break;case n.FunctionSetHighlightedIndex:a={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:a={inputValue:t.inputValue};break;case n.FunctionReset:a={highlightedIndex:bo(i,"highlightedIndex"),isOpen:bo(i,"isOpen"),selectedItem:bo(i,"selectedItem"),inputValue:bo(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return nn({},e,a)}be.array.isRequired,be.func,be.func,be.func,be.number,be.number,be.number,be.bool,be.bool,be.bool,be.any,be.any,be.any,be.string,be.string,be.string,be.func,be.string,be.func,be.func,be.func,be.func,be.func,be.shape({addEventListener:be.func,removeEventListener:be.func,document:be.shape({getElementById:be.func,activeElement:be.any,body:be.any})});function T1e(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(n===1?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}$g($g({},Kd),{getA11yStatusMessage:T1e});var B7=0,U7=1,$7=2,z7=3,H7=4,j7=5,G7=6,V7=7,W7=8,zg=9,q7=10,UF=11,$F=12,K7=13,zF=14,HF=15,jF=16,GF=17,VF=18,Y7=19,WF=20,qF=21,X7=22,KF=Object.freeze({__proto__:null,InputKeyDownArrowDown:B7,InputKeyDownArrowUp:U7,InputKeyDownEscape:$7,InputKeyDownHome:z7,InputKeyDownEnd:H7,InputKeyDownPageUp:j7,InputKeyDownPageDown:G7,InputKeyDownEnter:V7,InputChange:W7,InputBlur:zg,InputFocus:q7,MenuMouseLeave:UF,ItemMouseMove:$F,ItemClick:K7,ToggleButtonClick:zF,FunctionToggleMenu:HF,FunctionOpenMenu:jF,FunctionCloseMenu:GF,FunctionSetHighlightedIndex:VF,FunctionSelectItem:Y7,FunctionSetInputValue:WF,FunctionReset:qF,ControlledPropUpdatedSelectedItem:X7});function S1e(e){var t=m1e(e),n=t.selectedItem,r=t.inputValue;return r===""&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),nn({},t,{inputValue:r})}be.array.isRequired,be.func,be.func,be.func,be.func,be.number,be.number,be.number,be.bool,be.bool,be.bool,be.any,be.any,be.any,be.string,be.string,be.string,be.string,be.string,be.string,be.func,be.string,be.string,be.func,be.func,be.func,be.func,be.func,be.func,be.shape({addEventListener:be.func,removeEventListener:be.func,document:be.shape({getElementById:be.func,activeElement:be.any,body:be.any})});function w1e(e,t,n){var r=C.useRef(),i=g1e(e,t,n),a=i[0],o=i[1];return C.useEffect(function(){MF(n,"selectedItem")&&(n.selectedItemChanged(r.current,n.selectedItem)&&o({type:X7,inputValue:n.itemToString(n.selectedItem)}),r.current=a.selectedItem===r.current?n.selectedItem:a.selectedItem)},[a.selectedItem,n.selectedItem]),[my(a,n),o]}var A1e=nn({},Kd,{selectedItemChanged:function(t,n){return t!==n},getA11yStatusMessage:t1e});function C1e(e,t){var n,r=t.type,i=t.props,a=t.altKey,o;switch(r){case K7:o={isOpen:bo(i,"isOpen"),highlightedIndex:bo(i,"highlightedIndex"),selectedItem:i.items[t.index],inputValue:i.itemToString(i.items[t.index])};break;case B7:e.isOpen?o={highlightedIndex:q0(1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:o={highlightedIndex:a&&e.selectedItem==null?-1:Yd(i,e,1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case U7:e.isOpen?a?o=_I(i,e.highlightedIndex):o={highlightedIndex:q0(-1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:o={highlightedIndex:Yd(i,e,-1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case V7:o=_I(i,e.highlightedIndex);break;case $7:o=nn({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case j7:o={highlightedIndex:q0(-10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case G7:o={highlightedIndex:q0(10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case z7:o={highlightedIndex:Ap(1,0,i.items.length,t.getItemNodeFromIndex,!1)};break;case H7:o={highlightedIndex:Ap(-1,i.items.length-1,i.items.length,t.getItemNodeFromIndex,!1)};break;case zg:o=nn({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((n=i.items)==null?void 0:n.length)&&t.selectItem&&{selectedItem:i.items[e.highlightedIndex],inputValue:i.itemToString(i.items[e.highlightedIndex])});break;case W7:o={isOpen:!0,highlightedIndex:bo(i,"highlightedIndex"),inputValue:t.inputValue};break;case q7:o={isOpen:!0,highlightedIndex:Yd(i,e,0)};break;case Y7:o={selectedItem:t.selectedItem,inputValue:i.itemToString(t.selectedItem)};break;case X7:o={inputValue:t.inputValue};break;default:return _1e(e,t,KF)}return nn({},e,o)}var k1e=["onMouseLeave","refKey","ref"],x1e=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],I1e=["onClick","onPress","refKey","ref"],R1e=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];YF.stateChangeTypes=KF;function YF(e){e===void 0&&(e={});var t=nn({},A1e,e),n=t.initialIsOpen,r=t.defaultIsOpen,i=t.items,a=t.scrollIntoView,o=t.environment,s=t.getA11yStatusMessage,u=t.getA11ySelectionMessage,c=t.itemToString,p=S1e(t),f=w1e(C1e,p,t),m=f[0],g=f[1],b=m.isOpen,y=m.highlightedIndex,T=m.selectedItem,E=m.inputValue,v=C.useRef(null),w=C.useRef({}),A=C.useRef(null),R=C.useRef(null),k=C.useRef(!0),N=p1e(t),B=C.useRef(),q=BF({state:m,props:t}),P=C.useCallback(function(ke){return w.current[N.getItemId(ke)]},[N]);vI(s,[b,y,E,i],nn({isInitialMount:k.current,previousResultCount:B.current,items:i,environment:o,itemToString:c},m)),vI(u,[T],nn({isInitialMount:k.current,previousResultCount:B.current,items:i,environment:o,itemToString:c},m));var Q=E1e({menuElement:v.current,highlightedIndex:y,isOpen:b,itemRefs:w,scrollIntoView:a,getItemNodeFromIndex:P});v1e({isInitialMount:k.current,props:t,state:m}),C.useEffect(function(){var ke=n||r||b;ke&&A.current&&A.current.focus()},[]),C.useEffect(function(){k.current||(B.current=i.length)});var $=b1e(b,[A,v,R],o,function(){g({type:zg,selectItem:!1})}),oe=y1e();C.useEffect(function(){return k.current=!1,function(){k.current=!0}},[]),C.useEffect(function(){var ke;if(!b)w.current={};else if(((ke=o.document)==null?void 0:ke.activeElement)!==A.current){var te;A==null||(te=A.current)==null||te.focus()}},[b,o]);var fe=C.useMemo(function(){return{ArrowDown:function(te){te.preventDefault(),g({type:B7,altKey:te.altKey,getItemNodeFromIndex:P})},ArrowUp:function(te){te.preventDefault(),g({type:U7,altKey:te.altKey,getItemNodeFromIndex:P})},Home:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:z7,getItemNodeFromIndex:P}))},End:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:H7,getItemNodeFromIndex:P}))},Escape:function(te){var Me=q.current.state;(Me.isOpen||Me.inputValue||Me.selectedItem||Me.highlightedIndex>-1)&&(te.preventDefault(),g({type:$7}))},Enter:function(te){var Me=q.current.state;!Me.isOpen||te.which===229||(te.preventDefault(),g({type:V7,getItemNodeFromIndex:P}))},PageUp:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:j7,getItemNodeFromIndex:P}))},PageDown:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:G7,getItemNodeFromIndex:P}))}}},[g,q,P]),ce=C.useCallback(function(ke){return nn({id:N.labelId,htmlFor:N.inputId},ke)},[N]),De=C.useCallback(function(ke,te){var Me,Re=ke===void 0?{}:ke,Ze=Re.onMouseLeave,We=Re.refKey,dt=We===void 0?"ref":We,ot=Re.ref,je=C1(Re,k1e),pt=te===void 0?{}:te;return pt.suppressRefError,nn((Me={},Me[dt]=W0(ot,function(U){v.current=U}),Me.id=N.menuId,Me.role="listbox",Me["aria-labelledby"]=je&&je["aria-label"]?void 0:""+N.labelId,Me.onMouseLeave=qo(Ze,function(){g({type:UF})}),Me),je)},[g,oe,N]),H=C.useCallback(function(ke){var te,Me,Re=ke===void 0?{}:ke,Ze=Re.item,We=Re.index,dt=Re.refKey,ot=dt===void 0?"ref":dt,je=Re.ref,pt=Re.onMouseMove,U=Re.onMouseDown,re=Re.onClick;Re.onPress;var de=Re.disabled,xe=C1(Re,x1e),ye=q.current,Te=ye.props,Le=ye.state,ze=f1e(Ze,We,Te.items,"Pass either item or index to getItemProps!"),Ye=ze[1],jt="onClick",ue=re,Ee=function(){Ye!==Le.highlightedIndex&&(Q.current=!1,g({type:$F,index:Ye,disabled:de}))},qe=function(){g({type:K7,index:Ye})},j=function(Ve){return Ve.preventDefault()};return nn((te={},te[ot]=W0(je,function(me){me&&(w.current[N.getItemId(Ye)]=me)}),te.disabled=de,te.role="option",te["aria-selected"]=""+(Ye===Le.highlightedIndex),te.id=N.getItemId(Ye),te),!de&&(Me={},Me[jt]=qo(ue,qe),Me),{onMouseMove:qo(pt,Ee),onMouseDown:qo(U,j)},xe)},[g,q,Q,N]),W=C.useCallback(function(ke){var te,Me=ke===void 0?{}:ke,Re=Me.onClick;Me.onPress;var Ze=Me.refKey,We=Ze===void 0?"ref":Ze,dt=Me.ref,ot=C1(Me,I1e),je=q.current.state,pt=function(){g({type:zF})};return nn((te={},te[We]=W0(dt,function(U){R.current=U}),te["aria-controls"]=N.menuId,te["aria-expanded"]=je.isOpen,te.id=N.toggleButtonId,te.tabIndex=-1,te),!ot.disabled&&nn({},{onClick:qo(Re,pt)}),ot)},[g,q,N]),se=C.useCallback(function(ke,te){var Me,Re=ke===void 0?{}:ke,Ze=Re.onKeyDown,We=Re.onChange,dt=Re.onInput,ot=Re.onFocus,je=Re.onBlur;Re.onChangeText;var pt=Re.refKey,U=pt===void 0?"ref":pt,re=Re.ref,de=C1(Re,R1e),xe=te===void 0?{}:te;xe.suppressRefError;var ye=q.current.state,Te=function(j){var me=n1e(j);me&&fe[me]&&fe[me](j)},Le=function(j){g({type:W7,inputValue:j.target.value})},ze=function(j){if(ye.isOpen&&!$.current.isMouseDown){var me=j.relatedTarget===null&&o.document.activeElement!==o.document.body;g({type:zg,selectItem:!me})}},Ye=function(){ye.isOpen||g({type:q7})},jt="onChange",ue={};if(!de.disabled){var Ee;ue=(Ee={},Ee[jt]=qo(We,dt,Le),Ee.onKeyDown=qo(Ze,Te),Ee.onBlur=qo(je,ze),Ee.onFocus=qo(ot,Ye),Ee)}return nn((Me={},Me[U]=W0(re,function(qe){A.current=qe}),Me["aria-activedescendant"]=ye.isOpen&&ye.highlightedIndex>-1?N.getItemId(ye.highlightedIndex):"",Me["aria-autocomplete"]="list",Me["aria-controls"]=N.menuId,Me["aria-expanded"]=ye.isOpen,Me["aria-labelledby"]=de&&de["aria-label"]?void 0:""+N.labelId,Me.autoComplete="off",Me.id=N.inputId,Me.role="combobox",Me.value=ye.inputValue,Me),ue,de)},[oe,q,N,fe,g,$,o]),D=C.useCallback(function(){g({type:HF})},[g]),pe=C.useCallback(function(){g({type:GF})},[g]),le=C.useCallback(function(){g({type:jF})},[g]),L=C.useCallback(function(ke){g({type:VF,highlightedIndex:ke})},[g]),ie=C.useCallback(function(ke){g({type:Y7,selectedItem:ke})},[g]),Se=C.useCallback(function(ke){g({type:WF,inputValue:ke})},[g]),X=C.useCallback(function(){g({type:qF})},[g]);return{getItemProps:H,getLabelProps:ce,getMenuProps:De,getInputProps:se,getToggleButtonProps:W,toggleMenu:D,openMenu:le,closeMenu:pe,setHighlightedIndex:L,setInputValue:Se,selectItem:ie,reset:X,highlightedIndex:y,isOpen:b,selectedItem:T,inputValue:E}}function N1e(e){var t=e.removedSelectedItem,n=e.itemToString;return n(t)+" has been removed."}be.array,be.array,be.array,be.func,be.func,be.func,be.number,be.number,be.number,be.func,be.func,be.string,be.string,be.shape({addEventListener:be.func,removeEventListener:be.func,document:be.shape({getElementById:be.func,activeElement:be.any,body:be.any})});Kd.itemToString,Kd.stateReducer,Kd.environment;/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */const{entries:XF,setPrototypeOf:TI,isFrozen:O1e,getPrototypeOf:D1e,getOwnPropertyDescriptor:ZF}=Object;let{freeze:ii,seal:Ya,create:QF}=Object,{apply:by,construct:yy}=typeof Reflect<"u"&&Reflect;ii||(ii=function(t){return t});Ya||(Ya=function(t){return t});by||(by=function(t,n,r){return t.apply(n,r)});yy||(yy=function(t,n){return new t(...n)});const Y0=va(Array.prototype.forEach),SI=va(Array.prototype.pop),ld=va(Array.prototype.push),Fh=va(String.prototype.toLowerCase),c4=va(String.prototype.toString),L1e=va(String.prototype.match),ud=va(String.prototype.replace),M1e=va(String.prototype.indexOf),F1e=va(String.prototype.trim),Ni=va(RegExp.prototype.test),cd=P1e(TypeError);function va(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:Fh;TI&&TI(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(O1e(t)||(t[r]=a),i=a)}e[i]=!0}return e}function r1(e){const t=QF(null);for(const[n,r]of XF(e))ZF(e,n)!==void 0&&(t[n]=r);return t}function X0(e,t){for(;e!==null;){const r=ZF(e,t);if(r){if(r.get)return va(r.get);if(typeof r.value=="function")return va(r.value)}e=D1e(e)}function n(r){return console.warn("fallback value for",r),null}return n}const wI=ii(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),d4=ii(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),p4=ii(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),B1e=ii(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),f4=ii(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),U1e=ii(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),AI=ii(["#text"]),CI=ii(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),h4=ii(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),kI=ii(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Z0=ii(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$1e=Ya(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z1e=Ya(/<%[\w\W]*|[\w\W]*%>/gm),H1e=Ya(/\${[\w\W]*}/gm),j1e=Ya(/^data-[\-\w.\u00B7-\uFFFF]/),G1e=Ya(/^aria-[\-\w]+$/),JF=Ya(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V1e=Ya(/^(?:\w+script|data):/i),W1e=Ya(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),eP=Ya(/^html$/i);var xI=Object.freeze({__proto__:null,MUSTACHE_EXPR:$1e,ERB_EXPR:z1e,TMPLIT_EXPR:H1e,DATA_ATTR:j1e,ARIA_ATTR:G1e,IS_ALLOWED_URI:JF,IS_SCRIPT_OR_DATA:V1e,ATTR_WHITESPACE:W1e,DOCTYPE_NAME:eP});const q1e=function(){return typeof window>"u"?null:window},K1e=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function tP(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q1e();const t=Ke=>tP(Ke);if(t.version="3.0.6",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:u,NodeFilter:c,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:m,trustedTypes:g}=e,b=u.prototype,y=X0(b,"cloneNode"),T=X0(b,"nextSibling"),E=X0(b,"childNodes"),v=X0(b,"parentNode");if(typeof o=="function"){const Ke=n.createElement("template");Ke.content&&Ke.content.ownerDocument&&(n=Ke.content.ownerDocument)}let w,A="";const{implementation:R,createNodeIterator:k,createDocumentFragment:N,getElementsByTagName:B}=n,{importNode:q}=r;let P={};t.isSupported=typeof XF=="function"&&typeof v=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Q,ERB_EXPR:$,TMPLIT_EXPR:oe,DATA_ATTR:fe,ARIA_ATTR:ce,IS_SCRIPT_OR_DATA:De,ATTR_WHITESPACE:H}=xI;let{IS_ALLOWED_URI:W}=xI,se=null;const D=At({},[...wI,...d4,...p4,...f4,...AI]);let pe=null;const le=At({},[...CI,...h4,...kI,...Z0]);let L=Object.seal(QF(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ie=null,Se=null,X=!0,ke=!0,te=!1,Me=!0,Re=!1,Ze=!1,We=!1,dt=!1,ot=!1,je=!1,pt=!1,U=!0,re=!1;const de="user-content-";let xe=!0,ye=!1,Te={},Le=null;const ze=At({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const jt=At({},["audio","video","img","source","image","track"]);let ue=null;const Ee=At({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qe="http://www.w3.org/1998/Math/MathML",j="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let Ve=me,ge=!1,G=null;const K=At({},[qe,j,me],c4);let ne=null;const ve=["application/xhtml+xml","text/html"],Qe="text/html";let Fe=null,at=null;const rt=n.createElement("form"),Je=function(J){return J instanceof RegExp||J instanceof Function},Rt=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(at&&at===J)){if((!J||typeof J!="object")&&(J={}),J=r1(J),ne=ve.indexOf(J.PARSER_MEDIA_TYPE)===-1?ne=Qe:ne=J.PARSER_MEDIA_TYPE,Fe=ne==="application/xhtml+xml"?c4:Fh,se="ALLOWED_TAGS"in J?At({},J.ALLOWED_TAGS,Fe):D,pe="ALLOWED_ATTR"in J?At({},J.ALLOWED_ATTR,Fe):le,G="ALLOWED_NAMESPACES"in J?At({},J.ALLOWED_NAMESPACES,c4):K,ue="ADD_URI_SAFE_ATTR"in J?At(r1(Ee),J.ADD_URI_SAFE_ATTR,Fe):Ee,Ye="ADD_DATA_URI_TAGS"in J?At(r1(jt),J.ADD_DATA_URI_TAGS,Fe):jt,Le="FORBID_CONTENTS"in J?At({},J.FORBID_CONTENTS,Fe):ze,ie="FORBID_TAGS"in J?At({},J.FORBID_TAGS,Fe):{},Se="FORBID_ATTR"in J?At({},J.FORBID_ATTR,Fe):{},Te="USE_PROFILES"in J?J.USE_PROFILES:!1,X=J.ALLOW_ARIA_ATTR!==!1,ke=J.ALLOW_DATA_ATTR!==!1,te=J.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=J.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Re=J.SAFE_FOR_TEMPLATES||!1,Ze=J.WHOLE_DOCUMENT||!1,ot=J.RETURN_DOM||!1,je=J.RETURN_DOM_FRAGMENT||!1,pt=J.RETURN_TRUSTED_TYPE||!1,dt=J.FORCE_BODY||!1,U=J.SANITIZE_DOM!==!1,re=J.SANITIZE_NAMED_PROPS||!1,xe=J.KEEP_CONTENT!==!1,ye=J.IN_PLACE||!1,W=J.ALLOWED_URI_REGEXP||JF,Ve=J.NAMESPACE||me,L=J.CUSTOM_ELEMENT_HANDLING||{},J.CUSTOM_ELEMENT_HANDLING&&Je(J.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(L.tagNameCheck=J.CUSTOM_ELEMENT_HANDLING.tagNameCheck),J.CUSTOM_ELEMENT_HANDLING&&Je(J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(L.attributeNameCheck=J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),J.CUSTOM_ELEMENT_HANDLING&&typeof J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Re&&(ke=!1),je&&(ot=!0),Te&&(se=At({},[...AI]),pe=[],Te.html===!0&&(At(se,wI),At(pe,CI)),Te.svg===!0&&(At(se,d4),At(pe,h4),At(pe,Z0)),Te.svgFilters===!0&&(At(se,p4),At(pe,h4),At(pe,Z0)),Te.mathMl===!0&&(At(se,f4),At(pe,kI),At(pe,Z0))),J.ADD_TAGS&&(se===D&&(se=r1(se)),At(se,J.ADD_TAGS,Fe)),J.ADD_ATTR&&(pe===le&&(pe=r1(pe)),At(pe,J.ADD_ATTR,Fe)),J.ADD_URI_SAFE_ATTR&&At(ue,J.ADD_URI_SAFE_ATTR,Fe),J.FORBID_CONTENTS&&(Le===ze&&(Le=r1(Le)),At(Le,J.FORBID_CONTENTS,Fe)),xe&&(se["#text"]=!0),Ze&&At(se,["html","head","body"]),se.table&&(At(se,["tbody"]),delete ie.tbody),J.TRUSTED_TYPES_POLICY){if(typeof J.TRUSTED_TYPES_POLICY.createHTML!="function")throw cd('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof J.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw cd('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=J.TRUSTED_TYPES_POLICY,A=w.createHTML("")}else w===void 0&&(w=K1e(g,i)),w!==null&&typeof A=="string"&&(A=w.createHTML(""));ii&&ii(J),at=J}},Qt=At({},["mi","mo","mn","ms","mtext"]),kt=At({},["foreignobject","desc","title","annotation-xml"]),rn=At({},["title","style","font","a","script"]),Xt=At({},d4);At(Xt,p4),At(Xt,B1e);const Wr=At({},f4);At(Wr,U1e);const qr=function(J){let Be=v(J);(!Be||!Be.tagName)&&(Be={namespaceURI:Ve,tagName:"template"});const it=Fh(J.tagName),un=Fh(Be.tagName);return G[J.namespaceURI]?J.namespaceURI===j?Be.namespaceURI===me?it==="svg":Be.namespaceURI===qe?it==="svg"&&(un==="annotation-xml"||Qt[un]):!!Xt[it]:J.namespaceURI===qe?Be.namespaceURI===me?it==="math":Be.namespaceURI===j?it==="math"&&kt[un]:!!Wr[it]:J.namespaceURI===me?Be.namespaceURI===j&&!kt[un]||Be.namespaceURI===qe&&!Qt[un]?!1:!Wr[it]&&(rn[it]||!Xt[it]):!!(ne==="application/xhtml+xml"&&G[J.namespaceURI]):!1},Kr=function(J){ld(t.removed,{element:J});try{J.parentNode.removeChild(J)}catch{J.remove()}},Aa=function(J,Be){try{ld(t.removed,{attribute:Be.getAttributeNode(J),from:Be})}catch{ld(t.removed,{attribute:null,from:Be})}if(Be.removeAttribute(J),J==="is"&&!pe[J])if(ot||je)try{Kr(Be)}catch{}else try{Be.setAttribute(J,"")}catch{}},si=function(J){let Be=null,it=null;if(dt)J=""+J;else{const or=L1e(J,/^[\r\n\t ]+/);it=or&&or[0]}ne==="application/xhtml+xml"&&Ve===me&&(J=''+J+"");const un=w?w.createHTML(J):J;if(Ve===me)try{Be=new m().parseFromString(un,ne)}catch{}if(!Be||!Be.documentElement){Be=R.createDocument(Ve,"template",null);try{Be.documentElement.innerHTML=ge?A:un}catch{}}const ar=Be.body||Be.documentElement;return J&&it&&ar.insertBefore(n.createTextNode(it),ar.childNodes[0]||null),Ve===me?B.call(Be,Ze?"html":"body")[0]:Ze?Be.documentElement:ar},Or=function(J){return k.call(J.ownerDocument||J,J,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null)},Es=function(J){return J instanceof f&&(typeof J.nodeName!="string"||typeof J.textContent!="string"||typeof J.removeChild!="function"||!(J.attributes instanceof p)||typeof J.removeAttribute!="function"||typeof J.setAttribute!="function"||typeof J.namespaceURI!="string"||typeof J.insertBefore!="function"||typeof J.hasChildNodes!="function")},vs=function(J){return typeof s=="function"&&J instanceof s},Yr=function(J,Be,it){P[J]&&Y0(P[J],un=>{un.call(t,Be,it,at)})},_s=function(J){let Be=null;if(Yr("beforeSanitizeElements",J,null),Es(J))return Kr(J),!0;const it=Fe(J.nodeName);if(Yr("uponSanitizeElement",J,{tagName:it,allowedTags:se}),J.hasChildNodes()&&!vs(J.firstElementChild)&&Ni(/<[/\w]/g,J.innerHTML)&&Ni(/<[/\w]/g,J.textContent))return Kr(J),!0;if(!se[it]||ie[it]){if(!ie[it]&&Dr(it)&&(L.tagNameCheck instanceof RegExp&&Ni(L.tagNameCheck,it)||L.tagNameCheck instanceof Function&&L.tagNameCheck(it)))return!1;if(xe&&!Le[it]){const un=v(J)||J.parentNode,ar=E(J)||J.childNodes;if(ar&&un){const or=ar.length;for(let Zn=or-1;Zn>=0;--Zn)un.insertBefore(y(ar[Zn],!0),T(J))}}return Kr(J),!0}return J instanceof u&&!qr(J)||(it==="noscript"||it==="noembed"||it==="noframes")&&Ni(/<\/no(script|embed|frames)/i,J.innerHTML)?(Kr(J),!0):(Re&&J.nodeType===3&&(Be=J.textContent,Y0([Q,$,oe],un=>{Be=ud(Be,un," ")}),J.textContent!==Be&&(ld(t.removed,{element:J.cloneNode()}),J.textContent=Be)),Yr("afterSanitizeElements",J,null),!1)},qt=function(J,Be,it){if(U&&(Be==="id"||Be==="name")&&(it in n||it in rt))return!1;if(!(ke&&!Se[Be]&&Ni(fe,Be))){if(!(X&&Ni(ce,Be))){if(!pe[Be]||Se[Be]){if(!(Dr(J)&&(L.tagNameCheck instanceof RegExp&&Ni(L.tagNameCheck,J)||L.tagNameCheck instanceof Function&&L.tagNameCheck(J))&&(L.attributeNameCheck instanceof RegExp&&Ni(L.attributeNameCheck,Be)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(Be))||Be==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&Ni(L.tagNameCheck,it)||L.tagNameCheck instanceof Function&&L.tagNameCheck(it))))return!1}else if(!ue[Be]){if(!Ni(W,ud(it,H,""))){if(!((Be==="src"||Be==="xlink:href"||Be==="href")&&J!=="script"&&M1e(it,"data:")===0&&Ye[J])){if(!(te&&!Ni(De,ud(it,H,"")))){if(it)return!1}}}}}}return!0},Dr=function(J){return J.indexOf("-")>0},Si=function(J){Yr("beforeSanitizeAttributes",J,null);const{attributes:Be}=J;if(!Be)return;const it={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:pe};let un=Be.length;for(;un--;){const ar=Be[un],{name:or,namespaceURI:Zn,value:Oo}=ar,no=Fe(or);let Lr=or==="value"?Oo:F1e(Oo);if(it.attrName=no,it.attrValue=Lr,it.keepAttr=!0,it.forceKeepAttr=void 0,Yr("uponSanitizeAttribute",J,it),Lr=it.attrValue,it.forceKeepAttr||(Aa(or,J),!it.keepAttr))continue;if(!Me&&Ni(/\/>/i,Lr)){Aa(or,J);continue}Re&&Y0([Q,$,oe],vf=>{Lr=ud(Lr,vf," ")});const Ef=Fe(J.nodeName);if(qt(Ef,no,Lr)){if(re&&(no==="id"||no==="name")&&(Aa(or,J),Lr=de+Lr),w&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Zn)switch(g.getAttributeType(Ef,no)){case"TrustedHTML":{Lr=w.createHTML(Lr);break}case"TrustedScriptURL":{Lr=w.createScriptURL(Lr);break}}try{Zn?J.setAttributeNS(Zn,or,Lr):J.setAttribute(or,Lr),SI(t.removed)}catch{}}}Yr("afterSanitizeAttributes",J,null)},Nl=function Ke(J){let Be=null;const it=Or(J);for(Yr("beforeSanitizeShadowDOM",J,null);Be=it.nextNode();)Yr("uponSanitizeShadowNode",Be,null),!_s(Be)&&(Be.content instanceof a&&Ke(Be.content),Si(Be));Yr("afterSanitizeShadowDOM",J,null)};return t.sanitize=function(Ke){let J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Be=null,it=null,un=null,ar=null;if(ge=!Ke,ge&&(Ke=""),typeof Ke!="string"&&!vs(Ke))if(typeof Ke.toString=="function"){if(Ke=Ke.toString(),typeof Ke!="string")throw cd("dirty is not a string, aborting")}else throw cd("toString is not a function");if(!t.isSupported)return Ke;if(We||Rt(J),t.removed=[],typeof Ke=="string"&&(ye=!1),ye){if(Ke.nodeName){const Oo=Fe(Ke.nodeName);if(!se[Oo]||ie[Oo])throw cd("root node is forbidden and cannot be sanitized in-place")}}else if(Ke instanceof s)Be=si(""),it=Be.ownerDocument.importNode(Ke,!0),it.nodeType===1&&it.nodeName==="BODY"||it.nodeName==="HTML"?Be=it:Be.appendChild(it);else{if(!ot&&!Re&&!Ze&&Ke.indexOf("<")===-1)return w&&pt?w.createHTML(Ke):Ke;if(Be=si(Ke),!Be)return ot?null:pt?A:""}Be&&dt&&Kr(Be.firstChild);const or=Or(ye?Ke:Be);for(;un=or.nextNode();)_s(un)||(un.content instanceof a&&Nl(un.content),Si(un));if(ye)return Ke;if(ot){if(je)for(ar=N.call(Be.ownerDocument);Be.firstChild;)ar.appendChild(Be.firstChild);else ar=Be;return(pe.shadowroot||pe.shadowrootmode)&&(ar=q.call(r,ar,!0)),ar}let Zn=Ze?Be.outerHTML:Be.innerHTML;return Ze&&se["!doctype"]&&Be.ownerDocument&&Be.ownerDocument.doctype&&Be.ownerDocument.doctype.name&&Ni(eP,Be.ownerDocument.doctype.name)&&(Zn=" + */var R2=60103,N2=60106,nf=60107,rf=60108,af=60114,of=60109,sf=60110,lf=60112,uf=60113,F7=60120,cf=60115,df=60116,xF=60121,IF=60122,RF=60117,NF=60129,OF=60131;if(typeof Symbol=="function"&&Symbol.for){var yr=Symbol.for;R2=yr("react.element"),N2=yr("react.portal"),nf=yr("react.fragment"),rf=yr("react.strict_mode"),af=yr("react.profiler"),of=yr("react.provider"),sf=yr("react.context"),lf=yr("react.forward_ref"),uf=yr("react.suspense"),F7=yr("react.suspense_list"),cf=yr("react.memo"),df=yr("react.lazy"),xF=yr("react.block"),IF=yr("react.server.block"),RF=yr("react.fundamental"),NF=yr("react.debug_trace_mode"),OF=yr("react.legacy_hidden")}function Ja(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case R2:switch(e=e.type,e){case nf:case af:case rf:case uf:case F7:return e;default:switch(e=e&&e.$$typeof,e){case sf:case lf:case df:case cf:case of:return e;default:return t}}case N2:return t}}}var $ue=of,zue=R2,Hue=lf,jue=nf,Gue=df,Vue=cf,Wue=N2,que=af,Kue=rf,Yue=uf;yn.ContextConsumer=sf;yn.ContextProvider=$ue;yn.Element=zue;yn.ForwardRef=Hue;yn.Fragment=jue;yn.Lazy=Gue;yn.Memo=Vue;yn.Portal=Wue;yn.Profiler=que;yn.StrictMode=Kue;yn.Suspense=Yue;yn.isAsyncMode=function(){return!1};yn.isConcurrentMode=function(){return!1};yn.isContextConsumer=function(e){return Ja(e)===sf};yn.isContextProvider=function(e){return Ja(e)===of};yn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===R2};yn.isForwardRef=function(e){return Ja(e)===lf};yn.isFragment=function(e){return Ja(e)===nf};yn.isLazy=function(e){return Ja(e)===df};yn.isMemo=function(e){return Ja(e)===cf};yn.isPortal=function(e){return Ja(e)===N2};yn.isProfiler=function(e){return Ja(e)===af};yn.isStrictMode=function(e){return Ja(e)===rf};yn.isSuspense=function(e){return Ja(e)===uf};yn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===nf||e===af||e===NF||e===rf||e===uf||e===F7||e===OF||typeof e=="object"&&e!==null&&(e.$$typeof===df||e.$$typeof===cf||e.$$typeof===of||e.$$typeof===sf||e.$$typeof===lf||e.$$typeof===RF||e.$$typeof===xF||e[0]===IF)};yn.typeOf=Ja;let mI=e=>typeof e=="object"&&e!=null&&e.nodeType===1,bI=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",u4=(e,t)=>{if(e.clientHeight{let i=(a=>{if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeightat||a>e&&o=t&&s>=n?a-e-r:o>t&&sn?o-t+i:0,Xue=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)};var Zue=(e,t)=>{var n,r,i,a,o,s;if(typeof document>"u")return[];let{scrollMode:u,block:c,inline:p,boundary:f,skipOverflowHiddenElements:m}=t,g=typeof f=="function"?f:fe=>fe!==f;if(!mI(e))throw new TypeError("Invalid target");let b=document.scrollingElement||document.documentElement,y=[],T=e;for(;mI(T)&&g(T);){if(T=Xue(T),T===b){y.push(T);break}T!=null&&T===document.body&&u4(T)&&!u4(document.documentElement)||T!=null&&u4(T,m)&&y.push(T)}let E=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,v=(a=(i=window.visualViewport)==null?void 0:i.height)!=null?a:innerHeight,w=(o=window.scrollX)!=null?o:pageXOffset,A=(s=window.scrollY)!=null?s:pageYOffset,{height:R,width:k,top:N,right:B,bottom:q,left:P}=e.getBoundingClientRect(),Q=c==="start"||c==="nearest"?N:c==="end"?q:N+R/2,$=p==="center"?P+k/2:p==="end"?B:P,oe=[];for(let fe=0;fe=0&&P>=0&&q<=v&&B<=E&&N>=W&&q<=D&&P>=pe&&B<=se)return oe;let le=getComputedStyle(ce),L=parseInt(le.borderLeftWidth,10),ie=parseInt(le.borderTopWidth,10),Se=parseInt(le.borderRightWidth,10),X=parseInt(le.borderBottomWidth,10),ke=0,te=0,Me="offsetWidth"in ce?ce.offsetWidth-ce.clientWidth-L-Se:0,Re="offsetHeight"in ce?ce.offsetHeight-ce.clientHeight-ie-X:0,Ye="offsetWidth"in ce?ce.offsetWidth===0?0:H/ce.offsetWidth:0,We="offsetHeight"in ce?ce.offsetHeight===0?0:De/ce.offsetHeight:0;if(b===ce)ke=c==="start"?Q:c==="end"?Q-v:c==="nearest"?V0(A,A+v,v,ie,X,A+Q,A+Q+R,R):Q-v/2,te=p==="start"?$:p==="center"?$-E/2:p==="end"?$-E:V0(w,w+E,E,L,Se,w+$,w+$+k,k),ke=Math.max(0,ke+A),te=Math.max(0,te+w);else{ke=c==="start"?Q-W-ie:c==="end"?Q-D+X+Re:c==="nearest"?V0(W,D,De,ie,X+Re,Q,Q+R,R):Q-(W+De/2)+Re/2,te=p==="start"?$-pe-L:p==="center"?$-(pe+H/2)+Me/2:p==="end"?$-se+Se+Me:V0(pe,se,H,L,Se+Me,$,$+k,k);let{scrollLeft:dt,scrollTop:ot}=ce;ke=Math.max(0,Math.min(ot+ke/We,ce.scrollHeight-De/We+Re)),te=Math.max(0,Math.min(dt+te/Ye,ce.scrollWidth-H/Ye+Me)),Q+=ot-ke,$+=dt-te}oe.push({el:ce,top:ke,left:te})}return oe},$g=function(){return $g=Object.assign||function(t){for(var n,r=1,i=arguments.length;r1?i-1:0),o=1;o=37&&n<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function q0(e,t,n,r,i){if(i===void 0&&(i=!0),n===0)return-1;var a=n-1;(typeof t!="number"||t<0||t>=n)&&(t=e>0?-1:a+1);var o=t+e;o<0?o=i?a:0:o>a&&(o=i?0:a);var s=Ap(e,o,n,r,i);return s===-1?t>=n?-1:t:s}function Ap(e,t,n,r,i){var a=r(t);if(!a||!a.hasAttribute("disabled"))return t;if(e>0){for(var o=t+1;o=0;s--)if(!r(s).hasAttribute("disabled"))return s;return i?e>0?Ap(1,0,n,r,!1):Ap(-1,n-1,n,r,!1):-1}function EI(e,t,n,r){return r===void 0&&(r=!0),t.some(function(i){return i&&(yI(i,e,n)||r&&yI(i,n.document.activeElement,n))})}var r1e=LF(function(e){FF(e).textContent=""},500);function i1e(e,t){var n=FF(t);e&&(n.textContent=e,r1e(t))}function FF(e){e===void 0&&(e=document);var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}var a1e=["isInitialMount","highlightedIndex","items","environment"],PF={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""};function o1e(e,t,n){var r=e.props,i=e.type,a={};Object.keys(t).forEach(function(o){s1e(o,e,t,n),n[o]!==t[o]&&(a[o]=n[o])}),r.onStateChange&&Object.keys(a).length&&r.onStateChange(nn({type:i},a))}function s1e(e,t,n,r){var i=t.props,a=t.type,o="on"+P7(e)+"Change";i[o]&&r[e]!==void 0&&r[e]!==n[e]&&i[o](nn({type:a},r))}function l1e(e,t){return t.changes}function u1e(e){var t=e.selectedItem,n=e.itemToString;return t?n(t)+" has been selected.":""}var c1e=LF(function(e,t){i1e(e(),t)},200),d1e=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?C.useLayoutEffect:C.useEffect;function p1e(e){var t=e.id,n=t===void 0?"downshift-"+e1e():t,r=e.labelId,i=e.menuId,a=e.getItemId,o=e.toggleButtonId,s=e.inputId,u=C.useRef({labelId:r||n+"-label",menuId:i||n+"-menu",getItemId:a||function(c){return n+"-item-"+c},toggleButtonId:o||n+"-toggle-button",inputId:s||n+"-input"});return u.current}function f1e(e,t,n,r){var i,a;if(e===void 0){if(t===void 0)throw new Error(r);i=n[t],a=t}else a=t===void 0?n.indexOf(e):t,i=e;return[i,a]}function h1e(e){return e?String(e):""}function P7(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function BF(e){var t=C.useRef(e);return t.current=e,t}function g1e(e,t,n){var r=C.useRef(),i=C.useRef(),a=C.useCallback(function(m,g){i.current=g,m=my(m,g.props);var b=e(m,g),y=g.props.stateReducer(m,nn({},g,{changes:b}));return y},[e]),o=C.useReducer(a,t),s=o[0],u=o[1],c=BF(n),p=C.useCallback(function(m){return u(nn({props:c.current},m))},[c]),f=i.current;return C.useEffect(function(){f&&r.current&&r.current!==s&&o1e(f,my(r.current,f.props),s),r.current=s},[s,n,f]),[s,p]}var Kd={itemToString:h1e,stateReducer:l1e,getA11ySelectionMessage:u1e,scrollIntoView:Jue,environment:typeof window>"u"?{}:window};function bo(e,t,n){n===void 0&&(n=PF);var r=e["default"+P7(t)];return r!==void 0?r:n[t]}function K0(e,t,n){n===void 0&&(n=PF);var r=e[t];if(r!==void 0)return r;var i=e["initial"+P7(t)];return i!==void 0?i:bo(e,t,n)}function m1e(e){var t=K0(e,"selectedItem"),n=K0(e,"isOpen"),r=K0(e,"highlightedIndex"),i=K0(e,"inputValue");return{highlightedIndex:r<0&&t&&n?e.items.indexOf(t):r,isOpen:n,selectedItem:t,inputValue:i}}function Yd(e,t,n){var r=e.items,i=e.initialHighlightedIndex,a=e.defaultHighlightedIndex,o=t.selectedItem,s=t.highlightedIndex;return r.length===0?-1:i!==void 0&&s===i?i:a!==void 0?a:o?r.indexOf(o):n===0?-1:n<0?r.length-1:0}function b1e(e,t,n,r){var i=C.useRef({isMouseDown:!1,isTouchMove:!1});return C.useEffect(function(){if((n==null?void 0:n.addEventListener)!=null){var a=function(){i.current.isMouseDown=!0},o=function(f){i.current.isMouseDown=!1,e&&!EI(f.target,t.map(function(m){return m.current}),n)&&r()},s=function(){i.current.isTouchMove=!1},u=function(){i.current.isTouchMove=!0},c=function(f){e&&!i.current.isTouchMove&&!EI(f.target,t.map(function(m){return m.current}),n,!1)&&r()};return n.addEventListener("mousedown",a),n.addEventListener("mouseup",o),n.addEventListener("touchstart",s),n.addEventListener("touchmove",u),n.addEventListener("touchend",c),function(){n.removeEventListener("mousedown",a),n.removeEventListener("mouseup",o),n.removeEventListener("touchstart",s),n.removeEventListener("touchmove",u),n.removeEventListener("touchend",c)}}},[e,n]),i}var y1e=function(){return DF};function vI(e,t,n){var r=n.isInitialMount,i=n.highlightedIndex,a=n.items,o=n.environment,s=C1(n,a1e);C.useEffect(function(){r||c1e(function(){return e(nn({highlightedIndex:i,highlightedItem:a[i],resultCount:a.length},s))},o.document)},t)}function E1e(e){var t=e.highlightedIndex,n=e.isOpen,r=e.itemRefs,i=e.getItemNodeFromIndex,a=e.menuElement,o=e.scrollIntoView,s=C.useRef(!0);return d1e(function(){t<0||!n||!Object.keys(r.current).length||(s.current===!1?s.current=!0:o(i(t),a))},[t]),s}var v1e=DF;function _I(e,t,n){var r;n===void 0&&(n=!0);var i=((r=e.items)==null?void 0:r.length)&&t>=0;return nn({isOpen:!1,highlightedIndex:-1},i&&nn({selectedItem:e.items[t],isOpen:bo(e,"isOpen"),highlightedIndex:bo(e,"highlightedIndex")},n&&{inputValue:e.itemToString(e.items[t])}))}function _1e(e,t,n){var r=t.type,i=t.props,a;switch(r){case n.ItemMouseMove:a={highlightedIndex:t.disabled?-1:t.index};break;case n.MenuMouseLeave:a={highlightedIndex:-1};break;case n.ToggleButtonClick:case n.FunctionToggleMenu:a={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Yd(i,e,0)};break;case n.FunctionOpenMenu:a={isOpen:!0,highlightedIndex:Yd(i,e,0)};break;case n.FunctionCloseMenu:a={isOpen:!1};break;case n.FunctionSetHighlightedIndex:a={highlightedIndex:t.highlightedIndex};break;case n.FunctionSetInputValue:a={inputValue:t.inputValue};break;case n.FunctionReset:a={highlightedIndex:bo(i,"highlightedIndex"),isOpen:bo(i,"isOpen"),selectedItem:bo(i,"selectedItem"),inputValue:bo(i,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return nn({},e,a)}be.array.isRequired,be.func,be.func,be.func,be.number,be.number,be.number,be.bool,be.bool,be.bool,be.any,be.any,be.any,be.string,be.string,be.string,be.func,be.string,be.func,be.func,be.func,be.func,be.func,be.shape({addEventListener:be.func,removeEventListener:be.func,document:be.shape({getElementById:be.func,activeElement:be.any,body:be.any})});function T1e(e){var t=e.isOpen,n=e.resultCount,r=e.previousResultCount;return t?n?n!==r?"".concat(n," result").concat(n===1?" is":"s are"," available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select."):"":"No results are available.":""}$g($g({},Kd),{getA11yStatusMessage:T1e});var B7=0,U7=1,$7=2,z7=3,H7=4,j7=5,G7=6,V7=7,W7=8,zg=9,q7=10,UF=11,$F=12,K7=13,zF=14,HF=15,jF=16,GF=17,VF=18,Y7=19,WF=20,qF=21,X7=22,KF=Object.freeze({__proto__:null,InputKeyDownArrowDown:B7,InputKeyDownArrowUp:U7,InputKeyDownEscape:$7,InputKeyDownHome:z7,InputKeyDownEnd:H7,InputKeyDownPageUp:j7,InputKeyDownPageDown:G7,InputKeyDownEnter:V7,InputChange:W7,InputBlur:zg,InputFocus:q7,MenuMouseLeave:UF,ItemMouseMove:$F,ItemClick:K7,ToggleButtonClick:zF,FunctionToggleMenu:HF,FunctionOpenMenu:jF,FunctionCloseMenu:GF,FunctionSetHighlightedIndex:VF,FunctionSelectItem:Y7,FunctionSetInputValue:WF,FunctionReset:qF,ControlledPropUpdatedSelectedItem:X7});function S1e(e){var t=m1e(e),n=t.selectedItem,r=t.inputValue;return r===""&&n&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(n)),nn({},t,{inputValue:r})}be.array.isRequired,be.func,be.func,be.func,be.func,be.number,be.number,be.number,be.bool,be.bool,be.bool,be.any,be.any,be.any,be.string,be.string,be.string,be.string,be.string,be.string,be.func,be.string,be.string,be.func,be.func,be.func,be.func,be.func,be.func,be.shape({addEventListener:be.func,removeEventListener:be.func,document:be.shape({getElementById:be.func,activeElement:be.any,body:be.any})});function w1e(e,t,n){var r=C.useRef(),i=g1e(e,t,n),a=i[0],o=i[1];return C.useEffect(function(){MF(n,"selectedItem")&&(n.selectedItemChanged(r.current,n.selectedItem)&&o({type:X7,inputValue:n.itemToString(n.selectedItem)}),r.current=a.selectedItem===r.current?n.selectedItem:a.selectedItem)},[a.selectedItem,n.selectedItem]),[my(a,n),o]}var A1e=nn({},Kd,{selectedItemChanged:function(t,n){return t!==n},getA11yStatusMessage:t1e});function C1e(e,t){var n,r=t.type,i=t.props,a=t.altKey,o;switch(r){case K7:o={isOpen:bo(i,"isOpen"),highlightedIndex:bo(i,"highlightedIndex"),selectedItem:i.items[t.index],inputValue:i.itemToString(i.items[t.index])};break;case B7:e.isOpen?o={highlightedIndex:q0(1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:o={highlightedIndex:a&&e.selectedItem==null?-1:Yd(i,e,1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case U7:e.isOpen?a?o=_I(i,e.highlightedIndex):o={highlightedIndex:q0(-1,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!0)}:o={highlightedIndex:Yd(i,e,-1,t.getItemNodeFromIndex),isOpen:i.items.length>=0};break;case V7:o=_I(i,e.highlightedIndex);break;case $7:o=nn({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case j7:o={highlightedIndex:q0(-10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case G7:o={highlightedIndex:q0(10,e.highlightedIndex,i.items.length,t.getItemNodeFromIndex,!1)};break;case z7:o={highlightedIndex:Ap(1,0,i.items.length,t.getItemNodeFromIndex,!1)};break;case H7:o={highlightedIndex:Ap(-1,i.items.length-1,i.items.length,t.getItemNodeFromIndex,!1)};break;case zg:o=nn({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((n=i.items)==null?void 0:n.length)&&t.selectItem&&{selectedItem:i.items[e.highlightedIndex],inputValue:i.itemToString(i.items[e.highlightedIndex])});break;case W7:o={isOpen:!0,highlightedIndex:bo(i,"highlightedIndex"),inputValue:t.inputValue};break;case q7:o={isOpen:!0,highlightedIndex:Yd(i,e,0)};break;case Y7:o={selectedItem:t.selectedItem,inputValue:i.itemToString(t.selectedItem)};break;case X7:o={inputValue:t.inputValue};break;default:return _1e(e,t,KF)}return nn({},e,o)}var k1e=["onMouseLeave","refKey","ref"],x1e=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],I1e=["onClick","onPress","refKey","ref"],R1e=["onKeyDown","onChange","onInput","onFocus","onBlur","onChangeText","refKey","ref"];YF.stateChangeTypes=KF;function YF(e){e===void 0&&(e={});var t=nn({},A1e,e),n=t.initialIsOpen,r=t.defaultIsOpen,i=t.items,a=t.scrollIntoView,o=t.environment,s=t.getA11yStatusMessage,u=t.getA11ySelectionMessage,c=t.itemToString,p=S1e(t),f=w1e(C1e,p,t),m=f[0],g=f[1],b=m.isOpen,y=m.highlightedIndex,T=m.selectedItem,E=m.inputValue,v=C.useRef(null),w=C.useRef({}),A=C.useRef(null),R=C.useRef(null),k=C.useRef(!0),N=p1e(t),B=C.useRef(),q=BF({state:m,props:t}),P=C.useCallback(function(ke){return w.current[N.getItemId(ke)]},[N]);vI(s,[b,y,E,i],nn({isInitialMount:k.current,previousResultCount:B.current,items:i,environment:o,itemToString:c},m)),vI(u,[T],nn({isInitialMount:k.current,previousResultCount:B.current,items:i,environment:o,itemToString:c},m));var Q=E1e({menuElement:v.current,highlightedIndex:y,isOpen:b,itemRefs:w,scrollIntoView:a,getItemNodeFromIndex:P});v1e({isInitialMount:k.current,props:t,state:m}),C.useEffect(function(){var ke=n||r||b;ke&&A.current&&A.current.focus()},[]),C.useEffect(function(){k.current||(B.current=i.length)});var $=b1e(b,[A,v,R],o,function(){g({type:zg,selectItem:!1})}),oe=y1e();C.useEffect(function(){return k.current=!1,function(){k.current=!0}},[]),C.useEffect(function(){var ke;if(!b)w.current={};else if(((ke=o.document)==null?void 0:ke.activeElement)!==A.current){var te;A==null||(te=A.current)==null||te.focus()}},[b,o]);var fe=C.useMemo(function(){return{ArrowDown:function(te){te.preventDefault(),g({type:B7,altKey:te.altKey,getItemNodeFromIndex:P})},ArrowUp:function(te){te.preventDefault(),g({type:U7,altKey:te.altKey,getItemNodeFromIndex:P})},Home:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:z7,getItemNodeFromIndex:P}))},End:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:H7,getItemNodeFromIndex:P}))},Escape:function(te){var Me=q.current.state;(Me.isOpen||Me.inputValue||Me.selectedItem||Me.highlightedIndex>-1)&&(te.preventDefault(),g({type:$7}))},Enter:function(te){var Me=q.current.state;!Me.isOpen||te.which===229||(te.preventDefault(),g({type:V7,getItemNodeFromIndex:P}))},PageUp:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:j7,getItemNodeFromIndex:P}))},PageDown:function(te){q.current.state.isOpen&&(te.preventDefault(),g({type:G7,getItemNodeFromIndex:P}))}}},[g,q,P]),ce=C.useCallback(function(ke){return nn({id:N.labelId,htmlFor:N.inputId},ke)},[N]),De=C.useCallback(function(ke,te){var Me,Re=ke===void 0?{}:ke,Ye=Re.onMouseLeave,We=Re.refKey,dt=We===void 0?"ref":We,ot=Re.ref,je=C1(Re,k1e),pt=te===void 0?{}:te;return pt.suppressRefError,nn((Me={},Me[dt]=W0(ot,function(U){v.current=U}),Me.id=N.menuId,Me.role="listbox",Me["aria-labelledby"]=je&&je["aria-label"]?void 0:""+N.labelId,Me.onMouseLeave=qo(Ye,function(){g({type:UF})}),Me),je)},[g,oe,N]),H=C.useCallback(function(ke){var te,Me,Re=ke===void 0?{}:ke,Ye=Re.item,We=Re.index,dt=Re.refKey,ot=dt===void 0?"ref":dt,je=Re.ref,pt=Re.onMouseMove,U=Re.onMouseDown,re=Re.onClick;Re.onPress;var de=Re.disabled,xe=C1(Re,x1e),ye=q.current,Te=ye.props,Le=ye.state,ze=f1e(Ye,We,Te.items,"Pass either item or index to getItemProps!"),Xe=ze[1],jt="onClick",ue=re,Ee=function(){Xe!==Le.highlightedIndex&&(Q.current=!1,g({type:$F,index:Xe,disabled:de}))},qe=function(){g({type:K7,index:Xe})},j=function(Ve){return Ve.preventDefault()};return nn((te={},te[ot]=W0(je,function(me){me&&(w.current[N.getItemId(Xe)]=me)}),te.disabled=de,te.role="option",te["aria-selected"]=""+(Xe===Le.highlightedIndex),te.id=N.getItemId(Xe),te),!de&&(Me={},Me[jt]=qo(ue,qe),Me),{onMouseMove:qo(pt,Ee),onMouseDown:qo(U,j)},xe)},[g,q,Q,N]),W=C.useCallback(function(ke){var te,Me=ke===void 0?{}:ke,Re=Me.onClick;Me.onPress;var Ye=Me.refKey,We=Ye===void 0?"ref":Ye,dt=Me.ref,ot=C1(Me,I1e),je=q.current.state,pt=function(){g({type:zF})};return nn((te={},te[We]=W0(dt,function(U){R.current=U}),te["aria-controls"]=N.menuId,te["aria-expanded"]=je.isOpen,te.id=N.toggleButtonId,te.tabIndex=-1,te),!ot.disabled&&nn({},{onClick:qo(Re,pt)}),ot)},[g,q,N]),se=C.useCallback(function(ke,te){var Me,Re=ke===void 0?{}:ke,Ye=Re.onKeyDown,We=Re.onChange,dt=Re.onInput,ot=Re.onFocus,je=Re.onBlur;Re.onChangeText;var pt=Re.refKey,U=pt===void 0?"ref":pt,re=Re.ref,de=C1(Re,R1e),xe=te===void 0?{}:te;xe.suppressRefError;var ye=q.current.state,Te=function(j){var me=n1e(j);me&&fe[me]&&fe[me](j)},Le=function(j){g({type:W7,inputValue:j.target.value})},ze=function(j){if(ye.isOpen&&!$.current.isMouseDown){var me=j.relatedTarget===null&&o.document.activeElement!==o.document.body;g({type:zg,selectItem:!me})}},Xe=function(){ye.isOpen||g({type:q7})},jt="onChange",ue={};if(!de.disabled){var Ee;ue=(Ee={},Ee[jt]=qo(We,dt,Le),Ee.onKeyDown=qo(Ye,Te),Ee.onBlur=qo(je,ze),Ee.onFocus=qo(ot,Xe),Ee)}return nn((Me={},Me[U]=W0(re,function(qe){A.current=qe}),Me["aria-activedescendant"]=ye.isOpen&&ye.highlightedIndex>-1?N.getItemId(ye.highlightedIndex):"",Me["aria-autocomplete"]="list",Me["aria-controls"]=N.menuId,Me["aria-expanded"]=ye.isOpen,Me["aria-labelledby"]=de&&de["aria-label"]?void 0:""+N.labelId,Me.autoComplete="off",Me.id=N.inputId,Me.role="combobox",Me.value=ye.inputValue,Me),ue,de)},[oe,q,N,fe,g,$,o]),D=C.useCallback(function(){g({type:HF})},[g]),pe=C.useCallback(function(){g({type:GF})},[g]),le=C.useCallback(function(){g({type:jF})},[g]),L=C.useCallback(function(ke){g({type:VF,highlightedIndex:ke})},[g]),ie=C.useCallback(function(ke){g({type:Y7,selectedItem:ke})},[g]),Se=C.useCallback(function(ke){g({type:WF,inputValue:ke})},[g]),X=C.useCallback(function(){g({type:qF})},[g]);return{getItemProps:H,getLabelProps:ce,getMenuProps:De,getInputProps:se,getToggleButtonProps:W,toggleMenu:D,openMenu:le,closeMenu:pe,setHighlightedIndex:L,setInputValue:Se,selectItem:ie,reset:X,highlightedIndex:y,isOpen:b,selectedItem:T,inputValue:E}}function N1e(e){var t=e.removedSelectedItem,n=e.itemToString;return n(t)+" has been removed."}be.array,be.array,be.array,be.func,be.func,be.func,be.number,be.number,be.number,be.func,be.func,be.string,be.string,be.shape({addEventListener:be.func,removeEventListener:be.func,document:be.shape({getElementById:be.func,activeElement:be.any,body:be.any})});Kd.itemToString,Kd.stateReducer,Kd.environment;/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */const{entries:XF,setPrototypeOf:TI,isFrozen:O1e,getPrototypeOf:D1e,getOwnPropertyDescriptor:ZF}=Object;let{freeze:ii,seal:Ya,create:QF}=Object,{apply:by,construct:yy}=typeof Reflect<"u"&&Reflect;ii||(ii=function(t){return t});Ya||(Ya=function(t){return t});by||(by=function(t,n,r){return t.apply(n,r)});yy||(yy=function(t,n){return new t(...n)});const Y0=va(Array.prototype.forEach),SI=va(Array.prototype.pop),ld=va(Array.prototype.push),Fh=va(String.prototype.toLowerCase),c4=va(String.prototype.toString),L1e=va(String.prototype.match),ud=va(String.prototype.replace),M1e=va(String.prototype.indexOf),F1e=va(String.prototype.trim),Ni=va(RegExp.prototype.test),cd=P1e(TypeError);function va(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:Fh;TI&&TI(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(O1e(t)||(t[r]=a),i=a)}e[i]=!0}return e}function r1(e){const t=QF(null);for(const[n,r]of XF(e))ZF(e,n)!==void 0&&(t[n]=r);return t}function X0(e,t){for(;e!==null;){const r=ZF(e,t);if(r){if(r.get)return va(r.get);if(typeof r.value=="function")return va(r.value)}e=D1e(e)}function n(r){return console.warn("fallback value for",r),null}return n}const wI=ii(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),d4=ii(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),p4=ii(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),B1e=ii(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),f4=ii(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),U1e=ii(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),AI=ii(["#text"]),CI=ii(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),h4=ii(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),kI=ii(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Z0=ii(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$1e=Ya(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z1e=Ya(/<%[\w\W]*|[\w\W]*%>/gm),H1e=Ya(/\${[\w\W]*}/gm),j1e=Ya(/^data-[\-\w.\u00B7-\uFFFF]/),G1e=Ya(/^aria-[\-\w]+$/),JF=Ya(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V1e=Ya(/^(?:\w+script|data):/i),W1e=Ya(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),eP=Ya(/^html$/i);var xI=Object.freeze({__proto__:null,MUSTACHE_EXPR:$1e,ERB_EXPR:z1e,TMPLIT_EXPR:H1e,DATA_ATTR:j1e,ARIA_ATTR:G1e,IS_ALLOWED_URI:JF,IS_SCRIPT_OR_DATA:V1e,ATTR_WHITESPACE:W1e,DOCTYPE_NAME:eP});const q1e=function(){return typeof window>"u"?null:window},K1e=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}};function tP(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q1e();const t=Ke=>tP(Ke);if(t.version="3.0.6",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:u,NodeFilter:c,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:m,trustedTypes:g}=e,b=u.prototype,y=X0(b,"cloneNode"),T=X0(b,"nextSibling"),E=X0(b,"childNodes"),v=X0(b,"parentNode");if(typeof o=="function"){const Ke=n.createElement("template");Ke.content&&Ke.content.ownerDocument&&(n=Ke.content.ownerDocument)}let w,A="";const{implementation:R,createNodeIterator:k,createDocumentFragment:N,getElementsByTagName:B}=n,{importNode:q}=r;let P={};t.isSupported=typeof XF=="function"&&typeof v=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Q,ERB_EXPR:$,TMPLIT_EXPR:oe,DATA_ATTR:fe,ARIA_ATTR:ce,IS_SCRIPT_OR_DATA:De,ATTR_WHITESPACE:H}=xI;let{IS_ALLOWED_URI:W}=xI,se=null;const D=At({},[...wI,...d4,...p4,...f4,...AI]);let pe=null;const le=At({},[...CI,...h4,...kI,...Z0]);let L=Object.seal(QF(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ie=null,Se=null,X=!0,ke=!0,te=!1,Me=!0,Re=!1,Ye=!1,We=!1,dt=!1,ot=!1,je=!1,pt=!1,U=!0,re=!1;const de="user-content-";let xe=!0,ye=!1,Te={},Le=null;const ze=At({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Xe=null;const jt=At({},["audio","video","img","source","image","track"]);let ue=null;const Ee=At({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qe="http://www.w3.org/1998/Math/MathML",j="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let Ve=me,ge=!1,G=null;const K=At({},[qe,j,me],c4);let ne=null;const ve=["application/xhtml+xml","text/html"],Qe="text/html";let Fe=null,at=null;const rt=n.createElement("form"),Je=function(J){return J instanceof RegExp||J instanceof Function},Rt=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(at&&at===J)){if((!J||typeof J!="object")&&(J={}),J=r1(J),ne=ve.indexOf(J.PARSER_MEDIA_TYPE)===-1?ne=Qe:ne=J.PARSER_MEDIA_TYPE,Fe=ne==="application/xhtml+xml"?c4:Fh,se="ALLOWED_TAGS"in J?At({},J.ALLOWED_TAGS,Fe):D,pe="ALLOWED_ATTR"in J?At({},J.ALLOWED_ATTR,Fe):le,G="ALLOWED_NAMESPACES"in J?At({},J.ALLOWED_NAMESPACES,c4):K,ue="ADD_URI_SAFE_ATTR"in J?At(r1(Ee),J.ADD_URI_SAFE_ATTR,Fe):Ee,Xe="ADD_DATA_URI_TAGS"in J?At(r1(jt),J.ADD_DATA_URI_TAGS,Fe):jt,Le="FORBID_CONTENTS"in J?At({},J.FORBID_CONTENTS,Fe):ze,ie="FORBID_TAGS"in J?At({},J.FORBID_TAGS,Fe):{},Se="FORBID_ATTR"in J?At({},J.FORBID_ATTR,Fe):{},Te="USE_PROFILES"in J?J.USE_PROFILES:!1,X=J.ALLOW_ARIA_ATTR!==!1,ke=J.ALLOW_DATA_ATTR!==!1,te=J.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=J.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Re=J.SAFE_FOR_TEMPLATES||!1,Ye=J.WHOLE_DOCUMENT||!1,ot=J.RETURN_DOM||!1,je=J.RETURN_DOM_FRAGMENT||!1,pt=J.RETURN_TRUSTED_TYPE||!1,dt=J.FORCE_BODY||!1,U=J.SANITIZE_DOM!==!1,re=J.SANITIZE_NAMED_PROPS||!1,xe=J.KEEP_CONTENT!==!1,ye=J.IN_PLACE||!1,W=J.ALLOWED_URI_REGEXP||JF,Ve=J.NAMESPACE||me,L=J.CUSTOM_ELEMENT_HANDLING||{},J.CUSTOM_ELEMENT_HANDLING&&Je(J.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(L.tagNameCheck=J.CUSTOM_ELEMENT_HANDLING.tagNameCheck),J.CUSTOM_ELEMENT_HANDLING&&Je(J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(L.attributeNameCheck=J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),J.CUSTOM_ELEMENT_HANDLING&&typeof J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Re&&(ke=!1),je&&(ot=!0),Te&&(se=At({},[...AI]),pe=[],Te.html===!0&&(At(se,wI),At(pe,CI)),Te.svg===!0&&(At(se,d4),At(pe,h4),At(pe,Z0)),Te.svgFilters===!0&&(At(se,p4),At(pe,h4),At(pe,Z0)),Te.mathMl===!0&&(At(se,f4),At(pe,kI),At(pe,Z0))),J.ADD_TAGS&&(se===D&&(se=r1(se)),At(se,J.ADD_TAGS,Fe)),J.ADD_ATTR&&(pe===le&&(pe=r1(pe)),At(pe,J.ADD_ATTR,Fe)),J.ADD_URI_SAFE_ATTR&&At(ue,J.ADD_URI_SAFE_ATTR,Fe),J.FORBID_CONTENTS&&(Le===ze&&(Le=r1(Le)),At(Le,J.FORBID_CONTENTS,Fe)),xe&&(se["#text"]=!0),Ye&&At(se,["html","head","body"]),se.table&&(At(se,["tbody"]),delete ie.tbody),J.TRUSTED_TYPES_POLICY){if(typeof J.TRUSTED_TYPES_POLICY.createHTML!="function")throw cd('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof J.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw cd('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=J.TRUSTED_TYPES_POLICY,A=w.createHTML("")}else w===void 0&&(w=K1e(g,i)),w!==null&&typeof A=="string"&&(A=w.createHTML(""));ii&&ii(J),at=J}},Qt=At({},["mi","mo","mn","ms","mtext"]),kt=At({},["foreignobject","desc","title","annotation-xml"]),rn=At({},["title","style","font","a","script"]),Xt=At({},d4);At(Xt,p4),At(Xt,B1e);const Wr=At({},f4);At(Wr,U1e);const qr=function(J){let Be=v(J);(!Be||!Be.tagName)&&(Be={namespaceURI:Ve,tagName:"template"});const it=Fh(J.tagName),un=Fh(Be.tagName);return G[J.namespaceURI]?J.namespaceURI===j?Be.namespaceURI===me?it==="svg":Be.namespaceURI===qe?it==="svg"&&(un==="annotation-xml"||Qt[un]):!!Xt[it]:J.namespaceURI===qe?Be.namespaceURI===me?it==="math":Be.namespaceURI===j?it==="math"&&kt[un]:!!Wr[it]:J.namespaceURI===me?Be.namespaceURI===j&&!kt[un]||Be.namespaceURI===qe&&!Qt[un]?!1:!Wr[it]&&(rn[it]||!Xt[it]):!!(ne==="application/xhtml+xml"&&G[J.namespaceURI]):!1},Kr=function(J){ld(t.removed,{element:J});try{J.parentNode.removeChild(J)}catch{J.remove()}},Aa=function(J,Be){try{ld(t.removed,{attribute:Be.getAttributeNode(J),from:Be})}catch{ld(t.removed,{attribute:null,from:Be})}if(Be.removeAttribute(J),J==="is"&&!pe[J])if(ot||je)try{Kr(Be)}catch{}else try{Be.setAttribute(J,"")}catch{}},si=function(J){let Be=null,it=null;if(dt)J=""+J;else{const or=L1e(J,/^[\r\n\t ]+/);it=or&&or[0]}ne==="application/xhtml+xml"&&Ve===me&&(J=''+J+"");const un=w?w.createHTML(J):J;if(Ve===me)try{Be=new m().parseFromString(un,ne)}catch{}if(!Be||!Be.documentElement){Be=R.createDocument(Ve,"template",null);try{Be.documentElement.innerHTML=ge?A:un}catch{}}const ar=Be.body||Be.documentElement;return J&&it&&ar.insertBefore(n.createTextNode(it),ar.childNodes[0]||null),Ve===me?B.call(Be,Ye?"html":"body")[0]:Ye?Be.documentElement:ar},Or=function(J){return k.call(J.ownerDocument||J,J,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null)},Es=function(J){return J instanceof f&&(typeof J.nodeName!="string"||typeof J.textContent!="string"||typeof J.removeChild!="function"||!(J.attributes instanceof p)||typeof J.removeAttribute!="function"||typeof J.setAttribute!="function"||typeof J.namespaceURI!="string"||typeof J.insertBefore!="function"||typeof J.hasChildNodes!="function")},vs=function(J){return typeof s=="function"&&J instanceof s},Yr=function(J,Be,it){P[J]&&Y0(P[J],un=>{un.call(t,Be,it,at)})},_s=function(J){let Be=null;if(Yr("beforeSanitizeElements",J,null),Es(J))return Kr(J),!0;const it=Fe(J.nodeName);if(Yr("uponSanitizeElement",J,{tagName:it,allowedTags:se}),J.hasChildNodes()&&!vs(J.firstElementChild)&&Ni(/<[/\w]/g,J.innerHTML)&&Ni(/<[/\w]/g,J.textContent))return Kr(J),!0;if(!se[it]||ie[it]){if(!ie[it]&&Dr(it)&&(L.tagNameCheck instanceof RegExp&&Ni(L.tagNameCheck,it)||L.tagNameCheck instanceof Function&&L.tagNameCheck(it)))return!1;if(xe&&!Le[it]){const un=v(J)||J.parentNode,ar=E(J)||J.childNodes;if(ar&&un){const or=ar.length;for(let Zn=or-1;Zn>=0;--Zn)un.insertBefore(y(ar[Zn],!0),T(J))}}return Kr(J),!0}return J instanceof u&&!qr(J)||(it==="noscript"||it==="noembed"||it==="noframes")&&Ni(/<\/no(script|embed|frames)/i,J.innerHTML)?(Kr(J),!0):(Re&&J.nodeType===3&&(Be=J.textContent,Y0([Q,$,oe],un=>{Be=ud(Be,un," ")}),J.textContent!==Be&&(ld(t.removed,{element:J.cloneNode()}),J.textContent=Be)),Yr("afterSanitizeElements",J,null),!1)},qt=function(J,Be,it){if(U&&(Be==="id"||Be==="name")&&(it in n||it in rt))return!1;if(!(ke&&!Se[Be]&&Ni(fe,Be))){if(!(X&&Ni(ce,Be))){if(!pe[Be]||Se[Be]){if(!(Dr(J)&&(L.tagNameCheck instanceof RegExp&&Ni(L.tagNameCheck,J)||L.tagNameCheck instanceof Function&&L.tagNameCheck(J))&&(L.attributeNameCheck instanceof RegExp&&Ni(L.attributeNameCheck,Be)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(Be))||Be==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&&Ni(L.tagNameCheck,it)||L.tagNameCheck instanceof Function&&L.tagNameCheck(it))))return!1}else if(!ue[Be]){if(!Ni(W,ud(it,H,""))){if(!((Be==="src"||Be==="xlink:href"||Be==="href")&&J!=="script"&&M1e(it,"data:")===0&&Xe[J])){if(!(te&&!Ni(De,ud(it,H,"")))){if(it)return!1}}}}}}return!0},Dr=function(J){return J.indexOf("-")>0},Si=function(J){Yr("beforeSanitizeAttributes",J,null);const{attributes:Be}=J;if(!Be)return;const it={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:pe};let un=Be.length;for(;un--;){const ar=Be[un],{name:or,namespaceURI:Zn,value:Oo}=ar,no=Fe(or);let Lr=or==="value"?Oo:F1e(Oo);if(it.attrName=no,it.attrValue=Lr,it.keepAttr=!0,it.forceKeepAttr=void 0,Yr("uponSanitizeAttribute",J,it),Lr=it.attrValue,it.forceKeepAttr||(Aa(or,J),!it.keepAttr))continue;if(!Me&&Ni(/\/>/i,Lr)){Aa(or,J);continue}Re&&Y0([Q,$,oe],vf=>{Lr=ud(Lr,vf," ")});const Ef=Fe(J.nodeName);if(qt(Ef,no,Lr)){if(re&&(no==="id"||no==="name")&&(Aa(or,J),Lr=de+Lr),w&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Zn)switch(g.getAttributeType(Ef,no)){case"TrustedHTML":{Lr=w.createHTML(Lr);break}case"TrustedScriptURL":{Lr=w.createScriptURL(Lr);break}}try{Zn?J.setAttributeNS(Zn,or,Lr):J.setAttribute(or,Lr),SI(t.removed)}catch{}}}Yr("afterSanitizeAttributes",J,null)},Nl=function Ke(J){let Be=null;const it=Or(J);for(Yr("beforeSanitizeShadowDOM",J,null);Be=it.nextNode();)Yr("uponSanitizeShadowNode",Be,null),!_s(Be)&&(Be.content instanceof a&&Ke(Be.content),Si(Be));Yr("afterSanitizeShadowDOM",J,null)};return t.sanitize=function(Ke){let J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Be=null,it=null,un=null,ar=null;if(ge=!Ke,ge&&(Ke=""),typeof Ke!="string"&&!vs(Ke))if(typeof Ke.toString=="function"){if(Ke=Ke.toString(),typeof Ke!="string")throw cd("dirty is not a string, aborting")}else throw cd("toString is not a function");if(!t.isSupported)return Ke;if(We||Rt(J),t.removed=[],typeof Ke=="string"&&(ye=!1),ye){if(Ke.nodeName){const Oo=Fe(Ke.nodeName);if(!se[Oo]||ie[Oo])throw cd("root node is forbidden and cannot be sanitized in-place")}}else if(Ke instanceof s)Be=si(""),it=Be.ownerDocument.importNode(Ke,!0),it.nodeType===1&&it.nodeName==="BODY"||it.nodeName==="HTML"?Be=it:Be.appendChild(it);else{if(!ot&&!Re&&!Ye&&Ke.indexOf("<")===-1)return w&&pt?w.createHTML(Ke):Ke;if(Be=si(Ke),!Be)return ot?null:pt?A:""}Be&&dt&&Kr(Be.firstChild);const or=Or(ye?Ke:Be);for(;un=or.nextNode();)_s(un)||(un.content instanceof a&&Nl(un.content),Si(un));if(ye)return Ke;if(ot){if(je)for(ar=N.call(Be.ownerDocument);Be.firstChild;)ar.appendChild(Be.firstChild);else ar=Be;return(pe.shadowroot||pe.shadowrootmode)&&(ar=q.call(r,ar,!0)),ar}let Zn=Ye?Be.outerHTML:Be.innerHTML;return Ye&&se["!doctype"]&&Be.ownerDocument&&Be.ownerDocument.doctype&&Be.ownerDocument.doctype.name&&Ni(eP,Be.ownerDocument.doctype.name)&&(Zn=" `+Zn),Re&&Y0([Q,$,oe],Oo=>{Zn=ud(Zn,Oo," ")}),w&&pt?w.createHTML(Zn):Zn},t.setConfig=function(){let Ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Rt(Ke),We=!0},t.clearConfig=function(){at=null,We=!1},t.isValidAttribute=function(Ke,J,Be){at||Rt({});const it=Fe(Ke),un=Fe(J);return qt(it,un,Be)},t.addHook=function(Ke,J){typeof J=="function"&&(P[Ke]=P[Ke]||[],ld(P[Ke],J))},t.removeHook=function(Ke){if(P[Ke])return SI(P[Ke])},t.removeHooks=function(Ke){P[Ke]&&(P[Ke]=[])},t.removeAllHooks=function(){P={}},t}var Y1e=tP(),Z7={};const X1e={folder:["folder","white"],"karma.conf.js":["karma","green"],"karma.conf.coffee":["karma","green"],"README.md":["info","blue"],"CHANGELOG.md":["clock","blue"],CHANGELOG:["clock","blue"],"CHANGES.md":["clock","blue"],"VERSION.md":["clock","blue"],VERSION:["clock","blue"],mvnw:["maven","red"],"tsconfig.json":["tsconfig","blue"],"swagger.json":["json","green"],"swagger.yml":["json","green"],"swagger.yaml":["json","green"],"mime.types":["config","grey-light"],Jenkinsfile:["jenkins","red"],"babel.config.js":["babel","yellow"],"babel.config.json":["babel","yellow"],"babel.config.cjs":["babel","yellow"],"bower.json":["bower","orange"],"Bower.json":["bower","orange"],"firebase.json":["firebase","orange"],geckodriver:["firefox","orange"],"Gruntfile.js":["grunt","orange"],"gruntfile.babel.js":["grunt","orange"],"Gruntfile.babel.js":["grunt","orange"],"gruntfile.js":["grunt","orange"],"Gruntfile.coffee":["grunt","orange"],"gruntfile.coffee":["grunt","orange"],"ionic.config.json":["ionic","blue"],"Ionic.config.json":["ionic","blue"],"ionic.project":["ionic","blue"],"Ionic.project":["ionic","blue"],"platformio.ini":["platformio","orange"],"rollup.config.js":["rollup","red"],"sass-lint.yml":["sass","pink"],"stylelint.config.js":["stylelint","white"],"stylelint.config.cjs":["stylelint","white"],"yarn.clean":["yarn","blue"],"yarn.lock":["yarn","blue"],"webpack.config.js":["webpack","blue"],"webpack.config.build.js":["webpack","blue"],"webpack.common.js":["webpack","blue"],"webpack.dev.js":["webpack","blue"],"webpack.prod.js":["webpack","blue"],"npm-debug.log":["npm_ignored","ignore"]},Z1e={".bsl":["bsl","red"],".mdo":["mdo","red"],".cls":["salesforce","blue"],".apex":["salesforce","blue"],".asm":["asm","red"],".s":["asm","red"],".bicep":["bicep","blue"],".c":["c","blue"],".h":["c","purple"],".m":["c","yellow"],".cs":["c-sharp","blue"],".cshtml":["html","blue"],".aspx":["html","blue"],".ascx":["html","green"],".asax":["html","yellow"],".master":["html","yellow"],".cc":["cpp","blue"],".cpp":["cpp","blue"],".cxx":["cpp","blue"],".c++":["cpp","blue"],".hh":["cpp","purple"],".hpp":["cpp","purple"],".hxx":["cpp","purple"],".h++":["cpp","purple"],".mm":["cpp","yellow"],".clj":["clojure","green"],".cljs":["clojure","green"],".cljc":["clojure","green"],".edn":["clojure","blue"],".cfc":["coldfusion","blue"],".cfm":["coldfusion","blue"],".coffee":["coffee","yellow"],".litcoffee":["coffee","yellow"],".config":["config","grey-light"],".cfg":["config","grey-light"],".conf":["config","grey-light"],".cr":["crystal","white"],".ecr":["crystal_embedded","white"],".slang":["crystal_embedded","white"],".cson":["json","yellow"],".css":["css","blue"],".css.map":["css","blue"],".sss":["css","blue"],".csv":["csv","green"],".xls":["xls","green"],".xlsx":["xls","green"],".cu":["cu","green"],".cuh":["cu","purple"],".hu":["cu","purple"],".cake":["cake","red"],".ctp":["cake_php","red"],".d":["d","red"],".doc":["word","blue"],".docx":["word","blue"],".ejs":["ejs","yellow"],".ex":["elixir","purple"],".exs":["elixir_script","purple"],".elm":["elm","blue"],".ico":["favicon","yellow"],".fs":["f-sharp","blue"],".fsx":["f-sharp","blue"],".gitignore":["git","ignore"],".gitconfig":["git","ignore"],".gitkeep":["git","ignore"],".gitattributes":["git","ignore"],".gitmodules":["git","ignore"],".go":["go2","blue"],".slide":["go","blue"],".article":["go","blue"],".gd":["godot","blue"],".godot":["godot","red"],".tres":["godot","yellow"],".tscn":["godot","purple"],".gradle":["gradle","blue"],".groovy":["grails","green"],".gsp":["grails","green"],".gql":["graphql","pink"],".graphql":["graphql","pink"],".graphqls":["graphql","pink"],".hack":["hacklang","orange"],".haml":["haml","red"],".handlebars":["mustache","orange"],".hbs":["mustache","orange"],".hjs":["mustache","orange"],".hs":["haskell","purple"],".lhs":["haskell","purple"],".hx":["haxe","orange"],".hxs":["haxe","yellow"],".hxp":["haxe","blue"],".hxml":["haxe","purple"],".html":["html","orange"],".jade":["jade","red"],".java":["java","red"],".class":["java","red"],".classpath":["java","red"],".properties":["java","red"],".js":["javascript","yellow"],".js.map":["javascript","yellow"],".spec.js":["javascript","orange"],".test.js":["javascript","orange"],".es":["javascript","yellow"],".es5":["javascript","yellow"],".es6":["javascript","yellow"],".es7":["javascript","yellow"],".jinja":["jinja","red"],".jinja2":["jinja","red"],".json":["json","yellow"],".jl":["julia","purple"],".kt":["kotlin","orange"],".kts":["kotlin","orange"],".dart":["dart","blue"],".less":["less","blue"],".liquid":["liquid","green"],".ls":["livescript","blue"],".lua":["lua","blue"],".markdown":["markdown","blue"],".md":["markdown","blue"],".argdown":["argdown","blue"],".ad":["argdown","blue"],".mustache":["mustache","orange"],".stache":["mustache","orange"],".nim":["nim","yellow"],".nims":["nim","yellow"],".github-issues":["github","white"],".ipynb":["notebook","blue"],".njk":["nunjucks","green"],".nunjucks":["nunjucks","green"],".nunjs":["nunjucks","green"],".nunj":["nunjucks","green"],".njs":["nunjucks","green"],".nj":["nunjucks","green"],".npm-debug.log":["npm","ignore"],".npmignore":["npm","red"],".npmrc":["npm","red"],".ml":["ocaml","orange"],".mli":["ocaml","orange"],".cmx":["ocaml","orange"],".cmxa":["ocaml","orange"],".odata":["odata","orange"],".pl":["perl","blue"],".php":["php","purple"],".php.inc":["php","purple"],".pipeline":["pipeline","orange"],".pddl":["pddl","purple"],".plan":["plan","green"],".happenings":["happenings","blue"],".ps1":["powershell","blue"],".psd1":["powershell","blue"],".psm1":["powershell","blue"],".prisma":["prisma","blue"],".pug":["pug","red"],".pp":["puppet","yellow"],".epp":["puppet","yellow"],".purs":["purescript","white"],".py":["python","blue"],".jsx":["react","blue"],".spec.jsx":["react","orange"],".test.jsx":["react","orange"],".cjsx":["react","blue"],".spec.tsx":["react","orange"],".test.tsx":["react","orange"],".re":["reasonml","red"],".res":["rescript","red"],".resi":["rescript","pink"],".R":["R","blue"],".rmd":["R","blue"],".rb":["ruby","red"],".erb":["html_erb","red"],".erb.html":["html_erb","red"],".html.erb":["html_erb","red"],".rs":["rust","grey-light"],".sass":["sass","pink"],".scss":["sass","pink"],".springBeans":["spring","green"],".slim":["slim","orange"],".smarty.tpl":["smarty","yellow"],".tpl":["smarty","yellow"],".sbt":["sbt","blue"],".scala":["scala","red"],".sol":["ethereum","blue"],".styl":["stylus","green"],".svelte":["svelte","red"],".swift":["swift","orange"],".sql":["db","pink"],".soql":["db","blue"],".tf":["terraform","purple"],".tf.json":["terraform","purple"],".tfvars":["terraform","purple"],".tex":["tex","blue"],".sty":["tex","yellow"],".dtx":["tex","orange"],".ins":["tex","white"],".txt":["default","white"],".toml":["config","grey-light"],".twig":["twig","green"],".ts":["typescript","blue"],".tsx":["typescript","blue"],".spec.ts":["typescript","orange"],".test.ts":["typescript","orange"],".vala":["vala","grey-light"],".vapi":["vala","grey-light"],".component":["html","orange"],".vue":["vue","green"],".wasm":["wasm","purple"],".wat":["wat","purple"],".xml":["xml","orange"],".yml":["yml","purple"],".yaml":["yml","purple"],".pro":["prolog","orange"],".jar":["zip","red"],".zip":["zip","grey-light"],".wgt":["wgt","blue"],".ai":["illustrator","yellow"],".psd":["photoshop","blue"],".pdf":["pdf","red"],".eot":["font","red"],".ttf":["font","red"],".woff":["font","red"],".woff2":["font","red"],".gif":["image","purple"],".jpg":["image","purple"],".jpeg":["image","purple"],".png":["image","purple"],".pxm":["image","purple"],".svg":["svg","purple"],".svgx":["image","purple"],".tiff":["image","purple"],".webp":["image","purple"],".sublime-project":["sublime","orange"],".sublime-workspace":["sublime","orange"],".code-search":["code-search","purple"],".sh":["shell","green"],".zsh":["shell","green"],".fish":["shell","green"],".zshrc":["shell","green"],".bashrc":["shell","green"],".mov":["video","pink"],".ogv":["video","pink"],".webm":["video","pink"],".avi":["video","pink"],".mpg":["video","pink"],".mp4":["video","pink"],".mp3":["audio","purple"],".ogg":["audio","purple"],".wav":["audio","purple"],".flac":["audio","purple"],".3ds":["svg","blue"],".3dm":["svg","blue"],".stl":["svg","blue"],".obj":["svg","blue"],".dae":["svg","blue"],".bat":["windows","blue"],".cmd":["windows","blue"],".babelrc":["babel","yellow"],".babelrc.js":["babel","yellow"],".babelrc.cjs":["babel","yellow"],".bowerrc":["bower","orange"],".codeclimate.yml":["code-climate","green"],".eslintrc":["eslint","purple"],".eslintrc.js":["eslint","purple"],".eslintrc.cjs":["eslint","purple"],".eslintrc.yaml":["eslint","purple"],".eslintrc.yml":["eslint","purple"],".eslintrc.json":["eslint","purple"],".eslintignore":["eslint","grey"],".firebaserc":["firebase","orange"],".jshintrc":["javascript","blue"],".jscsrc":["javascript","blue"],".stylelintrc":["stylelint","white"],".stylelintrc.json":["stylelint","white"],".stylelintrc.yaml":["stylelint","white"],".stylelintrc.yml":["stylelint","white"],".stylelintrc.js":["stylelint","white"],".stylelintignore":["stylelint","grey"],".direnv":["config","grey-light"],".env":["config","grey-light"],".static":["config","grey-light"],".editorconfig":["config","grey-light"],".slugignore":["config","grey-light"],".tmp":["clock","grey-light"],".htaccess":["config","grey-light"],".key":["lock","green"],".cert":["lock","green"],".cer":["lock","green"],".crt":["lock","green"],".pem":["lock","green"],".DS_Store":["ignored","ignore"]},Q1e=[["TODO",["todo","blue"]],["Procfile",["heroku","purple"]],["cmakelists.txt",["makefile","blue"]],["CMakeLists.txt",["makefile","blue"]],["CMAKELISTS.txt",["makefile","blue"]],["CMAKELISTS.TXT",["makefile","blue"]],["omakefile",["makefile","grey-light"]],["OMakefile",["makefile","grey-light"]],["OMAKEFILE",["makefile","grey-light"]],["qmakefile",["makefile","purple"]],["QMakefile",["makefile","purple"]],["QMAKEFILE",["makefile","purple"]],["makefile",["makefile","orange"]],["Makefile",["makefile","orange"]],["MAKEFILE",["makefile","orange"]],["CONTRIBUTING",["license","red"]],["COMPILING",["license","orange"]],["COPYING",["license","yellow"]],["LICENCE.md",["license","yellow"]],["LICENSE.md",["license","yellow"]],["LICENCE",["license","yellow"]],["LICENSE",["license","yellow"]],["gulpfile.js",["gulp","red"]],["gulpfile",["gulp","red"]],["Gulpfile",["gulp","red"]],["GULPFILE",["gulp","red"]],["docker-compose.override.yaml",["docker","pink"]],["docker-compose.override.yml",["docker","pink"]],["docker-compose.yaml",["docker","pink"]],["docker-compose.yml",["docker","pink"]],["docker-healthcheck",["docker","green"]],[".dockerignore",["docker","grey"]],["DOCKERFILE",["docker","blue"]],["Dockerfile",["docker","blue"]],["dockerfile",["docker","blue"]],["gemfile",["ruby","red"]],["Gemfile",["ruby","red"]],["mix",["hex","red"]]],J1e={files:X1e,extensions:Z1e,partials:Q1e,default:["default","white"]},ece='',tce='',nce='',rce='',ice='',ace='',oce='',sce='',lce='',uce='',cce='',dce='',pce='',fce='',hce='',gce='',mce='',bce='',yce='',Ece='',vce='',_ce='',Tce='',Sce='',wce='',Ace='',Cce='',kce='',xce='',Ice='',Rce='',Nce='',Oce='',Dce='',Lce='',Mce='',Fce='',Pce='',Bce='',Uce='',$ce='',zce='',Hce='',jce='',Gce='',Vce='',Wce='',qce='',Kce='',Yce='',Xce='',Zce='',Qce='',Jce='',ede='',tde='',nde='',rde='',ide='',ade='',ode='',sde='',lde='',ude='',cde='',dde='',pde='',fde='',hde='',gde='',mde='',bde='',yde='',Ede='',vde='',_de='',Tde='',Sde='',wde='',Ade='',Cde='',kde='',xde='',Ide='',Rde='',Nde='',Ode='',Dde='',Lde='',Mde='',Fde='',Pde='',Bde='',Ude='',$de='',zde='',Hde='',jde='',Gde='',Vde='',Wde='',qde='',Kde='',Yde='',Xde='',Zde='',Qde='',Jde='',epe='',tpe='',npe='',rpe='',ipe='',ape='',ope='',spe='',lpe='',upe='',cpe='',dpe='',ppe='',fpe='',hpe='',gpe='',mpe='',bpe='',ype='',Epe='',vpe='',_pe='',Tpe='',Spe='',wpe='',Ape='',Cpe='',kpe='',xpe='',Ipe='',Rpe='',Npe='',Ope='',Dpe='',Lpe='',Mpe={folder:ece,bsl:tce,mdo:nce,salesforce:rce,asm:ice,bicep:ace,c:oce,"c-sharp":'',html:sce,cpp:lce,clojure:uce,coldfusion:cce,coffee:dce,config:pce,crystal:fce,crystal_embedded:hce,json:gce,css:mce,csv:bce,xls:yce,cu:Ece,cake:vce,cake_php:_ce,d:Tce,word:Sce,ejs:wce,elixir:Ace,elixir_script:Cce,hex:kce,elm:xce,favicon:Ice,"f-sharp":'',git:Rce,go2:Nce,go:Oce,godot:Dce,gradle:Lce,grails:Mce,graphql:Fce,hacklang:Pce,haml:Bce,mustache:Uce,haskell:$ce,haxe:zce,jade:Hce,java:jce,javascript:Gce,jinja:Vce,julia:Wce,karma:qce,kotlin:Kce,dart:Yce,less:Xce,liquid:Zce,livescript:Qce,lua:Jce,markdown:ede,argdown:tde,info:nde,clock:rde,maven:ide,nim:ade,github:ode,notebook:sde,nunjucks:lde,npm:ude,ocaml:cde,odata:dde,perl:pde,php:fde,pipeline:hde,pddl:gde,plan:mde,happenings:bde,powershell:yde,prisma:Ede,pug:vde,puppet:_de,purescript:Tde,python:Sde,react:wde,reasonml:Ade,rescript:Cde,R:kde,ruby:xde,html_erb:Ide,rust:Rde,sass:Nde,spring:Ode,slim:Dde,smarty:Lde,sbt:Mde,scala:Fde,ethereum:Pde,stylus:Bde,svelte:Ude,swift:$de,db:zde,terraform:Hde,tex:jde,default:'',twig:Gde,typescript:Vde,tsconfig:Wde,vala:qde,vue:Kde,wasm:Yde,wat:Xde,xml:Zde,yml:Qde,prolog:Jde,zip:epe,wgt:tpe,illustrator:npe,photoshop:rpe,pdf:ipe,font:ape,image:ope,svg:spe,sublime:lpe,"code-search":'',shell:upe,video:cpe,audio:dpe,windows:ppe,jenkins:fpe,babel:hpe,bower:gpe,docker:mpe,"code-climate":'',eslint:bpe,firebase:ype,firefox:Epe,grunt:vpe,gulp:_pe,ionic:Tpe,platformio:Spe,rollup:wpe,stylelint:Ape,yarn:Cpe,webpack:kpe,lock:xpe,license:Ipe,makefile:Rpe,heroku:Npe,todo:Ope,npm_ignored:Dpe,ignored:Lpe};var Hg=Jl&&Jl.__assign||function(){return Hg=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1)return i[1]}return i1.default},nP=function(e){var t=Upe(e),n=t[0],r=t[1];return{svg:Bpe[n],color:r}};Z7.getIcon=nP;var $pe=function(e){return function(t){var n=nP(t);return Hg(Hg({},n),{color:e[n.color]})}},zpe=Z7.themeIcons=$pe;const Ey=({filename:e,height:t,width:n})=>{const r=zpe({blue:"#268bd2",grey:"#657b83","grey-light":"#839496",green:"#859900",orange:"#cb4b16",pink:"#d33682",purple:"#6c71c4",red:"#dc322f",white:"#fdf6e3",yellow:"#b58900",ignore:"#586e75"}),{svg:i,color:a}=r(e),o=Y1e.sanitize(i);return I.jsx("div",{dangerouslySetInnerHTML:{__html:o},style:{width:n,height:t,fill:a}})};var Q7={};Object.defineProperty(Q7,"__esModule",{value:!0});Q7.testFunc=void 0;var Hpe=function(){console.log("test")};Q7.testFunc=Hpe;function jpe(e,t){var n;if(typeof vscode>"u"){if(localStorage.getItem("ide"),window.postIntellijMessage===void 0)throw console.log("Unable to send message: postIntellijMessage is undefined. ",e,t),new Error("postIntellijMessage is undefined");(n=window.postIntellijMessage)==null||n.call(window,e,t);return}vscode.postMessage({type:e,...t})}function qa(e,t,n=0){try{jpe(e,t)}catch(r){n<5?(console.log(`Attempt ${n} failed. Retrying...`),setTimeout(()=>qa(e,t,n+1),Math.pow(2,n)*1e3)):console.error("Max attempts reached. Message could not be sent.",r)}}var rP={exports:{}},iP={};/** * @license React * use-sync-external-store-shim.production.min.js @@ -606,11 +606,11 @@ Hint: It might not be working because maybe you're not up to date with the Meili ${({isLastItem:e})=>e&&"border-bottom: 1px solid gray;"} cursor: pointer; z-index: 500; -`,QI=st.forwardRef((e,t)=>{var Te,Le,ze,Ye,jt,ue,Ee,qe;const n=zt(j=>j.serverState.meilisearchUrl||"http://127.0.0.1:7700"),[r,i]=C.useState(void 0);C.useEffect(()=>{const j=new G0e({host:n});i(j)},[n]);const a=C.useContext(to),o=eo(),s=zt(j=>j.config.workspacePaths);zt(j=>j.sessionState.history);const[u,c]=st.useState([]),[p,f]=st.useState(0),[m,g]=st.useState([]),b=st.useRef(null);C.useEffect(()=>{b.current&&(b.current.style.height="auto",b.current.style.height=Math.min(b.current.scrollHeight,300)+"px")},[(Te=b.current)==null?void 0:Te.scrollHeight,(Le=b.current)==null?void 0:Le.clientHeight,(ze=b.current)==null?void 0:ze.value]);const[y,T]=C.useState(!1),[E,v]=C.useState(void 0),[w,A]=C.useState(void 0),R=zt(j=>{var me;return((me=j.serverState.slashCommands)==null?void 0:me.map(Ve=>({name:`/${Ve.name}`,description:Ve.description})))||[]}),k=zt(j=>typeof e.index<"u"?j.sessionState.contextItemsAtIndex[e.index]||[]:j.sessionState.context_items||[]),N=zt(j=>j.sessionState.history),B=zt(j=>j.sessionState.active);C.useEffect(()=>{y||(v(void 0),A(void 0))},[y]);const q=zt(j=>j.serverState.contextProviders),P=()=>{T(!1),v(void 0),A(void 0),H.setInputValue("@")};C.useEffect(()=>{E||g((q==null?void 0:q.map(j=>({name:j.display_title,description:j.description,id:j.title})).sort((j,me)=>j.id==="file"?-1:1))||[])},[E]);const[Q,$]=C.useState(""),oe=C.useCallback(async(j,me)=>{const Ve=await(a==null?void 0:a.getContextItem(j,me));e.isMainInput?o(TP(Ve)):typeof e.index<"u"&&o(SP({item:Ve,index:e.index}))},[a,e.index]),fe=C.useCallback(({inputValue:j,highlightedIndex:me})=>{var Ve;if(!j){g([]),v(void 0),T(!1);return}if(Q===""&&(q!=null&&q.some(ge=>ge.display_title===j))){H.setInputValue(""),$("");return}if($(j),w&&!j.startsWith(`@${w.title}`)&&A(void 0),(Ve=e.onInputValueChange)==null||Ve.call(e,j),j.endsWith("@")||y){const ge=(j==null?void 0:j.split("@"))||[];if(ge.length>1){T(!0);const G=ge[ge.length-1]||"";if(E&&!j.endsWith("@")){const K=G.split(" ");ce(E.title,K.length>1?K[1]:"").then(ne=>{g(ne)})}else{const K=(q==null?void 0:q.filter(ne=>`@${ne.title}`.toLowerCase().startsWith(j.toLowerCase())||`@${ne.display_title}`.toLowerCase().startsWith(j.toLowerCase())).map(ne=>({name:ne.display_title,description:ne.description,id:ne.title})).sort((ne,ve)=>ne.id==="file"?-1:1))||[];g(K),T(!0)}return}else T(!1),v(void 0)}v(void 0),g((R==null?void 0:R.filter(ge=>{const G=ge.name.toLowerCase(),K=j.toLowerCase();return G.startsWith(K)&&G!==K}))||[]),(j.startsWith("/")||j.startsWith("@"))&&o(Ad(null))},[R,y,E,w]),ce=async(j,me)=>{const Ve=s&&s.length>0?`workspace_dir IN [ ${s.map(ge=>`"${ge}"`).join(", ")} ] AND provider_name = '${j}'`:void 0;try{const ge=await(r==null?void 0:r.index(J0e).search(me,{filter:Ve}));return(ge==null?void 0:ge.hits.map(G=>({name:G.name,description:G.description,id:G.id,content:G.content})))||[]}catch(ge){return console.log("Error searching context items",ge),[]}},{getInputProps:De,...H}=YF({onInputValueChange:fe,items:m,itemToString(j){return j?j.name:""}});C.useEffect(()=>{H.highlightedIndex<0&&H.setHighlightedIndex(0)},[H.inputValue]);const W=st.useRef(null),se=st.useRef(null),D=()=>{var j;return(((j=W.current)==null?void 0:j.getBoundingClientRect().top)||Number.MAX_SAFE_INTEGER)>RP};C.useImperativeHandle(t,()=>H,[H]);const pe=st.useRef(null),le=C.useCallback(()=>{var ge;if(ye(!0),!pe.current)return;const j=pe.current.querySelectorAll(`.pill-button-${e.index||"main"}`),me=Array.from(j),Ve=me.findIndex(G=>G===document.activeElement);if(Ve===me.length-1)(ge=b.current)==null||ge.focus();else if(Ve!==-1){const G=me[(Ve+1)%me.length];G==null||G.focus()}else{const G=me[0];G==null||G.focus()}},[e.index]);C.useEffect(()=>{if(b.current){const j=me=>{me.key==="Tab"&&(me.preventDefault(),le())};return b.current.addEventListener("keydown",j),()=>{var me;(me=b.current)==null||me.removeEventListener("keydown",j)}}},[b.current]),C.useEffect(()=>{e.value&&H.setInputValue(e.value)},[e.value,H.setInputValue]);const[L,ie]=C.useState(!1);C.useLayoutEffect(()=>{se.current&&H.setHighlightedIndex(0)},[m,H.setHighlightedIndex,se.current]);const[Se,X]=C.useState(!1),[ke,te]=C.useState(!1);C.useEffect(()=>{const j=Ve=>{Ve.key==="Meta"&&X(!0)},me=Ve=>{Ve.key==="Meta"&&X(!1)};return window.addEventListener("keydown",j),window.addEventListener("keyup",me),()=>{window.removeEventListener("keydown",j),window.removeEventListener("keyup",me)}},[]),C.useEffect(()=>{if(!b.current||!e.isMainInput)return;e.isMainInput&&b.current.focus();const j=me=>{var Ve;me.data.type==="focusContinueInput"?(b.current.focus(),o(Ad(null))):me.data.type==="focusContinueInputWithEdit"?(b.current.focus(),(Ve=b.current)!=null&&Ve.value.startsWith("/edit")||H.setInputValue("/edit "),o(Ad(null))):me.data.type==="focusContinueInputWithNewSession"&&(a==null||a.stopSession(),o(uc()),o(Ad(null)))};return window.addEventListener("message",j),()=>{window.removeEventListener("message",j)}},[b.current,e.isMainInput]);const Me=st.useRef(null),Re=C.useCallback(j=>{const me=m[H.highlightedIndex],Ve=me==null?void 0:me.name,ge=q.find(G=>G.display_title===Ve);if(ge){if(ge.dynamic&&ge.requires_query){A(ge),H.setInputValue(`@${ge.title} `),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}else if(ge.dynamic){if(!me.id)return;const G=H.inputValue.split("@"),K=G[G.length-1];if(oe(me.id,K),H.inputValue.includes("@")){const ne=q.find(ve=>ve.title===me.id);!E&&!(ne!=null&&ne.dynamic)?(H.setInputValue(`@${me.id} `),v(ne)):H.setInputValue("")}H.setInputValue(""),T(!1),v(void 0),A(void 0),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}}else{if(E&&me.id){oe(me.id,""),H.setInputValue(""),T(!1),v(void 0),A(void 0),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}v(ge),H.setInputValue(`@${ge.title} `),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault(),ce(ge.title,"").then(G=>g(G))},[m,H.highlightedIndex,q,E,H.inputValue,oe]),[Ze,We]=C.useState(!1),[dt,ot]=C.useState(!1),[je,pt]=C.useState(void 0),[U,re]=C.useState(void 0),de=st.useRef(null),[xe,ye]=C.useState(!1);return C.useEffect(()=>{ke||ye(!1)},[ke]),I.jsxs("div",{ref:de,style:{paddingTop:"4px",backgroundColor:Ht},children:[k.length===0&&e.isMainInput&&I.jsxs("div",{style:{color:Et,fontSize:"10px",backgroundColor:Ht,paddingLeft:"12px",paddingTop:pr(),width:"calc(100% - 24px)"},children:[I.jsx("span",{onClick:()=>{var j;H.setInputValue("@"),(j=b.current)==null||j.focus()},className:"hover:underline cursor-pointer",children:"+ Add Context"}),(((Ye=H.inputValue)==null?void 0:Ye.startsWith("/edit"))||ke&&Se&&((jt=H.inputValue)==null?void 0:jt.length)>0)&&I.jsx("span",{className:"float-right",children:"Inserting at cursor"})]}),e.isMainInput||k.length>0&&xe?I.jsxs("div",{className:"px-2 flex gap-2 items-center flex-wrap",ref:pe,style:{backgroundColor:Ht},children:[k.length>0&&I.jsx("div",{className:"cursor-pointer",onClick:j=>{ot(me=>!me)},id:"toggle-context-div",children:dt?I.jsx(gZ,{width:"14px",height:"14px",color:Et}):I.jsx(yZ,{width:"14px",height:"14px",color:Et})}),I.jsx(nhe,{className:k.length>0?`pill-button-${e.index||"main"}`:"",onClick:()=>{var j;o(w4({ids:k.map(me=>me.description.id),index:e.index})),(j=b.current)==null||j.focus(),pt(void 0),re(void 0)},onKeyDown:j=>{var me;j.key==="Backspace"&&(o(w4({ids:k.map(Ve=>Ve.description.id),index:e.index})),(me=b.current)==null||me.focus(),pt(void 0),re(void 0))},children:I.jsx(kL,{width:"1.4em",height:"1.4em"})}),k.map((j,me)=>{var Ve,ge,G,K;return I.jsx(A0e,{inputIndex:e.index,areMultipleItems:k.length>1,item:j,editing:j.editing&&((ge=(Ve=b.current)==null?void 0:Ve.value)==null?void 0:ge.startsWith("/edit")),editingAny:(K=(G=b.current)==null?void 0:G.value)==null?void 0:K.startsWith("/edit"),stepIndex:e.index,index:me,onDelete:()=>{var ne;o(w4({ids:[j.description.id],index:e.index})),(ne=b.current)==null||ne.focus(),(j.description.id.item_id===(U==null?void 0:U.description.id.item_id)&&(U==null?void 0:U.description.id.provider_name)===j.description.id.provider_name||j.description.id.item_id===(je==null?void 0:je.description.id.item_id)&&(je==null?void 0:je.description.id.provider_name)===j.description.id.provider_name)&&(pt(void 0),re(void 0))},onClick:ne=>{j.description.id.item_id===(U==null?void 0:U.description.id.item_id)&&(U==null?void 0:U.description.id.provider_name)===j.description.id.provider_name?re(void 0):re(j)},onBlur:()=>{re(void 0)},toggleViewContent:()=>{pt(ne=>{if(!ne)return j;if(!(ne.description.id.item_id===j.description.id.item_id&&ne.description.id.provider_name===j.description.id.provider_name))return j})},previewing:j.description.id.item_id===(je==null?void 0:je.description.id.item_id)&&(je==null?void 0:je.description.id.provider_name)===j.description.id.provider_name,focusing:j.description.id.item_id===(U==null?void 0:U.description.id.item_id)&&(U==null?void 0:U.description.id.provider_name)===j.description.id.provider_name,prefixInputWithEdit:ne=>{var ve,Qe,Fe;!ne&&((ve=b.current)!=null&&ve.value.startsWith("/edit"))&&H.setInputValue((Qe=b.current)==null?void 0:Qe.value.replace("/edit ","")),!H.inputValue.startsWith("/edit")&&(H.setInputValue(`/edit ${H.inputValue}`),(Fe=b.current)==null||Fe.focus())}},`${j.description.id.item_id}${me}`)})]}):k.length>0&&I.jsxs("div",{onClick:()=>{var j;(j=b.current)==null||j.focus(),ye(!0)},style:{color:Et,fontSize:"10px",backgroundColor:Ht,paddingLeft:"12px",cursor:"default",paddingTop:pr(),width:"fit-content"},children:[e.active?"Using":"Used"," ",k.length," ","context item",k.length===1?"":"s"]}),je&&I.jsx("pre",{className:"m-0",children:I.jsx(Ug,{source:`\`\`\`${WC(je.description.description)} +`,QI=st.forwardRef((e,t)=>{var Te,Le,ze,Xe,jt,ue,Ee,qe;const n=zt(j=>j.serverState.meilisearchUrl||"http://127.0.0.1:7700"),[r,i]=C.useState(void 0);C.useEffect(()=>{const j=new G0e({host:n});i(j)},[n]);const a=C.useContext(to),o=eo(),s=zt(j=>j.config.workspacePaths);zt(j=>j.sessionState.history);const[u,c]=st.useState([]),[p,f]=st.useState(0),[m,g]=st.useState([]),b=st.useRef(null);C.useEffect(()=>{b.current&&(b.current.style.height="auto",b.current.style.height=Math.min(b.current.scrollHeight,300)+"px")},[(Te=b.current)==null?void 0:Te.scrollHeight,(Le=b.current)==null?void 0:Le.clientHeight,(ze=b.current)==null?void 0:ze.value]);const[y,T]=C.useState(!1),[E,v]=C.useState(void 0),[w,A]=C.useState(void 0),R=zt(j=>{var me;return((me=j.serverState.slashCommands)==null?void 0:me.map(Ve=>({name:`/${Ve.name}`,description:Ve.description})))||[]}),k=zt(j=>typeof e.index<"u"?j.sessionState.contextItemsAtIndex[e.index]||[]:j.sessionState.context_items||[]),N=zt(j=>j.sessionState.history),B=zt(j=>j.sessionState.active);C.useEffect(()=>{y||(v(void 0),A(void 0))},[y]);const q=zt(j=>j.serverState.contextProviders),P=()=>{T(!1),v(void 0),A(void 0),H.setInputValue("@")};C.useEffect(()=>{E||g((q==null?void 0:q.map(j=>({name:j.display_title,description:j.description,id:j.title})).sort((j,me)=>j.id==="file"?-1:1))||[])},[E]);const[Q,$]=C.useState(""),oe=C.useCallback(async(j,me)=>{const Ve=await(a==null?void 0:a.getContextItem(j,me));e.isMainInput?o(TP(Ve)):typeof e.index<"u"&&o(SP({item:Ve,index:e.index}))},[a,e.index]),fe=C.useCallback(({inputValue:j,highlightedIndex:me})=>{var Ve;if(!j){g([]),v(void 0),T(!1);return}if(Q===""&&(q!=null&&q.some(ge=>ge.display_title===j))){H.setInputValue(""),$("");return}if($(j),w&&!j.startsWith(`@${w.title}`)&&A(void 0),(Ve=e.onInputValueChange)==null||Ve.call(e,j),j.endsWith("@")||y){const ge=(j==null?void 0:j.split("@"))||[];if(ge.length>1){T(!0);const G=ge[ge.length-1]||"";if(E&&!j.endsWith("@")){const K=G.split(" ");ce(E.title,K.length>1?K[1]:"").then(ne=>{g(ne)})}else{const K=(q==null?void 0:q.filter(ne=>`@${ne.title}`.toLowerCase().startsWith(j.toLowerCase())||`@${ne.display_title}`.toLowerCase().startsWith(j.toLowerCase())).map(ne=>({name:ne.display_title,description:ne.description,id:ne.title})).sort((ne,ve)=>ne.id==="file"?-1:1))||[];g(K),T(!0)}return}else T(!1),v(void 0)}v(void 0),g((R==null?void 0:R.filter(ge=>{const G=ge.name.toLowerCase(),K=j.toLowerCase();return G.startsWith(K)&&G!==K}))||[]),(j.startsWith("/")||j.startsWith("@"))&&o(Ad(null))},[R,y,E,w]),ce=async(j,me)=>{const Ve=s&&s.length>0?`workspace_dir IN [ ${s.map(ge=>`"${ge}"`).join(", ")} ] AND provider_name = '${j}'`:void 0;try{const ge=await(r==null?void 0:r.index(J0e).search(me,{filter:Ve}));return(ge==null?void 0:ge.hits.map(G=>({name:G.name,description:G.description,id:G.id,content:G.content})))||[]}catch(ge){return console.log("Error searching context items",ge),[]}},{getInputProps:De,...H}=YF({onInputValueChange:fe,items:m,itemToString(j){return j?j.name:""}});C.useEffect(()=>{H.highlightedIndex<0&&H.setHighlightedIndex(0)},[H.inputValue]);const W=st.useRef(null),se=st.useRef(null),D=()=>{var j;return(((j=W.current)==null?void 0:j.getBoundingClientRect().top)||Number.MAX_SAFE_INTEGER)>RP};C.useImperativeHandle(t,()=>H,[H]);const pe=st.useRef(null),le=C.useCallback(()=>{var ge;if(ye(!0),!pe.current)return;const j=pe.current.querySelectorAll(`.pill-button-${e.index||"main"}`),me=Array.from(j),Ve=me.findIndex(G=>G===document.activeElement);if(Ve===me.length-1)(ge=b.current)==null||ge.focus();else if(Ve!==-1){const G=me[(Ve+1)%me.length];G==null||G.focus()}else{const G=me[0];G==null||G.focus()}},[e.index]);C.useEffect(()=>{if(b.current){const j=me=>{me.key==="Tab"&&(me.preventDefault(),le())};return b.current.addEventListener("keydown",j),()=>{var me;(me=b.current)==null||me.removeEventListener("keydown",j)}}},[b.current]),C.useEffect(()=>{e.value&&H.setInputValue(e.value)},[e.value,H.setInputValue]);const[L,ie]=C.useState(!1);C.useLayoutEffect(()=>{se.current&&H.setHighlightedIndex(0)},[m,H.setHighlightedIndex,se.current]);const[Se,X]=C.useState(!1),[ke,te]=C.useState(!1);C.useEffect(()=>{const j=Ve=>{Ve.key==="Meta"&&X(!0)},me=Ve=>{Ve.key==="Meta"&&X(!1)};return window.addEventListener("keydown",j),window.addEventListener("keyup",me),()=>{window.removeEventListener("keydown",j),window.removeEventListener("keyup",me)}},[]),C.useEffect(()=>{if(!b.current||!e.isMainInput)return;e.isMainInput&&b.current.focus();const j=me=>{var Ve;me.data.type==="focusContinueInput"?(b.current.focus(),o(Ad(null))):me.data.type==="focusContinueInputWithEdit"?(b.current.focus(),(Ve=b.current)!=null&&Ve.value.startsWith("/edit")||H.setInputValue("/edit "),o(Ad(null))):me.data.type==="focusContinueInputWithNewSession"&&(a==null||a.stopSession(),o(uc()),o(Ad(null)))};return window.addEventListener("message",j),()=>{window.removeEventListener("message",j)}},[b.current,e.isMainInput]);const Me=st.useRef(null),Re=C.useCallback(j=>{const me=m[H.highlightedIndex],Ve=me==null?void 0:me.name,ge=q.find(G=>G.display_title===Ve);if(ge){if(ge.dynamic&&ge.requires_query){A(ge),H.setInputValue(`@${ge.title} `),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}else if(ge.dynamic){if(!me.id)return;const G=H.inputValue.split("@"),K=G[G.length-1];if(oe(me.id,K),H.inputValue.includes("@")){const ne=q.find(ve=>ve.title===me.id);!E&&!(ne!=null&&ne.dynamic)?(H.setInputValue(`@${me.id} `),v(ne)):H.setInputValue("")}H.setInputValue(""),T(!1),v(void 0),A(void 0),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}}else{if(E&&me.id){oe(me.id,""),H.setInputValue(""),T(!1),v(void 0),A(void 0),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault();return}v(ge),H.setInputValue(`@${ge.title} `),j.nativeEvent.preventDownshiftDefault=!0,j.preventDefault(),ce(ge.title,"").then(G=>g(G))},[m,H.highlightedIndex,q,E,H.inputValue,oe]),[Ye,We]=C.useState(!1),[dt,ot]=C.useState(!1),[je,pt]=C.useState(void 0),[U,re]=C.useState(void 0),de=st.useRef(null),[xe,ye]=C.useState(!1);return C.useEffect(()=>{ke||ye(!1)},[ke]),I.jsxs("div",{ref:de,style:{paddingTop:"4px",backgroundColor:Ht},children:[k.length===0&&e.isMainInput&&I.jsxs("div",{style:{color:Et,fontSize:"10px",backgroundColor:Ht,paddingLeft:"12px",paddingTop:pr(),width:"calc(100% - 24px)"},children:[I.jsx("span",{onClick:()=>{var j;H.setInputValue("@"),(j=b.current)==null||j.focus()},className:"hover:underline cursor-pointer",children:"+ Add Context"}),(((Xe=H.inputValue)==null?void 0:Xe.startsWith("/edit"))||ke&&Se&&((jt=H.inputValue)==null?void 0:jt.length)>0)&&I.jsx("span",{className:"float-right",children:"Inserting at cursor"})]}),e.isMainInput||k.length>0&&xe?I.jsxs("div",{className:"px-2 flex gap-2 items-center flex-wrap",ref:pe,style:{backgroundColor:Ht},children:[k.length>0&&I.jsx("div",{className:"cursor-pointer",onClick:j=>{ot(me=>!me)},id:"toggle-context-div",children:dt?I.jsx(gZ,{width:"14px",height:"14px",color:Et}):I.jsx(yZ,{width:"14px",height:"14px",color:Et})}),I.jsx(nhe,{className:k.length>0?`pill-button-${e.index||"main"}`:"",onClick:()=>{var j;o(w4({ids:k.map(me=>me.description.id),index:e.index})),(j=b.current)==null||j.focus(),pt(void 0),re(void 0)},onKeyDown:j=>{var me;j.key==="Backspace"&&(o(w4({ids:k.map(Ve=>Ve.description.id),index:e.index})),(me=b.current)==null||me.focus(),pt(void 0),re(void 0))},children:I.jsx(kL,{width:"1.4em",height:"1.4em"})}),k.map((j,me)=>{var Ve,ge,G,K;return I.jsx(A0e,{inputIndex:e.index,areMultipleItems:k.length>1,item:j,editing:j.editing&&((ge=(Ve=b.current)==null?void 0:Ve.value)==null?void 0:ge.startsWith("/edit")),editingAny:(K=(G=b.current)==null?void 0:G.value)==null?void 0:K.startsWith("/edit"),stepIndex:e.index,index:me,onDelete:()=>{var ne;o(w4({ids:[j.description.id],index:e.index})),(ne=b.current)==null||ne.focus(),(j.description.id.item_id===(U==null?void 0:U.description.id.item_id)&&(U==null?void 0:U.description.id.provider_name)===j.description.id.provider_name||j.description.id.item_id===(je==null?void 0:je.description.id.item_id)&&(je==null?void 0:je.description.id.provider_name)===j.description.id.provider_name)&&(pt(void 0),re(void 0))},onClick:ne=>{j.description.id.item_id===(U==null?void 0:U.description.id.item_id)&&(U==null?void 0:U.description.id.provider_name)===j.description.id.provider_name?re(void 0):re(j)},onBlur:()=>{re(void 0)},toggleViewContent:()=>{pt(ne=>{if(!ne)return j;if(!(ne.description.id.item_id===j.description.id.item_id&&ne.description.id.provider_name===j.description.id.provider_name))return j})},previewing:j.description.id.item_id===(je==null?void 0:je.description.id.item_id)&&(je==null?void 0:je.description.id.provider_name)===j.description.id.provider_name,focusing:j.description.id.item_id===(U==null?void 0:U.description.id.item_id)&&(U==null?void 0:U.description.id.provider_name)===j.description.id.provider_name,prefixInputWithEdit:ne=>{var ve,Qe,Fe;!ne&&((ve=b.current)!=null&&ve.value.startsWith("/edit"))&&H.setInputValue((Qe=b.current)==null?void 0:Qe.value.replace("/edit ","")),!H.inputValue.startsWith("/edit")&&(H.setInputValue(`/edit ${H.inputValue}`),(Fe=b.current)==null||Fe.focus())}},`${j.description.id.item_id}${me}`)})]}):k.length>0&&I.jsxs("div",{onClick:()=>{var j;(j=b.current)==null||j.focus(),ye(!0)},style:{color:Et,fontSize:"10px",backgroundColor:Ht,paddingLeft:"12px",cursor:"default",paddingTop:pr(),width:"fit-content"},children:[e.active?"Using":"Used"," ",k.length," ","context item",k.length===1?"":"s"]}),je&&I.jsx("pre",{className:"m-0",children:I.jsx(Ug,{source:`\`\`\`${WC(je.description.description)} ${je.content} \`\`\``,maxHeight:200})}),dt&&I.jsx("div",{children:k.map(j=>I.jsxs(rhe,{children:[I.jsxs(ihe,{children:[I.jsx(Ey,{height:"20px",width:"20px",filename:j.description.name}),j.description.name]}),I.jsx("pre",{className:"m-0",children:I.jsx(Ug,{source:`\`\`\`${WC(j.description.description)} ${j.content} -\`\`\``,maxHeight:200})})]}))}),I.jsxs("div",{className:"flex px-2 relative",style:{backgroundColor:Ht},ref:W,children:[I.jsxs(the,{loading:e.active||!1,isFirst:!1,isLast:!1,borderColor:e.active?void 0:Ht,borderRadius:It,children:[I.jsx(ahe,{onClick:()=>{var j;(j=b.current)==null||j.focus()},onMouseEnter:()=>ie(!0),onMouseLeave:j=>{var me;j.relatedTarget===Me.current||j.relatedTarget instanceof Node&&((me=Me.current)!=null&&me.contains(j.relatedTarget))||ie(!1)},rows:e.isMainInput?void 0:1,inQueryForDynamicProvider:typeof w<"u",fontSize:pr(),disabled:e.disabled,placeholder:"Ask a question, '/' for slash commands, '@' to add context",...De({onCompositionStart:()=>We(!0),onCompositionEnd:()=>We(!1),onChange:j=>{},onFocus:j=>{te(!0),o(pu(void 0))},onBlur:j=>{var me,Ve;(me=de.current)!=null&&me.contains(j.relatedTarget)||(Ve=document.getElementById("toggle-context-div"))!=null&&Ve.contains(j.relatedTarget)||te(!1)},onKeyDown:j=>{var me,Ve;if(o(pu(void 0)),j.key==="Enter"&&j.shiftKey)j.nativeEvent.preventDownshiftDefault=!0,T(!1);else if(j.key==="Enter"&&(!H.isOpen||m.length===0)&&!Ze){const ge=H.inputValue;if(w){const G=ge.split("@");oe(w.title,G[G.length-1]),T(!1),H.setInputValue("");return}else ge!==""&&(f(u.length+1),c([...u,ge])),j.nativeEvent.preventDownshiftDefault=!0,e.onEnter&&e.onEnter(j,ge);T(!1)}else if(j.key==="Enter"&&y)Re(j);else if(j.key==="Tab"&&H.isOpen&&m.length>0&&((me=m[H.highlightedIndex])!=null&&me.name.startsWith("/")))H.setInputValue(m[0].name),j.preventDefault();else if(j.key==="Tab")j.nativeEvent.preventDownshiftDefault=!0;else{if((j.key==="ArrowUp"||j.key==="ArrowDown")&&m.length>0)return;if(j.key==="ArrowUp"){if(p==0||j.currentTarget.selectionStart!==0){j.nativeEvent.preventDownshiftDefault=!0;return}else p==u.length&&(u.length===0||u[u.length-1]!==j.currentTarget.value)&&c([...u,j.currentTarget.value]);H.setInputValue(u[p-1]),f(ge=>ge-1),T(!1)}else if(j.key==="ArrowDown"){if(p===u.length||j.currentTarget.selectionStart!==j.currentTarget.value.length){j.nativeEvent.preventDownshiftDefault=!0;return}pMath.min(ge+1,u.length)),T(!1)}else if(j.key==="Escape"){if(E){P(),j.nativeEvent.preventDownshiftDefault=!0;return}else if(w){P(),j.nativeEvent.preventDownshiftDefault=!0;return}T(!1),H.isOpen&&m.length>0?(H.closeMenu(),j.nativeEvent.preventDownshiftDefault=!0):(j.nativeEvent.preventDownshiftDefault=!0,(Ve=b.current)==null||Ve.blur(),qa("focusEditor",{}))}else j.key==="Home"||j.key==="End"?j.nativeEvent.preventDownshiftDefault=!0:localStorage.getItem("ide")==="jetbrains"&&(Km()==="mac"?Z0e(j,H.inputValue,H.setInputValue):Q0e(j,H.inputValue,H.setInputValue))}},onClick:()=>{o(pu(void 0))},ref:b})}),e.isMainInput||I.jsx(ohe,{ref:Me,children:L&&I.jsx("div",{className:"flex",children:I.jsxs(I.Fragment,{children:[N.filter((j,me)=>{var Ve;return((Ve=e.groupIndices)==null?void 0:Ve.includes(me))&&j.logs}).some(j=>j.logs.length>0)&&I.jsx(zi,{onClick:j=>{if(j.stopPropagation(),e.groupIndices){const me=`This is the exact prompt sent to the LLM: +\`\`\``,maxHeight:200})})]}))}),I.jsxs("div",{className:"flex px-2 relative",style:{backgroundColor:Ht},ref:W,children:[I.jsxs(the,{loading:e.active||!1,isFirst:!1,isLast:!1,borderColor:e.active?void 0:Ht,borderRadius:It,children:[I.jsx(ahe,{onClick:()=>{var j;(j=b.current)==null||j.focus()},onMouseEnter:()=>ie(!0),onMouseLeave:j=>{var me;j.relatedTarget===Me.current||j.relatedTarget instanceof Node&&((me=Me.current)!=null&&me.contains(j.relatedTarget))||ie(!1)},rows:e.isMainInput?void 0:1,inQueryForDynamicProvider:typeof w<"u",fontSize:pr(),disabled:e.disabled,placeholder:"Ask a question, '/' for slash commands, '@' to add context",...De({onCompositionStart:()=>We(!0),onCompositionEnd:()=>We(!1),onChange:j=>{},onFocus:j=>{te(!0),o(pu(void 0))},onBlur:j=>{var me,Ve;(me=de.current)!=null&&me.contains(j.relatedTarget)||(Ve=document.getElementById("toggle-context-div"))!=null&&Ve.contains(j.relatedTarget)||te(!1)},onKeyDown:j=>{var me,Ve;if(!Ye)if(o(pu(void 0)),j.key==="Enter"&&j.shiftKey)j.nativeEvent.preventDownshiftDefault=!0,T(!1);else if(j.key==="Enter"&&(!H.isOpen||m.length===0)&&!Ye){const ge=H.inputValue;if(w){const G=ge.split("@");oe(w.title,G[G.length-1]),T(!1),H.setInputValue("");return}else ge!==""&&(f(u.length+1),c([...u,ge])),j.nativeEvent.preventDownshiftDefault=!0,e.onEnter&&e.onEnter(j,ge);T(!1)}else if(j.key==="Enter"&&y)Re(j);else if(j.key==="Tab"&&H.isOpen&&m.length>0&&((me=m[H.highlightedIndex])!=null&&me.name.startsWith("/")))H.setInputValue(m[0].name),j.preventDefault();else if(j.key==="Tab")j.nativeEvent.preventDownshiftDefault=!0;else{if((j.key==="ArrowUp"||j.key==="ArrowDown")&&m.length>0)return;if(j.key==="ArrowUp"){if(p==0||j.currentTarget.selectionStart!==0){j.nativeEvent.preventDownshiftDefault=!0;return}else p==u.length&&(u.length===0||u[u.length-1]!==j.currentTarget.value)&&c([...u,j.currentTarget.value]);H.setInputValue(u[p-1]),f(ge=>ge-1),T(!1)}else if(j.key==="ArrowDown"){if(p===u.length||j.currentTarget.selectionStart!==j.currentTarget.value.length){j.nativeEvent.preventDownshiftDefault=!0;return}pMath.min(ge+1,u.length)),T(!1)}else if(j.key==="Escape"){if(E){P(),j.nativeEvent.preventDownshiftDefault=!0;return}else if(w){P(),j.nativeEvent.preventDownshiftDefault=!0;return}T(!1),H.isOpen&&m.length>0?(H.closeMenu(),j.nativeEvent.preventDownshiftDefault=!0):(j.nativeEvent.preventDownshiftDefault=!0,(Ve=b.current)==null||Ve.blur(),qa("focusEditor",{}))}else j.key==="Home"||j.key==="End"?j.nativeEvent.preventDownshiftDefault=!0:localStorage.getItem("ide")==="jetbrains"&&(Km()==="mac"?Z0e(j,H.inputValue,H.setInputValue):Q0e(j,H.inputValue,H.setInputValue))}},onClick:()=>{o(pu(void 0))},ref:b})}),e.isMainInput||I.jsx(ohe,{ref:Me,children:L&&I.jsx("div",{className:"flex",children:I.jsxs(I.Fragment,{children:[N.filter((j,me)=>{var Ve;return((Ve=e.groupIndices)==null?void 0:Ve.includes(me))&&j.logs}).some(j=>j.logs.length>0)&&I.jsx(zi,{onClick:j=>{if(j.stopPropagation(),e.groupIndices){const me=`This is the exact prompt sent to the LLM: `+N.filter((Ve,ge)=>{var G;return(G=e.groupIndices)==null?void 0:G.includes(ge)}).flatMap(Ve=>Ve.logs||[]).join(` `);qa("showVirtualFile",{name:"inspect_prompt.md",content:me})}},text:"Inspect Prompt",children:I.jsx(iZ,{width:"1.3em",height:"1.3em"})}),I.jsx(zi,{onClick:j=>{var me;j.stopPropagation(),e.active&&e.groupIndices?a==null||a.stopSession():(me=e.onDelete)==null||me.call(e)},text:e.active?`Stop (${zX()}⌫)`:"Delete",children:e.active?null:I.jsx(w9,{width:"1.4em",height:"1.4em"})})]})})})]}),w&&I.jsxs(she,{children:["Enter ",w.display_title," Query"]}),I.jsxs(lhe,{...H.getMenuProps({ref:se}),isMainInput:e.isMainInput,showAbove:D(),ulHeightPixels:((ue=se.current)==null?void 0:ue.getBoundingClientRect().height)||0,hidden:!H.isOpen||m.length===0||((Ee=b.current)==null?void 0:Ee.value)==="",fontSize:pr(),children:[E&&I.jsxs("div",{style:{backgroundColor:Vt,borderBottom:`0.5px solid ${Et}`,display:"flex",gap:"4px",position:"sticky",top:"0px"},className:"py-2 px-4 my-0",children:[I.jsx(mc,{width:"1.4em",height:"1.4em",className:"cursor-pointer",onClick:j=>{var me;P(),(me=b.current)==null||me.focus()}}),E.display_title," -"," ",E.description]}),H.isOpen&&m.map((j,me)=>I.jsxs(ZI,{style:{borderTop:me===0?"none":`0.5px solid ${Et}`},...H.getItemProps({item:j,index:me}),highlighted:H.highlightedIndex===me,selected:H.selectedItem===j,onClick:Ve=>{var ge;Re(Ve),Ve.stopPropagation(),Ve.preventDefault(),(ge=b.current)==null||ge.focus()},children:[I.jsxs("span",{className:"flex justify-between w-full items-center",children:[I.jsxs("div",{className:"flex items-center justify-center",children:[E&&I.jsx(Ey,{height:"20px",width:"20px",filename:j.name}),j.name," "]}),I.jsx("span",{style:{color:Et,float:"right",textAlign:"right"},children:j.description})]}),(q==null?void 0:q.filter(Ve=>!Ve.dynamic||Ve.requires_query).find(Ve=>Ve.title===j.id))&&I.jsx(tZ,{width:"1.2em",height:"1.2em",color:Et,className:"ml-2 flex-shrink-0"})]},`${j.name}${me}`)),H.isOpen&&m.length===0&&I.jsx(ZI,{highlighted:!1,selected:!1,isLastItem:!1,children:I.jsx("span",{style:{color:Et,float:"right",textAlign:"right",display:"flex",width:"100%",cursor:"default"},children:"No items found"})},"empty-items-li")]})]}),e.isMainInput&&I.jsx(xP,{disabled:!B&&(!((qe=b.current)!=null&&qe.value)||typeof a>"u"),onClick:()=>{var j;B?(a==null||a.stopSession(),o(Zd(!1))):(j=e.onEnter)==null||j.call(e,void 0)},showStop:B})]})});function JI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vt(e){for(var t=1;t=0||(p[u]=o[u]);return p}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function che(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}(e)}function OP(e){var t=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,r=Xg(e);if(t){var i=Xg(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return che(this,n)}}function Co(e,t){return function(n){if(Array.isArray(n))return n}(e)||function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var a,o,s=[],u=!0,c=!1;try{for(i=i.call(n);!(u=(a=i.next()).done)&&(s.push(a.value),!r||s.length!==r);u=!0);}catch(p){c=!0,o=p}finally{try{u||i.return==null||i.return()}finally{if(c)throw o}}return s}}(e,t)||lT(e,t)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. @@ -626,7 +626,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * from https://github.com/LiosK/uuidv7/blob/e501462ea3d23241de13192ceae726956f9b3b7d/src/index.ts */Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e});var tR="0123456789abcdef",dhe=function(){function e(t){if(Un(this,e),this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}return $n(e,[{key:"toString",value:function(){for(var t="",n=0;n>>4)+tR.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(t){return this.compareTo(t)===0}},{key:"compareTo",value:function(t){for(var n=0;n<16;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var a=new Uint8Array(16);return a[0]=t/Math.pow(2,40),a[1]=t/Math.pow(2,32),a[2]=t/Math.pow(2,24),a[3]=t/Math.pow(2,16),a[4]=t/Math.pow(2,8),a[5]=t,a[6]=112|n>>>8,a[7]=n,a[8]=128|r>>>24,a[9]=r>>>16,a[10]=r>>>8,a[11]=r,a[12]=i>>>24,a[13]=i>>>16,a[14]=i>>>8,a[15]=i,new e(a)}}]),e}(),phe=function(){function e(){Un(this,e),ct(this,"timestamp",0),ct(this,"counter",0),ct(this,"random",new fhe)}return $n(e,[{key:"generate",value:function(){var t=this.generateOrAbort();if(t!==void 0)return t;this.timestamp=0;var n=this.generateOrAbort();if(n===void 0)throw new Error("Could not generate UUID after timestamp reset");return n}},{key:"generateOrAbort",value:function(){var t=Date.now();if(t>this.timestamp)this.timestamp=t,this.resetCounter();else{if(!(t+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return dhe.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),DP=function(e){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t=this.buffer.length&&(DP(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),hhe=function(){return(nR||(nR=new phe)).generate()},LP=Array.prototype,MP=Object.prototype,uT=MP.toString,ghe=MP.hasOwnProperty,ht=typeof window<"u"?window:{},Ql=ht.navigator||{userAgent:""},jn=ht.document||{},aa=Ql.userAgent,mhe=["localhost","127.0.0.1"],rR=LP.forEach,iR=LP.indexOf,bhe=Array.isArray,cT={},In={log:function(){if(ma.DEBUG&&!ja(window.console)&&window.console){for(var e=("__rrweb_original__"in window.console.log)?window.console.log.__rrweb_original__:window.console.log,t=arguments.length,n=new Array(t),r=0;r1?t-1:0),r=1;r0&&(t[r]=n)}),t},Ehe=["$performance_raw"];function vhe(e,t){return n=e,r=function(a,o){return o&&Ehe.indexOf(o)>-1?a:typeof a=="string"&&t!==null?a.slice(0,t):a},i=new Set,function a(o,s){return o!==Object(o)?r?r(o,s):o:i.has(o)?void 0:(i.add(o),ts(o)?(u=[],os(o,function(c){u.push(a(c))})):(u={},hn(o,function(c,p){i.has(c)||(u[p]=a(c,p))})),u);var u}(n);var n,r,i}function dT(e){var t,n,r,i,a,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,c="",p=[];if(!e)return e;e=_he(e);do t=(a=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=a>>12&63,r=a>>6&63,i=63&a,p[u++]=o.charAt(t)+o.charAt(n)+o.charAt(r)+o.charAt(i);while(s127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),s!==null&&(n>t&&(a+=e.substring(t,n)),a+=s,t=n=i+1)}return n>t&&(a+=e.substring(t,e.length)),a},aR=function(e){var t=function(){var n=new Date().valueOf(),r=0;if(ht.performance&&ht.performance.now)r=1e4*ht.performance.now();else for(;n==new Date().valueOf();)r++;return n.toString(16)+Math.floor(r).toString(16)};return function(n){if(n==="og"||e==="og"){var r=typeof window<"u"?(window.screen.height*window.screen.width).toString(16):"0";return t()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var i,a,o=aa,s=0,u=[];function c(p,f){var m,g=0;for(m=0;m=4&&(s=c(s,u),u=[]);return u.length>0&&(s=c(s,u)),s.toString(16)}()+"-"+r+"-"+t()}return hhe().toString()}},The=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog|applebot|semrushbot|duckduckbot|twitterbot|rogerbot|linkedinbot|mj12bot|sitebulb|bot.htm|bot.php|hubspot|crawler|prerender)/i.test(e)},oR=function(e,t){var n=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),r=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(e);if(r===null||r&&typeof r[1]!="string"&&r[1].length)return"";var i=r[1];try{i=decodeURIComponent(i)}catch{In.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},sR=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Qd=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,a){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!a);else{var o="on"+n,s=t[o];t[o]=function(u,c,p){return function(f){if(f=f||e(window.event)){var m,g=!0;FP(p)&&(m=p(f));var b=c.call(u,f);return m!==!1&&b!==!1||(g=!1),g}}}(t,r,s)}else In.error("No valid element provided to register_event")}}();function pT(e,t){var n=function(){var r=jn.createElement("script");r.type="text/javascript",r.src=e,r.onload=function(o){return t(void 0,o)},r.onerror=function(o){return t(o)};var i,a=jn.querySelectorAll("body > script");a.length>0?(i=a[0].parentNode)===null||i===void 0||i.insertBefore(r,a[0]):jn.body.appendChild(r)};jn.body?n():jn.addEventListener("DOMContentLoaded",n)}var Sr={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(e||[]),n={};return hn(t,function(r){var i=oR(jn.URL,r);i.length&&(n[r]=i)}),n},searchEngine:function(){var e=jn.referrer;return e?e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null},searchInfo:function(){var e=Sr.searchEngine(),t=e!="yahoo"?"q":"p",n={};if(e!==null){n.$search_engine=e;var r=oR(jn.referrer,t);r.length&&(n.ph_keyword=r)}return n},browser:function(e,t,n){return t=t||"",n||fn(e," OPR/")?fn(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":fn(e,"IEMobile")||fn(e,"WPDesktop")?"Internet Explorer Mobile":fn(e,"SamsungBrowser/")?"Samsung Internet":fn(e,"Edge")||fn(e,"Edg/")?"Microsoft Edge":fn(e,"FBIOS")?"Facebook Mobile":fn(e,"Chrome")?"Chrome":fn(e,"CriOS")?"Chrome iOS":fn(e,"UCWEB")||fn(e,"UCBrowser")?"UC Browser":fn(e,"FxiOS")?"Firefox iOS":fn(t,"Apple")?fn(e,"Mobile")?"Mobile Safari":"Safari":fn(e,"Android")?"Android Mobile":fn(e,"Konqueror")?"Konqueror":fn(e,"Firefox")?"Firefox":fn(e,"MSIE")||fn(e,"Trident/")?"Internet Explorer":fn(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[Sr.browser(e,t,n)];if(r===void 0)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},browserLanguage:function(){return Ql.language||Ql.userLanguage},os:function(e){if(/Windows/i.test(e)){if(/Phone/.test(e)||/WPDesktop/.test(e))return{os_name:"Windows Phone",os_version:""};var t=/Windows NT ([0-9.]+)/i.exec(e);return t&&t[1]?{os_name:"Windows",os_version:t[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(e)){var n=/OS (\d+)_(\d+)_?(\d+)?/i.exec(e);return n&&n[1]?{os_name:"iOS",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(e)){var r=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(e);return r&&r[1]?{os_name:"Android",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(e))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(e)){var i=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(e);return i&&i[1]?{os_name:"Mac OS X",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(e)?{os_name:"Linux",os_version:""}:/CrOS/.test(e)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return t==="iPad"||t==="Android Tablet"?"Tablet":t?"Mobile":"Desktop"},referrer:function(){return jn.referrer||"$direct"},referringDomain:function(){if(!jn.referrer)return"$direct";var e=jn.createElement("a");return e.href=jn.referrer,e.host},properties:function(){var e=Sr.os(aa),t=e.os_name,n=e.os_version;return $r(Oy({$os:t,$os_version:n,$browser:Sr.browser(aa,Ql.vendor,ht.opera),$device:Sr.device(aa),$device_type:Sr.deviceType(aa)}),{$current_url:ht==null?void 0:ht.location.href,$host:ht==null?void 0:ht.location.host,$pathname:ht==null?void 0:ht.location.pathname,$browser_version:Sr.browserVersion(aa,Ql.vendor,ht.opera),$browser_language:Sr.browserLanguage(),$screen_height:ht==null?void 0:ht.screen.height,$screen_width:ht==null?void 0:ht.screen.width,$viewport_height:ht==null?void 0:ht.innerHeight,$viewport_width:ht==null?void 0:ht.innerWidth,$lib:"web",$lib_version:ma.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:BP()/1e3})},people_properties:function(){var e=Sr.os(aa),t=e.os_name,n=e.os_version;return $r(Oy({$os:t,$os_version:n,$browser:Sr.browser(aa,Ql.vendor,ht.opera)}),{$browser_version:Sr.browserVersion(aa,Ql.vendor,ht.opera)})}};function Zg(e){switch(pl(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function Qg(e){var t="";return Ph(e)&&!zP(e)&&e.childNodes&&e.childNodes.length&&hn(e.childNodes,function(n){$P(n)&&n.textContent&&(t+=Ry(n.textContent).split(/(\s+)/).filter(N1).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),Ry(t)}function lR(e){return!!e&&e.nodeType===1}function fu(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function $P(e){return!!e&&e.nodeType===3}function uR(e){return!!e&&e.nodeType===11}var k4=["a","button","form","input","select","textarea","label"];function Ph(e){for(var t=e;t.parentNode&&!fu(t,"body");t=t.parentNode){var n=Zg(t).split(" ");if(fn(n,"ph-sensitive")||fn(n,"ph-no-capture"))return!1}if(fn(Zg(e).split(" "),"ph-include"))return!0;var r=e.type||"";if(typeof r=="string")switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!(typeof i=="string"&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function zP(e){return!!(fu(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||fu(e,"select")||fu(e,"textarea")||e.getAttribute("contenteditable")==="true")}function N1(e){return!(e===null||ja(e)||typeof e=="string"&&(e=Ry(e),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(e)))}function cR(e){var t=Qg(e);return N1(t="".concat(t," ").concat(HP(e)).trim())?t:""}function HP(e){var t="";return e&&e.childNodes&&e.childNodes.length&&hn(e.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{var i=Qg(n);t="".concat(t," ").concat(i).trim(),n.childNodes&&n.childNodes.length&&(t="".concat(t," ").concat(HP(n)).trim())}catch(a){console.error(a)}}),t}var She=function(){function e(t){Un(this,e),this.clicks=[],this.enabled=t}return $n(e,[{key:"isRageClick",value:function(t,n,r){if(!this.enabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(n-i.y)<30&&r-i.timestamp<1e3){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}]),e}(),whe=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,yo={is_supported:function(){return!0},error:function(e){In.error("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?i.$el_text=cR(e):i.$el_text=Qg(e));var a=Zg(e);a.length>0&&(i.classes=a.split(" ").filter(function(c){return c!==""})),hn(e.attributes,function(c){var p;zP(e)&&["name","id","class"].indexOf(c.name)===-1||!t&&N1(c.value)&&(typeof(p=c.name)!="string"||p.substring(0,10)!=="_ngcontent"&&p.substring(0,7)!=="_nghost")&&(i["attr__"+c.name]=c.value)});for(var o=1,s=1,u=e;u=this._previousElementSibling(u);)o++,u.tagName===e.tagName&&s++;return i.nth_child=o,i.nth_of_type=s,i},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return hn(document.querySelectorAll(e.css_selector),function(n){var r;["input","select"].indexOf(n.tagName.toLowerCase())>-1?r=n.value:n.textContent&&(r=n.textContent),N1(r)&&t.push(r)}),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return hn(this._customProperties,function(r){hn(r.event_selectors,function(i){hn(document.querySelectorAll(i),function(a){fn(e,a)&&Ph(a)&&(n[r.name]=t._extractCustomPropertyValue(r))})})}),n},_getEventTarget:function(e){return e.target===void 0?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"$autocapture",a=this._getEventTarget(e);if($P(a)&&(a=a.parentNode||null),i==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&(n=this.rageclicks)!==null&&n!==void 0&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,t,"$rageclick"),a&&function(g,b){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!g||fu(g,"html")||!lR(g))return!1;if(y!=null&&y.url_allowlist){var T=window.location.href,E=y.url_allowlist;if(E&&!E.some(function($){return T.match($)}))return!1}if(y!=null&&y.dom_event_allowlist){var v=y.dom_event_allowlist;if(v&&!v.some(function($){return b.type===$}))return!1}if(y!=null&&y.element_allowlist){var w=y.element_allowlist;if(w&&!w.some(function($){return g.tagName.toLowerCase()===$}))return!1}if(y!=null&&y.css_selector_allowlist){var A=y.css_selector_allowlist;if(A&&!A.some(function($){return g.matches($)}))return!1}for(var R=!1,k=[g],N=!0,B=g;B.parentNode&&!fu(B,"body");)if(uR(B.parentNode))k.push(B.parentNode.host),B=B.parentNode.host;else{if(!(N=B.parentNode||!1))break;if(k4.indexOf(N.tagName.toLowerCase())>-1)R=!0;else{var q=window.getComputedStyle(N);q&&q.getPropertyValue("cursor")==="pointer"&&(R=!0)}k.push(N),B=N}var P=window.getComputedStyle(g);if(P&&P.getPropertyValue("cursor")==="pointer"&&b.type==="click")return!0;var Q=g.tagName.toLowerCase();switch(Q){case"html":return!1;case"form":return b.type==="submit";case"input":case"select":case"textarea":return b.type==="change"||b.type==="click";default:return R?b.type==="click":b.type==="click"&&(k4.indexOf(Q)>-1||g.getAttribute("contenteditable")==="true")}}(a,e,this.config)){for(var o=[a],s=a;s.parentNode&&!fu(s,"body");)uR(s.parentNode)?(o.push(s.parentNode.host),s=s.parentNode.host):(o.push(s.parentNode),s=s.parentNode);var u,c=[],p={},f=!1;if(hn(o,function(g){var b=Ph(g);g.tagName.toLowerCase()==="a"&&(u=g.getAttribute("href"),u=b&&N1(u)&&u),fn(Zg(g).split(" "),"ph-no-capture")&&(f=!0),c.push(r._getPropertiesFromElement(g,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")));var y=r._getAugmentPropertiesFromElement(g);$r(p,y)}),t.get_config("mask_all_text")||(a.tagName.toLowerCase()==="a"||a.tagName.toLowerCase()==="button"?c[0].$el_text=cR(a):c[0].$el_text=Qg(a)),u&&(c[0].attr__href=u),f)return!1;var m=$r(this._getDefaultProperties(e.type),{$elements:c},this._getCustomProperties(o),p);return t.capture(i,m),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,n=function(r){r=r||window.event,t._captureEvent(r,e)};Qd(document,"submit",n,!1,!0),Qd(document,"change",n,!1,!0),Qd(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;typeof e.__autocapture!="boolean"&&(this.config=e.__autocapture),(t=this.config)!==null&&t!==void 0&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map(function(n){return new RegExp(n)})),this.rageclicks=new She(e.get_config("rageclick"))},afterDecideResponse:function(e,t){var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?In.log('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(ct({},dR,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=ja(t)?10:t,n=ja(n)?10:n;for(var r=0,i=0;i1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],i="".concat(r),a=this.instance.get_property(Jg)||{};return!n.send_event&&"send_event"in n||t in a&&a[t].includes(i)||(Array.isArray(a[t])?a[t].push(i):a[t]=[i],this.instance.persistence.register(ct({},Jg,a)),this.instance.capture("$feature_flag_called",{$feature_flag:t,$feature_flag_response:r})),r}console.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(t){return this.getFlagPayloads()[t]}},{key:"isFeatureEnabled",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(t,n);console.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(t){this.featureFlagEventHandlers.push(t)}},{key:"removeFeatureFlagsHandler",value:function(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(n){return n!==t})}},{key:"receivedFeatureFlags",value:function(t){this.instance.decideEndpointWasHit=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads();(function(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=i.featureFlags,c=i.featureFlagPayloads;if(u)if(Array.isArray(u)){var p,f={};if(u)for(var m=0;m1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(Fy);if(i&&!r)return t(i);this.instance._send_request("".concat(this.instance.get_config("api_host"),"/api/early_access_features/?token=").concat(this.instance.get_config("token")),{},{method:"GET"},function(a){var o=a.earlyAccessFeatures;return n.instance.persistence.register(ct({},Fy,o)),t(o)})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter(function(r){return n[r]}),flagVariants:Object.keys(n).filter(function(r){return n[r]}).reduce(function(r,i){return r[i]=n[i],r},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(function(i){return i(n,r)})}},{key:"setPersonPropertiesForFlags",value:function(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(D1)||{};this.instance.register(ct({},D1,vt(vt({},r),t))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(D1)}},{key:"setGroupPropertiesForFlags",value:function(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Vs)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(function(i){r[i]=vt(vt({},r[i]),t[i]),delete t[i]}),this.instance.register(ct({},Vs,vt(vt({},r),t))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(t){if(t){var n=this.instance.get_property(Vs)||{};this.instance.register(ct({},Vs,vt(vt({},n),{},ct({},t,{}))))}else this.instance.unregister(Vs)}}]),e}(),Ihe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==",bR=2,Rhe=4,GP=3,Nhe=6,Ohe=0,Dhe=5e6,Lhe="rrweb/console@1",fo,Mhe=$n(function e(t){var n,r,i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Un(this,e),ct(this,"bucketSize",100),ct(this,"refillRate",10),ct(this,"mutationBuckets",{}),ct(this,"loggedTracker",{}),ct(this,"refillBuckets",function(){Object.keys(i.mutationBuckets).forEach(function(o){i.mutationBuckets[o]=i.mutationBuckets[o]+i.refillRate,i.mutationBuckets[o]>=i.bucketSize&&delete i.mutationBuckets[o]})}),ct(this,"getNodeOrRelevantParent",function(o){var s=i.rrweb.mirror.getNode(o);if((s==null?void 0:s.nodeName)!=="svg"&&s instanceof Element){var u=s.closest("svg");if(u)return[i.rrweb.mirror.getId(u),u]}return[o,s]}),ct(this,"numberOfChanges",function(o){var s,u,c,p,f,m,g,b;return((s=(u=o.removes)===null||u===void 0?void 0:u.length)!==null&&s!==void 0?s:0)+((c=(p=o.attributes)===null||p===void 0?void 0:p.length)!==null&&c!==void 0?c:0)+((f=(m=o.texts)===null||m===void 0?void 0:m.length)!==null&&f!==void 0?f:0)+((g=(b=o.adds)===null||b===void 0?void 0:b.length)!==null&&g!==void 0?g:0)}),ct(this,"throttleMutations",function(o){if(o.type!==GP||o.data.source!==Ohe)return o;var s=o.data,u=i.numberOfChanges(s);s.attributes&&(s.attributes=s.attributes.filter(function(p){var f,m,g,b=Co(i.getNodeOrRelevantParent(p.id),2),y=b[0],T=b[1];return i.mutationBuckets[y]===0?!1:(i.mutationBuckets[y]=(f=i.mutationBuckets[y])!==null&&f!==void 0?f:i.bucketSize,i.mutationBuckets[y]=Math.max(i.mutationBuckets[y]-1,0),i.mutationBuckets[y]===0&&(i.loggedTracker[y]||(i.loggedTracker[y]=!0,(m=(g=i.options).onBlockedNode)===null||m===void 0||m.call(g,y,T))),p)}));var c=i.numberOfChanges(s);return c!==0||u===c?o:void 0}),this.rrweb=t,this.options=a,this.refillRate=(n=this.options.refillRate)!==null&&n!==void 0?n:this.refillRate,this.bucketSize=(r=this.options.bucketSize)!==null&&r!==void 0?r:this.bucketSize,setInterval(function(){i.refillBuckets()},1e3)}),Fhe="/s/",VP="sessionRecording";(function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"})(fo||(fo={}));var Phe=[fo.MouseMove,fo.MouseInteraction,fo.Scroll,fo.ViewportResize,fo.Input,fo.TouchMove,fo.MediaInteraction,fo.Drag],Bhe=function(){function e(t){var n=this;Un(this,e),ct(this,"lastActivityTimestamp",Date.now()),ct(this,"isIdle",!1),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint=Fhe,this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1,window.addEventListener("beforeunload",function(){n._flushBuffer()})}return $n(e,[{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var t=!!this.instance.get_property(Ly),n=!this.instance.get_config("disable_session_recording");return t&&n}},{key:"isConsoleLogCaptureEnabled",value:function(){var t=!!this.instance.get_property(pR),n=this.instance.get_config("enable_recording_console_log");return n??t}},{key:"getRecordingVersion",value:function(){var t,n=this.instance.get_property(fR);return((t=this.instance.get_config("session_recording"))===null||t===void 0?void 0:t.recorderVersion)||n||"v1"}},{key:"afterDecideResponse",value:function(t){var n,r,i,a,o,s;this.receivedDecide=!0,this.instance.persistence&&this.instance.persistence.register((ct(o={},Ly,!!t.sessionRecording),ct(o,pR,(i=t.sessionRecording)===null||i===void 0?void 0:i.consoleLogRecordingEnabled),ct(o,fR,(a=t.sessionRecording)===null||a===void 0?void 0:a.recorderVersion),o)),(n=t.sessionRecording)!==null&&n!==void 0&&n.endpoint&&(this.endpoint=(s=t.sessionRecording)===null||s===void 0?void 0:s.endpoint),(r=t.sessionRecording)!==null&&r!==void 0&&r.recorderVersion&&(this.recorderVersion=t.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"log",value:function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(n=this.instance.sessionRecording)===null||n===void 0||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:r,trace:[],payload:[JSON.stringify(t)]}},timestamp:BP()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var t=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach(function(n){return t._captureSnapshotBuffered(n)})),this._startCapture()}},{key:"_startCapture",value:function(){var t=this;if(Object.assign!==void 0&&!this.captureStarted&&!this.instance.get_config("disable_session_recording")){this.captureStarted=!0,this.instance.sessionManager.checkAndGetSessionAndWindowId();var n=this.getRecordingVersion()==="v2"?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.getRecordingVersion()?pT(this.instance.get_config("api_host")+"/static/".concat(n,"?v=").concat(ma.LIB_VERSION),function(r){if(r)return In.error("Could not load ".concat(n),r);t._onScriptLoaded()}):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(t){var n;return t.type===GP&&Phe.indexOf((n=t.data)===null||n===void 0?void 0:n.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(t){var n=this._isInteractiveEvent(t);if(n||this.isIdle||t.timestamp-this.lastActivityTimestamp>3e5&&(this.isIdle=!0),n&&(this.lastActivityTimestamp=t.timestamp,this.isIdle&&(this.isIdle=!1,this._tryTakeFullSnapshot())),!this.isIdle){var r=this.instance.sessionManager.checkAndGetSessionAndWindowId(!n,t.timestamp),i=r.windowId,a=r.sessionId;[bR,Rhe].indexOf(t.type)!==-1||this.windowId===i&&this.sessionId===a||this._tryTakeFullSnapshot(),this.windowId=i,this.sessionId=a}}},{key:"_tryTakeFullSnapshot",value:function(){if(!this.captureStarted)return!1;try{var t;return(t=this.rrwebRecord)===null||t===void 0||t.takeFullSnapshot(),!0}catch(n){return In.error("Error taking full snapshot.",n),!1}}},{key:"_onScriptLoaded",value:function(){var t,n=this,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var i=this.instance.get_config("session_recording"),a=0,o=Object.entries(i||{});aDhe){var c,p=hs(u.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(p.s();!(c=p.n()).done;){var f=c.value;u=f[1].toLocaleLowerCase().slice(0,6)==="image/"?u.replace(f[0],Ihe):u.replace(f[0],"")}}catch(m){p.e(m)}finally{p.f()}}return{event:JSON.parse(u),size:u.length}}(function(s){var u=s;if(u&&pl(u)==="object"&&u.type===Nhe&&pl(u.data)==="object"&&u.data.plugin===Lhe){u.data.payload.payload.length>10&&(u.data.payload.payload=u.data.payload.payload.slice(0,10),u.data.payload.payload.push("...[truncated]"));for(var c=[],p=0;p2e3?c.push(u.data.payload.payload[p].slice(0,2e3)+"...[truncated]"):c.push(u.data.payload.payload[p]);return u.data.payload.payload=c,s}return s}(n)),i=r.event,a=r.size;if(this._updateWindowAndSessionIds(i),!this.isIdle){var o={$snapshot_bytes:a,$snapshot_data:i,$session_id:this.sessionId,$window_id:this.windowId};this.instance._captureMetrics.incr("rrweb-record"),this.instance._captureMetrics.incr("rrweb-record-".concat(i.type)),this.emit?this._captureSnapshotBuffered(o):this.snapshots.push(o)}}}}},{key:"_flushBuffer",value:function(){return this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0),this.buffer&&this.buffer.data.length!==0&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_captureSnapshotBuffered",value:function(t){var n,r=this,i=2+(((n=this.buffer)===null||n===void 0?void 0:n.data.length)||0);(!this.buffer||this.buffer.size+t.$snapshot_bytes+i>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=t.$snapshot_bytes,this.buffer.data.push(t.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){r._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(t){this.instance.capture("$snapshot",t,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:VP,_metrics:{rrweb_full_snapshot:t.$snapshot_data.type===bR}})}}]),e}(),lo={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},Uhe=["first-input","navigation","paint","resource"],$he=["/s/","/e/"],zhe=function(){function e(t){Un(this,e),ct(this,"_forceAllowLocalhost",!1),this.instance=t}return $n(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var t,n,r=this;if(!this.observer)if(((t=window)===null||t===void 0||(n=t.PerformanceObserver)===null||n===void 0?void 0:n.supportedEntryTypes)!==void 0)if(!mhe.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver(function(a){a.getEntries().forEach(function(o){r._capturePerformanceEvent(o)})});var i=PerformanceObserver.supportedEntryTypes.filter(function(a){return Uhe.includes(a)});i.forEach(function(a){var o;(o=r.observer)===null||o===void 0||o.observe({type:a,buffered:!0})})}catch(a){console.error("PostHog failed to start performance observer",a),this.stopObserving()}else In.log("PostHog Peformance observer not started because we are on localhost.");else In.log("PostHog Performance observer not started because PerformanceObserver is not supported by this browser.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var t,n;return(t=(n=this.instance.get_config("capture_performance"))!==null&&n!==void 0?n:this.remoteEnabled)!==null&&t!==void 0&&t}},{key:"afterDecideResponse",value:function(t){this.remoteEnabled=t.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(t){if(t.name.indexOf(this.instance.get_config("api_host"))===0){var n=t.name.replace(this.instance.get_config("api_host"),"");if($he.find(function(g){return n.indexOf(g)===0}))return}var r={url:t.name},i=this.instance.get_config("session_recording");if(i.maskNetworkRequestFn&&(r=i.maskNetworkRequestFn(r)),r){var a=t.toJSON();a.name=r.url;var o={},s=Math.floor(Date.now()-performance.now());for(var u in o[lo.timeOrigin]=s,o[lo.timestamp]=Math.floor(s+t.startTime),lo)a[u]!==void 0&&(o[lo[u]]=a[u]);if(this.capturePerformanceEvent(o),Hhe(t)){var c,p=hs(t.serverTiming||[]);try{for(p.s();!(c=p.n()).done;){var f,m=c.value;this.capturePerformanceEvent((ct(f={},lo.timeOrigin,s),ct(f,lo.timestamp,Math.floor(s+t.startTime)),ct(f,lo.name,m.name),ct(f,lo.duration,m.duration),ct(f,lo.entryType,"serverTiming"),f))}}catch(g){p.e(g)}finally{p.f()}}}}},{key:"capturePerformanceEvent",value:function(t){var n,r=t[lo.timestamp];(n=this.instance.sessionRecording)===null||n===void 0||n.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:t},timestamp:r})}}]),e}(),Hhe=function(e){return e.entryType==="navigation"||e.entryType==="resource"},jhe=function(){function e(t){Un(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return $n(e,[{key:"call",value:function(){var t=this,n=dT(JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(D1),group_properties:this.instance.get_property(Vs),disable_flags:this.instance.get_config("advanced_disable_feature_flags")||this.instance.get_config("advanced_disable_feature_flags_on_first_load")||void 0}));this.instance._send_request("".concat(this.instance.get_config("api_host"),"/decide/?v=3"),{data:n,verbose:!0},{method:"POST"},function(r){return t.parseDecideResponse(r)})}},{key:"parseDecideResponse",value:function(t){var n,r,i,a=this;if((t==null?void 0:t.status)!==0){if(!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){a.parseDecideResponse(t)},500);if(this.instance.toolbar.afterDecideResponse(t),(n=this.instance.sessionRecording)===null||n===void 0||n.afterDecideResponse(t),Ys.afterDecideResponse(t,this.instance),(r=this.instance.webPerformance)===null||r===void 0||r.afterDecideResponse(t),(i=this.instance.exceptionAutocapture)===null||i===void 0||i.afterDecideResponse(t),this.instance.get_config("advanced_disable_feature_flags_on_first_load")||this.instance.featureFlags.receivedFeatureFlags(t),this.instance.compression={},t.supportedCompression&&!this.instance.get_config("disable_compression")){var o,s={},u=hs(t.supportedCompression);try{for(u.s();!(o=u.n()).done;)s[o.value]=!0}catch(g){u.e(g)}finally{u.f()}this.instance.compression=s}if(t.siteApps)if(this.instance.get_config("opt_in_site_apps")){var c,p=this.instance.get_config("api_host"),f=hs(t.siteApps);try{var m=function(){var g=c.value,b=g.id,y=g.url,T=[p,p[p.length-1]==="/"&&y[0]==="/"?y.substring(1):y].join("");window["__$$ph_site_app_".concat(b)]=a.instance,pT(T,function(E){E&&console.error("Error while initializing PostHog app with config id ".concat(b),E)})};for(f.s();!(c=f.n()).done;)m()}catch(g){f.e(g)}finally{f.f()}}else t.siteApps.length>0&&console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),Ghe=["https://app.posthog.com","https://eu.posthog.com"],Vhe=["source"],Whe=function(){function e(t){Un(this,e),this.instance=t}return $n(e,[{key:"afterDecideResponse",value:function(t){var n=t.toolbarParams||t.editorParams||(t.toolbarVersion?{toolbarVersion:t.toolbarVersion}:{});t.isAuthenticated&&n.toolbarVersion&&n.toolbarVersion.indexOf("toolbar")===0&&this.loadToolbar(vt({},n))}},{key:"maybeLoadToolbar",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window.history;try{if(!n){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch{return!1}n=window.localStorage}var i,a=sR(t.hash,"__posthog")||sR(t.hash,"state"),o=a?JSON.parse(decodeURIComponent(a)):null;return o&&o.action==="ph_authorize"?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState("",document.title,t.pathname+t.search):t.hash="")):((i=JSON.parse(n.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.get_config("token")!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}},{key:"loadToolbar",value:function(t){var n=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var r=this.instance.get_config("api_host"),i=3e4*Math.floor(Date.now()/3e4),a="".concat(r).concat(r.endsWith("/")?"":"/","static/toolbar.js?_ts=").concat(i),o=!Ghe.includes(this.instance.get_config("api_host"))&&this.instance.get_config("advanced_disable_toolbar_metrics"),s=vt(vt({token:this.instance.get_config("token")},t),{},{apiURL:r},o?{instrument:!1}:{});s.source;var u=uhe(s,Vhe);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),pT(a,function(c){c?In.error("Failed to load toolbar",c):(window.ph_load_toolbar||window.ph_load_editor)(s,n.instance)}),Qd(window,"turbolinks:load",function(){window._postHogToolbarLoaded=!1,n.loadToolbar(s)}),!0}},{key:"_loadEditor",value:function(t){return this.loadToolbar(t)}},{key:"maybeLoadEditor",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window.history;return this.maybeLoadToolbar(t,n,r)}}]),e}(),qhe="__ph_opt_in_out_";function Khe(e,t){qP(!0,e,t)}function Yhe(e,t){qP(!1,e,t)}function Xhe(e,t){return WP(e,t)==="1"}function yR(e,t){return!!function(n){if(n&&n.respectDnt){var r=n&&n.window||ht,i=r.navigator||{},a=!1;return hn([i.doNotTrack,i.msDoNotTrack,r.doNotTrack],function(o){fn([!0,1,"1","yes"],o)&&(a=!0)}),a}return!1}(t)||WP(e,t)==="0"}function Zhe(e,t){fT(t=t||{}).remove(hT(e,t),!!t.crossSubdomainCookie)}function fT(e){return(e=e||{}).persistenceType==="localStorage"?Kn:e.persistenceType==="localStorage+cookie"?Dy:yo}function hT(e,t){return((t=t||{}).persistencePrefix||qhe)+e}function WP(e,t){return fT(t).get(hT(e,t))}function qP(e,t,n){PP(t)&&t.length?(fT(n=n||{}).set(hT(t,n),e?1:0,yhe(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}var KP=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:3e3;Un(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return $n(e,[{key:"setPollInterval",value:function(t){this._pollInterval=t,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return new Date().getTime()}}]),e}(),Qhe=function(e){NP(n,KP);var t=OP(n);function n(r,i){var a,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:3e3;return Un(this,n),(a=t.call(this,o)).handlePollRequest=i,a.captureMetrics=r,a}return $n(n,[{key:"enqueue",value:function(r,i,a){this.captureMetrics.incr("batch-enqueue"),this._event_queue.push({url:r,data:i,options:a}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var r=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(r._event_queue.length>0){var i=r.formatQueue(),a=function(s){var u=i[s],c=u.url,p=u.data,f=u.options;hn(p,function(m,g){p[g].offset=Math.abs(p[g].timestamp-r.getTime()),delete p[g].timestamp}),r.handlePollRequest(c,p,f),r.captureMetrics.incr("batch-requests"),r.captureMetrics.incr("batch-requests-".concat(c.slice(c.length-2))),r.captureMetrics.incr("batch-handle",p.length),r.captureMetrics.incr("batch-handle-".concat(c.slice(c.length-2)),p.length)};for(var o in i)a(o);r._event_queue.length=0,r._empty_queue_count=0}else r._empty_queue_count++;r._empty_queue_count>4&&(r.isPolling=!1,r._empty_queue_count=0),r.isPolling&&r.poll()},this._pollInterval)}},{key:"updateUnloadMetrics",value:function(){var r=this.formatQueue();for(var i in r){var a=r[i],o=a.url,s=a.data;this.captureMetrics.incr("batch-unload-requests"),this.captureMetrics.incr("batch-unload-requests-".concat(o.slice(o.length-2))),this.captureMetrics.incr("batch-unload",s.length),this.captureMetrics.incr("batch-unload-".concat(o.slice(o.length-2)),s.length)}}},{key:"unload",value:function(){var r=this;clearTimeout(this._poller);var i=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var a=Object.values(i);[].concat(xy(a.filter(function(o){return o.url.indexOf("/e")===0})),xy(a.filter(function(o){return o.url.indexOf("/e")!==0}))).map(function(o){var s=o.url,u=o.data,c=o.options;r.handlePollRequest(s,u,vt(vt({},c),{},{transport:"sendBeacon"}))})}},{key:"formatQueue",value:function(){var r={};return hn(this._event_queue,function(i){var a=i.url,o=i.data,s=i.options,u=(s?s._batchKey:null)||a;r[u]===void 0&&(r[u]={data:[],url:a,options:s}),s&&r[u].options&&r[u].options._metrics&&!r[u].options._metrics.rrweb_full_snapshot&&(r[u].options._metrics.rrweb_full_snapshot=s._metrics.rrweb_full_snapshot),r[u].data.push(o)}),r}}]),n}(),Jhe=function(){function e(t){Un(this,e),this.enabled=t,this.metrics={}}return $n(e,[{key:"incr",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.enabled&&(t="phjs-".concat(t),this.metrics[t]=(this.metrics[t]||0)+n)}},{key:"decr",value:function(t){this.enabled&&(t="phjs-".concat(t),this.metrics[t]=(this.metrics[t]||0)-1)}}]),e}(),Ui=Uint8Array,ni=Uint16Array,dc=Uint32Array,gT=new Ui([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mT=new Ui([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ER=new Ui([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),YP=function(e,t){for(var n=new ni(31),r=0;r<31;++r)n[r]=t+=1<>>1|(21845&Sn)<<1;ql=(61680&(ql=(52428&ql)>>>2|(13107&ql)<<2))>>>4|(3855&ql)<<4,zy[Sn]=((65280&ql)>>>8|(255&ql)<<8)>>>1}var Jd=function(e,t,n){for(var r=e.length,i=0,a=new ni(t);i>>u]=c}else for(o=new ni(r),i=0;i>>15-e[i];return o},wu=new Ui(288);for(Sn=0;Sn<144;++Sn)wu[Sn]=8;for(Sn=144;Sn<256;++Sn)wu[Sn]=9;for(Sn=256;Sn<280;++Sn)wu[Sn]=7;for(Sn=280;Sn<288;++Sn)wu[Sn]=8;var em=new Ui(32);for(Sn=0;Sn<32;++Sn)em[Sn]=5;var tu,tge=Jd(wu,9,0),nge=Jd(em,5,0),ZP=function(e){return(e/8>>0)+(7&e&&1)},QP=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof ni?ni:e instanceof dc?dc:Ui)(n-t);return r.set(e.subarray(t,n)),r},Ko=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},dd=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},R4=function(e,t){for(var n=[],r=0;rm&&(m=a[r].s);var g=new ni(m+1),b=rge(n[p-1],g,0);if(b>t){r=0;var y=0,T=b-t,E=1<t))break;y+=E-(1<>>=T;y>0;){var w=a[r].s;g[w]=0&&y;--r){var A=a[r].s;g[A]==t&&(--g[A],++y)}b=t}return[new Ui(g),b]},rge=function e(t,n,r){return t.s==-1?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},_R=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ni(++t),r=0,i=e[0],a=1,o=function(u){n[r++]=u},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},pd=function(e,t){for(var n=0,r=0;r>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;a4&&!P[ER[$-1]];--$);var oe,fe,ce,De,H=c+5<<3,W=pd(i,wu)+pd(a,em)+o,se=pd(i,m)+pd(a,y)+o+14+3*$+pd(N,P)+(2*N[16]+3*N[17]+7*N[18]);if(H<=W&&H<=se)return Uh(t,p,e.subarray(u,u+c));if(Ko(t,p,1+(se15&&(Ko(t,p,L[B]>>>5&127),p+=L[B]>>>12)}}}else oe=tge,fe=wu,ce=nge,De=em;for(B=0;B255){ie=r[B]>>>18&31,dd(t,p,oe[ie+257]),p+=fe[ie+257],ie>7&&(Ko(t,p,r[B]>>>23&31),p+=gT[ie]);var Se=31&r[B];dd(t,p,ce[Se]),p+=De[Se],Se>3&&(dd(t,p,r[B]>>>5&8191),p+=mT[Se])}else dd(t,p,oe[r[B]]),p+=fe[r[B]];return dd(t,p,oe[256]),p+fe[256]},ige=new dc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),age=new Ui(0),oge=function(){for(var e=new dc(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),sge=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r>>8;e=n},d:function(){return 4294967295^e}}},lge=function(e,t,n,r,i){return function(a,o,s,u,c,p){var f=a.length,m=new Ui(u+f+5*(1+Math.floor(f/7e3))+c),g=m.subarray(u,m.length-c),b=0;if(!o||f<8)for(var y=0;y<=f;y+=65535){var T=y+65535;T>>13,w=8191&E,A=(1<7e3||ce>24576)&&pe>423){b=TR(a,g,0,P,Q,$,fe,ce,H,y-H,b),ce=oe=fe=0,H=y;for(var le=0;le<286;++le)Q[le]=0;for(le=0;le<30;++le)$[le]=0}var L=2,ie=0,Se=w,X=se-D&32767;if(pe>2&&W==q(y-X))for(var ke=Math.min(v,pe)-1,te=Math.min(32767,y),Me=Math.min(258,pe);X<=te&&--Se&&se!=D;){if(a[y+L]==a[y+L-X]){for(var Re=0;ReL){if(L=Re,ie=X,Re>ke)break;var Ze=Math.min(X,Re-2),We=0;for(le=0;leWe&&(We=ot,D=dt)}}}X+=(se=D)-(D=R[se])+32768&32767}if(ie){P[ce++]=268435456|$y[L]<<18|vR[ie];var je=31&$y[L],pt=31&vR[ie];fe+=gT[je]+mT[pt],++Q[257+je],++$[pt],De=y+L,++oe}else P[ce++]=a[y],++Q[a[y]]}}b=TR(a,g,p,P,Q,$,fe,ce,H,y-H,b),p||(b=Uh(g,b,age))}return QP(m,0,u+ZP(b)+c)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Hy=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},uge=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Hy(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},cge=function(e){return 10+(e.filename&&e.filename.length+1||0)};function dge(e,t){t===void 0&&(t={});var n=sge(),r=e.length;n.p(e);var i=lge(e,t,cge(t),8),a=i.length;return uge(i,t),Hy(i,a-8,n.d()),Hy(i,a-4,r),i}function pge(e,t){var n=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new Ui(e.length+(e.length>>>1)),i=0,a=function(c){r[i++]=c},o=0;or.length){var s=new Ui(i+8+(n-o<<1));s.set(r),r=s}var u=e.charCodeAt(o);u<128||t?a(u):u<2048?(a(192|u>>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++o))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return QP(r,0,i)}(function(e){e.GZipJS="gzip-js",e.Base64="base64"})(tu||(tu={}));var fge=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=new Date().getTime().toString(),r.ver=ma.LIB_VERSION;var i=e.split("?");if(i.length>1){var a,o=hs(i[1].split("&"));try{for(o.s();!(a=o.n()).done;){var s=a.value.split("=")[0];r[s]&&delete r[s]}}catch(c){o.e(c)}finally{o.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(c){var p,f,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",g=[];return hn(c,function(b,y){p=encodeURIComponent(b.toString()),f=encodeURIComponent(y),g[g.length]=f+"="+p}),g.join(m)}(r)},bT=function e(t,n){if(n.blob&&t.buffer)return new Blob([t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r=e(t,{method:"POST"});return new Blob([r],{type:"application/x-www-form-urlencoded"})}if(n.method!=="POST")return null;var i,a;return i=Array.isArray(t)||(a=t,Object.prototype.toString.call(a)==="[object Uint8Array]")?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i},JP=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,a=e.captureMetrics,o=e.callback,s=e.retriesPerformedSoFar,u=e.retryQueue,c=e.onXHRError,p=e.timeout,f=p===void 0?1e4:p,m=e.onRateLimited,g=new XMLHttpRequest;g.open(i.method||"GET",t,!0);var b=bT(n,i);a.incr("_send_request"),a.incr("_send_request_inflight"),hn(r,function(y,T){g.setRequestHeader(T,y)}),i.method!=="POST"||i.blob||g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.timeout=f,g.withCredentials=!0,g.onreadystatechange=function(){if(g.readyState===4)if(a.incr("xhr-response"),a.incr("xhr-response-".concat(g.status)),a.decr("_send_request_inflight"),g.status===200){if(o){var y;try{y=JSON.parse(g.responseText)}catch(T){return void In.error(T)}o(y)}}else typeof c=="function"&&c(g),[401,403,404,500].indexOf(g.status)<0&&u.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(s||0)+1,callback:o}),g.status===429&&(m==null||m(g)),o&&o({status:0})},g.send(b)},hge=18e5,gge=function(e){NP(n,KP);var t=OP(n);function n(r,i,a){var o;return Un(this,n),(o=t.call(this)).captureMetrics=r,o.isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=i,o.rateLimiter=a,typeof window<"u"&&"onLine"in window.navigator&&(o.areWeOnline=window.navigator.onLine,window.addEventListener("online",function(){o._handleWeAreNowOnline()}),window.addEventListener("offline",function(){o.areWeOnline=!1})),o}return $n(n,[{key:"enqueue",value:function(r){var i=r.retriesPerformedSoFar||0;if(!(i>=10)){var a=function(s){var u=3e3*Math.pow(2,s),c=u/2,p=Math.min(hge,u),f=(Math.random()-.5)*(p-c);return Math.ceil(p+f)}(i),o=new Date(Date.now()+a);this.queue.push({retryAt:o,requestData:r}),console.warn("Enqueued failed request for retry in ".concat(a)),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var r=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){r.areWeOnline&&r.queue.length>0&&r.flush(),r.poll()},this._pollInterval)}},{key:"flush",value:function(){var r=new Date(Date.now()),i=this.queue.filter(function(u){return u.retryAt0){this.queue=this.queue.filter(function(u){return u.retryAt>=r});var a,o=hs(i);try{for(o.s();!(a=o.n()).done;){var s=a.value.requestData;this._executeXhrRequest(s)}}catch(u){o.e(u)}finally{o.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var r,i=hs(this.queue);try{for(i.s();!(r=i.n()).done;){var a=r.value.requestData,o=a.url,s=a.data,u=a.options;if(this.rateLimiter.isRateLimited(u._batchKey))ma.DEBUG&&console.warn("[PostHog RetryQueue] is quota limited. Dropping request.");else try{window.navigator.sendBeacon(o,bT(s,vt(vt({},u),{},{sendBeacon:!0})))}catch(c){ma.DEBUG&&console.error(c)}}}catch(c){i.e(c)}finally{i.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(r){var i=r.url,a=r.data,o=r.options,s=r.headers,u=r.callback,c=r.retriesPerformedSoFar;this.rateLimiter.isRateLimited(o._batchKey)?ma.DEBUG&&console.warn("[PostHog RetryQueue] in quota limited mode. Dropping request."):JP({url:i,data:a||{},options:o||{},headers:s||{},retriesPerformedSoFar:c||0,callback:u,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError,onRateLimited:this.rateLimiter.on429Response})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),n}(),rh=1800,SR=60,mge=864e5,bge=function(){function e(t,n,r){Un(this,e),ct(this,"_sessionIdChangedHandlers",[]),this.uuidFn=r,this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null;var i=t.persistence_name||t.token,a=t.session_idle_timeout_seconds||rh;if(typeof a!="number"?(console.warn("[PostHog] session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=rh):a>rh?console.warn("[PostHog] session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a0&&arguments[0]!==void 0&&arguments[0],n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),r=Co(this._getSessionId(),3),i=r[0],a=r[1],o=r[2],s=this._getWindowId(),u=o&&o>0&&Math.abs(n-o)>mge,c=!1;!a||!t&&Math.abs(n-i)>this._sessionTimeoutMs||u?(a=this.uuidFn(),s=this.uuidFn(),o=n,c=!0):s||(s=this.uuidFn(),c=!0);var p=i===0||!t||u?n:i,f=o===0?new Date().getTime():o;return this._setWindowId(s),this._setSessionId(a,p,f),c&&this._sessionIdChangedHandlers.forEach(function(m){return m(a,s)}),{sessionId:a,windowId:s,sessionStartTimestamp:f}}}]),e}(),yge=$n(function e(t,n,r,i){Un(this,e),this.name="posthog-js",this.setupOnce=function(a){a(function(o){var s,u,c,p,f;if(o.level!=="error"||!t.__loaded)return o;o.tags||(o.tags={});var m=t.config.ui_host||t.config.api_host;o.tags["PostHog Person URL"]=m+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var g=((s=o.exception)===null||s===void 0?void 0:s.values)||[],b={$exception_message:(u=g[0])===null||u===void 0?void 0:u.value,$exception_type:(c=g[0])===null||c===void 0?void 0:c.type,$exception_personURL:m+"/person/"+t.get_distinct_id(),$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(p=g[0])===null||p===void 0?void 0:p.value,$sentry_exception_type:(f=g[0])===null||f===void 0?void 0:f.type,$sentry_tags:o.tags};return n&&r&&(b.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+o.event_id),t.capture("$exception",b),o})}}),Ege=function(e){Promise&&Promise.resolve||console.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(n,r){n.event.userId||n.event.anonymousId===e.get_distinct_id()||e.reset(),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:n.event.userId}),e.reloadFeatureFlags());var i=e._calculate_event_properties(r,n.event.properties);return n.event.properties=Object.assign({},i,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(n){return t(n,n.event.event)},page:function(n){return t(n,"$pageview")},identify:function(n){return t(n,"$identify")},screen:function(n){return t(n,"$screen")}}},vge=function(){function e(t){Un(this,e),ct(this,"_seenFirstPageView",!1),this.uuidFn=t}return $n(e,[{key:"onPageview",value:function(){this._seenFirstPageView&&(this._pageViewId=this.uuidFn()),this._seenFirstPageView=!0}},{key:"getPageViewId",value:function(){return this._pageViewId||(this._pageViewId=this.uuidFn()),this._pageViewId}}]),e}();function wR(e){return typeof Event<"u"&&eB(e,Event)}function eB(e,t){try{return e instanceof t}catch{return!1}}function AR(e){return e===null||pl(e)!=="object"&&typeof e!="function"}function $h(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function N4(e){return $h(e,"DOMError")}var CR=/\(error: (.*)\)/,kR=50,zh="?";function O4(e,t,n,r){var i={filename:e,function:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var _ge=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Tge=/\((\S*)(?::(\d+))(?::(\d+))\)/,Sge=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wge=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Age=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Cge=(function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:0,o=[],s=i.split(` +`)).length,i=0;i127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),s!==null&&(n>t&&(a+=e.substring(t,n)),a+=s,t=n=i+1)}return n>t&&(a+=e.substring(t,e.length)),a},aR=function(e){var t=function(){var n=new Date().valueOf(),r=0;if(ht.performance&&ht.performance.now)r=1e4*ht.performance.now();else for(;n==new Date().valueOf();)r++;return n.toString(16)+Math.floor(r).toString(16)};return function(n){if(n==="og"||e==="og"){var r=typeof window<"u"?(window.screen.height*window.screen.width).toString(16):"0";return t()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var i,a,o=aa,s=0,u=[];function c(p,f){var m,g=0;for(m=0;m=4&&(s=c(s,u),u=[]);return u.length>0&&(s=c(s,u)),s.toString(16)}()+"-"+r+"-"+t()}return hhe().toString()}},The=function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog|applebot|semrushbot|duckduckbot|twitterbot|rogerbot|linkedinbot|mj12bot|sitebulb|bot.htm|bot.php|hubspot|crawler|prerender)/i.test(e)},oR=function(e,t){var n=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),r=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(e);if(r===null||r&&typeof r[1]!="string"&&r[1].length)return"";var i=r[1];try{i=decodeURIComponent(i)}catch{In.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},sR=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Qd=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,a){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!a);else{var o="on"+n,s=t[o];t[o]=function(u,c,p){return function(f){if(f=f||e(window.event)){var m,g=!0;FP(p)&&(m=p(f));var b=c.call(u,f);return m!==!1&&b!==!1||(g=!1),g}}}(t,r,s)}else In.error("No valid element provided to register_event")}}();function pT(e,t){var n=function(){var r=jn.createElement("script");r.type="text/javascript",r.src=e,r.onload=function(o){return t(void 0,o)},r.onerror=function(o){return t(o)};var i,a=jn.querySelectorAll("body > script");a.length>0?(i=a[0].parentNode)===null||i===void 0||i.insertBefore(r,a[0]):jn.body.appendChild(r)};jn.body?n():jn.addEventListener("DOMContentLoaded",n)}var Sr={campaignParams:function(e){var t=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","fbclid","msclkid"].concat(e||[]),n={};return hn(t,function(r){var i=oR(jn.URL,r);i.length&&(n[r]=i)}),n},searchEngine:function(){var e=jn.referrer;return e?e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null:null},searchInfo:function(){var e=Sr.searchEngine(),t=e!="yahoo"?"q":"p",n={};if(e!==null){n.$search_engine=e;var r=oR(jn.referrer,t);r.length&&(n.ph_keyword=r)}return n},browser:function(e,t,n){return t=t||"",n||fn(e," OPR/")?fn(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":fn(e,"IEMobile")||fn(e,"WPDesktop")?"Internet Explorer Mobile":fn(e,"SamsungBrowser/")?"Samsung Internet":fn(e,"Edge")||fn(e,"Edg/")?"Microsoft Edge":fn(e,"FBIOS")?"Facebook Mobile":fn(e,"Chrome")?"Chrome":fn(e,"CriOS")?"Chrome iOS":fn(e,"UCWEB")||fn(e,"UCBrowser")?"UC Browser":fn(e,"FxiOS")?"Firefox iOS":fn(t,"Apple")?fn(e,"Mobile")?"Mobile Safari":"Safari":fn(e,"Android")?"Android Mobile":fn(e,"Konqueror")?"Konqueror":fn(e,"Firefox")?"Firefox":fn(e,"MSIE")||fn(e,"Trident/")?"Internet Explorer":fn(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[Sr.browser(e,t,n)];if(r===void 0)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},browserLanguage:function(){return Ql.language||Ql.userLanguage},os:function(e){if(/Windows/i.test(e)){if(/Phone/.test(e)||/WPDesktop/.test(e))return{os_name:"Windows Phone",os_version:""};var t=/Windows NT ([0-9.]+)/i.exec(e);return t&&t[1]?{os_name:"Windows",os_version:t[1]}:{os_name:"Windows",os_version:""}}if(/(iPhone|iPad|iPod)/.test(e)){var n=/OS (\d+)_(\d+)_?(\d+)?/i.exec(e);return n&&n[1]?{os_name:"iOS",os_version:[n[1],n[2],n[3]||"0"].join(".")}:{os_name:"iOS",os_version:""}}if(/Android/.test(e)){var r=/Android (\d+)\.(\d+)\.?(\d+)?/i.exec(e);return r&&r[1]?{os_name:"Android",os_version:[r[1],r[2],r[3]||"0"].join(".")}:{os_name:"Android",os_version:""}}if(/(BlackBerry|PlayBook|BB10)/i.test(e))return{os_name:"BlackBerry",os_version:""};if(/Mac/i.test(e)){var i=/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i.exec(e);return i&&i[1]?{os_name:"Mac OS X",os_version:[i[1],i[2],i[3]||"0"].join(".")}:{os_name:"Mac OS X",os_version:""}}return/Linux/.test(e)?{os_name:"Linux",os_version:""}:/CrOS/.test(e)?{os_name:"Chrome OS",os_version:""}:{os_name:"",os_version:""}},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return t==="iPad"||t==="Android Tablet"?"Tablet":t?"Mobile":"Desktop"},referrer:function(){return jn.referrer||"$direct"},referringDomain:function(){if(!jn.referrer)return"$direct";var e=jn.createElement("a");return e.href=jn.referrer,e.host},properties:function(){var e=Sr.os(aa),t=e.os_name,n=e.os_version;return $r(Oy({$os:t,$os_version:n,$browser:Sr.browser(aa,Ql.vendor,ht.opera),$device:Sr.device(aa),$device_type:Sr.deviceType(aa)}),{$current_url:ht==null?void 0:ht.location.href,$host:ht==null?void 0:ht.location.host,$pathname:ht==null?void 0:ht.location.pathname,$browser_version:Sr.browserVersion(aa,Ql.vendor,ht.opera),$browser_language:Sr.browserLanguage(),$screen_height:ht==null?void 0:ht.screen.height,$screen_width:ht==null?void 0:ht.screen.width,$viewport_height:ht==null?void 0:ht.innerHeight,$viewport_width:ht==null?void 0:ht.innerWidth,$lib:"web",$lib_version:ma.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:BP()/1e3})},people_properties:function(){var e=Sr.os(aa),t=e.os_name,n=e.os_version;return $r(Oy({$os:t,$os_version:n,$browser:Sr.browser(aa,Ql.vendor,ht.opera)}),{$browser_version:Sr.browserVersion(aa,Ql.vendor,ht.opera)})}};function Zg(e){switch(pl(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function Qg(e){var t="";return Ph(e)&&!zP(e)&&e.childNodes&&e.childNodes.length&&hn(e.childNodes,function(n){$P(n)&&n.textContent&&(t+=Ry(n.textContent).split(/(\s+)/).filter(N1).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))}),Ry(t)}function lR(e){return!!e&&e.nodeType===1}function fu(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function $P(e){return!!e&&e.nodeType===3}function uR(e){return!!e&&e.nodeType===11}var k4=["a","button","form","input","select","textarea","label"];function Ph(e){for(var t=e;t.parentNode&&!fu(t,"body");t=t.parentNode){var n=Zg(t).split(" ");if(fn(n,"ph-sensitive")||fn(n,"ph-no-capture"))return!1}if(fn(Zg(e).split(" "),"ph-include"))return!0;var r=e.type||"";if(typeof r=="string")switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!(typeof i=="string"&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function zP(e){return!!(fu(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||fu(e,"select")||fu(e,"textarea")||e.getAttribute("contenteditable")==="true")}function N1(e){return!(e===null||ja(e)||typeof e=="string"&&(e=Ry(e),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,""))||/(^\d{3}-?\d{2}-?\d{4}$)/.test(e)))}function cR(e){var t=Qg(e);return N1(t="".concat(t," ").concat(HP(e)).trim())?t:""}function HP(e){var t="";return e&&e.childNodes&&e.childNodes.length&&hn(e.childNodes,function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{var i=Qg(n);t="".concat(t," ").concat(i).trim(),n.childNodes&&n.childNodes.length&&(t="".concat(t," ").concat(HP(n)).trim())}catch(a){console.error(a)}}),t}var She=function(){function e(t){Un(this,e),this.clicks=[],this.enabled=t}return $n(e,[{key:"isRageClick",value:function(t,n,r){if(!this.enabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(n-i.y)<30&&r-i.timestamp<1e3){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}]),e}(),whe=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,yo={is_supported:function(){return!0},error:function(e){In.error("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?i.$el_text=cR(e):i.$el_text=Qg(e));var a=Zg(e);a.length>0&&(i.classes=a.split(" ").filter(function(c){return c!==""})),hn(e.attributes,function(c){var p;zP(e)&&["name","id","class"].indexOf(c.name)===-1||!t&&N1(c.value)&&(typeof(p=c.name)!="string"||p.substring(0,10)!=="_ngcontent"&&p.substring(0,7)!=="_nghost")&&(i["attr__"+c.name]=c.value)});for(var o=1,s=1,u=e;u=this._previousElementSibling(u);)o++,u.tagName===e.tagName&&s++;return i.nth_child=o,i.nth_of_type=s,i},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return hn(document.querySelectorAll(e.css_selector),function(n){var r;["input","select"].indexOf(n.tagName.toLowerCase())>-1?r=n.value:n.textContent&&(r=n.textContent),N1(r)&&t.push(r)}),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return hn(this._customProperties,function(r){hn(r.event_selectors,function(i){hn(document.querySelectorAll(i),function(a){fn(e,a)&&Ph(a)&&(n[r.name]=t._extractCustomPropertyValue(r))})})}),n},_getEventTarget:function(e){return e.target===void 0?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"$autocapture",a=this._getEventTarget(e);if($P(a)&&(a=a.parentNode||null),i==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&(n=this.rageclicks)!==null&&n!==void 0&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this._captureEvent(e,t,"$rageclick"),a&&function(g,b){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!g||fu(g,"html")||!lR(g))return!1;if(y!=null&&y.url_allowlist){var T=window.location.href,E=y.url_allowlist;if(E&&!E.some(function($){return T.match($)}))return!1}if(y!=null&&y.dom_event_allowlist){var v=y.dom_event_allowlist;if(v&&!v.some(function($){return b.type===$}))return!1}if(y!=null&&y.element_allowlist){var w=y.element_allowlist;if(w&&!w.some(function($){return g.tagName.toLowerCase()===$}))return!1}if(y!=null&&y.css_selector_allowlist){var A=y.css_selector_allowlist;if(A&&!A.some(function($){return g.matches($)}))return!1}for(var R=!1,k=[g],N=!0,B=g;B.parentNode&&!fu(B,"body");)if(uR(B.parentNode))k.push(B.parentNode.host),B=B.parentNode.host;else{if(!(N=B.parentNode||!1))break;if(k4.indexOf(N.tagName.toLowerCase())>-1)R=!0;else{var q=window.getComputedStyle(N);q&&q.getPropertyValue("cursor")==="pointer"&&(R=!0)}k.push(N),B=N}var P=window.getComputedStyle(g);if(P&&P.getPropertyValue("cursor")==="pointer"&&b.type==="click")return!0;var Q=g.tagName.toLowerCase();switch(Q){case"html":return!1;case"form":return b.type==="submit";case"input":case"select":case"textarea":return b.type==="change"||b.type==="click";default:return R?b.type==="click":b.type==="click"&&(k4.indexOf(Q)>-1||g.getAttribute("contenteditable")==="true")}}(a,e,this.config)){for(var o=[a],s=a;s.parentNode&&!fu(s,"body");)uR(s.parentNode)?(o.push(s.parentNode.host),s=s.parentNode.host):(o.push(s.parentNode),s=s.parentNode);var u,c=[],p={},f=!1;if(hn(o,function(g){var b=Ph(g);g.tagName.toLowerCase()==="a"&&(u=g.getAttribute("href"),u=b&&N1(u)&&u),fn(Zg(g).split(" "),"ph-no-capture")&&(f=!0),c.push(r._getPropertiesFromElement(g,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")));var y=r._getAugmentPropertiesFromElement(g);$r(p,y)}),t.get_config("mask_all_text")||(a.tagName.toLowerCase()==="a"||a.tagName.toLowerCase()==="button"?c[0].$el_text=cR(a):c[0].$el_text=Qg(a)),u&&(c[0].attr__href=u),f)return!1;var m=$r(this._getDefaultProperties(e.type),{$elements:c},this._getCustomProperties(o),p);return t.capture(i,m),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,n=function(r){r=r||window.event,t._captureEvent(r,e)};Qd(document,"submit",n,!1,!0),Qd(document,"change",n,!1,!0),Qd(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;typeof e.__autocapture!="boolean"&&(this.config=e.__autocapture),(t=this.config)!==null&&t!==void 0&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map(function(n){return new RegExp(n)})),this.rageclicks=new She(e.get_config("rageclick"))},afterDecideResponse:function(e,t){var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?In.log('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(ct({},dR,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this._setIsAutocaptureEnabled(t),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=ja(t)?10:t,n=ja(n)?10:n;for(var r=0,i=0;i1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],i="".concat(r),a=this.instance.get_property(Jg)||{};return!n.send_event&&"send_event"in n||t in a&&a[t].includes(i)||(Array.isArray(a[t])?a[t].push(i):a[t]=[i],this.instance.persistence.register(ct({},Jg,a)),this.instance.capture("$feature_flag_called",{$feature_flag:t,$feature_flag_response:r})),r}console.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(t){return this.getFlagPayloads()[t]}},{key:"isFeatureEnabled",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(t,n);console.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(t){this.featureFlagEventHandlers.push(t)}},{key:"removeFeatureFlagsHandler",value:function(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(n){return n!==t})}},{key:"receivedFeatureFlags",value:function(t){this.instance.decideEndpointWasHit=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads();(function(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=i.featureFlags,c=i.featureFlagPayloads;if(u)if(Array.isArray(u)){var p,f={};if(u)for(var m=0;m1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(Fy);if(i&&!r)return t(i);this.instance._send_request("".concat(this.instance.get_config("api_host"),"/api/early_access_features/?token=").concat(this.instance.get_config("token")),{},{method:"GET"},function(a){var o=a.earlyAccessFeatures;return n.instance.persistence.register(ct({},Fy,o)),t(o)})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter(function(r){return n[r]}),flagVariants:Object.keys(n).filter(function(r){return n[r]}).reduce(function(r,i){return r[i]=n[i],r},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(function(i){return i(n,r)})}},{key:"setPersonPropertiesForFlags",value:function(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(D1)||{};this.instance.register(ct({},D1,vt(vt({},r),t))),n&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(D1)}},{key:"setGroupPropertiesForFlags",value:function(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Vs)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(function(i){r[i]=vt(vt({},r[i]),t[i]),delete t[i]}),this.instance.register(ct({},Vs,vt(vt({},r),t))),n&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(t){if(t){var n=this.instance.get_property(Vs)||{};this.instance.register(ct({},Vs,vt(vt({},n),{},ct({},t,{}))))}else this.instance.unregister(Vs)}}]),e}(),Ihe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg==",bR=2,Rhe=4,GP=3,Nhe=6,Ohe=0,Dhe=5e6,Lhe="rrweb/console@1",fo,Mhe=$n(function e(t){var n,r,i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Un(this,e),ct(this,"bucketSize",100),ct(this,"refillRate",10),ct(this,"mutationBuckets",{}),ct(this,"loggedTracker",{}),ct(this,"refillBuckets",function(){Object.keys(i.mutationBuckets).forEach(function(o){i.mutationBuckets[o]=i.mutationBuckets[o]+i.refillRate,i.mutationBuckets[o]>=i.bucketSize&&delete i.mutationBuckets[o]})}),ct(this,"getNodeOrRelevantParent",function(o){var s=i.rrweb.mirror.getNode(o);if((s==null?void 0:s.nodeName)!=="svg"&&s instanceof Element){var u=s.closest("svg");if(u)return[i.rrweb.mirror.getId(u),u]}return[o,s]}),ct(this,"numberOfChanges",function(o){var s,u,c,p,f,m,g,b;return((s=(u=o.removes)===null||u===void 0?void 0:u.length)!==null&&s!==void 0?s:0)+((c=(p=o.attributes)===null||p===void 0?void 0:p.length)!==null&&c!==void 0?c:0)+((f=(m=o.texts)===null||m===void 0?void 0:m.length)!==null&&f!==void 0?f:0)+((g=(b=o.adds)===null||b===void 0?void 0:b.length)!==null&&g!==void 0?g:0)}),ct(this,"throttleMutations",function(o){if(o.type!==GP||o.data.source!==Ohe)return o;var s=o.data,u=i.numberOfChanges(s);s.attributes&&(s.attributes=s.attributes.filter(function(p){var f,m,g,b=Co(i.getNodeOrRelevantParent(p.id),2),y=b[0],T=b[1];return i.mutationBuckets[y]===0?!1:(i.mutationBuckets[y]=(f=i.mutationBuckets[y])!==null&&f!==void 0?f:i.bucketSize,i.mutationBuckets[y]=Math.max(i.mutationBuckets[y]-1,0),i.mutationBuckets[y]===0&&(i.loggedTracker[y]||(i.loggedTracker[y]=!0,(m=(g=i.options).onBlockedNode)===null||m===void 0||m.call(g,y,T))),p)}));var c=i.numberOfChanges(s);return c!==0||u===c?o:void 0}),this.rrweb=t,this.options=a,this.refillRate=(n=this.options.refillRate)!==null&&n!==void 0?n:this.refillRate,this.bucketSize=(r=this.options.bucketSize)!==null&&r!==void 0?r:this.bucketSize,setInterval(function(){i.refillBuckets()},1e3)}),Fhe="/s/",VP="sessionRecording";(function(e){e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet"})(fo||(fo={}));var Phe=[fo.MouseMove,fo.MouseInteraction,fo.Scroll,fo.ViewportResize,fo.Input,fo.TouchMove,fo.MediaInteraction,fo.Drag],Bhe=function(){function e(t){var n=this;Un(this,e),ct(this,"lastActivityTimestamp",Date.now()),ct(this,"isIdle",!1),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint=Fhe,this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1,window.addEventListener("beforeunload",function(){n._flushBuffer()})}return $n(e,[{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var t=!!this.instance.get_property(Ly),n=!this.instance.get_config("disable_session_recording");return t&&n}},{key:"isConsoleLogCaptureEnabled",value:function(){var t=!!this.instance.get_property(pR),n=this.instance.get_config("enable_recording_console_log");return n??t}},{key:"getRecordingVersion",value:function(){var t,n=this.instance.get_property(fR);return((t=this.instance.get_config("session_recording"))===null||t===void 0?void 0:t.recorderVersion)||n||"v1"}},{key:"afterDecideResponse",value:function(t){var n,r,i,a,o,s;this.receivedDecide=!0,this.instance.persistence&&this.instance.persistence.register((ct(o={},Ly,!!t.sessionRecording),ct(o,pR,(i=t.sessionRecording)===null||i===void 0?void 0:i.consoleLogRecordingEnabled),ct(o,fR,(a=t.sessionRecording)===null||a===void 0?void 0:a.recorderVersion),o)),(n=t.sessionRecording)!==null&&n!==void 0&&n.endpoint&&(this.endpoint=(s=t.sessionRecording)===null||s===void 0?void 0:s.endpoint),(r=t.sessionRecording)!==null&&r!==void 0&&r.recorderVersion&&(this.recorderVersion=t.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"log",value:function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(n=this.instance.sessionRecording)===null||n===void 0||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:r,trace:[],payload:[JSON.stringify(t)]}},timestamp:BP()})}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var t=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach(function(n){return t._captureSnapshotBuffered(n)})),this._startCapture()}},{key:"_startCapture",value:function(){var t=this;if(Object.assign!==void 0&&!this.captureStarted&&!this.instance.get_config("disable_session_recording")){this.captureStarted=!0,this.instance.sessionManager.checkAndGetSessionAndWindowId();var n=this.getRecordingVersion()==="v2"?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.getRecordingVersion()?pT(this.instance.get_config("api_host")+"/static/".concat(n,"?v=").concat(ma.LIB_VERSION),function(r){if(r)return In.error("Could not load ".concat(n),r);t._onScriptLoaded()}):this._onScriptLoaded()}}},{key:"_isInteractiveEvent",value:function(t){var n;return t.type===GP&&Phe.indexOf((n=t.data)===null||n===void 0?void 0:n.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(t){var n=this._isInteractiveEvent(t);if(n||this.isIdle||t.timestamp-this.lastActivityTimestamp>3e5&&(this.isIdle=!0),n&&(this.lastActivityTimestamp=t.timestamp,this.isIdle&&(this.isIdle=!1,this._tryTakeFullSnapshot())),!this.isIdle){var r=this.instance.sessionManager.checkAndGetSessionAndWindowId(!n,t.timestamp),i=r.windowId,a=r.sessionId;[bR,Rhe].indexOf(t.type)!==-1||this.windowId===i&&this.sessionId===a||this._tryTakeFullSnapshot(),this.windowId=i,this.sessionId=a}}},{key:"_tryTakeFullSnapshot",value:function(){if(!this.captureStarted)return!1;try{var t;return(t=this.rrwebRecord)===null||t===void 0||t.takeFullSnapshot(),!0}catch(n){return In.error("Error taking full snapshot.",n),!1}}},{key:"_onScriptLoaded",value:function(){var t,n=this,r={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var i=this.instance.get_config("session_recording"),a=0,o=Object.entries(i||{});aDhe){var c,p=hs(u.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(p.s();!(c=p.n()).done;){var f=c.value;u=f[1].toLocaleLowerCase().slice(0,6)==="image/"?u.replace(f[0],Ihe):u.replace(f[0],"")}}catch(m){p.e(m)}finally{p.f()}}return{event:JSON.parse(u),size:u.length}}(function(s){var u=s;if(u&&pl(u)==="object"&&u.type===Nhe&&pl(u.data)==="object"&&u.data.plugin===Lhe){u.data.payload.payload.length>10&&(u.data.payload.payload=u.data.payload.payload.slice(0,10),u.data.payload.payload.push("...[truncated]"));for(var c=[],p=0;p2e3?c.push(u.data.payload.payload[p].slice(0,2e3)+"...[truncated]"):c.push(u.data.payload.payload[p]);return u.data.payload.payload=c,s}return s}(n)),i=r.event,a=r.size;if(this._updateWindowAndSessionIds(i),!this.isIdle){var o={$snapshot_bytes:a,$snapshot_data:i,$session_id:this.sessionId,$window_id:this.windowId};this.instance._captureMetrics.incr("rrweb-record"),this.instance._captureMetrics.incr("rrweb-record-".concat(i.type)),this.emit?this._captureSnapshotBuffered(o):this.snapshots.push(o)}}}}},{key:"_flushBuffer",value:function(){return this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0),this.buffer&&this.buffer.data.length!==0&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.buffer=void 0,{size:0,data:[],sessionId:this.sessionId,windowId:this.windowId}}},{key:"_captureSnapshotBuffered",value:function(t){var n,r=this,i=2+(((n=this.buffer)===null||n===void 0?void 0:n.data.length)||0);(!this.buffer||this.buffer.size+t.$snapshot_bytes+i>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=t.$snapshot_bytes,this.buffer.data.push(t.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){r._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(t){this.instance.capture("$snapshot",t,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:VP,_metrics:{rrweb_full_snapshot:t.$snapshot_data.type===bR}})}}]),e}(),lo={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},Uhe=["first-input","navigation","paint","resource"],$he=["/s/","/e/"],zhe=function(){function e(t){Un(this,e),ct(this,"_forceAllowLocalhost",!1),this.instance=t}return $n(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var t,n,r=this;if(!this.observer)if(((t=window)===null||t===void 0||(n=t.PerformanceObserver)===null||n===void 0?void 0:n.supportedEntryTypes)!==void 0)if(!mhe.includes(location.hostname)||this._forceAllowLocalhost)try{this.observer=new PerformanceObserver(function(a){a.getEntries().forEach(function(o){r._capturePerformanceEvent(o)})});var i=PerformanceObserver.supportedEntryTypes.filter(function(a){return Uhe.includes(a)});i.forEach(function(a){var o;(o=r.observer)===null||o===void 0||o.observe({type:a,buffered:!0})})}catch(a){console.error("PostHog failed to start performance observer",a),this.stopObserving()}else In.log("PostHog Peformance observer not started because we are on localhost.");else In.log("PostHog Performance observer not started because PerformanceObserver is not supported by this browser.")}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var t,n;return(t=(n=this.instance.get_config("capture_performance"))!==null&&n!==void 0?n:this.remoteEnabled)!==null&&t!==void 0&&t}},{key:"afterDecideResponse",value:function(t){this.remoteEnabled=t.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(t){if(t.name.indexOf(this.instance.get_config("api_host"))===0){var n=t.name.replace(this.instance.get_config("api_host"),"");if($he.find(function(g){return n.indexOf(g)===0}))return}var r={url:t.name},i=this.instance.get_config("session_recording");if(i.maskNetworkRequestFn&&(r=i.maskNetworkRequestFn(r)),r){var a=t.toJSON();a.name=r.url;var o={},s=Math.floor(Date.now()-performance.now());for(var u in o[lo.timeOrigin]=s,o[lo.timestamp]=Math.floor(s+t.startTime),lo)a[u]!==void 0&&(o[lo[u]]=a[u]);if(this.capturePerformanceEvent(o),Hhe(t)){var c,p=hs(t.serverTiming||[]);try{for(p.s();!(c=p.n()).done;){var f,m=c.value;this.capturePerformanceEvent((ct(f={},lo.timeOrigin,s),ct(f,lo.timestamp,Math.floor(s+t.startTime)),ct(f,lo.name,m.name),ct(f,lo.duration,m.duration),ct(f,lo.entryType,"serverTiming"),f))}}catch(g){p.e(g)}finally{p.f()}}}}},{key:"capturePerformanceEvent",value:function(t){var n,r=t[lo.timestamp];(n=this.instance.sessionRecording)===null||n===void 0||n.onRRwebEmit({type:6,data:{plugin:"posthog/network@1",payload:t},timestamp:r})}}]),e}(),Hhe=function(e){return e.entryType==="navigation"||e.entryType==="resource"},jhe=function(){function e(t){Un(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return $n(e,[{key:"call",value:function(){var t=this,n=dT(JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(D1),group_properties:this.instance.get_property(Vs),disable_flags:this.instance.get_config("advanced_disable_feature_flags")||this.instance.get_config("advanced_disable_feature_flags_on_first_load")||void 0}));this.instance._send_request("".concat(this.instance.get_config("api_host"),"/decide/?v=3"),{data:n,verbose:!0},{method:"POST"},function(r){return t.parseDecideResponse(r)})}},{key:"parseDecideResponse",value:function(t){var n,r,i,a=this;if((t==null?void 0:t.status)!==0){if(!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){a.parseDecideResponse(t)},500);if(this.instance.toolbar.afterDecideResponse(t),(n=this.instance.sessionRecording)===null||n===void 0||n.afterDecideResponse(t),Ys.afterDecideResponse(t,this.instance),(r=this.instance.webPerformance)===null||r===void 0||r.afterDecideResponse(t),(i=this.instance.exceptionAutocapture)===null||i===void 0||i.afterDecideResponse(t),this.instance.get_config("advanced_disable_feature_flags_on_first_load")||this.instance.featureFlags.receivedFeatureFlags(t),this.instance.compression={},t.supportedCompression&&!this.instance.get_config("disable_compression")){var o,s={},u=hs(t.supportedCompression);try{for(u.s();!(o=u.n()).done;)s[o.value]=!0}catch(g){u.e(g)}finally{u.f()}this.instance.compression=s}if(t.siteApps)if(this.instance.get_config("opt_in_site_apps")){var c,p=this.instance.get_config("api_host"),f=hs(t.siteApps);try{var m=function(){var g=c.value,b=g.id,y=g.url,T=[p,p[p.length-1]==="/"&&y[0]==="/"?y.substring(1):y].join("");window["__$$ph_site_app_".concat(b)]=a.instance,pT(T,function(E){E&&console.error("Error while initializing PostHog app with config id ".concat(b),E)})};for(f.s();!(c=f.n()).done;)m()}catch(g){f.e(g)}finally{f.f()}}else t.siteApps.length>0&&console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),Ghe=["https://app.posthog.com","https://eu.posthog.com"],Vhe=["source"],Whe=function(){function e(t){Un(this,e),this.instance=t}return $n(e,[{key:"afterDecideResponse",value:function(t){var n=t.toolbarParams||t.editorParams||(t.toolbarVersion?{toolbarVersion:t.toolbarVersion}:{});t.isAuthenticated&&n.toolbarVersion&&n.toolbarVersion.indexOf("toolbar")===0&&this.loadToolbar(vt({},n))}},{key:"maybeLoadToolbar",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window.history;try{if(!n){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch{return!1}n=window.localStorage}var i,a=sR(t.hash,"__posthog")||sR(t.hash,"state"),o=a?JSON.parse(decodeURIComponent(a)):null;return o&&o.action==="ph_authorize"?((i=o).source="url",i&&Object.keys(i).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState("",document.title,t.pathname+t.search):t.hash="")):((i=JSON.parse(n.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.get_config("token")!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}},{key:"loadToolbar",value:function(t){var n=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var r=this.instance.get_config("api_host"),i=3e4*Math.floor(Date.now()/3e4),a="".concat(r).concat(r.endsWith("/")?"":"/","static/toolbar.js?_ts=").concat(i),o=!Ghe.includes(this.instance.get_config("api_host"))&&this.instance.get_config("advanced_disable_toolbar_metrics"),s=vt(vt({token:this.instance.get_config("token")},t),{},{apiURL:r},o?{instrument:!1}:{});s.source;var u=uhe(s,Vhe);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(u)),pT(a,function(c){c?In.error("Failed to load toolbar",c):(window.ph_load_toolbar||window.ph_load_editor)(s,n.instance)}),Qd(window,"turbolinks:load",function(){window._postHogToolbarLoaded=!1,n.loadToolbar(s)}),!0}},{key:"_loadEditor",value:function(t){return this.loadToolbar(t)}},{key:"maybeLoadEditor",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:window.history;return this.maybeLoadToolbar(t,n,r)}}]),e}(),qhe="__ph_opt_in_out_";function Khe(e,t){qP(!0,e,t)}function Yhe(e,t){qP(!1,e,t)}function Xhe(e,t){return WP(e,t)==="1"}function yR(e,t){return!!function(n){if(n&&n.respectDnt){var r=n&&n.window||ht,i=r.navigator||{},a=!1;return hn([i.doNotTrack,i.msDoNotTrack,r.doNotTrack],function(o){fn([!0,1,"1","yes"],o)&&(a=!0)}),a}return!1}(t)||WP(e,t)==="0"}function Zhe(e,t){fT(t=t||{}).remove(hT(e,t),!!t.crossSubdomainCookie)}function fT(e){return(e=e||{}).persistenceType==="localStorage"?Kn:e.persistenceType==="localStorage+cookie"?Dy:yo}function hT(e,t){return((t=t||{}).persistencePrefix||qhe)+e}function WP(e,t){return fT(t).get(hT(e,t))}function qP(e,t,n){PP(t)&&t.length?(fT(n=n||{}).set(hT(t,n),e?1:0,yhe(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}var KP=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:3e3;Un(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return $n(e,[{key:"setPollInterval",value:function(t){this._pollInterval=t,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return new Date().getTime()}}]),e}(),Qhe=function(e){NP(n,KP);var t=OP(n);function n(r,i){var a,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:3e3;return Un(this,n),(a=t.call(this,o)).handlePollRequest=i,a.captureMetrics=r,a}return $n(n,[{key:"enqueue",value:function(r,i,a){this.captureMetrics.incr("batch-enqueue"),this._event_queue.push({url:r,data:i,options:a}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var r=this;clearTimeout(this._poller),this._poller=setTimeout(function(){if(r._event_queue.length>0){var i=r.formatQueue(),a=function(s){var u=i[s],c=u.url,p=u.data,f=u.options;hn(p,function(m,g){p[g].offset=Math.abs(p[g].timestamp-r.getTime()),delete p[g].timestamp}),r.handlePollRequest(c,p,f),r.captureMetrics.incr("batch-requests"),r.captureMetrics.incr("batch-requests-".concat(c.slice(c.length-2))),r.captureMetrics.incr("batch-handle",p.length),r.captureMetrics.incr("batch-handle-".concat(c.slice(c.length-2)),p.length)};for(var o in i)a(o);r._event_queue.length=0,r._empty_queue_count=0}else r._empty_queue_count++;r._empty_queue_count>4&&(r.isPolling=!1,r._empty_queue_count=0),r.isPolling&&r.poll()},this._pollInterval)}},{key:"updateUnloadMetrics",value:function(){var r=this.formatQueue();for(var i in r){var a=r[i],o=a.url,s=a.data;this.captureMetrics.incr("batch-unload-requests"),this.captureMetrics.incr("batch-unload-requests-".concat(o.slice(o.length-2))),this.captureMetrics.incr("batch-unload",s.length),this.captureMetrics.incr("batch-unload-".concat(o.slice(o.length-2)),s.length)}}},{key:"unload",value:function(){var r=this;clearTimeout(this._poller);var i=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var a=Object.values(i);[].concat(xy(a.filter(function(o){return o.url.indexOf("/e")===0})),xy(a.filter(function(o){return o.url.indexOf("/e")!==0}))).map(function(o){var s=o.url,u=o.data,c=o.options;r.handlePollRequest(s,u,vt(vt({},c),{},{transport:"sendBeacon"}))})}},{key:"formatQueue",value:function(){var r={};return hn(this._event_queue,function(i){var a=i.url,o=i.data,s=i.options,u=(s?s._batchKey:null)||a;r[u]===void 0&&(r[u]={data:[],url:a,options:s}),s&&r[u].options&&r[u].options._metrics&&!r[u].options._metrics.rrweb_full_snapshot&&(r[u].options._metrics.rrweb_full_snapshot=s._metrics.rrweb_full_snapshot),r[u].data.push(o)}),r}}]),n}(),Jhe=function(){function e(t){Un(this,e),this.enabled=t,this.metrics={}}return $n(e,[{key:"incr",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.enabled&&(t="phjs-".concat(t),this.metrics[t]=(this.metrics[t]||0)+n)}},{key:"decr",value:function(t){this.enabled&&(t="phjs-".concat(t),this.metrics[t]=(this.metrics[t]||0)-1)}}]),e}(),Ui=Uint8Array,ni=Uint16Array,dc=Uint32Array,gT=new Ui([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mT=new Ui([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ER=new Ui([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),YP=function(e,t){for(var n=new ni(31),r=0;r<31;++r)n[r]=t+=1<>>1|(21845&Sn)<<1;ql=(61680&(ql=(52428&ql)>>>2|(13107&ql)<<2))>>>4|(3855&ql)<<4,zy[Sn]=((65280&ql)>>>8|(255&ql)<<8)>>>1}var Jd=function(e,t,n){for(var r=e.length,i=0,a=new ni(t);i>>u]=c}else for(o=new ni(r),i=0;i>>15-e[i];return o},wu=new Ui(288);for(Sn=0;Sn<144;++Sn)wu[Sn]=8;for(Sn=144;Sn<256;++Sn)wu[Sn]=9;for(Sn=256;Sn<280;++Sn)wu[Sn]=7;for(Sn=280;Sn<288;++Sn)wu[Sn]=8;var em=new Ui(32);for(Sn=0;Sn<32;++Sn)em[Sn]=5;var tu,tge=Jd(wu,9,0),nge=Jd(em,5,0),ZP=function(e){return(e/8>>0)+(7&e&&1)},QP=function(e,t,n){(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof ni?ni:e instanceof dc?dc:Ui)(n-t);return r.set(e.subarray(t,n)),r},Ko=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},dd=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},R4=function(e,t){for(var n=[],r=0;rm&&(m=a[r].s);var g=new ni(m+1),b=rge(n[p-1],g,0);if(b>t){r=0;var y=0,T=b-t,E=1<t))break;y+=E-(1<>>=T;y>0;){var w=a[r].s;g[w]=0&&y;--r){var A=a[r].s;g[A]==t&&(--g[A],++y)}b=t}return[new Ui(g),b]},rge=function e(t,n,r){return t.s==-1?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},_R=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ni(++t),r=0,i=e[0],a=1,o=function(u){n[r++]=u},s=1;s<=t;++s)if(e[s]==i&&s!=t)++a;else{if(!i&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(i),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(i);a=1,i=e[s]}return[n.subarray(0,r),t]},pd=function(e,t){for(var n=0,r=0;r>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;a4&&!P[ER[$-1]];--$);var oe,fe,ce,De,H=c+5<<3,W=pd(i,wu)+pd(a,em)+o,se=pd(i,m)+pd(a,y)+o+14+3*$+pd(N,P)+(2*N[16]+3*N[17]+7*N[18]);if(H<=W&&H<=se)return Uh(t,p,e.subarray(u,u+c));if(Ko(t,p,1+(se15&&(Ko(t,p,L[B]>>>5&127),p+=L[B]>>>12)}}}else oe=tge,fe=wu,ce=nge,De=em;for(B=0;B255){ie=r[B]>>>18&31,dd(t,p,oe[ie+257]),p+=fe[ie+257],ie>7&&(Ko(t,p,r[B]>>>23&31),p+=gT[ie]);var Se=31&r[B];dd(t,p,ce[Se]),p+=De[Se],Se>3&&(dd(t,p,r[B]>>>5&8191),p+=mT[Se])}else dd(t,p,oe[r[B]]),p+=fe[r[B]];return dd(t,p,oe[256]),p+fe[256]},ige=new dc([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),age=new Ui(0),oge=function(){for(var e=new dc(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),sge=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r>>8;e=n},d:function(){return 4294967295^e}}},lge=function(e,t,n,r,i){return function(a,o,s,u,c,p){var f=a.length,m=new Ui(u+f+5*(1+Math.floor(f/7e3))+c),g=m.subarray(u,m.length-c),b=0;if(!o||f<8)for(var y=0;y<=f;y+=65535){var T=y+65535;T>>13,w=8191&E,A=(1<7e3||ce>24576)&&pe>423){b=TR(a,g,0,P,Q,$,fe,ce,H,y-H,b),ce=oe=fe=0,H=y;for(var le=0;le<286;++le)Q[le]=0;for(le=0;le<30;++le)$[le]=0}var L=2,ie=0,Se=w,X=se-D&32767;if(pe>2&&W==q(y-X))for(var ke=Math.min(v,pe)-1,te=Math.min(32767,y),Me=Math.min(258,pe);X<=te&&--Se&&se!=D;){if(a[y+L]==a[y+L-X]){for(var Re=0;ReL){if(L=Re,ie=X,Re>ke)break;var Ye=Math.min(X,Re-2),We=0;for(le=0;leWe&&(We=ot,D=dt)}}}X+=(se=D)-(D=R[se])+32768&32767}if(ie){P[ce++]=268435456|$y[L]<<18|vR[ie];var je=31&$y[L],pt=31&vR[ie];fe+=gT[je]+mT[pt],++Q[257+je],++$[pt],De=y+L,++oe}else P[ce++]=a[y],++Q[a[y]]}}b=TR(a,g,p,P,Q,$,fe,ce,H,y-H,b),p||(b=Uh(g,b,age))}return QP(m,0,u+ZP(b)+c)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)},Hy=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},uge=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Hy(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},cge=function(e){return 10+(e.filename&&e.filename.length+1||0)};function dge(e,t){t===void 0&&(t={});var n=sge(),r=e.length;n.p(e);var i=lge(e,t,cge(t),8),a=i.length;return uge(i,t),Hy(i,a-8,n.d()),Hy(i,a-4,r),i}function pge(e,t){var n=e.length;if(!t&&typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new Ui(e.length+(e.length>>>1)),i=0,a=function(c){r[i++]=c},o=0;or.length){var s=new Ui(i+8+(n-o<<1));s.set(r),r=s}var u=e.charCodeAt(o);u<128||t?a(u):u<2048?(a(192|u>>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&e.charCodeAt(++o))>>>18),a(128|u>>>12&63),a(128|u>>>6&63),a(128|63&u)):(a(224|u>>>12),a(128|u>>>6&63),a(128|63&u))}return QP(r,0,i)}(function(e){e.GZipJS="gzip-js",e.Base64="base64"})(tu||(tu={}));var fge=function(e,t,n){var r=t||{};r.ip=n.ip?1:0,r._=new Date().getTime().toString(),r.ver=ma.LIB_VERSION;var i=e.split("?");if(i.length>1){var a,o=hs(i[1].split("&"));try{for(o.s();!(a=o.n()).done;){var s=a.value.split("=")[0];r[s]&&delete r[s]}}catch(c){o.e(c)}finally{o.f()}}var u=e.indexOf("?")>-1?"&":"?";return e+u+function(c){var p,f,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",g=[];return hn(c,function(b,y){p=encodeURIComponent(b.toString()),f=encodeURIComponent(y),g[g.length]=f+"="+p}),g.join(m)}(r)},bT=function e(t,n){if(n.blob&&t.buffer)return new Blob([t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r=e(t,{method:"POST"});return new Blob([r],{type:"application/x-www-form-urlencoded"})}if(n.method!=="POST")return null;var i,a;return i=Array.isArray(t)||(a=t,Object.prototype.toString.call(a)==="[object Uint8Array]")?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i},JP=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,a=e.captureMetrics,o=e.callback,s=e.retriesPerformedSoFar,u=e.retryQueue,c=e.onXHRError,p=e.timeout,f=p===void 0?1e4:p,m=e.onRateLimited,g=new XMLHttpRequest;g.open(i.method||"GET",t,!0);var b=bT(n,i);a.incr("_send_request"),a.incr("_send_request_inflight"),hn(r,function(y,T){g.setRequestHeader(T,y)}),i.method!=="POST"||i.blob||g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.timeout=f,g.withCredentials=!0,g.onreadystatechange=function(){if(g.readyState===4)if(a.incr("xhr-response"),a.incr("xhr-response-".concat(g.status)),a.decr("_send_request_inflight"),g.status===200){if(o){var y;try{y=JSON.parse(g.responseText)}catch(T){return void In.error(T)}o(y)}}else typeof c=="function"&&c(g),[401,403,404,500].indexOf(g.status)<0&&u.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(s||0)+1,callback:o}),g.status===429&&(m==null||m(g)),o&&o({status:0})},g.send(b)},hge=18e5,gge=function(e){NP(n,KP);var t=OP(n);function n(r,i,a){var o;return Un(this,n),(o=t.call(this)).captureMetrics=r,o.isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=i,o.rateLimiter=a,typeof window<"u"&&"onLine"in window.navigator&&(o.areWeOnline=window.navigator.onLine,window.addEventListener("online",function(){o._handleWeAreNowOnline()}),window.addEventListener("offline",function(){o.areWeOnline=!1})),o}return $n(n,[{key:"enqueue",value:function(r){var i=r.retriesPerformedSoFar||0;if(!(i>=10)){var a=function(s){var u=3e3*Math.pow(2,s),c=u/2,p=Math.min(hge,u),f=(Math.random()-.5)*(p-c);return Math.ceil(p+f)}(i),o=new Date(Date.now()+a);this.queue.push({retryAt:o,requestData:r}),console.warn("Enqueued failed request for retry in ".concat(a)),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var r=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout(function(){r.areWeOnline&&r.queue.length>0&&r.flush(),r.poll()},this._pollInterval)}},{key:"flush",value:function(){var r=new Date(Date.now()),i=this.queue.filter(function(u){return u.retryAt0){this.queue=this.queue.filter(function(u){return u.retryAt>=r});var a,o=hs(i);try{for(o.s();!(a=o.n()).done;){var s=a.value.requestData;this._executeXhrRequest(s)}}catch(u){o.e(u)}finally{o.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var r,i=hs(this.queue);try{for(i.s();!(r=i.n()).done;){var a=r.value.requestData,o=a.url,s=a.data,u=a.options;if(this.rateLimiter.isRateLimited(u._batchKey))ma.DEBUG&&console.warn("[PostHog RetryQueue] is quota limited. Dropping request.");else try{window.navigator.sendBeacon(o,bT(s,vt(vt({},u),{},{sendBeacon:!0})))}catch(c){ma.DEBUG&&console.error(c)}}}catch(c){i.e(c)}finally{i.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(r){var i=r.url,a=r.data,o=r.options,s=r.headers,u=r.callback,c=r.retriesPerformedSoFar;this.rateLimiter.isRateLimited(o._batchKey)?ma.DEBUG&&console.warn("[PostHog RetryQueue] in quota limited mode. Dropping request."):JP({url:i,data:a||{},options:o||{},headers:s||{},retriesPerformedSoFar:c||0,callback:u,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError,onRateLimited:this.rateLimiter.on429Response})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),n}(),rh=1800,SR=60,mge=864e5,bge=function(){function e(t,n,r){Un(this,e),ct(this,"_sessionIdChangedHandlers",[]),this.uuidFn=r,this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null;var i=t.persistence_name||t.token,a=t.session_idle_timeout_seconds||rh;if(typeof a!="number"?(console.warn("[PostHog] session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),a=rh):a>rh?console.warn("[PostHog] session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):a0&&arguments[0]!==void 0&&arguments[0],n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),r=Co(this._getSessionId(),3),i=r[0],a=r[1],o=r[2],s=this._getWindowId(),u=o&&o>0&&Math.abs(n-o)>mge,c=!1;!a||!t&&Math.abs(n-i)>this._sessionTimeoutMs||u?(a=this.uuidFn(),s=this.uuidFn(),o=n,c=!0):s||(s=this.uuidFn(),c=!0);var p=i===0||!t||u?n:i,f=o===0?new Date().getTime():o;return this._setWindowId(s),this._setSessionId(a,p,f),c&&this._sessionIdChangedHandlers.forEach(function(m){return m(a,s)}),{sessionId:a,windowId:s,sessionStartTimestamp:f}}}]),e}(),yge=$n(function e(t,n,r,i){Un(this,e),this.name="posthog-js",this.setupOnce=function(a){a(function(o){var s,u,c,p,f;if(o.level!=="error"||!t.__loaded)return o;o.tags||(o.tags={});var m=t.config.ui_host||t.config.api_host;o.tags["PostHog Person URL"]=m+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var g=((s=o.exception)===null||s===void 0?void 0:s.values)||[],b={$exception_message:(u=g[0])===null||u===void 0?void 0:u.value,$exception_type:(c=g[0])===null||c===void 0?void 0:c.type,$exception_personURL:m+"/person/"+t.get_distinct_id(),$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(p=g[0])===null||p===void 0?void 0:p.value,$sentry_exception_type:(f=g[0])===null||f===void 0?void 0:f.type,$sentry_tags:o.tags};return n&&r&&(b.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+o.event_id),t.capture("$exception",b),o})}}),Ege=function(e){Promise&&Promise.resolve||console.warn("This browser does not have Promise support, and can not use the segment integration");var t=function(n,r){n.event.userId||n.event.anonymousId===e.get_distinct_id()||e.reset(),n.event.userId&&n.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:n.event.userId}),e.reloadFeatureFlags());var i=e._calculate_event_properties(r,n.event.properties);return n.event.properties=Object.assign({},i,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(n){return t(n,n.event.event)},page:function(n){return t(n,"$pageview")},identify:function(n){return t(n,"$identify")},screen:function(n){return t(n,"$screen")}}},vge=function(){function e(t){Un(this,e),ct(this,"_seenFirstPageView",!1),this.uuidFn=t}return $n(e,[{key:"onPageview",value:function(){this._seenFirstPageView&&(this._pageViewId=this.uuidFn()),this._seenFirstPageView=!0}},{key:"getPageViewId",value:function(){return this._pageViewId||(this._pageViewId=this.uuidFn()),this._pageViewId}}]),e}();function wR(e){return typeof Event<"u"&&eB(e,Event)}function eB(e,t){try{return e instanceof t}catch{return!1}}function AR(e){return e===null||pl(e)!=="object"&&typeof e!="function"}function $h(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function N4(e){return $h(e,"DOMError")}var CR=/\(error: (.*)\)/,kR=50,zh="?";function O4(e,t,n,r){var i={filename:e,function:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var _ge=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Tge=/\((\S*)(?::(\d+))(?::(\d+))\)/,Sge=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,wge=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Age=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Cge=(function(){for(var e=arguments.length,t=new Array(e),n=0;n1&&arguments[1]!==void 0?arguments[1]:0,o=[],s=i.split(` `),u=a;u1024)){var p=CR.test(c)?c.replace(CR,"$1"):c;if(!p.match(/\S*Error: /)){var f,m=hs(r);try{for(m.s();!(f=m.n()).done;){var g=(0,f.value)(p);if(g){o.push(g);break}}}catch(b){m.e(b)}finally{m.f()}if(o.length>=kR)break}}}return function(b){if(!b.length)return[];var y=b.slice(0,kR);return y.reverse(),y.map(function(T){return vt(vt({},T),{},{filename:T.filename||y[y.length-1].filename,function:T.function||"?"})})}(o)}}).apply(void 0,[[30,function(e){var t=_ge.exec(e);if(t){if(t[2]&&t[2].indexOf("eval")===0){var n=Tge.exec(t[2]);n&&(t[2]=n[1],t[3]=n[2],t[4]=n[3])}var r=Co(xR(t[1]||zh,t[2]),2),i=r[0];return O4(r[1],i,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],[50,function(e){var t=Sge.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=wge.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],i=t[1]||zh,a=Co(xR(i,r),2);return i=a[0],O4(r=a[1],i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],[40,function(e){var t=Age.exec(e);return t?O4(t[2],t[1]||zh,+t[3],t[4]?+t[4]:void 0):void 0}]]),xR=function(e,t){var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:zh,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]},kge=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,xge=/Minified React error #\d+;/i;function Ige(e){var t=e.stacktrace||e.stack||"",n=function(r){if(r){if(typeof r.framesToPop=="number")return r.framesToPop;if(xge.test(r.message))return 1}return 0}(e);try{return Cge(t,n)}catch{}return[]}function D4(e){var t=Ige(e);return{$exception_type:e.name,$exception_message:e.message,$exception_stack_trace_raw:JSON.stringify(t)}}function Rge(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:40,n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>t))return r===n.length||i.length<=t?i:"".concat(i.slice(0,t),"...")}return""}function IR(e){var t=Co(e,5),n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s={};if(o===void 0&&typeof n=="string"){var u="Error",c=n,p=n.match(kge);p&&(u=p[1],c=p[2]),s={$exception_type:u,$exception_message:c}}var f=o||n;if(N4(f)||function(y){return $h(y,"DOMException")}(f)){var m=f;if(function(y){return"stack"in y}(f))s=D4(f);else{var g=m.name||(N4(m)?"DOMError":"DOMException"),b=m.message?"".concat(g,": ").concat(m.message):g;s=function(y){return{$exception_type:"Error",$exception_message:y}}(b),s.$exception_type=N4(m)?"DOMError":"DOMException",s.$exception_message=s.$exception_message||b}"code"in m&&(s.$exception_DOMException_code="".concat(m.code))}else(function(y){return $h(y,"ErrorEvent")})(f)&&f.error?s=D4(f.error):function(y){switch(Object.prototype.toString.call(y)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return eB(y,Error)}}(f)?s=D4(f):function(y){return $h(y,"Object")}(f)||wR(f)?(s=function(y){return{$exception_type:wR(y)?y.constructor.name:"Error",$exception_message:"Non-Error ".concat("exception"," captured with keys: ",Rge(y))}}(f),s.$exception_is_synthetic=!0):(s.$exception_type=s.$exception_type||"Error",s.$exception_message=s.$exception_message||f,s.$exception_is_synthetic=!0);return vt(vt(vt(vt({},s),{},{$exception_type:s.$exception_type||"UnknownErrorType",$exception_message:s.$exception_message||""},r?{$exception_source:r}:{}),i?{$exception_lineno:i}:{}),a?{$exception_colno:a}:{})}var RR,NR,Nge=function(){function e(t){Un(this,e),ct(this,"originalOnErrorHandler",void 0),ct(this,"originalOnUnhandledRejectionHandler",void 0),ct(this,"errorsToIgnore",[]),this.instance=t}return $n(e,[{key:"debugLog",value:function(){if(this.instance.get_config("debug")){for(var t,n=arguments.length,r=new Array(n),i=0;i1&&arguments[1]!==void 0&&arguments[1],i=this.instance.get_property(Py);if(i&&!r)return t(i);this.instance._send_request("".concat(this.instance.get_config("api_host"),"/api/surveys/?token=").concat(this.instance.get_config("token")),{},{method:"GET"},function(a){var o=a.surveys;return n.instance.persistence.register(ct({},Py,o)),t(o)})}},{key:"getActiveMatchingSurveys",value:function(t){var n=this,r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(i){var a=i.filter(function(o){return!(!o.start_date||o.end_date)}).filter(function(o){var s,u;if(!o.conditions)return!0;var c=(s=o.conditions)===null||s===void 0||!s.url||window.location.href.indexOf(o.conditions.url)>-1,p=(u=o.conditions)===null||u===void 0||!u.selector||document.querySelector(o.conditions.selector);return c&&p}).filter(function(o){if(!o.linked_flag_key&&!o.targeting_flag_key)return!0;var s=!o.linked_flag_key||n.instance.featureFlags.isFeatureEnabled(o.linked_flag_key),u=!o.targeting_flag_key||n.instance.featureFlags.isFeatureEnabled(o.targeting_flag_key);return s&&u});return t(a)},r)}}]),e}(),Dge={"X-PostHog-Retry-After-Recordings":VP,"X-PostHog-Retry-After-Events":"events"},Lge=function(){function e(){Un(this,e),ct(this,"limits",{})}return $n(e,[{key:"isRateLimited",value:function(t){var n=this.limits[t||"events"]||!1;return n!==!1&&new Date().getTime()1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var u,c={segmentRegister:!1,syncCode:!1},p=function(A){return function(){c[A]||(c[A]=!0,c.segmentRegister&&c.syncCode&&(s==null||s(i)))}};if(this.set_config($r({},OR(),a,{name:o,token:t,callback_fn:(o===gi?o:gi+"."+o)+"._jsc"})),this.uuidFn=aR(this.config.uuid_version||"og"),this._jsc=function(){},(ht!=null&&(n=ht.rrweb)!==null&&n!==void 0&&n.record||ht!=null&&ht.rrwebRecord)&&(this.__loaded_recorder_version=ht==null||(u=ht.rrweb)===null||u===void 0?void 0:u.version),this.persistence=new hR(this.config),this._captureMetrics=new Jhe(this.get_config("_capture_metrics")),this._requestQueue=new Qhe(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new gge(this._captureMetrics,this.get_config("on_xhr_error"),this.rateLimiter),this.__captureHooks=[],this.__request_queue=[],this.sessionManager=new bge(this.config,this.persistence,this.uuidFn),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new hR(vt(vt({},this.config),{},{persistence:"sessionStorage"})),this._gdpr_init(),a.segment?(this.config.get_device_id=function(){return a.segment.user().anonymousId()},a.segment.user().id()&&(this.register({distinct_id:a.segment.user().id()}),this.persistence.set_user_state("identified")),a.segment.register(this.segmentIntegration()).then(p("segmentRegister"))):p("segmentRegister")(),((r=a.bootstrap)===null||r===void 0?void 0:r.distinctID)!==void 0){var f,m,g=this.get_config("get_device_id")(this.uuidFn()),b=(f=a.bootstrap)!==null&&f!==void 0&&f.isIdentifiedID?g:a.bootstrap.distinctID;this.persistence.set_user_state((m=a.bootstrap)!==null&&m!==void 0&&m.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:a.bootstrap.distinctID,$device_id:b})}if(this._hasBootstrappedFeatureFlags()){var y,T,E=Object.keys(((y=a.bootstrap)===null||y===void 0?void 0:y.featureFlags)||{}).filter(function(A){var R,k;return!((R=a.bootstrap)===null||R===void 0||(k=R.featureFlags)===null||k===void 0||!k[A])}).reduce(function(A,R){var k,N;return A[R]=((k=a.bootstrap)===null||k===void 0||(N=k.featureFlags)===null||N===void 0?void 0:N[R])||!1,A},{}),v=Object.keys(((T=a.bootstrap)===null||T===void 0?void 0:T.featureFlagPayloads)||{}).filter(function(A){return E[A]}).reduce(function(A,R){var k,N,B,q;return(k=a.bootstrap)!==null&&k!==void 0&&(N=k.featureFlagPayloads)!==null&&N!==void 0&&N[R]&&(A[R]=(B=a.bootstrap)===null||B===void 0||(q=B.featureFlagPayloads)===null||q===void 0?void 0:q[R]),A},{});this.featureFlags.receivedFeatureFlags({featureFlags:E,featureFlagPayloads:v})}if(!this.get_distinct_id()){var w=this.get_config("get_device_id")(this.uuidFn());this.register_once({distinct_id:w,$device_id:w},""),this.persistence.set_user_state("anonymous")}ht.addEventListener&&ht.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),p("syncCode")()}},{key:"_loaded",value:function(){this.featureFlags.setReloadingPaused(!0);try{this.get_config("loaded")(this)}catch(t){console.error("`loaded` function failed",t)}this._start_queue_if_opted_in(),this.get_config("capture_pageview")&&this.capture("$pageview",{title:jn.title},{send_instantly:!0}),this.get_config("advanced_disable_decide")||new jhe(this).call(),this.featureFlags.resetRequestQueue(),this.featureFlags.setReloadingPaused(!1)}},{key:"_start_queue_if_opted_in",value:function(){this.has_opted_out_capturing()||this.get_config("request_batching")&&this._requestQueue.poll()}},{key:"_dom_loaded",value:function(){var t=this;this.has_opted_out_capturing()||os(this.__request_queue,function(n){t._send_request.apply(t,xy(n))}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(t,n){if(ja(t))return null;if(Hh)return function(o){t(o,n)};var r=this._jsc,i=""+Math.floor(1e8*Math.random()),a=this.get_config("callback_fn")+"["+i+"]";return r[i]=function(o){delete r[i],t(o,n)},a}},{key:"_handle_unload",value:function(){this.get_config("request_batching")?(this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave"),this.get_config("_capture_metrics")&&(this._requestQueue.updateUnloadMetrics(),this.capture("$capture_metrics",this._captureMetrics.metrics)),this._requestQueue.unload(),this._retryQueue.unload()):this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(t,n,r){var i=JSON.stringify(n);this.__compress_and_send_json_request(t,i,r||ih,jy)}},{key:"__compress_and_send_json_request",value:function(t,n,r,i){var a=function(c,p,f){return c===tu.GZipJS?[dge(pge(p),{mtime:0}),vt(vt({},f),{},{blob:!0,urlQueryArgs:{compression:tu.GZipJS}})]:[{data:dT(p)},f]}(this.compression[tu.GZipJS]?tu.GZipJS:tu.Base64,n,r),o=Co(a,2),s=o[0],u=o[1];this._send_request(t,s,u,i)}},{key:"_send_request",value:function(t,n,r,i){if(this.rateLimiter.isRateLimited(r._batchKey))this.get_config("debug")&&console.warn("[PostHog SendRequest] is quota limited. Dropping request.");else if(tB)this.__request_queue.push([t,n,r,i]);else{var a={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")};r=$r(a,r||{}),Hh||(r.method="GET");var o="sendBeacon"in ht.navigator&&r.transport==="sendBeacon";if(t=fge(t,r.urlQueryArgs||{},{ip:this.get_config("ip")}),o)try{ht.navigator.sendBeacon(t,bT(n,vt(vt({},r),{},{sendBeacon:!0})))}catch{}else if(Hh)try{JP({url:t,data:n,headers:this.get_config("xhr_headers"),options:r,captureMetrics:this._captureMetrics,callback:i,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.get_config("on_xhr_error"),onRateLimited:this.rateLimiter.on429Response})}catch(p){console.error(p)}else{var s,u=jn.createElement("script");u.type="text/javascript",u.async=!0,u.defer=!0,u.src=t;var c=jn.getElementsByTagName("script")[0];(s=c.parentNode)===null||s===void 0||s.insertBefore(u,c)}}}},{key:"_execute_array",value:function(t){var n,r=this,i=[],a=[],o=[];os(t,function(u){u&&(n=u[0],ts(n)?o.push(u):typeof u=="function"?u.call(r):ts(u)&&n==="alias"?i.push(u):ts(u)&&n.indexOf("capture")!==-1&&typeof r[n]=="function"?o.push(u):a.push(u))});var s=function(u,c){os(u,function(p){if(ts(p[0])){var f=c;hn(p,function(m){f=f[m[0]].apply(f,m.slice(1))})}else this[p[0]].apply(this,p.slice(1))},c)};s(i,this),s(a,this),s(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var t,n;return((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags)&&Object.keys((n=this.config.bootstrap)===null||n===void 0?void 0:n.featureFlags).length>0||!1}},{key:"push",value:function(t){this._execute_array([t])}},{key:"captureException",value:function(t,n){var r;(r=this.exceptionAutocapture)===null||r===void 0||r.captureException([t.name,void 0,void 0,void 0,t],n)}},{key:"capture",value:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ih;if(this.__loaded&&!function(c,p){var f=!1;try{var m=c.get_config("token"),g=c.get_config("respect_dnt"),b=c.get_config("opt_out_capturing_persistence_type"),y=c.get_config("opt_out_capturing_cookie_prefix")||void 0,T=c.get_config("window");m&&(f=yR(m,{respectDnt:g,persistenceType:b,persistencePrefix:y,window:T}))}catch(E){p||console.error("Unexpected error when checking capturing opt-out status: "+E)}return f}(this,!1)){this._captureMetrics.incr("capture"),t==="$snapshot"&&this._captureMetrics.incr("snapshot");var i=(r=r||ih).transport;if(i&&(r.transport=i),ja(t)||typeof t!="string")console.error("No event name provided to posthog.capture");else if(!The(aa)){this.sessionPersistence.update_search_keyword(),this.get_config("store_google")&&this.sessionPersistence.update_campaign_params(),this.get_config("save_referrer")&&this.sessionPersistence.update_referrer_info();var a={uuid:this.uuidFn("v7"),event:t,properties:this._calculate_event_properties(t,n||{})};t==="$identify"&&(a.$set=r.$set,a.$set_once=r.$set_once),(a=vhe(a,r._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=r.timestamp||new Date,this.get_config("debug")&&In.log("PostHog.js send",a);var o=JSON.stringify(a),s=this.get_config("api_host")+(r.endpoint||"/e/"),u=r!==ih;return!this.get_config("request_batching")||u&&!r._batchKey||r.send_instantly?this.__compress_and_send_json_request(s,o,r):this._requestQueue.enqueue(s,a,r),this._invokeCaptureHooks(t,a),a}}}},{key:"_addCaptureHook",value:function(t){this.__captureHooks.push(t)}},{key:"_invokeCaptureHooks",value:function(t,n){this.config._onCapture(t,n),hn(this.__captureHooks,function(r){return r(t)})}},{key:"_calculate_event_properties",value:function(t,n){var r,i=this.persistence.remove_event_timer(t),a=vt({},n);if(a.token=this.get_config("token"),t==="$snapshot"){var o=vt(vt({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=o.distinct_id,a}var s=Sr.properties();if(this.sessionManager){var u=this.sessionManager.checkAndGetSessionAndWindowId(),c=u.sessionId,p=u.windowId;a.$session_id=c,a.$window_id=p}if((r=this.webPerformance)!==null&&r!==void 0&&r.isEnabled&&(t==="$pageview"&&this.pageViewIdManager.onPageview(),a=$r(a,{$pageview_id:this.pageViewIdManager.getPageViewId()})),t==="$pageview"&&(a.title=jn.title),t==="$performance_event"){var f=this.persistence.properties();return a.distinct_id=f.distinct_id,a.$current_url=s.$current_url,a}if(i!==void 0){var m=new Date().getTime()-i;a.$duration=parseFloat((m/1e3).toFixed(3))}a=$r({},Sr.properties(),this.persistence.properties(),this.sessionPersistence.properties(),a);var g=this.get_config("property_blacklist");ts(g)?hn(g,function(y){delete a[y]}):console.error("Invalid value for property_blacklist config: "+g);var b=this.get_config("sanitize_properties");return b&&(a=b(a,t)),a}},{key:"register",value:function(t,n){this.persistence.register(t,n)}},{key:"register_once",value:function(t,n,r){this.persistence.register_once(t,n,r)}},{key:"register_for_session",value:function(t){this.sessionPersistence.register(t)}},{key:"unregister",value:function(t){this.persistence.unregister(t)}},{key:"unregister_for_session",value:function(t){this.sessionPersistence.unregister(t)}},{key:"_register_single",value:function(t,n){this.register(ct({},t,n))}},{key:"getFeatureFlag",value:function(t,n){return this.featureFlags.getFeatureFlag(t,n)}},{key:"getFeatureFlagPayload",value:function(t){var n=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(n)}catch{return n}}},{key:"isFeatureEnabled",value:function(t,n){return this.featureFlags.isFeatureEnabled(t,n)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(t,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,n)}},{key:"getEarlyAccessFeatures",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(t,n)}},{key:"onFeatureFlags",value:function(t){return this.featureFlags.onFeatureFlags(t)}},{key:"onSessionId",value:function(t){return this.sessionManager.onSessionId(t)}},{key:"getSurveys",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(t,n)}},{key:"getActiveMatchingSurveys",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(t,n)}},{key:"identify",value:function(t,n,r){if(t){this._captureMetrics.incr("identify");var i=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var a=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:a},"")}t!==i&&t!==this.get_property(Bh)&&(this.unregister(Bh),this.register({distinct_id:t}));var o=this.persistence.get_user_state()==="anonymous";t!==i&&o?(this.persistence.set_user_state("identified"),this.setPersonPropertiesForFlags(n||{},!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this.featureFlags.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(Jg))}else console.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(t,n){(t||n)&&(this.setPersonPropertiesForFlags(t||{}),this.capture("$set",{$set:t||{},$set_once:n||{}}))}},{key:"group",value:function(t,n,r){if(t&&n){this._captureMetrics.incr("group");var i=this.getGroups();i[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:vt(vt({},i),{},ct({},t,n))}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags(ct({},t,r))),i[t]===n||r||this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(t,n)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setGroupPropertiesForFlags(t,n)}},{key:"resetGroupPropertiesForFlags",value:function(t){this.featureFlags.resetGroupPropertiesForFlags(t)}},{key:"reset",value:function(t){var n=this.get_property("$device_id");this.persistence.clear(),this.sessionPersistence.clear(),this.persistence.set_user_state("anonymous"),this.sessionManager.resetSessionId();var r=this.get_config("get_device_id")(this.uuidFn());this.register_once({distinct_id:r,$device_id:t?r:n},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){return this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId}},{key:"get_session_replay_url",value:function(t){var n=this.config.ui_host||this.config.api_host,r=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=r.sessionId,a=r.sessionStartTimestamp,o=n+"/replay/"+i;if(t!=null&&t.withTimestamp&&a){var s,u=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!a)return o;var c=Math.max(Math.floor((new Date().getTime()-a)/1e3)-u,0);o+="?t=".concat(c)}return o}},{key:"alias",value:function(t,n){return t===this.get_property(jP)?(In.critical("Attempting to create alias for existing People user - aborting."),-2):(ja(n)&&(n=this.get_distinct_id()),t!==n?(this._register_single(Bh,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(console.error("alias matches current distinct_id - skipping api call."),this.identify(t),-1))}},{key:"set_config",value:function(t){var n=vt({},this.config);Ny(t)&&($r(this.config,t),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),this.sessionPersistence&&this.sessionPersistence.update_config(this.config),Kn.is_supported()&&Kn.get("ph_debug")==="true"&&(this.config.debug=!0),this.get_config("debug")&&(ma.DEBUG=!0),this.sessionRecording&&t.disable_session_recording!==void 0&&n.disable_session_recording!==t.disable_session_recording&&(t.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var t;return!((t=this.sessionRecording)===null||t===void 0||!t.started())}},{key:"loadToolbar",value:function(t){return this.toolbar.loadToolbar(t)}},{key:"get_config",value:function(t){var n;return(n=this.config)===null||n===void 0?void 0:n[t]}},{key:"get_property",value:function(t){return this.persistence.props[t]}},{key:"getSessionProperty",value:function(t){return this.sessionPersistence.props[t]}},{key:"toString",value:function(){var t,n=(t=this.get_config("name"))!==null&&t!==void 0?t:gi;return n!==gi&&(n=gi+"."+n),n}},{key:"_gdpr_init",value:function(){this.get_config("opt_out_capturing_persistence_type")==="localStorage"&&Kn.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.get_config("opt_out_capturing_by_default")&&!yo.get("ph_optout")||(yo.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))}},{key:"_gdpr_update_persistence",value:function(t){var n;if(t&&t.clear_persistence)n=!0;else{if(!t||!t.enable_persistence)return;n=!1}this.get_config("disable_persistence")||this.persistence.disabled===n||this.persistence.set_disabled(n),this.get_config("disable_persistence")||this.sessionPersistence.disabled===n||this.sessionPersistence.set_disabled(n)}},{key:"_gdpr_call_func",value:function(t,n){return n=$r({capture:this.capture.bind(this),persistence_type:this.get_config("opt_out_capturing_persistence_type"),cookie_prefix:this.get_config("opt_out_capturing_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),secure_cookie:this.get_config("secure_cookie")},n||{}),Kn.is_supported()||n.persistence_type!=="localStorage"||(n.persistence_type="cookie"),t(this.get_config("token"),{capture:n.capture,captureEventName:n.capture_event_name,captureProperties:n.capture_properties,persistenceType:n.persistence_type,persistencePrefix:n.cookie_prefix,cookieExpiration:n.cookie_expiration,crossSubdomainCookie:n.cross_subdomain_cookie,secureCookie:n.secure_cookie})}},{key:"opt_in_capturing",value:function(t){t=$r({enable_persistence:!0},t||{}),this._gdpr_call_func(Khe,t),this._gdpr_update_persistence(t)}},{key:"opt_out_capturing",value:function(t){var n=$r({clear_persistence:!0},t||{});this._gdpr_call_func(Yhe,n),this._gdpr_update_persistence(n)}},{key:"has_opted_in_capturing",value:function(t){return this._gdpr_call_func(Xhe,t)}},{key:"has_opted_out_capturing",value:function(t){return this._gdpr_call_func(yR,t)}},{key:"clear_opt_in_out_capturing",value:function(t){var n=$r({enable_persistence:!0},t??{});this._gdpr_call_func(Zhe,n),this._gdpr_update_persistence(n)}},{key:"debug",value:function(t){t===!1?(ht.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(ht.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),e}();(function(e,t){for(var n=0;np(g,typeof g=="string"?null:g.state,b===0?"default":void 0));let a=u(n??i.length-1),o=Wn.Pop,s=null;function u(g){return Math.min(Math.max(g,0),i.length-1)}function c(){return i[a]}function p(g,b,y){b===void 0&&(b=null);let T=Vy(i?c().pathname:"/",g,b,y);return Au(T.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(g)),T}function f(g){return typeof g=="string"?g:D2(g)}return{get index(){return a},get action(){return o},get location(){return c()},createHref:f,createURL(g){return new URL(f(g),"http://localhost")},encodeLocation(g){let b=typeof g=="string"?Ro(g):g;return{pathname:b.pathname||"",search:b.search||"",hash:b.hash||""}},push(g,b){o=Wn.Push;let y=p(g,b);a+=1,i.splice(a,i.length,y),r&&s&&s({action:o,location:y,delta:1})},replace(g,b){o=Wn.Replace;let y=p(g,b);i[a]=y,r&&s&&s({action:o,location:y,delta:0})},go(g){o=Wn.Pop;let b=u(a+g),y=i[b];a=b,s&&s({action:o,location:y,delta:g})},listen(g){return s=g,()=>{s=null}}}}function $t(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Au(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Kge(){return Math.random().toString(36).substr(2,8)}function Vy(e,t,n,r){return n===void 0&&(n=null),Nn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ro(t):t,{state:n,key:t&&t.key||r||Kge()})}function D2(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ro(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var tr;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(tr||(tr={}));const Yge=new Set(["lazy","caseSensitive","path","id","index","children"]);function Xge(e){return e.index===!0}function Wy(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,a)=>{let o=[...n,a],s=typeof i.id=="string"?i.id:o.join("-");if($t(i.index!==!0||!i.children,"Cannot specify children on an index route"),$t(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),Xge(i)){let u=Nn({},i,t(i),{id:s});return r[s]=u,u}else{let u=Nn({},i,t(i),{id:s,children:void 0});return r[s]=u,i.children&&(u.children=Wy(i.children,t,o,r)),u}})}function L1(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Ro(t):t,i=hf(r.pathname||"/",n);if(i==null)return null;let a=rB(e);Zge(a);let o=null;for(let s=0;o==null&&s{let u={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};u.relativePath.startsWith("/")&&($t(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=fl([r,u.relativePath]),p=n.concat(u);a.children&&a.children.length>0&&($t(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),rB(a.children,t,p,c)),!(a.path==null&&!a.index)&&t.push({path:c,score:ime(c,a.index),routesMeta:p})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let u of iB(a.path))i(a,o,u)}),t}function iB(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=iB(r.join("/")),s=[];return s.push(...o.map(u=>u===""?a:[a,u].join("/"))),i&&s.push(...o),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function Zge(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ame(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Qge=/^:\w+$/,Jge=3,eme=2,tme=1,nme=10,rme=-2,DR=e=>e==="*";function ime(e,t){let n=e.split("/"),r=n.length;return n.some(DR)&&(r+=rme),t&&(r+=eme),n.filter(i=>!DR(i)).reduce((i,a)=>i+(Qge.test(a)?Jge:a===""?tme:nme),r)}function ame(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function ome(e,t){let{routesMeta:n}=e,r={},i="/",a=[];for(let o=0;o{if(p==="*"){let m=s[f]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}return c[p]=cme(s[f]||"",p),c},{}),pathname:a,pathnameBase:o,pattern:e}}function lme(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Au(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,s)=>(r.push(s),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function ume(e){try{return decodeURI(e)}catch(t){return Au(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function cme(e,t){try{return decodeURIComponent(e)}catch(n){return Au(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function hf(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function dme(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ro(e):e;return{pathname:n?n.startsWith("/")?n:pme(n,t):t,search:hme(r),hash:gme(i)}}function pme(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function L4(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function vT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function aB(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ro(e):(i=Nn({},e),$t(!i.pathname||!i.pathname.includes("?"),L4("?","pathname","search",i)),$t(!i.pathname||!i.pathname.includes("#"),L4("#","pathname","hash",i)),$t(!i.search||!i.search.includes("#"),L4("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(r||o==null)s=n;else{let f=t.length-1;if(o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),f-=1;i.pathname=m.join("/")}s=f>=0?t[f]:"/"}let u=dme(i,s),c=o&&o!=="/"&&o.endsWith("/"),p=(a||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||p)&&(u.pathname+="/"),u}const fl=e=>e.join("/").replace(/\/\/+/g,"/"),fme=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hme=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,gme=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class oB{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function sB(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lB=["post","put","patch","delete"],mme=new Set(lB),bme=["get",...lB],yme=new Set(bme),Eme=new Set([301,302,303,307,308]),vme=new Set([307,308]),M4={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},_me={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fd={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},uB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Tme=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function Sme(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;$t(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let G=e.detectErrorBoundary;i=K=>({hasErrorBoundary:G(K)})}else i=Tme;let a={},o=Wy(e.routes,i,void 0,a),s,u=e.basename||"/",c=Nn({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),p=null,f=new Set,m=null,g=null,b=null,y=e.hydrationData!=null,T=L1(o,e.history.location,u),E=null;if(T==null){let G=oa(404,{pathname:e.history.location.pathname}),{matches:K,route:ne}=zR(o);T=K,E={[ne.id]:G}}let v=!T.some(G=>G.route.lazy)&&(!T.some(G=>G.route.loader)||e.hydrationData!=null),w,A={historyAction:e.history.action,location:e.history.location,matches:T,initialized:v,navigation:M4,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},R=Wn.Pop,k=!1,N,B=!1,q=!1,P=[],Q=[],$=new Map,oe=0,fe=-1,ce=new Map,De=new Set,H=new Map,W=new Map,se=new Map,D=!1;function pe(){return p=e.history.listen(G=>{let{action:K,location:ne,delta:ve}=G;if(D){D=!1;return}Au(se.size===0||ve!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Qe=ue({currentLocation:A.location,nextLocation:ne,historyAction:K});if(Qe&&ve!=null){D=!0,e.history.go(ve*-1),jt(Qe,{state:"blocked",location:ne,proceed(){jt(Qe,{state:"proceeding",proceed:void 0,reset:void 0,location:ne}),e.history.go(ve)},reset(){let Fe=new Map(A.blockers);Fe.set(Qe,fd),ie({blockers:Fe})}});return}return te(K,ne)}),A.initialized||te(Wn.Pop,A.location),w}function le(){p&&p(),f.clear(),N&&N.abort(),A.fetchers.forEach((G,K)=>de(K)),A.blockers.forEach((G,K)=>Ye(K))}function L(G){return f.add(G),()=>f.delete(G)}function ie(G){A=Nn({},A,G),f.forEach(K=>K(A))}function Se(G,K){var ne,ve;let Qe=A.actionData!=null&&A.navigation.formMethod!=null&&Ba(A.navigation.formMethod)&&A.navigation.state==="loading"&&((ne=G.state)==null?void 0:ne._isRedirect)!==!0,Fe;K.actionData?Object.keys(K.actionData).length>0?Fe=K.actionData:Fe=null:Qe?Fe=A.actionData:Fe=null;let at=K.loaderData?$R(A.loaderData,K.loaderData,K.matches||[],K.errors):A.loaderData,rt=A.blockers;rt.size>0&&(rt=new Map(rt),rt.forEach((Rt,Qt)=>rt.set(Qt,fd)));let Je=k===!0||A.navigation.formMethod!=null&&Ba(A.navigation.formMethod)&&((ve=G.state)==null?void 0:ve._isRedirect)!==!0;s&&(o=s,s=void 0),B||R===Wn.Pop||(R===Wn.Push?e.history.push(G,G.state):R===Wn.Replace&&e.history.replace(G,G.state)),ie(Nn({},K,{actionData:Fe,loaderData:at,historyAction:R,location:G,initialized:!0,navigation:M4,revalidation:"idle",restoreScrollPosition:Ve(G,K.matches||A.matches),preventScrollReset:Je,blockers:rt})),R=Wn.Pop,k=!1,B=!1,q=!1,P=[],Q=[]}async function X(G,K){if(typeof G=="number"){e.history.go(G);return}let ne=qy(A.location,A.matches,u,c.v7_prependBasename,G,K==null?void 0:K.fromRouteId,K==null?void 0:K.relative),{path:ve,submission:Qe,error:Fe}=LR(c.v7_normalizeFormMethod,!1,ne,K),at=A.location,rt=Vy(A.location,ve,K&&K.state);rt=Nn({},rt,e.history.encodeLocation(rt));let Je=K&&K.replace!=null?K.replace:void 0,Rt=Wn.Push;Je===!0?Rt=Wn.Replace:Je===!1||Qe!=null&&Ba(Qe.formMethod)&&Qe.formAction===A.location.pathname+A.location.search&&(Rt=Wn.Replace);let Qt=K&&"preventScrollReset"in K?K.preventScrollReset===!0:void 0,kt=ue({currentLocation:at,nextLocation:rt,historyAction:Rt});if(kt){jt(kt,{state:"blocked",location:rt,proceed(){jt(kt,{state:"proceeding",proceed:void 0,reset:void 0,location:rt}),X(G,K)},reset(){let rn=new Map(A.blockers);rn.set(kt,fd),ie({blockers:rn})}});return}return await te(Rt,rt,{submission:Qe,pendingError:Fe,preventScrollReset:Qt,replace:K&&K.replace})}function ke(){if(U(),ie({revalidation:"loading"}),A.navigation.state!=="submitting"){if(A.navigation.state==="idle"){te(A.historyAction,A.location,{startUninterruptedRevalidation:!0});return}te(R||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation})}}async function te(G,K,ne){N&&N.abort(),N=null,R=G,B=(ne&&ne.startUninterruptedRevalidation)===!0,me(A.location,A.matches),k=(ne&&ne.preventScrollReset)===!0;let ve=s||o,Qe=ne&&ne.overrideNavigation,Fe=L1(ve,K,u);if(!Fe){let rn=oa(404,{pathname:K.pathname}),{matches:Xt,route:Wr}=zR(ve);Ee(),Se(K,{matches:Xt,loaderData:{},errors:{[Wr.id]:rn}});return}if(A.initialized&&!q&&xme(A.location,K)&&!(ne&&ne.submission&&Ba(ne.submission.formMethod))){Se(K,{matches:Fe});return}N=new AbortController;let at=gd(e.history,K,N.signal,ne&&ne.submission),rt,Je;if(ne&&ne.pendingError)Je={[M1(Fe).route.id]:ne.pendingError};else if(ne&&ne.submission&&Ba(ne.submission.formMethod)){let rn=await Me(at,K,ne.submission,Fe,{replace:ne.replace});if(rn.shortCircuited)return;rt=rn.pendingActionData,Je=rn.pendingActionError,Qe=ah(K,ne.submission),at=new Request(at.url,{signal:at.signal})}let{shortCircuited:Rt,loaderData:Qt,errors:kt}=await Re(at,K,Fe,Qe,ne&&ne.submission,ne&&ne.fetcherSubmission,ne&&ne.replace,rt,Je);Rt||(N=null,Se(K,Nn({matches:Fe},rt?{actionData:rt}:{},{loaderData:Qt,errors:kt})))}async function Me(G,K,ne,ve,Qe){Qe===void 0&&(Qe={}),U();let Fe=Dme(K,ne);ie({navigation:Fe});let at,rt=Yy(ve,K);if(!rt.route.action&&!rt.route.lazy)at={type:tr.error,error:oa(405,{method:G.method,pathname:K.pathname,routeId:rt.route.id})};else if(at=await hd("action",G,rt,ve,a,i,u),G.signal.aborted)return{shortCircuited:!0};if(K1(at)){let Je;return Qe&&Qe.replace!=null?Je=Qe.replace:Je=at.location===A.location.pathname+A.location.search,await je(A,at,{submission:ne,replace:Je}),{shortCircuited:!0}}if(tp(at)){let Je=M1(ve,rt.route.id);return(Qe&&Qe.replace)!==!0&&(R=Wn.Push),{pendingActionData:{},pendingActionError:{[Je.route.id]:at.error}}}if(su(at))throw oa(400,{type:"defer-action"});return{pendingActionData:{[rt.route.id]:at.data}}}async function Re(G,K,ne,ve,Qe,Fe,at,rt,Je){let Rt=ve||ah(K,Qe),Qt=Qe||Fe||GR(Rt),kt=s||o,[rn,Xt]=MR(e.history,A,ne,Qt,K,q,P,Q,H,De,kt,u,rt,Je);if(Ee(qt=>!(ne&&ne.some(Dr=>Dr.route.id===qt))||rn&&rn.some(Dr=>Dr.route.id===qt)),fe=++oe,rn.length===0&&Xt.length===0){let qt=Te();return Se(K,Nn({matches:ne,loaderData:{},errors:Je||null},rt?{actionData:rt}:{},qt?{fetchers:new Map(A.fetchers)}:{})),{shortCircuited:!0}}if(!B){Xt.forEach(Dr=>{let Si=A.fetchers.get(Dr.key),Nl=md(void 0,Si?Si.data:void 0);A.fetchers.set(Dr.key,Nl)});let qt=rt||A.actionData;ie(Nn({navigation:Rt},qt?Object.keys(qt).length===0?{actionData:null}:{actionData:qt}:{},Xt.length>0?{fetchers:new Map(A.fetchers)}:{}))}Xt.forEach(qt=>{$.has(qt.key)&&xe(qt.key),qt.controller&&$.set(qt.key,qt.controller)});let Wr=()=>Xt.forEach(qt=>xe(qt.key));N&&N.signal.addEventListener("abort",Wr);let{results:qr,loaderResults:Kr,fetcherResults:Aa}=await pt(A.matches,ne,rn,Xt,G);if(G.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",Wr),Xt.forEach(qt=>$.delete(qt.key));let si=HR(qr);if(si){if(si.idx>=rn.length){let qt=Xt[si.idx-rn.length].key;De.add(qt)}return await je(A,si.result,{replace:at}),{shortCircuited:!0}}let{loaderData:Or,errors:Es}=UR(A,ne,rn,Kr,Je,Xt,Aa,W);W.forEach((qt,Dr)=>{qt.subscribe(Si=>{(Si||qt.done)&&W.delete(Dr)})});let vs=Te(),Yr=Le(fe),_s=vs||Yr||Xt.length>0;return Nn({loaderData:Or,errors:Es},_s?{fetchers:new Map(A.fetchers)}:{})}function Ze(G){return A.fetchers.get(G)||_me}function We(G,K,ne,ve){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");$.has(G)&&xe(G);let Qe=s||o,Fe=qy(A.location,A.matches,u,c.v7_prependBasename,ne,K,ve==null?void 0:ve.relative),at=L1(Qe,Fe,u);if(!at){re(G,K,oa(404,{pathname:Fe}));return}let{path:rt,submission:Je,error:Rt}=LR(c.v7_normalizeFormMethod,!0,Fe,ve);if(Rt){re(G,K,Rt);return}let Qt=Yy(at,rt);if(k=(ve&&ve.preventScrollReset)===!0,Je&&Ba(Je.formMethod)){dt(G,K,rt,Qt,at,Je);return}H.set(G,{routeId:K,path:rt}),ot(G,K,rt,Qt,at,Je)}async function dt(G,K,ne,ve,Qe,Fe){if(U(),H.delete(G),!ve.route.action&&!ve.route.lazy){let Ke=oa(405,{method:Fe.formMethod,pathname:ne,routeId:K});re(G,K,Ke);return}let at=A.fetchers.get(G),rt=Lme(Fe,at);A.fetchers.set(G,rt),ie({fetchers:new Map(A.fetchers)});let Je=new AbortController,Rt=gd(e.history,ne,Je.signal,Fe);$.set(G,Je);let Qt=oe,kt=await hd("action",Rt,ve,Qe,a,i,u);if(Rt.signal.aborted){$.get(G)===Je&&$.delete(G);return}if(K1(kt))if($.delete(G),fe>Qt){let Ke=d1(void 0);A.fetchers.set(G,Ke),ie({fetchers:new Map(A.fetchers)});return}else{De.add(G);let Ke=md(Fe);return A.fetchers.set(G,Ke),ie({fetchers:new Map(A.fetchers)}),je(A,kt,{submission:Fe,isFetchActionRedirect:!0})}if(tp(kt)){re(G,K,kt.error);return}if(su(kt))throw oa(400,{type:"defer-action"});let rn=A.navigation.location||A.location,Xt=gd(e.history,rn,Je.signal),Wr=s||o,qr=A.navigation.state!=="idle"?L1(Wr,A.navigation.location,u):A.matches;$t(qr,"Didn't find any matches after fetcher action");let Kr=++oe;ce.set(G,Kr);let Aa=md(Fe,kt.data);A.fetchers.set(G,Aa);let[si,Or]=MR(e.history,A,qr,Fe,rn,q,P,Q,H,De,Wr,u,{[ve.route.id]:kt.data},void 0);Or.filter(Ke=>Ke.key!==G).forEach(Ke=>{let J=Ke.key,Be=A.fetchers.get(J),it=md(void 0,Be?Be.data:void 0);A.fetchers.set(J,it),$.has(J)&&xe(J),Ke.controller&&$.set(J,Ke.controller)}),ie({fetchers:new Map(A.fetchers)});let Es=()=>Or.forEach(Ke=>xe(Ke.key));Je.signal.addEventListener("abort",Es);let{results:vs,loaderResults:Yr,fetcherResults:_s}=await pt(A.matches,qr,si,Or,Xt);if(Je.signal.aborted)return;Je.signal.removeEventListener("abort",Es),ce.delete(G),$.delete(G),Or.forEach(Ke=>$.delete(Ke.key));let qt=HR(vs);if(qt){if(qt.idx>=si.length){let Ke=Or[qt.idx-si.length].key;De.add(Ke)}return je(A,qt.result)}let{loaderData:Dr,errors:Si}=UR(A,A.matches,si,Yr,void 0,Or,_s,W);if(A.fetchers.has(G)){let Ke=d1(kt.data);A.fetchers.set(G,Ke)}let Nl=Le(Kr);A.navigation.state==="loading"&&Kr>fe?($t(R,"Expected pending action"),N&&N.abort(),Se(A.navigation.location,{matches:qr,loaderData:Dr,errors:Si,fetchers:new Map(A.fetchers)})):(ie(Nn({errors:Si,loaderData:$R(A.loaderData,Dr,qr,Si)},Nl||Or.length>0?{fetchers:new Map(A.fetchers)}:{})),q=!1)}async function ot(G,K,ne,ve,Qe,Fe){let at=A.fetchers.get(G),rt=md(Fe,at?at.data:void 0);A.fetchers.set(G,rt),ie({fetchers:new Map(A.fetchers)});let Je=new AbortController,Rt=gd(e.history,ne,Je.signal);$.set(G,Je);let Qt=oe,kt=await hd("loader",Rt,ve,Qe,a,i,u);if(su(kt)&&(kt=await pB(kt,Rt.signal,!0)||kt),$.get(G)===Je&&$.delete(G),Rt.signal.aborted)return;if(K1(kt))if(fe>Qt){let Xt=d1(void 0);A.fetchers.set(G,Xt),ie({fetchers:new Map(A.fetchers)});return}else{De.add(G),await je(A,kt);return}if(tp(kt)){let Xt=M1(A.matches,K);A.fetchers.delete(G),ie({fetchers:new Map(A.fetchers),errors:{[Xt.route.id]:kt.error}});return}$t(!su(kt),"Unhandled fetcher deferred data");let rn=d1(kt.data);A.fetchers.set(G,rn),ie({fetchers:new Map(A.fetchers)})}async function je(G,K,ne){let{submission:ve,replace:Qe,isFetchActionRedirect:Fe}=ne===void 0?{}:ne;K.revalidate&&(q=!0);let at=Vy(G.location,K.location,Nn({_isRedirect:!0},Fe?{_isFetchActionRedirect:!0}:{}));if($t(at,"Expected a location on the redirect navigation"),uB.test(K.location)&&n){let Rt=e.history.createURL(K.location),Qt=hf(Rt.pathname,u)==null;if(t.location.origin!==Rt.origin||Qt){Qe?t.location.replace(K.location):t.location.assign(K.location);return}}N=null;let rt=Qe===!0?Wn.Replace:Wn.Push,Je=ve||GR(G.navigation);if(vme.has(K.status)&&Je&&Ba(Je.formMethod))await te(rt,at,{submission:Nn({},Je,{formAction:K.location}),preventScrollReset:k});else if(Fe)await te(rt,at,{overrideNavigation:ah(at),fetcherSubmission:Je,preventScrollReset:k});else{let Rt=ah(at,Je);await te(rt,at,{overrideNavigation:Rt,preventScrollReset:k})}}async function pt(G,K,ne,ve,Qe){let Fe=await Promise.all([...ne.map(Je=>hd("loader",Qe,Je,K,a,i,u)),...ve.map(Je=>Je.matches&&Je.match&&Je.controller?hd("loader",gd(e.history,Je.path,Je.controller.signal),Je.match,Je.matches,a,i,u):{type:tr.error,error:oa(404,{pathname:Je.path})})]),at=Fe.slice(0,ne.length),rt=Fe.slice(ne.length);return await Promise.all([jR(G,ne,at,at.map(()=>Qe.signal),!1,A.loaderData),jR(G,ve.map(Je=>Je.match),rt,ve.map(Je=>Je.controller?Je.controller.signal:null),!0)]),{results:Fe,loaderResults:at,fetcherResults:rt}}function U(){q=!0,P.push(...Ee()),H.forEach((G,K)=>{$.has(K)&&(Q.push(K),xe(K))})}function re(G,K,ne){let ve=M1(A.matches,K);de(G),ie({errors:{[ve.route.id]:ne},fetchers:new Map(A.fetchers)})}function de(G){let K=A.fetchers.get(G);$.has(G)&&!(K&&K.state==="loading"&&ce.has(G))&&xe(G),H.delete(G),ce.delete(G),De.delete(G),A.fetchers.delete(G)}function xe(G){let K=$.get(G);$t(K,"Expected fetch controller: "+G),K.abort(),$.delete(G)}function ye(G){for(let K of G){let ne=Ze(K),ve=d1(ne.data);A.fetchers.set(K,ve)}}function Te(){let G=[],K=!1;for(let ne of De){let ve=A.fetchers.get(ne);$t(ve,"Expected fetcher: "+ne),ve.state==="loading"&&(De.delete(ne),G.push(ne),K=!0)}return ye(G),K}function Le(G){let K=[];for(let[ne,ve]of ce)if(ve0}function ze(G,K){let ne=A.blockers.get(G)||fd;return se.get(G)!==K&&se.set(G,K),ne}function Ye(G){A.blockers.delete(G),se.delete(G)}function jt(G,K){let ne=A.blockers.get(G)||fd;$t(ne.state==="unblocked"&&K.state==="blocked"||ne.state==="blocked"&&K.state==="blocked"||ne.state==="blocked"&&K.state==="proceeding"||ne.state==="blocked"&&K.state==="unblocked"||ne.state==="proceeding"&&K.state==="unblocked","Invalid blocker state transition: "+ne.state+" -> "+K.state);let ve=new Map(A.blockers);ve.set(G,K),ie({blockers:ve})}function ue(G){let{currentLocation:K,nextLocation:ne,historyAction:ve}=G;if(se.size===0)return;se.size>1&&Au(!1,"A router only supports one blocker at a time");let Qe=Array.from(se.entries()),[Fe,at]=Qe[Qe.length-1],rt=A.blockers.get(Fe);if(!(rt&&rt.state==="proceeding")&&at({currentLocation:K,nextLocation:ne,historyAction:ve}))return Fe}function Ee(G){let K=[];return W.forEach((ne,ve)=>{(!G||G(ve))&&(ne.cancel(),K.push(ve),W.delete(ve))}),K}function qe(G,K,ne){if(m=G,b=K,g=ne||null,!y&&A.navigation===M4){y=!0;let ve=Ve(A.location,A.matches);ve!=null&&ie({restoreScrollPosition:ve})}return()=>{m=null,b=null,g=null}}function j(G,K){return g&&g(G,K.map(ve=>Ome(ve,A.loaderData)))||G.key}function me(G,K){if(m&&b){let ne=j(G,K);m[ne]=b()}}function Ve(G,K){if(m){let ne=j(G,K),ve=m[ne];if(typeof ve=="number")return ve}return null}function ge(G){a={},s=Wy(G,i,void 0,a)}return w={get basename(){return u},get state(){return A},get routes(){return o},initialize:pe,subscribe:L,enableScrollRestoration:qe,navigate:X,fetch:We,revalidate:ke,createHref:G=>e.history.createHref(G),encodeLocation:G=>e.history.encodeLocation(G),getFetcher:Ze,deleteFetcher:de,dispose:le,getBlocker:ze,deleteBlocker:Ye,_internalFetchControllers:$,_internalActiveDeferreds:W,_internalSetRoutes:ge},w}function wme(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function qy(e,t,n,r,i,a,o){let s,u;if(a!=null&&o!=="path"){s=[];for(let p of t)if(s.push(p),p.route.id===a){u=p;break}}else s=t,u=t[t.length-1];let c=aB(i||".",vT(s).map(p=>p.pathnameBase),hf(e.pathname,n)||e.pathname,o==="path");return i==null&&(c.search=e.search,c.hash=e.hash),(i==null||i===""||i===".")&&u&&u.route.index&&!_T(c.search)&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(c.pathname=c.pathname==="/"?n:fl([n,c.pathname])),D2(c)}function LR(e,t,n,r){if(!r||!wme(r))return{path:n};if(r.formMethod&&!Nme(r.formMethod))return{path:n,error:oa(405,{method:r.formMethod})};let i=()=>({path:n,error:oa(400,{type:"invalid-body"})}),a=r.formMethod||"get",o=e?a.toUpperCase():a.toLowerCase(),s=dB(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Ba(o))return i();let m=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,b)=>{let[y,T]=b;return""+g+y+"="+T+` + */function Nn(){return Nn=Object.assign?Object.assign.bind():function(e){for(var t=1;tp(g,typeof g=="string"?null:g.state,b===0?"default":void 0));let a=u(n??i.length-1),o=Wn.Pop,s=null;function u(g){return Math.min(Math.max(g,0),i.length-1)}function c(){return i[a]}function p(g,b,y){b===void 0&&(b=null);let T=Vy(i?c().pathname:"/",g,b,y);return Au(T.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(g)),T}function f(g){return typeof g=="string"?g:D2(g)}return{get index(){return a},get action(){return o},get location(){return c()},createHref:f,createURL(g){return new URL(f(g),"http://localhost")},encodeLocation(g){let b=typeof g=="string"?Ro(g):g;return{pathname:b.pathname||"",search:b.search||"",hash:b.hash||""}},push(g,b){o=Wn.Push;let y=p(g,b);a+=1,i.splice(a,i.length,y),r&&s&&s({action:o,location:y,delta:1})},replace(g,b){o=Wn.Replace;let y=p(g,b);i[a]=y,r&&s&&s({action:o,location:y,delta:0})},go(g){o=Wn.Pop;let b=u(a+g),y=i[b];a=b,s&&s({action:o,location:y,delta:g})},listen(g){return s=g,()=>{s=null}}}}function $t(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Au(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Kge(){return Math.random().toString(36).substr(2,8)}function Vy(e,t,n,r){return n===void 0&&(n=null),Nn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ro(t):t,{state:n,key:t&&t.key||r||Kge()})}function D2(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ro(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var tr;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(tr||(tr={}));const Yge=new Set(["lazy","caseSensitive","path","id","index","children"]);function Xge(e){return e.index===!0}function Wy(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,a)=>{let o=[...n,a],s=typeof i.id=="string"?i.id:o.join("-");if($t(i.index!==!0||!i.children,"Cannot specify children on an index route"),$t(!r[s],'Found a route id collision on id "'+s+`". Route id's must be globally unique within Data Router usages`),Xge(i)){let u=Nn({},i,t(i),{id:s});return r[s]=u,u}else{let u=Nn({},i,t(i),{id:s,children:void 0});return r[s]=u,i.children&&(u.children=Wy(i.children,t,o,r)),u}})}function L1(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Ro(t):t,i=hf(r.pathname||"/",n);if(i==null)return null;let a=rB(e);Zge(a);let o=null;for(let s=0;o==null&&s{let u={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};u.relativePath.startsWith("/")&&($t(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=fl([r,u.relativePath]),p=n.concat(u);a.children&&a.children.length>0&&($t(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),rB(a.children,t,p,c)),!(a.path==null&&!a.index)&&t.push({path:c,score:ime(c,a.index),routesMeta:p})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let u of iB(a.path))i(a,o,u)}),t}function iB(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=iB(r.join("/")),s=[];return s.push(...o.map(u=>u===""?a:[a,u].join("/"))),i&&s.push(...o),s.map(u=>e.startsWith("/")&&u===""?"/":u)}function Zge(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ame(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Qge=/^:\w+$/,Jge=3,eme=2,tme=1,nme=10,rme=-2,DR=e=>e==="*";function ime(e,t){let n=e.split("/"),r=n.length;return n.some(DR)&&(r+=rme),t&&(r+=eme),n.filter(i=>!DR(i)).reduce((i,a)=>i+(Qge.test(a)?Jge:a===""?tme:nme),r)}function ame(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function ome(e,t){let{routesMeta:n}=e,r={},i="/",a=[];for(let o=0;o{if(p==="*"){let m=s[f]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}return c[p]=cme(s[f]||"",p),c},{}),pathname:a,pathnameBase:o,pattern:e}}function lme(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Au(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,s)=>(r.push(s),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function ume(e){try{return decodeURI(e)}catch(t){return Au(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function cme(e,t){try{return decodeURIComponent(e)}catch(n){return Au(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function hf(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function dme(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ro(e):e;return{pathname:n?n.startsWith("/")?n:pme(n,t):t,search:hme(r),hash:gme(i)}}function pme(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function L4(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function vT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function aB(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ro(e):(i=Nn({},e),$t(!i.pathname||!i.pathname.includes("?"),L4("?","pathname","search",i)),$t(!i.pathname||!i.pathname.includes("#"),L4("#","pathname","hash",i)),$t(!i.search||!i.search.includes("#"),L4("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(r||o==null)s=n;else{let f=t.length-1;if(o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),f-=1;i.pathname=m.join("/")}s=f>=0?t[f]:"/"}let u=dme(i,s),c=o&&o!=="/"&&o.endsWith("/"),p=(a||o===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||p)&&(u.pathname+="/"),u}const fl=e=>e.join("/").replace(/\/\/+/g,"/"),fme=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hme=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,gme=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class oB{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function sB(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const lB=["post","put","patch","delete"],mme=new Set(lB),bme=["get",...lB],yme=new Set(bme),Eme=new Set([301,302,303,307,308]),vme=new Set([307,308]),M4={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},_me={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fd={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},uB=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Tme=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function Sme(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;$t(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let G=e.detectErrorBoundary;i=K=>({hasErrorBoundary:G(K)})}else i=Tme;let a={},o=Wy(e.routes,i,void 0,a),s,u=e.basename||"/",c=Nn({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),p=null,f=new Set,m=null,g=null,b=null,y=e.hydrationData!=null,T=L1(o,e.history.location,u),E=null;if(T==null){let G=oa(404,{pathname:e.history.location.pathname}),{matches:K,route:ne}=zR(o);T=K,E={[ne.id]:G}}let v=!T.some(G=>G.route.lazy)&&(!T.some(G=>G.route.loader)||e.hydrationData!=null),w,A={historyAction:e.history.action,location:e.history.location,matches:T,initialized:v,navigation:M4,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},R=Wn.Pop,k=!1,N,B=!1,q=!1,P=[],Q=[],$=new Map,oe=0,fe=-1,ce=new Map,De=new Set,H=new Map,W=new Map,se=new Map,D=!1;function pe(){return p=e.history.listen(G=>{let{action:K,location:ne,delta:ve}=G;if(D){D=!1;return}Au(se.size===0||ve!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Qe=ue({currentLocation:A.location,nextLocation:ne,historyAction:K});if(Qe&&ve!=null){D=!0,e.history.go(ve*-1),jt(Qe,{state:"blocked",location:ne,proceed(){jt(Qe,{state:"proceeding",proceed:void 0,reset:void 0,location:ne}),e.history.go(ve)},reset(){let Fe=new Map(A.blockers);Fe.set(Qe,fd),ie({blockers:Fe})}});return}return te(K,ne)}),A.initialized||te(Wn.Pop,A.location),w}function le(){p&&p(),f.clear(),N&&N.abort(),A.fetchers.forEach((G,K)=>de(K)),A.blockers.forEach((G,K)=>Xe(K))}function L(G){return f.add(G),()=>f.delete(G)}function ie(G){A=Nn({},A,G),f.forEach(K=>K(A))}function Se(G,K){var ne,ve;let Qe=A.actionData!=null&&A.navigation.formMethod!=null&&Ba(A.navigation.formMethod)&&A.navigation.state==="loading"&&((ne=G.state)==null?void 0:ne._isRedirect)!==!0,Fe;K.actionData?Object.keys(K.actionData).length>0?Fe=K.actionData:Fe=null:Qe?Fe=A.actionData:Fe=null;let at=K.loaderData?$R(A.loaderData,K.loaderData,K.matches||[],K.errors):A.loaderData,rt=A.blockers;rt.size>0&&(rt=new Map(rt),rt.forEach((Rt,Qt)=>rt.set(Qt,fd)));let Je=k===!0||A.navigation.formMethod!=null&&Ba(A.navigation.formMethod)&&((ve=G.state)==null?void 0:ve._isRedirect)!==!0;s&&(o=s,s=void 0),B||R===Wn.Pop||(R===Wn.Push?e.history.push(G,G.state):R===Wn.Replace&&e.history.replace(G,G.state)),ie(Nn({},K,{actionData:Fe,loaderData:at,historyAction:R,location:G,initialized:!0,navigation:M4,revalidation:"idle",restoreScrollPosition:Ve(G,K.matches||A.matches),preventScrollReset:Je,blockers:rt})),R=Wn.Pop,k=!1,B=!1,q=!1,P=[],Q=[]}async function X(G,K){if(typeof G=="number"){e.history.go(G);return}let ne=qy(A.location,A.matches,u,c.v7_prependBasename,G,K==null?void 0:K.fromRouteId,K==null?void 0:K.relative),{path:ve,submission:Qe,error:Fe}=LR(c.v7_normalizeFormMethod,!1,ne,K),at=A.location,rt=Vy(A.location,ve,K&&K.state);rt=Nn({},rt,e.history.encodeLocation(rt));let Je=K&&K.replace!=null?K.replace:void 0,Rt=Wn.Push;Je===!0?Rt=Wn.Replace:Je===!1||Qe!=null&&Ba(Qe.formMethod)&&Qe.formAction===A.location.pathname+A.location.search&&(Rt=Wn.Replace);let Qt=K&&"preventScrollReset"in K?K.preventScrollReset===!0:void 0,kt=ue({currentLocation:at,nextLocation:rt,historyAction:Rt});if(kt){jt(kt,{state:"blocked",location:rt,proceed(){jt(kt,{state:"proceeding",proceed:void 0,reset:void 0,location:rt}),X(G,K)},reset(){let rn=new Map(A.blockers);rn.set(kt,fd),ie({blockers:rn})}});return}return await te(Rt,rt,{submission:Qe,pendingError:Fe,preventScrollReset:Qt,replace:K&&K.replace})}function ke(){if(U(),ie({revalidation:"loading"}),A.navigation.state!=="submitting"){if(A.navigation.state==="idle"){te(A.historyAction,A.location,{startUninterruptedRevalidation:!0});return}te(R||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation})}}async function te(G,K,ne){N&&N.abort(),N=null,R=G,B=(ne&&ne.startUninterruptedRevalidation)===!0,me(A.location,A.matches),k=(ne&&ne.preventScrollReset)===!0;let ve=s||o,Qe=ne&&ne.overrideNavigation,Fe=L1(ve,K,u);if(!Fe){let rn=oa(404,{pathname:K.pathname}),{matches:Xt,route:Wr}=zR(ve);Ee(),Se(K,{matches:Xt,loaderData:{},errors:{[Wr.id]:rn}});return}if(A.initialized&&!q&&xme(A.location,K)&&!(ne&&ne.submission&&Ba(ne.submission.formMethod))){Se(K,{matches:Fe});return}N=new AbortController;let at=gd(e.history,K,N.signal,ne&&ne.submission),rt,Je;if(ne&&ne.pendingError)Je={[M1(Fe).route.id]:ne.pendingError};else if(ne&&ne.submission&&Ba(ne.submission.formMethod)){let rn=await Me(at,K,ne.submission,Fe,{replace:ne.replace});if(rn.shortCircuited)return;rt=rn.pendingActionData,Je=rn.pendingActionError,Qe=ah(K,ne.submission),at=new Request(at.url,{signal:at.signal})}let{shortCircuited:Rt,loaderData:Qt,errors:kt}=await Re(at,K,Fe,Qe,ne&&ne.submission,ne&&ne.fetcherSubmission,ne&&ne.replace,rt,Je);Rt||(N=null,Se(K,Nn({matches:Fe},rt?{actionData:rt}:{},{loaderData:Qt,errors:kt})))}async function Me(G,K,ne,ve,Qe){Qe===void 0&&(Qe={}),U();let Fe=Dme(K,ne);ie({navigation:Fe});let at,rt=Yy(ve,K);if(!rt.route.action&&!rt.route.lazy)at={type:tr.error,error:oa(405,{method:G.method,pathname:K.pathname,routeId:rt.route.id})};else if(at=await hd("action",G,rt,ve,a,i,u),G.signal.aborted)return{shortCircuited:!0};if(K1(at)){let Je;return Qe&&Qe.replace!=null?Je=Qe.replace:Je=at.location===A.location.pathname+A.location.search,await je(A,at,{submission:ne,replace:Je}),{shortCircuited:!0}}if(tp(at)){let Je=M1(ve,rt.route.id);return(Qe&&Qe.replace)!==!0&&(R=Wn.Push),{pendingActionData:{},pendingActionError:{[Je.route.id]:at.error}}}if(su(at))throw oa(400,{type:"defer-action"});return{pendingActionData:{[rt.route.id]:at.data}}}async function Re(G,K,ne,ve,Qe,Fe,at,rt,Je){let Rt=ve||ah(K,Qe),Qt=Qe||Fe||GR(Rt),kt=s||o,[rn,Xt]=MR(e.history,A,ne,Qt,K,q,P,Q,H,De,kt,u,rt,Je);if(Ee(qt=>!(ne&&ne.some(Dr=>Dr.route.id===qt))||rn&&rn.some(Dr=>Dr.route.id===qt)),fe=++oe,rn.length===0&&Xt.length===0){let qt=Te();return Se(K,Nn({matches:ne,loaderData:{},errors:Je||null},rt?{actionData:rt}:{},qt?{fetchers:new Map(A.fetchers)}:{})),{shortCircuited:!0}}if(!B){Xt.forEach(Dr=>{let Si=A.fetchers.get(Dr.key),Nl=md(void 0,Si?Si.data:void 0);A.fetchers.set(Dr.key,Nl)});let qt=rt||A.actionData;ie(Nn({navigation:Rt},qt?Object.keys(qt).length===0?{actionData:null}:{actionData:qt}:{},Xt.length>0?{fetchers:new Map(A.fetchers)}:{}))}Xt.forEach(qt=>{$.has(qt.key)&&xe(qt.key),qt.controller&&$.set(qt.key,qt.controller)});let Wr=()=>Xt.forEach(qt=>xe(qt.key));N&&N.signal.addEventListener("abort",Wr);let{results:qr,loaderResults:Kr,fetcherResults:Aa}=await pt(A.matches,ne,rn,Xt,G);if(G.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",Wr),Xt.forEach(qt=>$.delete(qt.key));let si=HR(qr);if(si){if(si.idx>=rn.length){let qt=Xt[si.idx-rn.length].key;De.add(qt)}return await je(A,si.result,{replace:at}),{shortCircuited:!0}}let{loaderData:Or,errors:Es}=UR(A,ne,rn,Kr,Je,Xt,Aa,W);W.forEach((qt,Dr)=>{qt.subscribe(Si=>{(Si||qt.done)&&W.delete(Dr)})});let vs=Te(),Yr=Le(fe),_s=vs||Yr||Xt.length>0;return Nn({loaderData:Or,errors:Es},_s?{fetchers:new Map(A.fetchers)}:{})}function Ye(G){return A.fetchers.get(G)||_me}function We(G,K,ne,ve){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");$.has(G)&&xe(G);let Qe=s||o,Fe=qy(A.location,A.matches,u,c.v7_prependBasename,ne,K,ve==null?void 0:ve.relative),at=L1(Qe,Fe,u);if(!at){re(G,K,oa(404,{pathname:Fe}));return}let{path:rt,submission:Je,error:Rt}=LR(c.v7_normalizeFormMethod,!0,Fe,ve);if(Rt){re(G,K,Rt);return}let Qt=Yy(at,rt);if(k=(ve&&ve.preventScrollReset)===!0,Je&&Ba(Je.formMethod)){dt(G,K,rt,Qt,at,Je);return}H.set(G,{routeId:K,path:rt}),ot(G,K,rt,Qt,at,Je)}async function dt(G,K,ne,ve,Qe,Fe){if(U(),H.delete(G),!ve.route.action&&!ve.route.lazy){let Ke=oa(405,{method:Fe.formMethod,pathname:ne,routeId:K});re(G,K,Ke);return}let at=A.fetchers.get(G),rt=Lme(Fe,at);A.fetchers.set(G,rt),ie({fetchers:new Map(A.fetchers)});let Je=new AbortController,Rt=gd(e.history,ne,Je.signal,Fe);$.set(G,Je);let Qt=oe,kt=await hd("action",Rt,ve,Qe,a,i,u);if(Rt.signal.aborted){$.get(G)===Je&&$.delete(G);return}if(K1(kt))if($.delete(G),fe>Qt){let Ke=d1(void 0);A.fetchers.set(G,Ke),ie({fetchers:new Map(A.fetchers)});return}else{De.add(G);let Ke=md(Fe);return A.fetchers.set(G,Ke),ie({fetchers:new Map(A.fetchers)}),je(A,kt,{submission:Fe,isFetchActionRedirect:!0})}if(tp(kt)){re(G,K,kt.error);return}if(su(kt))throw oa(400,{type:"defer-action"});let rn=A.navigation.location||A.location,Xt=gd(e.history,rn,Je.signal),Wr=s||o,qr=A.navigation.state!=="idle"?L1(Wr,A.navigation.location,u):A.matches;$t(qr,"Didn't find any matches after fetcher action");let Kr=++oe;ce.set(G,Kr);let Aa=md(Fe,kt.data);A.fetchers.set(G,Aa);let[si,Or]=MR(e.history,A,qr,Fe,rn,q,P,Q,H,De,Wr,u,{[ve.route.id]:kt.data},void 0);Or.filter(Ke=>Ke.key!==G).forEach(Ke=>{let J=Ke.key,Be=A.fetchers.get(J),it=md(void 0,Be?Be.data:void 0);A.fetchers.set(J,it),$.has(J)&&xe(J),Ke.controller&&$.set(J,Ke.controller)}),ie({fetchers:new Map(A.fetchers)});let Es=()=>Or.forEach(Ke=>xe(Ke.key));Je.signal.addEventListener("abort",Es);let{results:vs,loaderResults:Yr,fetcherResults:_s}=await pt(A.matches,qr,si,Or,Xt);if(Je.signal.aborted)return;Je.signal.removeEventListener("abort",Es),ce.delete(G),$.delete(G),Or.forEach(Ke=>$.delete(Ke.key));let qt=HR(vs);if(qt){if(qt.idx>=si.length){let Ke=Or[qt.idx-si.length].key;De.add(Ke)}return je(A,qt.result)}let{loaderData:Dr,errors:Si}=UR(A,A.matches,si,Yr,void 0,Or,_s,W);if(A.fetchers.has(G)){let Ke=d1(kt.data);A.fetchers.set(G,Ke)}let Nl=Le(Kr);A.navigation.state==="loading"&&Kr>fe?($t(R,"Expected pending action"),N&&N.abort(),Se(A.navigation.location,{matches:qr,loaderData:Dr,errors:Si,fetchers:new Map(A.fetchers)})):(ie(Nn({errors:Si,loaderData:$R(A.loaderData,Dr,qr,Si)},Nl||Or.length>0?{fetchers:new Map(A.fetchers)}:{})),q=!1)}async function ot(G,K,ne,ve,Qe,Fe){let at=A.fetchers.get(G),rt=md(Fe,at?at.data:void 0);A.fetchers.set(G,rt),ie({fetchers:new Map(A.fetchers)});let Je=new AbortController,Rt=gd(e.history,ne,Je.signal);$.set(G,Je);let Qt=oe,kt=await hd("loader",Rt,ve,Qe,a,i,u);if(su(kt)&&(kt=await pB(kt,Rt.signal,!0)||kt),$.get(G)===Je&&$.delete(G),Rt.signal.aborted)return;if(K1(kt))if(fe>Qt){let Xt=d1(void 0);A.fetchers.set(G,Xt),ie({fetchers:new Map(A.fetchers)});return}else{De.add(G),await je(A,kt);return}if(tp(kt)){let Xt=M1(A.matches,K);A.fetchers.delete(G),ie({fetchers:new Map(A.fetchers),errors:{[Xt.route.id]:kt.error}});return}$t(!su(kt),"Unhandled fetcher deferred data");let rn=d1(kt.data);A.fetchers.set(G,rn),ie({fetchers:new Map(A.fetchers)})}async function je(G,K,ne){let{submission:ve,replace:Qe,isFetchActionRedirect:Fe}=ne===void 0?{}:ne;K.revalidate&&(q=!0);let at=Vy(G.location,K.location,Nn({_isRedirect:!0},Fe?{_isFetchActionRedirect:!0}:{}));if($t(at,"Expected a location on the redirect navigation"),uB.test(K.location)&&n){let Rt=e.history.createURL(K.location),Qt=hf(Rt.pathname,u)==null;if(t.location.origin!==Rt.origin||Qt){Qe?t.location.replace(K.location):t.location.assign(K.location);return}}N=null;let rt=Qe===!0?Wn.Replace:Wn.Push,Je=ve||GR(G.navigation);if(vme.has(K.status)&&Je&&Ba(Je.formMethod))await te(rt,at,{submission:Nn({},Je,{formAction:K.location}),preventScrollReset:k});else if(Fe)await te(rt,at,{overrideNavigation:ah(at),fetcherSubmission:Je,preventScrollReset:k});else{let Rt=ah(at,Je);await te(rt,at,{overrideNavigation:Rt,preventScrollReset:k})}}async function pt(G,K,ne,ve,Qe){let Fe=await Promise.all([...ne.map(Je=>hd("loader",Qe,Je,K,a,i,u)),...ve.map(Je=>Je.matches&&Je.match&&Je.controller?hd("loader",gd(e.history,Je.path,Je.controller.signal),Je.match,Je.matches,a,i,u):{type:tr.error,error:oa(404,{pathname:Je.path})})]),at=Fe.slice(0,ne.length),rt=Fe.slice(ne.length);return await Promise.all([jR(G,ne,at,at.map(()=>Qe.signal),!1,A.loaderData),jR(G,ve.map(Je=>Je.match),rt,ve.map(Je=>Je.controller?Je.controller.signal:null),!0)]),{results:Fe,loaderResults:at,fetcherResults:rt}}function U(){q=!0,P.push(...Ee()),H.forEach((G,K)=>{$.has(K)&&(Q.push(K),xe(K))})}function re(G,K,ne){let ve=M1(A.matches,K);de(G),ie({errors:{[ve.route.id]:ne},fetchers:new Map(A.fetchers)})}function de(G){let K=A.fetchers.get(G);$.has(G)&&!(K&&K.state==="loading"&&ce.has(G))&&xe(G),H.delete(G),ce.delete(G),De.delete(G),A.fetchers.delete(G)}function xe(G){let K=$.get(G);$t(K,"Expected fetch controller: "+G),K.abort(),$.delete(G)}function ye(G){for(let K of G){let ne=Ye(K),ve=d1(ne.data);A.fetchers.set(K,ve)}}function Te(){let G=[],K=!1;for(let ne of De){let ve=A.fetchers.get(ne);$t(ve,"Expected fetcher: "+ne),ve.state==="loading"&&(De.delete(ne),G.push(ne),K=!0)}return ye(G),K}function Le(G){let K=[];for(let[ne,ve]of ce)if(ve0}function ze(G,K){let ne=A.blockers.get(G)||fd;return se.get(G)!==K&&se.set(G,K),ne}function Xe(G){A.blockers.delete(G),se.delete(G)}function jt(G,K){let ne=A.blockers.get(G)||fd;$t(ne.state==="unblocked"&&K.state==="blocked"||ne.state==="blocked"&&K.state==="blocked"||ne.state==="blocked"&&K.state==="proceeding"||ne.state==="blocked"&&K.state==="unblocked"||ne.state==="proceeding"&&K.state==="unblocked","Invalid blocker state transition: "+ne.state+" -> "+K.state);let ve=new Map(A.blockers);ve.set(G,K),ie({blockers:ve})}function ue(G){let{currentLocation:K,nextLocation:ne,historyAction:ve}=G;if(se.size===0)return;se.size>1&&Au(!1,"A router only supports one blocker at a time");let Qe=Array.from(se.entries()),[Fe,at]=Qe[Qe.length-1],rt=A.blockers.get(Fe);if(!(rt&&rt.state==="proceeding")&&at({currentLocation:K,nextLocation:ne,historyAction:ve}))return Fe}function Ee(G){let K=[];return W.forEach((ne,ve)=>{(!G||G(ve))&&(ne.cancel(),K.push(ve),W.delete(ve))}),K}function qe(G,K,ne){if(m=G,b=K,g=ne||null,!y&&A.navigation===M4){y=!0;let ve=Ve(A.location,A.matches);ve!=null&&ie({restoreScrollPosition:ve})}return()=>{m=null,b=null,g=null}}function j(G,K){return g&&g(G,K.map(ve=>Ome(ve,A.loaderData)))||G.key}function me(G,K){if(m&&b){let ne=j(G,K);m[ne]=b()}}function Ve(G,K){if(m){let ne=j(G,K),ve=m[ne];if(typeof ve=="number")return ve}return null}function ge(G){a={},s=Wy(G,i,void 0,a)}return w={get basename(){return u},get state(){return A},get routes(){return o},initialize:pe,subscribe:L,enableScrollRestoration:qe,navigate:X,fetch:We,revalidate:ke,createHref:G=>e.history.createHref(G),encodeLocation:G=>e.history.encodeLocation(G),getFetcher:Ye,deleteFetcher:de,dispose:le,getBlocker:ze,deleteBlocker:Xe,_internalFetchControllers:$,_internalActiveDeferreds:W,_internalSetRoutes:ge},w}function wme(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function qy(e,t,n,r,i,a,o){let s,u;if(a!=null&&o!=="path"){s=[];for(let p of t)if(s.push(p),p.route.id===a){u=p;break}}else s=t,u=t[t.length-1];let c=aB(i||".",vT(s).map(p=>p.pathnameBase),hf(e.pathname,n)||e.pathname,o==="path");return i==null&&(c.search=e.search,c.hash=e.hash),(i==null||i===""||i===".")&&u&&u.route.index&&!_T(c.search)&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(c.pathname=c.pathname==="/"?n:fl([n,c.pathname])),D2(c)}function LR(e,t,n,r){if(!r||!wme(r))return{path:n};if(r.formMethod&&!Nme(r.formMethod))return{path:n,error:oa(405,{method:r.formMethod})};let i=()=>({path:n,error:oa(400,{type:"invalid-body"})}),a=r.formMethod||"get",o=e?a.toUpperCase():a.toLowerCase(),s=dB(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Ba(o))return i();let m=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,b)=>{let[y,T]=b;return""+g+y+"="+T+` `},""):String(r.body);return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:void 0,text:m}}}else if(r.formEncType==="application/json"){if(!Ba(o))return i();try{let m=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:o,formAction:s,formEncType:r.formEncType,formData:void 0,json:m,text:void 0}}}catch{return i()}}}$t(typeof FormData=="function","FormData is not available in this environment");let u,c;if(r.formData)u=Ky(r.formData),c=r.formData;else if(r.body instanceof FormData)u=Ky(r.body),c=r.body;else if(r.body instanceof URLSearchParams)u=r.body,c=BR(u);else if(r.body==null)u=new URLSearchParams,c=new FormData;else try{u=new URLSearchParams(r.body),c=BR(u)}catch{return i()}let p={formMethod:o,formAction:s,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(Ba(p.formMethod))return{path:n,submission:p};let f=Ro(n);return t&&f.search&&_T(f.search)&&u.append("index",""),f.search="?"+u,{path:D2(f),submission:p}}function Ame(e,t){let n=e;if(t){let r=e.findIndex(i=>i.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function MR(e,t,n,r,i,a,o,s,u,c,p,f,m,g){let b=g?Object.values(g)[0]:m?Object.values(m)[0]:void 0,y=e.createURL(t.location),T=e.createURL(i),E=g?Object.keys(g)[0]:void 0,w=Ame(n,E).filter((R,k)=>{if(R.route.lazy)return!0;if(R.route.loader==null)return!1;if(Cme(t.loaderData,t.matches[k],R)||o.some(q=>q===R.route.id))return!0;let N=t.matches[k],B=R;return FR(R,Nn({currentUrl:y,currentParams:N.params,nextUrl:T,nextParams:B.params},r,{actionResult:b,defaultShouldRevalidate:a||y.pathname+y.search===T.pathname+T.search||y.search!==T.search||cB(N,B)}))}),A=[];return u.forEach((R,k)=>{if(!n.some(Q=>Q.route.id===R.routeId))return;let N=L1(p,R.path,f);if(!N){A.push({key:k,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let B=t.fetchers.get(k),q=Yy(N,R.path),P=!1;c.has(k)?P=!1:s.includes(k)?P=!0:B&&B.state!=="idle"&&B.data===void 0?P=a:P=FR(q,Nn({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:T,nextParams:n[n.length-1].params},r,{actionResult:b,defaultShouldRevalidate:a})),P&&A.push({key:k,routeId:R.routeId,path:R.path,matches:N,match:q,controller:new AbortController})}),[w,A]}function Cme(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function cB(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function FR(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function PR(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];$t(i,"No route found in manifest");let a={};for(let o in r){let u=i[o]!==void 0&&o!=="hasErrorBoundary";Au(!u,'Route "'+i.id+'" has a static property "'+o+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+o+'" will be ignored.')),!u&&!Yge.has(o)&&(a[o]=r[o])}Object.assign(i,a),Object.assign(i,Nn({},t(i),{lazy:void 0}))}async function hd(e,t,n,r,i,a,o,s){s===void 0&&(s={});let u,c,p,f=b=>{let y,T=new Promise((E,v)=>y=v);return p=()=>y(),t.signal.addEventListener("abort",p),Promise.race([b({request:t,params:n.params,context:s.requestContext}),T])};try{let b=n.route[e];if(n.route.lazy)if(b)c=(await Promise.all([f(b),PR(n.route,a,i)]))[0];else if(await PR(n.route,a,i),b=n.route[e],b)c=await f(b);else if(e==="action"){let y=new URL(t.url),T=y.pathname+y.search;throw oa(405,{method:t.method,pathname:T,routeId:n.route.id})}else return{type:tr.data,data:void 0};else if(b)c=await f(b);else{let y=new URL(t.url),T=y.pathname+y.search;throw oa(404,{pathname:T})}$t(c!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(b){u=tr.error,c=b}finally{p&&t.signal.removeEventListener("abort",p)}if(Rme(c)){let b=c.status;if(Eme.has(b)){let E=c.headers.get("Location");if($t(E,"Redirects returned/thrown from loaders/actions must have a Location header"),!uB.test(E))E=qy(new URL(t.url),r.slice(0,r.indexOf(n)+1),o,!0,E);else if(!s.isStaticRequest){let v=new URL(t.url),w=E.startsWith("//")?new URL(v.protocol+E):new URL(E),A=hf(w.pathname,o)!=null;w.origin===v.origin&&A&&(E=w.pathname+w.search+w.hash)}if(s.isStaticRequest)throw c.headers.set("Location",E),c;return{type:tr.redirect,status:b,location:E,revalidate:c.headers.get("X-Remix-Revalidate")!==null}}if(s.isRouteRequest)throw{type:u||tr.data,response:c};let y,T=c.headers.get("Content-Type");return T&&/\bapplication\/json\b/.test(T)?y=await c.json():y=await c.text(),u===tr.error?{type:u,error:new oB(b,c.statusText,y),headers:c.headers}:{type:tr.data,data:y,statusCode:c.status,headers:c.headers}}if(u===tr.error)return{type:u,error:c};if(Ime(c)){var m,g;return{type:tr.deferred,deferredData:c,statusCode:(m=c.init)==null?void 0:m.status,headers:((g=c.init)==null?void 0:g.headers)&&new Headers(c.init.headers)}}return{type:tr.data,data:c}}function gd(e,t,n,r){let i=e.createURL(dB(t)).toString(),a={signal:n};if(r&&Ba(r.formMethod)){let{formMethod:o,formEncType:s}=r;a.method=o.toUpperCase(),s==="application/json"?(a.headers=new Headers({"Content-Type":s}),a.body=JSON.stringify(r.json)):s==="text/plain"?a.body=r.text:s==="application/x-www-form-urlencoded"&&r.formData?a.body=Ky(r.formData):a.body=r.formData}return new Request(i,a)}function Ky(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function BR(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function kme(e,t,n,r,i){let a={},o=null,s,u=!1,c={};return n.forEach((p,f)=>{let m=t[f].route.id;if($t(!K1(p),"Cannot handle redirect results in processLoaderData"),tp(p)){let g=M1(e,m),b=p.error;r&&(b=Object.values(r)[0],r=void 0),o=o||{},o[g.route.id]==null&&(o[g.route.id]=b),a[m]=void 0,u||(u=!0,s=sB(p.error)?p.error.status:500),p.headers&&(c[m]=p.headers)}else su(p)?(i.set(m,p.deferredData),a[m]=p.deferredData.data):a[m]=p.data,p.statusCode!=null&&p.statusCode!==200&&!u&&(s=p.statusCode),p.headers&&(c[m]=p.headers)}),r&&(o=r,a[Object.keys(r)[0]]=void 0),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:c}}function UR(e,t,n,r,i,a,o,s){let{loaderData:u,errors:c}=kme(t,n,r,i,s);for(let p=0;pr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function zR(e){let t=e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function oa(e,t){let{pathname:n,routeId:r,method:i,type:a}=t===void 0?{}:t,o="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(o="Bad Request",i&&n&&r?s="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":a==="defer-action"?s="defer() is not supported in actions":a==="invalid-body"&&(s="Unable to encode submission body")):e===403?(o="Forbidden",s='Route "'+r+'" does not match URL "'+n+'"'):e===404?(o="Not Found",s='No route matches URL "'+n+'"'):e===405&&(o="Method Not Allowed",i&&n&&r?s="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(s='Invalid request method "'+i.toUpperCase()+'"')),new oB(e||500,o,new Error(s),!0)}function HR(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(K1(n))return{result:n,idx:t}}}function dB(e){let t=typeof e=="string"?Ro(e):e;return D2(Nn({},t,{hash:""}))}function xme(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function su(e){return e.type===tr.deferred}function tp(e){return e.type===tr.error}function K1(e){return(e&&e.type)===tr.redirect}function Ime(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Rme(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Nme(e){return yme.has(e.toLowerCase())}function Ba(e){return mme.has(e.toLowerCase())}async function jR(e,t,n,r,i,a){for(let o=0;of.route.id===u.route.id),p=c!=null&&!cB(c,u)&&(a&&a[u.route.id])!==void 0;if(su(s)&&(i||p)){let f=r[o];$t(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await pB(s,f,i).then(m=>{m&&(n[o]=m||n[o])})}}}async function pB(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:tr.data,data:e.deferredData.unwrappedData}}catch(i){return{type:tr.error,error:i}}return{type:tr.data,data:e.deferredData.data}}}function _T(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ome(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function Yy(e,t){let n=typeof t=="string"?Ro(t).search:t.search;if(e[e.length-1].route.index&&_T(n||""))return e[e.length-1];let r=vT(e);return r[r.length-1]}function GR(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function ah(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Dme(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function md(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t," _hasFetcherDoneAnything ":!0}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t," _hasFetcherDoneAnything ":!0}}function Lme(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0," _hasFetcherDoneAnything ":!0}}function d1(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e," _hasFetcherDoneAnything ":!0}}/** * React Router v6.14.2 * @@ -755,7 +755,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho top: 0; z-index: 100; background-color: ${Ht}; -`;function l2e({error:e,resetErrorBoundary:t}){return I.jsxs("div",{role:"alert",children:[I.jsx("p",{children:"Something went wrong:"}),I.jsx("pre",{style:{color:"red"},children:e.message}),I.jsx(oc,{onClick:t,children:"Restart"})]})}function qR(e){var ce,De;const t=C.useContext(to),n=Bge(),r=eo(),i=No(),a=zt(H=>H.sessionState),o=zt(H=>{var W;return(W=H.serverState.config.models)==null?void 0:W.default}),s=zt(H=>H.misc.serverStatusMessage),u=zt(H=>H.sessionState.title),c=zt(H=>H.sessionState.active),[p,f]=C.useState(!1),[m,g]=C.useState([]);C.useState(!0);const[b,y]=C.useState(!1);C.useEffect(()=>{setTimeout(()=>{y(!0)},5e3)},[]);const T=C.useRef(null),E=C.useRef(null),v=C.useRef(null),w=zt(H=>H.uiState.bottomMessage),A=zt(H=>H.misc.takenAction);C.useEffect(()=>{v.current&&r(W0e(v.current.getBoundingClientRect().top{var W;const H=()=>{var L,ie;const D=((L=E.current)==null?void 0:L.scrollTop)||0,pe=((ie=E.current)==null?void 0:ie.scrollHeight)||0,le=window.innerHeight||0;D+le+-25>=pe?k(!1):k(!0)};return(W=E.current)==null||W.addEventListener("scroll",H),()=>{window.removeEventListener("scroll",H)}},[E.current]),C.useLayoutEffect(()=>{var H,W;R||(W=E.current)==null||W.scrollTo({top:(H=E.current)==null?void 0:H.scrollHeight,behavior:"instant"})},[(ce=E.current)==null?void 0:ce.scrollHeight,a.history]),C.useEffect(()=>{const H=W=>{W.key==="Backspace"&&xg(W)&&!W.shiftKey?(t==null||t.stopSession(),r(Zd(!1))):W.key==="Escape"&&r(pu(void 0))};return window.addEventListener("keydown",H),()=>{window.removeEventListener("keydown",H)}},[t,c]);const N=C.useCallback(H=>{if((o==null?void 0:o.class_name)==="OpenAIFreeTrial"&&(o==null?void 0:o.api_key)===""&&(!H.startsWith("/")||H.startsWith("/edit"))){const pe=localStorage.getItem("ftc");if(pe){const le=parseInt(pe);if(localStorage.setItem("ftc",(le+1).toString()),le>=250){console.log(o,"FTC"),r(cc(!0)),r(C4(I.jsx(r2e,{}))),n==null||n.capture("ftc_reached");return}}else localStorage.setItem("ftc","1")}f(!0);const W=[...a.history,{name:"User Input",description:H,observations:[],logs:[],step_type:"UserInputStep",params:{user_input:H},hide:!1,depth:0}],se={history:W,context_items:a.context_items};for(let pe of a.context_items)r(SP({item:pe,index:W.length-1}));t.runFromState(se),W.push({name:"Generating Response...",description:" ",observations:[],logs:[],step_type:"SimpleChatStep",params:{},hide:!1,depth:0}),r(KI(W)),r(Zd(!0));const D=localStorage.getItem("mainTextEntryCounter");if(D){let pe=parseInt(D);localStorage.setItem("mainTextEntryCounter",(pe+1).toString()),pe===300&&(r(C4(I.jsxs("div",{className:"text-center p-4",children:["👋 Thanks for using Continue. We are a beta product and love working closely with our first users. If you're interested in speaking, enter your name and email. We won't use this information for anything other than reaching out.",I.jsx("br",{}),I.jsx("br",{}),I.jsxs("form",{onSubmit:le=>{le.preventDefault(),n==null||n.capture("user_interest_form",{name:le.target.elements[0].value,email:le.target.elements[1].value}),r(C4(I.jsx("div",{className:"text-center p-4",children:"Thanks! We'll be in touch soon."})))},style:{display:"flex",flexDirection:"column",gap:"10px"},children:[I.jsx("input",{style:{padding:"10px",borderRadius:"5px"},type:"text",name:"name",placeholder:"Name",required:!0}),I.jsx("input",{style:{padding:"10px",borderRadius:"5px"},type:"email",name:"email",placeholder:"Email",required:!0}),I.jsx("button",{style:{padding:"10px",borderRadius:"5px",cursor:"pointer"},type:"submit",children:"Submit"})]})]}))),r(V0e(!1)),r(cc(!0)))}else localStorage.setItem("mainTextEntryCounter","1")},[t,a.history,a.context_items,o]);C.useEffect(()=>{const H=W=>{W.data.type==="userInput"&&N(W.data.input)};return window.addEventListener("message",H),()=>window.removeEventListener("message",H)},[N]);const B=H=>{if(r(Ad(null)),T.current&&t){let W=T.current.inputValue;if(W.trim()==="")return;if(W.startsWith("#")&&(W.length===7||W.length===4)){localStorage.setItem("continueButtonColor",W),T.current.setInputValue("");return}H&&xg(H)&&(W=`/edit ${W}`),T.current.setInputValue(""),N(W)}},q=(H,W)=>{t&&t.sendStepUserInput(H,W)},P=C.useCallback(H=>{let W=!1;for(let se=H+1;se{const W=[];let se=-1;for(let D=H;D>=0;D--)if(typeof a.history[D]<"u"&&a.history[D].name==="User Input"&&a.history[D].hide===!1){W.push(D),se=D;break}if(W.length===0)return[];for(let D=se+1;D{const W=Q(H),se=W[0];g(D=>{const pe=[...D];return pe[H]=!pe[H],!W.some((L,ie)=>ie>0&&pe[L])?pe[se]=!1:!W.some((ie,Se)=>Se>0&&!pe[ie])&&(pe[se]=!0),pe})},[Q]);C.useEffect(()=>{u&&fe(u)},[u]);const[oe,fe]=C.useState(u||"New Session");return I.jsxs(i2e,{ref:E,onKeyDown:H=>{H.key==="Enter"&&H.ctrlKey&&B()},children:[I.jsxs(s2e,{children:[I.jsx(a2e,{onClick:H=>{H.target.setSelectionRange(0,H.target.value.length)},value:oe,onChange:H=>fe(H.target.value),onBlur:H=>{H.target.value===u||typeof u>"u"&&H.target.value==="New Session"||r(wP(H.target.value))},onKeyDown:H=>{H.key==="Enter"?(H.preventDefault(),H.target.blur()):H.key==="Escape"&&(fe(u||"New Session"),H.target.blur())}}),I.jsxs("div",{className:"flex gap-2",children:[I.jsx(zi,{onClick:()=>{t==null||t.stopSession(),r(uc())},text:"New Session (⌥⌘N)",children:I.jsx(CL,{width:"1.4em",height:"1.4em"})}),I.jsx(zi,{onClick:()=>{i("/history")},text:"History",children:I.jsx(OZ,{width:"1.4em",height:"1.4em"})})]})]}),A&&b&&typeof t>"u"&&I.jsxs(I.Fragment,{children:[I.jsx(zge,{}),I.jsx("p",{style:{textAlign:"center",margin:"0px",fontSize:"14px"},children:s}),I.jsxs("div",{className:"flex mx-8 my-2",children:[I.jsx("p",{style:{margin:"auto",textAlign:"center",marginTop:"4px",fontSize:"12px",cursor:"pointer",opacity:.7},children:I.jsx("u",{children:I.jsx("a",{style:{color:"inherit"},href:"https://continue.dev/docs/troubleshooting",target:"_blank",children:"Troubleshooting help"})})}),I.jsx("p",{style:{margin:"auto",textAlign:"center",marginTop:"4px",fontSize:"12px",cursor:"pointer",opacity:.7},onClick:()=>{qa("toggleDevTools",{})},children:I.jsx("u",{children:"View logs"})}),I.jsx("p",{style:{margin:"auto",textAlign:"center",marginTop:"4px",fontSize:"12px",cursor:"pointer",opacity:.7},children:I.jsx("u",{children:I.jsx("a",{style:{color:"inherit"},href:"https://continue.dev/docs/walkthroughs/manually-run-continue#recommended-use-the-continuedev-pypi-package",target:"_blank",children:"Manually start server"})})})]})]}),I.jsx("br",{}),I.jsx(o2e,{children:(De=a==null?void 0:a.history)==null?void 0:De.map((H,W)=>H.hide?null:I.jsx(C.Fragment,{children:I.jsx(WX,{FallbackComponent:l2e,onReset:()=>{t==null||t.stopSession(),r(uc())},children:H.name==="User Input"?H.hide||I.jsx(QI,{isMainInput:!1,value:H.description,active:c&&P(W),onEnter:(se,D)=>{if(D){t==null||t.stopSession();const pe=[...a.history.slice(0,W),{name:"User Input",description:D,observations:[],logs:[],step_type:"UserInputStep",params:{user_input:D},hide:!1,depth:0}];r(KI(pe)),r(Zd(!0));const le={history:pe,context_items:a.context_items};console.log("State: ",le),t.runFromState(le)}se==null||se.stopPropagation(),se==null||se.preventDefault()},groupIndices:Q(W),onToggle:se=>{g(D=>{const pe=[...D];return Q(W).forEach(le=>{pe[le]=se}),pe})},onToggleAll:se=>{g(D=>D.map(pe=>se))},isToggleOpen:typeof m[W]>"u"?!0:m[W],index:W,onDelete:()=>{Q(W).forEach(se=>{console.log(se),r(S4(se))})}}):I.jsx(Gge,{historyNode:H,iconElement:H.step_type==="DefaultModelEditCodeStep"?I.jsx(wZ,{width:"16px",height:"16px"}):H.error?I.jsx(wL,{width:"16px",height:"16px",color:"red"}):I.jsx(SL,{width:"16px",height:"16px"}),open:typeof m[W]>"u"?!H.error:m[W],onToggle:()=>$(W),children:H.error?I.jsx(Wge,{onClose:()=>$(W),error:H.error,onDelete:()=>{r(S4(W))}}):I.jsx(Uue,{index:W,isLast:W===a.history.length-1,isFirst:W===0,open:typeof m[W]>"u"?!0:m[W],onUserInput:se=>{q(se,W)},step:H,onReverse:()=>{t==null||t.reverseToIndex(W)},onRetry:()=>{t==null||t.retryAtIndex(W),f(!0)},onDelete:()=>{r(S4(W))},noUserInputParent:Q(W).length===0},W)})})},W))}),I.jsx("div",{ref:v}),I.jsx(QI,{isMainInput:!0,ref:T,onEnter:(H,W)=>{B(H),H==null||H.stopPropagation(),H==null||H.preventDefault()},onInputValueChange:()=>{},onToggleAddContext:()=>{t==null||t.toggleAddingHighlightedCode()}})]})}const u2e=Ge.div` +`;function l2e({error:e,resetErrorBoundary:t}){return I.jsxs("div",{role:"alert",children:[I.jsx("p",{children:"Something went wrong:"}),I.jsx("pre",{style:{color:"red"},children:e.message}),I.jsx(oc,{onClick:t,children:"Restart"})]})}function qR(e){var ce,De;const t=C.useContext(to),n=Bge(),r=eo(),i=No(),a=zt(H=>H.sessionState),o=zt(H=>{var W;return(W=H.serverState.config.models)==null?void 0:W.default}),s=zt(H=>H.misc.serverStatusMessage),u=zt(H=>H.sessionState.title),c=zt(H=>H.sessionState.active),[p,f]=C.useState(!1),[m,g]=C.useState([]);C.useState(!0);const[b,y]=C.useState(!1);C.useEffect(()=>{setTimeout(()=>{y(!0)},5e3)},[]);const T=C.useRef(null),E=C.useRef(null),v=C.useRef(null),w=zt(H=>H.uiState.bottomMessage),A=zt(H=>H.misc.takenAction);C.useEffect(()=>{v.current&&r(W0e(v.current.getBoundingClientRect().top{var W;const H=()=>{var L,ie;const D=((L=E.current)==null?void 0:L.scrollTop)||0,pe=((ie=E.current)==null?void 0:ie.scrollHeight)||0,le=window.innerHeight||0;D+le+-25>=pe?k(!1):k(!0)};return(W=E.current)==null||W.addEventListener("scroll",H),()=>{window.removeEventListener("scroll",H)}},[E.current]),C.useLayoutEffect(()=>{var H,W;R||(W=E.current)==null||W.scrollTo({top:(H=E.current)==null?void 0:H.scrollHeight,behavior:"instant"})},[(ce=E.current)==null?void 0:ce.scrollHeight,a.history]),C.useEffect(()=>{const H=W=>{W.key==="Backspace"&&xg(W)&&!W.shiftKey?(t==null||t.stopSession(),r(Zd(!1))):W.key==="Escape"&&r(pu(void 0))};return window.addEventListener("keydown",H),()=>{window.removeEventListener("keydown",H)}},[t,c]);const N=C.useCallback(H=>{if((o==null?void 0:o.class_name)==="OpenAIFreeTrial"&&(o==null?void 0:o.api_key)===""&&(!H.startsWith("/")||H.startsWith("/edit"))){const pe=localStorage.getItem("ftc");if(pe){const le=parseInt(pe);if(localStorage.setItem("ftc",(le+1).toString()),le>=250){r(cc(!0)),r(C4(I.jsx(r2e,{}))),n==null||n.capture("ftc_reached");return}}else localStorage.setItem("ftc","1")}f(!0);const W=[...a.history,{name:"User Input",description:H,observations:[],logs:[],step_type:"UserInputStep",params:{user_input:H},hide:!1,depth:0}],se={history:W,context_items:a.context_items};for(let pe of a.context_items)r(SP({item:pe,index:W.length-1}));t.runFromState(se),W.push({name:"Generating Response...",description:" ",observations:[],logs:[],step_type:"SimpleChatStep",params:{},hide:!1,depth:0}),r(KI(W)),r(Zd(!0));const D=localStorage.getItem("mainTextEntryCounter");if(D){let pe=parseInt(D);localStorage.setItem("mainTextEntryCounter",(pe+1).toString()),pe===300&&(r(C4(I.jsxs("div",{className:"text-center p-4",children:["👋 Thanks for using Continue. We are a beta product and love working closely with our first users. If you're interested in speaking, enter your name and email. We won't use this information for anything other than reaching out.",I.jsx("br",{}),I.jsx("br",{}),I.jsxs("form",{onSubmit:le=>{le.preventDefault(),n==null||n.capture("user_interest_form",{name:le.target.elements[0].value,email:le.target.elements[1].value}),r(C4(I.jsx("div",{className:"text-center p-4",children:"Thanks! We'll be in touch soon."})))},style:{display:"flex",flexDirection:"column",gap:"10px"},children:[I.jsx("input",{style:{padding:"10px",borderRadius:"5px"},type:"text",name:"name",placeholder:"Name",required:!0}),I.jsx("input",{style:{padding:"10px",borderRadius:"5px"},type:"email",name:"email",placeholder:"Email",required:!0}),I.jsx("button",{style:{padding:"10px",borderRadius:"5px",cursor:"pointer"},type:"submit",children:"Submit"})]})]}))),r(V0e(!1)),r(cc(!0)))}else localStorage.setItem("mainTextEntryCounter","1")},[t,a.history,a.context_items,o]);C.useEffect(()=>{const H=W=>{W.data.type==="userInput"&&N(W.data.input)};return window.addEventListener("message",H),()=>window.removeEventListener("message",H)},[N]);const B=H=>{if(r(Ad(null)),T.current&&t){let W=T.current.inputValue;if(W.trim()==="")return;if(W.startsWith("#")&&(W.length===7||W.length===4)){localStorage.setItem("continueButtonColor",W),T.current.setInputValue("");return}H&&xg(H)&&(W=`/edit ${W}`),T.current.setInputValue(""),N(W)}},q=(H,W)=>{t&&t.sendStepUserInput(H,W)},P=C.useCallback(H=>{let W=!1;for(let se=H+1;se{const W=[];let se=-1;for(let D=H;D>=0;D--)if(typeof a.history[D]<"u"&&a.history[D].name==="User Input"&&a.history[D].hide===!1){W.push(D),se=D;break}if(W.length===0)return[];for(let D=se+1;D{const W=Q(H),se=W[0];g(D=>{const pe=[...D];return pe[H]=!pe[H],!W.some((L,ie)=>ie>0&&pe[L])?pe[se]=!1:!W.some((ie,Se)=>Se>0&&!pe[ie])&&(pe[se]=!0),pe})},[Q]);C.useEffect(()=>{u&&fe(u)},[u]);const[oe,fe]=C.useState(u||"New Session");return I.jsxs(i2e,{ref:E,onKeyDown:H=>{H.key==="Enter"&&H.ctrlKey&&B()},children:[I.jsxs(s2e,{children:[I.jsx(a2e,{onClick:H=>{H.target.setSelectionRange(0,H.target.value.length)},value:oe,onChange:H=>fe(H.target.value),onBlur:H=>{H.target.value===u||typeof u>"u"&&H.target.value==="New Session"||r(wP(H.target.value))},onKeyDown:H=>{H.key==="Enter"?(H.preventDefault(),H.target.blur()):H.key==="Escape"&&(fe(u||"New Session"),H.target.blur())}}),I.jsxs("div",{className:"flex gap-2",children:[I.jsx(zi,{onClick:()=>{t==null||t.stopSession(),r(uc())},text:"New Session (⌥⌘N)",children:I.jsx(CL,{width:"1.4em",height:"1.4em"})}),I.jsx(zi,{onClick:()=>{i("/history")},text:"History",children:I.jsx(OZ,{width:"1.4em",height:"1.4em"})})]})]}),A&&b&&typeof t>"u"&&I.jsxs(I.Fragment,{children:[I.jsx(zge,{}),I.jsx("p",{style:{textAlign:"center",margin:"0px",fontSize:"14px"},children:s}),I.jsxs("div",{className:"flex mx-8 my-2",children:[I.jsx("p",{style:{margin:"auto",textAlign:"center",marginTop:"4px",fontSize:"12px",cursor:"pointer",opacity:.7},children:I.jsx("u",{children:I.jsx("a",{style:{color:"inherit"},href:"https://continue.dev/docs/troubleshooting",target:"_blank",children:"Troubleshooting help"})})}),I.jsx("p",{style:{margin:"auto",textAlign:"center",marginTop:"4px",fontSize:"12px",cursor:"pointer",opacity:.7},onClick:()=>{qa("toggleDevTools",{})},children:I.jsx("u",{children:"View logs"})}),I.jsx("p",{style:{margin:"auto",textAlign:"center",marginTop:"4px",fontSize:"12px",cursor:"pointer",opacity:.7},children:I.jsx("u",{children:I.jsx("a",{style:{color:"inherit"},href:"https://continue.dev/docs/walkthroughs/manually-run-continue#recommended-use-the-continuedev-pypi-package",target:"_blank",children:"Manually start server"})})})]})]}),I.jsx("br",{}),I.jsx(o2e,{children:(De=a==null?void 0:a.history)==null?void 0:De.map((H,W)=>H.hide?null:I.jsx(C.Fragment,{children:I.jsx(WX,{FallbackComponent:l2e,onReset:()=>{t==null||t.stopSession(),r(uc())},children:H.name==="User Input"?H.hide||I.jsx(QI,{isMainInput:!1,value:H.description,active:c&&P(W),onEnter:(se,D)=>{if(D){t==null||t.stopSession();const pe=[...a.history.slice(0,W),{name:"User Input",description:D,observations:[],logs:[],step_type:"UserInputStep",params:{user_input:D},hide:!1,depth:0}];r(KI(pe)),r(Zd(!0));const le={history:pe,context_items:a.context_items};console.log("State: ",le),t.runFromState(le)}se==null||se.stopPropagation(),se==null||se.preventDefault()},groupIndices:Q(W),onToggle:se=>{g(D=>{const pe=[...D];return Q(W).forEach(le=>{pe[le]=se}),pe})},onToggleAll:se=>{g(D=>D.map(pe=>se))},isToggleOpen:typeof m[W]>"u"?!0:m[W],index:W,onDelete:()=>{Q(W).forEach(se=>{console.log(se),r(S4(se))})}}):I.jsx(Gge,{historyNode:H,iconElement:H.step_type==="DefaultModelEditCodeStep"?I.jsx(wZ,{width:"16px",height:"16px"}):H.error?I.jsx(wL,{width:"16px",height:"16px",color:"red"}):I.jsx(SL,{width:"16px",height:"16px"}),open:typeof m[W]>"u"?!H.error:m[W],onToggle:()=>$(W),children:H.error?I.jsx(Wge,{onClose:()=>$(W),error:H.error,onDelete:()=>{r(S4(W))}}):I.jsx(Uue,{index:W,isLast:W===a.history.length-1,isFirst:W===0,open:typeof m[W]>"u"?!0:m[W],onUserInput:se=>{q(se,W)},step:H,onReverse:()=>{t==null||t.reverseToIndex(W)},onRetry:()=>{t==null||t.retryAtIndex(W),f(!0)},onDelete:()=>{r(S4(W))},noUserInputParent:Q(W).length===0},W)})})},W))}),I.jsx("div",{ref:v}),I.jsx(QI,{isMainInput:!0,ref:T,onEnter:(H,W)=>{B(H),H==null||H.stopPropagation(),H==null||H.preventDefault()},onInputValueChange:()=>{},onToggleAddContext:()=>{t==null||t.toggleAddingHighlightedCode()}})]})}const u2e=Ge.div` display: flex; flex-direction: row; align-items: center; @@ -873,7 +873,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `;Ge.p` color: ${Yt}; margin: 8px auto; -`;const S2e=e=>(C.useEffect(()=>{const t=n=>{n.key==="Escape"&&e.onClose()};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[e]),I.jsx(v2e,{onClick:()=>{e.onClose()},hidden:!e.showDialog,children:I.jsx(_2e,{onClick:t=>{t.stopPropagation()},children:I.jsx(T2e,{children:typeof e.message=="string"?I.jsx(N9,{children:e.message||""}):st.isValidElement(e.message)?e.message:null})})}));var w2e=Object.defineProperty,A2e=(e,t,n)=>t in e?w2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P4=(e,t,n)=>(A2e(e,typeof t!="symbol"?t+"":t,n),n);let C2e=class{constructor(){P4(this,"current",this.detect()),P4(this,"handoffState","pending"),P4(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},hu=new C2e,Gi=(e,t)=>{hu.isServer?C.useEffect(e,t):C.useLayoutEffect(e,t)};function wo(e){let t=C.useRef(e);return Gi(()=>{t.current=e},[e]),t}function yB(e,t){let[n,r]=C.useState(e),i=wo(e);return Gi(()=>r(i.current),[i,r,...t]),n}function k2e(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function vl(){let e=[],t={addEventListener(n,r,i,a){return n.addEventListener(r,i,a),t.add(()=>n.removeEventListener(r,i,a))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return k2e(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,i){let a=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:a})})},group(n){let r=vl();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let i of e.splice(r,1))i()}},dispose(){for(let n of e.splice(0))n()}};return t}function pc(){let[e]=C.useState(vl);return C.useEffect(()=>()=>e.dispose(),[e]),e}let Zt=function(e){let t=wo(e);return st.useCallback((...n)=>t.current(...n),[t])};function x2e(){let e=typeof document>"u";return"useSyncExternalStore"in Q4?(t=>t.useSyncExternalStore)(Q4)(()=>()=>{},()=>!1,()=>!e):!1}function ST(){let e=x2e(),[t,n]=C.useState(hu.isHandoffComplete);return t&&hu.isHandoffComplete===!1&&n(!1),C.useEffect(()=>{t!==!0&&n(!0)},[t]),C.useEffect(()=>hu.handoff(),[]),e?!1:t}var XR;let B2=(XR=st.useId)!=null?XR:function(){let e=ST(),[t,n]=st.useState(e?()=>hu.nextId():null);return Gi(()=>{t===null&&n(hu.nextId())},[t]),t!=null?""+t:void 0};function Cr(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Cr),r}function EB(e){return hu.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let ZR=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var I2e=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(I2e||{}),R2e=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(R2e||{}),N2e=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(N2e||{}),wT=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(wT||{});function vB(e,t=0){var n;return e===((n=EB(e))==null?void 0:n.body)?!1:Cr(t,{0(){return e.matches(ZR)},1(){let r=e;for(;r!==null;){if(r.matches(ZR))return!0;r=r.parentElement}return!1}})}var O2e=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(O2e||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function D2e(e,t=n=>n){return e.slice().sort((n,r)=>{let i=t(n),a=t(r);if(i===null||a===null)return 0;let o=i.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function lh(e,t,n){let r=wo(t);C.useEffect(()=>{function i(a){r.current(a)}return document.addEventListener(e,i,n),()=>document.removeEventListener(e,i,n)},[e,n])}function L2e(e,t,n){let r=wo(t);C.useEffect(()=>{function i(a){r.current(a)}return window.addEventListener(e,i,n),()=>window.removeEventListener(e,i,n)},[e,n])}function M2e(e,t,n=!0){let r=C.useRef(!1);C.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function i(o,s){if(!r.current||o.defaultPrevented)return;let u=s(o);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let c=function p(f){return typeof f=="function"?p(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let p of c){if(p===null)continue;let f=p instanceof HTMLElement?p:p.current;if(f!=null&&f.contains(u)||o.composed&&o.composedPath().includes(f))return}return!vB(u,wT.Loose)&&u.tabIndex!==-1&&o.preventDefault(),t(o,u)}let a=C.useRef(null);lh("pointerdown",o=>{var s,u;r.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),lh("mousedown",o=>{var s,u;r.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),lh("click",o=>{a.current&&(i(o,()=>a.current),a.current=null)},!0),lh("touchend",o=>i(o,()=>o.target instanceof HTMLElement?o.target:null),!0),L2e("blur",o=>i(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function QR(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function F2e(e,t){let[n,r]=C.useState(()=>QR(e));return Gi(()=>{r(QR(e))},[e.type,e.as]),Gi(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let P2e=Symbol();function Pu(...e){let t=C.useRef(e);C.useEffect(()=>{t.current=e},[e]);let n=Zt(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[P2e]))?void 0:n}function B2e(e){throw new Error("Unexpected object: "+e)}var yi=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(yi||{});function U2e(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1,a=(()=>{switch(e.focus){case 0:return n.findIndex(o=>!t.resolveDisabled(o));case 1:{let o=n.slice().reverse().findIndex((s,u,c)=>i!==-1&&c.length-u-1>=i?!1:!t.resolveDisabled(s));return o===-1?o:n.length-1-o}case 2:return n.findIndex((o,s)=>s<=i?!1:!t.resolveDisabled(o));case 3:{let o=n.slice().reverse().findIndex(s=>!t.resolveDisabled(s));return o===-1?o:n.length-1-o}case 4:return n.findIndex(o=>t.resolveId(o)===e.id);case 5:return null;default:B2e(e)}})();return a===-1?r:a}function tm(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var nm=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(nm||{}),Qs=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Qs||{});function Rl({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:a=!0,name:o}){let s=_B(t,e);if(a)return uh(s,n,r,o);let u=i??0;if(u&2){let{static:c=!1,...p}=s;if(c)return uh(p,n,r,o)}if(u&1){let{unmount:c=!0,...p}=s;return Cr(c?0:1,{0(){return null},1(){return uh({...p,hidden:!0,style:{display:"none"}},n,r,o)}})}return uh(s,n,r,o)}function uh(e,t={},n,r){let{as:i=n,children:a,refName:o="ref",...s}=B4(e,["unmount","static"]),u=e.ref!==void 0?{[o]:e.ref}:{},c=typeof a=="function"?a(t):a;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(t));let p={};if(t){let f=!1,m=[];for(let[g,b]of Object.entries(t))typeof b=="boolean"&&(f=!0),b===!0&&m.push(g);f&&(p["data-headlessui-state"]=m.join(" "))}if(i===C.Fragment&&Object.keys(Zy(s)).length>0){if(!C.isValidElement(c)||Array.isArray(c)&&c.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(b=>` - ${b}`).join(` +`;const S2e=e=>(C.useEffect(()=>{const t=n=>{n.key==="Escape"&&e.onClose()};return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[e]),!C.isValidElement(e.message)&&typeof e.message!="string"?null:I.jsx(v2e,{onClick:()=>{e.onClose()},hidden:!e.showDialog,children:I.jsx(_2e,{onClick:t=>{t.stopPropagation()},children:I.jsx(T2e,{children:typeof e.message=="string"?I.jsx(N9,{children:e.message||""}):st.isValidElement(e.message)?e.message:null})})}));var w2e=Object.defineProperty,A2e=(e,t,n)=>t in e?w2e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P4=(e,t,n)=>(A2e(e,typeof t!="symbol"?t+"":t,n),n);let C2e=class{constructor(){P4(this,"current",this.detect()),P4(this,"handoffState","pending"),P4(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},hu=new C2e,Gi=(e,t)=>{hu.isServer?C.useEffect(e,t):C.useLayoutEffect(e,t)};function wo(e){let t=C.useRef(e);return Gi(()=>{t.current=e},[e]),t}function yB(e,t){let[n,r]=C.useState(e),i=wo(e);return Gi(()=>r(i.current),[i,r,...t]),n}function k2e(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function vl(){let e=[],t={addEventListener(n,r,i,a){return n.addEventListener(r,i,a),t.add(()=>n.removeEventListener(r,i,a))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return k2e(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,i){let a=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:i}),this.add(()=>{Object.assign(n.style,{[r]:a})})},group(n){let r=vl();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let i of e.splice(r,1))i()}},dispose(){for(let n of e.splice(0))n()}};return t}function pc(){let[e]=C.useState(vl);return C.useEffect(()=>()=>e.dispose(),[e]),e}let Zt=function(e){let t=wo(e);return st.useCallback((...n)=>t.current(...n),[t])};function x2e(){let e=typeof document>"u";return"useSyncExternalStore"in Q4?(t=>t.useSyncExternalStore)(Q4)(()=>()=>{},()=>!1,()=>!e):!1}function ST(){let e=x2e(),[t,n]=C.useState(hu.isHandoffComplete);return t&&hu.isHandoffComplete===!1&&n(!1),C.useEffect(()=>{t!==!0&&n(!0)},[t]),C.useEffect(()=>hu.handoff(),[]),e?!1:t}var XR;let B2=(XR=st.useId)!=null?XR:function(){let e=ST(),[t,n]=st.useState(e?()=>hu.nextId():null);return Gi(()=>{t===null&&n(hu.nextId())},[t]),t!=null?""+t:void 0};function Cr(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Cr),r}function EB(e){return hu.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let ZR=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var I2e=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(I2e||{}),R2e=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(R2e||{}),N2e=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(N2e||{}),wT=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(wT||{});function vB(e,t=0){var n;return e===((n=EB(e))==null?void 0:n.body)?!1:Cr(t,{0(){return e.matches(ZR)},1(){let r=e;for(;r!==null;){if(r.matches(ZR))return!0;r=r.parentElement}return!1}})}var O2e=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(O2e||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function D2e(e,t=n=>n){return e.slice().sort((n,r)=>{let i=t(n),a=t(r);if(i===null||a===null)return 0;let o=i.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function lh(e,t,n){let r=wo(t);C.useEffect(()=>{function i(a){r.current(a)}return document.addEventListener(e,i,n),()=>document.removeEventListener(e,i,n)},[e,n])}function L2e(e,t,n){let r=wo(t);C.useEffect(()=>{function i(a){r.current(a)}return window.addEventListener(e,i,n),()=>window.removeEventListener(e,i,n)},[e,n])}function M2e(e,t,n=!0){let r=C.useRef(!1);C.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function i(o,s){if(!r.current||o.defaultPrevented)return;let u=s(o);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let c=function p(f){return typeof f=="function"?p(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let p of c){if(p===null)continue;let f=p instanceof HTMLElement?p:p.current;if(f!=null&&f.contains(u)||o.composed&&o.composedPath().includes(f))return}return!vB(u,wT.Loose)&&u.tabIndex!==-1&&o.preventDefault(),t(o,u)}let a=C.useRef(null);lh("pointerdown",o=>{var s,u;r.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),lh("mousedown",o=>{var s,u;r.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),lh("click",o=>{a.current&&(i(o,()=>a.current),a.current=null)},!0),lh("touchend",o=>i(o,()=>o.target instanceof HTMLElement?o.target:null),!0),L2e("blur",o=>i(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function QR(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function F2e(e,t){let[n,r]=C.useState(()=>QR(e));return Gi(()=>{r(QR(e))},[e.type,e.as]),Gi(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let P2e=Symbol();function Pu(...e){let t=C.useRef(e);C.useEffect(()=>{t.current=e},[e]);let n=Zt(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[P2e]))?void 0:n}function B2e(e){throw new Error("Unexpected object: "+e)}var yi=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(yi||{});function U2e(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r??-1,a=(()=>{switch(e.focus){case 0:return n.findIndex(o=>!t.resolveDisabled(o));case 1:{let o=n.slice().reverse().findIndex((s,u,c)=>i!==-1&&c.length-u-1>=i?!1:!t.resolveDisabled(s));return o===-1?o:n.length-1-o}case 2:return n.findIndex((o,s)=>s<=i?!1:!t.resolveDisabled(o));case 3:{let o=n.slice().reverse().findIndex(s=>!t.resolveDisabled(s));return o===-1?o:n.length-1-o}case 4:return n.findIndex(o=>t.resolveId(o)===e.id);case 5:return null;default:B2e(e)}})();return a===-1?r:a}function tm(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var nm=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(nm||{}),Qs=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Qs||{});function Rl({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:a=!0,name:o}){let s=_B(t,e);if(a)return uh(s,n,r,o);let u=i??0;if(u&2){let{static:c=!1,...p}=s;if(c)return uh(p,n,r,o)}if(u&1){let{unmount:c=!0,...p}=s;return Cr(c?0:1,{0(){return null},1(){return uh({...p,hidden:!0,style:{display:"none"}},n,r,o)}})}return uh(s,n,r,o)}function uh(e,t={},n,r){let{as:i=n,children:a,refName:o="ref",...s}=B4(e,["unmount","static"]),u=e.ref!==void 0?{[o]:e.ref}:{},c=typeof a=="function"?a(t):a;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(t));let p={};if(t){let f=!1,m=[];for(let[g,b]of Object.entries(t))typeof b=="boolean"&&(f=!0),b===!0&&m.push(g);f&&(p["data-headlessui-state"]=m.join(" "))}if(i===C.Fragment&&Object.keys(Zy(s)).length>0){if(!C.isValidElement(c)||Array.isArray(c)&&c.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(b=>` - ${b}`).join(` `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(b=>` - ${b}`).join(` `)].join(` `));let f=c.props,m=typeof(f==null?void 0:f.className)=="function"?(...b)=>tm(f==null?void 0:f.className(...b),s.className):tm(f==null?void 0:f.className,s.className),g=m?{className:m}:{};return C.cloneElement(c,Object.assign({},_B(c.props,Zy(B4(s,["ref"]))),p,u,$2e(c.ref,u.ref),g))}return C.createElement(i,Object.assign({},B4(s,["ref"]),i!==C.Fragment&&u,i!==C.Fragment&&p),c)}function $2e(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}}function _B(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](i,...a){let o=n[r];for(let s of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;s(i,...a)}}});return t}function ys(e){var t;return Object.assign(C.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Zy(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function B4(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function z2e(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&H2e(n)?!1:r}function H2e(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function TB(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))wB(n,SB(t,r),i);return n}function SB(e,t){return e?e+"["+t+"]":t}function wB(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())wB(e,SB(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):TB(n,t,e)}let j2e="div";var AB=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(AB||{});function G2e(e,t){let{features:n=1,...r}=e,i={ref:t,"aria-hidden":(n&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Rl({ourProps:i,theirProps:r,slot:{},defaultTag:j2e,name:"Hidden"})}let V2e=ys(G2e),AT=C.createContext(null);AT.displayName="OpenClosedContext";var Li=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Li||{});function CT(){return C.useContext(AT)}function CB({value:e,children:t}){return st.createElement(AT.Provider,{value:e},t)}var ur=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(ur||{});function W2e(e,t,n){let[r,i]=C.useState(n),a=e!==void 0,o=C.useRef(a),s=C.useRef(!1),u=C.useRef(!1);return a&&!o.current&&!s.current?(s.current=!0,o.current=a,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!a&&o.current&&!u.current&&(u.current=!0,o.current=a,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[a?e:r,Zt(c=>(a||i(c),t==null?void 0:t(c)))]}function JR(e){return[e.screenX,e.screenY]}function q2e(){let e=C.useRef([-1,-1]);return{wasMoved(t){let n=JR(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=JR(t)}}}function kT(){let e=C.useRef(!1);return Gi(()=>(e.current=!0,()=>{e.current=!1}),[]),e}let eN=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function tN(e){var t,n;let r=(t=e.innerText)!=null?t:"",i=e.cloneNode(!0);if(!(i instanceof HTMLElement))return r;let a=!1;for(let s of i.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),a=!0;let o=a?(n=i.innerText)!=null?n:"":r;return eN.test(o)&&(o=o.replace(eN,"")),o}function K2e(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(i=>{let a=document.getElementById(i);if(a){let o=a.getAttribute("aria-label");return typeof o=="string"?o.trim():tN(a).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return tN(e).trim()}function Y2e(e){let t=C.useRef(""),n=C.useRef("");return Zt(()=>{let r=e.current;if(!r)return"";let i=r.innerText;if(t.current===i)return n.current;let a=K2e(r).trim().toLowerCase();return t.current=i,n.current=a,a})}var X2e=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(X2e||{}),Z2e=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Z2e||{}),Q2e=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Q2e||{}),J2e=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.RegisterLabel=7]="RegisterLabel",e))(J2e||{});function U4(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=D2e(t(e.options.slice()),a=>a.dataRef.current.domRef.current),i=n?r.indexOf(n):null;return i===-1&&(i=null),{options:r,activeOptionIndex:i}}let e5e={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1}},0(e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex(i=>n(i.dataRef.current.value));return r!==-1&&(t=r),{...e,listboxState:0,activeOptionIndex:t}},2(e,t){var n;if(e.dataRef.current.disabled||e.listboxState===1)return e;let r=U4(e),i=U2e(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:i,activationTrigger:(n=t.trigger)!=null?n:1}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(o=>{var s;return!o.dataRef.current.disabled&&((s=o.dataRef.current.textValue)==null?void 0:s.startsWith(r))}),a=i?e.options.indexOf(i):-1;return a===-1||a===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:a,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=U4(e,i=>[...i,n]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...e,...r}},6:(e,t)=>{let n=U4(e,r=>{let i=r.findIndex(a=>a.id===t.id);return i!==-1&&r.splice(i,1),r});return{...e,...n,activationTrigger:1}},7:(e,t)=>({...e,labelId:t.id})},xT=C.createContext(null);xT.displayName="ListboxActionsContext";function gf(e){let t=C.useContext(xT);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,gf),n}return t}let IT=C.createContext(null);IT.displayName="ListboxDataContext";function mf(e){let t=C.useContext(IT);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,mf),n}return t}function t5e(e,t){return Cr(t.type,e5e,e,t)}let n5e=C.Fragment;function r5e(e,t){let{value:n,defaultValue:r,form:i,name:a,onChange:o,by:s=(ie,Se)=>ie===Se,disabled:u=!1,horizontal:c=!1,multiple:p=!1,...f}=e;const m=c?"horizontal":"vertical";let g=Pu(t),[b=p?[]:void 0,y]=W2e(n,o,r),[T,E]=C.useReducer(t5e,{dataRef:C.createRef(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),v=C.useRef({static:!1,hold:!1}),w=C.useRef(null),A=C.useRef(null),R=C.useRef(null),k=Zt(typeof s=="string"?(ie,Se)=>{let X=s;return(ie==null?void 0:ie[X])===(Se==null?void 0:Se[X])}:s),N=C.useCallback(ie=>Cr(B.mode,{1:()=>b.some(Se=>k(Se,ie)),0:()=>k(b,ie)}),[b]),B=C.useMemo(()=>({...T,value:b,disabled:u,mode:p?1:0,orientation:m,compare:k,isSelected:N,optionsPropsRef:v,labelRef:w,buttonRef:A,optionsRef:R}),[b,u,p,T]);Gi(()=>{T.dataRef.current=B},[B]),M2e([B.buttonRef,B.optionsRef],(ie,Se)=>{var X;E({type:1}),vB(Se,wT.Loose)||(ie.preventDefault(),(X=B.buttonRef.current)==null||X.focus())},B.listboxState===0);let q=C.useMemo(()=>({open:B.listboxState===0,disabled:u,value:b}),[B,u,b]),P=Zt(ie=>{let Se=B.options.find(X=>X.id===ie);Se&&H(Se.dataRef.current.value)}),Q=Zt(()=>{if(B.activeOptionIndex!==null){let{dataRef:ie,id:Se}=B.options[B.activeOptionIndex];H(ie.current.value),E({type:2,focus:yi.Specific,id:Se})}}),$=Zt(()=>E({type:0})),oe=Zt(()=>E({type:1})),fe=Zt((ie,Se,X)=>ie===yi.Specific?E({type:2,focus:yi.Specific,id:Se,trigger:X}):E({type:2,focus:ie,trigger:X})),ce=Zt((ie,Se)=>(E({type:5,id:ie,dataRef:Se}),()=>E({type:6,id:ie}))),De=Zt(ie=>(E({type:7,id:ie}),()=>E({type:7,id:null}))),H=Zt(ie=>Cr(B.mode,{0(){return y==null?void 0:y(ie)},1(){let Se=B.value.slice(),X=Se.findIndex(ke=>k(ke,ie));return X===-1?Se.push(ie):Se.splice(X,1),y==null?void 0:y(Se)}})),W=Zt(ie=>E({type:3,value:ie})),se=Zt(()=>E({type:4})),D=C.useMemo(()=>({onChange:H,registerOption:ce,registerLabel:De,goToOption:fe,closeListbox:oe,openListbox:$,selectActiveOption:Q,selectOption:P,search:W,clearSearch:se}),[]),pe={ref:g},le=C.useRef(null),L=pc();return C.useEffect(()=>{le.current&&r!==void 0&&L.addEventListener(le.current,"reset",()=>{y==null||y(r)})},[le,y]),st.createElement(xT.Provider,{value:D},st.createElement(IT.Provider,{value:B},st.createElement(CB,{value:Cr(B.listboxState,{0:Li.Open,1:Li.Closed})},a!=null&&b!=null&&TB({[a]:b}).map(([ie,Se],X)=>st.createElement(V2e,{features:AB.Hidden,ref:X===0?ke=>{var te;le.current=(te=ke==null?void 0:ke.closest("form"))!=null?te:null}:void 0,...Zy({key:ie,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:ie,value:Se})})),Rl({ourProps:pe,theirProps:f,slot:q,defaultTag:n5e,name:"Listbox"}))))}let i5e="button";function a5e(e,t){var n;let r=B2(),{id:i=`headlessui-listbox-button-${r}`,...a}=e,o=mf("Listbox.Button"),s=gf("Listbox.Button"),u=Pu(o.buttonRef,t),c=pc(),p=Zt(T=>{switch(T.key){case ur.Space:case ur.Enter:case ur.ArrowDown:T.preventDefault(),s.openListbox(),c.nextFrame(()=>{o.value||s.goToOption(yi.First)});break;case ur.ArrowUp:T.preventDefault(),s.openListbox(),c.nextFrame(()=>{o.value||s.goToOption(yi.Last)});break}}),f=Zt(T=>{switch(T.key){case ur.Space:T.preventDefault();break}}),m=Zt(T=>{if(z2e(T.currentTarget))return T.preventDefault();o.listboxState===0?(s.closeListbox(),c.nextFrame(()=>{var E;return(E=o.buttonRef.current)==null?void 0:E.focus({preventScroll:!0})})):(T.preventDefault(),s.openListbox())}),g=yB(()=>{if(o.labelId)return[o.labelId,i].join(" ")},[o.labelId,i]),b=C.useMemo(()=>({open:o.listboxState===0,disabled:o.disabled,value:o.value}),[o]),y={ref:u,id:i,type:F2e(e,o.buttonRef),"aria-haspopup":"listbox","aria-controls":(n=o.optionsRef.current)==null?void 0:n.id,"aria-expanded":o.listboxState===0,"aria-labelledby":g,disabled:o.disabled,onKeyDown:p,onKeyUp:f,onClick:m};return Rl({ourProps:y,theirProps:a,slot:b,defaultTag:i5e,name:"Listbox.Button"})}let o5e="label";function s5e(e,t){let n=B2(),{id:r=`headlessui-listbox-label-${n}`,...i}=e,a=mf("Listbox.Label"),o=gf("Listbox.Label"),s=Pu(a.labelRef,t);Gi(()=>o.registerLabel(r),[r]);let u=Zt(()=>{var p;return(p=a.buttonRef.current)==null?void 0:p.focus({preventScroll:!0})}),c=C.useMemo(()=>({open:a.listboxState===0,disabled:a.disabled}),[a]);return Rl({ourProps:{ref:s,id:r,onClick:u},theirProps:i,slot:c,defaultTag:o5e,name:"Listbox.Label"})}let l5e="ul",u5e=nm.RenderStrategy|nm.Static;function c5e(e,t){var n;let r=B2(),{id:i=`headlessui-listbox-options-${r}`,...a}=e,o=mf("Listbox.Options"),s=gf("Listbox.Options"),u=Pu(o.optionsRef,t),c=pc(),p=pc(),f=CT(),m=(()=>f!==null?(f&Li.Open)===Li.Open:o.listboxState===0)();C.useEffect(()=>{var E;let v=o.optionsRef.current;v&&o.listboxState===0&&v!==((E=EB(v))==null?void 0:E.activeElement)&&v.focus({preventScroll:!0})},[o.listboxState,o.optionsRef]);let g=Zt(E=>{switch(p.dispose(),E.key){case ur.Space:if(o.searchQuery!=="")return E.preventDefault(),E.stopPropagation(),s.search(E.key);case ur.Enter:if(E.preventDefault(),E.stopPropagation(),o.activeOptionIndex!==null){let{dataRef:v}=o.options[o.activeOptionIndex];s.onChange(v.current.value)}o.mode===0&&(s.closeListbox(),vl().nextFrame(()=>{var v;return(v=o.buttonRef.current)==null?void 0:v.focus({preventScroll:!0})}));break;case Cr(o.orientation,{vertical:ur.ArrowDown,horizontal:ur.ArrowRight}):return E.preventDefault(),E.stopPropagation(),s.goToOption(yi.Next);case Cr(o.orientation,{vertical:ur.ArrowUp,horizontal:ur.ArrowLeft}):return E.preventDefault(),E.stopPropagation(),s.goToOption(yi.Previous);case ur.Home:case ur.PageUp:return E.preventDefault(),E.stopPropagation(),s.goToOption(yi.First);case ur.End:case ur.PageDown:return E.preventDefault(),E.stopPropagation(),s.goToOption(yi.Last);case ur.Escape:return E.preventDefault(),E.stopPropagation(),s.closeListbox(),c.nextFrame(()=>{var v;return(v=o.buttonRef.current)==null?void 0:v.focus({preventScroll:!0})});case ur.Tab:E.preventDefault(),E.stopPropagation();break;default:E.key.length===1&&(s.search(E.key),p.setTimeout(()=>s.clearSearch(),350));break}}),b=yB(()=>{var E,v,w;return(w=(E=o.labelRef.current)==null?void 0:E.id)!=null?w:(v=o.buttonRef.current)==null?void 0:v.id},[o.labelRef.current,o.buttonRef.current]),y=C.useMemo(()=>({open:o.listboxState===0}),[o]),T={"aria-activedescendant":o.activeOptionIndex===null||(n=o.options[o.activeOptionIndex])==null?void 0:n.id,"aria-multiselectable":o.mode===1?!0:void 0,"aria-labelledby":b,"aria-orientation":o.orientation,id:i,onKeyDown:g,role:"listbox",tabIndex:0,ref:u};return Rl({ourProps:T,theirProps:a,slot:y,defaultTag:l5e,features:u5e,visible:m,name:"Listbox.Options"})}let d5e="li";function p5e(e,t){let n=B2(),{id:r=`headlessui-listbox-option-${n}`,disabled:i=!1,value:a,...o}=e,s=mf("Listbox.Option"),u=gf("Listbox.Option"),c=s.activeOptionIndex!==null?s.options[s.activeOptionIndex].id===r:!1,p=s.isSelected(a),f=C.useRef(null),m=Y2e(f),g=wo({disabled:i,value:a,domRef:f,get textValue(){return m()}}),b=Pu(t,f);Gi(()=>{if(s.listboxState!==0||!c||s.activationTrigger===0)return;let k=vl();return k.requestAnimationFrame(()=>{var N,B;(B=(N=f.current)==null?void 0:N.scrollIntoView)==null||B.call(N,{block:"nearest"})}),k.dispose},[f,c,s.listboxState,s.activationTrigger,s.activeOptionIndex]),Gi(()=>u.registerOption(r,g),[g,r]);let y=Zt(k=>{if(i)return k.preventDefault();u.onChange(a),s.mode===0&&(u.closeListbox(),vl().nextFrame(()=>{var N;return(N=s.buttonRef.current)==null?void 0:N.focus({preventScroll:!0})}))}),T=Zt(()=>{if(i)return u.goToOption(yi.Nothing);u.goToOption(yi.Specific,r)}),E=q2e(),v=Zt(k=>E.update(k)),w=Zt(k=>{E.wasMoved(k)&&(i||c||u.goToOption(yi.Specific,r,0))}),A=Zt(k=>{E.wasMoved(k)&&(i||c&&u.goToOption(yi.Nothing))}),R=C.useMemo(()=>({active:c,selected:p,disabled:i}),[c,p,i]);return Rl({ourProps:{id:r,ref:b,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":p,disabled:void 0,onClick:y,onFocus:T,onPointerEnter:v,onMouseEnter:v,onPointerMove:w,onMouseMove:w,onPointerLeave:A,onMouseLeave:A},theirProps:o,slot:R,defaultTag:d5e,name:"Listbox.Option"})}let f5e=ys(r5e),h5e=ys(a5e),g5e=ys(s5e),m5e=ys(c5e),b5e=ys(p5e),U2=Object.assign(f5e,{Button:h5e,Label:g5e,Options:m5e,Option:b5e});function y5e(e=0){let[t,n]=C.useState(e),r=kT(),i=C.useCallback(u=>{r.current&&n(c=>c|u)},[t,r]),a=C.useCallback(u=>!!(t&u),[t]),o=C.useCallback(u=>{r.current&&n(c=>c&~u)},[n,r]),s=C.useCallback(u=>{r.current&&n(c=>c^u)},[n]);return{flags:t,addFlag:i,hasFlag:a,removeFlag:o,toggleFlag:s}}function E5e(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function $4(e,...t){e&&t.length>0&&e.classList.add(...t)}function z4(e,...t){e&&t.length>0&&e.classList.remove(...t)}function v5e(e,t){let n=vl();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[a,o]=[r,i].map(u=>{let[c=0]=u.split(",").filter(Boolean).map(p=>p.includes("ms")?parseFloat(p):parseFloat(p)*1e3).sort((p,f)=>f-p);return c}),s=a+o;if(s!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},s),c.addEventListener(e,"transitionrun",p=>{p.target===p.currentTarget&&c.dispose()})});let u=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),u())})}else t();return n.add(()=>t()),n.dispose}function _5e(e,t,n,r){let i=n?"enter":"leave",a=vl(),o=r!==void 0?E5e(r):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=Cr(i,{enter:()=>t.enter,leave:()=>t.leave}),u=Cr(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Cr(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return z4(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),$4(e,...t.base,...s,...c),a.nextFrame(()=>{z4(e,...t.base,...s,...c),$4(e,...t.base,...s,...u),v5e(e,()=>(z4(e,...t.base,...s),$4(e,...t.base,...t.entered),o()))}),a.dispose}function T5e({immediate:e,container:t,direction:n,classes:r,onStart:i,onStop:a}){let o=kT(),s=pc(),u=wo(n);Gi(()=>{e&&(u.current="enter")},[e]),Gi(()=>{let c=vl();s.add(c.dispose);let p=t.current;if(p&&u.current!=="idle"&&o.current)return c.dispose(),i.current(u.current),c.add(_5e(p,r.current,u.current==="enter",()=>{c.dispose(),a.current(u.current)})),c.dispose},[n])}function Bs(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let $2=C.createContext(null);$2.displayName="TransitionContext";var S5e=(e=>(e.Visible="visible",e.Hidden="hidden",e))(S5e||{});function w5e(){let e=C.useContext($2);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}function A5e(){let e=C.useContext(z2);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}let z2=C.createContext(null);z2.displayName="NestingContext";function H2(e){return"children"in e?H2(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function kB(e,t){let n=wo(e),r=C.useRef([]),i=kT(),a=pc(),o=Zt((g,b=Qs.Hidden)=>{let y=r.current.findIndex(({el:T})=>T===g);y!==-1&&(Cr(b,{[Qs.Unmount](){r.current.splice(y,1)},[Qs.Hidden](){r.current[y].state="hidden"}}),a.microTask(()=>{var T;!H2(r)&&i.current&&((T=n.current)==null||T.call(n))}))}),s=Zt(g=>{let b=r.current.find(({el:y})=>y===g);return b?b.state!=="visible"&&(b.state="visible"):r.current.push({el:g,state:"visible"}),()=>o(g,Qs.Unmount)}),u=C.useRef([]),c=C.useRef(Promise.resolve()),p=C.useRef({enter:[],leave:[],idle:[]}),f=Zt((g,b,y)=>{u.current.splice(0),t&&(t.chains.current[b]=t.chains.current[b].filter(([T])=>T!==g)),t==null||t.chains.current[b].push([g,new Promise(T=>{u.current.push(T)})]),t==null||t.chains.current[b].push([g,new Promise(T=>{Promise.all(p.current[b].map(([E,v])=>v)).then(()=>T())})]),b==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(b)):y(b)}),m=Zt((g,b,y)=>{Promise.all(p.current[b].splice(0).map(([T,E])=>E)).then(()=>{var T;(T=u.current.shift())==null||T()}).then(()=>y(b))});return C.useMemo(()=>({children:r,register:s,unregister:o,onStart:f,onStop:m,wait:c,chains:p}),[s,o,r,f,m,p,c])}function C5e(){}let k5e=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function nN(e){var t;let n={};for(let r of k5e)n[r]=(t=e[r])!=null?t:C5e;return n}function x5e(e){let t=C.useRef(nN(e));return C.useEffect(()=>{t.current=nN(e)},[e]),t}let I5e="div",xB=nm.RenderStrategy;function R5e(e,t){var n,r;let{beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s,enter:u,enterFrom:c,enterTo:p,entered:f,leave:m,leaveFrom:g,leaveTo:b,...y}=e,T=C.useRef(null),E=Pu(T,t),v=(n=y.unmount)==null||n?Qs.Unmount:Qs.Hidden,{show:w,appear:A,initial:R}=w5e(),[k,N]=C.useState(w?"visible":"hidden"),B=A5e(),{register:q,unregister:P}=B;C.useEffect(()=>q(T),[q,T]),C.useEffect(()=>{if(v===Qs.Hidden&&T.current){if(w&&k!=="visible"){N("visible");return}return Cr(k,{hidden:()=>P(T),visible:()=>q(T)})}},[k,T,q,P,w,v]);let Q=wo({base:Bs(y.className),enter:Bs(u),enterFrom:Bs(c),enterTo:Bs(p),entered:Bs(f),leave:Bs(m),leaveFrom:Bs(g),leaveTo:Bs(b)}),$=x5e({beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s}),oe=ST();C.useEffect(()=>{if(oe&&k==="visible"&&T.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[T,k,oe]);let fe=R&&!A,ce=A&&w&&R,De=(()=>!oe||fe?"idle":w?"enter":"leave")(),H=y5e(0),W=Zt(L=>Cr(L,{enter:()=>{H.addFlag(Li.Opening),$.current.beforeEnter()},leave:()=>{H.addFlag(Li.Closing),$.current.beforeLeave()},idle:()=>{}})),se=Zt(L=>Cr(L,{enter:()=>{H.removeFlag(Li.Opening),$.current.afterEnter()},leave:()=>{H.removeFlag(Li.Closing),$.current.afterLeave()},idle:()=>{}})),D=kB(()=>{N("hidden"),P(T)},B);T5e({immediate:ce,container:T,classes:Q,direction:De,onStart:wo(L=>{D.onStart(T,L,W)}),onStop:wo(L=>{D.onStop(T,L,se),L==="leave"&&!H2(D)&&(N("hidden"),P(T))})});let pe=y,le={ref:E};return ce?pe={...pe,className:tm(y.className,...Q.current.enter,...Q.current.enterFrom)}:(pe.className=tm(y.className,(r=T.current)==null?void 0:r.className),pe.className===""&&delete pe.className),st.createElement(z2.Provider,{value:D},st.createElement(CB,{value:Cr(k,{visible:Li.Open,hidden:Li.Closed})|H.flags},Rl({ourProps:le,theirProps:pe,defaultTag:I5e,features:xB,visible:k==="visible",name:"Transition.Child"})))}function N5e(e,t){let{show:n,appear:r=!1,unmount:i=!0,...a}=e,o=C.useRef(null),s=Pu(o,t);ST();let u=CT();if(n===void 0&&u!==null&&(n=(u&Li.Open)===Li.Open),![!0,!1].includes(n))throw new Error("A is used but it is missing a `show={true | false}` prop.");let[c,p]=C.useState(n?"visible":"hidden"),f=kB(()=>{p("hidden")}),[m,g]=C.useState(!0),b=C.useRef([n]);Gi(()=>{m!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),g(!1))},[b,n]);let y=C.useMemo(()=>({show:n,appear:r,initial:m}),[n,r,m]);C.useEffect(()=>{if(n)p("visible");else if(!H2(f))p("hidden");else{let w=o.current;if(!w)return;let A=w.getBoundingClientRect();A.x===0&&A.y===0&&A.width===0&&A.height===0&&p("hidden")}},[n,f]);let T={unmount:i},E=Zt(()=>{var w;m&&g(!1),(w=e.beforeEnter)==null||w.call(e)}),v=Zt(()=>{var w;m&&g(!1),(w=e.beforeLeave)==null||w.call(e)});return st.createElement(z2.Provider,{value:f},st.createElement($2.Provider,{value:y},Rl({ourProps:{...T,as:C.Fragment,children:st.createElement(IB,{ref:s,...T,...a,beforeEnter:E,beforeLeave:v})},theirProps:{},defaultTag:C.Fragment,features:xB,visible:c==="visible",name:"Transition"})))}function O5e(e,t){let n=C.useContext($2)!==null,r=CT()!==null;return st.createElement(st.Fragment,null,!n&&r?st.createElement(Qy,{ref:t,...e}):st.createElement(IB,{ref:t,...e}))}let Qy=ys(N5e),IB=ys(R5e),D5e=ys(O5e),L5e=Object.assign(Qy,{Child:D5e,Root:Qy});const M5e=Ge.div` @@ -1069,7 +1069,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho opacity: 0.4; } } -`;function Y3e(e){const t=window.vscMediaUrl;return I.jsx(K3e,{children:t?I.jsx("img",{src:`${t}/play_button.png`,width:"22px"}):I.jsx(AL,{width:e.size||WB})})}const aE=({msg:e})=>{const t="info-hover",n=document.getElementById("tooltip-portal-div");return I.jsxs(I.Fragment,{children:[I.jsx(MZ,{"data-tooltip-id":t,className:"h-5 w-5 text-gray-500 cursor-help"}),n&&u9.createPortal(I.jsx(au,{id:t,place:"bottom",children:e}),n)]})};var bf=e=>e.type==="checkbox",F1=e=>e instanceof Date,ei=e=>e==null;const qB=e=>typeof e=="object";var ir=e=>!ei(e)&&!Array.isArray(e)&&qB(e)&&!F1(e),X3e=e=>ir(e)&&e.target?bf(e.target)?e.target.checked:e.target.value:e,Z3e=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Q3e=(e,t)=>e.has(Z3e(t)),J3e=e=>{const t=e.constructor&&e.constructor.prototype;return ir(t)&&t.hasOwnProperty("isPrototypeOf")},FT=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Qo(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(FT&&(e instanceof Blob||e instanceof FileList))&&(n||ir(e)))if(t=n?[]:{},!n&&!J3e(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Qo(e[r]));else return e;return t}var yf=e=>Array.isArray(e)?e.filter(Boolean):[],qn=e=>e===void 0,ut=(e,t,n)=>{if(!t||!ir(e))return n;const r=yf(t.split(/[,[\].]+?/)).reduce((i,a)=>ei(i)?i:i[a],e);return qn(r)||r===e?qn(e[t])?n:e[t]:r},lu=e=>typeof e=="boolean";const fN={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ha={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Yo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},e4e=st.createContext(null),KB=e=>{const{children:t,...n}=e;return st.createElement(e4e.Provider,{value:n},t)};var t4e=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Ha.all&&(t._proxyFormState[o]=!r||Ha.all),n&&(n[o]=!0),e[o]}});return i},sa=e=>ir(e)&&!Object.keys(e).length,n4e=(e,t,n,r)=>{n(e);const{name:i,...a}=e;return sa(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!r||Ha.all))},V4=e=>Array.isArray(e)?e:[e];function r4e(e){const t=st.useRef(e);t.current=e,st.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var Eo=e=>typeof e=="string",i4e=(e,t,n,r,i)=>Eo(e)?(r&&t.watch.add(e),ut(n,e,i)):Array.isArray(e)?e.map(a=>(r&&t.watch.add(a),ut(n,a))):(r&&(t.watchAll=!0),n),PT=e=>/^\w*$/.test(e),YB=e=>yf(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Cn(e,t,n){let r=-1;const i=PT(t)?[t]:YB(t),a=i.length,o=a-1;for(;++rt?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{};const oE=(e,t,n)=>{for(const r of n||Object.keys(e)){const i=ut(e,r);if(i){const{_f:a,...o}=i;if(a&&t(a.name)){if(a.ref.focus){a.ref.focus();break}else if(a.refs&&a.refs[0].focus){a.refs[0].focus();break}}else ir(o)&&oE(o,t)}}};var hN=e=>({isOnSubmit:!e||e===Ha.onSubmit,isOnBlur:e===Ha.onBlur,isOnChange:e===Ha.onChange,isOnAll:e===Ha.all,isOnTouch:e===Ha.onTouched}),gN=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length)))),o4e=(e,t,n)=>{const r=yf(ut(e,n));return Cn(r,"root",t[n]),Cn(e,n,r),e},BT=e=>e.type==="file",Js=e=>typeof e=="function",rm=e=>{if(!FT)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},qh=e=>Eo(e),UT=e=>e.type==="radio",im=e=>e instanceof RegExp;const mN={value:!1,isValid:!1},bN={value:!0,isValid:!0};var XB=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&&!qn(e[0].attributes.value)?qn(e[0].value)||e[0].value===""?bN:{value:e[0].value,isValid:!0}:bN:mN}return mN};const yN={isValid:!1,value:null};var ZB=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,yN):yN;function EN(e,t,n="validate"){if(qh(e)||Array.isArray(e)&&e.every(qh)||lu(e)&&!e)return{type:n,message:qh(e)?e:"",ref:t}}var a1=e=>ir(e)&&!im(e)?e:{value:e,message:""},vN=async(e,t,n,r,i)=>{const{ref:a,refs:o,required:s,maxLength:u,minLength:c,min:p,max:f,pattern:m,validate:g,name:b,valueAsNumber:y,mount:T,disabled:E}=e._f,v=ut(t,b);if(!T||E)return{};const w=o?o[0]:a,A=$=>{r&&w.reportValidity&&(w.setCustomValidity(lu($)?"":$||""),w.reportValidity())},R={},k=UT(a),N=bf(a),B=k||N,q=(y||BT(a))&&qn(a.value)&&qn(v)||rm(a)&&a.value===""||v===""||Array.isArray(v)&&!v.length,P=a4e.bind(null,b,n,R),Q=($,oe,fe,ce=Yo.maxLength,De=Yo.minLength)=>{const H=$?oe:fe;R[b]={type:$?ce:De,message:H,ref:a,...P($?ce:De,H)}};if(i?!Array.isArray(v)||!v.length:s&&(!B&&(q||ei(v))||lu(v)&&!v||N&&!XB(o).isValid||k&&!ZB(o).isValid)){const{value:$,message:oe}=qh(s)?{value:!!s,message:s}:a1(s);if($&&(R[b]={type:Yo.required,message:oe,ref:w,...P(Yo.required,oe)},!n))return A(oe),R}if(!q&&(!ei(p)||!ei(f))){let $,oe;const fe=a1(f),ce=a1(p);if(!ei(v)&&!isNaN(v)){const De=a.valueAsNumber||v&&+v;ei(fe.value)||($=De>fe.value),ei(ce.value)||(oe=Denew Date(new Date().toDateString()+" "+D),W=a.type=="time",se=a.type=="week";Eo(fe.value)&&v&&($=W?H(v)>H(fe.value):se?v>fe.value:De>new Date(fe.value)),Eo(ce.value)&&v&&(oe=W?H(v)+$.value,ce=!ei(oe.value)&&v.length<+oe.value;if((fe||ce)&&(Q(fe,$.message,oe.message),!n))return A(R[b].message),R}if(m&&!q&&Eo(v)){const{value:$,message:oe}=a1(m);if(im($)&&!v.match($)&&(R[b]={type:Yo.pattern,message:oe,ref:a,...P(Yo.pattern,oe)},!n))return A(oe),R}if(g){if(Js(g)){const $=await g(v,t),oe=EN($,w);if(oe&&(R[b]={...oe,...P(Yo.validate,oe.message)},!n))return A(oe.message),R}else if(ir(g)){let $={};for(const oe in g){if(!sa($)&&!n)break;const fe=EN(await g[oe](v,t),w,oe);fe&&($={...fe,...P(oe,fe.message)},A(fe.message),n&&(R[b]=$))}if(!sa($)&&(R[b]={ref:w,...$},!n))return R}}return A(!0),R};function s4e(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}}var am=e=>ei(e)||!qB(e);function uu(e,t){if(am(e)||am(t))return e===t;if(F1(e)&&F1(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const a=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=t[i];if(F1(a)&&F1(o)||ir(a)&&ir(o)||Array.isArray(a)&&Array.isArray(o)?!uu(a,o):a!==o)return!1}}return!0}var QB=e=>e.type==="select-multiple",u4e=e=>UT(e)||bf(e),q4=e=>rm(e)&&e.isConnected,JB=e=>{for(const t in e)if(Js(e[t]))return!0;return!1};function om(e,t={}){const n=Array.isArray(e);if(ir(e)||n)for(const r in e)Array.isArray(e[r])||ir(e[r])&&!JB(e[r])?(t[r]=Array.isArray(e[r])?[]:{},om(e[r],t[r])):ei(e[r])||(t[r]=!0);return t}function eU(e,t,n){const r=Array.isArray(e);if(ir(e)||r)for(const i in e)Array.isArray(e[i])||ir(e[i])&&!JB(e[i])?qn(t)||am(n[i])?n[i]=Array.isArray(e[i])?om(e[i],[]):{...om(e[i])}:eU(e[i],ei(t)?{}:t[i],n[i]):n[i]=!uu(e[i],t[i]);return n}var K4=(e,t)=>eU(e,t,om(t)),tU=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>qn(e)?e:t?e===""?NaN:e&&+e:n&&Eo(e)?new Date(e):r?r(e):e;function Y4(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return BT(t)?t.files:UT(t)?ZB(e.refs).value:QB(t)?[...t.selectedOptions].map(({value:n})=>n):bf(t)?XB(e.refs).value:tU(qn(t.value)?e.ref.value:t.value,e)}var c4e=(e,t,n,r)=>{const i={};for(const a of e){const o=ut(t,a);o&&Cn(i,a,o._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},yd=e=>qn(e)?e:im(e)?e.source:ir(e)?im(e.value)?e.value.source:e.value:e,d4e=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function _N(e,t,n){const r=ut(e,n);if(r||PT(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const a=i.join("."),o=ut(t,a),s=ut(e,a);if(o&&!Array.isArray(o)&&n!==a)return{name:n};if(s&&s.type)return{name:a,error:s};i.pop()}return{name:n}}var p4e=(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,f4e=(e,t)=>!yf(ut(e,t)).length&&vr(e,t);const h4e={mode:Ha.onSubmit,reValidateMode:Ha.onChange,shouldFocusError:!0};function g4e(e={},t){let n={...h4e,...e},r={submitCount:0,isDirty:!1,isLoading:Js(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},i={},a=ir(n.defaultValues)||ir(n.values)?Qo(n.defaultValues||n.values)||{}:{},o=n.shouldUnregister?{}:Qo(a),s={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,p=0;const f={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={values:W4(),array:W4(),state:W4()},g=e.resetOptions&&e.resetOptions.keepDirtyValues,b=hN(n.mode),y=hN(n.reValidateMode),T=n.criteriaMode===Ha.all,E=U=>re=>{clearTimeout(p),p=setTimeout(U,re)},v=async U=>{if(f.isValid||U){const re=n.resolver?sa((await q()).errors):await Q(i,!0);re!==r.isValid&&m.state.next({isValid:re})}},w=U=>f.isValidating&&m.state.next({isValidating:U}),A=(U,re=[],de,xe,ye=!0,Te=!0)=>{if(xe&&de){if(s.action=!0,Te&&Array.isArray(ut(i,U))){const Le=de(ut(i,U),xe.argA,xe.argB);ye&&Cn(i,U,Le)}if(Te&&Array.isArray(ut(r.errors,U))){const Le=de(ut(r.errors,U),xe.argA,xe.argB);ye&&Cn(r.errors,U,Le),f4e(r.errors,U)}if(f.touchedFields&&Te&&Array.isArray(ut(r.touchedFields,U))){const Le=de(ut(r.touchedFields,U),xe.argA,xe.argB);ye&&Cn(r.touchedFields,U,Le)}f.dirtyFields&&(r.dirtyFields=K4(a,o)),m.state.next({name:U,isDirty:oe(U,re),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Cn(o,U,re)},R=(U,re)=>{Cn(r.errors,U,re),m.state.next({errors:r.errors})},k=(U,re,de,xe)=>{const ye=ut(i,U);if(ye){const Te=ut(o,U,qn(de)?ut(a,U):de);qn(Te)||xe&&xe.defaultChecked||re?Cn(o,U,re?Te:Y4(ye._f)):De(U,Te),s.mount&&v()}},N=(U,re,de,xe,ye)=>{let Te=!1,Le=!1;const ze={name:U};if(!de||xe){f.isDirty&&(Le=r.isDirty,r.isDirty=ze.isDirty=oe(),Te=Le!==ze.isDirty);const Ye=uu(ut(a,U),re);Le=ut(r.dirtyFields,U),Ye?vr(r.dirtyFields,U):Cn(r.dirtyFields,U,!0),ze.dirtyFields=r.dirtyFields,Te=Te||f.dirtyFields&&Le!==!Ye}if(de){const Ye=ut(r.touchedFields,U);Ye||(Cn(r.touchedFields,U,de),ze.touchedFields=r.touchedFields,Te=Te||f.touchedFields&&Ye!==de)}return Te&&ye&&m.state.next(ze),Te?ze:{}},B=(U,re,de,xe)=>{const ye=ut(r.errors,U),Te=f.isValid&&lu(re)&&r.isValid!==re;if(e.delayError&&de?(c=E(()=>R(U,de)),c(e.delayError)):(clearTimeout(p),c=null,de?Cn(r.errors,U,de):vr(r.errors,U)),(de?!uu(ye,de):ye)||!sa(xe)||Te){const Le={...xe,...Te&&lu(re)?{isValid:re}:{},errors:r.errors,name:U};r={...r,...Le},m.state.next(Le)}w(!1)},q=async U=>n.resolver(o,n.context,c4e(U||u.mount,i,n.criteriaMode,n.shouldUseNativeValidation)),P=async U=>{const{errors:re}=await q(U);if(U)for(const de of U){const xe=ut(re,de);xe?Cn(r.errors,de,xe):vr(r.errors,de)}else r.errors=re;return re},Q=async(U,re,de={valid:!0})=>{for(const xe in U){const ye=U[xe];if(ye){const{_f:Te,...Le}=ye;if(Te){const ze=u.array.has(Te.name),Ye=await vN(ye,o,T,n.shouldUseNativeValidation&&!re,ze);if(Ye[Te.name]&&(de.valid=!1,re))break;!re&&(ut(Ye,Te.name)?ze?o4e(r.errors,Ye,Te.name):Cn(r.errors,Te.name,Ye[Te.name]):vr(r.errors,Te.name))}Le&&await Q(Le,re,de)}}return de.valid},$=()=>{for(const U of u.unMount){const re=ut(i,U);re&&(re._f.refs?re._f.refs.every(de=>!q4(de)):!q4(re._f.ref))&&X(U)}u.unMount=new Set},oe=(U,re)=>(U&&re&&Cn(o,U,re),!uu(pe(),a)),fe=(U,re,de)=>i4e(U,u,{...s.mount?o:qn(re)?a:Eo(U)?{[U]:re}:re},de,re),ce=U=>yf(ut(s.mount?o:a,U,e.shouldUnregister?ut(a,U,[]):[])),De=(U,re,de={})=>{const xe=ut(i,U);let ye=re;if(xe){const Te=xe._f;Te&&(!Te.disabled&&Cn(o,U,tU(re,Te)),ye=rm(Te.ref)&&ei(re)?"":re,QB(Te.ref)?[...Te.ref.options].forEach(Le=>Le.selected=ye.includes(Le.value)):Te.refs?bf(Te.ref)?Te.refs.length>1?Te.refs.forEach(Le=>(!Le.defaultChecked||!Le.disabled)&&(Le.checked=Array.isArray(ye)?!!ye.find(ze=>ze===Le.value):ye===Le.value)):Te.refs[0]&&(Te.refs[0].checked=!!ye):Te.refs.forEach(Le=>Le.checked=Le.value===ye):BT(Te.ref)?Te.ref.value="":(Te.ref.value=ye,Te.ref.type||m.values.next({name:U,values:{...o}})))}(de.shouldDirty||de.shouldTouch)&&N(U,ye,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&D(U)},H=(U,re,de)=>{for(const xe in re){const ye=re[xe],Te=`${U}.${xe}`,Le=ut(i,Te);(u.array.has(U)||!am(ye)||Le&&!Le._f)&&!F1(ye)?H(Te,ye,de):De(Te,ye,de)}},W=(U,re,de={})=>{const xe=ut(i,U),ye=u.array.has(U),Te=Qo(re);Cn(o,U,Te),ye?(m.array.next({name:U,values:{...o}}),(f.isDirty||f.dirtyFields)&&de.shouldDirty&&m.state.next({name:U,dirtyFields:K4(a,o),isDirty:oe(U,Te)})):xe&&!xe._f&&!ei(Te)?H(U,Te,de):De(U,Te,de),gN(U,u)&&m.state.next({...r}),m.values.next({name:U,values:{...o}}),!s.mount&&t()},se=async U=>{const re=U.target;let de=re.name,xe=!0;const ye=ut(i,de),Te=()=>re.type?Y4(ye._f):X3e(U);if(ye){let Le,ze;const Ye=Te(),jt=U.type===fN.BLUR||U.type===fN.FOCUS_OUT,ue=!d4e(ye._f)&&!n.resolver&&!ut(r.errors,de)&&!ye._f.deps||p4e(jt,ut(r.touchedFields,de),r.isSubmitted,y,b),Ee=gN(de,u,jt);Cn(o,de,Ye),jt?(ye._f.onBlur&&ye._f.onBlur(U),c&&c(0)):ye._f.onChange&&ye._f.onChange(U);const qe=N(de,Ye,jt,!1),j=!sa(qe)||Ee;if(!jt&&m.values.next({name:de,type:U.type,values:{...o}}),ue)return f.isValid&&v(),j&&m.state.next({name:de,...Ee?{}:qe});if(!jt&&Ee&&m.state.next({...r}),w(!0),n.resolver){const{errors:me}=await q([de]),Ve=_N(r.errors,i,de),ge=_N(me,i,Ve.name||de);Le=ge.error,de=ge.name,ze=sa(me)}else Le=(await vN(ye,o,T,n.shouldUseNativeValidation))[de],xe=Number.isNaN(Ye)||Ye===ut(o,de,Ye),xe&&(Le?ze=!1:f.isValid&&(ze=await Q(i,!0)));xe&&(ye._f.deps&&D(ye._f.deps),B(de,ze,Le,qe))}},D=async(U,re={})=>{let de,xe;const ye=V4(U);if(w(!0),n.resolver){const Te=await P(qn(U)?U:ye);de=sa(Te),xe=U?!ye.some(Le=>ut(Te,Le)):de}else U?(xe=(await Promise.all(ye.map(async Te=>{const Le=ut(i,Te);return await Q(Le&&Le._f?{[Te]:Le}:Le)}))).every(Boolean),!(!xe&&!r.isValid)&&v()):xe=de=await Q(i);return m.state.next({...!Eo(U)||f.isValid&&de!==r.isValid?{}:{name:U},...n.resolver||!U?{isValid:de}:{},errors:r.errors,isValidating:!1}),re.shouldFocus&&!xe&&oE(i,Te=>Te&&ut(r.errors,Te),U?ye:u.mount),xe},pe=U=>{const re={...a,...s.mount?o:{}};return qn(U)?re:Eo(U)?ut(re,U):U.map(de=>ut(re,de))},le=(U,re)=>({invalid:!!ut((re||r).errors,U),isDirty:!!ut((re||r).dirtyFields,U),isTouched:!!ut((re||r).touchedFields,U),error:ut((re||r).errors,U)}),L=U=>{U&&V4(U).forEach(re=>vr(r.errors,re)),m.state.next({errors:U?r.errors:{}})},ie=(U,re,de)=>{const xe=(ut(i,U,{_f:{}})._f||{}).ref;Cn(r.errors,U,{...re,ref:xe}),m.state.next({name:U,errors:r.errors,isValid:!1}),de&&de.shouldFocus&&xe&&xe.focus&&xe.focus()},Se=(U,re)=>Js(U)?m.values.subscribe({next:de=>U(fe(void 0,re),de)}):fe(U,re,!0),X=(U,re={})=>{for(const de of U?V4(U):u.mount)u.mount.delete(de),u.array.delete(de),re.keepValue||(vr(i,de),vr(o,de)),!re.keepError&&vr(r.errors,de),!re.keepDirty&&vr(r.dirtyFields,de),!re.keepTouched&&vr(r.touchedFields,de),!n.shouldUnregister&&!re.keepDefaultValue&&vr(a,de);m.values.next({values:{...o}}),m.state.next({...r,...re.keepDirty?{isDirty:oe()}:{}}),!re.keepIsValid&&v()},ke=({disabled:U,name:re,field:de,fields:xe})=>{if(lu(U)){const ye=U?void 0:ut(o,re,Y4(de?de._f:ut(xe,re)._f));Cn(o,re,ye),N(re,ye,!1,!1,!0)}},te=(U,re={})=>{let de=ut(i,U);const xe=lu(re.disabled);return Cn(i,U,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:U}},name:U,mount:!0,...re}}),u.mount.add(U),de?ke({field:de,disabled:re.disabled,name:U}):k(U,!0,re.value),{...xe?{disabled:re.disabled}:{},...n.progressive?{required:!!re.required,min:yd(re.min),max:yd(re.max),minLength:yd(re.minLength),maxLength:yd(re.maxLength),pattern:yd(re.pattern)}:{},name:U,onChange:se,onBlur:se,ref:ye=>{if(ye){te(U,re),de=ut(i,U);const Te=qn(ye.value)&&ye.querySelectorAll&&ye.querySelectorAll("input,select,textarea")[0]||ye,Le=u4e(Te),ze=de._f.refs||[];if(Le?ze.find(Ye=>Ye===Te):Te===de._f.ref)return;Cn(i,U,{_f:{...de._f,...Le?{refs:[...ze.filter(q4),Te,...Array.isArray(ut(a,U))?[{}]:[]],ref:{type:Te.type,name:U}}:{ref:Te}}}),k(U,!1,void 0,Te)}else de=ut(i,U,{}),de._f&&(de._f.mount=!1),(n.shouldUnregister||re.shouldUnregister)&&!(Q3e(u.array,U)&&s.action)&&u.unMount.add(U)}}},Me=()=>n.shouldFocusError&&oE(i,U=>U&&ut(r.errors,U),u.mount),Re=(U,re)=>async de=>{de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let xe=Qo(o);if(m.state.next({isSubmitting:!0}),n.resolver){const{errors:ye,values:Te}=await q();r.errors=ye,xe=Te}else await Q(i);vr(r.errors,"root"),sa(r.errors)?(m.state.next({errors:{}}),await U(xe,de)):(re&&await re({...r.errors},de),Me(),setTimeout(Me)),m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:sa(r.errors),submitCount:r.submitCount+1,errors:r.errors})},Ze=(U,re={})=>{ut(i,U)&&(qn(re.defaultValue)?W(U,ut(a,U)):(W(U,re.defaultValue),Cn(a,U,re.defaultValue)),re.keepTouched||vr(r.touchedFields,U),re.keepDirty||(vr(r.dirtyFields,U),r.isDirty=re.defaultValue?oe(U,ut(a,U)):oe()),re.keepError||(vr(r.errors,U),f.isValid&&v()),m.state.next({...r}))},We=(U,re={})=>{const de=U?Qo(U):a,xe=Qo(de),ye=U&&!sa(U)?xe:a;if(re.keepDefaultValues||(a=de),!re.keepValues){if(re.keepDirtyValues||g)for(const Te of u.mount)ut(r.dirtyFields,Te)?Cn(ye,Te,ut(o,Te)):W(Te,ut(ye,Te));else{if(FT&&qn(U))for(const Te of u.mount){const Le=ut(i,Te);if(Le&&Le._f){const ze=Array.isArray(Le._f.refs)?Le._f.refs[0]:Le._f.ref;if(rm(ze)){const Ye=ze.closest("form");if(Ye){Ye.reset();break}}}}i={}}o=e.shouldUnregister?re.keepDefaultValues?Qo(a):{}:Qo(ye),m.array.next({values:{...ye}}),m.values.next({values:{...ye}})}u={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!s.mount&&t(),s.mount=!f.isValid||!!re.keepIsValid,s.watch=!!e.shouldUnregister,m.state.next({submitCount:re.keepSubmitCount?r.submitCount:0,isDirty:re.keepDirty?r.isDirty:!!(re.keepDefaultValues&&!uu(U,a)),isSubmitted:re.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:re.keepDirtyValues?r.dirtyFields:re.keepDefaultValues&&U?K4(a,U):{},touchedFields:re.keepTouched?r.touchedFields:{},errors:re.keepErrors?r.errors:{},isSubmitSuccessful:re.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},dt=(U,re)=>We(Js(U)?U(o):U,re);return{control:{register:te,unregister:X,getFieldState:le,handleSubmit:Re,setError:ie,_executeSchema:q,_getWatch:fe,_getDirty:oe,_updateValid:v,_removeUnmounted:$,_updateFieldArray:A,_updateDisabledField:ke,_getFieldArray:ce,_reset:We,_resetDefaultValues:()=>Js(n.defaultValues)&&n.defaultValues().then(U=>{dt(U,n.resetOptions),m.state.next({isLoading:!1})}),_updateFormState:U=>{r={...r,...U}},_subjects:m,_proxyFormState:f,get _fields(){return i},get _formValues(){return o},get _state(){return s},set _state(U){s=U},get _defaultValues(){return a},get _names(){return u},set _names(U){u=U},get _formState(){return r},set _formState(U){r=U},get _options(){return n},set _options(U){n={...n,...U}}},trigger:D,register:te,handleSubmit:Re,watch:Se,setValue:W,getValues:pe,reset:dt,resetField:Ze,clearErrors:L,unregister:X,setError:ie,setFocus:(U,re={})=>{const de=ut(i,U),xe=de&&de._f;if(xe){const ye=xe.refs?xe.refs[0]:xe.ref;ye.focus&&(ye.focus(),re.shouldSelect&&ye.select())}},getFieldState:le}}function nU(e={}){const t=st.useRef(),n=st.useRef(),[r,i]=st.useState({isDirty:!1,isValidating:!1,isLoading:Js(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Js(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...g4e(e,()=>i(o=>({...o}))),formState:r});const a=t.current.control;return a._options=e,r4e({subject:a._subjects.state,next:o=>{n4e(o,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),st.useEffect(()=>{e.values&&!uu(e.values,n.current)?(a._reset(e.values,a._options.resetOptions),n.current=e.values):a._resetDefaultValues()},[e.values,a]),st.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=t4e(r,a),t.current}const TN=Ge.hr` +`;function Y3e(e){const t=window.vscMediaUrl;return I.jsx(K3e,{children:t?I.jsx("img",{src:`${t}/play_button.png`,width:"22px"}):I.jsx(AL,{width:e.size||WB})})}const aE=({msg:e})=>{const t="info-hover",n=document.getElementById("tooltip-portal-div");return I.jsxs(I.Fragment,{children:[I.jsx(MZ,{"data-tooltip-id":t,className:"h-5 w-5 text-gray-500 cursor-help"}),n&&u9.createPortal(I.jsx(au,{id:t,place:"bottom",children:e}),n)]})};var bf=e=>e.type==="checkbox",F1=e=>e instanceof Date,ei=e=>e==null;const qB=e=>typeof e=="object";var ir=e=>!ei(e)&&!Array.isArray(e)&&qB(e)&&!F1(e),X3e=e=>ir(e)&&e.target?bf(e.target)?e.target.checked:e.target.value:e,Z3e=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Q3e=(e,t)=>e.has(Z3e(t)),J3e=e=>{const t=e.constructor&&e.constructor.prototype;return ir(t)&&t.hasOwnProperty("isPrototypeOf")},FT=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Qo(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(FT&&(e instanceof Blob||e instanceof FileList))&&(n||ir(e)))if(t=n?[]:{},!n&&!J3e(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Qo(e[r]));else return e;return t}var yf=e=>Array.isArray(e)?e.filter(Boolean):[],qn=e=>e===void 0,ut=(e,t,n)=>{if(!t||!ir(e))return n;const r=yf(t.split(/[,[\].]+?/)).reduce((i,a)=>ei(i)?i:i[a],e);return qn(r)||r===e?qn(e[t])?n:e[t]:r},lu=e=>typeof e=="boolean";const fN={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Ha={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Yo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},e4e=st.createContext(null),KB=e=>{const{children:t,...n}=e;return st.createElement(e4e.Provider,{value:n},t)};var t4e=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Ha.all&&(t._proxyFormState[o]=!r||Ha.all),n&&(n[o]=!0),e[o]}});return i},sa=e=>ir(e)&&!Object.keys(e).length,n4e=(e,t,n,r)=>{n(e);const{name:i,...a}=e;return sa(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(o=>t[o]===(!r||Ha.all))},V4=e=>Array.isArray(e)?e:[e];function r4e(e){const t=st.useRef(e);t.current=e,st.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}var Eo=e=>typeof e=="string",i4e=(e,t,n,r,i)=>Eo(e)?(r&&t.watch.add(e),ut(n,e,i)):Array.isArray(e)?e.map(a=>(r&&t.watch.add(a),ut(n,a))):(r&&(t.watchAll=!0),n),PT=e=>/^\w*$/.test(e),YB=e=>yf(e.replace(/["|']|\]/g,"").split(/\.|\[/));function Cn(e,t,n){let r=-1;const i=PT(t)?[t]:YB(t),a=i.length,o=a-1;for(;++rt?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{};const oE=(e,t,n)=>{for(const r of n||Object.keys(e)){const i=ut(e,r);if(i){const{_f:a,...o}=i;if(a&&t(a.name)){if(a.ref.focus){a.ref.focus();break}else if(a.refs&&a.refs[0].focus){a.refs[0].focus();break}}else ir(o)&&oE(o,t)}}};var hN=e=>({isOnSubmit:!e||e===Ha.onSubmit,isOnBlur:e===Ha.onBlur,isOnChange:e===Ha.onChange,isOnAll:e===Ha.all,isOnTouch:e===Ha.onTouched}),gN=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length)))),o4e=(e,t,n)=>{const r=yf(ut(e,n));return Cn(r,"root",t[n]),Cn(e,n,r),e},BT=e=>e.type==="file",Js=e=>typeof e=="function",rm=e=>{if(!FT)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},qh=e=>Eo(e),UT=e=>e.type==="radio",im=e=>e instanceof RegExp;const mN={value:!1,isValid:!1},bN={value:!0,isValid:!0};var XB=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&&!qn(e[0].attributes.value)?qn(e[0].value)||e[0].value===""?bN:{value:e[0].value,isValid:!0}:bN:mN}return mN};const yN={isValid:!1,value:null};var ZB=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,yN):yN;function EN(e,t,n="validate"){if(qh(e)||Array.isArray(e)&&e.every(qh)||lu(e)&&!e)return{type:n,message:qh(e)?e:"",ref:t}}var a1=e=>ir(e)&&!im(e)?e:{value:e,message:""},vN=async(e,t,n,r,i)=>{const{ref:a,refs:o,required:s,maxLength:u,minLength:c,min:p,max:f,pattern:m,validate:g,name:b,valueAsNumber:y,mount:T,disabled:E}=e._f,v=ut(t,b);if(!T||E)return{};const w=o?o[0]:a,A=$=>{r&&w.reportValidity&&(w.setCustomValidity(lu($)?"":$||""),w.reportValidity())},R={},k=UT(a),N=bf(a),B=k||N,q=(y||BT(a))&&qn(a.value)&&qn(v)||rm(a)&&a.value===""||v===""||Array.isArray(v)&&!v.length,P=a4e.bind(null,b,n,R),Q=($,oe,fe,ce=Yo.maxLength,De=Yo.minLength)=>{const H=$?oe:fe;R[b]={type:$?ce:De,message:H,ref:a,...P($?ce:De,H)}};if(i?!Array.isArray(v)||!v.length:s&&(!B&&(q||ei(v))||lu(v)&&!v||N&&!XB(o).isValid||k&&!ZB(o).isValid)){const{value:$,message:oe}=qh(s)?{value:!!s,message:s}:a1(s);if($&&(R[b]={type:Yo.required,message:oe,ref:w,...P(Yo.required,oe)},!n))return A(oe),R}if(!q&&(!ei(p)||!ei(f))){let $,oe;const fe=a1(f),ce=a1(p);if(!ei(v)&&!isNaN(v)){const De=a.valueAsNumber||v&&+v;ei(fe.value)||($=De>fe.value),ei(ce.value)||(oe=Denew Date(new Date().toDateString()+" "+D),W=a.type=="time",se=a.type=="week";Eo(fe.value)&&v&&($=W?H(v)>H(fe.value):se?v>fe.value:De>new Date(fe.value)),Eo(ce.value)&&v&&(oe=W?H(v)+$.value,ce=!ei(oe.value)&&v.length<+oe.value;if((fe||ce)&&(Q(fe,$.message,oe.message),!n))return A(R[b].message),R}if(m&&!q&&Eo(v)){const{value:$,message:oe}=a1(m);if(im($)&&!v.match($)&&(R[b]={type:Yo.pattern,message:oe,ref:a,...P(Yo.pattern,oe)},!n))return A(oe),R}if(g){if(Js(g)){const $=await g(v,t),oe=EN($,w);if(oe&&(R[b]={...oe,...P(Yo.validate,oe.message)},!n))return A(oe.message),R}else if(ir(g)){let $={};for(const oe in g){if(!sa($)&&!n)break;const fe=EN(await g[oe](v,t),w,oe);fe&&($={...fe,...P(oe,fe.message)},A(fe.message),n&&(R[b]=$))}if(!sa($)&&(R[b]={ref:w,...$},!n))return R}}return A(!0),R};function s4e(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{for(const a of e)a.next&&a.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(a=>a!==i)}}),unsubscribe:()=>{e=[]}}}var am=e=>ei(e)||!qB(e);function uu(e,t){if(am(e)||am(t))return e===t;if(F1(e)&&F1(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const a=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=t[i];if(F1(a)&&F1(o)||ir(a)&&ir(o)||Array.isArray(a)&&Array.isArray(o)?!uu(a,o):a!==o)return!1}}return!0}var QB=e=>e.type==="select-multiple",u4e=e=>UT(e)||bf(e),q4=e=>rm(e)&&e.isConnected,JB=e=>{for(const t in e)if(Js(e[t]))return!0;return!1};function om(e,t={}){const n=Array.isArray(e);if(ir(e)||n)for(const r in e)Array.isArray(e[r])||ir(e[r])&&!JB(e[r])?(t[r]=Array.isArray(e[r])?[]:{},om(e[r],t[r])):ei(e[r])||(t[r]=!0);return t}function eU(e,t,n){const r=Array.isArray(e);if(ir(e)||r)for(const i in e)Array.isArray(e[i])||ir(e[i])&&!JB(e[i])?qn(t)||am(n[i])?n[i]=Array.isArray(e[i])?om(e[i],[]):{...om(e[i])}:eU(e[i],ei(t)?{}:t[i],n[i]):n[i]=!uu(e[i],t[i]);return n}var K4=(e,t)=>eU(e,t,om(t)),tU=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>qn(e)?e:t?e===""?NaN:e&&+e:n&&Eo(e)?new Date(e):r?r(e):e;function Y4(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return BT(t)?t.files:UT(t)?ZB(e.refs).value:QB(t)?[...t.selectedOptions].map(({value:n})=>n):bf(t)?XB(e.refs).value:tU(qn(t.value)?e.ref.value:t.value,e)}var c4e=(e,t,n,r)=>{const i={};for(const a of e){const o=ut(t,a);o&&Cn(i,a,o._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},yd=e=>qn(e)?e:im(e)?e.source:ir(e)?im(e.value)?e.value.source:e.value:e,d4e=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function _N(e,t,n){const r=ut(e,n);if(r||PT(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const a=i.join("."),o=ut(t,a),s=ut(e,a);if(o&&!Array.isArray(o)&&n!==a)return{name:n};if(s&&s.type)return{name:a,error:s};i.pop()}return{name:n}}var p4e=(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,f4e=(e,t)=>!yf(ut(e,t)).length&&vr(e,t);const h4e={mode:Ha.onSubmit,reValidateMode:Ha.onChange,shouldFocusError:!0};function g4e(e={},t){let n={...h4e,...e},r={submitCount:0,isDirty:!1,isLoading:Js(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},i={},a=ir(n.defaultValues)||ir(n.values)?Qo(n.defaultValues||n.values)||{}:{},o=n.shouldUnregister?{}:Qo(a),s={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,p=0;const f={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={values:W4(),array:W4(),state:W4()},g=e.resetOptions&&e.resetOptions.keepDirtyValues,b=hN(n.mode),y=hN(n.reValidateMode),T=n.criteriaMode===Ha.all,E=U=>re=>{clearTimeout(p),p=setTimeout(U,re)},v=async U=>{if(f.isValid||U){const re=n.resolver?sa((await q()).errors):await Q(i,!0);re!==r.isValid&&m.state.next({isValid:re})}},w=U=>f.isValidating&&m.state.next({isValidating:U}),A=(U,re=[],de,xe,ye=!0,Te=!0)=>{if(xe&&de){if(s.action=!0,Te&&Array.isArray(ut(i,U))){const Le=de(ut(i,U),xe.argA,xe.argB);ye&&Cn(i,U,Le)}if(Te&&Array.isArray(ut(r.errors,U))){const Le=de(ut(r.errors,U),xe.argA,xe.argB);ye&&Cn(r.errors,U,Le),f4e(r.errors,U)}if(f.touchedFields&&Te&&Array.isArray(ut(r.touchedFields,U))){const Le=de(ut(r.touchedFields,U),xe.argA,xe.argB);ye&&Cn(r.touchedFields,U,Le)}f.dirtyFields&&(r.dirtyFields=K4(a,o)),m.state.next({name:U,isDirty:oe(U,re),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Cn(o,U,re)},R=(U,re)=>{Cn(r.errors,U,re),m.state.next({errors:r.errors})},k=(U,re,de,xe)=>{const ye=ut(i,U);if(ye){const Te=ut(o,U,qn(de)?ut(a,U):de);qn(Te)||xe&&xe.defaultChecked||re?Cn(o,U,re?Te:Y4(ye._f)):De(U,Te),s.mount&&v()}},N=(U,re,de,xe,ye)=>{let Te=!1,Le=!1;const ze={name:U};if(!de||xe){f.isDirty&&(Le=r.isDirty,r.isDirty=ze.isDirty=oe(),Te=Le!==ze.isDirty);const Xe=uu(ut(a,U),re);Le=ut(r.dirtyFields,U),Xe?vr(r.dirtyFields,U):Cn(r.dirtyFields,U,!0),ze.dirtyFields=r.dirtyFields,Te=Te||f.dirtyFields&&Le!==!Xe}if(de){const Xe=ut(r.touchedFields,U);Xe||(Cn(r.touchedFields,U,de),ze.touchedFields=r.touchedFields,Te=Te||f.touchedFields&&Xe!==de)}return Te&&ye&&m.state.next(ze),Te?ze:{}},B=(U,re,de,xe)=>{const ye=ut(r.errors,U),Te=f.isValid&&lu(re)&&r.isValid!==re;if(e.delayError&&de?(c=E(()=>R(U,de)),c(e.delayError)):(clearTimeout(p),c=null,de?Cn(r.errors,U,de):vr(r.errors,U)),(de?!uu(ye,de):ye)||!sa(xe)||Te){const Le={...xe,...Te&&lu(re)?{isValid:re}:{},errors:r.errors,name:U};r={...r,...Le},m.state.next(Le)}w(!1)},q=async U=>n.resolver(o,n.context,c4e(U||u.mount,i,n.criteriaMode,n.shouldUseNativeValidation)),P=async U=>{const{errors:re}=await q(U);if(U)for(const de of U){const xe=ut(re,de);xe?Cn(r.errors,de,xe):vr(r.errors,de)}else r.errors=re;return re},Q=async(U,re,de={valid:!0})=>{for(const xe in U){const ye=U[xe];if(ye){const{_f:Te,...Le}=ye;if(Te){const ze=u.array.has(Te.name),Xe=await vN(ye,o,T,n.shouldUseNativeValidation&&!re,ze);if(Xe[Te.name]&&(de.valid=!1,re))break;!re&&(ut(Xe,Te.name)?ze?o4e(r.errors,Xe,Te.name):Cn(r.errors,Te.name,Xe[Te.name]):vr(r.errors,Te.name))}Le&&await Q(Le,re,de)}}return de.valid},$=()=>{for(const U of u.unMount){const re=ut(i,U);re&&(re._f.refs?re._f.refs.every(de=>!q4(de)):!q4(re._f.ref))&&X(U)}u.unMount=new Set},oe=(U,re)=>(U&&re&&Cn(o,U,re),!uu(pe(),a)),fe=(U,re,de)=>i4e(U,u,{...s.mount?o:qn(re)?a:Eo(U)?{[U]:re}:re},de,re),ce=U=>yf(ut(s.mount?o:a,U,e.shouldUnregister?ut(a,U,[]):[])),De=(U,re,de={})=>{const xe=ut(i,U);let ye=re;if(xe){const Te=xe._f;Te&&(!Te.disabled&&Cn(o,U,tU(re,Te)),ye=rm(Te.ref)&&ei(re)?"":re,QB(Te.ref)?[...Te.ref.options].forEach(Le=>Le.selected=ye.includes(Le.value)):Te.refs?bf(Te.ref)?Te.refs.length>1?Te.refs.forEach(Le=>(!Le.defaultChecked||!Le.disabled)&&(Le.checked=Array.isArray(ye)?!!ye.find(ze=>ze===Le.value):ye===Le.value)):Te.refs[0]&&(Te.refs[0].checked=!!ye):Te.refs.forEach(Le=>Le.checked=Le.value===ye):BT(Te.ref)?Te.ref.value="":(Te.ref.value=ye,Te.ref.type||m.values.next({name:U,values:{...o}})))}(de.shouldDirty||de.shouldTouch)&&N(U,ye,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&D(U)},H=(U,re,de)=>{for(const xe in re){const ye=re[xe],Te=`${U}.${xe}`,Le=ut(i,Te);(u.array.has(U)||!am(ye)||Le&&!Le._f)&&!F1(ye)?H(Te,ye,de):De(Te,ye,de)}},W=(U,re,de={})=>{const xe=ut(i,U),ye=u.array.has(U),Te=Qo(re);Cn(o,U,Te),ye?(m.array.next({name:U,values:{...o}}),(f.isDirty||f.dirtyFields)&&de.shouldDirty&&m.state.next({name:U,dirtyFields:K4(a,o),isDirty:oe(U,Te)})):xe&&!xe._f&&!ei(Te)?H(U,Te,de):De(U,Te,de),gN(U,u)&&m.state.next({...r}),m.values.next({name:U,values:{...o}}),!s.mount&&t()},se=async U=>{const re=U.target;let de=re.name,xe=!0;const ye=ut(i,de),Te=()=>re.type?Y4(ye._f):X3e(U);if(ye){let Le,ze;const Xe=Te(),jt=U.type===fN.BLUR||U.type===fN.FOCUS_OUT,ue=!d4e(ye._f)&&!n.resolver&&!ut(r.errors,de)&&!ye._f.deps||p4e(jt,ut(r.touchedFields,de),r.isSubmitted,y,b),Ee=gN(de,u,jt);Cn(o,de,Xe),jt?(ye._f.onBlur&&ye._f.onBlur(U),c&&c(0)):ye._f.onChange&&ye._f.onChange(U);const qe=N(de,Xe,jt,!1),j=!sa(qe)||Ee;if(!jt&&m.values.next({name:de,type:U.type,values:{...o}}),ue)return f.isValid&&v(),j&&m.state.next({name:de,...Ee?{}:qe});if(!jt&&Ee&&m.state.next({...r}),w(!0),n.resolver){const{errors:me}=await q([de]),Ve=_N(r.errors,i,de),ge=_N(me,i,Ve.name||de);Le=ge.error,de=ge.name,ze=sa(me)}else Le=(await vN(ye,o,T,n.shouldUseNativeValidation))[de],xe=Number.isNaN(Xe)||Xe===ut(o,de,Xe),xe&&(Le?ze=!1:f.isValid&&(ze=await Q(i,!0)));xe&&(ye._f.deps&&D(ye._f.deps),B(de,ze,Le,qe))}},D=async(U,re={})=>{let de,xe;const ye=V4(U);if(w(!0),n.resolver){const Te=await P(qn(U)?U:ye);de=sa(Te),xe=U?!ye.some(Le=>ut(Te,Le)):de}else U?(xe=(await Promise.all(ye.map(async Te=>{const Le=ut(i,Te);return await Q(Le&&Le._f?{[Te]:Le}:Le)}))).every(Boolean),!(!xe&&!r.isValid)&&v()):xe=de=await Q(i);return m.state.next({...!Eo(U)||f.isValid&&de!==r.isValid?{}:{name:U},...n.resolver||!U?{isValid:de}:{},errors:r.errors,isValidating:!1}),re.shouldFocus&&!xe&&oE(i,Te=>Te&&ut(r.errors,Te),U?ye:u.mount),xe},pe=U=>{const re={...a,...s.mount?o:{}};return qn(U)?re:Eo(U)?ut(re,U):U.map(de=>ut(re,de))},le=(U,re)=>({invalid:!!ut((re||r).errors,U),isDirty:!!ut((re||r).dirtyFields,U),isTouched:!!ut((re||r).touchedFields,U),error:ut((re||r).errors,U)}),L=U=>{U&&V4(U).forEach(re=>vr(r.errors,re)),m.state.next({errors:U?r.errors:{}})},ie=(U,re,de)=>{const xe=(ut(i,U,{_f:{}})._f||{}).ref;Cn(r.errors,U,{...re,ref:xe}),m.state.next({name:U,errors:r.errors,isValid:!1}),de&&de.shouldFocus&&xe&&xe.focus&&xe.focus()},Se=(U,re)=>Js(U)?m.values.subscribe({next:de=>U(fe(void 0,re),de)}):fe(U,re,!0),X=(U,re={})=>{for(const de of U?V4(U):u.mount)u.mount.delete(de),u.array.delete(de),re.keepValue||(vr(i,de),vr(o,de)),!re.keepError&&vr(r.errors,de),!re.keepDirty&&vr(r.dirtyFields,de),!re.keepTouched&&vr(r.touchedFields,de),!n.shouldUnregister&&!re.keepDefaultValue&&vr(a,de);m.values.next({values:{...o}}),m.state.next({...r,...re.keepDirty?{isDirty:oe()}:{}}),!re.keepIsValid&&v()},ke=({disabled:U,name:re,field:de,fields:xe})=>{if(lu(U)){const ye=U?void 0:ut(o,re,Y4(de?de._f:ut(xe,re)._f));Cn(o,re,ye),N(re,ye,!1,!1,!0)}},te=(U,re={})=>{let de=ut(i,U);const xe=lu(re.disabled);return Cn(i,U,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:U}},name:U,mount:!0,...re}}),u.mount.add(U),de?ke({field:de,disabled:re.disabled,name:U}):k(U,!0,re.value),{...xe?{disabled:re.disabled}:{},...n.progressive?{required:!!re.required,min:yd(re.min),max:yd(re.max),minLength:yd(re.minLength),maxLength:yd(re.maxLength),pattern:yd(re.pattern)}:{},name:U,onChange:se,onBlur:se,ref:ye=>{if(ye){te(U,re),de=ut(i,U);const Te=qn(ye.value)&&ye.querySelectorAll&&ye.querySelectorAll("input,select,textarea")[0]||ye,Le=u4e(Te),ze=de._f.refs||[];if(Le?ze.find(Xe=>Xe===Te):Te===de._f.ref)return;Cn(i,U,{_f:{...de._f,...Le?{refs:[...ze.filter(q4),Te,...Array.isArray(ut(a,U))?[{}]:[]],ref:{type:Te.type,name:U}}:{ref:Te}}}),k(U,!1,void 0,Te)}else de=ut(i,U,{}),de._f&&(de._f.mount=!1),(n.shouldUnregister||re.shouldUnregister)&&!(Q3e(u.array,U)&&s.action)&&u.unMount.add(U)}}},Me=()=>n.shouldFocusError&&oE(i,U=>U&&ut(r.errors,U),u.mount),Re=(U,re)=>async de=>{de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let xe=Qo(o);if(m.state.next({isSubmitting:!0}),n.resolver){const{errors:ye,values:Te}=await q();r.errors=ye,xe=Te}else await Q(i);vr(r.errors,"root"),sa(r.errors)?(m.state.next({errors:{}}),await U(xe,de)):(re&&await re({...r.errors},de),Me(),setTimeout(Me)),m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:sa(r.errors),submitCount:r.submitCount+1,errors:r.errors})},Ye=(U,re={})=>{ut(i,U)&&(qn(re.defaultValue)?W(U,ut(a,U)):(W(U,re.defaultValue),Cn(a,U,re.defaultValue)),re.keepTouched||vr(r.touchedFields,U),re.keepDirty||(vr(r.dirtyFields,U),r.isDirty=re.defaultValue?oe(U,ut(a,U)):oe()),re.keepError||(vr(r.errors,U),f.isValid&&v()),m.state.next({...r}))},We=(U,re={})=>{const de=U?Qo(U):a,xe=Qo(de),ye=U&&!sa(U)?xe:a;if(re.keepDefaultValues||(a=de),!re.keepValues){if(re.keepDirtyValues||g)for(const Te of u.mount)ut(r.dirtyFields,Te)?Cn(ye,Te,ut(o,Te)):W(Te,ut(ye,Te));else{if(FT&&qn(U))for(const Te of u.mount){const Le=ut(i,Te);if(Le&&Le._f){const ze=Array.isArray(Le._f.refs)?Le._f.refs[0]:Le._f.ref;if(rm(ze)){const Xe=ze.closest("form");if(Xe){Xe.reset();break}}}}i={}}o=e.shouldUnregister?re.keepDefaultValues?Qo(a):{}:Qo(ye),m.array.next({values:{...ye}}),m.values.next({values:{...ye}})}u={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!s.mount&&t(),s.mount=!f.isValid||!!re.keepIsValid,s.watch=!!e.shouldUnregister,m.state.next({submitCount:re.keepSubmitCount?r.submitCount:0,isDirty:re.keepDirty?r.isDirty:!!(re.keepDefaultValues&&!uu(U,a)),isSubmitted:re.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:re.keepDirtyValues?r.dirtyFields:re.keepDefaultValues&&U?K4(a,U):{},touchedFields:re.keepTouched?r.touchedFields:{},errors:re.keepErrors?r.errors:{},isSubmitSuccessful:re.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},dt=(U,re)=>We(Js(U)?U(o):U,re);return{control:{register:te,unregister:X,getFieldState:le,handleSubmit:Re,setError:ie,_executeSchema:q,_getWatch:fe,_getDirty:oe,_updateValid:v,_removeUnmounted:$,_updateFieldArray:A,_updateDisabledField:ke,_getFieldArray:ce,_reset:We,_resetDefaultValues:()=>Js(n.defaultValues)&&n.defaultValues().then(U=>{dt(U,n.resetOptions),m.state.next({isLoading:!1})}),_updateFormState:U=>{r={...r,...U}},_subjects:m,_proxyFormState:f,get _fields(){return i},get _formValues(){return o},get _state(){return s},set _state(U){s=U},get _defaultValues(){return a},get _names(){return u},set _names(U){u=U},get _formState(){return r},set _formState(U){r=U},get _options(){return n},set _options(U){n={...n,...U}}},trigger:D,register:te,handleSubmit:Re,watch:Se,setValue:W,getValues:pe,reset:dt,resetField:Ye,clearErrors:L,unregister:X,setError:ie,setFocus:(U,re={})=>{const de=ut(i,U),xe=de&&de._f;if(xe){const ye=xe.refs?xe.refs[0]:xe.ref;ye.focus&&(ye.focus(),re.shouldSelect&&ye.select())}},getFieldState:le}}function nU(e={}){const t=st.useRef(),n=st.useRef(),[r,i]=st.useState({isDirty:!1,isValidating:!1,isLoading:Js(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Js(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...g4e(e,()=>i(o=>({...o}))),formState:r});const a=t.current.control;return a._options=e,r4e({subject:a._subjects.state,next:o=>{n4e(o,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),st.useEffect(()=>{e.values&&!uu(e.values,n.current)?(a._reset(e.values,a._options.resetOptions),n.current=e.values):a._resetDefaultValues()},[e.values,a]),st.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=t4e(r,a),t.current}const TN=Ge.hr` border: 0.5px solid ${Et}; `,m4e=Ge(oc)` background-color: transparent; @@ -1132,10 +1132,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */sm.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",c=500,p="__lodash_placeholder__",f=1,m=2,g=4,b=1,y=2,T=1,E=2,v=4,w=8,A=16,R=32,k=64,N=128,B=256,q=512,P=30,Q="...",$=800,oe=16,fe=1,ce=2,De=3,H=1/0,W=9007199254740991,se=17976931348623157e292,D=0/0,pe=4294967295,le=pe-1,L=pe>>>1,ie=[["ary",N],["bind",T],["bindKey",E],["curry",w],["curryRight",A],["flip",q],["partial",R],["partialRight",k],["rearg",B]],Se="[object Arguments]",X="[object Array]",ke="[object AsyncFunction]",te="[object Boolean]",Me="[object Date]",Re="[object DOMException]",Ze="[object Error]",We="[object Function]",dt="[object GeneratorFunction]",ot="[object Map]",je="[object Number]",pt="[object Null]",U="[object Object]",re="[object Promise]",de="[object Proxy]",xe="[object RegExp]",ye="[object Set]",Te="[object String]",Le="[object Symbol]",ze="[object Undefined]",Ye="[object WeakMap]",jt="[object WeakSet]",ue="[object ArrayBuffer]",Ee="[object DataView]",qe="[object Float32Array]",j="[object Float64Array]",me="[object Int8Array]",Ve="[object Int16Array]",ge="[object Int32Array]",G="[object Uint8Array]",K="[object Uint8ClampedArray]",ne="[object Uint16Array]",ve="[object Uint32Array]",Qe=/\b__p \+= '';/g,Fe=/\b(__p \+=) '' \+/g,at=/(__e\(.*?\)|\b__t\)) \+\n'';/g,rt=/&(?:amp|lt|gt|quot|#39);/g,Je=/[&<>"']/g,Rt=RegExp(rt.source),Qt=RegExp(Je.source),kt=/<%-([\s\S]+?)%>/g,rn=/<%([\s\S]+?)%>/g,Xt=/<%=([\s\S]+?)%>/g,Wr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qr=/^\w*$/,Kr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Aa=/[\\^$.*+?()[\]{}|]/g,si=RegExp(Aa.source),Or=/^\s+/,Es=/\s/,vs=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Yr=/\{\n\/\* \[wrapped with (.+)\] \*/,_s=/,? & /,qt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dr=/[()=,{}\[\]\/\s]/,Si=/\\(\\)?/g,Nl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ke=/\w*$/,J=/^[-+]0x[0-9a-f]+$/i,Be=/^0b[01]+$/i,it=/^\[object .+?Constructor\]$/,un=/^0o[0-7]+$/i,ar=/^(?:0|[1-9]\d*)$/,or=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zn=/($^)/,Oo=/['\n\r\u2028\u2029\\]/g,no="\\ud800-\\udfff",Lr="\\u0300-\\u036f",Ef="\\ufe20-\\ufe2f",vf="\\u20d0-\\u20ff",GT=Lr+Ef+vf,VT="\\u2700-\\u27bf",WT="a-z\\xdf-\\xf6\\xf8-\\xff",yU="\\xac\\xb1\\xd7\\xf7",EU="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vU="\\u2000-\\u206f",_U=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",qT="A-Z\\xc0-\\xd6\\xd8-\\xde",KT="\\ufe0e\\ufe0f",YT=yU+EU+vU+_U,G2="['’]",TU="["+no+"]",XT="["+YT+"]",_f="["+GT+"]",ZT="\\d+",SU="["+VT+"]",QT="["+WT+"]",JT="[^"+no+YT+ZT+VT+WT+qT+"]",V2="\\ud83c[\\udffb-\\udfff]",wU="(?:"+_f+"|"+V2+")",eS="[^"+no+"]",W2="(?:\\ud83c[\\udde6-\\uddff]){2}",q2="[\\ud800-\\udbff][\\udc00-\\udfff]",Bu="["+qT+"]",tS="\\u200d",nS="(?:"+QT+"|"+JT+")",AU="(?:"+Bu+"|"+JT+")",rS="(?:"+G2+"(?:d|ll|m|re|s|t|ve))?",iS="(?:"+G2+"(?:D|LL|M|RE|S|T|VE))?",aS=wU+"?",oS="["+KT+"]?",CU="(?:"+tS+"(?:"+[eS,W2,q2].join("|")+")"+oS+aS+")*",kU="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xU="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sS=oS+aS+CU,IU="(?:"+[SU,W2,q2].join("|")+")"+sS,RU="(?:"+[eS+_f+"?",_f,W2,q2,TU].join("|")+")",NU=RegExp(G2,"g"),OU=RegExp(_f,"g"),K2=RegExp(V2+"(?="+V2+")|"+RU+sS,"g"),DU=RegExp([Bu+"?"+QT+"+"+rS+"(?="+[XT,Bu,"$"].join("|")+")",AU+"+"+iS+"(?="+[XT,Bu+nS,"$"].join("|")+")",Bu+"?"+nS+"+"+rS,Bu+"+"+iS,xU,kU,ZT,IU].join("|"),"g"),LU=RegExp("["+tS+no+GT+KT+"]"),MU=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,FU=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],PU=-1,En={};En[qe]=En[j]=En[me]=En[Ve]=En[ge]=En[G]=En[K]=En[ne]=En[ve]=!0,En[Se]=En[X]=En[ue]=En[te]=En[Ee]=En[Me]=En[Ze]=En[We]=En[ot]=En[je]=En[U]=En[xe]=En[ye]=En[Te]=En[Ye]=!1;var mn={};mn[Se]=mn[X]=mn[ue]=mn[Ee]=mn[te]=mn[Me]=mn[qe]=mn[j]=mn[me]=mn[Ve]=mn[ge]=mn[ot]=mn[je]=mn[U]=mn[xe]=mn[ye]=mn[Te]=mn[Le]=mn[G]=mn[K]=mn[ne]=mn[ve]=!0,mn[Ze]=mn[We]=mn[Ye]=!1;var BU={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},UU={"&":"&","<":"<",">":">",'"':""","'":"'"},$U={"&":"&","<":"<",">":">",""":'"',"'":"'"},zU={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},HU=parseFloat,jU=parseInt,lS=typeof Jl=="object"&&Jl&&Jl.Object===Object&&Jl,GU=typeof self=="object"&&self&&self.Object===Object&&self,mr=lS||GU||Function("return this")(),Y2=t&&!t.nodeType&&t,Ol=Y2&&!0&&e&&!e.nodeType&&e,uS=Ol&&Ol.exports===Y2,X2=uS&&lS.process,Yi=function(){try{var ee=Ol&&Ol.require&&Ol.require("util").types;return ee||X2&&X2.binding&&X2.binding("util")}catch{}}(),cS=Yi&&Yi.isArrayBuffer,dS=Yi&&Yi.isDate,pS=Yi&&Yi.isMap,fS=Yi&&Yi.isRegExp,hS=Yi&&Yi.isSet,gS=Yi&&Yi.isTypedArray;function wi(ee,_e,he){switch(he.length){case 0:return ee.call(_e);case 1:return ee.call(_e,he[0]);case 2:return ee.call(_e,he[0],he[1]);case 3:return ee.call(_e,he[0],he[1],he[2])}return ee.apply(_e,he)}function VU(ee,_e,he,et){for(var _t=-1,Jt=ee==null?0:ee.length;++_t-1}function Z2(ee,_e,he){for(var et=-1,_t=ee==null?0:ee.length;++et<_t;)if(he(_e,ee[et]))return!0;return!1}function An(ee,_e){for(var he=-1,et=ee==null?0:ee.length,_t=Array(et);++he-1;);return he}function SS(ee,_e){for(var he=ee.length;he--&&Uu(_e,ee[he],0)>-1;);return he}function e$(ee,_e){for(var he=ee.length,et=0;he--;)ee[he]===_e&&++et;return et}var t$=t5(BU),n$=t5(UU);function r$(ee){return"\\"+zU[ee]}function i$(ee,_e){return ee==null?n:ee[_e]}function $u(ee){return LU.test(ee)}function a$(ee){return MU.test(ee)}function o$(ee){for(var _e,he=[];!(_e=ee.next()).done;)he.push(_e.value);return he}function a5(ee){var _e=-1,he=Array(ee.size);return ee.forEach(function(et,_t){he[++_e]=[_t,et]}),he}function wS(ee,_e){return function(he){return ee(_e(he))}}function ws(ee,_e){for(var he=-1,et=ee.length,_t=0,Jt=[];++he-1}function q$(l,d){var h=this.__data__,_=Uf(h,l);return _<0?(++this.size,h.push([l,d])):h[_][1]=d,this}Do.prototype.clear=j$,Do.prototype.delete=G$,Do.prototype.get=V$,Do.prototype.has=W$,Do.prototype.set=q$;function Lo(l){var d=-1,h=l==null?0:l.length;for(this.clear();++d=d?l:d)),l}function Ji(l,d,h,_,x,F){var z,Z=d&f,ae=d&m,we=d&g;if(h&&(z=x?h(l,_,x,F):h(l)),z!==n)return z;if(!Rn(l))return l;var Ce=Tt(l);if(Ce){if(z=Zz(l),!Z)return li(l,z)}else{var Ie=Fr(l),Xe=Ie==We||Ie==dt;if(Rs(l))return ow(l,Z);if(Ie==U||Ie==Se||Xe&&!x){if(z=ae||Xe?{}:Aw(l),!Z)return ae?$z(l,uz(z,l)):Uz(l,FS(z,l))}else{if(!mn[Ie])return x?l:{};z=Qz(l,Ie,Z)}}F||(F=new ka);var lt=F.get(l);if(lt)return lt;F.set(l,z),eA(l)?l.forEach(function(yt){z.add(Ji(yt,d,h,yt,l,F))}):Qw(l)&&l.forEach(function(yt,Nt){z.set(Nt,Ji(yt,d,h,Nt,l,F))});var bt=we?ae?N5:R5:ae?ci:sr,wt=Ce?n:bt(l);return Xi(wt||l,function(yt,Nt){wt&&(Nt=yt,yt=l[Nt]),Pc(z,Nt,Ji(yt,d,h,Nt,l,F))}),z}function cz(l){var d=sr(l);return function(h){return PS(h,l,d)}}function PS(l,d,h){var _=h.length;if(l==null)return!_;for(l=pn(l);_--;){var x=h[_],F=d[x],z=l[x];if(z===n&&!(x in l)||!F(z))return!1}return!0}function BS(l,d,h){if(typeof l!="function")throw new Zi(o);return Gc(function(){l.apply(n,h)},d)}function Bc(l,d,h,_){var x=-1,F=Tf,z=!0,Z=l.length,ae=[],we=d.length;if(!Z)return ae;h&&(d=An(d,Ai(h))),_?(F=Z2,z=!1):d.length>=i&&(F=Nc,z=!1,d=new Ml(d));e:for(;++xx?0:x+h),_=_===n||_>x?x:St(_),_<0&&(_+=x),_=h>_?0:nA(_);h<_;)l[h++]=d;return l}function $S(l,d){var h=[];return Cs(l,function(_,x,F){d(_,x,F)&&h.push(_)}),h}function br(l,d,h,_,x){var F=-1,z=l.length;for(h||(h=eH),x||(x=[]);++F0&&h(Z)?d>1?br(Z,d-1,h,_,x):Ss(x,Z):_||(x[x.length]=Z)}return x}var p5=pw(),zS=pw(!0);function ro(l,d){return l&&p5(l,d,sr)}function f5(l,d){return l&&zS(l,d,sr)}function zf(l,d){return Ts(d,function(h){return Uo(l[h])})}function Pl(l,d){d=xs(d,l);for(var h=0,_=d.length;l!=null&&h<_;)l=l[ao(d[h++])];return h&&h==_?l:n}function HS(l,d,h){var _=d(l);return Tt(l)?_:Ss(_,h(l))}function Xr(l){return l==null?l===n?ze:pt:Dl&&Dl in pn(l)?Kz(l):sH(l)}function h5(l,d){return l>d}function fz(l,d){return l!=null&&an.call(l,d)}function hz(l,d){return l!=null&&d in pn(l)}function gz(l,d,h){return l>=Mr(d,h)&&l=120&&Ce.length>=120)?new Ml(z&&Ce):n}Ce=l[0];var Ie=-1,Xe=Z[0];e:for(;++Ie-1;)Z!==l&&Of.call(Z,ae,1),Of.call(l,ae,1);return l}function QS(l,d){for(var h=l?d.length:0,_=h-1;h--;){var x=d[h];if(h==_||x!==F){var F=x;Bo(x)?Of.call(l,x,1):S5(l,x)}}return l}function v5(l,d){return l+Mf(OS()*(d-l+1))}function xz(l,d,h,_){for(var x=-1,F=Jn(Lf((d-l)/(h||1)),0),z=he(F);F--;)z[_?F:++x]=l,l+=h;return z}function _5(l,d){var h="";if(!l||d<1||d>W)return h;do d%2&&(h+=l),d=Mf(d/2),d&&(l+=l);while(d);return h}function xt(l,d){return B5(xw(l,d,di),l+"")}function Iz(l){return MS(Zu(l))}function Rz(l,d){var h=Zu(l);return Qf(h,Fl(d,0,h.length))}function zc(l,d,h,_){if(!Rn(l))return l;d=xs(d,l);for(var x=-1,F=d.length,z=F-1,Z=l;Z!=null&&++xx?0:x+d),h=h>x?x:h,h<0&&(h+=x),x=d>h?0:h-d>>>0,d>>>=0;for(var F=he(x);++_>>1,z=l[F];z!==null&&!ki(z)&&(h?z<=d:z=i){var we=d?null:Gz(l);if(we)return wf(we);z=!1,x=Nc,ae=new Ml}else ae=d?[]:Z;e:for(;++_=_?l:ea(l,d,h)}var aw=_$||function(l){return mr.clearTimeout(l)};function ow(l,d){if(d)return l.slice();var h=l.length,_=kS?kS(h):new l.constructor(h);return l.copy(_),_}function k5(l){var d=new l.constructor(l.byteLength);return new Rf(d).set(new Rf(l)),d}function Mz(l,d){var h=d?k5(l.buffer):l.buffer;return new l.constructor(h,l.byteOffset,l.byteLength)}function Fz(l){var d=new l.constructor(l.source,Ke.exec(l));return d.lastIndex=l.lastIndex,d}function Pz(l){return Fc?pn(Fc.call(l)):{}}function sw(l,d){var h=d?k5(l.buffer):l.buffer;return new l.constructor(h,l.byteOffset,l.length)}function lw(l,d){if(l!==d){var h=l!==n,_=l===null,x=l===l,F=ki(l),z=d!==n,Z=d===null,ae=d===d,we=ki(d);if(!Z&&!we&&!F&&l>d||F&&z&&ae&&!Z&&!we||_&&z&&ae||!h&&ae||!x)return 1;if(!_&&!F&&!we&&l=Z)return ae;var we=h[_];return ae*(we=="desc"?-1:1)}}return l.index-d.index}function uw(l,d,h,_){for(var x=-1,F=l.length,z=h.length,Z=-1,ae=d.length,we=Jn(F-z,0),Ce=he(ae+we),Ie=!_;++Z1?h[x-1]:n,z=x>2?h[2]:n;for(F=l.length>3&&typeof F=="function"?(x--,F):n,z&&Zr(h[0],h[1],z)&&(F=x<3?n:F,x=1),d=pn(d);++_-1?x[F?d[z]:z]:n}}function gw(l){return Po(function(d){var h=d.length,_=h,x=Qi.prototype.thru;for(l&&d.reverse();_--;){var F=d[_];if(typeof F!="function")throw new Zi(o);if(x&&!z&&Xf(F)=="wrapper")var z=new Qi([],!0)}for(_=z?_:h;++_1&&Bt.reverse(),Ce&&aeZ))return!1;var we=F.get(l),Ce=F.get(d);if(we&&Ce)return we==d&&Ce==l;var Ie=-1,Xe=!0,lt=h&y?new Ml:n;for(F.set(l,d),F.set(d,l);++Ie1?"& ":"")+d[_],d=d.join(h>2?", ":" "),l.replace(vs,`{ + */sm.exports;(function(e,t){(function(){var n,r="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",c=500,p="__lodash_placeholder__",f=1,m=2,g=4,b=1,y=2,T=1,E=2,v=4,w=8,A=16,R=32,k=64,N=128,B=256,q=512,P=30,Q="...",$=800,oe=16,fe=1,ce=2,De=3,H=1/0,W=9007199254740991,se=17976931348623157e292,D=0/0,pe=4294967295,le=pe-1,L=pe>>>1,ie=[["ary",N],["bind",T],["bindKey",E],["curry",w],["curryRight",A],["flip",q],["partial",R],["partialRight",k],["rearg",B]],Se="[object Arguments]",X="[object Array]",ke="[object AsyncFunction]",te="[object Boolean]",Me="[object Date]",Re="[object DOMException]",Ye="[object Error]",We="[object Function]",dt="[object GeneratorFunction]",ot="[object Map]",je="[object Number]",pt="[object Null]",U="[object Object]",re="[object Promise]",de="[object Proxy]",xe="[object RegExp]",ye="[object Set]",Te="[object String]",Le="[object Symbol]",ze="[object Undefined]",Xe="[object WeakMap]",jt="[object WeakSet]",ue="[object ArrayBuffer]",Ee="[object DataView]",qe="[object Float32Array]",j="[object Float64Array]",me="[object Int8Array]",Ve="[object Int16Array]",ge="[object Int32Array]",G="[object Uint8Array]",K="[object Uint8ClampedArray]",ne="[object Uint16Array]",ve="[object Uint32Array]",Qe=/\b__p \+= '';/g,Fe=/\b(__p \+=) '' \+/g,at=/(__e\(.*?\)|\b__t\)) \+\n'';/g,rt=/&(?:amp|lt|gt|quot|#39);/g,Je=/[&<>"']/g,Rt=RegExp(rt.source),Qt=RegExp(Je.source),kt=/<%-([\s\S]+?)%>/g,rn=/<%([\s\S]+?)%>/g,Xt=/<%=([\s\S]+?)%>/g,Wr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qr=/^\w*$/,Kr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Aa=/[\\^$.*+?()[\]{}|]/g,si=RegExp(Aa.source),Or=/^\s+/,Es=/\s/,vs=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Yr=/\{\n\/\* \[wrapped with (.+)\] \*/,_s=/,? & /,qt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dr=/[()=,{}\[\]\/\s]/,Si=/\\(\\)?/g,Nl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ke=/\w*$/,J=/^[-+]0x[0-9a-f]+$/i,Be=/^0b[01]+$/i,it=/^\[object .+?Constructor\]$/,un=/^0o[0-7]+$/i,ar=/^(?:0|[1-9]\d*)$/,or=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zn=/($^)/,Oo=/['\n\r\u2028\u2029\\]/g,no="\\ud800-\\udfff",Lr="\\u0300-\\u036f",Ef="\\ufe20-\\ufe2f",vf="\\u20d0-\\u20ff",GT=Lr+Ef+vf,VT="\\u2700-\\u27bf",WT="a-z\\xdf-\\xf6\\xf8-\\xff",yU="\\xac\\xb1\\xd7\\xf7",EU="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vU="\\u2000-\\u206f",_U=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",qT="A-Z\\xc0-\\xd6\\xd8-\\xde",KT="\\ufe0e\\ufe0f",YT=yU+EU+vU+_U,G2="['’]",TU="["+no+"]",XT="["+YT+"]",_f="["+GT+"]",ZT="\\d+",SU="["+VT+"]",QT="["+WT+"]",JT="[^"+no+YT+ZT+VT+WT+qT+"]",V2="\\ud83c[\\udffb-\\udfff]",wU="(?:"+_f+"|"+V2+")",eS="[^"+no+"]",W2="(?:\\ud83c[\\udde6-\\uddff]){2}",q2="[\\ud800-\\udbff][\\udc00-\\udfff]",Bu="["+qT+"]",tS="\\u200d",nS="(?:"+QT+"|"+JT+")",AU="(?:"+Bu+"|"+JT+")",rS="(?:"+G2+"(?:d|ll|m|re|s|t|ve))?",iS="(?:"+G2+"(?:D|LL|M|RE|S|T|VE))?",aS=wU+"?",oS="["+KT+"]?",CU="(?:"+tS+"(?:"+[eS,W2,q2].join("|")+")"+oS+aS+")*",kU="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xU="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sS=oS+aS+CU,IU="(?:"+[SU,W2,q2].join("|")+")"+sS,RU="(?:"+[eS+_f+"?",_f,W2,q2,TU].join("|")+")",NU=RegExp(G2,"g"),OU=RegExp(_f,"g"),K2=RegExp(V2+"(?="+V2+")|"+RU+sS,"g"),DU=RegExp([Bu+"?"+QT+"+"+rS+"(?="+[XT,Bu,"$"].join("|")+")",AU+"+"+iS+"(?="+[XT,Bu+nS,"$"].join("|")+")",Bu+"?"+nS+"+"+rS,Bu+"+"+iS,xU,kU,ZT,IU].join("|"),"g"),LU=RegExp("["+tS+no+GT+KT+"]"),MU=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,FU=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],PU=-1,En={};En[qe]=En[j]=En[me]=En[Ve]=En[ge]=En[G]=En[K]=En[ne]=En[ve]=!0,En[Se]=En[X]=En[ue]=En[te]=En[Ee]=En[Me]=En[Ye]=En[We]=En[ot]=En[je]=En[U]=En[xe]=En[ye]=En[Te]=En[Xe]=!1;var mn={};mn[Se]=mn[X]=mn[ue]=mn[Ee]=mn[te]=mn[Me]=mn[qe]=mn[j]=mn[me]=mn[Ve]=mn[ge]=mn[ot]=mn[je]=mn[U]=mn[xe]=mn[ye]=mn[Te]=mn[Le]=mn[G]=mn[K]=mn[ne]=mn[ve]=!0,mn[Ye]=mn[We]=mn[Xe]=!1;var BU={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},UU={"&":"&","<":"<",">":">",'"':""","'":"'"},$U={"&":"&","<":"<",">":">",""":'"',"'":"'"},zU={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},HU=parseFloat,jU=parseInt,lS=typeof Jl=="object"&&Jl&&Jl.Object===Object&&Jl,GU=typeof self=="object"&&self&&self.Object===Object&&self,mr=lS||GU||Function("return this")(),Y2=t&&!t.nodeType&&t,Ol=Y2&&!0&&e&&!e.nodeType&&e,uS=Ol&&Ol.exports===Y2,X2=uS&&lS.process,Yi=function(){try{var ee=Ol&&Ol.require&&Ol.require("util").types;return ee||X2&&X2.binding&&X2.binding("util")}catch{}}(),cS=Yi&&Yi.isArrayBuffer,dS=Yi&&Yi.isDate,pS=Yi&&Yi.isMap,fS=Yi&&Yi.isRegExp,hS=Yi&&Yi.isSet,gS=Yi&&Yi.isTypedArray;function wi(ee,_e,he){switch(he.length){case 0:return ee.call(_e);case 1:return ee.call(_e,he[0]);case 2:return ee.call(_e,he[0],he[1]);case 3:return ee.call(_e,he[0],he[1],he[2])}return ee.apply(_e,he)}function VU(ee,_e,he,et){for(var _t=-1,Jt=ee==null?0:ee.length;++_t-1}function Z2(ee,_e,he){for(var et=-1,_t=ee==null?0:ee.length;++et<_t;)if(he(_e,ee[et]))return!0;return!1}function An(ee,_e){for(var he=-1,et=ee==null?0:ee.length,_t=Array(et);++he-1;);return he}function SS(ee,_e){for(var he=ee.length;he--&&Uu(_e,ee[he],0)>-1;);return he}function e$(ee,_e){for(var he=ee.length,et=0;he--;)ee[he]===_e&&++et;return et}var t$=t5(BU),n$=t5(UU);function r$(ee){return"\\"+zU[ee]}function i$(ee,_e){return ee==null?n:ee[_e]}function $u(ee){return LU.test(ee)}function a$(ee){return MU.test(ee)}function o$(ee){for(var _e,he=[];!(_e=ee.next()).done;)he.push(_e.value);return he}function a5(ee){var _e=-1,he=Array(ee.size);return ee.forEach(function(et,_t){he[++_e]=[_t,et]}),he}function wS(ee,_e){return function(he){return ee(_e(he))}}function ws(ee,_e){for(var he=-1,et=ee.length,_t=0,Jt=[];++he-1}function q$(l,d){var h=this.__data__,_=Uf(h,l);return _<0?(++this.size,h.push([l,d])):h[_][1]=d,this}Do.prototype.clear=j$,Do.prototype.delete=G$,Do.prototype.get=V$,Do.prototype.has=W$,Do.prototype.set=q$;function Lo(l){var d=-1,h=l==null?0:l.length;for(this.clear();++d=d?l:d)),l}function Ji(l,d,h,_,x,F){var z,Z=d&f,ae=d&m,we=d&g;if(h&&(z=x?h(l,_,x,F):h(l)),z!==n)return z;if(!Rn(l))return l;var Ce=Tt(l);if(Ce){if(z=Zz(l),!Z)return li(l,z)}else{var Ie=Fr(l),Ze=Ie==We||Ie==dt;if(Rs(l))return ow(l,Z);if(Ie==U||Ie==Se||Ze&&!x){if(z=ae||Ze?{}:Aw(l),!Z)return ae?$z(l,uz(z,l)):Uz(l,FS(z,l))}else{if(!mn[Ie])return x?l:{};z=Qz(l,Ie,Z)}}F||(F=new ka);var lt=F.get(l);if(lt)return lt;F.set(l,z),eA(l)?l.forEach(function(yt){z.add(Ji(yt,d,h,yt,l,F))}):Qw(l)&&l.forEach(function(yt,Nt){z.set(Nt,Ji(yt,d,h,Nt,l,F))});var bt=we?ae?N5:R5:ae?ci:sr,wt=Ce?n:bt(l);return Xi(wt||l,function(yt,Nt){wt&&(Nt=yt,yt=l[Nt]),Pc(z,Nt,Ji(yt,d,h,Nt,l,F))}),z}function cz(l){var d=sr(l);return function(h){return PS(h,l,d)}}function PS(l,d,h){var _=h.length;if(l==null)return!_;for(l=pn(l);_--;){var x=h[_],F=d[x],z=l[x];if(z===n&&!(x in l)||!F(z))return!1}return!0}function BS(l,d,h){if(typeof l!="function")throw new Zi(o);return Gc(function(){l.apply(n,h)},d)}function Bc(l,d,h,_){var x=-1,F=Tf,z=!0,Z=l.length,ae=[],we=d.length;if(!Z)return ae;h&&(d=An(d,Ai(h))),_?(F=Z2,z=!1):d.length>=i&&(F=Nc,z=!1,d=new Ml(d));e:for(;++xx?0:x+h),_=_===n||_>x?x:St(_),_<0&&(_+=x),_=h>_?0:nA(_);h<_;)l[h++]=d;return l}function $S(l,d){var h=[];return Cs(l,function(_,x,F){d(_,x,F)&&h.push(_)}),h}function br(l,d,h,_,x){var F=-1,z=l.length;for(h||(h=eH),x||(x=[]);++F0&&h(Z)?d>1?br(Z,d-1,h,_,x):Ss(x,Z):_||(x[x.length]=Z)}return x}var p5=pw(),zS=pw(!0);function ro(l,d){return l&&p5(l,d,sr)}function f5(l,d){return l&&zS(l,d,sr)}function zf(l,d){return Ts(d,function(h){return Uo(l[h])})}function Pl(l,d){d=xs(d,l);for(var h=0,_=d.length;l!=null&&h<_;)l=l[ao(d[h++])];return h&&h==_?l:n}function HS(l,d,h){var _=d(l);return Tt(l)?_:Ss(_,h(l))}function Xr(l){return l==null?l===n?ze:pt:Dl&&Dl in pn(l)?Kz(l):sH(l)}function h5(l,d){return l>d}function fz(l,d){return l!=null&&an.call(l,d)}function hz(l,d){return l!=null&&d in pn(l)}function gz(l,d,h){return l>=Mr(d,h)&&l=120&&Ce.length>=120)?new Ml(z&&Ce):n}Ce=l[0];var Ie=-1,Ze=Z[0];e:for(;++Ie-1;)Z!==l&&Of.call(Z,ae,1),Of.call(l,ae,1);return l}function QS(l,d){for(var h=l?d.length:0,_=h-1;h--;){var x=d[h];if(h==_||x!==F){var F=x;Bo(x)?Of.call(l,x,1):S5(l,x)}}return l}function v5(l,d){return l+Mf(OS()*(d-l+1))}function xz(l,d,h,_){for(var x=-1,F=Jn(Lf((d-l)/(h||1)),0),z=he(F);F--;)z[_?F:++x]=l,l+=h;return z}function _5(l,d){var h="";if(!l||d<1||d>W)return h;do d%2&&(h+=l),d=Mf(d/2),d&&(l+=l);while(d);return h}function xt(l,d){return B5(xw(l,d,di),l+"")}function Iz(l){return MS(Zu(l))}function Rz(l,d){var h=Zu(l);return Qf(h,Fl(d,0,h.length))}function zc(l,d,h,_){if(!Rn(l))return l;d=xs(d,l);for(var x=-1,F=d.length,z=F-1,Z=l;Z!=null&&++xx?0:x+d),h=h>x?x:h,h<0&&(h+=x),x=d>h?0:h-d>>>0,d>>>=0;for(var F=he(x);++_>>1,z=l[F];z!==null&&!ki(z)&&(h?z<=d:z=i){var we=d?null:Gz(l);if(we)return wf(we);z=!1,x=Nc,ae=new Ml}else ae=d?[]:Z;e:for(;++_=_?l:ea(l,d,h)}var aw=_$||function(l){return mr.clearTimeout(l)};function ow(l,d){if(d)return l.slice();var h=l.length,_=kS?kS(h):new l.constructor(h);return l.copy(_),_}function k5(l){var d=new l.constructor(l.byteLength);return new Rf(d).set(new Rf(l)),d}function Mz(l,d){var h=d?k5(l.buffer):l.buffer;return new l.constructor(h,l.byteOffset,l.byteLength)}function Fz(l){var d=new l.constructor(l.source,Ke.exec(l));return d.lastIndex=l.lastIndex,d}function Pz(l){return Fc?pn(Fc.call(l)):{}}function sw(l,d){var h=d?k5(l.buffer):l.buffer;return new l.constructor(h,l.byteOffset,l.length)}function lw(l,d){if(l!==d){var h=l!==n,_=l===null,x=l===l,F=ki(l),z=d!==n,Z=d===null,ae=d===d,we=ki(d);if(!Z&&!we&&!F&&l>d||F&&z&&ae&&!Z&&!we||_&&z&&ae||!h&&ae||!x)return 1;if(!_&&!F&&!we&&l=Z)return ae;var we=h[_];return ae*(we=="desc"?-1:1)}}return l.index-d.index}function uw(l,d,h,_){for(var x=-1,F=l.length,z=h.length,Z=-1,ae=d.length,we=Jn(F-z,0),Ce=he(ae+we),Ie=!_;++Z1?h[x-1]:n,z=x>2?h[2]:n;for(F=l.length>3&&typeof F=="function"?(x--,F):n,z&&Zr(h[0],h[1],z)&&(F=x<3?n:F,x=1),d=pn(d);++_-1?x[F?d[z]:z]:n}}function gw(l){return Po(function(d){var h=d.length,_=h,x=Qi.prototype.thru;for(l&&d.reverse();_--;){var F=d[_];if(typeof F!="function")throw new Zi(o);if(x&&!z&&Xf(F)=="wrapper")var z=new Qi([],!0)}for(_=z?_:h;++_1&&Bt.reverse(),Ce&&aeZ))return!1;var we=F.get(l),Ce=F.get(d);if(we&&Ce)return we==d&&Ce==l;var Ie=-1,Ze=!0,lt=h&y?new Ml:n;for(F.set(l,d),F.set(d,l);++Ie1?"& ":"")+d[_],d=d.join(h>2?", ":" "),l.replace(vs,`{ /* [wrapped with `+d+`] */ -`)}function eH(l){return Tt(l)||$l(l)||!!(RS&&l&&l[RS])}function Bo(l,d){var h=typeof l;return d=d??W,!!d&&(h=="number"||h!="symbol"&&ar.test(l))&&l>-1&&l%1==0&&l0){if(++d>=$)return arguments[0]}else d=0;return l.apply(n,arguments)}}function Qf(l,d){var h=-1,_=l.length,x=_-1;for(d=d===n?_:d;++h1?l[d-1]:n;return h=typeof h=="function"?(l.pop(),h):n,$w(l,h)});function zw(l){var d=M(l);return d.__chain__=!0,d}function dj(l,d){return d(l),l}function Jf(l,d){return d(l)}var pj=Po(function(l){var d=l.length,h=d?l[0]:0,_=this.__wrapped__,x=function(F){return d5(F,l)};return d>1||this.__actions__.length||!(_ instanceof Mt)||!Bo(h)?this.thru(x):(_=_.slice(h,+h+(d?1:0)),_.__actions__.push({func:Jf,args:[x],thisArg:n}),new Qi(_,this.__chain__).thru(function(F){return d&&!F.length&&F.push(n),F}))});function fj(){return zw(this)}function hj(){return new Qi(this.value(),this.__chain__)}function gj(){this.__values__===n&&(this.__values__=tA(this.value()));var l=this.__index__>=this.__values__.length,d=l?n:this.__values__[this.__index__++];return{done:l,value:d}}function mj(){return this}function bj(l){for(var d,h=this;h instanceof Bf;){var _=Lw(h);_.__index__=0,_.__values__=n,d?x.__wrapped__=_:d=_;var x=_;h=h.__wrapped__}return x.__wrapped__=l,d}function yj(){var l=this.__wrapped__;if(l instanceof Mt){var d=l;return this.__actions__.length&&(d=new Mt(this)),d=d.reverse(),d.__actions__.push({func:Jf,args:[U5],thisArg:n}),new Qi(d,this.__chain__)}return this.thru(U5)}function Ej(){return rw(this.__wrapped__,this.__actions__)}var vj=Vf(function(l,d,h){an.call(l,h)?++l[h]:Mo(l,h,1)});function _j(l,d,h){var _=Tt(l)?mS:dz;return h&&Zr(l,d,h)&&(d=n),_(l,mt(d,3))}function Tj(l,d){var h=Tt(l)?Ts:$S;return h(l,mt(d,3))}var Sj=hw(Mw),wj=hw(Fw);function Aj(l,d){return br(e0(l,d),1)}function Cj(l,d){return br(e0(l,d),H)}function kj(l,d,h){return h=h===n?1:St(h),br(e0(l,d),h)}function Hw(l,d){var h=Tt(l)?Xi:Cs;return h(l,mt(d,3))}function jw(l,d){var h=Tt(l)?WU:US;return h(l,mt(d,3))}var xj=Vf(function(l,d,h){an.call(l,h)?l[h].push(d):Mo(l,h,[d])});function Ij(l,d,h,_){l=ui(l)?l:Zu(l),h=h&&!_?St(h):0;var x=l.length;return h<0&&(h=Jn(x+h,0)),a0(l)?h<=x&&l.indexOf(d,h)>-1:!!x&&Uu(l,d,h)>-1}var Rj=xt(function(l,d,h){var _=-1,x=typeof d=="function",F=ui(l)?he(l.length):[];return Cs(l,function(z){F[++_]=x?wi(d,z,h):Uc(z,d,h)}),F}),Nj=Vf(function(l,d,h){Mo(l,h,d)});function e0(l,d){var h=Tt(l)?An:WS;return h(l,mt(d,3))}function Oj(l,d,h,_){return l==null?[]:(Tt(d)||(d=d==null?[]:[d]),h=_?n:h,Tt(h)||(h=h==null?[]:[h]),XS(l,d,h))}var Dj=Vf(function(l,d,h){l[h?0:1].push(d)},function(){return[[],[]]});function Lj(l,d,h){var _=Tt(l)?Q2:vS,x=arguments.length<3;return _(l,mt(d,4),h,x,Cs)}function Mj(l,d,h){var _=Tt(l)?qU:vS,x=arguments.length<3;return _(l,mt(d,4),h,x,US)}function Fj(l,d){var h=Tt(l)?Ts:$S;return h(l,r0(mt(d,3)))}function Pj(l){var d=Tt(l)?MS:Iz;return d(l)}function Bj(l,d,h){(h?Zr(l,d,h):d===n)?d=1:d=St(d);var _=Tt(l)?oz:Rz;return _(l,d)}function Uj(l){var d=Tt(l)?sz:Oz;return d(l)}function $j(l){if(l==null)return 0;if(ui(l))return a0(l)?zu(l):l.length;var d=Fr(l);return d==ot||d==ye?l.size:b5(l).length}function zj(l,d,h){var _=Tt(l)?J2:Dz;return h&&Zr(l,d,h)&&(d=n),_(l,mt(d,3))}var Hj=xt(function(l,d){if(l==null)return[];var h=d.length;return h>1&&Zr(l,d[0],d[1])?d=[]:h>2&&Zr(d[0],d[1],d[2])&&(d=[d[0]]),XS(l,br(d,1),[])}),t0=T$||function(){return mr.Date.now()};function jj(l,d){if(typeof d!="function")throw new Zi(o);return l=St(l),function(){if(--l<1)return d.apply(this,arguments)}}function Gw(l,d,h){return d=h?n:d,d=l&&d==null?l.length:d,Fo(l,N,n,n,n,n,d)}function Vw(l,d){var h;if(typeof d!="function")throw new Zi(o);return l=St(l),function(){return--l>0&&(h=d.apply(this,arguments)),l<=1&&(d=n),h}}var z5=xt(function(l,d,h){var _=T;if(h.length){var x=ws(h,Yu(z5));_|=R}return Fo(l,_,d,h,x)}),Ww=xt(function(l,d,h){var _=T|E;if(h.length){var x=ws(h,Yu(Ww));_|=R}return Fo(d,_,l,h,x)});function qw(l,d,h){d=h?n:d;var _=Fo(l,w,n,n,n,n,n,d);return _.placeholder=qw.placeholder,_}function Kw(l,d,h){d=h?n:d;var _=Fo(l,A,n,n,n,n,n,d);return _.placeholder=Kw.placeholder,_}function Yw(l,d,h){var _,x,F,z,Z,ae,we=0,Ce=!1,Ie=!1,Xe=!0;if(typeof l!="function")throw new Zi(o);d=na(d)||0,Rn(h)&&(Ce=!!h.leading,Ie="maxWait"in h,F=Ie?Jn(na(h.maxWait)||0,d):F,Xe="trailing"in h?!!h.trailing:Xe);function lt(Hn){var Ia=_,zo=x;return _=x=n,we=Hn,z=l.apply(zo,Ia),z}function bt(Hn){return we=Hn,Z=Gc(Nt,d),Ce?lt(Hn):z}function wt(Hn){var Ia=Hn-ae,zo=Hn-we,hA=d-Ia;return Ie?Mr(hA,F-zo):hA}function yt(Hn){var Ia=Hn-ae,zo=Hn-we;return ae===n||Ia>=d||Ia<0||Ie&&zo>=F}function Nt(){var Hn=t0();if(yt(Hn))return Bt(Hn);Z=Gc(Nt,wt(Hn))}function Bt(Hn){return Z=n,Xe&&_?lt(Hn):(_=x=n,z)}function xi(){Z!==n&&aw(Z),we=0,_=ae=x=Z=n}function Qr(){return Z===n?z:Bt(t0())}function Ii(){var Hn=t0(),Ia=yt(Hn);if(_=arguments,x=this,ae=Hn,Ia){if(Z===n)return bt(ae);if(Ie)return aw(Z),Z=Gc(Nt,d),lt(ae)}return Z===n&&(Z=Gc(Nt,d)),z}return Ii.cancel=xi,Ii.flush=Qr,Ii}var Gj=xt(function(l,d){return BS(l,1,d)}),Vj=xt(function(l,d,h){return BS(l,na(d)||0,h)});function Wj(l){return Fo(l,q)}function n0(l,d){if(typeof l!="function"||d!=null&&typeof d!="function")throw new Zi(o);var h=function(){var _=arguments,x=d?d.apply(this,_):_[0],F=h.cache;if(F.has(x))return F.get(x);var z=l.apply(this,_);return h.cache=F.set(x,z)||F,z};return h.cache=new(n0.Cache||Lo),h}n0.Cache=Lo;function r0(l){if(typeof l!="function")throw new Zi(o);return function(){var d=arguments;switch(d.length){case 0:return!l.call(this);case 1:return!l.call(this,d[0]);case 2:return!l.call(this,d[0],d[1]);case 3:return!l.call(this,d[0],d[1],d[2])}return!l.apply(this,d)}}function qj(l){return Vw(2,l)}var Kj=Lz(function(l,d){d=d.length==1&&Tt(d[0])?An(d[0],Ai(mt())):An(br(d,1),Ai(mt()));var h=d.length;return xt(function(_){for(var x=-1,F=Mr(_.length,h);++x=d}),$l=jS(function(){return arguments}())?jS:function(l){return Mn(l)&&an.call(l,"callee")&&!IS.call(l,"callee")},Tt=he.isArray,uG=cS?Ai(cS):bz;function ui(l){return l!=null&&i0(l.length)&&!Uo(l)}function zn(l){return Mn(l)&&ui(l)}function cG(l){return l===!0||l===!1||Mn(l)&&Xr(l)==te}var Rs=w$||J5,dG=dS?Ai(dS):yz;function pG(l){return Mn(l)&&l.nodeType===1&&!Vc(l)}function fG(l){if(l==null)return!0;if(ui(l)&&(Tt(l)||typeof l=="string"||typeof l.splice=="function"||Rs(l)||Xu(l)||$l(l)))return!l.length;var d=Fr(l);if(d==ot||d==ye)return!l.size;if(jc(l))return!b5(l).length;for(var h in l)if(an.call(l,h))return!1;return!0}function hG(l,d){return $c(l,d)}function gG(l,d,h){h=typeof h=="function"?h:n;var _=h?h(l,d):n;return _===n?$c(l,d,n,h):!!_}function j5(l){if(!Mn(l))return!1;var d=Xr(l);return d==Ze||d==Re||typeof l.message=="string"&&typeof l.name=="string"&&!Vc(l)}function mG(l){return typeof l=="number"&&NS(l)}function Uo(l){if(!Rn(l))return!1;var d=Xr(l);return d==We||d==dt||d==ke||d==de}function Zw(l){return typeof l=="number"&&l==St(l)}function i0(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=W}function Rn(l){var d=typeof l;return l!=null&&(d=="object"||d=="function")}function Mn(l){return l!=null&&typeof l=="object"}var Qw=pS?Ai(pS):vz;function bG(l,d){return l===d||m5(l,d,D5(d))}function yG(l,d,h){return h=typeof h=="function"?h:n,m5(l,d,D5(d),h)}function EG(l){return Jw(l)&&l!=+l}function vG(l){if(rH(l))throw new _t(a);return GS(l)}function _G(l){return l===null}function TG(l){return l==null}function Jw(l){return typeof l=="number"||Mn(l)&&Xr(l)==je}function Vc(l){if(!Mn(l)||Xr(l)!=U)return!1;var d=Nf(l);if(d===null)return!0;var h=an.call(d,"constructor")&&d.constructor;return typeof h=="function"&&h instanceof h&&kf.call(h)==y$}var G5=fS?Ai(fS):_z;function SG(l){return Zw(l)&&l>=-W&&l<=W}var eA=hS?Ai(hS):Tz;function a0(l){return typeof l=="string"||!Tt(l)&&Mn(l)&&Xr(l)==Te}function ki(l){return typeof l=="symbol"||Mn(l)&&Xr(l)==Le}var Xu=gS?Ai(gS):Sz;function wG(l){return l===n}function AG(l){return Mn(l)&&Fr(l)==Ye}function CG(l){return Mn(l)&&Xr(l)==jt}var kG=Yf(y5),xG=Yf(function(l,d){return l<=d});function tA(l){if(!l)return[];if(ui(l))return a0(l)?Ca(l):li(l);if(Oc&&l[Oc])return o$(l[Oc]());var d=Fr(l),h=d==ot?a5:d==ye?wf:Zu;return h(l)}function $o(l){if(!l)return l===0?l:0;if(l=na(l),l===H||l===-H){var d=l<0?-1:1;return d*se}return l===l?l:0}function St(l){var d=$o(l),h=d%1;return d===d?h?d-h:d:0}function nA(l){return l?Fl(St(l),0,pe):0}function na(l){if(typeof l=="number")return l;if(ki(l))return D;if(Rn(l)){var d=typeof l.valueOf=="function"?l.valueOf():l;l=Rn(d)?d+"":d}if(typeof l!="string")return l===0?l:+l;l=_S(l);var h=Be.test(l);return h||un.test(l)?jU(l.slice(2),h?2:8):J.test(l)?D:+l}function rA(l){return io(l,ci(l))}function IG(l){return l?Fl(St(l),-W,W):l===0?l:0}function en(l){return l==null?"":Ci(l)}var RG=qu(function(l,d){if(jc(d)||ui(d)){io(d,sr(d),l);return}for(var h in d)an.call(d,h)&&Pc(l,h,d[h])}),iA=qu(function(l,d){io(d,ci(d),l)}),o0=qu(function(l,d,h,_){io(d,ci(d),l,_)}),NG=qu(function(l,d,h,_){io(d,sr(d),l,_)}),OG=Po(d5);function DG(l,d){var h=Wu(l);return d==null?h:FS(h,d)}var LG=xt(function(l,d){l=pn(l);var h=-1,_=d.length,x=_>2?d[2]:n;for(x&&Zr(d[0],d[1],x)&&(_=1);++h<_;)for(var F=d[h],z=ci(F),Z=-1,ae=z.length;++Z1),F}),io(l,N5(l),h),_&&(h=Ji(h,f|m|g,Vz));for(var x=d.length;x--;)S5(h,d[x]);return h});function QG(l,d){return oA(l,r0(mt(d)))}var JG=Po(function(l,d){return l==null?{}:Cz(l,d)});function oA(l,d){if(l==null)return{};var h=An(N5(l),function(_){return[_]});return d=mt(d),ZS(l,h,function(_,x){return d(_,x[0])})}function eV(l,d,h){d=xs(d,l);var _=-1,x=d.length;for(x||(x=1,l=n);++_d){var _=l;l=d,d=_}if(h||l%1||d%1){var x=OS();return Mr(l+x*(d-l+HU("1e-"+((x+"").length-1))),d)}return v5(l,d)}var dV=Ku(function(l,d,h){return d=d.toLowerCase(),l+(h?uA(d):d)});function uA(l){return q5(en(l).toLowerCase())}function cA(l){return l=en(l),l&&l.replace(or,t$).replace(OU,"")}function pV(l,d,h){l=en(l),d=Ci(d);var _=l.length;h=h===n?_:Fl(St(h),0,_);var x=h;return h-=d.length,h>=0&&l.slice(h,x)==d}function fV(l){return l=en(l),l&&Qt.test(l)?l.replace(Je,n$):l}function hV(l){return l=en(l),l&&si.test(l)?l.replace(Aa,"\\$&"):l}var gV=Ku(function(l,d,h){return l+(h?"-":"")+d.toLowerCase()}),mV=Ku(function(l,d,h){return l+(h?" ":"")+d.toLowerCase()}),bV=fw("toLowerCase");function yV(l,d,h){l=en(l),d=St(d);var _=d?zu(l):0;if(!d||_>=d)return l;var x=(d-_)/2;return Kf(Mf(x),h)+l+Kf(Lf(x),h)}function EV(l,d,h){l=en(l),d=St(d);var _=d?zu(l):0;return d&&_>>0,h?(l=en(l),l&&(typeof d=="string"||d!=null&&!G5(d))&&(d=Ci(d),!d&&$u(l))?Is(Ca(l),0,h):l.split(d,h)):[]}var CV=Ku(function(l,d,h){return l+(h?" ":"")+q5(d)});function kV(l,d,h){return l=en(l),h=h==null?0:Fl(St(h),0,l.length),d=Ci(d),l.slice(h,h+d.length)==d}function xV(l,d,h){var _=M.templateSettings;h&&Zr(l,d,h)&&(d=n),l=en(l),d=o0({},d,_,vw);var x=o0({},d.imports,_.imports,vw),F=sr(x),z=i5(x,F),Z,ae,we=0,Ce=d.interpolate||Zn,Ie="__p += '",Xe=o5((d.escape||Zn).source+"|"+Ce.source+"|"+(Ce===Xt?Nl:Zn).source+"|"+(d.evaluate||Zn).source+"|$","g"),lt="//# sourceURL="+(an.call(d,"sourceURL")?(d.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++PU+"]")+` -`;l.replace(Xe,function(yt,Nt,Bt,xi,Qr,Ii){return Bt||(Bt=xi),Ie+=l.slice(we,Ii).replace(Oo,r$),Nt&&(Z=!0,Ie+=`' + +`)}function eH(l){return Tt(l)||$l(l)||!!(RS&&l&&l[RS])}function Bo(l,d){var h=typeof l;return d=d??W,!!d&&(h=="number"||h!="symbol"&&ar.test(l))&&l>-1&&l%1==0&&l0){if(++d>=$)return arguments[0]}else d=0;return l.apply(n,arguments)}}function Qf(l,d){var h=-1,_=l.length,x=_-1;for(d=d===n?_:d;++h1?l[d-1]:n;return h=typeof h=="function"?(l.pop(),h):n,$w(l,h)});function zw(l){var d=M(l);return d.__chain__=!0,d}function dj(l,d){return d(l),l}function Jf(l,d){return d(l)}var pj=Po(function(l){var d=l.length,h=d?l[0]:0,_=this.__wrapped__,x=function(F){return d5(F,l)};return d>1||this.__actions__.length||!(_ instanceof Mt)||!Bo(h)?this.thru(x):(_=_.slice(h,+h+(d?1:0)),_.__actions__.push({func:Jf,args:[x],thisArg:n}),new Qi(_,this.__chain__).thru(function(F){return d&&!F.length&&F.push(n),F}))});function fj(){return zw(this)}function hj(){return new Qi(this.value(),this.__chain__)}function gj(){this.__values__===n&&(this.__values__=tA(this.value()));var l=this.__index__>=this.__values__.length,d=l?n:this.__values__[this.__index__++];return{done:l,value:d}}function mj(){return this}function bj(l){for(var d,h=this;h instanceof Bf;){var _=Lw(h);_.__index__=0,_.__values__=n,d?x.__wrapped__=_:d=_;var x=_;h=h.__wrapped__}return x.__wrapped__=l,d}function yj(){var l=this.__wrapped__;if(l instanceof Mt){var d=l;return this.__actions__.length&&(d=new Mt(this)),d=d.reverse(),d.__actions__.push({func:Jf,args:[U5],thisArg:n}),new Qi(d,this.__chain__)}return this.thru(U5)}function Ej(){return rw(this.__wrapped__,this.__actions__)}var vj=Vf(function(l,d,h){an.call(l,h)?++l[h]:Mo(l,h,1)});function _j(l,d,h){var _=Tt(l)?mS:dz;return h&&Zr(l,d,h)&&(d=n),_(l,mt(d,3))}function Tj(l,d){var h=Tt(l)?Ts:$S;return h(l,mt(d,3))}var Sj=hw(Mw),wj=hw(Fw);function Aj(l,d){return br(e0(l,d),1)}function Cj(l,d){return br(e0(l,d),H)}function kj(l,d,h){return h=h===n?1:St(h),br(e0(l,d),h)}function Hw(l,d){var h=Tt(l)?Xi:Cs;return h(l,mt(d,3))}function jw(l,d){var h=Tt(l)?WU:US;return h(l,mt(d,3))}var xj=Vf(function(l,d,h){an.call(l,h)?l[h].push(d):Mo(l,h,[d])});function Ij(l,d,h,_){l=ui(l)?l:Zu(l),h=h&&!_?St(h):0;var x=l.length;return h<0&&(h=Jn(x+h,0)),a0(l)?h<=x&&l.indexOf(d,h)>-1:!!x&&Uu(l,d,h)>-1}var Rj=xt(function(l,d,h){var _=-1,x=typeof d=="function",F=ui(l)?he(l.length):[];return Cs(l,function(z){F[++_]=x?wi(d,z,h):Uc(z,d,h)}),F}),Nj=Vf(function(l,d,h){Mo(l,h,d)});function e0(l,d){var h=Tt(l)?An:WS;return h(l,mt(d,3))}function Oj(l,d,h,_){return l==null?[]:(Tt(d)||(d=d==null?[]:[d]),h=_?n:h,Tt(h)||(h=h==null?[]:[h]),XS(l,d,h))}var Dj=Vf(function(l,d,h){l[h?0:1].push(d)},function(){return[[],[]]});function Lj(l,d,h){var _=Tt(l)?Q2:vS,x=arguments.length<3;return _(l,mt(d,4),h,x,Cs)}function Mj(l,d,h){var _=Tt(l)?qU:vS,x=arguments.length<3;return _(l,mt(d,4),h,x,US)}function Fj(l,d){var h=Tt(l)?Ts:$S;return h(l,r0(mt(d,3)))}function Pj(l){var d=Tt(l)?MS:Iz;return d(l)}function Bj(l,d,h){(h?Zr(l,d,h):d===n)?d=1:d=St(d);var _=Tt(l)?oz:Rz;return _(l,d)}function Uj(l){var d=Tt(l)?sz:Oz;return d(l)}function $j(l){if(l==null)return 0;if(ui(l))return a0(l)?zu(l):l.length;var d=Fr(l);return d==ot||d==ye?l.size:b5(l).length}function zj(l,d,h){var _=Tt(l)?J2:Dz;return h&&Zr(l,d,h)&&(d=n),_(l,mt(d,3))}var Hj=xt(function(l,d){if(l==null)return[];var h=d.length;return h>1&&Zr(l,d[0],d[1])?d=[]:h>2&&Zr(d[0],d[1],d[2])&&(d=[d[0]]),XS(l,br(d,1),[])}),t0=T$||function(){return mr.Date.now()};function jj(l,d){if(typeof d!="function")throw new Zi(o);return l=St(l),function(){if(--l<1)return d.apply(this,arguments)}}function Gw(l,d,h){return d=h?n:d,d=l&&d==null?l.length:d,Fo(l,N,n,n,n,n,d)}function Vw(l,d){var h;if(typeof d!="function")throw new Zi(o);return l=St(l),function(){return--l>0&&(h=d.apply(this,arguments)),l<=1&&(d=n),h}}var z5=xt(function(l,d,h){var _=T;if(h.length){var x=ws(h,Yu(z5));_|=R}return Fo(l,_,d,h,x)}),Ww=xt(function(l,d,h){var _=T|E;if(h.length){var x=ws(h,Yu(Ww));_|=R}return Fo(d,_,l,h,x)});function qw(l,d,h){d=h?n:d;var _=Fo(l,w,n,n,n,n,n,d);return _.placeholder=qw.placeholder,_}function Kw(l,d,h){d=h?n:d;var _=Fo(l,A,n,n,n,n,n,d);return _.placeholder=Kw.placeholder,_}function Yw(l,d,h){var _,x,F,z,Z,ae,we=0,Ce=!1,Ie=!1,Ze=!0;if(typeof l!="function")throw new Zi(o);d=na(d)||0,Rn(h)&&(Ce=!!h.leading,Ie="maxWait"in h,F=Ie?Jn(na(h.maxWait)||0,d):F,Ze="trailing"in h?!!h.trailing:Ze);function lt(Hn){var Ia=_,zo=x;return _=x=n,we=Hn,z=l.apply(zo,Ia),z}function bt(Hn){return we=Hn,Z=Gc(Nt,d),Ce?lt(Hn):z}function wt(Hn){var Ia=Hn-ae,zo=Hn-we,hA=d-Ia;return Ie?Mr(hA,F-zo):hA}function yt(Hn){var Ia=Hn-ae,zo=Hn-we;return ae===n||Ia>=d||Ia<0||Ie&&zo>=F}function Nt(){var Hn=t0();if(yt(Hn))return Bt(Hn);Z=Gc(Nt,wt(Hn))}function Bt(Hn){return Z=n,Ze&&_?lt(Hn):(_=x=n,z)}function xi(){Z!==n&&aw(Z),we=0,_=ae=x=Z=n}function Qr(){return Z===n?z:Bt(t0())}function Ii(){var Hn=t0(),Ia=yt(Hn);if(_=arguments,x=this,ae=Hn,Ia){if(Z===n)return bt(ae);if(Ie)return aw(Z),Z=Gc(Nt,d),lt(ae)}return Z===n&&(Z=Gc(Nt,d)),z}return Ii.cancel=xi,Ii.flush=Qr,Ii}var Gj=xt(function(l,d){return BS(l,1,d)}),Vj=xt(function(l,d,h){return BS(l,na(d)||0,h)});function Wj(l){return Fo(l,q)}function n0(l,d){if(typeof l!="function"||d!=null&&typeof d!="function")throw new Zi(o);var h=function(){var _=arguments,x=d?d.apply(this,_):_[0],F=h.cache;if(F.has(x))return F.get(x);var z=l.apply(this,_);return h.cache=F.set(x,z)||F,z};return h.cache=new(n0.Cache||Lo),h}n0.Cache=Lo;function r0(l){if(typeof l!="function")throw new Zi(o);return function(){var d=arguments;switch(d.length){case 0:return!l.call(this);case 1:return!l.call(this,d[0]);case 2:return!l.call(this,d[0],d[1]);case 3:return!l.call(this,d[0],d[1],d[2])}return!l.apply(this,d)}}function qj(l){return Vw(2,l)}var Kj=Lz(function(l,d){d=d.length==1&&Tt(d[0])?An(d[0],Ai(mt())):An(br(d,1),Ai(mt()));var h=d.length;return xt(function(_){for(var x=-1,F=Mr(_.length,h);++x=d}),$l=jS(function(){return arguments}())?jS:function(l){return Mn(l)&&an.call(l,"callee")&&!IS.call(l,"callee")},Tt=he.isArray,uG=cS?Ai(cS):bz;function ui(l){return l!=null&&i0(l.length)&&!Uo(l)}function zn(l){return Mn(l)&&ui(l)}function cG(l){return l===!0||l===!1||Mn(l)&&Xr(l)==te}var Rs=w$||J5,dG=dS?Ai(dS):yz;function pG(l){return Mn(l)&&l.nodeType===1&&!Vc(l)}function fG(l){if(l==null)return!0;if(ui(l)&&(Tt(l)||typeof l=="string"||typeof l.splice=="function"||Rs(l)||Xu(l)||$l(l)))return!l.length;var d=Fr(l);if(d==ot||d==ye)return!l.size;if(jc(l))return!b5(l).length;for(var h in l)if(an.call(l,h))return!1;return!0}function hG(l,d){return $c(l,d)}function gG(l,d,h){h=typeof h=="function"?h:n;var _=h?h(l,d):n;return _===n?$c(l,d,n,h):!!_}function j5(l){if(!Mn(l))return!1;var d=Xr(l);return d==Ye||d==Re||typeof l.message=="string"&&typeof l.name=="string"&&!Vc(l)}function mG(l){return typeof l=="number"&&NS(l)}function Uo(l){if(!Rn(l))return!1;var d=Xr(l);return d==We||d==dt||d==ke||d==de}function Zw(l){return typeof l=="number"&&l==St(l)}function i0(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=W}function Rn(l){var d=typeof l;return l!=null&&(d=="object"||d=="function")}function Mn(l){return l!=null&&typeof l=="object"}var Qw=pS?Ai(pS):vz;function bG(l,d){return l===d||m5(l,d,D5(d))}function yG(l,d,h){return h=typeof h=="function"?h:n,m5(l,d,D5(d),h)}function EG(l){return Jw(l)&&l!=+l}function vG(l){if(rH(l))throw new _t(a);return GS(l)}function _G(l){return l===null}function TG(l){return l==null}function Jw(l){return typeof l=="number"||Mn(l)&&Xr(l)==je}function Vc(l){if(!Mn(l)||Xr(l)!=U)return!1;var d=Nf(l);if(d===null)return!0;var h=an.call(d,"constructor")&&d.constructor;return typeof h=="function"&&h instanceof h&&kf.call(h)==y$}var G5=fS?Ai(fS):_z;function SG(l){return Zw(l)&&l>=-W&&l<=W}var eA=hS?Ai(hS):Tz;function a0(l){return typeof l=="string"||!Tt(l)&&Mn(l)&&Xr(l)==Te}function ki(l){return typeof l=="symbol"||Mn(l)&&Xr(l)==Le}var Xu=gS?Ai(gS):Sz;function wG(l){return l===n}function AG(l){return Mn(l)&&Fr(l)==Xe}function CG(l){return Mn(l)&&Xr(l)==jt}var kG=Yf(y5),xG=Yf(function(l,d){return l<=d});function tA(l){if(!l)return[];if(ui(l))return a0(l)?Ca(l):li(l);if(Oc&&l[Oc])return o$(l[Oc]());var d=Fr(l),h=d==ot?a5:d==ye?wf:Zu;return h(l)}function $o(l){if(!l)return l===0?l:0;if(l=na(l),l===H||l===-H){var d=l<0?-1:1;return d*se}return l===l?l:0}function St(l){var d=$o(l),h=d%1;return d===d?h?d-h:d:0}function nA(l){return l?Fl(St(l),0,pe):0}function na(l){if(typeof l=="number")return l;if(ki(l))return D;if(Rn(l)){var d=typeof l.valueOf=="function"?l.valueOf():l;l=Rn(d)?d+"":d}if(typeof l!="string")return l===0?l:+l;l=_S(l);var h=Be.test(l);return h||un.test(l)?jU(l.slice(2),h?2:8):J.test(l)?D:+l}function rA(l){return io(l,ci(l))}function IG(l){return l?Fl(St(l),-W,W):l===0?l:0}function en(l){return l==null?"":Ci(l)}var RG=qu(function(l,d){if(jc(d)||ui(d)){io(d,sr(d),l);return}for(var h in d)an.call(d,h)&&Pc(l,h,d[h])}),iA=qu(function(l,d){io(d,ci(d),l)}),o0=qu(function(l,d,h,_){io(d,ci(d),l,_)}),NG=qu(function(l,d,h,_){io(d,sr(d),l,_)}),OG=Po(d5);function DG(l,d){var h=Wu(l);return d==null?h:FS(h,d)}var LG=xt(function(l,d){l=pn(l);var h=-1,_=d.length,x=_>2?d[2]:n;for(x&&Zr(d[0],d[1],x)&&(_=1);++h<_;)for(var F=d[h],z=ci(F),Z=-1,ae=z.length;++Z1),F}),io(l,N5(l),h),_&&(h=Ji(h,f|m|g,Vz));for(var x=d.length;x--;)S5(h,d[x]);return h});function QG(l,d){return oA(l,r0(mt(d)))}var JG=Po(function(l,d){return l==null?{}:Cz(l,d)});function oA(l,d){if(l==null)return{};var h=An(N5(l),function(_){return[_]});return d=mt(d),ZS(l,h,function(_,x){return d(_,x[0])})}function eV(l,d,h){d=xs(d,l);var _=-1,x=d.length;for(x||(x=1,l=n);++_d){var _=l;l=d,d=_}if(h||l%1||d%1){var x=OS();return Mr(l+x*(d-l+HU("1e-"+((x+"").length-1))),d)}return v5(l,d)}var dV=Ku(function(l,d,h){return d=d.toLowerCase(),l+(h?uA(d):d)});function uA(l){return q5(en(l).toLowerCase())}function cA(l){return l=en(l),l&&l.replace(or,t$).replace(OU,"")}function pV(l,d,h){l=en(l),d=Ci(d);var _=l.length;h=h===n?_:Fl(St(h),0,_);var x=h;return h-=d.length,h>=0&&l.slice(h,x)==d}function fV(l){return l=en(l),l&&Qt.test(l)?l.replace(Je,n$):l}function hV(l){return l=en(l),l&&si.test(l)?l.replace(Aa,"\\$&"):l}var gV=Ku(function(l,d,h){return l+(h?"-":"")+d.toLowerCase()}),mV=Ku(function(l,d,h){return l+(h?" ":"")+d.toLowerCase()}),bV=fw("toLowerCase");function yV(l,d,h){l=en(l),d=St(d);var _=d?zu(l):0;if(!d||_>=d)return l;var x=(d-_)/2;return Kf(Mf(x),h)+l+Kf(Lf(x),h)}function EV(l,d,h){l=en(l),d=St(d);var _=d?zu(l):0;return d&&_>>0,h?(l=en(l),l&&(typeof d=="string"||d!=null&&!G5(d))&&(d=Ci(d),!d&&$u(l))?Is(Ca(l),0,h):l.split(d,h)):[]}var CV=Ku(function(l,d,h){return l+(h?" ":"")+q5(d)});function kV(l,d,h){return l=en(l),h=h==null?0:Fl(St(h),0,l.length),d=Ci(d),l.slice(h,h+d.length)==d}function xV(l,d,h){var _=M.templateSettings;h&&Zr(l,d,h)&&(d=n),l=en(l),d=o0({},d,_,vw);var x=o0({},d.imports,_.imports,vw),F=sr(x),z=i5(x,F),Z,ae,we=0,Ce=d.interpolate||Zn,Ie="__p += '",Ze=o5((d.escape||Zn).source+"|"+Ce.source+"|"+(Ce===Xt?Nl:Zn).source+"|"+(d.evaluate||Zn).source+"|$","g"),lt="//# sourceURL="+(an.call(d,"sourceURL")?(d.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++PU+"]")+` +`;l.replace(Ze,function(yt,Nt,Bt,xi,Qr,Ii){return Bt||(Bt=xi),Ie+=l.slice(we,Ii).replace(Oo,r$),Nt&&(Z=!0,Ie+=`' + __e(`+Nt+`) + '`),Qr&&(ae=!0,Ie+=`'; `+Qr+`; @@ -1151,7 +1151,7 @@ __p += '`),Bt&&(Ie+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Ie+`return __p -}`;var wt=pA(function(){return Jt(F,lt+"return "+Ie).apply(n,z)});if(wt.source=Ie,j5(wt))throw wt;return wt}function IV(l){return en(l).toLowerCase()}function RV(l){return en(l).toUpperCase()}function NV(l,d,h){if(l=en(l),l&&(h||d===n))return _S(l);if(!l||!(d=Ci(d)))return l;var _=Ca(l),x=Ca(d),F=TS(_,x),z=SS(_,x)+1;return Is(_,F,z).join("")}function OV(l,d,h){if(l=en(l),l&&(h||d===n))return l.slice(0,AS(l)+1);if(!l||!(d=Ci(d)))return l;var _=Ca(l),x=SS(_,Ca(d))+1;return Is(_,0,x).join("")}function DV(l,d,h){if(l=en(l),l&&(h||d===n))return l.replace(Or,"");if(!l||!(d=Ci(d)))return l;var _=Ca(l),x=TS(_,Ca(d));return Is(_,x).join("")}function LV(l,d){var h=P,_=Q;if(Rn(d)){var x="separator"in d?d.separator:x;h="length"in d?St(d.length):h,_="omission"in d?Ci(d.omission):_}l=en(l);var F=l.length;if($u(l)){var z=Ca(l);F=z.length}if(h>=F)return l;var Z=h-zu(_);if(Z<1)return _;var ae=z?Is(z,0,Z).join(""):l.slice(0,Z);if(x===n)return ae+_;if(z&&(Z+=ae.length-Z),G5(x)){if(l.slice(Z).search(x)){var we,Ce=ae;for(x.global||(x=o5(x.source,en(Ke.exec(x))+"g")),x.lastIndex=0;we=x.exec(Ce);)var Ie=we.index;ae=ae.slice(0,Ie===n?Z:Ie)}}else if(l.indexOf(Ci(x),Z)!=Z){var Xe=ae.lastIndexOf(x);Xe>-1&&(ae=ae.slice(0,Xe))}return ae+_}function MV(l){return l=en(l),l&&Rt.test(l)?l.replace(rt,c$):l}var FV=Ku(function(l,d,h){return l+(h?" ":"")+d.toUpperCase()}),q5=fw("toUpperCase");function dA(l,d,h){return l=en(l),d=h?n:d,d===n?a$(l)?f$(l):XU(l):l.match(d)||[]}var pA=xt(function(l,d){try{return wi(l,n,d)}catch(h){return j5(h)?h:new _t(h)}}),PV=Po(function(l,d){return Xi(d,function(h){h=ao(h),Mo(l,h,z5(l[h],l))}),l});function BV(l){var d=l==null?0:l.length,h=mt();return l=d?An(l,function(_){if(typeof _[1]!="function")throw new Zi(o);return[h(_[0]),_[1]]}):[],xt(function(_){for(var x=-1;++xW)return[];var h=pe,_=Mr(l,pe);d=mt(d),l-=pe;for(var x=r5(_,d);++h0||d<0)?new Mt(h):(l<0?h=h.takeRight(-l):l&&(h=h.drop(l)),d!==n&&(d=St(d),h=d<0?h.dropRight(-d):h.take(d-l)),h)},Mt.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Mt.prototype.toArray=function(){return this.take(pe)},ro(Mt.prototype,function(l,d){var h=/^(?:filter|find|map|reject)|While$/.test(d),_=/^(?:head|last)$/.test(d),x=M[_?"take"+(d=="last"?"Right":""):d],F=_||/^find/.test(d);x&&(M.prototype[d]=function(){var z=this.__wrapped__,Z=_?[1]:arguments,ae=z instanceof Mt,we=Z[0],Ce=ae||Tt(z),Ie=function(Nt){var Bt=x.apply(M,Ss([Nt],Z));return _&&Xe?Bt[0]:Bt};Ce&&h&&typeof we=="function"&&we.length!=1&&(ae=Ce=!1);var Xe=this.__chain__,lt=!!this.__actions__.length,bt=F&&!Xe,wt=ae&&!lt;if(!F&&Ce){z=wt?z:new Mt(this);var yt=l.apply(z,Z);return yt.__actions__.push({func:Jf,args:[Ie],thisArg:n}),new Qi(yt,Xe)}return bt&&wt?l.apply(this,Z):(yt=this.thru(Ie),bt?_?yt.value()[0]:yt.value():yt)})}),Xi(["pop","push","shift","sort","splice","unshift"],function(l){var d=Af[l],h=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",_=/^(?:pop|shift)$/.test(l);M.prototype[l]=function(){var x=arguments;if(_&&!this.__chain__){var F=this.value();return d.apply(Tt(F)?F:[],x)}return this[h](function(z){return d.apply(Tt(z)?z:[],x)})}}),ro(Mt.prototype,function(l,d){var h=M[d];if(h){var _=h.name+"";an.call(Vu,_)||(Vu[_]=[]),Vu[_].push({name:d,func:h})}}),Vu[Wf(n,E).name]=[{name:"wrapper",func:n}],Mt.prototype.clone=M$,Mt.prototype.reverse=F$,Mt.prototype.value=P$,M.prototype.at=pj,M.prototype.chain=fj,M.prototype.commit=hj,M.prototype.next=gj,M.prototype.plant=bj,M.prototype.reverse=yj,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=Ej,M.prototype.first=M.prototype.head,Oc&&(M.prototype[Oc]=mj),M},Hu=h$();Ol?((Ol.exports=Hu)._=Hu,Y2._=Hu):mr._=Hu}).call(Jl)})(sm,sm.exports);var v4e=sm.exports;const el=Vi(v4e);function uo(e,t){const n=el.cloneDeep(e);for(const r in t)typeof t[r]=="function"?el.updateWith(n,r,t[r]):el.updateWith(n,r,i=>t[r]);return n}const Rc={};Rc["Requires API Key"]="#FF0000";Rc.Local="#00bb00";Rc["Open-Source"]="#0033FF";Rc.Free="#ffff00";const _4e={inputType:"number",key:"context_length",label:"Context Length",defaultValue:2048,required:!1},T4e={inputType:"number",key:"temperature",label:"Temperature",defaultValue:void 0,required:!1,min:0,max:1,step:.01},S4e={inputType:"number",key:"top_p",label:"Top-P",defaultValue:void 0,required:!1,min:0,max:1,step:.01},w4e={inputType:"number",key:"top_k",label:"Top-K",defaultValue:void 0,required:!1,min:0,max:1,step:.01},A4e={inputType:"number",key:"presence_penalty",label:"Presence Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},C4e={inputType:"number",key:"frequency_penalty",label:"Frequency Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},Da=[_4e,T4e,w4e,S4e,A4e,C4e],SN={inputType:"text",key:"server_url",label:"Server URL",placeholder:"e.g. http://localhost:8080",required:!1},sE={title:"CodeLlama Instruct",description:"A model from Meta, fine-tuned for code generation and conversation",refUrl:"",params:{title:"CodeLlama-7b-Instruct",model:"codellama:7b-instruct",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"codellama:7b-instruct",title:"CodeLlama-7b-Instruct"},"13b":{model:"codellama:13b-instruct",title:"CodeLlama-13b-Instruct"},"34b":{model:"codellama:34b-instruct",title:"CodeLlama-34b-Instruct"}}}]},lE={title:"Llama2 Chat",description:"The latest Llama model from Meta, fine-tuned for chat",refUrl:"",params:{title:"Llama2-7b-Chat",model:"llama2:7b-chat",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"llama2:7b-chat",title:"Llama2-7b-Chat"},"13b":{model:"llama2:13b-chat",title:"Llama2-13b-Chat"},"34b":{model:"llama2:34b-chat",title:"Llama2-34b-Chat"}}}]},uE={title:"WizardCoder",description:"A CodeLlama-based code generation model from WizardLM, focused on Python",refUrl:"",params:{title:"WizardCoder-7b-Python",model:"wizardcoder:7b-python",context_length:2048,template_messages:"template_alpaca_messages",prompt_templates:{edit:"alpaca_edit_prompt"}},icon:"wizardlm.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"wizardcoder:7b-python",title:"WizardCoder-7b-Python"},"13b":{model:"wizardcoder:13b-python",title:"WizardCoder-13b-Python"},"34b":{model:"wizardcoder:34b-python",title:"WizardCoder-34b-Python"}}}]},rU={title:"Phind CodeLlama (34b)",description:"A finetune of CodeLlama by Phind",params:{title:"Phind CodeLlama",model:"phind-codellama",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}}},cE={title:"Mistral (7b)",description:"A 7b parameter base model created by Mistral AI, very competent for code generation and other tasks",params:{title:"Mistral",model:"mistral",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},icon:"mistral.png"},iU={title:"SQLCoder",description:"A finetune of StarCoder by Defog.ai, focused specifically on SQL",params:{title:"SQLCoder",model:"sqlcoder",context_length:2048,template_messages:"sqlcoder_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"sqlcoder:7b",title:"SQLCoder-7b"},"13b":{model:"sqlcoder:15b",title:"SQLCoder-15b"}}}]},k4e={title:"CodeUp (13b)",description:"An open-source coding model based on Llama2",params:{title:"CodeUp",model:"codeup",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"alpaca_edit_prompt"}}},o1=[sE,lE,uE,rU,iU,cE,k4e],wN={title:"GPT-4",description:"The latest model from OpenAI",params:{model:"gpt-4",context_length:8096,api_key:"",title:"GPT-4"}},AN={title:"GPT-3.5-Turbo",description:"A faster, cheaper OpenAI model with slightly lower capabilities",params:{model:"gpt-3.5-turbo",context_length:8096,title:"GPT-3.5-Turbo",api_key:""}},x4e={"codellama:7b-instruct":"meta/codellama-7b-instruct:6527b83e01e41412db37de5110a8670e3701ee95872697481a355e05ce12af0e","codellama:13b-instruct":"meta/codellama-13b-instruct:1f01a52ff933873dff339d5fb5e1fd6f24f77456836f514fa05e91c1a42699c7","codellama:34b-instruct":"meta/codellama-34b-instruct:8281a5c610f6e88237ff3ddaf3c33b56f60809e2bdd19fbec2fda742aa18167e","llama2:7b-chat":"meta/llama-2-7b-chat:8e6975e5ed6174911a6ff3d60540dfd4844201974602551e10e9e87ab143d81e","llama2:13b-chat":"meta/llama-2-13b-chat:f4e2de70d66816a838a89eeeb621910adffb0dd0baba3976c96980970978018d"};function CN(e){return x4e[e]||e}const aU={openai:{title:"OpenAI",class:"OpenAI",description:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model",longDescription:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.",icon:"openai.png",tags:["Requires API Key"],packages:[wN,AN],collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your OpenAI API key",required:!0},...Da]},anthropic:{title:"Anthropic",class:"AnthropicLLM",description:"Claude-2 is a highly capable model with a 100k context length",icon:"anthropic.png",tags:["Requires API Key"],longDescription:"To get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.",collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your Anthropic API key",required:!0},...Da],packages:[{title:"Claude-2",description:"A highly capable model with a 100k context length",params:{model:"claude-2",context_length:1e5,title:"Claude-2"}}]},ollama:{title:"Ollama",class:"Ollama",description:"One of the fastest ways to get started with local models on Mac or Linux",longDescription:'To get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama pull `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model="codellama:7b-instruct"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.',icon:"ollama.png",tags:["Local","Open-Source"],packages:o1,collectInputFor:[...Da]},together:{title:"TogetherAI",class:"TogetherLLM",description:"Use the TogetherAI API for extremely fast streaming of open-source models",icon:"together.png",longDescription:`Together is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together: +}`;var wt=pA(function(){return Jt(F,lt+"return "+Ie).apply(n,z)});if(wt.source=Ie,j5(wt))throw wt;return wt}function IV(l){return en(l).toLowerCase()}function RV(l){return en(l).toUpperCase()}function NV(l,d,h){if(l=en(l),l&&(h||d===n))return _S(l);if(!l||!(d=Ci(d)))return l;var _=Ca(l),x=Ca(d),F=TS(_,x),z=SS(_,x)+1;return Is(_,F,z).join("")}function OV(l,d,h){if(l=en(l),l&&(h||d===n))return l.slice(0,AS(l)+1);if(!l||!(d=Ci(d)))return l;var _=Ca(l),x=SS(_,Ca(d))+1;return Is(_,0,x).join("")}function DV(l,d,h){if(l=en(l),l&&(h||d===n))return l.replace(Or,"");if(!l||!(d=Ci(d)))return l;var _=Ca(l),x=TS(_,Ca(d));return Is(_,x).join("")}function LV(l,d){var h=P,_=Q;if(Rn(d)){var x="separator"in d?d.separator:x;h="length"in d?St(d.length):h,_="omission"in d?Ci(d.omission):_}l=en(l);var F=l.length;if($u(l)){var z=Ca(l);F=z.length}if(h>=F)return l;var Z=h-zu(_);if(Z<1)return _;var ae=z?Is(z,0,Z).join(""):l.slice(0,Z);if(x===n)return ae+_;if(z&&(Z+=ae.length-Z),G5(x)){if(l.slice(Z).search(x)){var we,Ce=ae;for(x.global||(x=o5(x.source,en(Ke.exec(x))+"g")),x.lastIndex=0;we=x.exec(Ce);)var Ie=we.index;ae=ae.slice(0,Ie===n?Z:Ie)}}else if(l.indexOf(Ci(x),Z)!=Z){var Ze=ae.lastIndexOf(x);Ze>-1&&(ae=ae.slice(0,Ze))}return ae+_}function MV(l){return l=en(l),l&&Rt.test(l)?l.replace(rt,c$):l}var FV=Ku(function(l,d,h){return l+(h?" ":"")+d.toUpperCase()}),q5=fw("toUpperCase");function dA(l,d,h){return l=en(l),d=h?n:d,d===n?a$(l)?f$(l):XU(l):l.match(d)||[]}var pA=xt(function(l,d){try{return wi(l,n,d)}catch(h){return j5(h)?h:new _t(h)}}),PV=Po(function(l,d){return Xi(d,function(h){h=ao(h),Mo(l,h,z5(l[h],l))}),l});function BV(l){var d=l==null?0:l.length,h=mt();return l=d?An(l,function(_){if(typeof _[1]!="function")throw new Zi(o);return[h(_[0]),_[1]]}):[],xt(function(_){for(var x=-1;++xW)return[];var h=pe,_=Mr(l,pe);d=mt(d),l-=pe;for(var x=r5(_,d);++h0||d<0)?new Mt(h):(l<0?h=h.takeRight(-l):l&&(h=h.drop(l)),d!==n&&(d=St(d),h=d<0?h.dropRight(-d):h.take(d-l)),h)},Mt.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Mt.prototype.toArray=function(){return this.take(pe)},ro(Mt.prototype,function(l,d){var h=/^(?:filter|find|map|reject)|While$/.test(d),_=/^(?:head|last)$/.test(d),x=M[_?"take"+(d=="last"?"Right":""):d],F=_||/^find/.test(d);x&&(M.prototype[d]=function(){var z=this.__wrapped__,Z=_?[1]:arguments,ae=z instanceof Mt,we=Z[0],Ce=ae||Tt(z),Ie=function(Nt){var Bt=x.apply(M,Ss([Nt],Z));return _&&Ze?Bt[0]:Bt};Ce&&h&&typeof we=="function"&&we.length!=1&&(ae=Ce=!1);var Ze=this.__chain__,lt=!!this.__actions__.length,bt=F&&!Ze,wt=ae&&!lt;if(!F&&Ce){z=wt?z:new Mt(this);var yt=l.apply(z,Z);return yt.__actions__.push({func:Jf,args:[Ie],thisArg:n}),new Qi(yt,Ze)}return bt&&wt?l.apply(this,Z):(yt=this.thru(Ie),bt?_?yt.value()[0]:yt.value():yt)})}),Xi(["pop","push","shift","sort","splice","unshift"],function(l){var d=Af[l],h=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",_=/^(?:pop|shift)$/.test(l);M.prototype[l]=function(){var x=arguments;if(_&&!this.__chain__){var F=this.value();return d.apply(Tt(F)?F:[],x)}return this[h](function(z){return d.apply(Tt(z)?z:[],x)})}}),ro(Mt.prototype,function(l,d){var h=M[d];if(h){var _=h.name+"";an.call(Vu,_)||(Vu[_]=[]),Vu[_].push({name:d,func:h})}}),Vu[Wf(n,E).name]=[{name:"wrapper",func:n}],Mt.prototype.clone=M$,Mt.prototype.reverse=F$,Mt.prototype.value=P$,M.prototype.at=pj,M.prototype.chain=fj,M.prototype.commit=hj,M.prototype.next=gj,M.prototype.plant=bj,M.prototype.reverse=yj,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=Ej,M.prototype.first=M.prototype.head,Oc&&(M.prototype[Oc]=mj),M},Hu=h$();Ol?((Ol.exports=Hu)._=Hu,Y2._=Hu):mr._=Hu}).call(Jl)})(sm,sm.exports);var v4e=sm.exports;const el=Vi(v4e);function uo(e,t){const n=el.cloneDeep(e);for(const r in t)typeof t[r]=="function"?el.updateWith(n,r,t[r]):el.updateWith(n,r,i=>t[r]);return n}const Rc={};Rc["Requires API Key"]="#FF0000";Rc.Local="#00bb00";Rc["Open-Source"]="#0033FF";Rc.Free="#ffff00";const _4e={inputType:"number",key:"context_length",label:"Context Length",defaultValue:2048,required:!1},T4e={inputType:"number",key:"temperature",label:"Temperature",defaultValue:void 0,required:!1,min:0,max:1,step:.01},S4e={inputType:"number",key:"top_p",label:"Top-P",defaultValue:void 0,required:!1,min:0,max:1,step:.01},w4e={inputType:"number",key:"top_k",label:"Top-K",defaultValue:void 0,required:!1,min:0,max:1,step:.01},A4e={inputType:"number",key:"presence_penalty",label:"Presence Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},C4e={inputType:"number",key:"frequency_penalty",label:"Frequency Penalty",defaultValue:void 0,required:!1,min:0,max:1,step:.01},Da=[_4e,T4e,w4e,S4e,A4e,C4e],SN={inputType:"text",key:"server_url",label:"Server URL",placeholder:"e.g. http://localhost:8080",required:!1},sE={title:"CodeLlama Instruct",description:"A model from Meta, fine-tuned for code generation and conversation",refUrl:"",params:{title:"CodeLlama-7b-Instruct",model:"codellama:7b-instruct",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"codellama:7b-instruct",title:"CodeLlama-7b-Instruct"},"13b":{model:"codellama:13b-instruct",title:"CodeLlama-13b-Instruct"},"34b":{model:"codellama:34b-instruct",title:"CodeLlama-34b-Instruct"}}}]},lE={title:"Llama2 Chat",description:"The latest Llama model from Meta, fine-tuned for chat",refUrl:"",params:{title:"Llama2-7b-Chat",model:"llama2:7b-chat",context_length:2048,template_messages:"llama2_template_messages"},icon:"meta.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"llama2:7b-chat",title:"Llama2-7b-Chat"},"13b":{model:"llama2:13b-chat",title:"Llama2-13b-Chat"},"34b":{model:"llama2:34b-chat",title:"Llama2-34b-Chat"}}}]},uE={title:"WizardCoder",description:"A CodeLlama-based code generation model from WizardLM, focused on Python",refUrl:"",params:{title:"WizardCoder-7b-Python",model:"wizardcoder:7b-python",context_length:2048,template_messages:"template_alpaca_messages",prompt_templates:{edit:"alpaca_edit_prompt"}},icon:"wizardlm.png",dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"wizardcoder:7b-python",title:"WizardCoder-7b-Python"},"13b":{model:"wizardcoder:13b-python",title:"WizardCoder-13b-Python"},"34b":{model:"wizardcoder:34b-python",title:"WizardCoder-34b-Python"}}}]},rU={title:"Phind CodeLlama (34b)",description:"A finetune of CodeLlama by Phind",params:{title:"Phind CodeLlama",model:"phind-codellama",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}}},cE={title:"Mistral (7b)",description:"A 7b parameter base model created by Mistral AI, very competent for code generation and other tasks",params:{title:"Mistral",model:"mistral",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},icon:"mistral.png"},iU={title:"SQLCoder",description:"A finetune of StarCoder by Defog.ai, focused specifically on SQL",params:{title:"SQLCoder",model:"sqlcoder",context_length:2048,template_messages:"sqlcoder_template_messages",prompt_templates:{edit:"codellama_edit_prompt"}},dimensions:[{name:"Parameter Count",description:"The number of parameters in the model",options:{"7b":{model:"sqlcoder:7b",title:"SQLCoder-7b"},"13b":{model:"sqlcoder:15b",title:"SQLCoder-15b"}}}]},k4e={title:"CodeUp (13b)",description:"An open-source coding model based on Llama2",params:{title:"CodeUp",model:"codeup",context_length:2048,template_messages:"llama2_template_messages",prompt_templates:{edit:"alpaca_edit_prompt"}}},o1=[sE,lE,uE,rU,iU,cE,k4e],wN={title:"GPT-4",description:"The latest model from OpenAI",params:{model:"gpt-4",context_length:8096,api_key:"",title:"GPT-4"}},AN={title:"GPT-3.5-Turbo",description:"A faster, cheaper OpenAI model with slightly lower capabilities",params:{model:"gpt-3.5-turbo",context_length:8096,title:"GPT-3.5-Turbo",api_key:""}},x4e={"codellama:7b-instruct":"meta/codellama-7b-instruct:6527b83e01e41412db37de5110a8670e3701ee95872697481a355e05ce12af0e","codellama:13b-instruct":"meta/codellama-13b-instruct:1f01a52ff933873dff339d5fb5e1fd6f24f77456836f514fa05e91c1a42699c7","codellama:34b-instruct":"meta/codellama-34b-instruct:8281a5c610f6e88237ff3ddaf3c33b56f60809e2bdd19fbec2fda742aa18167e","llama2:7b-chat":"meta/llama-2-7b-chat:8e6975e5ed6174911a6ff3d60540dfd4844201974602551e10e9e87ab143d81e","llama2:13b-chat":"meta/llama-2-13b-chat:f4e2de70d66816a838a89eeeb621910adffb0dd0baba3976c96980970978018d"};function CN(e){return x4e[e]||e}const aU={openai:{title:"OpenAI",class:"OpenAI",description:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model",longDescription:"Use gpt-4, gpt-3.5-turbo, or any other OpenAI model. See [here](https://openai.com/product#made-for-developers) to obtain an API key.",icon:"openai.png",tags:["Requires API Key"],packages:[wN,AN],collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your OpenAI API key",required:!0},...Da]},anthropic:{title:"Anthropic",class:"AnthropicLLM",description:"Claude-2 is a highly capable model with a 100k context length",icon:"anthropic.png",tags:["Requires API Key"],longDescription:"To get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.",collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your Anthropic API key",required:!0},...Da],packages:[{title:"Claude-2",description:"A highly capable model with a 100k context length",params:{model:"claude-2",context_length:1e5,title:"Claude-2"}}]},ollama:{title:"Ollama",class:"Ollama",description:"One of the fastest ways to get started with local models on Mac or Linux",longDescription:'To get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama pull `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model="codellama:7b-instruct"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.',icon:"ollama.png",tags:["Local","Open-Source"],packages:o1,collectInputFor:[...Da]},together:{title:"TogetherAI",class:"TogetherLLM",description:"Use the TogetherAI API for extremely fast streaming of open-source models",icon:"together.png",longDescription:`Together is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together: 1. Obtain an API key from [here](https://together.ai) 2. Paste below 3. Select a model preset`,tags:["Requires API Key","Open-Source"],params:{api_key:""},collectInputFor:[{inputType:"text",key:"api_key",label:"API Key",placeholder:"Enter your TogetherAI API key",required:!0},...Da],packages:[uo(lE,{"dimensions[0].options":e=>el.mapValues(e,t=>el.assign({},t,{model:"togethercomputer/"+t.model.replace("llama2","llama-2").replace(":","-")}))}),uo(sE,{"dimensions[0].options":e=>el.mapValues(e,t=>el.assign({},t,{model:"togethercomputer/"+t.model.replace("codellama","CodeLlama").replace(":","-").replace("instruct","Instruct")}))}),uo(uE,{"params.model":"WizardLM/WizardCoder-15B-V1.0","params.title":"WizardCoder-15b","dimensions[0].options":{"15b":{model:"WizardLM/WizardCoder-15B-V1.0",title:"WizardCoder-15b"},"34b (Python)":{model:"WizardLM/WizardCoder-Python-34B-V1.0",title:"WizardCoder-34b-Python"}}}),uo(rU,{"params.model":"Phind/Phind-CodeLlama-34B-Python-v1"}),uo(cE,{"params.model":"mistralai/Mistral-7B-Instruct-v0.1"})].map(e=>(e.params.context_length=4096,e))},lmstudio:{title:"LM Studio",class:"GGML",description:"One of the fastest ways to get started with local models on Mac or Windows",longDescription:`LMStudio provides a professional and well-designed GUI for exploring, configuring, and serving LLMs. It is available on both Mac and Windows. To get started: diff --git a/extensions/vscode/src/continueIdeClient.ts b/extensions/vscode/src/continueIdeClient.ts index bb6937a58..41ed97a28 100644 --- a/extensions/vscode/src/continueIdeClient.ts +++ b/extensions/vscode/src/continueIdeClient.ts @@ -719,7 +719,7 @@ class IdeProtocolClient { } async debugTerminal() { - const contents = await this.getTerminalContents(); + const contents = (await this.getTerminalContents()).trim(); this.send("debugTerminal", v4(), { contents }); } } diff --git a/server/continuedev/server/protocols/gui.py b/server/continuedev/server/protocols/gui.py index a279ff491..833b0bae1 100644 --- a/server/continuedev/server/protocols/gui.py +++ b/server/continuedev/server/protocols/gui.py @@ -288,7 +288,7 @@ class GUIProtocolServer: "step run", { "step_name": step_to_log.name, - "params": step_to_log.params, + "params": step_to_log.params if step is None else step.dict(), "context": list( map( lambda item: item.dict(), diff --git a/server/continuedev/server/window_manager.py b/server/continuedev/server/window_manager.py index 6414e7567..a2a89bf37 100644 --- a/server/continuedev/server/window_manager.py +++ b/server/continuedev/server/window_manager.py @@ -65,11 +65,12 @@ class Window: async def reload_config(self): self.config = self.load_config() - await self.config.models.start( - self.ide.window_info.unique_id, - self.config.system_message, - self.config.temperature, - ) + if self.ide is not None: + await self.config.models.start( + self.ide.window_info.unique_id, + self.config.system_message, + self.config.temperature, + ) async def load( self, config: Optional[ContinueConfig] = None, only_reloading: bool = False