diff --git "a/assets/index-CSPwXiyR.js" "b/assets/index-CSPwXiyR.js" new file mode 100644--- /dev/null +++ "b/assets/index-CSPwXiyR.js" @@ -0,0 +1,97 @@ +var qd=Object.defineProperty;var Bu=e=>{throw TypeError(e)};var Jd=(e,t,n)=>t in e?qd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var q=(e,t,n)=>Jd(e,typeof t!="symbol"?t+"":t,n),bd=(e,t,n)=>t.has(e)||Bu("Cannot "+n);var Wu=(e,t,n)=>t.has(e)?Bu("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);var cl=(e,t,n)=>(bd(e,t,"access private method"),n);import{PGlite as ep}from"https://cdn.jsdelivr.net/npm/@electric-sql/pglite/dist/index.js";import{vector as tp}from"https://cdn.jsdelivr.net/npm/@electric-sql/pglite/dist/vector/index.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();function np(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hc={exports:{}},vi={},mc={exports:{}},H={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var qr=Symbol.for("react.element"),rp=Symbol.for("react.portal"),lp=Symbol.for("react.fragment"),ip=Symbol.for("react.strict_mode"),op=Symbol.for("react.profiler"),sp=Symbol.for("react.provider"),up=Symbol.for("react.context"),ap=Symbol.for("react.forward_ref"),cp=Symbol.for("react.suspense"),fp=Symbol.for("react.memo"),dp=Symbol.for("react.lazy"),Vu=Symbol.iterator;function pp(e){return e===null||typeof e!="object"?null:(e=Vu&&e[Vu]||e["@@iterator"],typeof e=="function"?e:null)}var gc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yc=Object.assign,vc={};function qn(e,t,n){this.props=e,this.context=t,this.refs=vc,this.updater=n||gc}qn.prototype.isReactComponent={};qn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};qn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function kc(){}kc.prototype=qn.prototype;function ks(e,t,n){this.props=e,this.context=t,this.refs=vc,this.updater=n||gc}var ws=ks.prototype=new kc;ws.constructor=ks;yc(ws,qn.prototype);ws.isPureReactComponent=!0;var Qu=Array.isArray,wc=Object.prototype.hasOwnProperty,xs={current:null},xc={key:!0,ref:!0,__self:!0,__source:!0};function Sc(e,t,n){var r,l={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)wc.call(t,r)&&!xc.hasOwnProperty(r)&&(l[r]=t[r]);var s=arguments.length-2;if(s===1)l.children=n;else if(1>>1,A=C[D];if(0>>1;Dl($,M))oel(ut,$)?(C[D]=ut,C[oe]=M,D=oe):(C[D]=$,C[K]=M,D=K);else if(oel(ut,M))C[D]=ut,C[oe]=M,D=oe;else break e}}return I}function l(C,I){var M=C.sortIndex-I.sortIndex;return M!==0?M:C.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var u=[],a=[],p=1,g=null,h=3,v=!1,x=!1,S=!1,O=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(C){for(var I=n(a);I!==null;){if(I.callback===null)r(a);else if(I.startTime<=C)r(a),I.sortIndex=I.expirationTime,t(u,I);else break;I=n(a)}}function y(C){if(S=!1,m(C),!x)if(n(u)!==null)x=!0,qt(_);else{var I=n(a);I!==null&&Jt(y,I.startTime-C)}}function _(C,I){x=!1,S&&(S=!1,d(P),P=-1),v=!0;var M=h;try{for(m(I),g=n(u);g!==null&&(!(g.expirationTime>I)||C&&!ee());){var D=g.callback;if(typeof D=="function"){g.callback=null,h=g.priorityLevel;var A=D(g.expirationTime<=I);I=e.unstable_now(),typeof A=="function"?g.callback=A:g===n(u)&&r(u),m(I)}else r(u);g=n(u)}if(g!==null)var j=!0;else{var K=n(a);K!==null&&Jt(y,K.startTime-I),j=!1}return j}finally{g=null,h=M,v=!1}}var T=!1,R=null,P=-1,Y=5,F=-1;function ee(){return!(e.unstable_now()-FC||125D?(C.sortIndex=M,t(a,C),n(u)===null&&C===n(a)&&(S?(d(P),P=-1):S=!0,Jt(y,M-D))):(C.sortIndex=A,t(u,C),x||v||(x=!0,qt(_))),C},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(C){var I=h;return function(){var M=h;h=I;try{return C.apply(this,arguments)}finally{h=M}}}})(Nc);Cc.exports=Nc;var Tp=Cc.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Cp=B,Ue=Tp;function w(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Eo=Object.prototype.hasOwnProperty,Np=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Yu={},Ku={};function Rp(e){return Eo.call(Ku,e)?!0:Eo.call(Yu,e)?!1:Np.test(e)?Ku[e]=!0:(Yu[e]=!0,!1)}function Lp(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Pp(e,t,n,r){if(t===null||typeof t>"u"||Lp(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Le(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var ye={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ye[e]=new Le(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ye[t]=new Le(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ye[e]=new Le(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ye[e]=new Le(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ye[e]=new Le(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ye[e]=new Le(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ye[e]=new Le(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ye[e]=new Le(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ye[e]=new Le(e,5,!1,e.toLowerCase(),null,!1,!1)});var Es=/[\-:]([a-z])/g;function _s(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Es,_s);ye[t]=new Le(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Es,_s);ye[t]=new Le(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Es,_s);ye[t]=new Le(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ye[e]=new Le(e,1,!1,e.toLowerCase(),null,!1,!1)});ye.xlinkHref=new Le("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ye[e]=new Le(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ts(e,t,n,r){var l=ye.hasOwnProperty(t)?ye[t]:null;(l!==null?l.type!==0:r||!(2s||l[o]!==i[s]){var u=` +`+l[o].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=s);break}}}finally{Qi=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?kr(e):""}function Ap(e){switch(e.tag){case 5:return kr(e.type);case 16:return kr("Lazy");case 13:return kr("Suspense");case 19:return kr("SuspenseList");case 0:case 2:case 15:return e=Gi(e.type,!1),e;case 11:return e=Gi(e.type.render,!1),e;case 1:return e=Gi(e.type,!0),e;default:return""}}function No(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Nn:return"Fragment";case Cn:return"Portal";case _o:return"Profiler";case Cs:return"StrictMode";case To:return"Suspense";case Co:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Pc:return(e.displayName||"Context")+".Consumer";case Lc:return(e._context.displayName||"Context")+".Provider";case Ns:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Rs:return t=e.displayName||null,t!==null?t:No(e.type)||"Memo";case zt:t=e._payload,e=e._init;try{return No(e(t))}catch{}}return null}function zp(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return No(t);case 8:return t===Cs?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Gt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ip(e){var t=zc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function pl(e){e._valueTracker||(e._valueTracker=Ip(e))}function Ic(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=zc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ql(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ro(e,t){var n=t.checked;return le({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Zu(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Gt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Mc(e,t){t=t.checked,t!=null&&Ts(e,"checked",t,!1)}function Lo(e,t){Mc(e,t);var n=Gt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Po(e,t.type,n):t.hasOwnProperty("defaultValue")&&Po(e,t.type,Gt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function qu(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Po(e,t,n){(t!=="number"||Ql(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wr=Array.isArray;function Fn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=hl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Or(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Er={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Mp=["Webkit","ms","Moz","O"];Object.keys(Er).forEach(function(e){Mp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Er[t]=Er[e]})});function Fc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Er.hasOwnProperty(e)&&Er[e]?(""+t).trim():t+"px"}function $c(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Fc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Op=le({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Io(e,t){if(t){if(Op[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(w(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(w(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(w(61))}if(t.style!=null&&typeof t.style!="object")throw Error(w(62))}}function Mo(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Oo=null;function Ls(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Do=null,$n=null,Un=null;function ea(e){if(e=el(e)){if(typeof Do!="function")throw Error(w(280));var t=e.stateNode;t&&(t=Ei(t),Do(e.stateNode,e.type,t))}}function Uc(e){$n?Un?Un.push(e):Un=[e]:$n=e}function Hc(){if($n){var e=$n,t=Un;if(Un=$n=null,ea(e),t)for(e=0;e>>=0,e===0?32:31-(Gp(e)/Yp|0)|0}var ml=64,gl=4194304;function xr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Xl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~l;s!==0?r=xr(s):(i&=o,i!==0&&(r=xr(i)))}else o=n&~l,o!==0?r=xr(o):i!==0&&(r=xr(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Jr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-lt(t),e[t]=n}function qp(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Tr),aa=" ",ca=!1;function uf(e,t){switch(e){case"keyup":return Th.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function af(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rn=!1;function Nh(e,t){switch(e){case"compositionend":return af(t);case"keypress":return t.which!==32?null:(ca=!0,aa);case"textInput":return e=t.data,e===aa&&ca?null:e;default:return null}}function Rh(e,t){if(Rn)return e==="compositionend"||!js&&uf(e,t)?(e=of(),Ol=Ms=Dt=null,Rn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ha(n)}}function pf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hf(){for(var e=window,t=Ql();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ql(e.document)}return t}function Fs(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function jh(e){var t=hf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&pf(n.ownerDocument.documentElement,n)){if(r!==null&&Fs(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=ma(n,i);var o=ma(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Ln=null,Bo=null,Nr=null,Wo=!1;function ga(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wo||Ln==null||Ln!==Ql(r)||(r=Ln,"selectionStart"in r&&Fs(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nr&&Hr(Nr,r)||(Nr=r,r=Jl(Bo,"onSelect"),0zn||(e.current=Xo[zn],Xo[zn]=null,zn--)}function Z(e,t){zn++,Xo[zn]=e.current,e.current=t}var Yt={},Se=Xt(Yt),Ie=Xt(!1),an=Yt;function Qn(e,t){var n=e.type.contextTypes;if(!n)return Yt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Me(e){return e=e.childContextTypes,e!=null}function ei(){b(Ie),b(Se)}function Ea(e,t,n){if(Se.current!==Yt)throw Error(w(168));Z(Se,t),Z(Ie,n)}function Ef(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(w(108,zp(e)||"Unknown",l));return le({},n,r)}function ti(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yt,an=Se.current,Z(Se,e),Z(Ie,Ie.current),!0}function _a(e,t,n){var r=e.stateNode;if(!r)throw Error(w(169));n?(e=Ef(e,t,an),r.__reactInternalMemoizedMergedChildContext=e,b(Ie),b(Se),Z(Se,e)):b(Ie),Z(Ie,n)}var xt=null,_i=!1,oo=!1;function _f(e){xt===null?xt=[e]:xt.push(e)}function Xh(e){_i=!0,_f(e)}function Zt(){if(!oo&&xt!==null){oo=!0;var e=0,t=Q;try{var n=xt;for(Q=1;e>=o,l-=o,St=1<<32-lt(t)+l|n<P?(Y=R,R=null):Y=R.sibling;var F=h(d,R,m[P],y);if(F===null){R===null&&(R=Y);break}e&&R&&F.alternate===null&&t(d,R),c=i(F,c,P),T===null?_=F:T.sibling=F,T=F,R=Y}if(P===m.length)return n(d,R),te&&en(d,P),_;if(R===null){for(;PP?(Y=R,R=null):Y=R.sibling;var ee=h(d,R,F.value,y);if(ee===null){R===null&&(R=Y);break}e&&R&&ee.alternate===null&&t(d,R),c=i(ee,c,P),T===null?_=ee:T.sibling=ee,T=ee,R=Y}if(F.done)return n(d,R),te&&en(d,P),_;if(R===null){for(;!F.done;P++,F=m.next())F=g(d,F.value,y),F!==null&&(c=i(F,c,P),T===null?_=F:T.sibling=F,T=F);return te&&en(d,P),_}for(R=r(d,R);!F.done;P++,F=m.next())F=v(R,d,P,F.value,y),F!==null&&(e&&F.alternate!==null&&R.delete(F.key===null?P:F.key),c=i(F,c,P),T===null?_=F:T.sibling=F,T=F);return e&&R.forEach(function(Je){return t(d,Je)}),te&&en(d,P),_}function O(d,c,m,y){if(typeof m=="object"&&m!==null&&m.type===Nn&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case dl:e:{for(var _=m.key,T=c;T!==null;){if(T.key===_){if(_=m.type,_===Nn){if(T.tag===7){n(d,T.sibling),c=l(T,m.props.children),c.return=d,d=c;break e}}else if(T.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===zt&&Na(_)===T.type){n(d,T.sibling),c=l(T,m.props),c.ref=cr(d,T,m),c.return=d,d=c;break e}n(d,T);break}else t(d,T);T=T.sibling}m.type===Nn?(c=un(m.props.children,d.mode,y,m.key),c.return=d,d=c):(y=Wl(m.type,m.key,m.props,null,d.mode,y),y.ref=cr(d,c,m),y.return=d,d=y)}return o(d);case Cn:e:{for(T=m.key;c!==null;){if(c.key===T)if(c.tag===4&&c.stateNode.containerInfo===m.containerInfo&&c.stateNode.implementation===m.implementation){n(d,c.sibling),c=l(c,m.children||[]),c.return=d,d=c;break e}else{n(d,c);break}else t(d,c);c=c.sibling}c=mo(m,d.mode,y),c.return=d,d=c}return o(d);case zt:return T=m._init,O(d,c,T(m._payload),y)}if(wr(m))return x(d,c,m,y);if(ir(m))return S(d,c,m,y);El(d,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,c!==null&&c.tag===6?(n(d,c.sibling),c=l(c,m),c.return=d,d=c):(n(d,c),c=ho(m,d.mode,y),c.return=d,d=c),o(d)):n(d,c)}return O}var Yn=Rf(!0),Lf=Rf(!1),li=Xt(null),ii=null,On=null,Bs=null;function Ws(){Bs=On=ii=null}function Vs(e){var t=li.current;b(li),e._currentValue=t}function Jo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Bn(e,t){ii=e,Bs=On=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ze=!0),e.firstContext=null)}function Xe(e){var t=e._currentValue;if(Bs!==e)if(e={context:e,memoizedValue:t,next:null},On===null){if(ii===null)throw Error(w(308));On=e,ii.dependencies={lanes:0,firstContext:e}}else On=On.next=e;return t}var ln=null;function Qs(e){ln===null?ln=[e]:ln.push(e)}function Pf(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Qs(t)):(n.next=l.next,l.next=n),t.interleaved=n,Nt(e,r)}function Nt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var It=!1;function Gs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Af(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function _t(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Bt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,W&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Nt(e,n)}return l=r.interleaved,l===null?(t.next=t,Qs(r)):(t.next=l.next,l.next=t),r.interleaved=t,Nt(e,n)}function jl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,As(e,n)}}function Ra(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function oi(e,t,n,r){var l=e.updateQueue;It=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,s=l.shared.pending;if(s!==null){l.shared.pending=null;var u=s,a=u.next;u.next=null,o===null?i=a:o.next=a,o=u;var p=e.alternate;p!==null&&(p=p.updateQueue,s=p.lastBaseUpdate,s!==o&&(s===null?p.firstBaseUpdate=a:s.next=a,p.lastBaseUpdate=u))}if(i!==null){var g=l.baseState;o=0,p=a=u=null,s=i;do{var h=s.lane,v=s.eventTime;if((r&h)===h){p!==null&&(p=p.next={eventTime:v,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var x=e,S=s;switch(h=t,v=n,S.tag){case 1:if(x=S.payload,typeof x=="function"){g=x.call(v,g,h);break e}g=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=S.payload,h=typeof x=="function"?x.call(v,g,h):x,h==null)break e;g=le({},g,h);break e;case 2:It=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=l.effects,h===null?l.effects=[s]:h.push(s))}else v={eventTime:v,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},p===null?(a=p=v,u=g):p=p.next=v,o|=h;if(s=s.next,s===null){if(s=l.shared.pending,s===null)break;h=s,s=h.next,h.next=null,l.lastBaseUpdate=h,l.shared.pending=null}}while(!0);if(p===null&&(u=g),l.baseState=u,l.firstBaseUpdate=a,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);dn|=o,e.lanes=o,e.memoizedState=g}}function La(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=uo.transition;uo.transition={};try{e(!1),t()}finally{Q=n,uo.transition=r}}function Kf(){return Ze().memoizedState}function bh(e,t,n){var r=Vt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Xf(e))Zf(t,n);else if(n=Pf(e,t,n,r),n!==null){var l=Ce();it(n,e,r,l),qf(n,t,r)}}function em(e,t,n){var r=Vt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Xf(e))Zf(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,s=i(o,n);if(l.hasEagerState=!0,l.eagerState=s,ot(s,o)){var u=t.interleaved;u===null?(l.next=l,Qs(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Pf(e,t,l,r),n!==null&&(l=Ce(),it(n,e,r,l),qf(n,t,r))}}function Xf(e){var t=e.alternate;return e===re||t!==null&&t===re}function Zf(e,t){Rr=ui=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,As(e,n)}}var ai={readContext:Xe,useCallback:ke,useContext:ke,useEffect:ke,useImperativeHandle:ke,useInsertionEffect:ke,useLayoutEffect:ke,useMemo:ke,useReducer:ke,useRef:ke,useState:ke,useDebugValue:ke,useDeferredValue:ke,useTransition:ke,useMutableSource:ke,useSyncExternalStore:ke,useId:ke,unstable_isNewReconciler:!1},tm={readContext:Xe,useCallback:function(e,t){return dt().memoizedState=[e,t===void 0?null:t],e},useContext:Xe,useEffect:Aa,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$l(4194308,4,Wf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $l(4194308,4,e,t)},useInsertionEffect:function(e,t){return $l(4,2,e,t)},useMemo:function(e,t){var n=dt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=dt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=bh.bind(null,re,e),[r.memoizedState,e]},useRef:function(e){var t=dt();return e={current:e},t.memoizedState=e},useState:Pa,useDebugValue:eu,useDeferredValue:function(e){return dt().memoizedState=e},useTransition:function(){var e=Pa(!1),t=e[0];return e=Jh.bind(null,e[1]),dt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=re,l=dt();if(te){if(n===void 0)throw Error(w(407));n=n()}else{if(n=t(),pe===null)throw Error(w(349));fn&30||Of(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Aa(jf.bind(null,r,i,e),[e]),r.flags|=2048,Xr(9,Df.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=dt(),t=pe.identifierPrefix;if(te){var n=Et,r=St;n=(r&~(1<<32-lt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Yr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[pt]=t,e[Vr]=r,sd(e,t,!1,!1),t.stateNode=e;e:{switch(o=Mo(n,r),n){case"dialog":J("cancel",e),J("close",e),l=r;break;case"iframe":case"object":case"embed":J("load",e),l=r;break;case"video":case"audio":for(l=0;lZn&&(t.flags|=128,r=!0,fr(i,!1),t.lanes=4194304)}else{if(!r)if(e=si(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!te)return we(t),null}else 2*se()-i.renderingStartTime>Zn&&n!==1073741824&&(t.flags|=128,r=!0,fr(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=se(),t.sibling=null,n=ne.current,Z(ne,r?n&1|2:n&1),t):(we(t),null);case 22:case 23:return ou(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?De&1073741824&&(we(t),t.subtreeFlags&6&&(t.flags|=8192)):we(t),null;case 24:return null;case 25:return null}throw Error(w(156,t.tag))}function am(e,t){switch(Us(t),t.tag){case 1:return Me(t.type)&&ei(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kn(),b(Ie),b(Se),Xs(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ks(t),null;case 13:if(b(ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(w(340));Gn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return b(ne),null;case 4:return Kn(),null;case 10:return Vs(t.type._context),null;case 22:case 23:return ou(),null;case 24:return null;default:return null}}var Tl=!1,xe=!1,cm=typeof WeakSet=="function"?WeakSet:Set,N=null;function Dn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ie(e,t,r)}else n.current=null}function ss(e,t,n){try{n()}catch(r){ie(e,t,r)}}var Ba=!1;function fm(e,t){if(Vo=Zl,e=hf(),Fs(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,s=-1,u=-1,a=0,p=0,g=e,h=null;t:for(;;){for(var v;g!==n||l!==0&&g.nodeType!==3||(s=o+l),g!==i||r!==0&&g.nodeType!==3||(u=o+r),g.nodeType===3&&(o+=g.nodeValue.length),(v=g.firstChild)!==null;)h=g,g=v;for(;;){if(g===e)break t;if(h===n&&++a===l&&(s=o),h===i&&++p===r&&(u=o),(v=g.nextSibling)!==null)break;g=h,h=g.parentNode}g=v}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qo={focusedElem:e,selectionRange:n},Zl=!1,N=t;N!==null;)if(t=N,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,N=e;else for(;N!==null;){t=N;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var S=x.memoizedProps,O=x.memoizedState,d=t.stateNode,c=d.getSnapshotBeforeUpdate(t.elementType===t.type?S:tt(t.type,S),O);d.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(w(163))}}catch(y){ie(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,N=e;break}N=t.return}return x=Ba,Ba=!1,x}function Lr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&ss(t,n,i)}l=l.next}while(l!==r)}}function Ni(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function us(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function cd(e){var t=e.alternate;t!==null&&(e.alternate=null,cd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[pt],delete t[Vr],delete t[Ko],delete t[Yh],delete t[Kh])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function fd(e){return e.tag===5||e.tag===3||e.tag===4}function Wa(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function as(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bl));else if(r!==4&&(e=e.child,e!==null))for(as(e,t,n),e=e.sibling;e!==null;)as(e,t,n),e=e.sibling}function cs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(cs(e,t,n),e=e.sibling;e!==null;)cs(e,t,n),e=e.sibling}var me=null,nt=!1;function At(e,t,n){for(n=n.child;n!==null;)dd(e,t,n),n=n.sibling}function dd(e,t,n){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(ki,n)}catch{}switch(n.tag){case 5:xe||Dn(n,t);case 6:var r=me,l=nt;me=null,At(e,t,n),me=r,nt=l,me!==null&&(nt?(e=me,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):me.removeChild(n.stateNode));break;case 18:me!==null&&(nt?(e=me,n=n.stateNode,e.nodeType===8?io(e.parentNode,n):e.nodeType===1&&io(e,n),$r(e)):io(me,n.stateNode));break;case 4:r=me,l=nt,me=n.stateNode.containerInfo,nt=!0,At(e,t,n),me=r,nt=l;break;case 0:case 11:case 14:case 15:if(!xe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&ss(n,t,o),l=l.next}while(l!==r)}At(e,t,n);break;case 1:if(!xe&&(Dn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){ie(n,t,s)}At(e,t,n);break;case 21:At(e,t,n);break;case 22:n.mode&1?(xe=(r=xe)||n.memoizedState!==null,At(e,t,n),xe=r):At(e,t,n);break;default:At(e,t,n)}}function Va(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new cm),t.forEach(function(r){var l=wm.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function be(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=se()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*pm(r/1960))-r,10e?16:e,jt===null)var r=!1;else{if(e=jt,jt=null,di=0,W&6)throw Error(w(331));var l=W;for(W|=4,N=e.current;N!==null;){var i=N,o=i.child;if(N.flags&16){var s=i.deletions;if(s!==null){for(var u=0;use()-lu?sn(e,0):ru|=n),Oe(e,t)}function wd(e,t){t===0&&(e.mode&1?(t=gl,gl<<=1,!(gl&130023424)&&(gl=4194304)):t=1);var n=Ce();e=Nt(e,t),e!==null&&(Jr(e,t,n),Oe(e,n))}function km(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wd(e,n)}function wm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(w(314))}r!==null&&r.delete(t),wd(e,n)}var xd;xd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ie.current)ze=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ze=!1,sm(e,t,n);ze=!!(e.flags&131072)}else ze=!1,te&&t.flags&1048576&&Tf(t,ri,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ul(e,t),e=t.pendingProps;var l=Qn(t,Se.current);Bn(t,n),l=qs(null,t,r,e,l,n);var i=Js();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Me(r)?(i=!0,ti(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Gs(t),l.updater=Ci,t.stateNode=l,l._reactInternals=t,es(t,r,e,n),t=rs(null,t,r,!0,i,n)):(t.tag=0,te&&i&&$s(t),Te(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ul(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Sm(r),e=tt(r,e),l){case 0:t=ns(null,t,r,e,n);break e;case 1:t=$a(null,t,r,e,n);break e;case 11:t=ja(null,t,r,e,n);break e;case 14:t=Fa(null,t,r,tt(r.type,e),n);break e}throw Error(w(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:tt(r,l),ns(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:tt(r,l),$a(e,t,r,l,n);case 3:e:{if(ld(t),e===null)throw Error(w(387));r=t.pendingProps,i=t.memoizedState,l=i.element,Af(e,t),oi(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=Xn(Error(w(423)),t),t=Ua(e,t,r,n,l);break e}else if(r!==l){l=Xn(Error(w(424)),t),t=Ua(e,t,r,n,l);break e}else for(Fe=Ht(t.stateNode.containerInfo.firstChild),$e=t,te=!0,rt=null,n=Lf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Gn(),r===l){t=Rt(e,t,n);break e}Te(e,t,r,n)}t=t.child}return t;case 5:return zf(t),e===null&&qo(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,Go(r,l)?o=null:i!==null&&Go(r,i)&&(t.flags|=32),rd(e,t),Te(e,t,o,n),t.child;case 6:return e===null&&qo(t),null;case 13:return id(e,t,n);case 4:return Ys(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Yn(t,null,r,n):Te(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:tt(r,l),ja(e,t,r,l,n);case 7:return Te(e,t,t.pendingProps,n),t.child;case 8:return Te(e,t,t.pendingProps.children,n),t.child;case 12:return Te(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,Z(li,r._currentValue),r._currentValue=o,i!==null)if(ot(i.value,o)){if(i.children===l.children&&!Ie.current){t=Rt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){o=i.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=_t(-1,n&-n),u.tag=2;var a=i.updateQueue;if(a!==null){a=a.shared;var p=a.pending;p===null?u.next=u:(u.next=p.next,p.next=u),a.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Jo(i.return,n,t),s.lanes|=n;break}u=u.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(w(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),Jo(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Te(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Bn(t,n),l=Xe(l),r=r(l),t.flags|=1,Te(e,t,r,n),t.child;case 14:return r=t.type,l=tt(r,t.pendingProps),l=tt(r.type,l),Fa(e,t,r,l,n);case 15:return td(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:tt(r,l),Ul(e,t),t.tag=1,Me(r)?(e=!0,ti(t)):e=!1,Bn(t,n),Jf(t,r,l),es(t,r,l,n),rs(null,t,r,!0,e,n);case 19:return od(e,t,n);case 22:return nd(e,t,n)}throw Error(w(156,t.tag))};function Sd(e,t){return Kc(e,t)}function xm(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ye(e,t,n,r){return new xm(e,t,n,r)}function uu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Sm(e){if(typeof e=="function")return uu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ns)return 11;if(e===Rs)return 14}return 2}function Qt(e,t){var n=e.alternate;return n===null?(n=Ye(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Wl(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")uu(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Nn:return un(n.children,l,i,t);case Cs:o=8,l|=8;break;case _o:return e=Ye(12,n,t,l|2),e.elementType=_o,e.lanes=i,e;case To:return e=Ye(13,n,t,l),e.elementType=To,e.lanes=i,e;case Co:return e=Ye(19,n,t,l),e.elementType=Co,e.lanes=i,e;case Ac:return Li(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Lc:o=10;break e;case Pc:o=9;break e;case Ns:o=11;break e;case Rs:o=14;break e;case zt:o=16,r=null;break e}throw Error(w(130,e==null?e:typeof e,""))}return t=Ye(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function un(e,t,n,r){return e=Ye(7,e,r,t),e.lanes=n,e}function Li(e,t,n,r){return e=Ye(22,e,r,t),e.elementType=Ac,e.lanes=n,e.stateNode={isHidden:!1},e}function ho(e,t,n){return e=Ye(6,e,null,t),e.lanes=n,e}function mo(e,t,n){return t=Ye(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Em(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ki(0),this.expirationTimes=Ki(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ki(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function au(e,t,n,r,l,i,o,s,u){return e=new Em(e,t,n,s,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ye(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gs(i),e}function _m(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Cd)}catch(e){console.error(e)}}Cd(),Tc.exports=Be;var Lm=Tc.exports,Ja=Lm;So.createRoot=Ja.createRoot,So.hydrateRoot=Ja.hydrateRoot;let go;async function Pm(){if(go)return go;const e=new ep("idb://browser-rag",{extensions:{vector:tp}});return await e.waitReady,go=e,e}const Am=async e=>await e.exec(` + create extension if not exists vector; + --drop table if exists embeddings; -- Uncomment this line to reset the database + create table if not exists embeddings ( + id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, + title text not null, + content text not null, + embedding vector (384) + ); + + create index on embeddings using hnsw (embedding vector_ip_ops); + `),ba=async(e,t)=>(await e.query(`SELECT COUNT(*) FROM ${t};`)).rows[0].count;function pu(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let vn=pu();function Nd(e){vn=e}const Rd=/[&<>"']/,zm=new RegExp(Rd.source,"g"),Ld=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Im=new RegExp(Ld.source,"g"),Mm={"&":"&","<":"<",">":">",'"':""","'":"'"},ec=e=>Mm[e];function je(e,t){if(t){if(Rd.test(e))return e.replace(zm,ec)}else if(Ld.test(e))return e.replace(Im,ec);return e}const Om=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Dm(e){return e.replace(Om,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const jm=/(^|[^\[])\^/g;function G(e,t){let n=typeof e=="string"?e:e.source;t=t||"";const r={replace:(l,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(jm,"$1"),n=n.replace(l,o),r},getRegex:()=>new RegExp(n,t)};return r}function tc(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const zr={exec:()=>null};function nc(e,t){const n=e.replace(/\|/g,(i,o,s)=>{let u=!1,a=o;for(;--a>=0&&s[a]==="\\";)u=!u;return u?"|":" |"}),r=n.split(/ \|/);let l=0;if(r[0].trim()||r.shift(),r.length>0&&!r[r.length-1].trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length{const i=l.match(/^\s+/);if(i===null)return l;const[o]=i;return o.length>=r.length?l.slice(r.length):l}).join(` +`)}class mi{constructor(t){q(this,"options");q(this,"rules");q(this,"lexer");this.options=t||vn}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const r=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Rl(r,` +`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],l=$m(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:l}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const l=Rl(r,"#");(this.options.pedantic||!l||/ $/.test(l))&&(r=l.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){let r=n[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` + $1`);r=Rl(r.replace(/^ *>[ \t]?/gm,""),` +`);const l=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(r);return this.lexer.state.top=l,{type:"blockquote",raw:n[0],tokens:i,text:r}}}list(t){let n=this.rules.block.list.exec(t);if(n){let r=n[1].trim();const l=r.length>1,i={type:"list",raw:"",ordered:l,start:l?+r.slice(0,-1):"",loose:!1,items:[]};r=l?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=l?r:"[*+-]");const o=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);let s="",u="",a=!1;for(;t;){let p=!1;if(!(n=o.exec(t))||this.rules.block.hr.test(t))break;s=n[0],t=t.substring(s.length);let g=n[2].split(` +`,1)[0].replace(/^\t+/,d=>" ".repeat(3*d.length)),h=t.split(` +`,1)[0],v=0;this.options.pedantic?(v=2,u=g.trimStart()):(v=n[2].search(/[^ ]/),v=v>4?1:v,u=g.slice(v),v+=n[1].length);let x=!1;if(!g&&/^ *$/.test(h)&&(s+=h+` +`,t=t.substring(h.length+1),p=!0),!p){const d=new RegExp(`^ {0,${Math.min(3,v-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),c=new RegExp(`^ {0,${Math.min(3,v-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),m=new RegExp(`^ {0,${Math.min(3,v-1)}}(?:\`\`\`|~~~)`),y=new RegExp(`^ {0,${Math.min(3,v-1)}}#`);for(;t;){const _=t.split(` +`,1)[0];if(h=_,this.options.pedantic&&(h=h.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),m.test(h)||y.test(h)||d.test(h)||c.test(t))break;if(h.search(/[^ ]/)>=v||!h.trim())u+=` +`+h.slice(v);else{if(x||g.search(/[^ ]/)>=4||m.test(g)||y.test(g)||c.test(g))break;u+=` +`+h}!x&&!h.trim()&&(x=!0),s+=_+` +`,t=t.substring(_.length+1),g=h.slice(v)}}i.loose||(a?i.loose=!0:/\n *\n *$/.test(s)&&(a=!0));let S=null,O;this.options.gfm&&(S=/^\[[ xX]\] /.exec(u),S&&(O=S[0]!=="[ ] ",u=u.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:s,task:!!S,checked:O,loose:!1,text:u,tokens:[]}),i.raw+=s}i.items[i.items.length-1].raw=s.trimEnd(),i.items[i.items.length-1].text=u.trimEnd(),i.raw=i.raw.trimEnd();for(let p=0;pv.type==="space"),h=g.length>0&&g.some(v=>/\n.*\n/.test(v.raw));i.loose=h}if(i.loose)for(let p=0;p$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:l,title:i}}}table(t){const n=this.rules.block.table.exec(t);if(!n||!/[:|]/.test(n[2]))return;const r=nc(n[1]),l=n[2].replace(/^\||\| *$/g,"").split("|"),i=n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(` +`):[],o={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===l.length){for(const s of l)/^ *-+: *$/.test(s)?o.align.push("right"):/^ *:-+: *$/.test(s)?o.align.push("center"):/^ *:-+ *$/.test(s)?o.align.push("left"):o.align.push(null);for(const s of r)o.header.push({text:s,tokens:this.lexer.inline(s)});for(const s of i)o.rows.push(nc(s,o.header.length).map(u=>({text:u,tokens:this.lexer.inline(u)})));return o}}lheading(t){const n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){const n=this.rules.block.paragraph.exec(t);if(n){const r=n[1].charAt(n[1].length-1)===` +`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(t){const n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){const n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:je(n[1])}}tag(t){const n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const r=n[2].trim();if(!this.options.pedantic&&/^$/.test(r))return;const o=Rl(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{const o=Fm(n[2],"()");if(o>-1){const u=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,u).trim(),n[3]=""}}let l=n[2],i="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(l);o&&(l=o[1],i=o[3])}else i=n[3]?n[3].slice(1,-1):"";return l=l.trim(),/^$/.test(r)?l=l.slice(1):l=l.slice(1,-1)),rc(n,{href:l&&l.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer)}}reflink(t,n){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){const l=(r[2]||r[1]).replace(/\s+/g," "),i=n[l.toLowerCase()];if(!i){const o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return rc(r,i,r[0],this.lexer)}}emStrong(t,n,r=""){let l=this.rules.inline.emStrongLDelim.exec(t);if(!l||l[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(l[1]||l[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const o=[...l[0]].length-1;let s,u,a=o,p=0;const g=l[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(g.lastIndex=0,n=n.slice(-1*t.length+o);(l=g.exec(n))!=null;){if(s=l[1]||l[2]||l[3]||l[4]||l[5]||l[6],!s)continue;if(u=[...s].length,l[3]||l[4]){a+=u;continue}else if((l[5]||l[6])&&o%3&&!((o+u)%3)){p+=u;continue}if(a-=u,a>0)continue;u=Math.min(u,u+a+p);const h=[...l[0]][0].length,v=t.slice(0,o+l.index+h+u);if(Math.min(o,u)%2){const S=v.slice(1,-1);return{type:"em",raw:v,text:S,tokens:this.lexer.inlineTokens(S)}}const x=v.slice(2,-2);return{type:"strong",raw:v,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const l=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return l&&i&&(r=r.substring(1,r.length-1)),r=je(r,!0),{type:"codespan",raw:n[0],text:r}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){const n=this.rules.inline.autolink.exec(t);if(n){let r,l;return n[2]==="@"?(r=je(n[1]),l="mailto:"+r):(r=je(n[1]),l=r),{type:"link",raw:n[0],text:r,href:l,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let n;if(n=this.rules.inline.url.exec(t)){let l,i;if(n[2]==="@")l=je(n[0]),i="mailto:"+l;else{let o;do o=n[0],n[0]=((r=this.rules.inline._backpedal.exec(n[0]))==null?void 0:r[0])??"";while(o!==n[0]);l=je(n[0]),n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:l,href:i,tokens:[{type:"text",raw:l,text:l}]}}}inlineText(t){const n=this.rules.inline.text.exec(t);if(n){let r;return this.lexer.state.inRawBlock?r=n[0]:r=je(n[0]),{type:"text",raw:n[0],text:r}}}}const Um=/^(?: *(?:\n|$))+/,Hm=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,Bm=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,nl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Wm=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Pd=/(?:[*+-]|\d{1,9}[.)])/,Ad=G(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Pd).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),hu=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Vm=/^[^\n]+/,mu=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Qm=G(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",mu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gm=G(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Pd).getRegex(),Mi="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",gu=/|$))/,Ym=G("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",gu).replace("tag",Mi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),zd=G(hu).replace("hr",nl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mi).getRegex(),Km=G(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",zd).getRegex(),yu={blockquote:Km,code:Hm,def:Qm,fences:Bm,heading:Wm,hr:nl,html:Ym,lheading:Ad,list:Gm,newline:Um,paragraph:zd,table:zr,text:Vm},lc=G("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",nl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mi).getRegex(),Xm={...yu,table:lc,paragraph:G(hu).replace("hr",nl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",lc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Mi).getRegex()},Zm={...yu,html:G(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",gu).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:zr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:G(hu).replace("hr",nl).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Ad).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Id=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,qm=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Md=/^( {2,}|\\)\n(?!\s*$)/,Jm=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,tg=G(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,rl).getRegex(),ng=G("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,rl).getRegex(),rg=G("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,rl).getRegex(),lg=G(/\\([punct])/,"gu").replace(/punct/g,rl).getRegex(),ig=G(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),og=G(gu).replace("(?:-->|$)","-->").getRegex(),sg=G("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",og).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),gi=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ug=G(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",gi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Od=G(/^!?\[(label)\]\[(ref)\]/).replace("label",gi).replace("ref",mu).getRegex(),Dd=G(/^!?\[(ref)\](?:\[\])?/).replace("ref",mu).getRegex(),ag=G("reflink|nolink(?!\\()","g").replace("reflink",Od).replace("nolink",Dd).getRegex(),vu={_backpedal:zr,anyPunctuation:lg,autolink:ig,blockSkip:eg,br:Md,code:qm,del:zr,emStrongLDelim:tg,emStrongRDelimAst:ng,emStrongRDelimUnd:rg,escape:Id,link:ug,nolink:Dd,punctuation:bm,reflink:Od,reflinkSearch:ag,tag:sg,text:Jm,url:zr},cg={...vu,link:G(/^!?\[(label)\]\((.*?)\)/).replace("label",gi).getRegex(),reflink:G(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",gi).getRegex()},ms={...vu,escape:G(Id).replace("])","~|])").getRegex(),url:G(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\u+" ".repeat(a.length));let r,l,i,o;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(r=s.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=` +`:n.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length),l=n[n.length-1],l&&(l.type==="paragraph"||l.type==="text")?(l.raw+=` +`+r.raw,l.text+=` +`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=l.text):n.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length),l=n[n.length-1],l&&(l.type==="paragraph"||l.type==="text")?(l.raw+=` +`+r.raw,l.text+=` +`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=l.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startBlock){let s=1/0;const u=t.slice(1);let a;this.options.extensions.startBlock.forEach(p=>{a=p.call({lexer:this},u),typeof a=="number"&&a>=0&&(s=Math.min(s,a))}),s<1/0&&s>=0&&(i=t.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){l=n[n.length-1],o&&l.type==="paragraph"?(l.raw+=` +`+r.raw,l.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=l.text):n.push(r),o=i.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),l=n[n.length-1],l&&l.type==="text"?(l.raw+=` +`+r.raw,l.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=l.text):n.push(r);continue}if(t){const s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let r,l,i,o=t,s,u,a;if(this.tokens.links){const p=Object.keys(this.tokens.links);if(p.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)p.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,s.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(u||(a=""),u=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(p=>(r=p.call({lexer:this},t,n))?(t=t.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),l=n[n.length-1],l&&r.type==="text"&&l.type==="text"?(l.raw+=r.raw,l.text+=r.text):n.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length),l=n[n.length-1],l&&r.type==="text"&&l.type==="text"?(l.raw+=r.raw,l.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,o,a)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.autolink(t)){t=t.substring(r.raw.length),n.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t))){t=t.substring(r.raw.length),n.push(r);continue}if(i=t,this.options.extensions&&this.options.extensions.startInline){let p=1/0;const g=t.slice(1);let h;this.options.extensions.startInline.forEach(v=>{h=v.call({lexer:this},g),typeof h=="number"&&h>=0&&(p=Math.min(p,h))}),p<1/0&&p>=0&&(i=t.substring(0,p+1))}if(r=this.tokenizer.inlineText(i)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(a=r.raw.slice(-1)),u=!0,l=n[n.length-1],l&&l.type==="text"?(l.raw+=r.raw,l.text+=r.text):n.push(r);continue}if(t){const p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}}class yi{constructor(t){q(this,"options");this.options=t||vn}code(t,n,r){var i;const l=(i=(n||"").match(/^\S*/))==null?void 0:i[0];return t=t.replace(/\n$/,"")+` +`,l?'
'+(r?t:je(t,!0))+`
+`:"
"+(r?t:je(t,!0))+`
+`}blockquote(t){return`
+${t}
+`}html(t,n){return t}heading(t,n,r){return`${t} +`}hr(){return`
+`}list(t,n,r){const l=n?"ol":"ul",i=n&&r!==1?' start="'+r+'"':"";return"<"+l+i+`> +`+t+" +`}listitem(t,n,r){return`
  • ${t}
  • +`}checkbox(t){return"'}paragraph(t){return`

    ${t}

    +`}table(t,n){return n&&(n=`${n}`),` + +`+t+` +`+n+`
    +`}tablerow(t){return` +${t} +`}tablecell(t,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+t+` +`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return"
    "}del(t){return`${t}`}link(t,n,r){const l=tc(t);if(l===null)return r;t=l;let i='
    ",i}image(t,n,r){const l=tc(t);if(l===null)return r;t=l;let i=`${r}0&&h.tokens[0].type==="paragraph"?(h.tokens[0].text=O+" "+h.tokens[0].text,h.tokens[0].tokens&&h.tokens[0].tokens.length>0&&h.tokens[0].tokens[0].type==="text"&&(h.tokens[0].tokens[0].text=O+" "+h.tokens[0].tokens[0].text)):h.tokens.unshift({type:"text",text:O+" "}):S+=O+" "}S+=this.parse(h.tokens,a),p+=this.renderer.listitem(S,x,!!v)}r+=this.renderer.list(p,s,u);continue}case"html":{const o=i;r+=this.renderer.html(o.text,o.block);continue}case"paragraph":{const o=i;r+=this.renderer.paragraph(this.parseInline(o.tokens));continue}case"text":{let o=i,s=o.tokens?this.parseInline(o.tokens):o.text;for(;l+1{const a=s[u].flat(1/0);r=r.concat(this.walkTokens(a,n))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,n)))}}return r}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const l={...r};if(l.async=this.defaults.async||l.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const o=n.renderers[i.name];o?n.renderers[i.name]=function(...s){let u=i.renderer.apply(this,s);return u===!1&&(u=o.apply(this,s)),u}:n.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=n[i.level];o?o.unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),l.extensions=n),r.renderer){const i=this.defaults.renderer||new yi(this.defaults);for(const o in r.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(o==="options")continue;const s=o,u=r.renderer[s],a=i[s];i[s]=(...p)=>{let g=u.apply(i,p);return g===!1&&(g=a.apply(i,p)),g||""}}l.renderer=i}if(r.tokenizer){const i=this.defaults.tokenizer||new mi(this.defaults);for(const o in r.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const s=o,u=r.tokenizer[s],a=i[s];i[s]=(...p)=>{let g=u.apply(i,p);return g===!1&&(g=a.apply(i,p)),g}}l.tokenizer=i}if(r.hooks){const i=this.defaults.hooks||new Ir;for(const o in r.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(o==="options")continue;const s=o,u=r.hooks[s],a=i[s];Ir.passThroughHooks.has(o)?i[s]=p=>{if(this.defaults.async)return Promise.resolve(u.call(i,p)).then(h=>a.call(i,h));const g=u.call(i,p);return a.call(i,g)}:i[s]=(...p)=>{let g=u.apply(i,p);return g===!1&&(g=a.apply(i,p)),g}}l.hooks=i}if(r.walkTokens){const i=this.defaults.walkTokens,o=r.walkTokens;l.walkTokens=function(s){let u=[];return u.push(o.call(this,s)),i&&(u=u.concat(i.call(this,s))),u}}this.defaults={...this.defaults,...l}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,n){return ht.lex(t,n??this.defaults)}parser(t,n){return mt.parse(t,n??this.defaults)}}mn=new WeakSet,gs=function(t,n){return(r,l)=>{const i={...l},o={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(o.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),o.async=!0);const s=cl(this,mn,jd).call(this,!!o.silent,!!o.async);if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(o.hooks&&(o.hooks.options=o),o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(u=>t(u,o)).then(u=>o.hooks?o.hooks.processAllTokens(u):u).then(u=>o.walkTokens?Promise.all(this.walkTokens(u,o.walkTokens)).then(()=>u):u).then(u=>n(u,o)).then(u=>o.hooks?o.hooks.postprocess(u):u).catch(s);try{o.hooks&&(r=o.hooks.preprocess(r));let u=t(r,o);o.hooks&&(u=o.hooks.processAllTokens(u)),o.walkTokens&&this.walkTokens(u,o.walkTokens);let a=n(u,o);return o.hooks&&(a=o.hooks.postprocess(a)),a}catch(u){return s(u)}}},jd=function(t,n){return r=>{if(r.message+=` +Please report this to https://github.com/markedjs/marked.`,t){const l="

    An error occurred:

    "+je(r.message+"",!0)+"
    ";return n?Promise.resolve(l):l}if(n)return Promise.reject(r);throw r}};const hn=new dg;function V(e,t){return hn.parse(e,t)}V.options=V.setOptions=function(e){return hn.setOptions(e),V.defaults=hn.defaults,Nd(V.defaults),V};V.getDefaults=pu;V.defaults=vn;V.use=function(...e){return hn.use(...e),V.defaults=hn.defaults,Nd(V.defaults),V};V.walkTokens=function(e,t){return hn.walkTokens(e,t)};V.parseInline=hn.parseInline;V.Parser=mt;V.parser=mt.parse;V.Renderer=yi;V.TextRenderer=ku;V.Lexer=ht;V.lexer=ht.lex;V.Tokenizer=mi;V.Hooks=Ir;V.parse=V;V.options;V.setOptions;V.use;V.walkTokens;V.parseInline;mt.parse;ht.lex;/*! @license DOMPurify 3.1.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.1.6/LICENSE */const{entries:Fd,setPrototypeOf:ic,isFrozen:pg,getPrototypeOf:hg,getOwnPropertyDescriptor:mg}=Object;let{freeze:Ne,seal:qe,create:$d}=Object,{apply:ys,construct:vs}=typeof Reflect<"u"&&Reflect;Ne||(Ne=function(t){return t});qe||(qe=function(t){return t});ys||(ys=function(t,n,r){return t.apply(n,r)});vs||(vs=function(t,n){return new t(...n)});const Pl=He(Array.prototype.forEach),oc=He(Array.prototype.pop),hr=He(Array.prototype.push),Vl=He(String.prototype.toLowerCase),yo=He(String.prototype.toString),sc=He(String.prototype.match),mr=He(String.prototype.replace),gg=He(String.prototype.indexOf),yg=He(String.prototype.trim),et=He(Object.prototype.hasOwnProperty),_e=He(RegExp.prototype.test),gr=vg(TypeError);function He(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),l=1;l2&&arguments[2]!==void 0?arguments[2]:Vl;ic&&ic(e,null);let r=t.length;for(;r--;){let l=t[r];if(typeof l=="string"){const i=n(l);i!==l&&(pg(t)||(t[r]=i),l=i)}e[l]=!0}return e}function kg(e){for(let t=0;t/gm),_g=qe(/\${[\w\W]*}/gm),Tg=qe(/^data-[\-\w.\u00B7-\uFFFF]/),Cg=qe(/^aria-[\-\w]+$/),Ud=qe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ng=qe(/^(?:\w+script|data):/i),Rg=qe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Hd=qe(/^html$/i),Lg=qe(/^[a-z][.\w]*(-[.\w]+)+$/i);var dc=Object.freeze({__proto__:null,MUSTACHE_EXPR:Sg,ERB_EXPR:Eg,TMPLIT_EXPR:_g,DATA_ATTR:Tg,ARIA_ATTR:Cg,IS_ALLOWED_URI:Ud,IS_SCRIPT_OR_DATA:Ng,ATTR_WHITESPACE:Rg,DOCTYPE_NAME:Hd,CUSTOM_ELEMENT:Lg});const vr={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Pg=function(){return typeof window>"u"?null:window},Ag=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const l="data-tt-policy-suffix";n&&n.hasAttribute(l)&&(r=n.getAttribute(l));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function Bd(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Pg();const t=z=>Bd(z);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==vr.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,l=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:s,Element:u,NodeFilter:a,NamedNodeMap:p=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:g,DOMParser:h,trustedTypes:v}=e,x=u.prototype,S=yr(x,"cloneNode"),O=yr(x,"remove"),d=yr(x,"nextSibling"),c=yr(x,"childNodes"),m=yr(x,"parentNode");if(typeof o=="function"){const z=n.createElement("template");z.content&&z.content.ownerDocument&&(n=z.content.ownerDocument)}let y,_="";const{implementation:T,createNodeIterator:R,createDocumentFragment:P,getElementsByTagName:Y}=n,{importNode:F}=r;let ee={};t.isSupported=typeof Fd=="function"&&typeof m=="function"&&T&&T.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Je,ERB_EXPR:Ve,TMPLIT_EXPR:st,DATA_ATTR:er,ARIA_ATTR:qt,IS_SCRIPT_OR_DATA:Jt,ATTR_WHITESPACE:C,CUSTOM_ELEMENT:I}=dc;let{IS_ALLOWED_URI:M}=dc,D=null;const A=U({},[...uc,...vo,...ko,...wo,...ac]);let j=null;const K=U({},[...cc,...xo,...fc,...Al]);let $=Object.seal($d(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}})),oe=null,ut=null,ll=!0,Pt=!0,tr=!1,wu=!0,kn=!1,Oi=!0,bt=!1,Di=!1,ji=!1,wn=!1,il=!1,ol=!1,xu=!0,Su=!1;const Wd="user-content-";let Fi=!0,nr=!1,xn={},Sn=null;const Eu=U({},["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 _u=null;const Tu=U({},["audio","video","img","source","image","track"]);let $i=null;const Cu=U({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),sl="http://www.w3.org/1998/Math/MathML",ul="http://www.w3.org/2000/svg",vt="http://www.w3.org/1999/xhtml";let En=vt,Ui=!1,Hi=null;const Vd=U({},[sl,ul,vt],yo);let rr=null;const Qd=["application/xhtml+xml","text/html"],Gd="text/html";let fe=null,_n=null;const Yd=n.createElement("form"),Nu=function(f){return f instanceof RegExp||f instanceof Function},Bi=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(_n&&_n===f)){if((!f||typeof f!="object")&&(f={}),f=nn(f),rr=Qd.indexOf(f.PARSER_MEDIA_TYPE)===-1?Gd:f.PARSER_MEDIA_TYPE,fe=rr==="application/xhtml+xml"?yo:Vl,D=et(f,"ALLOWED_TAGS")?U({},f.ALLOWED_TAGS,fe):A,j=et(f,"ALLOWED_ATTR")?U({},f.ALLOWED_ATTR,fe):K,Hi=et(f,"ALLOWED_NAMESPACES")?U({},f.ALLOWED_NAMESPACES,yo):Vd,$i=et(f,"ADD_URI_SAFE_ATTR")?U(nn(Cu),f.ADD_URI_SAFE_ATTR,fe):Cu,_u=et(f,"ADD_DATA_URI_TAGS")?U(nn(Tu),f.ADD_DATA_URI_TAGS,fe):Tu,Sn=et(f,"FORBID_CONTENTS")?U({},f.FORBID_CONTENTS,fe):Eu,oe=et(f,"FORBID_TAGS")?U({},f.FORBID_TAGS,fe):{},ut=et(f,"FORBID_ATTR")?U({},f.FORBID_ATTR,fe):{},xn=et(f,"USE_PROFILES")?f.USE_PROFILES:!1,ll=f.ALLOW_ARIA_ATTR!==!1,Pt=f.ALLOW_DATA_ATTR!==!1,tr=f.ALLOW_UNKNOWN_PROTOCOLS||!1,wu=f.ALLOW_SELF_CLOSE_IN_ATTR!==!1,kn=f.SAFE_FOR_TEMPLATES||!1,Oi=f.SAFE_FOR_XML!==!1,bt=f.WHOLE_DOCUMENT||!1,wn=f.RETURN_DOM||!1,il=f.RETURN_DOM_FRAGMENT||!1,ol=f.RETURN_TRUSTED_TYPE||!1,ji=f.FORCE_BODY||!1,xu=f.SANITIZE_DOM!==!1,Su=f.SANITIZE_NAMED_PROPS||!1,Fi=f.KEEP_CONTENT!==!1,nr=f.IN_PLACE||!1,M=f.ALLOWED_URI_REGEXP||Ud,En=f.NAMESPACE||vt,$=f.CUSTOM_ELEMENT_HANDLING||{},f.CUSTOM_ELEMENT_HANDLING&&Nu(f.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=f.CUSTOM_ELEMENT_HANDLING.tagNameCheck),f.CUSTOM_ELEMENT_HANDLING&&Nu(f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=f.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),f.CUSTOM_ELEMENT_HANDLING&&typeof f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&($.allowCustomizedBuiltInElements=f.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),kn&&(Pt=!1),il&&(wn=!0),xn&&(D=U({},ac),j=[],xn.html===!0&&(U(D,uc),U(j,cc)),xn.svg===!0&&(U(D,vo),U(j,xo),U(j,Al)),xn.svgFilters===!0&&(U(D,ko),U(j,xo),U(j,Al)),xn.mathMl===!0&&(U(D,wo),U(j,fc),U(j,Al))),f.ADD_TAGS&&(D===A&&(D=nn(D)),U(D,f.ADD_TAGS,fe)),f.ADD_ATTR&&(j===K&&(j=nn(j)),U(j,f.ADD_ATTR,fe)),f.ADD_URI_SAFE_ATTR&&U($i,f.ADD_URI_SAFE_ATTR,fe),f.FORBID_CONTENTS&&(Sn===Eu&&(Sn=nn(Sn)),U(Sn,f.FORBID_CONTENTS,fe)),Fi&&(D["#text"]=!0),bt&&U(D,["html","head","body"]),D.table&&(U(D,["tbody"]),delete oe.tbody),f.TRUSTED_TYPES_POLICY){if(typeof f.TRUSTED_TYPES_POLICY.createHTML!="function")throw gr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof f.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw gr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=f.TRUSTED_TYPES_POLICY,_=y.createHTML("")}else y===void 0&&(y=Ag(v,l)),y!==null&&typeof _=="string"&&(_=y.createHTML(""));Ne&&Ne(f),_n=f}},Ru=U({},["mi","mo","mn","ms","mtext"]),Lu=U({},["foreignobject","annotation-xml"]),Kd=U({},["title","style","font","a","script"]),Pu=U({},[...vo,...ko,...wg]),Au=U({},[...wo,...xg]),Xd=function(f){let E=m(f);(!E||!E.tagName)&&(E={namespaceURI:En,tagName:"template"});const L=Vl(f.tagName),X=Vl(E.tagName);return Hi[f.namespaceURI]?f.namespaceURI===ul?E.namespaceURI===vt?L==="svg":E.namespaceURI===sl?L==="svg"&&(X==="annotation-xml"||Ru[X]):!!Pu[L]:f.namespaceURI===sl?E.namespaceURI===vt?L==="math":E.namespaceURI===ul?L==="math"&&Lu[X]:!!Au[L]:f.namespaceURI===vt?E.namespaceURI===ul&&!Lu[X]||E.namespaceURI===sl&&!Ru[X]?!1:!Au[L]&&(Kd[L]||!Pu[L]):!!(rr==="application/xhtml+xml"&&Hi[f.namespaceURI]):!1},at=function(f){hr(t.removed,{element:f});try{m(f).removeChild(f)}catch{O(f)}},al=function(f,E){try{hr(t.removed,{attribute:E.getAttributeNode(f),from:E})}catch{hr(t.removed,{attribute:null,from:E})}if(E.removeAttribute(f),f==="is"&&!j[f])if(wn||il)try{at(E)}catch{}else try{E.setAttribute(f,"")}catch{}},zu=function(f){let E=null,L=null;if(ji)f=""+f;else{const he=sc(f,/^[\r\n\t ]+/);L=he&&he[0]}rr==="application/xhtml+xml"&&En===vt&&(f=''+f+"");const X=y?y.createHTML(f):f;if(En===vt)try{E=new h().parseFromString(X,rr)}catch{}if(!E||!E.documentElement){E=T.createDocument(En,"template",null);try{E.documentElement.innerHTML=Ui?_:X}catch{}}const ve=E.body||E.documentElement;return f&&L&&ve.insertBefore(n.createTextNode(L),ve.childNodes[0]||null),En===vt?Y.call(E,bt?"html":"body")[0]:bt?E.documentElement:ve},Iu=function(f){return R.call(f.ownerDocument||f,f,a.SHOW_ELEMENT|a.SHOW_COMMENT|a.SHOW_TEXT|a.SHOW_PROCESSING_INSTRUCTION|a.SHOW_CDATA_SECTION,null)},Mu=function(f){return f instanceof g&&(typeof f.nodeName!="string"||typeof f.textContent!="string"||typeof f.removeChild!="function"||!(f.attributes instanceof p)||typeof f.removeAttribute!="function"||typeof f.setAttribute!="function"||typeof f.namespaceURI!="string"||typeof f.insertBefore!="function"||typeof f.hasChildNodes!="function")},Ou=function(f){return typeof s=="function"&&f instanceof s},kt=function(f,E,L){ee[f]&&Pl(ee[f],X=>{X.call(t,E,L,_n)})},Du=function(f){let E=null;if(kt("beforeSanitizeElements",f,null),Mu(f))return at(f),!0;const L=fe(f.nodeName);if(kt("uponSanitizeElement",f,{tagName:L,allowedTags:D}),f.hasChildNodes()&&!Ou(f.firstElementChild)&&_e(/<[/\w]/g,f.innerHTML)&&_e(/<[/\w]/g,f.textContent)||f.nodeType===vr.progressingInstruction||Oi&&f.nodeType===vr.comment&&_e(/<[/\w]/g,f.data))return at(f),!0;if(!D[L]||oe[L]){if(!oe[L]&&Fu(L)&&($.tagNameCheck instanceof RegExp&&_e($.tagNameCheck,L)||$.tagNameCheck instanceof Function&&$.tagNameCheck(L)))return!1;if(Fi&&!Sn[L]){const X=m(f)||f.parentNode,ve=c(f)||f.childNodes;if(ve&&X){const he=ve.length;for(let Pe=he-1;Pe>=0;--Pe){const ct=S(ve[Pe],!0);ct.__removalCount=(f.__removalCount||0)+1,X.insertBefore(ct,d(f))}}}return at(f),!0}return f instanceof u&&!Xd(f)||(L==="noscript"||L==="noembed"||L==="noframes")&&_e(/<\/no(script|embed|frames)/i,f.innerHTML)?(at(f),!0):(kn&&f.nodeType===vr.text&&(E=f.textContent,Pl([Je,Ve,st],X=>{E=mr(E,X," ")}),f.textContent!==E&&(hr(t.removed,{element:f.cloneNode()}),f.textContent=E)),kt("afterSanitizeElements",f,null),!1)},ju=function(f,E,L){if(xu&&(E==="id"||E==="name")&&(L in n||L in Yd))return!1;if(!(Pt&&!ut[E]&&_e(er,E))){if(!(ll&&_e(qt,E))){if(!j[E]||ut[E]){if(!(Fu(f)&&($.tagNameCheck instanceof RegExp&&_e($.tagNameCheck,f)||$.tagNameCheck instanceof Function&&$.tagNameCheck(f))&&($.attributeNameCheck instanceof RegExp&&_e($.attributeNameCheck,E)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(E))||E==="is"&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&_e($.tagNameCheck,L)||$.tagNameCheck instanceof Function&&$.tagNameCheck(L))))return!1}else if(!$i[E]){if(!_e(M,mr(L,C,""))){if(!((E==="src"||E==="xlink:href"||E==="href")&&f!=="script"&&gg(L,"data:")===0&&_u[f])){if(!(tr&&!_e(Jt,mr(L,C,"")))){if(L)return!1}}}}}}return!0},Fu=function(f){return f!=="annotation-xml"&&sc(f,I)},$u=function(f){kt("beforeSanitizeAttributes",f,null);const{attributes:E}=f;if(!E)return;const L={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j};let X=E.length;for(;X--;){const ve=E[X],{name:he,namespaceURI:Pe,value:ct}=ve,lr=fe(he);let Ee=he==="value"?ct:yg(ct);if(L.attrName=lr,L.attrValue=Ee,L.keepAttr=!0,L.forceKeepAttr=void 0,kt("uponSanitizeAttribute",f,L),Ee=L.attrValue,Oi&&_e(/((--!?|])>)|<\/(style|title)/i,Ee)){al(he,f);continue}if(L.forceKeepAttr||(al(he,f),!L.keepAttr))continue;if(!wu&&_e(/\/>/i,Ee)){al(he,f);continue}kn&&Pl([Je,Ve,st],Hu=>{Ee=mr(Ee,Hu," ")});const Uu=fe(f.nodeName);if(ju(Uu,lr,Ee)){if(Su&&(lr==="id"||lr==="name")&&(al(he,f),Ee=Wd+Ee),y&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!Pe)switch(v.getAttributeType(Uu,lr)){case"TrustedHTML":{Ee=y.createHTML(Ee);break}case"TrustedScriptURL":{Ee=y.createScriptURL(Ee);break}}try{Pe?f.setAttributeNS(Pe,he,Ee):f.setAttribute(he,Ee),Mu(f)?at(f):oc(t.removed)}catch{}}}kt("afterSanitizeAttributes",f,null)},Zd=function z(f){let E=null;const L=Iu(f);for(kt("beforeSanitizeShadowDOM",f,null);E=L.nextNode();)kt("uponSanitizeShadowNode",E,null),!Du(E)&&(E.content instanceof i&&z(E.content),$u(E));kt("afterSanitizeShadowDOM",f,null)};return t.sanitize=function(z){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=null,L=null,X=null,ve=null;if(Ui=!z,Ui&&(z=""),typeof z!="string"&&!Ou(z))if(typeof z.toString=="function"){if(z=z.toString(),typeof z!="string")throw gr("dirty is not a string, aborting")}else throw gr("toString is not a function");if(!t.isSupported)return z;if(Di||Bi(f),t.removed=[],typeof z=="string"&&(nr=!1),nr){if(z.nodeName){const ct=fe(z.nodeName);if(!D[ct]||oe[ct])throw gr("root node is forbidden and cannot be sanitized in-place")}}else if(z instanceof s)E=zu(""),L=E.ownerDocument.importNode(z,!0),L.nodeType===vr.element&&L.nodeName==="BODY"||L.nodeName==="HTML"?E=L:E.appendChild(L);else{if(!wn&&!kn&&!bt&&z.indexOf("<")===-1)return y&&ol?y.createHTML(z):z;if(E=zu(z),!E)return wn?null:ol?_:""}E&&ji&&at(E.firstChild);const he=Iu(nr?z:E);for(;X=he.nextNode();)Du(X)||(X.content instanceof i&&Zd(X.content),$u(X));if(nr)return z;if(wn){if(il)for(ve=P.call(E.ownerDocument);E.firstChild;)ve.appendChild(E.firstChild);else ve=E;return(j.shadowroot||j.shadowrootmode)&&(ve=F.call(r,ve,!0)),ve}let Pe=bt?E.outerHTML:E.innerHTML;return bt&&D["!doctype"]&&E.ownerDocument&&E.ownerDocument.doctype&&E.ownerDocument.doctype.name&&_e(Hd,E.ownerDocument.doctype.name)&&(Pe=" +`+Pe),kn&&Pl([Je,Ve,st],ct=>{Pe=mr(Pe,ct," ")}),y&&ol?y.createHTML(Pe):Pe},t.setConfig=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Bi(z),Di=!0},t.clearConfig=function(){_n=null,Di=!1},t.isValidAttribute=function(z,f,E){_n||Bi({});const L=fe(z),X=fe(f);return ju(L,X,E)},t.addHook=function(z,f){typeof f=="function"&&(ee[z]=ee[z]||[],hr(ee[z],f))},t.removeHook=function(z){if(ee[z])return oc(ee[z])},t.removeHooks=function(z){ee[z]&&(ee[z]=[])},t.removeAllHooks=function(){ee={}},t}var zg=Bd();function Ig(e){return k.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("path",{d:"M12 8V4H8"}),k.jsx("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),k.jsx("path",{d:"M2 14h2"}),k.jsx("path",{d:"M20 14h2"}),k.jsx("path",{d:"M15 13v2"}),k.jsx("path",{d:"M9 13v2"})]})}function Mg(e){return k.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),k.jsx("circle",{cx:"12",cy:"7",r:"4"})]})}function Og(e){return zg.sanitize(V.parse(e))}function Dg({messages:e}){const t=e.length===0;return B.useEffect(()=>{window.MathJax.typeset()},[e]),k.jsx("div",{className:`flex-1 p-6 max-w-[960px] w-full ${t?"flex flex-col items-center justify-end":"space-y-4"}`,children:t?k.jsx("div",{className:"text-xl",children:"Ready!"}):e.map((n,r)=>k.jsx("div",{className:"flex items-start space-x-4",children:n.role==="assistant"?k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"hidden sm:block border rounded-full p-2 border-white/15",children:k.jsx(Ig,{className:" h-6 w-6 min-h-6 min-w-6 text-gray-500 dark:text-gray-300"})}),k.jsx("div",{className:" rounded-lg p-4",children:k.jsx("p",{className:"min-h-6 text-white overflow-wrap-anywhere",children:n.content.length>0?k.jsx("span",{className:"markdown",dangerouslySetInnerHTML:{__html:Og(n.content)}}):k.jsxs("span",{className:"h-6 flex items-center gap-1",children:[k.jsx("span",{className:"w-2.5 h-2.5 bg-gray-300 rounded-full animate-pulse"}),k.jsx("span",{className:"w-2.5 h-2.5 bg-gray-300 rounded-full animate-pulse animation-delay-200"}),k.jsx("span",{className:"w-2.5 h-2.5 bg-gray-300 rounded-full animate-pulse animation-delay-400"})]})})})]}):k.jsx(k.Fragment,{children:k.jsxs("div",{className:"w-full flex justify-end",children:[k.jsx("div",{className:"bg-[#303030] text-white rounded-2xl p-4 sm:max-w-[55%] min-w-[55%]",children:k.jsx("p",{className:"min-h-6 overflow-wrap-anywhere",children:n.content})}),k.jsx("div",{className:"hidden sm:block",children:k.jsx(Mg,{className:"ml-4 h-6 w-6 min-h-6 min-w-6 my-3 text-gray-500 dark:text-gray-300"})})]})})},`message-${r}`))})}function pc(e){return k.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("path",{d:"M5 12h14"}),k.jsx("path",{d:"m12 5 7 7-7 7"})]})}function jg(e){return k.jsxs("svg",{...e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("path",{d:"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}),k.jsx("path",{fill:"currentColor",d:"M9 9.563C9 9.252 9.252 9 9.563 9h4.874c.311 0 .563.252.563.563v4.874c0 .311-.252.563-.563.563H9.564A.562.562 0 0 1 9 14.437V9.564Z"})]})}function Fg(e){const t=e==0?0:Math.floor(Math.log(e)/Math.log(1024));return+(e/Math.pow(1024,t)).toFixed(2)*1+["B","kB","MB","GB","TB"][t]}function $g({text:e,percentage:t,total:n}){return t??(t=0),k.jsx("div",{className:"w-full bg-gray-100 dark:bg-gray-700 text-left rounded-lg overflow-hidden mb-0.5",children:k.jsxs("div",{className:"bg-blue-400 whitespace-nowrap px-1 text-sm",style:{width:`${t}%`},children:[e," (",t.toFixed(2),"%",isNaN(n)?"":` of ${Fg(n)}`,")"]})})}function Ug({saveTodb:e,content:t,worker:n,loading:r,loading_msg:l}){B.useRef(null),B.useRef(!1),B.useState(!1);const[i,o]=B.useState(!0);B.useState(null),B.useState(""),B.useState("");const s=B.useRef(null),u=()=>{s.current&&s.current.click()};async function a(p){if(p===null){alert("You must select a file to embed.");return}o(!0),n.current.postMessage({type:"add_pdf",data:p}),o(!1)}return k.jsx(k.Fragment,{children:k.jsxs("div",{className:"w-[20%] p-4 bg-[#212121] min-w-[400px] rounded-xl text-white",children:[k.jsxs("div",{className:"flex justify-between items-center p-4 border border-gray-300/50 rounded-md",children:[k.jsx("h2",{className:"text-lg font-semibold",children:"Source"}),k.jsx("button",{className:"bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600 disabled:hover:bg-blue-500 flex items-center justify-center",onClick:u,disabled:r,children:r?k.jsxs("svg",{className:"animate-spin h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[k.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),k.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):"+"}),k.jsx("input",{type:"file",ref:s,onChange:p=>a(p.target.files[0]),className:"hidden"})]}),l&&k.jsx("p",{className:"text-sm font-light mt-2 ml-2",children:l}),k.jsx("ul",{className:"mt-4 flex flex-col",children:t.map((p,g)=>k.jsxs("li",{className:"p-2 text-bold flex items-center gap-2",children:[k.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-file-text",children:[k.jsx("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),k.jsx("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),k.jsx("path",{d:"M10 9H8"}),k.jsx("path",{d:"M16 13H8"}),k.jsx("path",{d:"M16 17H8"})]}),k.jsx("p",{className:"font-bold text-sm",children:p.title})]},g))})]})})}const Hg=120,Bg=[];function Wg(){const e=B.useRef(null),t=B.useRef(null),n=B.useRef(null),r=B.useRef(null),[l,i]=B.useState({model_id:"HuggingFaceTB/SmolLM2-360M-Instruct",dtype:"fp16"}),[o,s]=B.useState({model_id:"onnx-community/Pleias-Pico",dtype:"fp16"}),[u,a]=B.useState(null),[p,g]=B.useState(null),[h,v]=B.useState(""),[x,S]=B.useState([]),[O,d]=B.useState(!1),[c,m]=B.useState(!1),[y,_]=B.useState(""),[T,R]=B.useState([]),[P,Y]=B.useState(null),[F,ee]=B.useState(null),[Je,Ve]=B.useState([]),st=B.useRef(!1),[er,qt]=B.useState("");B.useEffect(()=>{const A=async()=>{try{st.current=!0,t.current=await Pm(),await Am(t.current);let j=await ba(t.current,"embeddings");console.log(`Found ${j} rows`),j===0&&(j=await ba(t.current,"embeddings"),console.log(`Seeded ${j} rows`)),await Jt(),console.log("Setup complete.")}catch(j){console.error("Error during setup:",j)}finally{st.current=!1}};!t.current&&!st.current&&A()},[]);const Jt=async()=>{const A=await t.current.query("SELECT DISTINCT title FROM embeddings;");Ve(A.rows),console.log(A)};function C(A){R(j=>[...j,{role:"user",content:A}]),Y(null),d(!0),_("")}function I(){e.current.postMessage({type:"interrupt"})}B.useEffect(()=>{M()},[y]);function M(){if(!n.current)return;const A=n.current;A.style.height="auto";const j=Math.min(Math.max(A.scrollHeight,24),200);A.style.height=`${j}px`}B.useEffect(()=>{e.current||(e.current=new Worker(new URL("/assets/worker-Cta7Ww_m.js",import.meta.url),{type:"module"}),e.current.postMessage({type:"check"}));const A=async K=>{switch(K.data.status){case"start_embedding":m(!0);break;case"db_update":Ve(K.data.rows),m(!1);break;case"loading":a("loading"),v(K.data.data);break;case"initiate":S($=>[...$,K.data]);break;case"side_notif":qt(K.data.message);break;case"progress":S($=>$.map(oe=>oe.file===K.data.file?{...oe,...K.data}:oe));break;case"done":S($=>$.filter(oe=>oe.file!==K.data.file));break;case"ready":a("ready");break;case"start":R($=>[...$,{role:"assistant",content:""}]);break;case"update":{const{output:$,tps:oe,numTokens:ut}=K.data;Y(oe),ee(ut),R(ll=>{const Pt=[...ll],tr=Pt.at(-1);return Pt[Pt.length-1]={...tr,content:tr.content+$},Pt})}break;case"complete":d(!1);break;case"error":g(K.data.data),alert(K.data.data);break}},j=K=>{console.error("Worker error:",K)};return e.current.addEventListener("message",A),e.current.addEventListener("error",j),()=>{e.current.removeEventListener("message",A),e.current.removeEventListener("error",j)}},[]),B.useEffect(()=>{T.filter(A=>A.role==="user").length!==0&&T.at(-1).role!=="assistant"&&(Y(null),e.current.postMessage({type:"generate",data:T}))},[T,O]),B.useEffect(()=>{if(!r.current||!O)return;const A=r.current;A.scrollHeight-A.scrollTop-A.clientHeight{e.current.postMessage({type:"load",data:o}),a("loading")},disabled:u!==null||p!==null,children:"Load Pleias-Pico"}),k.jsx("button",{className:"mt-4 px-4 py-2 rounded-lg bg-[#fdde00] text-black font-bold disabled:cursor-not-allowed select-none",onClick:()=>{e.current.postMessage({type:"load",data:l}),a("loading")},disabled:u!==null||p!==null,children:"Load SmolLM2-360M-Instruct"})]})}),u==="loading"&&k.jsx(k.Fragment,{children:k.jsxs("div",{className:"w-full max-w-[500px] text-left mx-auto p-4 bottom-0 mt-auto",children:[k.jsx("p",{className:"text-center mb-1 text-white",children:h}),x.map(({file:A,progress:j,total:K},$)=>k.jsx($g,{text:A,percentage:j,total:K},$))]})}),u==="ready"&&k.jsxs("div",{ref:r,className:"overflow-y-auto scrollbar-thin w-full flex flex-col items-center h-full",children:[k.jsx(Dg,{messages:T}),T.length===0&&k.jsx("div",{children:Bg.map((A,j)=>k.jsx("div",{className:"m-1 border dark:border-gray-600 rounded-md p-2 bg-gray-100 dark:bg-gray-700 cursor-pointer",onClick:()=>C(A),children:A},j))}),k.jsx("p",{className:"text-center text-sm min-h-6 text-gray-500 dark:text-gray-300",children:P&&T.length>0&&k.jsxs(k.Fragment,{children:[!O&&k.jsxs("span",{children:["Generated ",F," tokens in"," ",(F/P).toFixed(2)," secondsĀ ("]}),k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"font-medium text-center mr-1 text-black dark:text-white",children:P.toFixed(2)}),k.jsx("span",{className:"text-white",children:"tokens/second"})]}),!O&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"mr-1",children:")."}),k.jsx("span",{className:"underline cursor-pointer",onClick:()=>{e.current.postMessage({type:"reset"}),R([])},children:"Reset"})]})]})})]}),k.jsxs("div",{className:"mt-2 mb-2 bg-[#2f2f2f] rounded-3xl w-[600px] max-w-[80%] max-h-[200px] mx-auto relative flex",children:[k.jsx("textarea",{ref:n,className:"mr-2 ml-2 scrollbar-thin w-[550px] bg-[#2f2f2f] px-3 py-4 rounded-3xl border-none outline-none text-gray-200 disabled:text-gray-400 placeholder-gray-400 disabled:placeholder-gray-200 resize-none disabled:cursor-not-allowed",placeholder:"Type your message...",type:"text",rows:1,value:y,disabled:u!=="ready",title:u==="ready"?"Model is ready":"Model not loaded yet",onKeyDown:A=>{y.length>0&&!O&&A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),C(y))},onInput:A=>_(A.target.value)}),O?k.jsx("div",{className:"cursor-pointer",onClick:I,children:k.jsx(jg,{className:"h-8 w-8 p-1 rounded-md text-gray-800 dark:text-gray-100 absolute right-3 bottom-3"})}):y.length>0?k.jsx("div",{className:"cursor-pointer",onClick:()=>C(y),children:k.jsx(pc,{className:"h-8 w-8 p-1 bg-gray-800 dark:bg-gray-100 text-white dark:text-black rounded-md absolute right-3 bottom-3"})}):k.jsx("div",{children:k.jsx(pc,{className:"h-8 w-8 p-1 bg-gray-200 dark:bg-gray-600 text-gray-50 dark:text-gray-800 rounded-md absolute right-3 bottom-3"})})]}),k.jsx("p",{className:"text-xs text-gray-400 text-center mb-6",children:"Disclaimer: Generated content may be inaccurate or false."})]})]})}So.createRoot(document.getElementById("root")).render(k.jsx(vp.StrictMode,{children:k.jsx(Wg,{})}));