From 113e8158be591c0f06bb5dd30ca8a70cd9ccd621 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Mon, 20 Nov 2023 12:57:29 +0000 Subject: [PATCH] Build ui --- backend/ui/assets/index-659277e1.js | 123 ++++++++++++++++++++++++++ backend/ui/index.html | 2 +- frontend/src/hooks/useChatMessages.ts | 2 +- 3 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 backend/ui/assets/index-659277e1.js diff --git a/backend/ui/assets/index-659277e1.js b/backend/ui/assets/index-659277e1.js new file mode 100644 index 00000000..43be4f42 --- /dev/null +++ b/backend/ui/assets/index-659277e1.js @@ -0,0 +1,123 @@ +var tE=Object.defineProperty;var nE=(e,t,n)=>t in e?tE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ot=(e,t,n)=>(nE(e,typeof t!="symbol"?t+"":t,n),n),rE=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var vd=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};var ss=(e,t,n)=>(rE(e,t,"access private method"),n);function oE(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var cs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a1={exports:{}},Lc={},l1={exports:{}},at={};/** + * @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 lu=Symbol.for("react.element"),iE=Symbol.for("react.portal"),aE=Symbol.for("react.fragment"),lE=Symbol.for("react.strict_mode"),uE=Symbol.for("react.profiler"),sE=Symbol.for("react.provider"),cE=Symbol.for("react.context"),fE=Symbol.for("react.forward_ref"),dE=Symbol.for("react.suspense"),pE=Symbol.for("react.memo"),hE=Symbol.for("react.lazy"),Iv=Symbol.iterator;function gE(e){return e===null||typeof e!="object"?null:(e=Iv&&e[Iv]||e["@@iterator"],typeof e=="function"?e:null)}var u1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},s1=Object.assign,c1={};function Ra(e,t,n){this.props=e,this.context=t,this.refs=c1,this.updater=n||u1}Ra.prototype.isReactComponent={};Ra.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")};Ra.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function f1(){}f1.prototype=Ra.prototype;function bh(e,t,n){this.props=e,this.context=t,this.refs=c1,this.updater=n||u1}var Sh=bh.prototype=new f1;Sh.constructor=bh;s1(Sh,Ra.prototype);Sh.isPureReactComponent=!0;var Lv=Array.isArray,d1=Object.prototype.hasOwnProperty,Eh={current:null},p1={key:!0,ref:!0,__self:!0,__source:!0};function h1(e,t,n){var r,o={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)d1.call(t,r)&&!p1.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1>>1,G=X[N];if(0>>1;No(ie,_e))reo(Se,ie)?(X[N]=Se,X[re]=_e,N=re):(X[N]=ie,X[Z]=_e,N=Z);else if(reo(Se,_e))X[N]=Se,X[re]=_e,N=re;else break e}}return ne}function o(X,ne){var _e=X.sortIndex-ne.sortIndex;return _e!==0?_e:X.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var c=[],f=[],h=1,p=null,g=3,y=!1,b=!1,E=!1,O=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(X){for(var ne=n(f);ne!==null;){if(ne.callback===null)r(f);else if(ne.startTime<=X)r(f),ne.sortIndex=ne.expirationTime,t(c,ne);else break;ne=n(f)}}function k(X){if(E=!1,S(X),!b)if(n(c)!==null)b=!0,De(C);else{var ne=n(f);ne!==null&&Be(k,ne.startTime-X)}}function C(X,ne){b=!1,E&&(E=!1,_(U),U=-1),y=!0;var _e=g;try{for(S(ne),p=n(c);p!==null&&(!(p.expirationTime>ne)||X&&!K());){var N=p.callback;if(typeof N=="function"){p.callback=null,g=p.priorityLevel;var G=N(p.expirationTime<=ne);ne=e.unstable_now(),typeof G=="function"?p.callback=G:p===n(c)&&r(c),S(ne)}else r(c);p=n(c)}if(p!==null)var oe=!0;else{var Z=n(f);Z!==null&&Be(k,Z.startTime-ne),oe=!1}return oe}finally{p=null,g=_e,y=!1}}var $=!1,L=null,U=-1,ce=5,z=-1;function K(){return!(e.unstable_now()-zX||125N?(X.sortIndex=_e,t(f,X),n(c)===null&&X===n(f)&&(E?(_(U),U=-1):E=!0,Be(k,_e-N))):(X.sortIndex=G,t(c,X),b||y||(b=!0,De(C))),X},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(X){var ne=g;return function(){var _e=g;g=ne;try{return X.apply(this,arguments)}finally{g=_e}}}})(y1);v1.exports=y1;var TE=v1.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 w1=j,sr=TE;function ue(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"),lp=Object.prototype.hasOwnProperty,CE=/^[: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]*$/,Fv={},zv={};function OE(e){return lp.call(zv,e)?!0:lp.call(Fv,e)?!1:CE.test(e)?zv[e]=!0:(Fv[e]=!0,!1)}function AE(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 jE(e,t,n,r){if(t===null||typeof t>"u"||AE(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 zn(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var xn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){xn[e]=new zn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];xn[t]=new zn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){xn[e]=new zn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){xn[e]=new zn(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){xn[e]=new zn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){xn[e]=new zn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){xn[e]=new zn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){xn[e]=new zn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){xn[e]=new zn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Th=/[\-:]([a-z])/g;function Ch(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(Th,Ch);xn[t]=new zn(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(Th,Ch);xn[t]=new zn(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(Th,Ch);xn[t]=new zn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){xn[e]=new zn(e,1,!1,e.toLowerCase(),null,!1,!1)});xn.xlinkHref=new zn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){xn[e]=new zn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Oh(e,t,n,r){var o=xn.hasOwnProperty(t)?xn[t]:null;(o!==null?o.type!==0:r||!(2s||o[l]!==i[s]){var c=` +`+o[l].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=l&&0<=s);break}}}finally{_d=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Tl(e):""}function PE(e){switch(e.tag){case 5:return Tl(e.type);case 16:return Tl("Lazy");case 13:return Tl("Suspense");case 19:return Tl("SuspenseList");case 0:case 2:case 15:return e=xd(e.type,!1),e;case 11:return e=xd(e.type.render,!1),e;case 1:return e=xd(e.type,!0),e;default:return""}}function fp(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 ua:return"Fragment";case la:return"Portal";case up:return"Profiler";case Ah:return"StrictMode";case sp:return"Suspense";case cp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case b1:return(e.displayName||"Context")+".Consumer";case x1:return(e._context.displayName||"Context")+".Provider";case jh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ph:return t=e.displayName||null,t!==null?t:fp(e.type)||"Memo";case Vo:t=e._payload,e=e._init;try{return fp(e(t))}catch{}}return null}function RE(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 fp(t);case 8:return t===Ah?"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 ui(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function E1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $E(e){var t=E1(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 o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ps(e){e._valueTracker||(e._valueTracker=$E(e))}function k1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=E1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Zs(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 dp(e,t){var n=t.checked;return Qt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Bv(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ui(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 T1(e,t){t=t.checked,t!=null&&Oh(e,"checked",t,!1)}function pp(e,t){T1(e,t);var n=ui(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")?hp(e,t.type,n):t.hasOwnProperty("defaultValue")&&hp(e,t.type,ui(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Hv(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 hp(e,t,n){(t!=="number"||Zs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Cl=Array.isArray;function wa(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=hs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pl={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},NE=["Webkit","ms","Moz","O"];Object.keys(Pl).forEach(function(e){NE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pl[t]=Pl[e]})});function j1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Pl.hasOwnProperty(e)&&Pl[e]?(""+t).trim():t+"px"}function P1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=j1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var DE=Qt({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 vp(e,t){if(t){if(DE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ue(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ue(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ue(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ue(62))}}function yp(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 wp=null;function Rh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _p=null,_a=null,xa=null;function Vv(e){if(e=cu(e)){if(typeof _p!="function")throw Error(ue(280));var t=e.stateNode;t&&(t=Bc(t),_p(e.stateNode,e.type,t))}}function R1(e){_a?xa?xa.push(e):xa=[e]:_a=e}function $1(){if(_a){var e=_a,t=xa;if(xa=_a=null,Vv(e),t)for(e=0;e>>=0,e===0?32:31-(VE(e)/qE|0)|0}var gs=64,ms=4194304;function Ol(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 nc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~o;s!==0?r=Ol(s):(i&=l,i!==0&&(r=Ol(i)))}else l=n&~o,l!==0?r=Ol(l):i!==0&&(r=Ol(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===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 uu(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fr(t),e[t]=n}function XE(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=$l),t0=String.fromCharCode(32),n0=!1;function J1(e,t){switch(e){case"keyup":return kk.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ew(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var sa=!1;function Ck(e,t){switch(e){case"compositionend":return ew(t);case"keypress":return t.which!==32?null:(n0=!0,t0);case"textInput":return e=t.data,e===t0&&n0?null:e;default:return null}}function Ok(e,t){if(sa)return e==="compositionend"||!zh&&J1(e,t)?(e=X1(),Us=Lh=Xo=null,sa=!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=a0(n)}}function ow(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ow(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function iw(){for(var e=window,t=Zs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Zs(e.document)}return t}function Uh(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 Lk(e){var t=iw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ow(n.ownerDocument.documentElement,n)){if(r!==null&&Uh(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 o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=l0(n,i);var l=l0(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.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,ca=null,Tp=null,Dl=null,Cp=!1;function u0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Cp||ca==null||ca!==Zs(r)||(r=ca,"selectionStart"in r&&Uh(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}),Dl&&Ql(Dl,r)||(Dl=r,r=ic(Tp,"onSelect"),0pa||(e.current=$p[pa],$p[pa]=null,pa--)}function Pt(e,t){pa++,$p[pa]=e.current,e.current=t}var si={},jn=fi(si),Kn=fi(!1),Ni=si;function Ta(e,t){var n=e.type.contextTypes;if(!n)return si;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Qn(e){return e=e.childContextTypes,e!=null}function lc(){Lt(Kn),Lt(jn)}function g0(e,t,n){if(jn.current!==si)throw Error(ue(168));Pt(jn,t),Pt(Kn,n)}function hw(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(ue(108,RE(e)||"Unknown",o));return Qt({},n,r)}function uc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||si,Ni=jn.current,Pt(jn,e),Pt(Kn,Kn.current),!0}function m0(e,t,n){var r=e.stateNode;if(!r)throw Error(ue(169));n?(e=hw(e,t,Ni),r.__reactInternalMemoizedMergedChildContext=e,Lt(Kn),Lt(jn),Pt(jn,e)):Lt(Kn),Pt(Kn,n)}var yo=null,Hc=!1,Dd=!1;function gw(e){yo===null?yo=[e]:yo.push(e)}function Qk(e){Hc=!0,gw(e)}function di(){if(!Dd&&yo!==null){Dd=!0;var e=0,t=Et;try{var n=yo;for(Et=1;e>=l,o-=l,wo=1<<32-Fr(t)+o|n<U?(ce=L,L=null):ce=L.sibling;var z=g(_,L,S[U],k);if(z===null){L===null&&(L=ce);break}e&&L&&z.alternate===null&&t(_,L),w=i(z,w,U),$===null?C=z:$.sibling=z,$=z,L=ce}if(U===S.length)return n(_,L),zt&&xi(_,U),C;if(L===null){for(;UU?(ce=L,L=null):ce=L.sibling;var K=g(_,L,z.value,k);if(K===null){L===null&&(L=ce);break}e&&L&&K.alternate===null&&t(_,L),w=i(K,w,U),$===null?C=K:$.sibling=K,$=K,L=ce}if(z.done)return n(_,L),zt&&xi(_,U),C;if(L===null){for(;!z.done;U++,z=S.next())z=p(_,z.value,k),z!==null&&(w=i(z,w,U),$===null?C=z:$.sibling=z,$=z);return zt&&xi(_,U),C}for(L=r(_,L);!z.done;U++,z=S.next())z=y(L,_,U,z.value,k),z!==null&&(e&&z.alternate!==null&&L.delete(z.key===null?U:z.key),w=i(z,w,U),$===null?C=z:$.sibling=z,$=z);return e&&L.forEach(function(W){return t(_,W)}),zt&&xi(_,U),C}function O(_,w,S,k){if(typeof S=="object"&&S!==null&&S.type===ua&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case ds:e:{for(var C=S.key,$=w;$!==null;){if($.key===C){if(C=S.type,C===ua){if($.tag===7){n(_,$.sibling),w=o($,S.props.children),w.return=_,_=w;break e}}else if($.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Vo&&S0(C)===$.type){n(_,$.sibling),w=o($,S.props),w.ref=gl(_,$,S),w.return=_,_=w;break e}n(_,$);break}else t(_,$);$=$.sibling}S.type===ua?(w=Ri(S.props.children,_.mode,k,S.key),w.return=_,_=w):(k=Qs(S.type,S.key,S.props,null,_.mode,k),k.ref=gl(_,w,S),k.return=_,_=k)}return l(_);case la:e:{for($=S.key;w!==null;){if(w.key===$)if(w.tag===4&&w.stateNode.containerInfo===S.containerInfo&&w.stateNode.implementation===S.implementation){n(_,w.sibling),w=o(w,S.children||[]),w.return=_,_=w;break e}else{n(_,w);break}else t(_,w);w=w.sibling}w=Hd(S,_.mode,k),w.return=_,_=w}return l(_);case Vo:return $=S._init,O(_,w,$(S._payload),k)}if(Cl(S))return b(_,w,S,k);if(cl(S))return E(_,w,S,k);Ss(_,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,w!==null&&w.tag===6?(n(_,w.sibling),w=o(w,S),w.return=_,_=w):(n(_,w),w=Bd(S,_.mode,k),w.return=_,_=w),l(_)):n(_,w)}return O}var Oa=Sw(!0),Ew=Sw(!1),fu={},oo=fi(fu),Jl=fi(fu),eu=fi(fu);function Oi(e){if(e===fu)throw Error(ue(174));return e}function Yh(e,t){switch(Pt(eu,t),Pt(Jl,e),Pt(oo,fu),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:mp(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=mp(t,e)}Lt(oo),Pt(oo,t)}function Aa(){Lt(oo),Lt(Jl),Lt(eu)}function kw(e){Oi(eu.current);var t=Oi(oo.current),n=mp(t,e.type);t!==n&&(Pt(Jl,e),Pt(oo,n))}function Xh(e){Jl.current===e&&(Lt(oo),Lt(Jl))}var qt=fi(0);function hc(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Id=[];function Zh(){for(var e=0;en?n:4,e(!0);var r=Ld.transition;Ld.transition={};try{e(!1),t()}finally{Et=n,Ld.transition=r}}function Uw(){return Cr().memoizedState}function Jk(e,t,n){var r=ai(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Bw(e))Hw(t,n);else if(n=ww(e,t,n,r),n!==null){var o=Ln();zr(n,e,r,o),Ww(n,t,r)}}function e2(e,t,n){var r=ai(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bw(e))Hw(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,s=i(l,n);if(o.hasEagerState=!0,o.eagerState=s,Ur(s,l)){var c=t.interleaved;c===null?(o.next=o,Kh(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=ww(e,t,o,r),n!==null&&(o=Ln(),zr(n,e,r,o),Ww(n,t,r))}}function Bw(e){var t=e.alternate;return e===Kt||t!==null&&t===Kt}function Hw(e,t){Il=gc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ww(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Nh(e,n)}}var mc={readContext:Tr,useCallback:kn,useContext:kn,useEffect:kn,useImperativeHandle:kn,useInsertionEffect:kn,useLayoutEffect:kn,useMemo:kn,useReducer:kn,useRef:kn,useState:kn,useDebugValue:kn,useDeferredValue:kn,useTransition:kn,useMutableSource:kn,useSyncExternalStore:kn,useId:kn,unstable_isNewReconciler:!1},t2={readContext:Tr,useCallback:function(e,t){return Jr().memoizedState=[e,t===void 0?null:t],e},useContext:Tr,useEffect:k0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Gs(4194308,4,Iw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Gs(4,2,e,t)},useMemo:function(e,t){var n=Jr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Jr();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=Jk.bind(null,Kt,e),[r.memoizedState,e]},useRef:function(e){var t=Jr();return e={current:e},t.memoizedState=e},useState:E0,useDebugValue:rg,useDeferredValue:function(e){return Jr().memoizedState=e},useTransition:function(){var e=E0(!1),t=e[0];return e=Zk.bind(null,e[1]),Jr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Kt,o=Jr();if(zt){if(n===void 0)throw Error(ue(407));n=n()}else{if(n=t(),mn===null)throw Error(ue(349));Ii&30||Ow(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,k0(jw.bind(null,r,i,e),[e]),r.flags|=2048,ru(9,Aw.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Jr(),t=mn.identifierPrefix;if(zt){var n=_o,r=wo;n=(r&~(1<<32-Fr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=tu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[eo]=t,e[Zl]=r,Jw(e,t,!1,!1),t.stateNode=e;e:{switch(l=yp(n,r),n){case"dialog":Dt("cancel",e),Dt("close",e),o=r;break;case"iframe":case"object":case"embed":Dt("load",e),o=r;break;case"video":case"audio":for(o=0;oPa&&(t.flags|=128,r=!0,ml(i,!1),t.lanes=4194304)}else{if(!r)if(e=hc(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ml(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!zt)return Tn(t),null}else 2*nn()-i.renderingStartTime>Pa&&n!==1073741824&&(t.flags|=128,r=!0,ml(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=nn(),t.sibling=null,n=qt.current,Pt(qt,r?n&1|2:n&1),t):(Tn(t),null);case 22:case 23:return sg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?or&1073741824&&(Tn(t),t.subtreeFlags&6&&(t.flags|=8192)):Tn(t),null;case 24:return null;case 25:return null}throw Error(ue(156,t.tag))}function s2(e,t){switch(Hh(t),t.tag){case 1:return Qn(t.type)&&lc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Aa(),Lt(Kn),Lt(jn),Zh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xh(t),null;case 13:if(Lt(qt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ue(340));Ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Lt(qt),null;case 4:return Aa(),null;case 10:return qh(t.type._context),null;case 22:case 23:return sg(),null;case 24:return null;default:return null}}var ks=!1,Cn=!1,c2=typeof WeakSet=="function"?WeakSet:Set,we=null;function va(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){en(e,t,r)}else n.current=null}function Gp(e,t,n){try{n()}catch(r){en(e,t,r)}}var N0=!1;function f2(e,t){if(Op=rc,e=iw(),Uh(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 o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,s=-1,c=-1,f=0,h=0,p=e,g=null;t:for(;;){for(var y;p!==n||o!==0&&p.nodeType!==3||(s=l+o),p!==i||r!==0&&p.nodeType!==3||(c=l+r),p.nodeType===3&&(l+=p.nodeValue.length),(y=p.firstChild)!==null;)g=p,p=y;for(;;){if(p===e)break t;if(g===n&&++f===o&&(s=l),g===i&&++h===r&&(c=l),(y=p.nextSibling)!==null)break;p=g,g=p.parentNode}p=y}n=s===-1||c===-1?null:{start:s,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ap={focusedElem:e,selectionRange:n},rc=!1,we=t;we!==null;)if(t=we,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,we=e;else for(;we!==null;){t=we;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var E=b.memoizedProps,O=b.memoizedState,_=t.stateNode,w=_.getSnapshotBeforeUpdate(t.elementType===t.type?E:Ir(t.type,E),O);_.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ue(163))}}catch(k){en(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,we=e;break}we=t.return}return b=N0,N0=!1,b}function Ll(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Gp(t,n,i)}o=o.next}while(o!==r)}}function Vc(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 Vp(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 n_(e){var t=e.alternate;t!==null&&(e.alternate=null,n_(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[eo],delete t[Zl],delete t[Rp],delete t[qk],delete t[Kk])),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 r_(e){return e.tag===5||e.tag===3||e.tag===4}function D0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||r_(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 qp(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=ac));else if(r!==4&&(e=e.child,e!==null))for(qp(e,t,n),e=e.sibling;e!==null;)qp(e,t,n),e=e.sibling}function Kp(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(Kp(e,t,n),e=e.sibling;e!==null;)Kp(e,t,n),e=e.sibling}var wn=null,Lr=!1;function Bo(e,t,n){for(n=n.child;n!==null;)o_(e,t,n),n=n.sibling}function o_(e,t,n){if(ro&&typeof ro.onCommitFiberUnmount=="function")try{ro.onCommitFiberUnmount(Mc,n)}catch{}switch(n.tag){case 5:Cn||va(n,t);case 6:var r=wn,o=Lr;wn=null,Bo(e,t,n),wn=r,Lr=o,wn!==null&&(Lr?(e=wn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wn.removeChild(n.stateNode));break;case 18:wn!==null&&(Lr?(e=wn,n=n.stateNode,e.nodeType===8?Nd(e.parentNode,n):e.nodeType===1&&Nd(e,n),ql(e)):Nd(wn,n.stateNode));break;case 4:r=wn,o=Lr,wn=n.stateNode.containerInfo,Lr=!0,Bo(e,t,n),wn=r,Lr=o;break;case 0:case 11:case 14:case 15:if(!Cn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&Gp(n,t,l),o=o.next}while(o!==r)}Bo(e,t,n);break;case 1:if(!Cn&&(va(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){en(n,t,s)}Bo(e,t,n);break;case 21:Bo(e,t,n);break;case 22:n.mode&1?(Cn=(r=Cn)||n.memoizedState!==null,Bo(e,t,n),Cn=r):Bo(e,t,n);break;default:Bo(e,t,n)}}function I0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new c2),t.forEach(function(r){var o=_2.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Nr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=nn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*p2(r/1960))-r,10e?16:e,Zo===null)var r=!1;else{if(e=Zo,Zo=null,wc=0,dt&6)throw Error(ue(331));var o=dt;for(dt|=4,we=e.current;we!==null;){var i=we,l=i.child;if(we.flags&16){var s=i.deletions;if(s!==null){for(var c=0;cnn()-lg?Pi(e,0):ag|=n),Yn(e,t)}function d_(e,t){t===0&&(e.mode&1?(t=ms,ms<<=1,!(ms&130023424)&&(ms=4194304)):t=1);var n=Ln();e=To(e,t),e!==null&&(uu(e,t,n),Yn(e,n))}function w2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),d_(e,n)}function _2(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ue(314))}r!==null&&r.delete(t),d_(e,n)}var p_;p_=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Kn.current)qn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qn=!1,l2(e,t,n);qn=!!(e.flags&131072)}else qn=!1,zt&&t.flags&1048576&&mw(t,cc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Vs(e,t),e=t.pendingProps;var o=Ta(t,jn.current);Sa(t,n),o=eg(null,t,r,e,o,n);var i=tg();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qn(r)?(i=!0,uc(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Qh(t),o.updater=Wc,t.stateNode=o,o._reactInternals=t,Mp(t,r,e,n),t=Up(null,t,r,!0,i,n)):(t.tag=0,zt&&i&&Bh(t),In(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Vs(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=b2(r),e=Ir(r,e),o){case 0:t=zp(null,t,r,e,n);break e;case 1:t=P0(null,t,r,e,n);break e;case 11:t=A0(null,t,r,e,n);break e;case 14:t=j0(null,t,r,Ir(r.type,e),n);break e}throw Error(ue(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ir(r,o),zp(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ir(r,o),P0(e,t,r,o,n);case 3:e:{if(Yw(t),e===null)throw Error(ue(387));r=t.pendingProps,i=t.memoizedState,o=i.element,_w(e,t),pc(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=ja(Error(ue(423)),t),t=R0(e,t,r,n,o);break e}else if(r!==o){o=ja(Error(ue(424)),t),t=R0(e,t,r,n,o);break e}else for(lr=ri(t.stateNode.containerInfo.firstChild),ur=t,zt=!0,Mr=null,n=Ew(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ca(),r===o){t=Co(e,t,n);break e}In(e,t,r,n)}t=t.child}return t;case 5:return kw(t),e===null&&Dp(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,jp(r,o)?l=null:i!==null&&jp(r,i)&&(t.flags|=32),Qw(e,t),In(e,t,l,n),t.child;case 6:return e===null&&Dp(t),null;case 13:return Xw(e,t,n);case 4:return Yh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Oa(t,null,r,n):In(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ir(r,o),A0(e,t,r,o,n);case 7:return In(e,t,t.pendingProps,n),t.child;case 8:return In(e,t,t.pendingProps.children,n),t.child;case 12:return In(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,Pt(fc,r._currentValue),r._currentValue=l,i!==null)if(Ur(i.value,l)){if(i.children===o.children&&!Kn.current){t=Co(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){l=i.child;for(var c=s.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=xo(-1,n&-n),c.tag=2;var f=i.updateQueue;if(f!==null){f=f.shared;var h=f.pending;h===null?c.next=c:(c.next=h.next,h.next=c),f.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Ip(i.return,n,t),s.lanes|=n;break}c=c.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(ue(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),Ip(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}In(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Sa(t,n),o=Tr(o),r=r(o),t.flags|=1,In(e,t,r,n),t.child;case 14:return r=t.type,o=Ir(r,t.pendingProps),o=Ir(r.type,o),j0(e,t,r,o,n);case 15:return qw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ir(r,o),Vs(e,t),t.tag=1,Qn(r)?(e=!0,uc(t)):e=!1,Sa(t,n),bw(t,r,o),Mp(t,r,o,n),Up(null,t,r,!0,e,n);case 19:return Zw(e,t,n);case 22:return Kw(e,t,n)}throw Error(ue(156,t.tag))};function h_(e,t){return z1(e,t)}function x2(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 Er(e,t,n,r){return new x2(e,t,n,r)}function fg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function b2(e){if(typeof e=="function")return fg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===jh)return 11;if(e===Ph)return 14}return 2}function li(e,t){var n=e.alternate;return n===null?(n=Er(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 Qs(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")fg(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case ua:return Ri(n.children,o,i,t);case Ah:l=8,o|=8;break;case up:return e=Er(12,n,t,o|2),e.elementType=up,e.lanes=i,e;case sp:return e=Er(13,n,t,o),e.elementType=sp,e.lanes=i,e;case cp:return e=Er(19,n,t,o),e.elementType=cp,e.lanes=i,e;case S1:return Kc(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case x1:l=10;break e;case b1:l=9;break e;case jh:l=11;break e;case Ph:l=14;break e;case Vo:l=16,r=null;break e}throw Error(ue(130,e==null?e:typeof e,""))}return t=Er(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Ri(e,t,n,r){return e=Er(7,e,r,t),e.lanes=n,e}function Kc(e,t,n,r){return e=Er(22,e,r,t),e.elementType=S1,e.lanes=n,e.stateNode={isHidden:!1},e}function Bd(e,t,n){return e=Er(6,e,null,t),e.lanes=n,e}function Hd(e,t,n){return t=Er(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function S2(e,t,n,r,o){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=Sd(0),this.expirationTimes=Sd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sd(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function dg(e,t,n,r,o,i,l,s,c){return e=new S2(e,t,n,s,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Er(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qh(i),e}function E2(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(y_)}catch(e){console.error(e)}}y_(),m1.exports=cr;var w_=m1.exports,W0=w_;ap.createRoot=W0.createRoot,ap.hydrateRoot=W0.hydrateRoot;function A2({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const j2=j.forwardRef(A2),P2=j2;function R2({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"}))}const $2=j.forwardRef(R2),G0=$2;function N2({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"}))}const D2=j.forwardRef(N2),I2=D2;function L2({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z"}))}const M2=j.forwardRef(L2),V0=M2;function F2({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 15h2.25m8.024-9.75c.011.05.028.1.052.148.591 1.2.924 2.55.924 3.977a8.96 8.96 0 01-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398C20.613 14.547 19.833 15 19 15h-1.053c-.472 0-.745-.556-.5-.96a8.95 8.95 0 00.303-.54m.023-8.25H16.48a4.5 4.5 0 01-1.423-.23l-3.114-1.04a4.5 4.5 0 00-1.423-.23H6.504c-.618 0-1.217.247-1.605.729A11.95 11.95 0 002.25 12c0 .434.023.863.068 1.285C2.427 14.306 3.346 15 4.372 15h3.126c.618 0 .991.724.725 1.282A7.471 7.471 0 007.5 19.5a2.25 2.25 0 002.25 2.25.75.75 0 00.75-.75v-.633c0-.573.11-1.14.322-1.672.304-.76.93-1.33 1.653-1.715a9.04 9.04 0 002.86-2.4c.498-.634 1.226-1.08 2.032-1.08h.384"}))}const z2=j.forwardRef(F2),U2=z2;function B2({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.633 10.5c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 012.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 00.322-1.672V3a.75.75 0 01.75-.75A2.25 2.25 0 0116.5 4.5c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 01-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 00-1.423-.23H5.904M14.25 9h2.25M5.904 18.75c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 01-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 10.203 4.167 9.75 5 9.75h1.053c.472 0 .745.556.5.96a8.958 8.958 0 00-1.302 4.665c0 1.194.232 2.333.654 3.375z"}))}const H2=j.forwardRef(B2),W2=H2;function G2({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"}))}const V2=j.forwardRef(G2),q2=V2;function K2({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const Q2=j.forwardRef(K2),__=Q2;function Y2({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.907a2.25 2.25 0 100 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186l9.566-5.314m-9.566 7.5l9.566 5.314m0 0a2.25 2.25 0 103.935 2.186 2.25 2.25 0 00-3.935-2.186zm0-12.814a2.25 2.25 0 103.933-2.185 2.25 2.25 0 00-3.933 2.185z"}))}const X2=j.forwardRef(Y2),Z2=X2;function J2({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.75 9.75l4.5 4.5m0-4.5l-4.5 4.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}const eT=j.forwardRef(J2),tT=eT;function nT({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))}const rT=j.forwardRef(nT),oT=rT;async function q0(e){const{messages:t}=await fetch(`/threads/${e}/messages`,{headers:{Accept:"application/json"}}).then(n=>n.json());return t}function iT(e,t){const[n,r]=j.useState(null);return j.useEffect(()=>{async function o(){e&&r(await q0(e))}return o(),()=>{r(null)}},[e]),j.useEffect(()=>{async function o(){e&&r(await q0(e))}(t==null?void 0:t.status)!=="inflight"&&o()},[t==null?void 0:t.status]),t!=null&&t.merge?[...n??[],...t.messages??[]]:(t==null?void 0:t.messages)??n}function aT({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{fillRule:"evenodd",d:"M3.43 2.524A41.29 41.29 0 0110 2c2.236 0 4.43.18 6.57.524 1.437.231 2.43 1.49 2.43 2.902v5.148c0 1.413-.993 2.67-2.43 2.902a41.202 41.202 0 01-5.183.501.78.78 0 00-.528.224l-3.579 3.58A.75.75 0 016 17.25v-3.443a41.033 41.033 0 01-2.57-.33C1.993 13.244 1 11.986 1 10.573V5.426c0-1.413.993-2.67 2.43-2.902z",clipRule:"evenodd"}))}const lT=j.forwardRef(aT),uT=lT;function sT({title:e,titleId:t,...n},r){return j.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?j.createElement("title",{id:t},e):null,j.createElement("path",{d:"M3.105 2.289a.75.75 0 00-.826.95l1.414 4.925A1.5 1.5 0 005.135 9.25h6.115a.75.75 0 010 1.5H5.135a1.5 1.5 0 00-1.442 1.086l-1.414 4.926a.75.75 0 00.826.95 28.896 28.896 0 0015.293-7.154.75.75 0 000-1.115A28.897 28.897 0 003.105 2.289z"}))}const cT=j.forwardRef(sT),fT=cT;function x_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ts(i)))==null?void 0:l.classGroupId}const K0=/^\[(.+)\]$/;function hT(e){if(K0.test(e)){const t=K0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function gT(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return vT(Object.entries(e.classGroups),n).forEach(([i,l])=>{Jp(l,r,i,t)}),r}function Jp(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Q0(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(mT(o)){Jp(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,l])=>{Jp(l,Q0(t,i),n,r)})})}function Q0(e,t){let n=e;return t.split(mg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function mT(e){return e.isThemeGetter}function vT(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([l,s])=>[t+l,s])):i);return[n,o]}):e}function yT(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,l){n.set(i,l),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let l=n.get(i);if(l!==void 0)return l;if((l=r.get(i))!==void 0)return o(i,l),l},set(i,l){n.has(i)?n.set(i,l):o(i,l)}}}const S_="!";function wT(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(l){const s=[];let c=0,f=0,h;for(let E=0;Ef?h-f:void 0;return{modifiers:s,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:b}}}function _T(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function xT(e){return{cache:yT(e.cacheSize),splitModifiers:wT(e),...pT(e)}}const bT=/\s+/;function ST(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(bT).map(l=>{const{modifiers:s,hasImportantModifier:c,baseClassName:f,maybePostfixModifierPosition:h}=n(l);let p=r(h?f.substring(0,h):f),g=!!h;if(!p){if(!h)return{isTailwindClass:!1,originalClassName:l};if(p=r(f),!p)return{isTailwindClass:!1,originalClassName:l};g=!1}const y=_T(s).join(":");return{isTailwindClass:!0,modifierId:c?y+S_:y,classGroupId:p,originalClassName:l,hasPostfixModifier:g}}).reverse().filter(l=>{if(!l.isTailwindClass)return!0;const{modifierId:s,classGroupId:c,hasPostfixModifier:f}=l,h=s+c;return i.has(h)?!1:(i.add(h),o(c,f).forEach(p=>i.add(s+p)),!0)}).reverse().map(l=>l.originalClassName).join(" ")}function ET(){let e=0,t,n,r="";for(;ep(h),e());return n=xT(f),r=n.cache.get,o=n.cache.set,i=s,s(c)}function s(c){const f=r(c);if(f)return f;const h=ST(c,n);return o(c,h),h}return function(){return i(ET.apply(null,arguments))}}function Nt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const k_=/^\[(?:([a-z-]+):)?(.+)\]$/i,TT=/^\d+\/\d+$/,CT=new Set(["px","full","screen"]),OT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,AT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,jT=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,PT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Dr(e){return Ai(e)||CT.has(e)||TT.test(e)}function Ho(e){return Da(e,"length",FT)}function Ai(e){return!!e&&!Number.isNaN(Number(e))}function Os(e){return Da(e,"number",Ai)}function yl(e){return!!e&&Number.isInteger(Number(e))}function RT(e){return e.endsWith("%")&&Ai(e.slice(0,-1))}function Je(e){return k_.test(e)}function Wo(e){return OT.test(e)}const $T=new Set(["length","size","percentage"]);function NT(e){return Da(e,$T,T_)}function DT(e){return Da(e,"position",T_)}const IT=new Set(["image","url"]);function LT(e){return Da(e,IT,UT)}function MT(e){return Da(e,"",zT)}function wl(){return!0}function Da(e,t,n){const r=k_.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function FT(e){return AT.test(e)}function T_(){return!1}function zT(e){return jT.test(e)}function UT(e){return PT.test(e)}function BT(){const e=Nt("colors"),t=Nt("spacing"),n=Nt("blur"),r=Nt("brightness"),o=Nt("borderColor"),i=Nt("borderRadius"),l=Nt("borderSpacing"),s=Nt("borderWidth"),c=Nt("contrast"),f=Nt("grayscale"),h=Nt("hueRotate"),p=Nt("invert"),g=Nt("gap"),y=Nt("gradientColorStops"),b=Nt("gradientColorStopPositions"),E=Nt("inset"),O=Nt("margin"),_=Nt("opacity"),w=Nt("padding"),S=Nt("saturate"),k=Nt("scale"),C=Nt("sepia"),$=Nt("skew"),L=Nt("space"),U=Nt("translate"),ce=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto",Je,t],W=()=>[Je,t],ge=()=>["",Dr,Ho],he=()=>["auto",Ai,Je],be=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],De=()=>["solid","dashed","dotted","double","none"],Be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],X=()=>["start","end","center","between","around","evenly","stretch"],ne=()=>["","0",Je],_e=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>[Ai,Os],G=()=>[Ai,Je];return{cacheSize:500,separator:":",theme:{colors:[wl],spacing:[Dr,Ho],blur:["none","",Wo,Je],brightness:N(),borderColor:[e],borderRadius:["none","","full",Wo,Je],borderSpacing:W(),borderWidth:ge(),contrast:N(),grayscale:ne(),hueRotate:G(),invert:ne(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[RT,Ho],inset:K(),margin:K(),opacity:N(),padding:W(),saturate:N(),scale:N(),sepia:ne(),skew:G(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",Je]}],container:["container"],columns:[{columns:[Wo]}],"break-after":[{"break-after":_e()}],"break-before":[{"break-before":_e()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...be(),Je]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:ce()}],"overscroll-x":[{"overscroll-x":ce()}],"overscroll-y":[{"overscroll-y":ce()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",yl,Je]}],basis:[{basis:K()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Je]}],grow:[{grow:ne()}],shrink:[{shrink:ne()}],order:[{order:["first","last","none",yl,Je]}],"grid-cols":[{"grid-cols":[wl]}],"col-start-end":[{col:["auto",{span:["full",yl,Je]},Je]}],"col-start":[{"col-start":he()}],"col-end":[{"col-end":he()}],"grid-rows":[{"grid-rows":[wl]}],"row-start-end":[{row:["auto",{span:[yl,Je]},Je]}],"row-start":[{"row-start":he()}],"row-end":[{"row-end":he()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Je]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Je]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[O]}],mx:[{mx:[O]}],my:[{my:[O]}],ms:[{ms:[O]}],me:[{me:[O]}],mt:[{mt:[O]}],mr:[{mr:[O]}],mb:[{mb:[O]}],ml:[{ml:[O]}],"space-x":[{"space-x":[L]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[L]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",Je,t]}],"min-w":[{"min-w":["min","max","fit",Je,Dr]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Wo]},Wo,Je]}],h:[{h:[Je,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Dr,Je]}],"max-h":[{"max-h":[Je,t,"min","max","fit"]}],"font-size":[{text:["base",Wo,Ho]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Os]}],"font-family":[{font:[wl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Je]}],"line-clamp":[{"line-clamp":["none",Ai,Os]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Dr,Je]}],"list-image":[{"list-image":["none",Je]}],"list-style-type":[{list:["none","disc","decimal",Je]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...De(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Dr,Ho]}],"underline-offset":[{"underline-offset":["auto",Dr,Je]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...be(),DT]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",NT]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},LT]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...De(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:De()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...De()]}],"outline-offset":[{"outline-offset":[Dr,Je]}],"outline-w":[{outline:[Dr,Ho]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ge()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Dr,Ho]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Wo,MT]}],"shadow-color":[{shadow:[wl]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":Be()}],"bg-blend":[{"bg-blend":Be()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Wo,Je]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[S]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Je]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",Je]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",Je]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[yl,Je]}],"translate-x":[{"translate-x":[U]}],"translate-y":[{"translate-y":[U]}],"skew-x":[{"skew-x":[$]}],"skew-y":[{"skew-y":[$]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Je]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Je]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Je]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Dr,Ho,Os]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const HT=kT(BT);function On(...e){return HT(dT(e))}function C_(e){const[t,n]=j.useState(!1),r=e.disabled||t;return M.jsxs("form",{className:On("mt-2 flex rounded-md shadow-sm",r&&"opacity-50 cursor-not-allowed"),onSubmit:async o=>{if(o.preventDefault(),r)return;const i=o.target,l=i.message.value;n(!0),await e.onSubmit(l),n(!1),i.message.value=""},children:[M.jsxs("div",{className:"relative flex flex-grow items-stretch focus-within:z-10",children:[M.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:M.jsx(uT,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})}),M.jsx("input",{type:"text",name:"messsage",id:"message",autoFocus:!0,autoComplete:"off",className:"block w-full rounded-none rounded-l-md border-0 py-1.5 pl-10 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6",placeholder:"Send a message",readOnly:r})]}),M.jsxs("button",{type:"submit",disabled:r,className:"relative -ml-px inline-flex items-center gap-x-1.5 rounded-r-md px-3 py-2 text-sm font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 bg-white",children:[M.jsx(fT,{className:"-ml-0.5 h-5 w-5 text-gray-400","aria-hidden":"true"}),t?"Sending...":"Send"]})]})}function O_(e){return typeof e=="object"?JSON.stringify(e,null,2):e}function vg(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Bi=vg();function A_(e){Bi=e}const j_=/[&<>"']/,WT=new RegExp(j_.source,"g"),P_=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,GT=new RegExp(P_.source,"g"),VT={"&":"&","<":"<",">":">",'"':""","'":"'"},Y0=e=>VT[e];function ir(e,t){if(t){if(j_.test(e))return e.replace(WT,Y0)}else if(P_.test(e))return e.replace(GT,Y0);return e}const qT=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function KT(e){return e.replace(qT,(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 QT=/(^|[^\[])\^/g;function xt(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(r,o)=>(o=typeof o=="object"&&"source"in o?o.source:o,o=o.replace(QT,"$1"),e=e.replace(r,o),n),getRegex:()=>new RegExp(e,t)};return n}function X0(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch{return null}return e}const bc={exec:()=>null};function Z0(e,t){const n=e.replace(/\|/g,(i,l,s)=>{let c=!1,f=l;for(;--f>=0&&s[f]==="\\";)c=!c;return c?"|":" |"}),r=n.split(/ \|/);let o=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=o.match(/^\s+/);if(i===null)return o;const[l]=i;return l.length>=r.length?o.slice(r.length):o}).join(` +`)}class Sc{constructor(t){Ot(this,"options");Ot(this,"rules");Ot(this,"lexer");this.options=t||Bi}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:As(r,` +`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const r=n[0],o=XT(r,n[3]||"");return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:o}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let r=n[2].trim();if(/#$/.test(r)){const o=As(r,"#");(this.options.pedantic||!o||/ $/.test(o))&&(r=o.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){const r=As(n[0].replace(/^ *>[ \t]?/gm,""),` +`),o=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(r);return this.lexer.state.top=o,{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 o=r.length>1,i={type:"list",raw:"",ordered:o,start:o?+r.slice(0,-1):"",loose:!1,items:[]};r=o?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=o?r:"[*+-]");const l=new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`);let s="",c="",f=!1;for(;t;){let h=!1;if(!(n=l.exec(t))||this.rules.block.hr.test(t))break;s=n[0],t=t.substring(s.length);let p=n[2].split(` +`,1)[0].replace(/^\t+/,_=>" ".repeat(3*_.length)),g=t.split(` +`,1)[0],y=0;this.options.pedantic?(y=2,c=p.trimStart()):(y=n[2].search(/[^ ]/),y=y>4?1:y,c=p.slice(y),y+=n[1].length);let b=!1;if(!p&&/^ *$/.test(g)&&(s+=g+` +`,t=t.substring(g.length+1),h=!0),!h){const _=new RegExp(`^ {0,${Math.min(3,y-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),w=new RegExp(`^ {0,${Math.min(3,y-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),S=new RegExp(`^ {0,${Math.min(3,y-1)}}(?:\`\`\`|~~~)`),k=new RegExp(`^ {0,${Math.min(3,y-1)}}#`);for(;t;){const C=t.split(` +`,1)[0];if(g=C,this.options.pedantic&&(g=g.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),S.test(g)||k.test(g)||_.test(g)||w.test(t))break;if(g.search(/[^ ]/)>=y||!g.trim())c+=` +`+g.slice(y);else{if(b||p.search(/[^ ]/)>=4||S.test(p)||k.test(p)||w.test(p))break;c+=` +`+g}!b&&!g.trim()&&(b=!0),s+=C+` +`,t=t.substring(C.length+1),p=g.slice(y)}}i.loose||(f?i.loose=!0:/\n *\n *$/.test(s)&&(f=!0));let E=null,O;this.options.gfm&&(E=/^\[[ xX]\] /.exec(c),E&&(O=E[0]!=="[ ] ",c=c.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:s,task:!!E,checked:O,loose:!1,text:c,tokens:[]}),i.raw+=s}i.items[i.items.length-1].raw=s.trimEnd(),i.items[i.items.length-1].text=c.trimEnd(),i.raw=i.raw.trimEnd();for(let h=0;hy.type==="space"),g=p.length>0&&p.some(y=>/\n.*\n/.test(y.raw));i.loose=g}if(i.loose)for(let h=0;h$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:o,title:i}}}table(t){const n=this.rules.block.table.exec(t);if(n){if(!/[:|]/.test(n[2]))return;const r={type:"table",raw:n[0],header:Z0(n[1]).map(o=>({text:o,tokens:[]})),align:n[2].replace(/^\||\| *$/g,"").split("|"),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(r.header.length===r.align.length){let o=r.align.length,i,l,s,c;for(i=0;i({text:f,tokens:[]}));for(o=r.header.length,l=0;l/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 l=As(r.slice(0,-1),"\\");if((r.length-l.length)%2===0)return}else{const l=YT(n[2],"()");if(l>-1){const c=(n[0].indexOf("!")===0?5:4)+n[1].length+l;n[2]=n[2].substring(0,l),n[0]=n[0].substring(0,c).trim(),n[3]=""}}let o=n[2],i="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);l&&(o=l[1],i=l[3])}else i=n[3]?n[3].slice(1,-1):"";return o=o.trim(),/^$/.test(r)?o=o.slice(1):o=o.slice(1,-1)),J0(n,{href:o&&o.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$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))){let o=(r[2]||r[1]).replace(/\s+/g," ");if(o=n[o.toLowerCase()],!o){const i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return J0(r,o,r[0],this.lexer)}}emStrong(t,n,r=""){let o=this.rules.inline.emStrong.lDelim.exec(t);if(!o||o[3]&&r.match(/[\p{L}\p{N}]/u))return;if(!(o[1]||o[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const l=[...o[0]].length-1;let s,c,f=l,h=0;const p=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(p.lastIndex=0,n=n.slice(-1*t.length+l);(o=p.exec(n))!=null;){if(s=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!s)continue;if(c=[...s].length,o[3]||o[4]){f+=c;continue}else if((o[5]||o[6])&&l%3&&!((l+c)%3)){h+=c;continue}if(f-=c,f>0)continue;c=Math.min(c,c+f+h);const g=[...o[0]][0].length,y=t.slice(0,l+o.index+g+c);if(Math.min(l,c)%2){const E=y.slice(1,-1);return{type:"em",raw:y,text:E,tokens:this.lexer.inlineTokens(E)}}const b=y.slice(2,-2);return{type:"strong",raw:y,text:b,tokens:this.lexer.inlineTokens(b)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let r=n[2].replace(/\n/g," ");const o=/[^ ]/.test(r),i=/^ /.test(r)&&/ $/.test(r);return o&&i&&(r=r.substring(1,r.length-1)),r=ir(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,o;return n[2]==="@"?(r=ir(n[1]),o="mailto:"+r):(r=ir(n[1]),o=r),{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let n;if(n=this.rules.inline.url.exec(t)){let r,o;if(n[2]==="@")r=ir(n[0]),o="mailto:"+r;else{let i;do i=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(i!==n[0]);r=ir(n[0]),n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){const n=this.rules.inline.text.exec(t);if(n){let r;return this.lexer.state.inRawBlock?r=n[0]:r=ir(n[0]),{type:"text",raw:n[0],text:r}}}}const je={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {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|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:bc,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};je._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;je._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;je.def=xt(je.def).replace("label",je._label).replace("title",je._title).getRegex();je.bullet=/(?:[*+-]|\d{1,9}[.)])/;je.listItemStart=xt(/^( *)(bull) */).replace("bull",je.bullet).getRegex();je.list=xt(je.list).replace(/bull/g,je.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+je.def.source+")").getRegex();je._tag="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";je._comment=/|$)/;je.html=xt(je.html,"i").replace("comment",je._comment).replace("tag",je._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();je.lheading=xt(je.lheading).replace(/bull/g,je.bullet).getRegex();je.paragraph=xt(je._paragraph).replace("hr",je.hr).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",je._tag).getRegex();je.blockquote=xt(je.blockquote).replace("paragraph",je.paragraph).getRegex();je.normal={...je};je.gfm={...je.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};je.gfm.table=xt(je.gfm.table).replace("hr",je.hr).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",je._tag).getRegex();je.gfm.paragraph=xt(je._paragraph).replace("hr",je.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",je.gfm.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",je._tag).getRegex();je.pedantic={...je.normal,html:xt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",je._comment).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:bc,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xt(je.normal._paragraph).replace("hr",je.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",je.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const me={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:bc,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:bc,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~";me.punctuation=xt(me.punctuation,"u").replace(/punctuation/g,me._punctuation).getRegex();me.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;me.anyPunctuation=/\\[punct]/g;me._escapes=/\\([punct])/g;me._comment=xt(je._comment).replace("(?:-->|$)","-->").getRegex();me.emStrong.lDelim=xt(me.emStrong.lDelim,"u").replace(/punct/g,me._punctuation).getRegex();me.emStrong.rDelimAst=xt(me.emStrong.rDelimAst,"gu").replace(/punct/g,me._punctuation).getRegex();me.emStrong.rDelimUnd=xt(me.emStrong.rDelimUnd,"gu").replace(/punct/g,me._punctuation).getRegex();me.anyPunctuation=xt(me.anyPunctuation,"gu").replace(/punct/g,me._punctuation).getRegex();me._escapes=xt(me._escapes,"gu").replace(/punct/g,me._punctuation).getRegex();me._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;me._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])?)+(?![-_])/;me.autolink=xt(me.autolink).replace("scheme",me._scheme).replace("email",me._email).getRegex();me._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;me.tag=xt(me.tag).replace("comment",me._comment).replace("attribute",me._attribute).getRegex();me._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;me._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;me._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;me.link=xt(me.link).replace("label",me._label).replace("href",me._href).replace("title",me._title).getRegex();me.reflink=xt(me.reflink).replace("label",me._label).replace("ref",je._label).getRegex();me.nolink=xt(me.nolink).replace("ref",je._label).getRegex();me.reflinkSearch=xt(me.reflinkSearch,"g").replace("reflink",me.reflink).replace("nolink",me.nolink).getRegex();me.normal={...me};me.pedantic={...me.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:xt(/^!?\[(label)\]\((.*?)\)/).replace("label",me._label).getRegex(),reflink:xt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",me._label).getRegex()};me.gfm={...me.normal,escape:xt(me.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\c+" ".repeat(f.length));let r,o,i,l;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),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=` +`+r.raw,o.text+=` +`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=o.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),o=n[n.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=` +`+r.raw,o.text+=` +`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.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 c=t.slice(1);let f;this.options.extensions.startBlock.forEach(h=>{f=h.call({lexer:this},c),typeof f=="number"&&f>=0&&(s=Math.min(s,f))}),s<1/0&&s>=0&&(i=t.substring(0,s+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){o=n[n.length-1],l&&o.type==="paragraph"?(o.raw+=` +`+r.raw,o.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):n.push(r),l=i.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length),o=n[n.length-1],o&&o.type==="text"?(o.raw+=` +`+r.raw,o.text+=` +`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.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,o,i,l=t,s,c,f;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)h.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(l))!=null;)l=l.slice(0,s.index)+"++"+l.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(c||(f=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(r=h.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),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.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),o=n[n.length-1],o&&r.type==="text"&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(r=this.tokenizer.emStrong(t,l,f)){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 h=1/0;const p=t.slice(1);let g;this.options.extensions.startInline.forEach(y=>{g=y.call({lexer:this},p),typeof g=="number"&&g>=0&&(h=Math.min(h,g))}),h<1/0&&h>=0&&(i=t.substring(0,h+1))}if(r=this.tokenizer.inlineText(i)){t=t.substring(r.raw.length),r.raw.slice(-1)!=="_"&&(f=r.raw.slice(-1)),c=!0,o=n[n.length-1],o&&o.type==="text"?(o.raw+=r.raw,o.text+=r.text):n.push(r);continue}if(t){const h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}}class Ec{constructor(t){Ot(this,"options");this.options=t||Bi}code(t,n,r){var i;const o=(i=(n||"").match(/^\S*/))==null?void 0:i[0];return t=t.replace(/\n$/,"")+` +`,o?'
'+(r?t:ir(t,!0))+`
+`:"
"+(r?t:ir(t,!0))+`
+`}blockquote(t){return`
+${t}
+`}html(t,n){return t}heading(t,n,r){return`${t} +`}hr(){return`
+`}list(t,n,r){const o=n?"ol":"ul",i=n&&r!==1?' start="'+r+'"':"";return"<"+o+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 o=X0(t);if(o===null)return r;t=o;let i='",i}image(t,n,r){const o=X0(t);if(o===null)return r;t=o;let i=`${r}0&&g.tokens[0].type==="paragraph"?(g.tokens[0].text=O+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&g.tokens[0].tokens[0].type==="text"&&(g.tokens[0].tokens[0].text=O+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:O+" "}):E+=O+" "}E+=this.parse(g.tokens,f),h+=this.renderer.listitem(E,b,!!y)}r+=this.renderer.list(h,s,c);continue}case"html":{const l=i;r+=this.renderer.html(l.text,l.block);continue}case"paragraph":{const l=i;r+=this.renderer.paragraph(this.parseInline(l.tokens));continue}case"text":{let l=i,s=l.tokens?this.parseInline(l.tokens):l.text;for(;o+1{r=r.concat(this.walkTokens(s[c],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 o={...r};if(o.async=this.defaults.async||o.async||!1,r.extensions&&(r.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const l=n.renderers[i.name];l?n.renderers[i.name]=function(...s){let c=i.renderer.apply(this,s);return c===!1&&(c=l.apply(this,s)),c}: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 l=n[i.level];l?l.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)}),o.extensions=n),r.renderer){const i=this.defaults.renderer||new Ec(this.defaults);for(const l in r.renderer){const s=r.renderer[l],c=l,f=i[c];i[c]=(...h)=>{let p=s.apply(i,h);return p===!1&&(p=f.apply(i,h)),p||""}}o.renderer=i}if(r.tokenizer){const i=this.defaults.tokenizer||new Sc(this.defaults);for(const l in r.tokenizer){const s=r.tokenizer[l],c=l,f=i[c];i[c]=(...h)=>{let p=s.apply(i,h);return p===!1&&(p=f.apply(i,h)),p}}o.tokenizer=i}if(r.hooks){const i=this.defaults.hooks||new zl;for(const l in r.hooks){const s=r.hooks[l],c=l,f=i[c];zl.passThroughHooks.has(l)?i[c]=h=>{if(this.defaults.async)return Promise.resolve(s.call(i,h)).then(g=>f.call(i,g));const p=s.call(i,h);return f.call(i,p)}:i[c]=(...h)=>{let p=s.apply(i,h);return p===!1&&(p=f.apply(i,h)),p}}o.hooks=i}if(r.walkTokens){const i=this.defaults.walkTokens,l=r.walkTokens;o.walkTokens=function(s){let c=[];return c.push(l.call(this,s)),i&&(c=c.concat(i.call(this,s))),c}}this.defaults={...this.defaults,...o}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}}au=new WeakSet,eh=function(t,n){return(r,o)=>{const i={...o},l={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(l.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),l.async=!0);const s=ss(this,Ic,R_).call(this,!!l.silent,!!l.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(l.hooks&&(l.hooks.options=l),l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(r):r).then(c=>t(c,l)).then(c=>l.walkTokens?Promise.all(this.walkTokens(c,l.walkTokens)).then(()=>c):c).then(c=>n(c,l)).then(c=>l.hooks?l.hooks.postprocess(c):c).catch(s);try{l.hooks&&(r=l.hooks.preprocess(r));const c=t(r,l);l.walkTokens&&this.walkTokens(c,l.walkTokens);let f=n(c,l);return l.hooks&&(f=l.hooks.postprocess(f)),f}catch(c){return s(c)}}},Ic=new WeakSet,R_=function(t,n){return r=>{if(r.message+=` +Please report this to https://github.com/markedjs/marked.`,t){const o="

    An error occurred:

    "+ir(r.message+"",!0)+"
    ";return n?Promise.resolve(o):o}if(n)return Promise.reject(r);throw r}};const Fi=new ZT;function _t(e,t){return Fi.parse(e,t)}_t.options=_t.setOptions=function(e){return Fi.setOptions(e),_t.defaults=Fi.defaults,A_(_t.defaults),_t};_t.getDefaults=vg;_t.defaults=Bi;_t.use=function(...e){return Fi.use(...e),_t.defaults=Fi.defaults,A_(_t.defaults),_t};_t.walkTokens=function(e,t){return Fi.walkTokens(e,t)};_t.parseInline=Fi.parseInline;_t.Parser=no;_t.parser=no.parse;_t.Renderer=Ec;_t.TextRenderer=yg;_t.Lexer=to;_t.lexer=to.lex;_t.Tokenizer=Sc;_t.Hooks=zl;_t.parse=_t;_t.options;_t.setOptions;_t.use;_t.walkTokens;_t.parseInline;no.parse;to.lex;/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */const{entries:$_,setPrototypeOf:ey,isFrozen:JT,getPrototypeOf:eC,getOwnPropertyDescriptor:N_}=Object;let{freeze:Mn,seal:Br,create:D_}=Object,{apply:th,construct:nh}=typeof Reflect<"u"&&Reflect;Mn||(Mn=function(t){return t});Br||(Br=function(t){return t});th||(th=function(t,n,r){return t.apply(n,r)});nh||(nh=function(t,n){return new t(...n)});const js=Or(Array.prototype.forEach),ty=Or(Array.prototype.pop),_l=Or(Array.prototype.push),Ys=Or(String.prototype.toLowerCase),Wd=Or(String.prototype.toString),tC=Or(String.prototype.match),xl=Or(String.prototype.replace),nC=Or(String.prototype.indexOf),rC=Or(String.prototype.trim),rr=Or(RegExp.prototype.test),bl=oC(TypeError);function Or(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:Ys;ey&&ey(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(JT(t)||(t[r]=i),o=i)}e[o]=!0}return e}function ia(e){const t=D_(null);for(const[n,r]of $_(e))N_(e,n)!==void 0&&(t[n]=r);return t}function Ps(e,t){for(;e!==null;){const r=N_(e,t);if(r){if(r.get)return Or(r.get);if(typeof r.value=="function")return Or(r.value)}e=eC(e)}function n(r){return console.warn("fallback value for",r),null}return n}const ny=Mn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Gd=Mn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Vd=Mn(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),iC=Mn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),qd=Mn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),aC=Mn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ry=Mn(["#text"]),oy=Mn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Kd=Mn(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),iy=Mn(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Rs=Mn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),lC=Br(/\{\{[\w\W]*|[\w\W]*\}\}/gm),uC=Br(/<%[\w\W]*|[\w\W]*%>/gm),sC=Br(/\${[\w\W]*}/gm),cC=Br(/^data-[\-\w.\u00B7-\uFFFF]/),fC=Br(/^aria-[\-\w]+$/),I_=Br(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dC=Br(/^(?:\w+script|data):/i),pC=Br(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),L_=Br(/^html$/i);var ay=Object.freeze({__proto__:null,MUSTACHE_EXPR:lC,ERB_EXPR:uC,TMPLIT_EXPR:sC,DATA_ATTR:cC,ARIA_ATTR:fC,IS_ALLOWED_URI:I_,IS_SCRIPT_OR_DATA:dC,ATTR_WHITESPACE:pC,DOCTYPE_NAME:L_});const hC=function(){return typeof window>"u"?null:window},gC=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function M_(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:hC();const t=ke=>M_(ke);if(t.version="3.0.6",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:l,Node:s,Element:c,NodeFilter:f,NamedNodeMap:h=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:p,DOMParser:g,trustedTypes:y}=e,b=c.prototype,E=Ps(b,"cloneNode"),O=Ps(b,"nextSibling"),_=Ps(b,"childNodes"),w=Ps(b,"parentNode");if(typeof l=="function"){const ke=n.createElement("template");ke.content&&ke.content.ownerDocument&&(n=ke.content.ownerDocument)}let S,k="";const{implementation:C,createNodeIterator:$,createDocumentFragment:L,getElementsByTagName:U}=n,{importNode:ce}=r;let z={};t.isSupported=typeof $_=="function"&&typeof w=="function"&&C&&C.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:K,ERB_EXPR:W,TMPLIT_EXPR:ge,DATA_ATTR:he,ARIA_ATTR:be,IS_SCRIPT_OR_DATA:De,ATTR_WHITESPACE:Be}=ay;let{IS_ALLOWED_URI:X}=ay,ne=null;const _e=et({},[...ny,...Gd,...Vd,...qd,...ry]);let N=null;const G=et({},[...oy,...Kd,...iy,...Rs]);let oe=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}})),Z=null,ie=null,re=!0,Se=!0,Pe=!1,Fe=!0,Ke=!1,He=!1,xe=!1,Xe=!1,rt=!1,Ie=!1,Ze=!1,gt=!0,Mt=!1;const jt="user-content-";let yt=!0,kt=!1,$e={},Bt=null;const se=et({},["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 Oe=null;const pt=et({},["audio","video","img","source","image","track"]);let Rt=null;const Yt=et({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Pn="http://www.w3.org/1998/Math/MathML",dn="http://www.w3.org/2000/svg",pn="http://www.w3.org/1999/xhtml";let Rn=pn,Xn=!1,A=null;const R=et({},[Pn,dn,pn],Wd);let I=null;const q=["application/xhtml+xml","text/html"],V="text/html";let de=null,ve=null;const Ge=n.createElement("form"),st=function(F){return F instanceof RegExp||F instanceof Function},Re=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ve&&ve===F)){if((!F||typeof F!="object")&&(F={}),F=ia(F),I=q.indexOf(F.PARSER_MEDIA_TYPE)===-1?I=V:I=F.PARSER_MEDIA_TYPE,de=I==="application/xhtml+xml"?Wd:Ys,ne="ALLOWED_TAGS"in F?et({},F.ALLOWED_TAGS,de):_e,N="ALLOWED_ATTR"in F?et({},F.ALLOWED_ATTR,de):G,A="ALLOWED_NAMESPACES"in F?et({},F.ALLOWED_NAMESPACES,Wd):R,Rt="ADD_URI_SAFE_ATTR"in F?et(ia(Yt),F.ADD_URI_SAFE_ATTR,de):Yt,Oe="ADD_DATA_URI_TAGS"in F?et(ia(pt),F.ADD_DATA_URI_TAGS,de):pt,Bt="FORBID_CONTENTS"in F?et({},F.FORBID_CONTENTS,de):se,Z="FORBID_TAGS"in F?et({},F.FORBID_TAGS,de):{},ie="FORBID_ATTR"in F?et({},F.FORBID_ATTR,de):{},$e="USE_PROFILES"in F?F.USE_PROFILES:!1,re=F.ALLOW_ARIA_ATTR!==!1,Se=F.ALLOW_DATA_ATTR!==!1,Pe=F.ALLOW_UNKNOWN_PROTOCOLS||!1,Fe=F.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ke=F.SAFE_FOR_TEMPLATES||!1,He=F.WHOLE_DOCUMENT||!1,rt=F.RETURN_DOM||!1,Ie=F.RETURN_DOM_FRAGMENT||!1,Ze=F.RETURN_TRUSTED_TYPE||!1,Xe=F.FORCE_BODY||!1,gt=F.SANITIZE_DOM!==!1,Mt=F.SANITIZE_NAMED_PROPS||!1,yt=F.KEEP_CONTENT!==!1,kt=F.IN_PLACE||!1,X=F.ALLOWED_URI_REGEXP||I_,Rn=F.NAMESPACE||pn,oe=F.CUSTOM_ELEMENT_HANDLING||{},F.CUSTOM_ELEMENT_HANDLING&&st(F.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(oe.tagNameCheck=F.CUSTOM_ELEMENT_HANDLING.tagNameCheck),F.CUSTOM_ELEMENT_HANDLING&&st(F.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(oe.attributeNameCheck=F.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),F.CUSTOM_ELEMENT_HANDLING&&typeof F.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(oe.allowCustomizedBuiltInElements=F.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ke&&(Se=!1),Ie&&(rt=!0),$e&&(ne=et({},[...ry]),N=[],$e.html===!0&&(et(ne,ny),et(N,oy)),$e.svg===!0&&(et(ne,Gd),et(N,Kd),et(N,Rs)),$e.svgFilters===!0&&(et(ne,Vd),et(N,Kd),et(N,Rs)),$e.mathMl===!0&&(et(ne,qd),et(N,iy),et(N,Rs))),F.ADD_TAGS&&(ne===_e&&(ne=ia(ne)),et(ne,F.ADD_TAGS,de)),F.ADD_ATTR&&(N===G&&(N=ia(N)),et(N,F.ADD_ATTR,de)),F.ADD_URI_SAFE_ATTR&&et(Rt,F.ADD_URI_SAFE_ATTR,de),F.FORBID_CONTENTS&&(Bt===se&&(Bt=ia(Bt)),et(Bt,F.FORBID_CONTENTS,de)),yt&&(ne["#text"]=!0),He&&et(ne,["html","head","body"]),ne.table&&(et(ne,["tbody"]),delete Z.tbody),F.TRUSTED_TYPES_POLICY){if(typeof F.TRUSTED_TYPES_POLICY.createHTML!="function")throw bl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof F.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw bl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=F.TRUSTED_TYPES_POLICY,k=S.createHTML("")}else S===void 0&&(S=gC(y,o)),S!==null&&typeof k=="string"&&(k=S.createHTML(""));Mn&&Mn(F),ve=F}},ct=et({},["mi","mo","mn","ms","mtext"]),lt=et({},["foreignobject","desc","title","annotation-xml"]),Ft=et({},["title","style","font","a","script"]),ut=et({},Gd);et(ut,Vd),et(ut,iC);const Ht=et({},qd);et(Ht,aC);const bt=function(F){let ae=w(F);(!ae||!ae.tagName)&&(ae={namespaceURI:Rn,tagName:"template"});const ye=Ys(F.tagName),vt=Ys(ae.tagName);return A[F.namespaceURI]?F.namespaceURI===dn?ae.namespaceURI===pn?ye==="svg":ae.namespaceURI===Pn?ye==="svg"&&(vt==="annotation-xml"||ct[vt]):!!ut[ye]:F.namespaceURI===Pn?ae.namespaceURI===pn?ye==="math":ae.namespaceURI===dn?ye==="math"&<[vt]:!!Ht[ye]:F.namespaceURI===pn?ae.namespaceURI===dn&&!lt[vt]||ae.namespaceURI===Pn&&!ct[vt]?!1:!Ht[ye]&&(Ft[ye]||!ut[ye]):!!(I==="application/xhtml+xml"&&A[F.namespaceURI]):!1},Tt=function(F){_l(t.removed,{element:F});try{F.parentNode.removeChild(F)}catch{F.remove()}},bn=function(F,ae){try{_l(t.removed,{attribute:ae.getAttributeNode(F),from:ae})}catch{_l(t.removed,{attribute:null,from:ae})}if(ae.removeAttribute(F),F==="is"&&!N[F])if(rt||Ie)try{Tt(ae)}catch{}else try{ae.setAttribute(F,"")}catch{}},Un=function(F){let ae=null,ye=null;if(Xe)F=""+F;else{const rn=tC(F,/^[\r\n\t ]+/);ye=rn&&rn[0]}I==="application/xhtml+xml"&&Rn===pn&&(F=''+F+"");const vt=S?S.createHTML(F):F;if(Rn===pn)try{ae=new g().parseFromString(vt,I)}catch{}if(!ae||!ae.documentElement){ae=C.createDocument(Rn,"template",null);try{ae.documentElement.innerHTML=Xn?k:vt}catch{}}const Qe=ae.body||ae.documentElement;return F&&ye&&Qe.insertBefore(n.createTextNode(ye),Qe.childNodes[0]||null),Rn===pn?U.call(ae,He?"html":"body")[0]:He?ae.documentElement:Qe},pr=function(F){return $.call(F.ownerDocument||F,F,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT,null)},Zn=function(F){return F instanceof p&&(typeof F.nodeName!="string"||typeof F.textContent!="string"||typeof F.removeChild!="function"||!(F.attributes instanceof h)||typeof F.removeAttribute!="function"||typeof F.setAttribute!="function"||typeof F.namespaceURI!="string"||typeof F.insertBefore!="function"||typeof F.hasChildNodes!="function")},vn=function(F){return typeof s=="function"&&F instanceof s},Xt=function(F,ae,ye){z[F]&&js(z[F],vt=>{vt.call(t,ae,ye,ve)})},Wr=function(F){let ae=null;if(Xt("beforeSanitizeElements",F,null),Zn(F))return Tt(F),!0;const ye=de(F.nodeName);if(Xt("uponSanitizeElement",F,{tagName:ye,allowedTags:ne}),F.hasChildNodes()&&!vn(F.firstElementChild)&&rr(/<[/\w]/g,F.innerHTML)&&rr(/<[/\w]/g,F.textContent))return Tt(F),!0;if(!ne[ye]||Z[ye]){if(!Z[ye]&&pi(ye)&&(oe.tagNameCheck instanceof RegExp&&rr(oe.tagNameCheck,ye)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(ye)))return!1;if(yt&&!Bt[ye]){const vt=w(F)||F.parentNode,Qe=_(F)||F.childNodes;if(Qe&&vt){const rn=Qe.length;for(let Zt=rn-1;Zt>=0;--Zt)vt.insertBefore(E(Qe[Zt],!0),O(F))}}return Tt(F),!0}return F instanceof c&&!bt(F)||(ye==="noscript"||ye==="noembed"||ye==="noframes")&&rr(/<\/no(script|embed|frames)/i,F.innerHTML)?(Tt(F),!0):(Ke&&F.nodeType===3&&(ae=F.textContent,js([K,W,ge],vt=>{ae=xl(ae,vt," ")}),F.textContent!==ae&&(_l(t.removed,{element:F.cloneNode()}),F.textContent=ae)),Xt("afterSanitizeElements",F,null),!1)},hr=function(F,ae,ye){if(gt&&(ae==="id"||ae==="name")&&(ye in n||ye in Ge))return!1;if(!(Se&&!ie[ae]&&rr(he,ae))){if(!(re&&rr(be,ae))){if(!N[ae]||ie[ae]){if(!(pi(F)&&(oe.tagNameCheck instanceof RegExp&&rr(oe.tagNameCheck,F)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(F))&&(oe.attributeNameCheck instanceof RegExp&&rr(oe.attributeNameCheck,ae)||oe.attributeNameCheck instanceof Function&&oe.attributeNameCheck(ae))||ae==="is"&&oe.allowCustomizedBuiltInElements&&(oe.tagNameCheck instanceof RegExp&&rr(oe.tagNameCheck,ye)||oe.tagNameCheck instanceof Function&&oe.tagNameCheck(ye))))return!1}else if(!Rt[ae]){if(!rr(X,xl(ye,Be,""))){if(!((ae==="src"||ae==="xlink:href"||ae==="href")&&F!=="script"&&nC(ye,"data:")===0&&Oe[F])){if(!(Pe&&!rr(De,xl(ye,Be,"")))){if(ye)return!1}}}}}}return!0},pi=function(F){return F.indexOf("-")>0},ht=function(F){Xt("beforeSanitizeAttributes",F,null);const{attributes:ae}=F;if(!ae)return;const ye={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:N};let vt=ae.length;for(;vt--;){const Qe=ae[vt],{name:rn,namespaceURI:Zt,value:Gr}=Qe,ao=de(rn);let Ct=rn==="value"?Gr:rC(Gr);if(ye.attrName=ao,ye.attrValue=Ct,ye.keepAttr=!0,ye.forceKeepAttr=void 0,Xt("uponSanitizeAttribute",F,ye),Ct=ye.attrValue,ye.forceKeepAttr||(bn(rn,F),!ye.keepAttr))continue;if(!Fe&&rr(/\/>/i,Ct)){bn(rn,F);continue}Ke&&js([K,W,ge],qa=>{Ct=xl(Ct,qa," ")});const Va=de(F.nodeName);if(hr(Va,ao,Ct)){if(Mt&&(ao==="id"||ao==="name")&&(bn(rn,F),Ct=jt+Ct),S&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!Zt)switch(y.getAttributeType(Va,ao)){case"TrustedHTML":{Ct=S.createHTML(Ct);break}case"TrustedScriptURL":{Ct=S.createScriptURL(Ct);break}}try{Zt?F.setAttributeNS(Zt,rn,Ct):F.setAttribute(rn,Ct),ty(t.removed)}catch{}}}Xt("afterSanitizeAttributes",F,null)},mt=function ke(F){let ae=null;const ye=pr(F);for(Xt("beforeSanitizeShadowDOM",F,null);ae=ye.nextNode();)Xt("uponSanitizeShadowNode",ae,null),!Wr(ae)&&(ae.content instanceof i&&ke(ae.content),ht(ae));Xt("afterSanitizeShadowDOM",F,null)};return t.sanitize=function(ke){let F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ae=null,ye=null,vt=null,Qe=null;if(Xn=!ke,Xn&&(ke=""),typeof ke!="string"&&!vn(ke))if(typeof ke.toString=="function"){if(ke=ke.toString(),typeof ke!="string")throw bl("dirty is not a string, aborting")}else throw bl("toString is not a function");if(!t.isSupported)return ke;if(xe||Re(F),t.removed=[],typeof ke=="string"&&(kt=!1),kt){if(ke.nodeName){const Gr=de(ke.nodeName);if(!ne[Gr]||Z[Gr])throw bl("root node is forbidden and cannot be sanitized in-place")}}else if(ke instanceof s)ae=Un(""),ye=ae.ownerDocument.importNode(ke,!0),ye.nodeType===1&&ye.nodeName==="BODY"||ye.nodeName==="HTML"?ae=ye:ae.appendChild(ye);else{if(!rt&&!Ke&&!He&&ke.indexOf("<")===-1)return S&&Ze?S.createHTML(ke):ke;if(ae=Un(ke),!ae)return rt?null:Ze?k:""}ae&&Xe&&Tt(ae.firstChild);const rn=pr(kt?ke:ae);for(;vt=rn.nextNode();)Wr(vt)||(vt.content instanceof i&&mt(vt.content),ht(vt));if(kt)return ke;if(rt){if(Ie)for(Qe=L.call(ae.ownerDocument);ae.firstChild;)Qe.appendChild(ae.firstChild);else Qe=ae;return(N.shadowroot||N.shadowrootmode)&&(Qe=ce.call(r,Qe,!0)),Qe}let Zt=He?ae.outerHTML:ae.innerHTML;return He&&ne["!doctype"]&&ae.ownerDocument&&ae.ownerDocument.doctype&&ae.ownerDocument.doctype.name&&rr(L_,ae.ownerDocument.doctype.name)&&(Zt=" +`+Zt),Ke&&js([K,W,ge],Gr=>{Zt=xl(Zt,Gr," ")}),S&&Ze?S.createHTML(Zt):Zt},t.setConfig=function(){let ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Re(ke),xe=!0},t.clearConfig=function(){ve=null,xe=!1},t.isValidAttribute=function(ke,F,ae){ve||Re({});const ye=de(ke),vt=de(F);return hr(ye,vt,ae)},t.addHook=function(ke,F){typeof F=="function"&&(z[ke]=z[ke]||[],_l(z[ke],F))},t.removeHook=function(ke){if(z[ke])return ty(z[ke])},t.removeHooks=function(ke){z[ke]&&(z[ke]=[])},t.removeAllHooks=function(){z={}},t}var mC=M_();function vC(e){const[t,n]=j.useState(null),r=async o=>{n({score:o,inflight:!0}),await fetch("/runs/feedback",{method:"POST",body:JSON.stringify({run_id:e.runId,key:"user_score",score:o}),headers:{"Content-Type":"application/json"}}),n({score:o,inflight:!1})};return M.jsxs("div",{className:"flex mt-2 gap-2 flex-row",children:[M.jsx("button",{type:"button",className:"rounded-full p-1 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50",onClick:()=>r(1),children:(t==null?void 0:t.score)===1?t!=null&&t.inflight?M.jsx(V0,{className:"h-5 w-5","aria-hidden":"true"}):M.jsx(G0,{className:"h-5 w-5","aria-hidden":"true"}):M.jsx(W2,{className:"h-5 w-5","aria-hidden":"true"})}),M.jsx("button",{type:"button",className:"rounded-full p-1 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50",onClick:()=>r(0),children:(t==null?void 0:t.score)===0?t!=null&&t.inflight?M.jsx(V0,{className:"h-5 w-5","aria-hidden":"true"}):M.jsx(G0,{className:"h-5 w-5","aria-hidden":"true"}):M.jsx(U2,{className:"h-5 w-5","aria-hidden":"true"})})]})}function yC(e){try{return JSON.parse(e)}catch{return{}}}function ly(e){return M.jsxs(M.Fragment,{children:[e.call&&M.jsx("span",{className:"text-gray-900 whitespace-pre-wrap break-words mr-2",children:"Use"}),e.name&&M.jsx("span",{className:"inline-flex items-center rounded-md bg-gray-50 px-2 py-1 text-sm font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 relative -top-[1px] mr-2",children:e.name}),!e.call&&M.jsx("span",{className:On("inline-flex items-center rounded-md bg-gray-50 px-2 py-1 text-sm font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 cursor-pointer relative top-1",e.open&&"mb-2"),onClick:t=>{var n;t.preventDefault(),t.stopPropagation(),(n=e.setOpen)==null||n.call(e,!e.open)},children:M.jsx(I2,{className:On("h-5 w-5 transition",e.open?"rotate-180":"")})}),e.args&&M.jsx("div",{className:"text-gray-900 mt-2 whitespace-pre-wrap break-words",children:M.jsx("div",{className:"ring-1 ring-gray-300 rounded",children:M.jsx("table",{className:"divide-y divide-gray-300",children:M.jsx("tbody",{children:Object.entries(yC(e.args)).map(([t,n],r)=>M.jsxs("tr",{children:[M.jsx("td",{className:On(r===0?"":"border-t border-transparent","py-1 px-3 table-cell text-sm border-r border-r-gray-300"),children:M.jsx("div",{className:"font-medium text-gray-500",children:t})}),M.jsx("td",{className:On(r===0?"":"border-t border-gray-200","py-1 px-3 table-cell"),children:O_(n)})]},r))})})})})]})}function wC(e){var r;const[t,n]=j.useState(!1);return M.jsxs("div",{className:"flex flex-col mb-8",children:[M.jsxs("div",{className:"leading-6 flex flex-row",children:[M.jsx("div",{className:On("font-medium text-sm text-gray-400 uppercase mr-2 mt-1 w-24 flex flex-col",e.type==="function"&&"mt-2"),children:e.type}),M.jsxs("div",{className:"flex-1",children:[e.type==="function"&&M.jsx(ly,{call:!1,name:e.name,open:t,setOpen:n}),((r=e.additional_kwargs)==null?void 0:r.function_call)&&M.jsx(ly,{call:!0,name:e.additional_kwargs.function_call.name,args:e.additional_kwargs.function_call.arguments}),e.type!=="function"||t?typeof e.content=="string"?M.jsx("div",{className:"text-gray-900 prose",dangerouslySetInnerHTML:{__html:mC.sanitize(_t(e.content)).trim()}}):M.jsx("div",{className:"text-gray-900 prose",children:O_(e.content)}):!1]})]}),e.runId&&M.jsx("div",{className:"mt-2 pl-[100px]",children:M.jsx(vC,{runId:e.runId})})]})}function _C(e){var n,r,o;const t=iT(e.chat.thread_id,e.stream);return j.useEffect(()=>{scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},[t]),M.jsxs("div",{className:"flex-1 flex flex-col items-stretch pb-[76px] pt-2",children:[t==null?void 0:t.map((i,l)=>{var s,c;return j.createElement(wC,{...i,key:l,runId:l===t.length-1&&((s=e.stream)==null?void 0:s.status)==="done"?(c=e.stream)==null?void 0:c.run_id:void 0})}),(((n=e.stream)==null?void 0:n.status)==="inflight"||t===null)&&M.jsx("div",{className:"leading-6 mb-2 animate-pulse font-black text-gray-400 text-lg",children:"..."}),((r=e.stream)==null?void 0:r.status)==="error"&&M.jsx("div",{className:"flex items-center rounded-md bg-yellow-50 px-2 py-1 text-xs font-medium text-yellow-800 ring-1 ring-inset ring-yellow-600/20",children:"An error has occurred. Please try again."}),M.jsx("div",{className:"fixed left-0 lg:left-72 bottom-0 right-0 p-4",children:M.jsx(C_,{onSubmit:e.startStream,disabled:((o=e.stream)==null?void 0:o.status)==="inflight"})})]})}function xC(e){var t;return M.jsxs(M.Fragment,{children:[M.jsxs("div",{onClick:()=>e.enterChat(null),className:On(e.currentChat===null?"bg-gray-50 text-indigo-600":"text-gray-700 hover:text-indigo-600 hover:bg-gray-50","group flex gap-x-3 rounded-md -mx-2 p-2 text-sm leading-6 font-semibold cursor-pointer"),children:[M.jsx("span",{className:On(e.currentChat===null?"text-indigo-600 border-indigo-600":"text-gray-400 border-gray-200 group-hover:border-indigo-600 group-hover:text-indigo-600","flex h-6 w-6 shrink-0 items-center justify-center rounded-lg border text-[0.625rem] font-medium bg-white"),children:M.jsx(__,{className:"h-4 w-4"})}),M.jsx("span",{className:"truncate",children:"New Chat"})]}),M.jsx("div",{className:"text-xs font-semibold leading-6 text-gray-400 mt-4",children:"Your chats"}),M.jsx("ul",{role:"list",className:"-mx-2 mt-2 space-y-1",children:((t=e.chats)==null?void 0:t.map(n=>{var r;return M.jsx("li",{children:M.jsxs("div",{onClick:()=>e.enterChat(n.thread_id),className:On(n===e.currentChat?"bg-gray-50 text-indigo-600":"text-gray-700 hover:text-indigo-600 hover:bg-gray-50","group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold cursor-pointer"),children:[M.jsx("span",{className:On(n===e.currentChat?"text-indigo-600 border-indigo-600":"text-gray-400 border-gray-200 group-hover:border-indigo-600 group-hover:text-indigo-600","flex h-6 w-6 shrink-0 items-center justify-center rounded-lg border text-[0.625rem] font-medium bg-white"),children:((r=n.name)==null?void 0:r[0])??" "}),M.jsx("span",{className:"truncate",children:n.name})]})},n.thread_id)}))??M.jsx("li",{className:"leading-6 p-2 animate-pulse font-black text-gray-400 text-lg",children:"..."})})]})}var bC=Object.defineProperty,SC=(e,t,n)=>t in e?bC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qd=(e,t,n)=>(SC(e,typeof t!="symbol"?t+"":t,n),n);let EC=class{constructor(){Qd(this,"current",this.detect()),Qd(this,"handoffState","pending"),Qd(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},bo=new EC,Ar=(e,t)=>{bo.isServer?j.useEffect(e,t):j.useLayoutEffect(e,t)};function So(e){let t=j.useRef(e);return Ar(()=>{t.current=e},[e]),t}function Jc(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Hi(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Jc(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=Hi();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function wg(){let[e]=j.useState(Hi);return j.useEffect(()=>()=>e.dispose(),[e]),e}let Ut=function(e){let t=So(e);return ot.useCallback((...n)=>t.current(...n),[t])};function kC(){let e=typeof document>"u";return"useSyncExternalStore"in Ul?(t=>t.useSyncExternalStore)(Ul)(()=>()=>{},()=>!1,()=>!e):!1}function Ia(){let e=kC(),[t,n]=j.useState(bo.isHandoffComplete);return t&&bo.isHandoffComplete===!1&&n(!1),j.useEffect(()=>{t!==!0&&n(!0)},[t]),j.useEffect(()=>bo.handoff(),[]),e?!1:t}var uy;let La=(uy=ot.useId)!=null?uy:function(){let e=Ia(),[t,n]=ot.useState(e?()=>bo.nextId():null);return Ar(()=>{t===null&&n(bo.nextId())},[t]),t!=null?""+t:void 0};function An(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,An),r}function F_(e){return bo.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let rh=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ei=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Ei||{}),z_=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(z_||{}),TC=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(TC||{});function CC(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(rh)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var U_=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(U_||{});function OC(e,t=0){var n;return e===((n=F_(e))==null?void 0:n.body)?!1:An(t,{0(){return e.matches(rh)},1(){let r=e;for(;r!==null;){if(r.matches(rh))return!0;r=r.parentElement}return!1}})}var AC=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(AC||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function $i(e){e==null||e.focus({preventScroll:!0})}let jC=["textarea","input"].join(",");function PC(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,jC))!=null?n:!1}function RC(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let l=o.compareDocumentPosition(i);return l&Node.DOCUMENT_POSITION_FOLLOWING?-1:l&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Xs(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,l=Array.isArray(e)?n?RC(e):e:CC(e);o.length>0&&l.length>1&&(l=l.filter(y=>!o.includes(y))),r=r??i.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,l.indexOf(r))-1;if(t&4)return Math.max(0,l.indexOf(r))+1;if(t&8)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=t&32?{preventScroll:!0}:{},h=0,p=l.length,g;do{if(h>=p||h+p<=0)return 0;let y=c+h;if(t&16)y=(y+p)%p;else{if(y<0)return 3;if(y>=p)return 1}g=l[y],g==null||g.focus(f),h+=s}while(g!==i.activeElement);return t&6&&PC(g)&&g.select(),2}function $s(e,t,n){let r=So(t);j.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(e,o,n),()=>document.removeEventListener(e,o,n)},[e,n])}function B_(e,t,n){let r=So(t);j.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(e,o,n),()=>window.removeEventListener(e,o,n)},[e,n])}function $C(e,t,n=!0){let r=j.useRef(!1);j.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function o(l,s){if(!r.current||l.defaultPrevented)return;let c=s(l);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let f=function h(p){return typeof p=="function"?h(p()):Array.isArray(p)||p instanceof Set?p:[p]}(e);for(let h of f){if(h===null)continue;let p=h instanceof HTMLElement?h:h.current;if(p!=null&&p.contains(c)||l.composed&&l.composedPath().includes(p))return}return!OC(c,U_.Loose)&&c.tabIndex!==-1&&l.preventDefault(),t(l,c)}let i=j.useRef(null);$s("pointerdown",l=>{var s,c;r.current&&(i.current=((c=(s=l.composedPath)==null?void 0:s.call(l))==null?void 0:c[0])||l.target)},!0),$s("mousedown",l=>{var s,c;r.current&&(i.current=((c=(s=l.composedPath)==null?void 0:s.call(l))==null?void 0:c[0])||l.target)},!0),$s("click",l=>{i.current&&(o(l,()=>i.current),i.current=null)},!0),$s("touchend",l=>o(l,()=>l.target instanceof HTMLElement?l.target:null),!0),B_("blur",l=>o(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}let H_=Symbol();function NC(e,t=!0){return Object.assign(e,{[H_]:t})}function Hr(...e){let t=j.useRef(e);j.useEffect(()=>{t.current=e},[e]);let n=Ut(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[H_]))?void 0:n}function kc(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Tc=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Tc||{}),Jo=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Jo||{});function jr({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l}){let s=W_(t,e);if(i)return Ns(s,n,r,l);let c=o??0;if(c&2){let{static:f=!1,...h}=s;if(f)return Ns(h,n,r,l)}if(c&1){let{unmount:f=!0,...h}=s;return An(f?0:1,{0(){return null},1(){return Ns({...h,hidden:!0,style:{display:"none"}},n,r,l)}})}return Ns(s,n,r,l)}function Ns(e,t={},n,r){let{as:o=n,children:i,refName:l="ref",...s}=Yd(e,["unmount","static"]),c=e.ref!==void 0?{[l]:e.ref}:{},f=typeof i=="function"?i(t):i;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(t));let h={};if(t){let p=!1,g=[];for(let[y,b]of Object.entries(t))typeof b=="boolean"&&(p=!0),b===!0&&g.push(y);p&&(h["data-headlessui-state"]=g.join(" "))}if(o===j.Fragment&&Object.keys(sy(s)).length>0){if(!j.isValidElement(f)||Array.isArray(f)&&f.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map(b=>` - ${b}`).join(` +`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(b=>` - ${b}`).join(` +`)].join(` +`));let p=f.props,g=typeof(p==null?void 0:p.className)=="function"?(...b)=>kc(p==null?void 0:p.className(...b),s.className):kc(p==null?void 0:p.className,s.className),y=g?{className:g}:{};return j.cloneElement(f,Object.assign({},W_(f.props,sy(Yd(s,["ref"]))),h,c,DC(f.ref,c.ref),y))}return j.createElement(o,Object.assign({},Yd(s,["ref"]),o!==j.Fragment&&c,o!==j.Fragment&&h),f)}function DC(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}}function W_(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](o,...i){let l=n[r];for(let s of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});return t}function dr(e){var t;return Object.assign(j.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function sy(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Yd(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function IC(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&LC(n)?!1:r}function LC(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let MC="div";var Cc=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Cc||{});function FC(e,t){let{features:n=1,...r}=e,o={ref:t,"aria-hidden":(n&2)===2?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return jr({ourProps:o,theirProps:r,slot:{},defaultTag:MC,name:"Hidden"})}let oh=dr(FC),_g=j.createContext(null);_g.displayName="OpenClosedContext";var ar=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ar||{});function xg(){return j.useContext(_g)}function zC({value:e,children:t}){return ot.createElement(_g.Provider,{value:e},t)}var G_=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(G_||{});function bg(e,t){let n=j.useRef([]),r=Ut(e);j.useEffect(()=>{let o=[...n.current];for(let[i,l]of t.entries())if(n.current[i]!==l){let s=r(t,o);return n.current=t,s}},[r,...t])}function UC(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function du(...e){return j.useMemo(()=>F_(...e),[...e])}var jl=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(jl||{});function BC(){let e=j.useRef(0);return B_("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function pu(){let e=j.useRef(!1);return Ar(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function V_(e,t,n,r){let o=So(n);j.useEffect(()=>{e=e??window;function i(l){o.current(l)}return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},[e,t,r])}function HC(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}function q_(e){let t=Ut(e),n=j.useRef(!1);j.useEffect(()=>(n.current=!1,()=>{n.current=!0,Jc(()=>{n.current&&t()})}),[t])}function K_(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let WC="div";var Q_=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(Q_||{});function GC(e,t){let n=j.useRef(null),r=Hr(n,t),{initialFocus:o,containers:i,features:l=30,...s}=e;Ia()||(l=1);let c=du(n);KC({ownerDocument:c},!!(l&16));let f=QC({ownerDocument:c,container:n,initialFocus:o},!!(l&2));YC({ownerDocument:c,container:n,containers:i,previousActiveElement:f},!!(l&8));let h=BC(),p=Ut(E=>{let O=n.current;O&&(_=>_())(()=>{An(h.current,{[jl.Forwards]:()=>{Xs(O,Ei.First,{skipElements:[E.relatedTarget]})},[jl.Backwards]:()=>{Xs(O,Ei.Last,{skipElements:[E.relatedTarget]})}})})}),g=wg(),y=j.useRef(!1),b={ref:r,onKeyDown(E){E.key=="Tab"&&(y.current=!0,g.requestAnimationFrame(()=>{y.current=!1}))},onBlur(E){let O=K_(i);n.current instanceof HTMLElement&&O.add(n.current);let _=E.relatedTarget;_ instanceof HTMLElement&&_.dataset.headlessuiFocusGuard!=="true"&&(Y_(O,_)||(y.current?Xs(n.current,An(h.current,{[jl.Forwards]:()=>Ei.Next,[jl.Backwards]:()=>Ei.Previous})|Ei.WrapAround,{relativeTo:E.target}):E.target instanceof HTMLElement&&$i(E.target)))}};return ot.createElement(ot.Fragment,null,!!(l&4)&&ot.createElement(oh,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:Cc.Focusable}),jr({ourProps:b,theirProps:s,defaultTag:WC,name:"FocusTrap"}),!!(l&4)&&ot.createElement(oh,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:p,features:Cc.Focusable}))}let VC=dr(GC),Sl=Object.assign(VC,{features:Q_}),Yo=[];HC(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Yo[0]!==t.target&&(Yo.unshift(t.target),Yo=Yo.filter(n=>n!=null&&n.isConnected),Yo.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function qC(e=!0){let t=j.useRef(Yo.slice());return bg(([n],[r])=>{r===!0&&n===!1&&Jc(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=Yo.slice())},[e,Yo,t]),Ut(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function KC({ownerDocument:e},t){let n=qC(t);bg(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&$i(n())},[t]),q_(()=>{t&&$i(n())})}function QC({ownerDocument:e,container:t,initialFocus:n},r){let o=j.useRef(null),i=pu();return bg(()=>{if(!r)return;let l=t.current;l&&Jc(()=>{if(!i.current)return;let s=e==null?void 0:e.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===s){o.current=s;return}}else if(l.contains(s)){o.current=s;return}n!=null&&n.current?$i(n.current):Xs(l,Ei.First)===z_.Error&&console.warn("There are no focusable elements inside the "),o.current=e==null?void 0:e.activeElement})},[r]),o}function YC({ownerDocument:e,container:t,containers:n,previousActiveElement:r},o){let i=pu();V_(e==null?void 0:e.defaultView,"focus",l=>{if(!o||!i.current)return;let s=K_(n);t.current instanceof HTMLElement&&s.add(t.current);let c=r.current;if(!c)return;let f=l.target;f&&f instanceof HTMLElement?Y_(s,f)?(r.current=f,$i(f)):(l.preventDefault(),l.stopPropagation(),$i(c)):$i(r.current)},!0)}function Y_(e,t){for(let n of e)if(n.contains(t))return!0;return!1}let X_=j.createContext(!1);function XC(){return j.useContext(X_)}function ih(e){return ot.createElement(X_.Provider,{value:e.force},e.children)}function ZC(e){let t=XC(),n=j.useContext(Z_),r=du(e),[o,i]=j.useState(()=>{if(!t&&n!==null||bo.isServer)return null;let l=r==null?void 0:r.getElementById("headlessui-portal-root");if(l)return l;if(r===null)return null;let s=r.createElement("div");return s.setAttribute("id","headlessui-portal-root"),r.body.appendChild(s)});return j.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),j.useEffect(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let JC=j.Fragment;function eO(e,t){let n=e,r=j.useRef(null),o=Hr(NC(h=>{r.current=h}),t),i=du(r),l=ZC(r),[s]=j.useState(()=>{var h;return bo.isServer?null:(h=i==null?void 0:i.createElement("div"))!=null?h:null}),c=j.useContext(ah),f=Ia();return Ar(()=>{!l||!s||l.contains(s)||(s.setAttribute("data-headlessui-portal",""),l.appendChild(s))},[l,s]),Ar(()=>{if(s&&c)return c.register(s)},[c,s]),q_(()=>{var h;!l||!s||(s instanceof Node&&l.contains(s)&&l.removeChild(s),l.childNodes.length<=0&&((h=l.parentElement)==null||h.removeChild(l)))}),f?!l||!s?null:w_.createPortal(jr({ourProps:{ref:o},theirProps:n,defaultTag:JC,name:"Portal"}),s):null}let tO=j.Fragment,Z_=j.createContext(null);function nO(e,t){let{target:n,...r}=e,o={ref:Hr(t)};return ot.createElement(Z_.Provider,{value:n},jr({ourProps:o,theirProps:r,defaultTag:tO,name:"Popover.Group"}))}let ah=j.createContext(null);function rO(){let e=j.useContext(ah),t=j.useRef([]),n=Ut(i=>(t.current.push(i),e&&e.register(i),()=>r(i))),r=Ut(i=>{let l=t.current.indexOf(i);l!==-1&&t.current.splice(l,1),e&&e.unregister(i)}),o=j.useMemo(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,j.useMemo(()=>function({children:i}){return ot.createElement(ah.Provider,{value:o},i)},[o])]}let oO=dr(eO),iO=dr(nO),lh=Object.assign(oO,{Group:iO}),J_=j.createContext(null);function ex(){let e=j.useContext(J_);if(e===null){let t=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,ex),t}return e}function aO(){let[e,t]=j.useState([]);return[e.length>0?e.join(" "):void 0,j.useMemo(()=>function(n){let r=Ut(i=>(t(l=>[...l,i]),()=>t(l=>{let s=l.slice(),c=s.indexOf(i);return c!==-1&&s.splice(c,1),s}))),o=j.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props}),[r,n.slot,n.name,n.props]);return ot.createElement(J_.Provider,{value:o},n.children)},[t])]}let lO="p";function uO(e,t){let n=La(),{id:r=`headlessui-description-${n}`,...o}=e,i=ex(),l=Hr(t);Ar(()=>i.register(r),[r,i.register]);let s={ref:l,...i.props,id:r};return jr({ourProps:s,theirProps:o,slot:i.slot||{},defaultTag:lO,name:i.name||"Description"})}let sO=dr(uO),cO=Object.assign(sO,{}),Sg=j.createContext(()=>{});Sg.displayName="StackContext";var uh=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(uh||{});function fO(){return j.useContext(Sg)}function dO({children:e,onUpdate:t,type:n,element:r,enabled:o}){let i=fO(),l=Ut((...s)=>{t==null||t(...s),i(...s)});return Ar(()=>{let s=o===void 0||o===!0;return s&&l(0,n,r),()=>{s&&l(1,n,r)}},[l,n,r,o]),ot.createElement(Sg.Provider,{value:l},e)}function pO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const hO=typeof Object.is=="function"?Object.is:pO,{useState:gO,useEffect:mO,useLayoutEffect:vO,useDebugValue:yO}=Ul;function wO(e,t,n){const r=t(),[{inst:o},i]=gO({inst:{value:r,getSnapshot:t}});return vO(()=>{o.value=r,o.getSnapshot=t,Xd(o)&&i({inst:o})},[e,r,t]),mO(()=>(Xd(o)&&i({inst:o}),e(()=>{Xd(o)&&i({inst:o})})),[e]),yO(r),r}function Xd(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!hO(n,r)}catch{return!0}}function _O(e,t,n){return t()}const xO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bO=!xO,SO=bO?_O:wO,EO="useSyncExternalStore"in Ul?(e=>e.useSyncExternalStore)(Ul):SO;function kO(e){return EO(e.subscribe,e.getSnapshot,e.getSnapshot)}function TO(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let l=t[o].call(n,...i);l&&(n=l,r.forEach(s=>s()))}}}function CO(){let e;return{before({doc:t}){var n;let r=t.documentElement;e=((n=t.defaultView)!=null?n:window).innerWidth-r.clientWidth},after({doc:t,d:n}){let r=t.documentElement,o=r.clientWidth-r.offsetWidth,i=e-o;n.style(r,"paddingRight",`${i}px`)}}}function OO(){if(!UC())return{};let e;return{before(){e=window.pageYOffset},after({doc:t,d:n,meta:r}){function o(i){return r.containers.flatMap(l=>l()).some(l=>l.contains(i))}n.microTask(()=>{if(window.getComputedStyle(t.documentElement).scrollBehavior!=="auto"){let l=Hi();l.style(t.documentElement,"scroll-behavior","auto"),n.add(()=>n.microTask(()=>l.dispose()))}n.style(t.body,"marginTop",`-${e}px`),window.scrollTo(0,0);let i=null;n.addEventListener(t,"click",l=>{if(l.target instanceof HTMLElement)try{let s=l.target.closest("a");if(!s)return;let{hash:c}=new URL(s.href),f=t.querySelector(c);f&&!o(f)&&(i=f)}catch{}},!0),n.addEventListener(t,"touchmove",l=>{l.target instanceof HTMLElement&&!o(l.target)&&l.preventDefault()},{passive:!1}),n.add(()=>{window.scrollTo(0,window.pageYOffset+e),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}}function AO(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function jO(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let ji=TO(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Hi(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:jO(n)},o=[OO(),CO(),AO()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});ji.subscribe(()=>{let e=ji.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&ji.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&ji.dispatch("TEARDOWN",n)}});function PO(e,t,n){let r=kO(ji),o=e?r.get(e):void 0,i=o?o.count>0:!1;return Ar(()=>{if(!(!e||!t))return ji.dispatch("PUSH",e,n),()=>ji.dispatch("POP",e,n)},[t,e]),i}let Zd=new Map,El=new Map;function cy(e,t=!0){Ar(()=>{var n;if(!t)return;let r=typeof e=="function"?e():e.current;if(!r)return;function o(){var l;if(!r)return;let s=(l=El.get(r))!=null?l:1;if(s===1?El.delete(r):El.set(r,s-1),s!==1)return;let c=Zd.get(r);c&&(c["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",c["aria-hidden"]),r.inert=c.inert,Zd.delete(r))}let i=(n=El.get(r))!=null?n:0;return El.set(r,i+1),i!==0||(Zd.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),o},[e,t])}function RO({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let o=j.useRef((r=n==null?void 0:n.current)!=null?r:null),i=du(o),l=Ut(()=>{var s;let c=[];for(let f of e)f!==null&&(f instanceof HTMLElement?c.push(f):"current"in f&&f.current instanceof HTMLElement&&c.push(f.current));if(t!=null&&t.current)for(let f of t.current)c.push(f);for(let f of(s=i==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])f!==document.body&&f!==document.head&&f instanceof HTMLElement&&f.id!=="headlessui-portal-root"&&(f.contains(o.current)||c.some(h=>f.contains(h))||c.push(f));return c});return{resolveContainers:l,contains:Ut(s=>l().some(c=>c.contains(s))),mainTreeNodeRef:o,MainTreeNode:j.useMemo(()=>function(){return n!=null?null:ot.createElement(oh,{features:Cc.Hidden,ref:o})},[o,n])}}var $O=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))($O||{}),NO=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(NO||{});let DO={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Oc=j.createContext(null);Oc.displayName="DialogContext";function hu(e){let t=j.useContext(Oc);if(t===null){let n=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,hu),n}return t}function IO(e,t,n=()=>[document.body]){PO(e,t,r=>{var o;return{containers:[...(o=r.containers)!=null?o:[],n]}})}function LO(e,t){return An(t.type,DO,e,t)}let MO="div",FO=Tc.RenderStrategy|Tc.Static;function zO(e,t){var n;let r=La(),{id:o=`headlessui-dialog-${r}`,open:i,onClose:l,initialFocus:s,__demoMode:c=!1,...f}=e,[h,p]=j.useState(0),g=xg();i===void 0&&g!==null&&(i=(g&ar.Open)===ar.Open);let y=j.useRef(null),b=Hr(y,t),E=du(y),O=e.hasOwnProperty("open")||g!==null,_=e.hasOwnProperty("onClose");if(!O&&!_)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!O)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!_)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof i!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if(typeof l!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${l}`);let w=i?0:1,[S,k]=j.useReducer(LO,{titleId:null,descriptionId:null,panelRef:j.createRef()}),C=Ut(()=>l(!1)),$=Ut(Fe=>k({type:0,id:Fe})),L=Ia()?c?!1:w===0:!1,U=h>1,ce=j.useContext(Oc)!==null,[z,K]=rO(),{resolveContainers:W,mainTreeNodeRef:ge,MainTreeNode:he}=RO({portals:z,defaultContainers:[(n=S.panelRef.current)!=null?n:y.current]}),be=U?"parent":"leaf",De=g!==null?(g&ar.Closing)===ar.Closing:!1,Be=(()=>ce||De?!1:L)(),X=j.useCallback(()=>{var Fe,Ke;return(Ke=Array.from((Fe=E==null?void 0:E.querySelectorAll("body > *"))!=null?Fe:[]).find(He=>He.id==="headlessui-portal-root"?!1:He.contains(ge.current)&&He instanceof HTMLElement))!=null?Ke:null},[ge]);cy(X,Be);let ne=(()=>U?!0:L)(),_e=j.useCallback(()=>{var Fe,Ke;return(Ke=Array.from((Fe=E==null?void 0:E.querySelectorAll("[data-headlessui-portal]"))!=null?Fe:[]).find(He=>He.contains(ge.current)&&He instanceof HTMLElement))!=null?Ke:null},[ge]);cy(_e,ne);let N=(()=>!(!L||U))();$C(W,C,N);let G=(()=>!(U||w!==0))();V_(E==null?void 0:E.defaultView,"keydown",Fe=>{G&&(Fe.defaultPrevented||Fe.key===G_.Escape&&(Fe.preventDefault(),Fe.stopPropagation(),C()))});let oe=(()=>!(De||w!==0||ce))();IO(E,oe,W),j.useEffect(()=>{if(w!==0||!y.current)return;let Fe=new ResizeObserver(Ke=>{for(let He of Ke){let xe=He.target.getBoundingClientRect();xe.x===0&&xe.y===0&&xe.width===0&&xe.height===0&&C()}});return Fe.observe(y.current),()=>Fe.disconnect()},[w,y,C]);let[Z,ie]=aO(),re=j.useMemo(()=>[{dialogState:w,close:C,setTitleId:$},S],[w,S,C,$]),Se=j.useMemo(()=>({open:w===0}),[w]),Pe={ref:b,id:o,role:"dialog","aria-modal":w===0?!0:void 0,"aria-labelledby":S.titleId,"aria-describedby":Z};return ot.createElement(dO,{type:"Dialog",enabled:w===0,element:y,onUpdate:Ut((Fe,Ke)=>{Ke==="Dialog"&&An(Fe,{[uh.Add]:()=>p(He=>He+1),[uh.Remove]:()=>p(He=>He-1)})})},ot.createElement(ih,{force:!0},ot.createElement(lh,null,ot.createElement(Oc.Provider,{value:re},ot.createElement(lh.Group,{target:y},ot.createElement(ih,{force:!1},ot.createElement(ie,{slot:Se,name:"Dialog.Description"},ot.createElement(Sl,{initialFocus:s,containers:W,features:L?An(be,{parent:Sl.features.RestoreFocus,leaf:Sl.features.All&~Sl.features.FocusLock}):Sl.features.None},ot.createElement(K,null,jr({ourProps:Pe,theirProps:f,slot:Se,defaultTag:MO,features:FO,visible:w===0,name:"Dialog"}))))))))),ot.createElement(he,null))}let UO="div";function BO(e,t){let n=La(),{id:r=`headlessui-dialog-overlay-${n}`,...o}=e,[{dialogState:i,close:l}]=hu("Dialog.Overlay"),s=Hr(t),c=Ut(h=>{if(h.target===h.currentTarget){if(IC(h.currentTarget))return h.preventDefault();h.preventDefault(),h.stopPropagation(),l()}}),f=j.useMemo(()=>({open:i===0}),[i]);return jr({ourProps:{ref:s,id:r,"aria-hidden":!0,onClick:c},theirProps:o,slot:f,defaultTag:UO,name:"Dialog.Overlay"})}let HO="div";function WO(e,t){let n=La(),{id:r=`headlessui-dialog-backdrop-${n}`,...o}=e,[{dialogState:i},l]=hu("Dialog.Backdrop"),s=Hr(t);j.useEffect(()=>{if(l.panelRef.current===null)throw new Error("A component is being used, but a component is missing.")},[l.panelRef]);let c=j.useMemo(()=>({open:i===0}),[i]);return ot.createElement(ih,{force:!0},ot.createElement(lh,null,jr({ourProps:{ref:s,id:r,"aria-hidden":!0},theirProps:o,slot:c,defaultTag:HO,name:"Dialog.Backdrop"})))}let GO="div";function VO(e,t){let n=La(),{id:r=`headlessui-dialog-panel-${n}`,...o}=e,[{dialogState:i},l]=hu("Dialog.Panel"),s=Hr(t,l.panelRef),c=j.useMemo(()=>({open:i===0}),[i]),f=Ut(h=>{h.stopPropagation()});return jr({ourProps:{ref:s,id:r,onClick:f},theirProps:o,slot:c,defaultTag:GO,name:"Dialog.Panel"})}let qO="h2";function KO(e,t){let n=La(),{id:r=`headlessui-dialog-title-${n}`,...o}=e,[{dialogState:i,setTitleId:l}]=hu("Dialog.Title"),s=Hr(t);j.useEffect(()=>(l(r),()=>l(null)),[r,l]);let c=j.useMemo(()=>({open:i===0}),[i]);return jr({ourProps:{ref:s,id:r},theirProps:o,slot:c,defaultTag:qO,name:"Dialog.Title"})}let QO=dr(zO),YO=dr(WO),XO=dr(VO),ZO=dr(BO),JO=dr(KO),fy=Object.assign(QO,{Backdrop:YO,Panel:XO,Overlay:ZO,Title:JO,Description:cO});function eA(e=0){let[t,n]=j.useState(e),r=pu(),o=j.useCallback(c=>{r.current&&n(f=>f|c)},[t,r]),i=j.useCallback(c=>!!(t&c),[t]),l=j.useCallback(c=>{r.current&&n(f=>f&~c)},[n,r]),s=j.useCallback(c=>{r.current&&n(f=>f^c)},[n]);return{flags:t,addFlag:o,hasFlag:i,removeFlag:l,toggleFlag:s}}function tA(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Jd(e,...t){e&&t.length>0&&e.classList.add(...t)}function ep(e,...t){e&&t.length>0&&e.classList.remove(...t)}function nA(e,t){let n=Hi();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,l]=[r,o].map(c=>{let[f=0]=c.split(",").filter(Boolean).map(h=>h.includes("ms")?parseFloat(h):parseFloat(h)*1e3).sort((h,p)=>p-h);return f}),s=i+l;if(s!==0){n.group(f=>{f.setTimeout(()=>{t(),f.dispose()},s),f.addEventListener(e,"transitionrun",h=>{h.target===h.currentTarget&&f.dispose()})});let c=n.addEventListener(e,"transitionend",f=>{f.target===f.currentTarget&&(t(),c())})}else t();return n.add(()=>t()),n.dispose}function rA(e,t,n,r){let o=n?"enter":"leave",i=Hi(),l=r!==void 0?tA(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=An(o,{enter:()=>t.enter,leave:()=>t.leave}),c=An(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),f=An(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return ep(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Jd(e,...t.base,...s,...f),i.nextFrame(()=>{ep(e,...t.base,...s,...f),Jd(e,...t.base,...s,...c),nA(e,()=>(ep(e,...t.base,...s),Jd(e,...t.base,...t.entered),l()))}),i.dispose}function oA({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let l=pu(),s=wg(),c=So(n);Ar(()=>{e&&(c.current="enter")},[e]),Ar(()=>{let f=Hi();s.add(f.dispose);let h=t.current;if(h&&c.current!=="idle"&&l.current)return f.dispose(),o.current(c.current),f.add(rA(h,r.current,c.current==="enter",()=>{f.dispose(),i.current(c.current)})),f.dispose},[n])}function Go(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let ef=j.createContext(null);ef.displayName="TransitionContext";var iA=(e=>(e.Visible="visible",e.Hidden="hidden",e))(iA||{});function aA(){let e=j.useContext(ef);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}function lA(){let e=j.useContext(tf);if(e===null)throw new Error("A is used but it is missing a parent or .");return e}let tf=j.createContext(null);tf.displayName="NestingContext";function nf(e){return"children"in e?nf(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function tx(e,t){let n=So(e),r=j.useRef([]),o=pu(),i=wg(),l=Ut((y,b=Jo.Hidden)=>{let E=r.current.findIndex(({el:O})=>O===y);E!==-1&&(An(b,{[Jo.Unmount](){r.current.splice(E,1)},[Jo.Hidden](){r.current[E].state="hidden"}}),i.microTask(()=>{var O;!nf(r)&&o.current&&((O=n.current)==null||O.call(n))}))}),s=Ut(y=>{let b=r.current.find(({el:E})=>E===y);return b?b.state!=="visible"&&(b.state="visible"):r.current.push({el:y,state:"visible"}),()=>l(y,Jo.Unmount)}),c=j.useRef([]),f=j.useRef(Promise.resolve()),h=j.useRef({enter:[],leave:[],idle:[]}),p=Ut((y,b,E)=>{c.current.splice(0),t&&(t.chains.current[b]=t.chains.current[b].filter(([O])=>O!==y)),t==null||t.chains.current[b].push([y,new Promise(O=>{c.current.push(O)})]),t==null||t.chains.current[b].push([y,new Promise(O=>{Promise.all(h.current[b].map(([_,w])=>w)).then(()=>O())})]),b==="enter"?f.current=f.current.then(()=>t==null?void 0:t.wait.current).then(()=>E(b)):E(b)}),g=Ut((y,b,E)=>{Promise.all(h.current[b].splice(0).map(([O,_])=>_)).then(()=>{var O;(O=c.current.shift())==null||O()}).then(()=>E(b))});return j.useMemo(()=>({children:r,register:s,unregister:l,onStart:p,onStop:g,wait:f,chains:h}),[s,l,r,p,g,h,f])}function uA(){}let sA=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function dy(e){var t;let n={};for(let r of sA)n[r]=(t=e[r])!=null?t:uA;return n}function cA(e){let t=j.useRef(dy(e));return j.useEffect(()=>{t.current=dy(e)},[e]),t}let fA="div",nx=Tc.RenderStrategy;function dA(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:l,afterLeave:s,enter:c,enterFrom:f,enterTo:h,entered:p,leave:g,leaveFrom:y,leaveTo:b,...E}=e,O=j.useRef(null),_=Hr(O,t),w=(n=E.unmount)==null||n?Jo.Unmount:Jo.Hidden,{show:S,appear:k,initial:C}=aA(),[$,L]=j.useState(S?"visible":"hidden"),U=lA(),{register:ce,unregister:z}=U;j.useEffect(()=>ce(O),[ce,O]),j.useEffect(()=>{if(w===Jo.Hidden&&O.current){if(S&&$!=="visible"){L("visible");return}return An($,{hidden:()=>z(O),visible:()=>ce(O)})}},[$,O,ce,z,S,w]);let K=So({base:Go(E.className),enter:Go(c),enterFrom:Go(f),enterTo:Go(h),entered:Go(p),leave:Go(g),leaveFrom:Go(y),leaveTo:Go(b)}),W=cA({beforeEnter:o,afterEnter:i,beforeLeave:l,afterLeave:s}),ge=Ia();j.useEffect(()=>{if(ge&&$==="visible"&&O.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[O,$,ge]);let he=C&&!k,be=k&&S&&C,De=(()=>!ge||he?"idle":S?"enter":"leave")(),Be=eA(0),X=Ut(oe=>An(oe,{enter:()=>{Be.addFlag(ar.Opening),W.current.beforeEnter()},leave:()=>{Be.addFlag(ar.Closing),W.current.beforeLeave()},idle:()=>{}})),ne=Ut(oe=>An(oe,{enter:()=>{Be.removeFlag(ar.Opening),W.current.afterEnter()},leave:()=>{Be.removeFlag(ar.Closing),W.current.afterLeave()},idle:()=>{}})),_e=tx(()=>{L("hidden"),z(O)},U);oA({immediate:be,container:O,classes:K,direction:De,onStart:So(oe=>{_e.onStart(O,oe,X)}),onStop:So(oe=>{_e.onStop(O,oe,ne),oe==="leave"&&!nf(_e)&&(L("hidden"),z(O))})});let N=E,G={ref:_};return be?N={...N,className:kc(E.className,...K.current.enter,...K.current.enterFrom)}:(N.className=kc(E.className,(r=O.current)==null?void 0:r.className),N.className===""&&delete N.className),ot.createElement(tf.Provider,{value:_e},ot.createElement(zC,{value:An($,{visible:ar.Open,hidden:ar.Closed})|Be.flags},jr({ourProps:G,theirProps:N,defaultTag:fA,features:nx,visible:$==="visible",name:"Transition.Child"})))}function pA(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,l=j.useRef(null),s=Hr(l,t);Ia();let c=xg();if(n===void 0&&c!==null&&(n=(c&ar.Open)===ar.Open),![!0,!1].includes(n))throw new Error("A is used but it is missing a `show={true | false}` prop.");let[f,h]=j.useState(n?"visible":"hidden"),p=tx(()=>{h("hidden")}),[g,y]=j.useState(!0),b=j.useRef([n]);Ar(()=>{g!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),y(!1))},[b,n]);let E=j.useMemo(()=>({show:n,appear:r,initial:g}),[n,r,g]);j.useEffect(()=>{if(n)h("visible");else if(!nf(p))h("hidden");else{let S=l.current;if(!S)return;let k=S.getBoundingClientRect();k.x===0&&k.y===0&&k.width===0&&k.height===0&&h("hidden")}},[n,p]);let O={unmount:o},_=Ut(()=>{var S;g&&y(!1),(S=e.beforeEnter)==null||S.call(e)}),w=Ut(()=>{var S;g&&y(!1),(S=e.beforeLeave)==null||S.call(e)});return ot.createElement(tf.Provider,{value:p},ot.createElement(ef.Provider,{value:E},jr({ourProps:{...O,as:j.Fragment,children:ot.createElement(rx,{ref:s,...O,...i,beforeEnter:_,beforeLeave:w})},theirProps:{},defaultTag:j.Fragment,features:nx,visible:f==="visible",name:"Transition"})))}function hA(e,t){let n=j.useContext(ef)!==null,r=xg()!==null;return ot.createElement(ot.Fragment,null,!n&&r?ot.createElement(sh,{ref:t,...e}):ot.createElement(rx,{ref:t,...e}))}let sh=dr(pA),rx=dr(dA),gA=dr(hA),Ds=Object.assign(sh,{Child:gA,Root:sh});function mA(e){return M.jsxs(M.Fragment,{children:[M.jsx(Ds.Root,{show:e.sidebarOpen,as:j.Fragment,children:M.jsxs(fy,{as:"div",className:"relative z-50 lg:hidden",onClose:e.setSidebarOpen,children:[M.jsx(Ds.Child,{as:j.Fragment,enter:"transition-opacity ease-linear duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity ease-linear duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:M.jsx("div",{className:"fixed inset-0 bg-gray-900/80"})}),M.jsx("div",{className:"fixed inset-0 flex",children:M.jsx(Ds.Child,{as:j.Fragment,enter:"transition ease-in-out duration-300 transform",enterFrom:"-translate-x-full",enterTo:"translate-x-0",leave:"transition ease-in-out duration-300 transform",leaveFrom:"translate-x-0",leaveTo:"-translate-x-full",children:M.jsxs(fy.Panel,{className:"relative mr-16 flex w-full max-w-xs flex-1",children:[M.jsx(Ds.Child,{as:j.Fragment,enter:"ease-in-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in-out duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:M.jsx("div",{className:"absolute left-full top-0 flex w-16 justify-center pt-5",children:M.jsxs("button",{type:"button",className:"-m-2.5 p-2.5",onClick:()=>e.setSidebarOpen(!1),children:[M.jsx("span",{className:"sr-only",children:"Close sidebar"}),M.jsx(oT,{className:"h-6 w-6 text-white","aria-hidden":"true"})]})})}),M.jsx("div",{className:"flex grow flex-col gap-y-5 overflow-y-auto bg-white px-6 py-4",children:M.jsx("nav",{className:"flex flex-1 flex-col",children:M.jsx("ul",{role:"list",className:"flex flex-1 flex-col gap-y-7",children:M.jsx("li",{children:e.sidebar})})})})]})})})]})}),M.jsx("div",{className:"hidden lg:fixed lg:inset-y-0 lg:z-50 lg:flex lg:w-72 lg:flex-col",children:M.jsx("div",{className:"flex grow flex-col gap-y-5 overflow-y-auto border-r border-gray-200 bg-white px-6 py-4",children:M.jsx("nav",{className:"flex flex-1 flex-col",children:M.jsx("ul",{role:"list",className:"flex flex-1 flex-col gap-y-7",children:M.jsx("li",{children:e.sidebar})})})})}),M.jsxs("div",{className:"fixed left-0 right-0 top-0 z-40 flex items-center gap-x-6 bg-white px-4 py-4 shadow-sm sm:px-6",children:[M.jsxs("button",{type:"button",className:"-m-2.5 p-2.5 text-gray-700 lg:hidden",onClick:()=>e.setSidebarOpen(!0),children:[M.jsx("span",{className:"sr-only",children:"Open sidebar"}),M.jsx(P2,{className:"h-6 w-6","aria-hidden":"true"})]}),M.jsx("div",{className:"flex-1 text-sm font-semibold leading-6 text-gray-900 lg:pl-72",children:e.subtitle?M.jsxs(M.Fragment,{children:["OpenGPTs: ",M.jsx("span",{className:"font-normal",children:e.subtitle})]}):"OpenGPTs"}),M.jsx("div",{className:"inline-flex items-center rounded-md bg-pink-100 px-2 py-1 text-xs font-medium text-pink-700",children:"Research Preview: this is unauthenticated and all data can be found. Do not use with sensitive data"})]}),M.jsx("main",{className:"pt-20 lg:pl-72 flex flex-col min-h-[calc(100%-56px)]",children:M.jsx("div",{className:"px-4 sm:px-6 lg:px-8 flex-1",children:e.children})})]})}function py(e){var t;return M.jsx("li",{children:M.jsxs("div",{onClick:()=>e.enterConfig(e.config.assistant_id),className:On(e.config===e.currentConfig?"bg-gray-50 text-indigo-600":"text-gray-700 hover:text-indigo-600 hover:bg-gray-50","group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold cursor-pointer"),children:[M.jsx("span",{className:On(e.config===e.currentConfig?"text-indigo-600 border-indigo-600":"text-gray-400 border-gray-200 group-hover:border-indigo-600 group-hover:text-indigo-600","flex h-6 w-6 shrink-0 items-center justify-center rounded-lg border text-[0.625rem] font-medium bg-white"),children:((t=e.config.name)==null?void 0:t[0])??" "}),M.jsx("span",{className:"truncate",children:e.config.name})]})},e.config.assistant_id)}function vA(e){var t,n;return M.jsxs(M.Fragment,{children:[M.jsxs("div",{onClick:()=>e.enterConfig(null),className:On(e.currentConfig===null?"bg-gray-50 text-indigo-600":"text-gray-700 hover:text-indigo-600 hover:bg-gray-50","group flex gap-x-3 rounded-md -mx-2 p-2 text-sm leading-6 font-semibold cursor-pointer"),children:[M.jsx("span",{className:On(e.currentConfig===null?"text-indigo-600 border-indigo-600":"text-gray-400 border-gray-200 group-hover:border-indigo-600 group-hover:text-indigo-600","flex h-6 w-6 shrink-0 items-center justify-center rounded-lg border text-[0.625rem] font-medium bg-white"),children:M.jsx(__,{className:"h-4 w-4"})}),M.jsx("span",{className:"truncate",children:"New Bot"})]}),M.jsx("div",{className:"text-xs font-semibold leading-6 text-gray-400 mt-4",children:"Your Saved Bots"}),M.jsx("ul",{role:"list",className:"-mx-2 mt-2 space-y-1",children:((t=e.configs)==null?void 0:t.filter(r=>r.mine).map(r=>M.jsx(py,{config:r,currentConfig:e.currentConfig,enterConfig:e.enterConfig},r.assistant_id)))??M.jsx("li",{className:"leading-6 p-2 animate-pulse font-black text-gray-400 text-lg",children:"..."})}),M.jsx("div",{className:"text-xs font-semibold leading-6 text-gray-400 mt-4",children:"Public Bots"}),M.jsx("ul",{role:"list",className:"-mx-2 mt-2 space-y-1",children:((n=e.configs)==null?void 0:n.filter(r=>!r.mine).map(r=>M.jsx(py,{config:r,currentConfig:e.currentConfig,enterConfig:e.enterConfig},r.assistant_id)))??M.jsx("li",{className:"leading-6 p-2 animate-pulse font-black text-gray-400 text-lg",children:"..."})})]})}var ox={exports:{}},yA="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",wA=yA,_A=wA;function ix(){}function ax(){}ax.resetWarningCache=ix;var xA=function(){function e(r,o,i,l,s,c){if(c!==_A){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ax,resetWarningCache:ix};return n.PropTypes=n,n};ox.exports=xA();var bA=ox.exports;const At=xh(bA);function Ma(e,t,n,r){function o(i){return i instanceof n?i:new n(function(l){l(i)})}return new(n||(n=Promise))(function(i,l){function s(h){try{f(r.next(h))}catch(p){l(p)}}function c(h){try{f(r.throw(h))}catch(p){l(p)}}function f(h){h.done?i(h.value):o(h.value).then(s,c)}f((r=r.apply(e,t||[])).next())})}function Fa(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,l;return l={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function s(f){return function(h){return c([f,h])}}function c(f){if(r)throw new TypeError("Generator is already executing.");for(;l&&(l=0,f[0]&&(n=0)),n;)try{if(r=1,o&&(i=f[0]&2?o.return:f[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,f[1])).done)return i;switch(o=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,o=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){l={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(l)throw l.error}}return i}function gy(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function EA(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=SA.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var kA=[".DS_Store","Thumbs.db"];function TA(e){return Ma(this,void 0,void 0,function(){return Fa(this,function(t){return Ac(e)&&CA(e.dataTransfer)?[2,PA(e.dataTransfer,e.type)]:OA(e)?[2,AA(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,jA(e)]:[2,[]]})})}function CA(e){return Ac(e)}function OA(e){return Ac(e)&&Ac(e.target)}function Ac(e){return typeof e=="object"&&e!==null}function AA(e){return ch(e.target.files).map(function(t){return gu(t)})}function jA(e){return Ma(this,void 0,void 0,function(){var t;return Fa(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return gu(r)})]}})})}function PA(e,t){return Ma(this,void 0,void 0,function(){var n,r;return Fa(this,function(o){switch(o.label){case 0:return e.items?(n=ch(e.items).filter(function(i){return i.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(RA))]):[3,2];case 1:return r=o.sent(),[2,my(lx(r))];case 2:return[2,my(ch(e.files).map(function(i){return gu(i)}))]}})})}function my(e){return e.filter(function(t){return kA.indexOf(t.name)===-1})}function ch(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,xy(n)];if(e.sizen)return[!1,xy(n)]}return[!0,null]}function ki(e){return e!=null}function KA(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,l=e.maxFiles,s=e.validator;return!i&&t.length>1||i&&l>=1&&t.length>l?!1:t.every(function(c){var f=fx(c,n),h=iu(f,1),p=h[0],g=dx(c,r,o),y=iu(g,1),b=y[0],E=s?s(c):null;return p&&b&&!E})}function jc(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Is(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Sy(e){e.preventDefault()}function QA(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function YA(e){return e.indexOf("Edge/")!==-1}function XA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return QA(e)||YA(e)}function Zr(){for(var e=arguments.length,t=new Array(e),n=0;n1?o-1:0),l=1;le.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hj(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Eg=j.forwardRef(function(e,t){var n=e.children,r=Pc(e,rj),o=vx(r),i=o.open,l=Pc(o,oj);return j.useImperativeHandle(t,function(){return{open:i}},[i]),ot.createElement(j.Fragment,null,n(Vt(Vt({},l),{},{open:i})))});Eg.displayName="Dropzone";var mx={disabled:!1,getFilesFromEvent:TA,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Eg.defaultProps=mx;Eg.propTypes={children:At.func,accept:At.objectOf(At.arrayOf(At.string)),multiple:At.bool,preventDropOnDocument:At.bool,noClick:At.bool,noKeyboard:At.bool,noDrag:At.bool,noDragEventsBubbling:At.bool,minSize:At.number,maxSize:At.number,maxFiles:At.number,disabled:At.bool,getFilesFromEvent:At.func,onFileDialogCancel:At.func,onFileDialogOpen:At.func,useFsAccessApi:At.bool,autoFocus:At.bool,onDragEnter:At.func,onDragLeave:At.func,onDragOver:At.func,onDrop:At.func,onDropAccepted:At.func,onDropRejected:At.func,onError:At.func,validator:At.func};var hh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function vx(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Vt(Vt({},mx),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,l=t.minSize,s=t.multiple,c=t.maxFiles,f=t.onDragEnter,h=t.onDragLeave,p=t.onDragOver,g=t.onDrop,y=t.onDropAccepted,b=t.onDropRejected,E=t.onFileDialogCancel,O=t.onFileDialogOpen,_=t.useFsAccessApi,w=t.autoFocus,S=t.preventDropOnDocument,k=t.noClick,C=t.noKeyboard,$=t.noDrag,L=t.noDragEventsBubbling,U=t.onError,ce=t.validator,z=j.useMemo(function(){return ej(n)},[n]),K=j.useMemo(function(){return JA(n)},[n]),W=j.useMemo(function(){return typeof O=="function"?O:ky},[O]),ge=j.useMemo(function(){return typeof E=="function"?E:ky},[E]),he=j.useRef(null),be=j.useRef(null),De=j.useReducer(gj,hh),Be=tp(De,2),X=Be[0],ne=Be[1],_e=X.isFocused,N=X.isFileDialogActive,G=j.useRef(typeof window<"u"&&window.isSecureContext&&_&&ZA()),oe=function(){!G.current&&N&&setTimeout(function(){if(be.current){var Oe=be.current.files;Oe.length||(ne({type:"closeDialog"}),ge())}},300)};j.useEffect(function(){return window.addEventListener("focus",oe,!1),function(){window.removeEventListener("focus",oe,!1)}},[be,N,ge,G]);var Z=j.useRef([]),ie=function(Oe){he.current&&he.current.contains(Oe.target)||(Oe.preventDefault(),Z.current=[])};j.useEffect(function(){return S&&(document.addEventListener("dragover",Sy,!1),document.addEventListener("drop",ie,!1)),function(){S&&(document.removeEventListener("dragover",Sy),document.removeEventListener("drop",ie))}},[he,S]),j.useEffect(function(){return!r&&w&&he.current&&he.current.focus(),function(){}},[he,w,r]);var re=j.useCallback(function(se){U?U(se):console.error(se)},[U]),Se=j.useCallback(function(se){se.preventDefault(),se.persist(),yt(se),Z.current=[].concat(lj(Z.current),[se.target]),Is(se)&&Promise.resolve(o(se)).then(function(Oe){if(!(jc(se)&&!L)){var pt=Oe.length,Rt=pt>0&&KA({files:Oe,accept:z,minSize:l,maxSize:i,multiple:s,maxFiles:c,validator:ce}),Yt=pt>0&&!Rt;ne({isDragAccept:Rt,isDragReject:Yt,isDragActive:!0,type:"setDraggedFiles"}),f&&f(se)}}).catch(function(Oe){return re(Oe)})},[o,f,re,L,z,l,i,s,c,ce]),Pe=j.useCallback(function(se){se.preventDefault(),se.persist(),yt(se);var Oe=Is(se);if(Oe&&se.dataTransfer)try{se.dataTransfer.dropEffect="copy"}catch{}return Oe&&p&&p(se),!1},[p,L]),Fe=j.useCallback(function(se){se.preventDefault(),se.persist(),yt(se);var Oe=Z.current.filter(function(Rt){return he.current&&he.current.contains(Rt)}),pt=Oe.indexOf(se.target);pt!==-1&&Oe.splice(pt,1),Z.current=Oe,!(Oe.length>0)&&(ne({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Is(se)&&h&&h(se))},[he,h,L]),Ke=j.useCallback(function(se,Oe){var pt=[],Rt=[];se.forEach(function(Yt){var Pn=fx(Yt,z),dn=tp(Pn,2),pn=dn[0],Rn=dn[1],Xn=dx(Yt,l,i),A=tp(Xn,2),R=A[0],I=A[1],q=ce?ce(Yt):null;if(pn&&R&&!q)pt.push(Yt);else{var V=[Rn,I];q&&(V=V.concat(q)),Rt.push({file:Yt,errors:V.filter(function(de){return de})})}}),(!s&&pt.length>1||s&&c>=1&&pt.length>c)&&(pt.forEach(function(Yt){Rt.push({file:Yt,errors:[qA]})}),pt.splice(0)),ne({acceptedFiles:pt,fileRejections:Rt,type:"setFiles"}),g&&g(pt,Rt,Oe),Rt.length>0&&b&&b(Rt,Oe),pt.length>0&&y&&y(pt,Oe)},[ne,s,z,l,i,c,g,y,b,ce]),He=j.useCallback(function(se){se.preventDefault(),se.persist(),yt(se),Z.current=[],Is(se)&&Promise.resolve(o(se)).then(function(Oe){jc(se)&&!L||Ke(Oe,se)}).catch(function(Oe){return re(Oe)}),ne({type:"reset"})},[o,Ke,re,L]),xe=j.useCallback(function(){if(G.current){ne({type:"openDialog"}),W();var se={multiple:s,types:K};window.showOpenFilePicker(se).then(function(Oe){return o(Oe)}).then(function(Oe){Ke(Oe,null),ne({type:"closeDialog"})}).catch(function(Oe){tj(Oe)?(ge(Oe),ne({type:"closeDialog"})):nj(Oe)?(G.current=!1,be.current?(be.current.value=null,be.current.click()):re(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):re(Oe)});return}be.current&&(ne({type:"openDialog"}),W(),be.current.value=null,be.current.click())},[ne,W,ge,_,Ke,re,K,s]),Xe=j.useCallback(function(se){!he.current||!he.current.isEqualNode(se.target)||(se.key===" "||se.key==="Enter"||se.keyCode===32||se.keyCode===13)&&(se.preventDefault(),xe())},[he,xe]),rt=j.useCallback(function(){ne({type:"focus"})},[]),Ie=j.useCallback(function(){ne({type:"blur"})},[]),Ze=j.useCallback(function(){k||(XA()?setTimeout(xe,0):xe())},[k,xe]),gt=function(Oe){return r?null:Oe},Mt=function(Oe){return C?null:gt(Oe)},jt=function(Oe){return $?null:gt(Oe)},yt=function(Oe){L&&Oe.stopPropagation()},kt=j.useMemo(function(){return function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Oe=se.refKey,pt=Oe===void 0?"ref":Oe,Rt=se.role,Yt=se.onKeyDown,Pn=se.onFocus,dn=se.onBlur,pn=se.onClick,Rn=se.onDragEnter,Xn=se.onDragOver,A=se.onDragLeave,R=se.onDrop,I=Pc(se,ij);return Vt(Vt(ph({onKeyDown:Mt(Zr(Yt,Xe)),onFocus:Mt(Zr(Pn,rt)),onBlur:Mt(Zr(dn,Ie)),onClick:gt(Zr(pn,Ze)),onDragEnter:jt(Zr(Rn,Se)),onDragOver:jt(Zr(Xn,Pe)),onDragLeave:jt(Zr(A,Fe)),onDrop:jt(Zr(R,He)),role:typeof Rt=="string"&&Rt!==""?Rt:"presentation"},pt,he),!r&&!C?{tabIndex:0}:{}),I)}},[he,Xe,rt,Ie,Ze,Se,Pe,Fe,He,C,$,r]),$e=j.useCallback(function(se){se.stopPropagation()},[]),Bt=j.useMemo(function(){return function(){var se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Oe=se.refKey,pt=Oe===void 0?"ref":Oe,Rt=se.onChange,Yt=se.onClick,Pn=Pc(se,aj),dn=ph({accept:z,multiple:s,type:"file",style:{display:"none"},onChange:gt(Zr(Rt,He)),onClick:gt(Zr(Yt,$e)),tabIndex:-1},pt,be);return Vt(Vt({},dn),Pn)}},[be,n,s,He,r]);return Vt(Vt({},X),{},{isFocused:_e&&!r,getRootProps:kt,getInputProps:Bt,rootRef:he,inputRef:be,open:gt(xe)})}function gj(e,t){switch(t.type){case"focus":return Vt(Vt({},e),{},{isFocused:!0});case"blur":return Vt(Vt({},e),{},{isFocused:!1});case"openDialog":return Vt(Vt({},hh),{},{isFileDialogActive:!0});case"closeDialog":return Vt(Vt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Vt(Vt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Vt(Vt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Vt({},hh);default:return e}}function ky(){}const mj={flex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",borderWidth:2,borderRadius:2,borderColor:"#eeeeee",borderStyle:"dashed",backgroundColor:"#fafafa",color:"#bdbdbd",outline:"none",transition:"border .24s ease-in-out"},vj={borderColor:"#2196f3"},yj={borderColor:"#00e676"},wj={borderColor:"#ff1744"};function _j(e){return M.jsx("label",{htmlFor:e.id,className:"block font-medium leading-6 text-gray-400 mb-2",children:e.title})}function xj(e){const{getRootProps:t,getInputProps:n,fileRejections:r}=e.state,o=e.files.map((l,s)=>M.jsxs("li",{children:[l.name," - ",l.size," bytes",M.jsx("span",{className:"not-prose ml-2 inline-flex items-center rounded-full px-1 py-1 text-xs font-medium cursor-pointer bg-gray-50 text-gray-600 relative top-[1px]",onClick:()=>e.setFiles(c=>c.filter(f=>f!==l)),children:M.jsx(tT,{className:"h-4 w-4"})})]},s)),i=j.useMemo(()=>({...mj,...e.state.isFocused?vj:{},...e.state.isDragAccept?yj:{},...e.state.isDragReject?wj:{}}),[e.state.isFocused,e.state.isDragAccept,e.state.isDragReject]);return M.jsxs("section",{className:"",children:[M.jsxs("aside",{children:[M.jsx(_j,{id:"files",title:"Files"}),M.jsx("div",{className:"prose",children:M.jsx("ul",{children:o})})]}),M.jsxs("div",{...t({style:i}),children:[M.jsx("input",{...n()}),M.jsxs("p",{children:["Drag n' drop some files here, or click to select files.",M.jsx("br",{}),"Accepted files: .txt, .csv, .html, .docx, .pdf.",M.jsx("br",{}),"No file should exceed 10 MB."]}),r.length>0&&M.jsx("div",{className:"flex items-center rounded-md bg-yellow-50 mt-4 px-2 py-1 text-xs font-medium text-yellow-800 ring-1 ring-inset ring-yellow-600/20 prose",children:M.jsx("ul",{children:r.map((l,s)=>M.jsxs("li",{className:"break-all",children:[l.file.name," - ",l.errors[0].message]},s))})})]})]})}function kg(e){return M.jsx("label",{htmlFor:e.id,className:"block font-medium leading-6 text-gray-400 mb-2",children:e.title})}function bj(e){return M.jsxs("div",{children:[M.jsx(kg,{id:e.id,title:e.title}),M.jsx("textarea",{rows:4,name:e.id,id:e.id,className:"block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6",value:e.value,readOnly:e.readonly,disabled:e.readonly,onChange:t=>e.setValue(t.target.value)})]})}function Ty(e){var t;return M.jsxs("div",{children:[M.jsx(kg,{id:e.id,title:e.title}),M.jsxs("fieldset",{children:[M.jsx("legend",{className:"sr-only",children:e.field.title}),M.jsx("div",{className:"space-y-2",children:(t=e.field.enum)==null?void 0:t.map(n=>M.jsxs("div",{className:"flex items-center",children:[M.jsx("input",{id:`${e.id}-${n}`,name:e.id,type:"radio",checked:n===e.value,className:"h-4 w-4 border-gray-300 text-indigo-600 focus:ring-indigo-600",disabled:e.readonly,onChange:()=>e.setValue(n)}),M.jsx("label",{htmlFor:`${e.id}-${n}`,className:"ml-3 block leading-6 text-gray-900",children:n})]},n))})]})]})}const Sj={Retrieval:"Look up information in uploaded files.","DDG Search":"Search the web with [DuckDuckGo](https://pypi.org/project/duckduckgo-search/).","Search (Tavily)":"Uses the [Tavily](https://app.tavily.com/) search engine. Includes sources in the response.","Search (short answer, Tavily)":"Uses the [Tavily](https://app.tavily.com/) search engine. This returns only the answer, no supporting evidence.","You.com Search":"Uses [You.com](https://you.com/) search, optimized responses for LLMs.","SEC Filings (Kay.ai)":"Searches through SEC filings using [Kay.ai](https://www.kay.ai/).","Press Releases (Kay.ai)":"Searches through press releases using [Kay.ai](https://www.kay.ai/).",Arxiv:"Searches [Arxiv](https://arxiv.org/).",PubMed:"Searches [PubMed](https://pubmed.ncbi.nlm.nih.gov/).",Wikipedia:"Searches [Wikipedia](https://pypi.org/project/wikipedia/)."};function Ej(e){var t,n,r;return M.jsxs("fieldset",{children:[M.jsx(kg,{id:e.id,title:e.title??((t=e.field.items)==null?void 0:t.title)}),M.jsx("div",{className:"space-y-2",children:(r=(n=e.field.items)==null?void 0:n.enum)==null?void 0:r.map(o=>{var i;return M.jsxs("div",{className:"relative flex items-start",children:[M.jsx("div",{className:"flex h-6 items-center",children:M.jsx("input",{id:`${e.id}-${o}`,"aria-describedby":"comments-description",name:`${e.id}-${o}`,type:"checkbox",checked:e.value.includes(o),className:"h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",disabled:e.readonly,onChange:l=>{l.target.checked?e.setValue([...e.value,o]):e.setValue(e.value.filter(s=>s!==o))}})}),M.jsxs("div",{className:"ml-3 text-sm leading-6",children:[M.jsx("label",{htmlFor:`${e.id}-${o}`,className:"text-gray-900",children:o}),((i=e.descriptions)==null?void 0:i[o])&&M.jsx("div",{className:"text-gray-500 prose prose-sm prose-a:text-gray-500",dangerouslySetInnerHTML:{__html:_t(e.descriptions[o])}})]})]},o)})})]})}function kj(e){const t=window.location.href+"?shared_id="+e.assistantId;return M.jsxs("div",{className:"flex rounded-md shadow-sm mb-4",children:[M.jsxs("button",{type:"submit",className:"relative -ml-px inline-flex items-center gap-x-1.5 rounded-l-md px-3 py-2 text-sm font-semibold text-gray-900 border border-gray-300 hover:bg-gray-50 bg-white",onClick:async n=>{n.preventDefault(),n.stopPropagation(),await navigator.clipboard.writeText(t),window.alert("Copied to clipboard!")},children:[M.jsx(Z2,{className:"-ml-0.5 h-5 w-5 text-gray-400","aria-hidden":"true"}),"Copy Public Link"]}),M.jsx("a",{className:"rounded-none rounded-r-md py-1.5 px-2 text-gray-900 border border-l-0 border-gray-300 text-sm leading-6 line-clamp-1 flex-1 underline",href:t,children:t})]})}function Tj(e){var p,g,y,b,E,O;const[t,n]=j.useState(((p=e.config)==null?void 0:p.config)??e.configDefaults),[r,o]=j.useState([]),i=vx({multiple:!0,accept:{"text/*":[".txt",".csv",".htm",".html"],"application/pdf":[".pdf"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/msword":[".doc"]},maxSize:1e7}),[l,s]=j.useState(((g=e.config)==null?void 0:g.public)??!1);j.useEffect(()=>{var _;n(((_=e.config)==null?void 0:_.config)??e.configDefaults)},[e.config,e.configDefaults]),j.useEffect(()=>{i.acceptedFiles.length>0&&(n(_=>{var w;return{configurable:{..._==null?void 0:_.configurable,tools:[...(((w=_==null?void 0:_.configurable)==null?void 0:w.tools)??[]).filter(S=>S!=="Retrieval"),"Retrieval"]}}}),o(_=>[..._.filter(w=>!i.acceptedFiles.includes(w)),...i.acceptedFiles]))},[i.acceptedFiles]);const[c,f]=j.useState(!1),h=!!e.config&&!c;return M.jsxs(M.Fragment,{children:[M.jsx("div",{className:"flex gap-2 items-center justify-between font-semibold text-lg leading-6 text-gray-600 mb-4",children:M.jsxs("span",{children:["Bot: ",((y=e.config)==null?void 0:y.name)??"New Bot"," ",M.jsx("span",{className:"font-normal",children:e.config?"(read-only)":""})]})}),((b=e.config)==null?void 0:b.public)&&M.jsx(kj,{assistantId:(E=e.config)==null?void 0:E.assistant_id}),M.jsxs("form",{className:On("flex flex-col gap-8"),onSubmit:async _=>{_.preventDefault(),_.stopPropagation();const S=_.target.key.value;S&&(f(!0),await e.saveConfig(S,t,i.acceptedFiles,l),f(!1))},children:[M.jsxs("div",{className:On("flex flex-col gap-8",h&&"opacity-50 cursor-not-allowed"),children:[Object.entries(((O=e.configSchema)==null?void 0:O.properties.configurable.properties)??{}).map(([_,w])=>{var k,C,$,L;const S=w.title;if(((k=w.allOf)==null?void 0:k.length)===1&&(w=w.allOf[0]),_==="agent_type")return M.jsx(Ty,{id:_,field:w,title:S,value:(C=t==null?void 0:t.configurable)==null?void 0:C[_],setValue:U=>n({...t,configurable:{...t.configurable,[_]:U}}),readonly:h},_);if(_==="system_message")return M.jsx(bj,{id:_,field:w,title:S,value:($=t==null?void 0:t.configurable)==null?void 0:$[_],setValue:U=>n({...t,configurable:{...t.configurable,[_]:U}}),readonly:h},_);if(_==="tools")return M.jsx(Ej,{id:_,field:w,title:S,value:(L=t==null?void 0:t.configurable)==null?void 0:L[_],setValue:U=>n({...t,configurable:{...t.configurable,[_]:U}}),readonly:h,descriptions:Sj},_)}),!e.config&&M.jsx(xj,{state:i,files:r,setFiles:o}),M.jsx(Ty,{id:"public",field:{type:"string",title:"public",description:"",enum:["Yes","No"]},title:"Create a public link?",value:l?"Yes":"No",setValue:_=>s(_==="Yes"),readonly:h})]}),!e.config&&M.jsxs("div",{className:"flex flex-row",children:[M.jsx("div",{className:"relative flex flex-grow items-stretch focus-within:z-10",children:M.jsx("input",{type:"text",name:"key",id:"key",autoComplete:"off",className:"block w-full rounded-none rounded-l-md border-0 py-1.5 pl-4 text-gray-900 ring-1 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6 ring-inset ring-gray-300",placeholder:"Name your bot"})}),M.jsx("button",{type:"submit",className:"inline-flex items-center px-4 py-2 border border-transparent text-sm leading-5 font-medium rounded-r-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-600",children:c?"Saving...":"Save"})]})]})]})}function Cj(e){var t;return M.jsxs("div",{className:"flex flex-col items-stretch pb-[76px]",children:[M.jsxs("div",{className:"flex-1 flex flex-col md:flex-row lg:items-stretch self-stretch",children:[M.jsx("div",{className:"w-72 border-r border-gray-200 pr-6",children:M.jsx(vA,{configs:e.configs,currentConfig:e.currentConfig,enterConfig:e.enterConfig})}),M.jsx("main",{className:"flex-1",children:M.jsx("div",{className:"px-4",children:M.jsx(Tj,{config:e.currentConfig,configSchema:e.configSchema,configDefaults:e.configDefaults,saveConfig:e.saveConfig},(t=e.currentConfig)==null?void 0:t.assistant_id)})})]}),e.currentConfig&&M.jsx("div",{className:"fixed left-0 lg:left-72 bottom-0 right-0 p-4",children:M.jsx(C_,{onSubmit:e.startChat})})]})}function Oj(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++n-1}var CP=TP,OP=lf;function AP(e,t){var n=this.__data__,r=OP(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var jP=AP,PP=pP,RP=xP,$P=EP,NP=CP,DP=jP;function Ba(e){var t=-1,n=e==null?0:e.length;for(this.clear();++ts))return!1;var f=i.get(e),h=i.get(t);if(f&&h)return f==t&&h==e;var p=-1,g=!0,y=n&E$?new _$:void 0;for(i.set(e,t),i.set(t,e);++p-1&&e%1==0&&e-1&&e%1==0&&e<=jN}var Rg=PN,RN=mu,$N=Rg,NN=vu,DN="[object Arguments]",IN="[object Array]",LN="[object Boolean]",MN="[object Date]",FN="[object Error]",zN="[object Function]",UN="[object Map]",BN="[object Number]",HN="[object Object]",WN="[object RegExp]",GN="[object Set]",VN="[object String]",qN="[object WeakMap]",KN="[object ArrayBuffer]",QN="[object DataView]",YN="[object Float32Array]",XN="[object Float64Array]",ZN="[object Int8Array]",JN="[object Int16Array]",e4="[object Int32Array]",t4="[object Uint8Array]",n4="[object Uint8ClampedArray]",r4="[object Uint16Array]",o4="[object Uint32Array]",It={};It[YN]=It[XN]=It[ZN]=It[JN]=It[e4]=It[t4]=It[n4]=It[r4]=It[o4]=!0;It[DN]=It[IN]=It[KN]=It[LN]=It[QN]=It[MN]=It[FN]=It[zN]=It[UN]=It[BN]=It[HN]=It[WN]=It[GN]=It[VN]=It[qN]=!1;function i4(e){return NN(e)&&$N(e.length)&&!!It[RN(e)]}var a4=i4;function l4(e){return function(t){return e(t)}}var $x=l4,Nc={exports:{}};Nc.exports;(function(e,t){var n=wx,r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===r,l=i&&n.process,s=function(){try{var c=o&&o.require&&o.require("util").types;return c||l&&l.binding&&l.binding("util")}catch{}}();e.exports=s})(Nc,Nc.exports);var u4=Nc.exports,s4=a4,c4=$x,Uy=u4,By=Uy&&Uy.isTypedArray,f4=By?c4(By):s4,Nx=f4,d4=gN,p4=jx,h4=io,g4=Px,m4=Rx,v4=Nx,y4=Object.prototype,w4=y4.hasOwnProperty;function _4(e,t){var n=h4(e),r=!n&&p4(e),o=!n&&!r&&g4(e),i=!n&&!r&&!o&&v4(e),l=n||r||o||i,s=l?d4(e.length,String):[],c=s.length;for(var f in e)(t||w4.call(e,f))&&!(l&&(f=="length"||o&&(f=="offset"||f=="parent")||i&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||m4(f,c)))&&s.push(f);return s}var x4=_4,b4=Object.prototype;function S4(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||b4;return e===n}var E4=S4;function k4(e,t){return function(n){return e(t(n))}}var T4=k4,C4=T4,O4=C4(Object.keys,Object),A4=O4,j4=E4,P4=A4,R4=Object.prototype,$4=R4.hasOwnProperty;function N4(e){if(!j4(e))return P4(e);var t=[];for(var n in Object(e))$4.call(e,n)&&n!="constructor"&&t.push(n);return t}var D4=N4,I4=xx,L4=Rg;function M4(e){return e!=null&&L4(e.length)&&!I4(e)}var $g=M4,F4=x4,z4=D4,U4=$g;function B4(e){return U4(e)?F4(e):z4(e)}var Ng=B4,H4=rN,W4=pN,G4=Ng;function V4(e){return H4(e,G4,W4)}var q4=V4,Hy=q4,K4=1,Q4=Object.prototype,Y4=Q4.hasOwnProperty;function X4(e,t,n,r,o,i){var l=n&K4,s=Hy(e),c=s.length,f=Hy(t),h=f.length;if(c!=h&&!l)return!1;for(var p=c;p--;){var g=s[p];if(!(l?g in t:Y4.call(t,g)))return!1}var y=i.get(e),b=i.get(t);if(y&&b)return y==t&&b==e;var E=!0;i.set(e,t),i.set(t,e);for(var O=l;++pt||i&&l&&c&&!s&&!f||r&&l&&c||!n&&c||!o)return 1;if(!r&&!i&&!f&&e=s)return c;var f=n[r];return c*(f=="desc"?-1:1)}}return e.index-t.index}var hL=pL,ip=yx,gL=Pg,mL=UI,vL=lL,yL=sL,wL=$x,_L=hL,xL=zx,bL=io;function SL(e,t,n){t.length?t=ip(t,function(i){return bL(i)?function(l){return gL(l,i.length===1?i[0]:i)}:i}):t=[xL];var r=-1;t=ip(t,wL(mL));var o=vL(e,function(i,l,s){var c=ip(t,function(f){return f(i)});return{criteria:c,index:++r,value:i}});return yL(o,function(i,l){return _L(i,l,n)})}var EL=SL,kL=EL,r1=io;function TL(e,t,n,r){return e==null?[]:(r1(t)||(t=t==null?[]:[t]),n=r?void 0:n,r1(n)||(n=n==null?[]:[n]),kL(e,t,n))}var CL=TL;const Ux=xh(CL);function OL(e,t){if(e=e??[],!Array.isArray(t)){const n=t;t=[...e.filter(r=>r.thread_id!==n.thread_id),n]}return Ux(t,"updated_at","desc")}function AL(){const[e,t]=j.useReducer(OL,null),[n,r]=j.useState(null);j.useEffect(()=>{async function l(){const s=await fetch("/threads/",{headers:{Accept:"application/json"}}).then(c=>c.json());t(s)}l()},[]);const o=j.useCallback(async(l,s,c=crypto.randomUUID())=>{const f=await fetch(`/threads/${c}`,{method:"PUT",body:JSON.stringify({assistant_id:s,name:l}),headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(h=>h.json());return t(f),r(f.thread_id),f},[]),i=j.useCallback(l=>{r(l)},[]);return{chats:e,currentChat:(e==null?void 0:e.find(l=>l.thread_id===n))||null,createChat:o,enterChat:i}}const jL=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(r,o,i){n.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:i})},n.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,o){if(1&o&&(r=n(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var l in r)n.d(i,l,(function(s){return r[s]}).bind(null,l));return i},n.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(o,"a",o),o},n.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},n.p="",n(n.s=84)}([function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r;try{r={clone:n(88),constant:n(64),each:n(146),filter:n(152),has:n(175),isArray:n(0),isEmpty:n(177),isFunction:n(17),isUndefined:n(178),keys:n(6),map:n(179),reduce:n(181),size:n(184),transform:n(190),union:n(191),values:n(210)}}catch{}r||(r=window._),e.exports=r},function(e,t,n){function r(s){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c})(s)}var o=n(47),i=(typeof self>"u"?"undefined":r(self))=="object"&&self&&self.Object===Object&&self,l=o||i||Function("return this")();e.exports=l},function(e,t){function n(r){return(n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(r)}e.exports=function(r){return r!=null&&n(r)=="object"}},function(e,t,n){var r=n(100),o=n(105);e.exports=function(i,l){var s=o(i,l);return r(s)?s:void 0}},function(e,t){function n(r){return(n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(r)}e.exports=function(r){var o=n(r);return r!=null&&(o=="object"||o=="function")}},function(e,t,n){var r=n(52),o=n(37),i=n(7);e.exports=function(l){return i(l)?r(l):o(l)}},function(e,t,n){var r=n(17),o=n(34);e.exports=function(i){return i!=null&&o(i.length)&&!r(i)}},function(e,t,n){var r=n(9),o=n(101),i=n(102),l=r?r.toStringTag:void 0;e.exports=function(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":l&&l in Object(s)?o(s):i(s)}},function(e,t,n){var r=n(2).Symbol;e.exports=r},function(e,t,n){var r=n(132),o=n(31),i=n(133),l=n(61),s=n(134),c=n(8),f=n(48),h=f(r),p=f(o),g=f(i),y=f(l),b=f(s),E=c;(r&&E(new r(new ArrayBuffer(1)))!="[object DataView]"||o&&E(new o)!="[object Map]"||i&&E(i.resolve())!="[object Promise]"||l&&E(new l)!="[object Set]"||s&&E(new s)!="[object WeakMap]")&&(E=function(O){var _=c(O),w=_=="[object Object]"?O.constructor:void 0,S=w?f(w):"";if(S)switch(S){case h:return"[object DataView]";case p:return"[object Map]";case g:return"[object Promise]";case y:return"[object Set]";case b:return"[object WeakMap]"}return _}),e.exports=E},function(e,t){function n(o){return(n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i})(o)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch{(typeof window>"u"?"undefined":n(window))==="object"&&(r=window)}e.exports=r},function(e,t,n){(function(r){function o(p){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g})(p)}var i=n(2),l=n(121),s=o(t)=="object"&&t&&!t.nodeType&&t,c=s&&o(r)=="object"&&r&&!r.nodeType&&r,f=c&&c.exports===s?i.Buffer:void 0,h=(f?f.isBuffer:void 0)||l;r.exports=h}).call(this,n(14)(e))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function s(O){if(n===setTimeout)return setTimeout(O,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(O,0);try{return n(O,0)}catch{try{return n.call(null,O,0)}catch{return n.call(this,O,0)}}}(function(){try{n=typeof setTimeout=="function"?setTimeout:i}catch{n=i}try{r=typeof clearTimeout=="function"?clearTimeout:l}catch{r=l}})();var c,f=[],h=!1,p=-1;function g(){h&&c&&(h=!1,c.length?f=c.concat(f):p=-1,f.length&&y())}function y(){if(!h){var O=s(g);h=!0;for(var _=f.length;_;){for(c=f,f=[];++p<_;)c&&c[p].run();p=-1,_=f.length}c=null,h=!1,function(w){if(r===clearTimeout)return clearTimeout(w);if((r===l||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(w);try{r(w)}catch{try{return r.call(null,w)}catch{return r.call(this,w)}}}(O)}}function b(O,_){this.fun=O,this.array=_}function E(){}o.nextTick=function(O){var _=new Array(arguments.length-1);if(arguments.length>1)for(var w=1;wO){var _=E;E=O,O=_}return E+""+O+""+(o.isUndefined(b)?"\0":b)}function f(p,g,y,b){var E=""+g,O=""+y;if(!p&&E>O){var _=E;E=O,O=_}var w={v:E,w:O};return b&&(w.name=b),w}function h(p,g){return c(p,g.v,g.w,g.name)}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(p){return this._label=p,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(p){return o.isFunction(p)||(p=o.constant(p)),this._defaultNodeLabelFn=p,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return o.keys(this._nodes)},i.prototype.sources=function(){var p=this;return o.filter(this.nodes(),function(g){return o.isEmpty(p._in[g])})},i.prototype.sinks=function(){var p=this;return o.filter(this.nodes(),function(g){return o.isEmpty(p._out[g])})},i.prototype.setNodes=function(p,g){var y=arguments,b=this;return o.each(p,function(E){y.length>1?b.setNode(E,g):b.setNode(E)}),this},i.prototype.setNode=function(p,g){return o.has(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=g),this):(this._nodes[p]=arguments.length>1?g:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]="\0",this._children[p]={},this._children["\0"][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)},i.prototype.node=function(p){return this._nodes[p]},i.prototype.hasNode=function(p){return o.has(this._nodes,p)},i.prototype.removeNode=function(p){var g=this;if(o.has(this._nodes,p)){var y=function(b){g.removeEdge(g._edgeObjs[b])};delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],o.each(this.children(p),function(b){g.setParent(b)}),delete this._children[p]),o.each(o.keys(this._in[p]),y),delete this._in[p],delete this._preds[p],o.each(o.keys(this._out[p]),y),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this},i.prototype.setParent=function(p,g){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(o.isUndefined(g))g="\0";else{for(var y=g+="";!o.isUndefined(y);y=this.parent(y))if(y===p)throw new Error("Setting "+g+" as parent of "+p+" would create a cycle");this.setNode(g)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=g,this._children[g][p]=!0,this},i.prototype._removeFromParentsChildList=function(p){delete this._children[this._parent[p]][p]},i.prototype.parent=function(p){if(this._isCompound){var g=this._parent[p];if(g!=="\0")return g}},i.prototype.children=function(p){if(o.isUndefined(p)&&(p="\0"),this._isCompound){var g=this._children[p];if(g)return o.keys(g)}else{if(p==="\0")return this.nodes();if(this.hasNode(p))return[]}},i.prototype.predecessors=function(p){var g=this._preds[p];if(g)return o.keys(g)},i.prototype.successors=function(p){var g=this._sucs[p];if(g)return o.keys(g)},i.prototype.neighbors=function(p){var g=this.predecessors(p);if(g)return o.union(g,this.successors(p))},i.prototype.isLeaf=function(p){return(this.isDirected()?this.successors(p):this.neighbors(p)).length===0},i.prototype.filterNodes=function(p){var g=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});g.setGraph(this.graph());var y=this;o.each(this._nodes,function(E,O){p(O)&&g.setNode(O,E)}),o.each(this._edgeObjs,function(E){g.hasNode(E.v)&&g.hasNode(E.w)&&g.setEdge(E,y.edge(E))});var b={};return this._isCompound&&o.each(g.nodes(),function(E){g.setParent(E,function O(_){var w=y.parent(_);return w===void 0||g.hasNode(w)?(b[_]=w,w):w in b?b[w]:O(w)}(E))}),g},i.prototype.setDefaultEdgeLabel=function(p){return o.isFunction(p)||(p=o.constant(p)),this._defaultEdgeLabelFn=p,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return o.values(this._edgeObjs)},i.prototype.setPath=function(p,g){var y=this,b=arguments;return o.reduce(p,function(E,O){return b.length>1?y.setEdge(E,O,g):y.setEdge(E,O),O}),this},i.prototype.setEdge=function(){var p,g,y,b,E=!1,O=arguments[0];r(O)==="object"&&O!==null&&"v"in O?(p=O.v,g=O.w,y=O.name,arguments.length===2&&(b=arguments[1],E=!0)):(p=O,g=arguments[1],y=arguments[3],arguments.length>2&&(b=arguments[2],E=!0)),p=""+p,g=""+g,o.isUndefined(y)||(y=""+y);var _=c(this._isDirected,p,g,y);if(o.has(this._edgeLabels,_))return E&&(this._edgeLabels[_]=b),this;if(!o.isUndefined(y)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(g),this._edgeLabels[_]=E?b:this._defaultEdgeLabelFn(p,g,y);var w=f(this._isDirected,p,g,y);return p=w.v,g=w.w,Object.freeze(w),this._edgeObjs[_]=w,l(this._preds[g],p),l(this._sucs[p],g),this._in[g][_]=w,this._out[p][_]=w,this._edgeCount++,this},i.prototype.edge=function(p,g,y){var b=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,g,y);return this._edgeLabels[b]},i.prototype.hasEdge=function(p,g,y){var b=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,g,y);return o.has(this._edgeLabels,b)},i.prototype.removeEdge=function(p,g,y){var b=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,g,y),E=this._edgeObjs[b];return E&&(p=E.v,g=E.w,delete this._edgeLabels[b],delete this._edgeObjs[b],s(this._preds[g],p),s(this._sucs[p],g),delete this._in[g][b],delete this._out[p][b],this._edgeCount--),this},i.prototype.inEdges=function(p,g){var y=this._in[p];if(y){var b=o.values(y);return g?o.filter(b,function(E){return E.v===g}):b}},i.prototype.outEdges=function(p,g){var y=this._out[p];if(y){var b=o.values(y);return g?o.filter(b,function(E){return E.w===g}):b}},i.prototype.nodeEdges=function(p,g){var y=this.inEdges(p,g);if(y)return y.concat(this.outEdges(p,g))}},function(e,t,n){var r=n(15),o=n(95),i=n(96),l=n(97),s=n(98),c=n(99);function f(h){var p=this.__data__=new r(h);this.size=p.size}f.prototype.clear=o,f.prototype.delete=i,f.prototype.get=l,f.prototype.has=s,f.prototype.set=c,e.exports=f},function(e,t){e.exports=function(n,r){return n===r||n!=n&&r!=r}},function(e,t,n){var r=n(4)(n(2),"Map");e.exports=r},function(e,t,n){var r=n(106),o=n(113),i=n(115),l=n(116),s=n(117);function c(f){var h=-1,p=f==null?0:f.length;for(this.clear();++h-1&&n%1==0&&n<=9007199254740991}},function(e,t){e.exports=function(n){return function(r){return n(r)}}},function(e,t,n){(function(r){function o(h){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p})(h)}var i=n(47),l=o(t)=="object"&&t&&!t.nodeType&&t,s=l&&o(r)=="object"&&r&&!r.nodeType&&r,c=s&&s.exports===l&&i.process,f=function(){try{var h=s&&s.require&&s.require("util").types;return h||c&&c.binding&&c.binding("util")}catch{}}();r.exports=f}).call(this,n(14)(e))},function(e,t,n){var r=n(23),o=n(123),i=Object.prototype.hasOwnProperty;e.exports=function(l){if(!r(l))return o(l);var s=[];for(var c in Object(l))i.call(l,c)&&c!="constructor"&&s.push(c);return s}},function(e,t,n){var r=n(56),o=n(57),i=Object.prototype.propertyIsEnumerable,l=Object.getOwnPropertySymbols,s=l?function(c){return c==null?[]:(c=Object(c),r(l(c),function(f){return i.call(c,f)}))}:o;e.exports=s},function(e,t){e.exports=function(n,r){for(var o=-1,i=r.length,l=n.length;++o-1&&o%1==0&&oy))return!1;var E=p.get(l);if(E&&p.get(s))return E==s;var O=-1,_=!0,w=2&c?new r:void 0;for(p.set(l,s),p.set(s,l);++O0&&(b=_.removeMin(),(E=O[b]).distance!==Number.POSITIVE_INFINITY);)y(b).forEach(w);return O}(l,String(s),c||i,f||function(h){return l.outEdges(h)})};var i=r.constant(1)},function(e,t,n){var r=n(1);function o(){this._arr=[],this._keyIndices={}}e.exports=o,o.prototype.size=function(){return this._arr.length},o.prototype.keys=function(){return this._arr.map(function(i){return i.key})},o.prototype.has=function(i){return r.has(this._keyIndices,i)},o.prototype.priority=function(i){var l=this._keyIndices[i];if(l!==void 0)return this._arr[l].priority},o.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},o.prototype.add=function(i,l){var s=this._keyIndices;if(i=String(i),!r.has(s,i)){var c=this._arr,f=c.length;return s[i]=f,c.push({key:i,priority:l}),this._decrease(f),!0}return!1},o.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var i=this._arr.pop();return delete this._keyIndices[i.key],this._heapify(0),i.key},o.prototype.decrease=function(i,l){var s=this._keyIndices[i];if(l>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+i+" Old: "+this._arr[s].priority+" New: "+l);this._arr[s].priority=l,this._decrease(s)},o.prototype._heapify=function(i){var l=this._arr,s=2*i,c=s+1,f=i;s>1].priority0&&E(_,W))}catch(ge){k.call(new $(W),ge)}}}function k(z){var K=this;K.triggered||(K.triggered=!0,K.def&&(K=K.def),K.msg=z,K.state=2,K.chain.length>0&&E(_,K))}function C(z,K,W,ge){for(var he=0;he-1?Z=ie:(oe=o.isUndefined(N)?void 0:z(N),o.isUndefined(oe)?Z=ie:((Z=oe).path=f(l.join(oe.path,ie.path)),Z.query=function(re,Se){var Pe={};function Fe(Ke){o.forOwn(Ke,function(He,xe){Pe[xe]=He})}return Fe(c.parse(re||"")),Fe(c.parse(Se||"")),Object.keys(Pe).length===0?void 0:c.stringify(Pe)}(oe.query,ie.query))),Z.fragment=void 0,(b.indexOf(Z.reference)===-1&&Z.path.indexOf("../")===0?"../":"")+h.serialize(Z)}function _(N){return y.indexOf(C(N))>-1}function w(N){return o.isUndefined(N.error)&&N.type!=="invalid"}function S(N,G){var oe=N;return G.forEach(function(Z){if(!(Z in oe))throw Error("JSON Pointer points to missing location: "+ne(G));oe=oe[Z]}),oe}function k(N){return Object.keys(N).filter(function(G){return G!=="$ref"})}function C(N){var G;switch(N.uriDetails.reference){case"absolute":case"uri":G="remote";break;case"same-document":G="local";break;default:G=N.uriDetails.reference}return G}function $(N,G){var oe=g[N],Z=Promise.resolve(),ie=o.cloneDeep(G.loaderOptions||{});return o.isUndefined(oe)?(o.isUndefined(ie.processContent)&&(ie.processContent=function(re,Se){Se(void 0,JSON.parse(re.text))}),Z=(Z=s.load(decodeURI(N),ie)).then(function(re){return g[N]={value:re},re}).catch(function(re){throw g[N]={error:re},re})):Z=Z.then(function(){if(o.isError(oe.error))throw oe.error;return oe.value}),Z=Z.then(function(re){return o.cloneDeep(re)})}function L(N,G){var oe=!0;try{if(!o.isPlainObject(N))throw new Error("obj is not an Object");if(!o.isString(N.$ref))throw new Error("obj.$ref is not a String")}catch(Z){if(G)throw Z;oe=!1}return oe}function U(N){return N.indexOf("://")!==-1||l.isAbsolute(N)?N:l.resolve(r.cwd(),N)}function ce(N,G){N.error=G.message,N.missing=!0}function z(N){return h.parse(N)}function K(N,G,oe){S(N,G.slice(0,G.length-1))[G[G.length-1]]=oe}function W(N,G){var oe,Z;if(N=o.isUndefined(N)?{}:o.cloneDeep(N),!o.isObject(N))throw new TypeError("options must be an Object");if(!o.isUndefined(N.resolveCirculars)&&!o.isBoolean(N.resolveCirculars))throw new TypeError("options.resolveCirculars must be a Boolean");if(!(o.isUndefined(N.filter)||o.isArray(N.filter)||o.isFunction(N.filter)||o.isString(N.filter)))throw new TypeError("options.filter must be an Array, a Function of a String");if(!o.isUndefined(N.includeInvalid)&&!o.isBoolean(N.includeInvalid))throw new TypeError("options.includeInvalid must be a Boolean");if(!o.isUndefined(N.location)&&!o.isString(N.location))throw new TypeError("options.location must be a String");if(!o.isUndefined(N.refPreProcessor)&&!o.isFunction(N.refPreProcessor))throw new TypeError("options.refPreProcessor must be a Function");if(!o.isUndefined(N.refPostProcessor)&&!o.isFunction(N.refPostProcessor))throw new TypeError("options.refPostProcessor must be a Function");if(!o.isUndefined(N.subDocPath)&&!o.isArray(N.subDocPath)&&!Be(N.subDocPath))throw new TypeError("options.subDocPath must be an Array of path segments or a valid JSON Pointer");if(o.isUndefined(N.resolveCirculars)&&(N.resolveCirculars=!1),N.filter=function(ie){var re,Se;return o.isArray(ie.filter)||o.isString(ie.filter)?(Se=o.isString(ie.filter)?[ie.filter]:ie.filter,re=function(Pe){return Se.indexOf(Pe.type)>-1||Se.indexOf(C(Pe))>-1}):o.isFunction(ie.filter)?re=ie.filter:o.isUndefined(ie.filter)&&(re=function(){return!0}),function(Pe,Fe){return(Pe.type!=="invalid"||ie.includeInvalid===!0)&&re(Pe,Fe)}}(N),o.isUndefined(N.location)&&(N.location=U("./root.json")),(oe=N.location.split("#")).length>1&&(N.subDocPath="#"+oe[1]),Z=decodeURI(N.location)===N.location,N.location=O(N.location,void 0),Z&&(N.location=decodeURI(N.location)),N.subDocPath=function(ie){var re;return o.isArray(ie.subDocPath)?re=ie.subDocPath:o.isString(ie.subDocPath)?re=X(ie.subDocPath):o.isUndefined(ie.subDocPath)&&(re=[]),re}(N),!o.isUndefined(G))try{S(G,N.subDocPath)}catch(ie){throw ie.message=ie.message.replace("JSON Pointer","options.subDocPath"),ie}return N}function ge(N){if(!o.isArray(N))throw new TypeError("path must be an array");return N.map(function(G){return o.isString(G)||(G=JSON.stringify(G)),G.replace(/~1/g,"/").replace(/~0/g,"~")})}function he(N){if(!o.isArray(N))throw new TypeError("path must be an array");return N.map(function(G){return o.isString(G)||(G=JSON.stringify(G)),G.replace(/~/g,"~0").replace(/\//g,"~1")})}function be(N,G){var oe={};if(!o.isArray(N)&&!o.isObject(N))throw new TypeError("obj must be an Array or an Object");return function Z(ie,re,Se,Pe){var Fe=!0;function Ke(He,xe){Se.push(xe),Z(ie,He,Se,Pe),Se.pop()}o.isFunction(Pe)&&(Fe=Pe(ie,re,Se)),ie.indexOf(re)===-1&&(ie.push(re),Fe!==!1&&(o.isArray(re)?re.forEach(function(He,xe){Ke(He,xe.toString())}):o.isObject(re)&&o.forOwn(re,function(He,xe){Ke(He,xe)})),ie.pop())}(function(Z,ie){var re,Se=[];return ie.length>0&&(re=Z,ie.slice(0,ie.length-1).forEach(function(Pe){Pe in re&&(re=re[Pe],Se.push(re))})),Se}(N,(G=W(G,N)).subDocPath),S(N,G.subDocPath),o.cloneDeep(G.subDocPath),function(Z,ie,re){var Se,Pe,Fe=!0;return L(ie)&&(o.isUndefined(G.refPreProcessor)||(ie=G.refPreProcessor(o.cloneDeep(ie),re)),Se=De(ie),o.isUndefined(G.refPostProcessor)||(Se=G.refPostProcessor(Se,re)),G.filter(Se,re)&&(Pe=ne(re),oe[Pe]=Se),k(ie).length>0&&(Fe=!1)),Fe}),oe}function De(N){var G,oe,Z,ie={def:N};try{if(L(N,!0),G=N.$ref,Z=E[G],o.isUndefined(Z)&&(Z=E[G]=z(G)),ie.uri=G,ie.uriDetails=Z,o.isUndefined(Z.error)){ie.type=C(ie);try{["#","/"].indexOf(G[0])>-1?Be(G,!0):G.indexOf("#")>-1&&Be(Z.fragment,!0)}catch(re){ie.error=re.message,ie.type="invalid"}}else ie.error=ie.uriDetails.error,ie.type="invalid";(oe=k(N)).length>0&&(ie.warning="Extra JSON Reference properties will be ignored: "+oe.join(", "))}catch(re){ie.error=re.message,ie.type="invalid"}return ie}function Be(N,G){var oe,Z=!0;try{if(!o.isString(N))throw new Error("ptr is not a String");if(N!==""){if(oe=N.charAt(0),["#","/"].indexOf(oe)===-1)throw new Error("ptr must start with a / or #/");if(oe==="#"&&N!=="#"&&N.charAt(1)!=="/")throw new Error("ptr must start with a / or #/");if(N.match(p))throw new Error("ptr has invalid token(s)")}}catch(ie){if(G===!0)throw ie;Z=!1}return Z}function X(N){try{Be(N,!0)}catch(oe){throw new Error("ptr must be a JSON Pointer: "+oe.message)}var G=N.split("/");return G.shift(),ge(G)}function ne(N,G){if(!o.isArray(N))throw new Error("path must be an Array");return(G!==!1?"#":"")+(N.length>0?"/":"")+he(N).join("/")}function _e(N,G){var oe=Promise.resolve();return oe=oe.then(function(){if(!o.isArray(N)&&!o.isObject(N))throw new TypeError("obj must be an Array or an Object");G=W(G,N),N=o.cloneDeep(N)}).then(function(){var Z={deps:{},docs:{},refs:{}};return function ie(re,Se,Pe){var Fe,Ke,He=Promise.resolve(),xe=ne(Se.subDocPath),Xe=U(Se.location),rt=l.dirname(Se.location),Ie=Xe+xe;return o.isUndefined(Pe.docs[Xe])&&(Pe.docs[Xe]=re),o.isUndefined(Pe.deps[Ie])&&(Pe.deps[Ie]={},Fe=be(re,Se),o.forOwn(Fe,function(Ze,gt){var Mt,jt,yt=U(Se.location)+gt,kt=Ze.refdId=decodeURI(U(_(Ze)?O(rt,Ze.uri):Se.location)+"#"+(Ze.uri.indexOf("#")>-1?Ze.uri.split("#")[1]:""));Pe.refs[yt]=Ze,w(Ze)&&(Ze.fqURI=kt,Pe.deps[Ie][gt===xe?"#":gt.replace(xe+"/","#/")]=kt,yt.indexOf(kt+"/")!==0&&yt!==kt?((Ke=o.cloneDeep(Se)).subDocPath=o.isUndefined(Ze.uriDetails.fragment)?[]:X(decodeURI(Ze.uriDetails.fragment)),_(Ze)?(delete Ke.filter,Ke.location=kt.split("#")[0],He=He.then((Mt=Pe,jt=Ke,function(){var $e=U(jt.location),Bt=Mt.docs[$e];return o.isUndefined(Bt)?$($e,jt).catch(function(se){return Mt.docs[$e]=se,se}):Promise.resolve().then(function(){return Bt})}))):He=He.then(function(){return re}),He=He.then(function($e,Bt,se){return function(Oe){if(o.isError(Oe))ce(se,Oe);else try{return ie(Oe,Bt,$e).catch(function(pt){ce(se,pt)})}catch(pt){ce(se,pt)}}}(Pe,Ke,Ze))):Ze.circular=!0)})),He}(N,G,Z).then(function(){return Z})}).then(function(Z){var ie={},re=[],Se=[],Pe=new i.Graph,Fe=U(G.location),Ke=Fe+ne(G.subDocPath),He=l.dirname(Fe);return Object.keys(Z.deps).forEach(function(xe){Pe.setNode(xe)}),o.forOwn(Z.deps,function(xe,Xe){o.forOwn(xe,function(rt){Pe.setEdge(Xe,rt)})}),(re=i.alg.findCycles(Pe)).forEach(function(xe){xe.forEach(function(Xe){Se.indexOf(Xe)===-1&&Se.push(Xe)})}),o.forOwn(Z.deps,function(xe,Xe){o.forOwn(xe,function(rt,Ie){var Ze,gt=!1,Mt=Xe+Ie.slice(1),jt=Z.refs[Xe+Ie.slice(1)],yt=_(jt);Se.indexOf(rt)>-1&&re.forEach(function(kt){gt||(Ze=kt.indexOf(rt))>-1&&kt.forEach(function($e){gt||Mt.indexOf($e+"/")===0&&(yt&&Ze!==kt.length-1&&rt[rt.length-1]==="#"||(gt=!0))})}),gt&&(jt.circular=!0)})}),o.forOwn(Object.keys(Z.deps).reverse(),function(xe){var Xe=Z.deps[xe],rt=xe.split("#"),Ie=Z.docs[rt[0]],Ze=X(rt[1]);o.forOwn(Xe,function(gt,Mt){var jt=gt.split("#"),yt=Z.docs[jt[0]],kt=Ze.concat(X(Mt)),$e=Z.refs[rt[0]+ne(kt)];if(o.isUndefined($e.error)&&o.isUndefined($e.missing))if(!G.resolveCirculars&&$e.circular)$e.value=o.cloneDeep($e.def);else{try{$e.value=S(yt,X(jt[1]))}catch(Bt){return void ce($e,Bt)}rt[1]===""&&Mt==="#"?Z.docs[rt[0]]=$e.value:K(Ie,kt,$e.value)}})}),Object.keys(Z.refs).forEach(function(xe){var Xe,rt,Ie=Z.refs[xe];Ie.type!=="invalid"&&(Ie.fqURI[Ie.fqURI.length-1]==="#"&&Ie.uri[Ie.uri.length-1]!=="#"&&(Ie.fqURI=Ie.fqURI.substr(0,Ie.fqURI.length-1)),Xe=Ie.fqURI.split("/"),rt=Ie.uri.split("/"),o.times(rt.length-1,function(Ze){var gt=rt[rt.length-Ze-1],Mt=rt[rt.length-Ze],jt=Xe.length-Ze-1;gt!=="."&>!==".."&&Mt!==".."&&(Xe[jt]=gt)}),Ie.fqURI=Xe.join("/"),Ie.fqURI.indexOf(Fe)===0?Ie.fqURI=Ie.fqURI.replace(Fe,""):Ie.fqURI.indexOf(He)===0&&(Ie.fqURI=Ie.fqURI.replace(He,"")),Ie.fqURI[0]==="/"&&(Ie.fqURI="."+Ie.fqURI)),xe.indexOf(Ke)===0&&function Ze(gt,Mt,jt){var yt,kt=Mt.split("#"),$e=Z.refs[Mt];ie[kt[0]===G.location?"#"+kt[1]:ne(G.subDocPath.concat(jt))]=$e,!$e.circular&&w($e)?(yt=Z.deps[$e.refdId],$e.refdId.indexOf(gt)!==0&&Object.keys(yt).forEach(function(Bt){Ze($e.refdId,$e.refdId+Bt.substr(1),jt.concat(X(Bt)))})):!$e.circular&&$e.error&&($e.error=$e.error.replace("options.subDocPath","JSON Pointer"),$e.error.indexOf("#")>-1&&($e.error=$e.error.replace($e.uri.substr($e.uri.indexOf("#")),$e.uri)),$e.error.indexOf("ENOENT:")!==0&&$e.error.indexOf("Not Found")!==0||($e.error="JSON Pointer points to missing location: "+$e.uri))}(Ke,xe,X(xe.substr(Ke.length)))}),o.forOwn(ie,function(xe,Xe){delete xe.refdId,xe.circular&&xe.type==="local"&&(xe.value.$ref=xe.fqURI,K(Z.docs[Fe],X(Xe),xe.value)),xe.missing&&(xe.error=xe.error.split(": ")[0]+": "+xe.def.$ref)}),{refs:ie,resolved:Z.docs[Fe]}})}typeof Promise>"u"&&n(83),e.exports.clearCache=function(){g={}},e.exports.decodePath=function(N){return ge(N)},e.exports.encodePath=function(N){return he(N)},e.exports.findRefs=function(N,G){return be(N,G)},e.exports.findRefsAt=function(N,G){return function(oe,Z){var ie=Promise.resolve();return ie=ie.then(function(){if(!o.isString(oe))throw new TypeError("location must be a string");return o.isUndefined(Z)&&(Z={}),o.isObject(Z)&&(Z.location=oe),$((Z=W(Z)).location,Z)}).then(function(re){var Se=o.cloneDeep(g[Z.location]),Pe=o.cloneDeep(Z);return o.isUndefined(Se.refs)&&(delete Pe.filter,delete Pe.subDocPath,Pe.includeInvalid=!0,g[Z.location].refs=be(re,Pe)),o.isUndefined(Z.filter)||(Pe.filter=Z.filter),{refs:be(re,Pe),value:re}})}(N,G)},e.exports.getRefDetails=function(N){return De(N)},e.exports.isPtr=function(N,G){return Be(N,G)},e.exports.isRef=function(N,G){return function(oe,Z){return L(oe,Z)&&De(oe).type!=="invalid"}(N,G)},e.exports.pathFromPtr=function(N){return X(N)},e.exports.pathToPtr=function(N,G){return ne(N,G)},e.exports.resolveRefs=function(N,G){return _e(N,G)},e.exports.resolveRefsAt=function(N,G){return function(oe,Z){var ie=Promise.resolve();return ie=ie.then(function(){if(!o.isString(oe))throw new TypeError("location must be a string");return o.isUndefined(Z)&&(Z={}),o.isObject(Z)&&(Z.location=oe),$((Z=W(Z)).location,Z)}).then(function(re){return _e(re,Z).then(function(Se){return{refs:Se.refs,resolved:Se.resolved,value:re}})})}(N,G)}}).call(this,n(13))},function(e,t,n){(function(r,o){var i;function l(s){return(l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c})(s)}/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(){var s="Expected a function",c="__lodash_placeholder__",f=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],h="[object Arguments]",p="[object Array]",g="[object Boolean]",y="[object Date]",b="[object Error]",E="[object Function]",O="[object GeneratorFunction]",_="[object Map]",w="[object Number]",S="[object Object]",k="[object RegExp]",C="[object Set]",$="[object String]",L="[object Symbol]",U="[object WeakMap]",ce="[object ArrayBuffer]",z="[object DataView]",K="[object Float32Array]",W="[object Float64Array]",ge="[object Int8Array]",he="[object Int16Array]",be="[object Int32Array]",De="[object Uint8Array]",Be="[object Uint16Array]",X="[object Uint32Array]",ne=/\b__p \+= '';/g,_e=/\b(__p \+=) '' \+/g,N=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,oe=/[&<>"']/g,Z=RegExp(G.source),ie=RegExp(oe.source),re=/<%-([\s\S]+?)%>/g,Se=/<%([\s\S]+?)%>/g,Pe=/<%=([\s\S]+?)%>/g,Fe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ke=/^\w*$/,He=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xe=/[\\^$.*+?()[\]{}|]/g,Xe=RegExp(xe.source),rt=/^\s+|\s+$/g,Ie=/^\s+/,Ze=/\s+$/,gt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Mt=/\{\n\/\* \[wrapped with (.+)\] \*/,jt=/,? & /,yt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,kt=/\\(\\)?/g,$e=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Bt=/\w*$/,se=/^[-+]0x[0-9a-f]+$/i,Oe=/^0b[01]+$/i,pt=/^\[object .+?Constructor\]$/,Rt=/^0o[0-7]+$/i,Yt=/^(?:0|[1-9]\d*)$/,Pn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,dn=/($^)/,pn=/['\n\r\u2028\u2029\\]/g,Rn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Xn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",A="[\\ud800-\\udfff]",R="["+Xn+"]",I="["+Rn+"]",q="\\d+",V="[\\u2700-\\u27bf]",de="[a-z\\xdf-\\xf6\\xf8-\\xff]",ve="[^\\ud800-\\udfff"+Xn+q+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Ge="\\ud83c[\\udffb-\\udfff]",st="[^\\ud800-\\udfff]",Re="(?:\\ud83c[\\udde6-\\uddff]){2}",ct="[\\ud800-\\udbff][\\udc00-\\udfff]",lt="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ft="(?:"+de+"|"+ve+")",ut="(?:"+lt+"|"+ve+")",Ht="(?:"+I+"|"+Ge+")?",bt="[\\ufe0e\\ufe0f]?"+Ht+("(?:\\u200d(?:"+[st,Re,ct].join("|")+")[\\ufe0e\\ufe0f]?"+Ht+")*"),Tt="(?:"+[V,Re,ct].join("|")+")"+bt,bn="(?:"+[st+I+"?",I,Re,ct,A].join("|")+")",Un=RegExp("['’]","g"),pr=RegExp(I,"g"),Zn=RegExp(Ge+"(?="+Ge+")|"+bn+bt,"g"),vn=RegExp([lt+"?"+de+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[R,lt,"$"].join("|")+")",ut+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[R,lt+Ft,"$"].join("|")+")",lt+"?"+Ft+"+(?:['’](?:d|ll|m|re|s|t|ve))?",lt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",q,Tt].join("|"),"g"),Xt=RegExp("[\\u200d\\ud800-\\udfff"+Rn+"\\ufe0e\\ufe0f]"),Wr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,hr=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],pi=-1,ht={};ht[K]=ht[W]=ht[ge]=ht[he]=ht[be]=ht[De]=ht["[object Uint8ClampedArray]"]=ht[Be]=ht[X]=!0,ht[h]=ht[p]=ht[ce]=ht[g]=ht[z]=ht[y]=ht[b]=ht[E]=ht[_]=ht[w]=ht[S]=ht[k]=ht[C]=ht[$]=ht[U]=!1;var mt={};mt[h]=mt[p]=mt[ce]=mt[z]=mt[g]=mt[y]=mt[K]=mt[W]=mt[ge]=mt[he]=mt[be]=mt[_]=mt[w]=mt[S]=mt[k]=mt[C]=mt[$]=mt[L]=mt[De]=mt["[object Uint8ClampedArray]"]=mt[Be]=mt[X]=!0,mt[b]=mt[E]=mt[U]=!1;var ke={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},F=parseFloat,ae=parseInt,ye=(r===void 0?"undefined":l(r))=="object"&&r&&r.Object===Object&&r,vt=(typeof self>"u"?"undefined":l(self))=="object"&&self&&self.Object===Object&&self,Qe=ye||vt||Function("return this")(),rn=l(t)=="object"&&t&&!t.nodeType&&t,Zt=rn&&l(o)=="object"&&o&&!o.nodeType&&o,Gr=Zt&&Zt.exports===rn,ao=Gr&&ye.process,Ct=function(){try{var H=Zt&&Zt.require&&Zt.require("util").types;return H||ao&&ao.binding&&ao.binding("util")}catch{}}(),Va=Ct&&Ct.isArrayBuffer,qa=Ct&&Ct.isDate,Ig=Ct&&Ct.isMap,Lg=Ct&&Ct.isRegExp,Mg=Ct&&Ct.isSet,Fg=Ct&&Ct.isTypedArray;function Jn(H,ee,J){switch(J.length){case 0:return H.call(ee);case 1:return H.call(ee,J[0]);case 2:return H.call(ee,J[0],J[1]);case 3:return H.call(ee,J[0],J[1],J[2])}return H.apply(ee,J)}function Hx(H,ee,J,pe){for(var Ve=-1,ft=H==null?0:H.length;++Ve-1}function df(H,ee,J){for(var pe=-1,Ve=H==null?0:H.length;++pe-1;);return J}function Vg(H,ee){for(var J=H.length;J--&&Wi(ee,H[J],0)>-1;);return J}function Kx(H,ee){for(var J=H.length,pe=0;J--;)H[J]===ee&&++pe;return pe}var Qx=mf({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Yx=mf({"&":"&","<":"<",">":">",'"':""","'":"'"});function Xx(H){return"\\"+ke[H]}function Gi(H){return Xt.test(H)}function _f(H){var ee=-1,J=Array(H.size);return H.forEach(function(pe,Ve){J[++ee]=[Ve,pe]}),J}function qg(H,ee){return function(J){return H(ee(J))}}function Ro(H,ee){for(var J=-1,pe=H.length,Ve=0,ft=[];++J",""":'"',"'":"'"}),$o=function H(ee){var J,pe=(ee=ee==null?Qe:$o.defaults(Qe.Object(),ee,$o.pick(Qe,hr))).Array,Ve=ee.Date,ft=ee.Error,an=ee.Function,Vr=ee.Math,$t=ee.Object,xf=ee.RegExp,eb=ee.String,mr=ee.TypeError,xu=pe.prototype,tb=an.prototype,qi=$t.prototype,bu=ee["__core-js_shared__"],Su=tb.toString,St=qi.hasOwnProperty,nb=0,Kg=(J=/[^.]+$/.exec(bu&&bu.keys&&bu.keys.IE_PROTO||""))?"Symbol(src)_1."+J:"",Eu=qi.toString,rb=Su.call($t),ob=Qe._,ib=xf("^"+Su.call(St).replace(xe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ku=Gr?ee.Buffer:void 0,No=ee.Symbol,Tu=ee.Uint8Array,Qg=ku?ku.allocUnsafe:void 0,Cu=qg($t.getPrototypeOf,$t),Yg=$t.create,Xg=qi.propertyIsEnumerable,Ou=xu.splice,Zg=No?No.isConcatSpreadable:void 0,Qa=No?No.iterator:void 0,hi=No?No.toStringTag:void 0,Au=function(){try{var a=yi($t,"defineProperty");return a({},"",{}),a}catch{}}(),ab=ee.clearTimeout!==Qe.clearTimeout&&ee.clearTimeout,lb=Ve&&Ve.now!==Qe.Date.now&&Ve.now,ub=ee.setTimeout!==Qe.setTimeout&&ee.setTimeout,ju=Vr.ceil,Pu=Vr.floor,bf=$t.getOwnPropertySymbols,sb=ku?ku.isBuffer:void 0,Jg=ee.isFinite,cb=xu.join,fb=qg($t.keys,$t),ln=Vr.max,Sn=Vr.min,db=Ve.now,pb=ee.parseInt,em=Vr.random,hb=xu.reverse,Sf=yi(ee,"DataView"),Ya=yi(ee,"Map"),Ef=yi(ee,"Promise"),Ki=yi(ee,"Set"),Xa=yi(ee,"WeakMap"),Za=yi($t,"create"),Ru=Xa&&new Xa,Qi={},gb=wi(Sf),mb=wi(Ya),vb=wi(Ef),yb=wi(Ki),wb=wi(Xa),$u=No?No.prototype:void 0,Ja=$u?$u.valueOf:void 0,tm=$u?$u.toString:void 0;function x(a){if(Jt(a)&&!qe(a)&&!(a instanceof it)){if(a instanceof vr)return a;if(St.call(a,"__wrapped__"))return nv(a)}return new vr(a)}var Yi=function(){function a(){}return function(u){if(!Gt(u))return{};if(Yg)return Yg(u);a.prototype=u;var d=new a;return a.prototype=void 0,d}}();function Nu(){}function vr(a,u){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=void 0}function it(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function gi(a){var u=-1,d=a==null?0:a.length;for(this.clear();++u=u?a:u)),a}function yr(a,u,d,m,v,T){var P,D=1&u,B=2&u,Y=4&u;if(d&&(P=v?d(a,m,v,T):d(a)),P!==void 0)return P;if(!Gt(a))return a;var Q=qe(a);if(Q){if(P=function(te){var fe=te.length,ze=new te.constructor(fe);return fe&&typeof te[0]=="string"&&St.call(te,"index")&&(ze.index=te.index,ze.input=te.input),ze}(a),!D)return Bn(a,P)}else{var le=En(a),Te=le==E||le==O;if(Fo(a))return Om(a,D);if(le==S||le==h||Te&&!v){if(P=B||Te?{}:qm(a),!D)return B?function(te,fe){return Kr(te,Gm(te),fe)}(a,function(te,fe){return te&&Kr(fe,Wn(fe),te)}(P,a)):function(te,fe){return Kr(te,Qf(te),fe)}(a,om(P,a))}else{if(!mt[le])return v?a:{};P=function(te,fe,ze){var Ee=te.constructor;switch(fe){case ce:return Bf(te);case g:case y:return new Ee(+te);case z:return function(We,nt){var Ae=nt?Bf(We.buffer):We.buffer;return new We.constructor(Ae,We.byteOffset,We.byteLength)}(te,ze);case K:case W:case ge:case he:case be:case De:case"[object Uint8ClampedArray]":case Be:case X:return Am(te,ze);case _:return new Ee;case w:case $:return new Ee(te);case k:return function(We){var nt=new We.constructor(We.source,Bt.exec(We));return nt.lastIndex=We.lastIndex,nt}(te);case C:return new Ee;case L:return Ue=te,Ja?$t(Ja.call(Ue)):{}}var Ue}(a,le,D)}}T||(T=new Rr);var Ce=T.get(a);if(Ce)return Ce;T.set(a,P),_v(a)?a.forEach(function(te){P.add(yr(te,u,d,te,a,T))}):yv(a)&&a.forEach(function(te,fe){P.set(fe,yr(te,u,d,fe,a,T))});var Le=Q?void 0:(Y?B?Vf:Gf:B?Wn:hn)(a);return gr(Le||a,function(te,fe){Le&&(te=a[fe=te]),el(P,fe,yr(te,u,d,fe,a,T))}),P}function im(a,u,d){var m=d.length;if(a==null)return!m;for(a=$t(a);m--;){var v=d[m],T=u[v],P=a[v];if(P===void 0&&!(v in a)||!T(P))return!1}return!0}function am(a,u,d){if(typeof a!="function")throw new mr(s);return ll(function(){a.apply(void 0,d)},u)}function tl(a,u,d,m){var v=-1,T=yu,P=!0,D=a.length,B=[],Y=u.length;if(!D)return B;d&&(u=Wt(u,er(d))),m?(T=df,P=!1):u.length>=200&&(T=Ka,P=!1,u=new mi(u));e:for(;++v-1},lo.prototype.set=function(a,u){var d=this.__data__,m=Du(d,a);return m<0?(++this.size,d.push([a,u])):d[m][1]=u,this},uo.prototype.clear=function(){this.size=0,this.__data__={hash:new gi,map:new(Ya||lo),string:new gi}},uo.prototype.delete=function(a){var u=qu(this,a).delete(a);return this.size-=u?1:0,u},uo.prototype.get=function(a){return qu(this,a).get(a)},uo.prototype.has=function(a){return qu(this,a).has(a)},uo.prototype.set=function(a,u){var d=qu(this,a),m=d.size;return d.set(a,u),this.size+=d.size==m?0:1,this},mi.prototype.add=mi.prototype.push=function(a){return this.__data__.set(a,"__lodash_hash_undefined__"),this},mi.prototype.has=function(a){return this.__data__.has(a)},Rr.prototype.clear=function(){this.__data__=new lo,this.size=0},Rr.prototype.delete=function(a){var u=this.__data__,d=u.delete(a);return this.size=u.size,d},Rr.prototype.get=function(a){return this.__data__.get(a)},Rr.prototype.has=function(a){return this.__data__.has(a)},Rr.prototype.set=function(a,u){var d=this.__data__;if(d instanceof lo){var m=d.__data__;if(!Ya||m.length<199)return m.push([a,u]),this.size=++d.size,this;d=this.__data__=new uo(m)}return d.set(a,u),this.size=d.size,this};var Do=$m(qr),lm=$m(Of,!0);function Sb(a,u){var d=!0;return Do(a,function(m,v,T){return d=!!u(m,v,T)}),d}function Iu(a,u,d){for(var m=-1,v=a.length;++m0&&d(D)?u>1?yn(D,u-1,d,m,v):Po(v,D):m||(v[v.length]=D)}return v}var Cf=Nm(),sm=Nm(!0);function qr(a,u){return a&&Cf(a,u,hn)}function Of(a,u){return a&&sm(a,u,hn)}function Lu(a,u){return jo(u,function(d){return ho(a[d])})}function Xi(a,u){for(var d=0,m=(u=Lo(u,a)).length;a!=null&&du}function Eb(a,u){return a!=null&&St.call(a,u)}function kb(a,u){return a!=null&&u in $t(a)}function jf(a,u,d){for(var m=d?df:yu,v=a[0].length,T=a.length,P=T,D=pe(T),B=1/0,Y=[];P--;){var Q=a[P];P&&u&&(Q=Wt(Q,er(u))),B=Sn(Q.length,B),D[P]=!d&&(u||v>=120&&Q.length>=120)?new mi(P&&Q):void 0}Q=a[0];var le=-1,Te=D[0];e:for(;++le=Ce)return Le;var te=B[Y];return Le*(te=="desc"?-1:1)}}return P.index-D.index}(v,T,d)})}function wm(a,u,d){for(var m=-1,v=u.length,T={};++m-1;)D!==a&&Ou.call(D,B,1),Ou.call(a,B,1);return a}function _m(a,u){for(var d=a?u.length:0,m=d-1;d--;){var v=u[d];if(d==m||v!==T){var T=v;po(v)?Ou.call(a,v,1):Mf(a,v)}}return a}function Df(a,u){return a+Pu(em()*(u-a+1))}function If(a,u){var d="";if(!a||u<1||u>9007199254740991)return d;do u%2&&(d+=a),(u=Pu(u/2))&&(a+=a);while(u);return d}function tt(a,u){return Jf(Ym(a,u,Gn),a+"")}function Cb(a){return rm(na(a))}function Ob(a,u){var d=na(a);return Ku(d,vi(u,0,d.length))}function ol(a,u,d,m){if(!Gt(a))return a;for(var v=-1,T=(u=Lo(u,a)).length,P=T-1,D=a;D!=null&&++vv?0:v+u),(d=d>v?v:d)<0&&(d+=v),v=u>d?0:d-u>>>0,u>>>=0;for(var T=pe(v);++m>>1,P=a[T];P!==null&&!nr(P)&&(d?P<=u:P=200){var Y=u?null:$b(a);if(Y)return _u(Y);P=!1,v=Ka,B=new mi}else B=u?[]:D;e:for(;++m=m?a:wr(a,u,d)}var Cm=ab||function(a){return Qe.clearTimeout(a)};function Om(a,u){if(u)return a.slice();var d=a.length,m=Qg?Qg(d):new a.constructor(d);return a.copy(m),m}function Bf(a){var u=new a.constructor(a.byteLength);return new Tu(u).set(new Tu(a)),u}function Am(a,u){var d=u?Bf(a.buffer):a.buffer;return new a.constructor(d,a.byteOffset,a.length)}function jm(a,u){if(a!==u){var d=a!==void 0,m=a===null,v=a==a,T=nr(a),P=u!==void 0,D=u===null,B=u==u,Y=nr(u);if(!D&&!Y&&!T&&a>u||T&&P&&B&&!D&&!Y||m&&P&&B||!d&&B||!v)return 1;if(!m&&!T&&!Y&&a1?d[v-1]:void 0,P=v>2?d[2]:void 0;for(T=a.length>3&&typeof T=="function"?(v--,T):void 0,P&&Nn(d[0],d[1],P)&&(T=v<3?void 0:T,v=1),u=$t(u);++m-1?v[T?u[P]:P]:void 0}}function Lm(a){return fo(function(u){var d=u.length,m=d,v=vr.prototype.thru;for(a&&u.reverse();m--;){var T=u[m];if(typeof T!="function")throw new mr(s);if(v&&!P&&Vu(T)=="wrapper")var P=new vr([],!0)}for(m=P?m:d;++m1&&Ee.reverse(),Q&&BD))return!1;var Y=T.get(a);if(Y&&T.get(u))return Y==u;var Q=-1,le=!0,Te=2&d?new mi:void 0;for(T.set(a,u),T.set(u,a);++Q-1&&a%1==0&&a1?"& ":"")+T[D],T=T.join(P>2?", ":" "),v.replace(gt,`{ +/* [wrapped with `+T+`] */ +`)}(m,function(v,T){return gr(f,function(P){var D="_."+P[0];T&P[1]&&!yu(v,D)&&v.push(D)}),v.sort()}(function(v){var T=v.match(Mt);return T?T[1].split(jt):[]}(m),d)))}function ev(a){var u=0,d=0;return function(){var m=db(),v=16-(m-d);if(d=m,v>0){if(++u>=800)return arguments[0]}else u=0;return a.apply(void 0,arguments)}}function Ku(a,u){var d=-1,m=a.length,v=m-1;for(u=u===void 0?m:u;++d1?a[u-1]:void 0;return d=typeof d=="function"?(a.pop(),d):void 0,uv(a,d)});function sv(a){var u=x(a);return u.__chain__=!0,u}function Qu(a,u){return u(a)}var tS=fo(function(a){var u=a.length,d=u?a[0]:0,m=this.__wrapped__,v=function(T){return Tf(T,a)};return!(u>1||this.__actions__.length)&&m instanceof it&&po(d)?((m=m.slice(d,+d+(u?1:0))).__actions__.push({func:Qu,args:[v],thisArg:void 0}),new vr(m,this.__chain__).thru(function(T){return u&&!T.length&&T.push(void 0),T})):this.thru(v)}),nS=Uu(function(a,u,d){St.call(a,d)?++a[d]:so(a,d,1)}),rS=Im(rv),oS=Im(ov);function cv(a,u){return(qe(a)?gr:Do)(a,Ne(u,3))}function fv(a,u){return(qe(a)?Wx:lm)(a,Ne(u,3))}var iS=Uu(function(a,u,d){St.call(a,d)?a[d].push(u):so(a,d,[u])}),aS=tt(function(a,u,d){var m=-1,v=typeof u=="function",T=Hn(a)?pe(a.length):[];return Do(a,function(P){T[++m]=v?Jn(u,P,d):nl(P,u,d)}),T}),lS=Uu(function(a,u,d){so(a,d,u)});function Yu(a,u){return(qe(a)?Wt:hm)(a,Ne(u,3))}var uS=Uu(function(a,u,d){a[d?0:1].push(u)},function(){return[[],[]]}),sS=tt(function(a,u){if(a==null)return[];var d=u.length;return d>1&&Nn(a,u[0],u[1])?u=[]:d>2&&Nn(u[0],u[1],u[2])&&(u=[u[0]]),ym(a,yn(u,1),[])}),Xu=lb||function(){return Qe.Date.now()};function dv(a,u,d){return u=d?void 0:u,co(a,128,void 0,void 0,void 0,void 0,u=a&&u==null?a.length:u)}function pv(a,u){var d;if(typeof u!="function")throw new mr(s);return a=Ye(a),function(){return--a>0&&(d=u.apply(this,arguments)),a<=1&&(u=void 0),d}}var nd=tt(function(a,u,d){var m=1;if(d.length){var v=Ro(d,ea(nd));m|=32}return co(a,m,u,d,v)}),hv=tt(function(a,u,d){var m=3;if(d.length){var v=Ro(d,ea(hv));m|=32}return co(u,m,a,d,v)});function gv(a,u,d){var m,v,T,P,D,B,Y=0,Q=!1,le=!1,Te=!0;if(typeof a!="function")throw new mr(s);function Ce(Ue){var We=m,nt=v;return m=v=void 0,Y=Ue,P=a.apply(nt,We)}function Le(Ue){return Y=Ue,D=ll(fe,u),Q?Ce(Ue):P}function te(Ue){var We=Ue-B;return B===void 0||We>=u||We<0||le&&Ue-Y>=T}function fe(){var Ue=Xu();if(te(Ue))return ze(Ue);D=ll(fe,function(We){var nt=u-(We-B);return le?Sn(nt,T-(We-Y)):nt}(Ue))}function ze(Ue){return D=void 0,Te&&m?Ce(Ue):(m=v=void 0,P)}function Ee(){var Ue=Xu(),We=te(Ue);if(m=arguments,v=this,B=Ue,We){if(D===void 0)return Le(B);if(le)return Cm(D),D=ll(fe,u),Ce(B)}return D===void 0&&(D=ll(fe,u)),P}return u=xr(u)||0,Gt(d)&&(Q=!!d.leading,T=(le="maxWait"in d)?ln(xr(d.maxWait)||0,u):T,Te="trailing"in d?!!d.trailing:Te),Ee.cancel=function(){D!==void 0&&Cm(D),Y=0,m=B=v=D=void 0},Ee.flush=function(){return D===void 0?P:ze(Xu())},Ee}var cS=tt(function(a,u){return am(a,1,u)}),fS=tt(function(a,u,d){return am(a,xr(u)||0,d)});function Zu(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new mr(s);var d=function m(){var v=arguments,T=u?u.apply(this,v):v[0],P=m.cache;if(P.has(T))return P.get(T);var D=a.apply(this,v);return m.cache=P.set(T,D)||P,D};return d.cache=new(Zu.Cache||uo),d}function Ju(a){if(typeof a!="function")throw new mr(s);return function(){var u=arguments;switch(u.length){case 0:return!a.call(this);case 1:return!a.call(this,u[0]);case 2:return!a.call(this,u[0],u[1]);case 3:return!a.call(this,u[0],u[1],u[2])}return!a.apply(this,u)}}Zu.Cache=uo;var dS=Rb(function(a,u){var d=(u=u.length==1&&qe(u[0])?Wt(u[0],er(Ne())):Wt(yn(u,1),er(Ne()))).length;return tt(function(m){for(var v=-1,T=Sn(m.length,d);++v=u}),_i=fm(function(){return arguments}())?fm:function(a){return Jt(a)&&St.call(a,"callee")&&!Xg.call(a,"callee")},qe=pe.isArray,mS=Va?er(Va):function(a){return Jt(a)&&$n(a)==ce};function Hn(a){return a!=null&&es(a.length)&&!ho(a)}function tn(a){return Jt(a)&&Hn(a)}var Fo=sb||hd,vS=qa?er(qa):function(a){return Jt(a)&&$n(a)==y};function od(a){if(!Jt(a))return!1;var u=$n(a);return u==b||u=="[object DOMException]"||typeof a.message=="string"&&typeof a.name=="string"&&!ul(a)}function ho(a){if(!Gt(a))return!1;var u=$n(a);return u==E||u==O||u=="[object AsyncFunction]"||u=="[object Proxy]"}function vv(a){return typeof a=="number"&&a==Ye(a)}function es(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=9007199254740991}function Gt(a){var u=l(a);return a!=null&&(u=="object"||u=="function")}function Jt(a){return a!=null&&l(a)=="object"}var yv=Ig?er(Ig):function(a){return Jt(a)&&En(a)==_};function wv(a){return typeof a=="number"||Jt(a)&&$n(a)==w}function ul(a){if(!Jt(a)||$n(a)!=S)return!1;var u=Cu(a);if(u===null)return!0;var d=St.call(u,"constructor")&&u.constructor;return typeof d=="function"&&d instanceof d&&Su.call(d)==rb}var id=Lg?er(Lg):function(a){return Jt(a)&&$n(a)==k},_v=Mg?er(Mg):function(a){return Jt(a)&&En(a)==C};function ts(a){return typeof a=="string"||!qe(a)&&Jt(a)&&$n(a)==$}function nr(a){return l(a)=="symbol"||Jt(a)&&$n(a)==L}var ta=Fg?er(Fg):function(a){return Jt(a)&&es(a.length)&&!!ht[$n(a)]},yS=Gu($f),wS=Gu(function(a,u){return a<=u});function xv(a){if(!a)return[];if(Hn(a))return ts(a)?Pr(a):Bn(a);if(Qa&&a[Qa])return function(d){for(var m,v=[];!(m=d.next()).done;)v.push(m.value);return v}(a[Qa]());var u=En(a);return(u==_?_f:u==C?_u:na)(a)}function go(a){return a?(a=xr(a))===1/0||a===-1/0?17976931348623157e292*(a<0?-1:1):a==a?a:0:a===0?a:0}function Ye(a){var u=go(a),d=u%1;return u==u?d?u-d:u:0}function bv(a){return a?vi(Ye(a),0,4294967295):0}function xr(a){if(typeof a=="number")return a;if(nr(a))return NaN;if(Gt(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=Gt(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=a.replace(rt,"");var d=Oe.test(a);return d||Rt.test(a)?ae(a.slice(2),d?2:8):se.test(a)?NaN:+a}function Sv(a){return Kr(a,Wn(a))}function wt(a){return a==null?"":tr(a)}var _S=Zi(function(a,u){if(al(u)||Hn(u))Kr(u,hn(u),a);else for(var d in u)St.call(u,d)&&el(a,d,u[d])}),Ev=Zi(function(a,u){Kr(u,Wn(u),a)}),ns=Zi(function(a,u,d,m){Kr(u,Wn(u),a,m)}),xS=Zi(function(a,u,d,m){Kr(u,hn(u),a,m)}),bS=fo(Tf),SS=tt(function(a,u){a=$t(a);var d=-1,m=u.length,v=m>2?u[2]:void 0;for(v&&Nn(u[0],u[1],v)&&(m=1);++d1),T}),Kr(a,Vf(a),d),m&&(d=yr(d,7,Nb));for(var v=u.length;v--;)Mf(d,u[v]);return d}),jS=fo(function(a,u){return a==null?{}:function(d,m){return wm(d,m,function(v,T){return ld(d,T)})}(a,u)});function Tv(a,u){if(a==null)return{};var d=Wt(Vf(a),function(m){return[m]});return u=Ne(u),wm(a,d,function(m,v){return u(m,v[0])})}var Cv=Um(hn),Ov=Um(Wn);function na(a){return a==null?[]:wf(a,hn(a))}var PS=Ji(function(a,u,d){return u=u.toLowerCase(),a+(d?Av(u):u)});function Av(a){return ud(wt(a).toLowerCase())}function jv(a){return(a=wt(a))&&a.replace(Pn,Qx).replace(pr,"")}var RS=Ji(function(a,u,d){return a+(d?"-":"")+u.toLowerCase()}),$S=Ji(function(a,u,d){return a+(d?" ":"")+u.toLowerCase()}),NS=Dm("toLowerCase"),DS=Ji(function(a,u,d){return a+(d?"_":"")+u.toLowerCase()}),IS=Ji(function(a,u,d){return a+(d?" ":"")+ud(u)}),LS=Ji(function(a,u,d){return a+(d?" ":"")+u.toUpperCase()}),ud=Dm("toUpperCase");function Pv(a,u,d){return a=wt(a),(u=d?void 0:u)===void 0?function(m){return Wr.test(m)}(a)?function(m){return m.match(vn)||[]}(a):function(m){return m.match(yt)||[]}(a):a.match(u)||[]}var Rv=tt(function(a,u){try{return Jn(a,void 0,u)}catch(d){return od(d)?d:new ft(d)}}),MS=fo(function(a,u){return gr(u,function(d){d=Qr(d),so(a,d,nd(a[d],a))}),a});function sd(a){return function(){return a}}var FS=Lm(),zS=Lm(!0);function Gn(a){return a}function cd(a){return pm(typeof a=="function"?a:yr(a,1))}var US=tt(function(a,u){return function(d){return nl(d,a,u)}}),BS=tt(function(a,u){return function(d){return nl(a,d,u)}});function fd(a,u,d){var m=hn(u),v=Lu(u,m);d!=null||Gt(u)&&(v.length||!m.length)||(d=u,u=a,a=this,v=Lu(u,hn(u)));var T=!(Gt(d)&&"chain"in d&&!d.chain),P=ho(a);return gr(v,function(D){var B=u[D];a[D]=B,P&&(a.prototype[D]=function(){var Y=this.__chain__;if(T||Y){var Q=a(this.__wrapped__),le=Q.__actions__=Bn(this.__actions__);return le.push({func:B,args:arguments,thisArg:a}),Q.__chain__=Y,Q}return B.apply(a,Po([this.value()],arguments))})}),a}function dd(){}var HS=Hf(Wt),WS=Hf(zg),GS=Hf(hf);function $v(a){return Yf(a)?gf(Qr(a)):function(u){return function(d){return Xi(d,u)}}(a)}var VS=Fm(),qS=Fm(!0);function pd(){return[]}function hd(){return!1}var KS=Hu(function(a,u){return a+u},0),QS=Wf("ceil"),YS=Hu(function(a,u){return a/u},1),XS=Wf("floor"),gd,ZS=Hu(function(a,u){return a*u},1),JS=Wf("round"),eE=Hu(function(a,u){return a-u},0);return x.after=function(a,u){if(typeof u!="function")throw new mr(s);return a=Ye(a),function(){if(--a<1)return u.apply(this,arguments)}},x.ary=dv,x.assign=_S,x.assignIn=Ev,x.assignInWith=ns,x.assignWith=xS,x.at=bS,x.before=pv,x.bind=nd,x.bindAll=MS,x.bindKey=hv,x.castArray=function(){if(!arguments.length)return[];var a=arguments[0];return qe(a)?a:[a]},x.chain=sv,x.chunk=function(a,u,d){u=(d?Nn(a,u,d):u===void 0)?1:ln(Ye(u),0);var m=a==null?0:a.length;if(!m||u<1)return[];for(var v=0,T=0,P=pe(ju(m/u));vY?0:Y+D),(B=B===void 0||B>Y?Y:Ye(B))<0&&(B+=Y),B=D>B?0:bv(B);D>>0)?(a=wt(a))&&(typeof u=="string"||u!=null&&!id(u))&&!(u=tr(u))&&Gi(a)?Mo(Pr(a),0,d):a.split(u,d):[]},x.spread=function(a,u){if(typeof a!="function")throw new mr(s);return u=u==null?0:ln(Ye(u),0),tt(function(d){var m=d[u],v=Mo(d,0,u);return m&&Po(v,m),Jn(a,this,v)})},x.tail=function(a){var u=a==null?0:a.length;return u?wr(a,1,u):[]},x.take=function(a,u,d){return a&&a.length?wr(a,0,(u=d||u===void 0?1:Ye(u))<0?0:u):[]},x.takeRight=function(a,u,d){var m=a==null?0:a.length;return m?wr(a,(u=m-(u=d||u===void 0?1:Ye(u)))<0?0:u,m):[]},x.takeRightWhile=function(a,u){return a&&a.length?zu(a,Ne(u,3),!1,!0):[]},x.takeWhile=function(a,u){return a&&a.length?zu(a,Ne(u,3)):[]},x.tap=function(a,u){return u(a),a},x.throttle=function(a,u,d){var m=!0,v=!0;if(typeof a!="function")throw new mr(s);return Gt(d)&&(m="leading"in d?!!d.leading:m,v="trailing"in d?!!d.trailing:v),gv(a,u,{leading:m,maxWait:u,trailing:v})},x.thru=Qu,x.toArray=xv,x.toPairs=Cv,x.toPairsIn=Ov,x.toPath=function(a){return qe(a)?Wt(a,Qr):nr(a)?[a]:Bn(tv(wt(a)))},x.toPlainObject=Sv,x.transform=function(a,u,d){var m=qe(a),v=m||Fo(a)||ta(a);if(u=Ne(u,4),d==null){var T=a&&a.constructor;d=v?m?new T:[]:Gt(a)&&ho(T)?Yi(Cu(a)):{}}return(v?gr:qr)(a,function(P,D,B){return u(d,P,D,B)}),d},x.unary=function(a){return dv(a,1)},x.union=Vb,x.unionBy=qb,x.unionWith=Kb,x.uniq=function(a){return a&&a.length?Io(a):[]},x.uniqBy=function(a,u){return a&&a.length?Io(a,Ne(u,2)):[]},x.uniqWith=function(a,u){return u=typeof u=="function"?u:void 0,a&&a.length?Io(a,void 0,u):[]},x.unset=function(a,u){return a==null||Mf(a,u)},x.unzip=td,x.unzipWith=uv,x.update=function(a,u,d){return a==null?a:Em(a,u,Uf(d))},x.updateWith=function(a,u,d,m){return m=typeof m=="function"?m:void 0,a==null?a:Em(a,u,Uf(d),m)},x.values=na,x.valuesIn=function(a){return a==null?[]:wf(a,Wn(a))},x.without=Qb,x.words=Pv,x.wrap=function(a,u){return rd(Uf(u),a)},x.xor=Yb,x.xorBy=Xb,x.xorWith=Zb,x.zip=Jb,x.zipObject=function(a,u){return Tm(a||[],u||[],el)},x.zipObjectDeep=function(a,u){return Tm(a||[],u||[],ol)},x.zipWith=eS,x.entries=Cv,x.entriesIn=Ov,x.extend=Ev,x.extendWith=ns,fd(x,x),x.add=KS,x.attempt=Rv,x.camelCase=PS,x.capitalize=Av,x.ceil=QS,x.clamp=function(a,u,d){return d===void 0&&(d=u,u=void 0),d!==void 0&&(d=(d=xr(d))==d?d:0),u!==void 0&&(u=(u=xr(u))==u?u:0),vi(xr(a),u,d)},x.clone=function(a){return yr(a,4)},x.cloneDeep=function(a){return yr(a,5)},x.cloneDeepWith=function(a,u){return yr(a,5,u=typeof u=="function"?u:void 0)},x.cloneWith=function(a,u){return yr(a,4,u=typeof u=="function"?u:void 0)},x.conformsTo=function(a,u){return u==null||im(a,u,hn(u))},x.deburr=jv,x.defaultTo=function(a,u){return a==null||a!=a?u:a},x.divide=YS,x.endsWith=function(a,u,d){a=wt(a),u=tr(u);var m=a.length,v=d=d===void 0?m:vi(Ye(d),0,m);return(d-=u.length)>=0&&a.slice(d,v)==u},x.eq=$r,x.escape=function(a){return(a=wt(a))&&ie.test(a)?a.replace(oe,Yx):a},x.escapeRegExp=function(a){return(a=wt(a))&&Xe.test(a)?a.replace(xe,"\\$&"):a},x.every=function(a,u,d){var m=qe(a)?zg:Sb;return d&&Nn(a,u,d)&&(u=void 0),m(a,Ne(u,3))},x.find=rS,x.findIndex=rv,x.findKey=function(a,u){return Ug(a,Ne(u,3),qr)},x.findLast=oS,x.findLastIndex=ov,x.findLastKey=function(a,u){return Ug(a,Ne(u,3),Of)},x.floor=XS,x.forEach=cv,x.forEachRight=fv,x.forIn=function(a,u){return a==null?a:Cf(a,Ne(u,3),Wn)},x.forInRight=function(a,u){return a==null?a:sm(a,Ne(u,3),Wn)},x.forOwn=function(a,u){return a&&qr(a,Ne(u,3))},x.forOwnRight=function(a,u){return a&&Of(a,Ne(u,3))},x.get=ad,x.gt=hS,x.gte=gS,x.has=function(a,u){return a!=null&&Vm(a,u,Eb)},x.hasIn=ld,x.head=av,x.identity=Gn,x.includes=function(a,u,d,m){a=Hn(a)?a:na(a),d=d&&!m?Ye(d):0;var v=a.length;return d<0&&(d=ln(v+d,0)),ts(a)?d<=v&&a.indexOf(u,d)>-1:!!v&&Wi(a,u,d)>-1},x.indexOf=function(a,u,d){var m=a==null?0:a.length;if(!m)return-1;var v=d==null?0:Ye(d);return v<0&&(v=ln(m+v,0)),Wi(a,u,v)},x.inRange=function(a,u,d){return u=go(u),d===void 0?(d=u,u=0):d=go(d),function(m,v,T){return m>=Sn(v,T)&&m=-9007199254740991&&a<=9007199254740991},x.isSet=_v,x.isString=ts,x.isSymbol=nr,x.isTypedArray=ta,x.isUndefined=function(a){return a===void 0},x.isWeakMap=function(a){return Jt(a)&&En(a)==U},x.isWeakSet=function(a){return Jt(a)&&$n(a)=="[object WeakSet]"},x.join=function(a,u){return a==null?"":cb.call(a,u)},x.kebabCase=RS,x.last=_r,x.lastIndexOf=function(a,u,d){var m=a==null?0:a.length;if(!m)return-1;var v=m;return d!==void 0&&(v=(v=Ye(d))<0?ln(m+v,0):Sn(v,m-1)),u==u?function(T,P,D){for(var B=D+1;B--;)if(T[B]===P)return B;return B}(a,u,v):wu(a,Bg,v,!0)},x.lowerCase=$S,x.lowerFirst=NS,x.lt=yS,x.lte=wS,x.max=function(a){return a&&a.length?Iu(a,Gn,Af):void 0},x.maxBy=function(a,u){return a&&a.length?Iu(a,Ne(u,2),Af):void 0},x.mean=function(a){return Hg(a,Gn)},x.meanBy=function(a,u){return Hg(a,Ne(u,2))},x.min=function(a){return a&&a.length?Iu(a,Gn,$f):void 0},x.minBy=function(a,u){return a&&a.length?Iu(a,Ne(u,2),$f):void 0},x.stubArray=pd,x.stubFalse=hd,x.stubObject=function(){return{}},x.stubString=function(){return""},x.stubTrue=function(){return!0},x.multiply=ZS,x.nth=function(a,u){return a&&a.length?vm(a,Ye(u)):void 0},x.noConflict=function(){return Qe._===this&&(Qe._=ob),this},x.noop=dd,x.now=Xu,x.pad=function(a,u,d){a=wt(a);var m=(u=Ye(u))?Vi(a):0;if(!u||m>=u)return a;var v=(u-m)/2;return Wu(Pu(v),d)+a+Wu(ju(v),d)},x.padEnd=function(a,u,d){a=wt(a);var m=(u=Ye(u))?Vi(a):0;return u&&mu){var m=a;a=u,u=m}if(d||a%1||u%1){var v=em();return Sn(a+v*(u-a+F("1e-"+((v+"").length-1))),u)}return Df(a,u)},x.reduce=function(a,u,d){var m=qe(a)?pf:Wg,v=arguments.length<3;return m(a,Ne(u,4),d,v,Do)},x.reduceRight=function(a,u,d){var m=qe(a)?Gx:Wg,v=arguments.length<3;return m(a,Ne(u,4),d,v,lm)},x.repeat=function(a,u,d){return u=(d?Nn(a,u,d):u===void 0)?1:Ye(u),If(wt(a),u)},x.replace=function(){var a=arguments,u=wt(a[0]);return a.length<3?u:u.replace(a[1],a[2])},x.result=function(a,u,d){var m=-1,v=(u=Lo(u,a)).length;for(v||(v=1,a=void 0);++m9007199254740991)return[];var d=4294967295,m=Sn(a,4294967295);a-=4294967295;for(var v=yf(m,u=Ne(u));++d=T)return a;var D=d-Vi(m);if(D<1)return m;var B=P?Mo(P,0,D).join(""):a.slice(0,D);if(v===void 0)return B+m;if(P&&(D+=B.length-D),id(v)){if(a.slice(D).search(v)){var Y,Q=B;for(v.global||(v=xf(v.source,wt(Bt.exec(v))+"g")),v.lastIndex=0;Y=v.exec(Q);)var le=Y.index;B=B.slice(0,le===void 0?D:le)}}else if(a.indexOf(tr(v),D)!=D){var Te=B.lastIndexOf(v);Te>-1&&(B=B.slice(0,Te))}return B+m},x.unescape=function(a){return(a=wt(a))&&Z.test(a)?a.replace(G,Jx):a},x.uniqueId=function(a){var u=++nb;return wt(a)+u},x.upperCase=LS,x.upperFirst=ud,x.each=cv,x.eachRight=fv,x.first=av,fd(x,(gd={},qr(x,function(a,u){St.call(x.prototype,u)||(gd[u]=a)}),gd),{chain:!1}),x.VERSION="4.17.15",gr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){x[a].placeholder=x}),gr(["drop","take"],function(a,u){it.prototype[a]=function(d){d=d===void 0?1:ln(Ye(d),0);var m=this.__filtered__&&!u?new it(this):this.clone();return m.__filtered__?m.__takeCount__=Sn(d,m.__takeCount__):m.__views__.push({size:Sn(d,4294967295),type:a+(m.__dir__<0?"Right":"")}),m},it.prototype[a+"Right"]=function(d){return this.reverse()[a](d).reverse()}}),gr(["filter","map","takeWhile"],function(a,u){var d=u+1,m=d==1||d==3;it.prototype[a]=function(v){var T=this.clone();return T.__iteratees__.push({iteratee:Ne(v,3),type:d}),T.__filtered__=T.__filtered__||m,T}}),gr(["head","last"],function(a,u){var d="take"+(u?"Right":"");it.prototype[a]=function(){return this[d](1).value()[0]}}),gr(["initial","tail"],function(a,u){var d="drop"+(u?"":"Right");it.prototype[a]=function(){return this.__filtered__?new it(this):this[d](1)}}),it.prototype.compact=function(){return this.filter(Gn)},it.prototype.find=function(a){return this.filter(a).head()},it.prototype.findLast=function(a){return this.reverse().find(a)},it.prototype.invokeMap=tt(function(a,u){return typeof a=="function"?new it(this):this.map(function(d){return nl(d,a,u)})}),it.prototype.reject=function(a){return this.filter(Ju(Ne(a)))},it.prototype.slice=function(a,u){a=Ye(a);var d=this;return d.__filtered__&&(a>0||u<0)?new it(d):(a<0?d=d.takeRight(-a):a&&(d=d.drop(a)),u!==void 0&&(d=(u=Ye(u))<0?d.dropRight(-u):d.take(u-a)),d)},it.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},it.prototype.toArray=function(){return this.take(4294967295)},qr(it.prototype,function(a,u){var d=/^(?:filter|find|map|reject)|While$/.test(u),m=/^(?:head|last)$/.test(u),v=x[m?"take"+(u=="last"?"Right":""):u],T=m||/^find/.test(u);v&&(x.prototype[u]=function(){var P=this.__wrapped__,D=m?[1]:arguments,B=P instanceof it,Y=D[0],Q=B||qe(P),le=function(ze){var Ee=v.apply(x,Po([ze],D));return m&&Te?Ee[0]:Ee};Q&&d&&typeof Y=="function"&&Y.length!=1&&(B=Q=!1);var Te=this.__chain__,Ce=!!this.__actions__.length,Le=T&&!Te,te=B&&!Ce;if(!T&&Q){P=te?P:new it(this);var fe=a.apply(P,D);return fe.__actions__.push({func:Qu,args:[le],thisArg:void 0}),new vr(fe,Te)}return Le&&te?a.apply(this,D):(fe=this.thru(le),Le?m?fe.value()[0]:fe.value():fe)})}),gr(["pop","push","shift","sort","splice","unshift"],function(a){var u=xu[a],d=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",m=/^(?:pop|shift)$/.test(a);x.prototype[a]=function(){var v=arguments;if(m&&!this.__chain__){var T=this.value();return u.apply(qe(T)?T:[],v)}return this[d](function(P){return u.apply(qe(P)?P:[],v)})}}),qr(it.prototype,function(a,u){var d=x[u];if(d){var m=d.name+"";St.call(Qi,m)||(Qi[m]=[]),Qi[m].push({name:u,func:d})}}),Qi[Bu(void 0,2).name]=[{name:"wrapper",func:void 0}],it.prototype.clone=function(){var a=new it(this.__wrapped__);return a.__actions__=Bn(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Bn(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Bn(this.__views__),a},it.prototype.reverse=function(){if(this.__filtered__){var a=new it(this);a.__dir__=-1,a.__filtered__=!0}else(a=this.clone()).__dir__*=-1;return a},it.prototype.value=function(){var a=this.__wrapped__.value(),u=this.__dir__,d=qe(a),m=u<0,v=d?a.length:0,T=function(nt,Ae,Me){for(var un=-1,Dn=Me.length;++un=this.__values__.length;return{done:a,value:a?void 0:this.__values__[this.__index__++]}},x.prototype.plant=function(a){for(var u,d=this;d instanceof Nu;){var m=nv(d);m.__index__=0,m.__values__=void 0,u?v.__wrapped__=m:u=m;var v=m;d=d.__wrapped__}return v.__wrapped__=a,u},x.prototype.reverse=function(){var a=this.__wrapped__;if(a instanceof it){var u=a;return this.__actions__.length&&(u=new it(this)),(u=u.reverse()).__actions__.push({func:Qu,args:[ed],thisArg:void 0}),new vr(u,this.__chain__)}return this.thru(ed)},x.prototype.toJSON=x.prototype.valueOf=x.prototype.value=function(){return km(this.__wrapped__,this.__actions__)},x.prototype.first=x.prototype.head,Qa&&(x.prototype[Qa]=function(){return this}),x}();l(n(46))=="object"&&n(46)?(Qe._=$o,(i=(function(){return $o}).call(t,n,t,o))===void 0||(o.exports=i)):Zt?((Zt.exports=$o)._=$o,rn._=$o):Qe._=$o}).call(this)}).call(this,n(11),n(14)(e))},function(e,t,n){var r=n(87);e.exports={Graph:r.Graph,json:n(213),alg:n(214),version:r.version}},function(e,t,n){e.exports={Graph:n(28),version:n(212)}},function(e,t,n){var r=n(89);e.exports=function(o){return r(o,4)}},function(e,t,n){var r=n(29),o=n(33),i=n(49),l=n(118),s=n(124),c=n(127),f=n(128),h=n(129),p=n(130),g=n(59),y=n(131),b=n(10),E=n(135),O=n(136),_=n(141),w=n(0),S=n(12),k=n(142),C=n(5),$=n(144),L=n(6),U={};U["[object Arguments]"]=U["[object Array]"]=U["[object ArrayBuffer]"]=U["[object DataView]"]=U["[object Boolean]"]=U["[object Date]"]=U["[object Float32Array]"]=U["[object Float64Array]"]=U["[object Int8Array]"]=U["[object Int16Array]"]=U["[object Int32Array]"]=U["[object Map]"]=U["[object Number]"]=U["[object Object]"]=U["[object RegExp]"]=U["[object Set]"]=U["[object String]"]=U["[object Symbol]"]=U["[object Uint8Array]"]=U["[object Uint8ClampedArray]"]=U["[object Uint16Array]"]=U["[object Uint32Array]"]=!0,U["[object Error]"]=U["[object Function]"]=U["[object WeakMap]"]=!1,e.exports=function ce(z,K,W,ge,he,be){var De,Be=1&K,X=2&K,ne=4&K;if(W&&(De=he?W(z,ge,he,be):W(z)),De!==void 0)return De;if(!C(z))return z;var _e=w(z);if(_e){if(De=E(z),!Be)return f(z,De)}else{var N=b(z),G=N=="[object Function]"||N=="[object GeneratorFunction]";if(S(z))return c(z,Be);if(N=="[object Object]"||N=="[object Arguments]"||G&&!he){if(De=X||G?{}:_(z),!Be)return X?p(z,s(De,z)):h(z,l(De,z))}else{if(!U[N])return he?z:{};De=O(z,N,Be)}}be||(be=new r);var oe=be.get(z);if(oe)return oe;be.set(z,De),$(z)?z.forEach(function(re){De.add(ce(re,K,W,re,z,be))}):k(z)&&z.forEach(function(re,Se){De.set(Se,ce(re,K,W,Se,z,be))});var Z=ne?X?y:g:X?keysIn:L,ie=_e?void 0:Z(z);return o(ie||z,function(re,Se){ie&&(re=z[Se=re]),i(De,Se,ce(re,K,W,Se,z,be))}),De}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(16),o=Array.prototype.splice;e.exports=function(i){var l=this.__data__,s=r(l,i);return!(s<0)&&(s==l.length-1?l.pop():o.call(l,s,1),--this.size,!0)}},function(e,t,n){var r=n(16);e.exports=function(o){var i=this.__data__,l=r(i,o);return l<0?void 0:i[l][1]}},function(e,t,n){var r=n(16);e.exports=function(o){return r(this.__data__,o)>-1}},function(e,t,n){var r=n(16);e.exports=function(o,i){var l=this.__data__,s=r(l,o);return s<0?(++this.size,l.push([o,i])):l[s][1]=i,this}},function(e,t,n){var r=n(15);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(n){var r=this.__data__,o=r.delete(n);return this.size=r.size,o}},function(e,t){e.exports=function(n){return this.__data__.get(n)}},function(e,t){e.exports=function(n){return this.__data__.has(n)}},function(e,t,n){var r=n(15),o=n(31),i=n(32);e.exports=function(l,s){var c=this.__data__;if(c instanceof r){var f=c.__data__;if(!o||f.length<199)return f.push([l,s]),this.size=++c.size,this;c=this.__data__=new i(f)}return c.set(l,s),this.size=c.size,this}},function(e,t,n){var r=n(17),o=n(103),i=n(5),l=n(48),s=/^\[object .+?Constructor\]$/,c=Function.prototype,f=Object.prototype,h=c.toString,p=f.hasOwnProperty,g=RegExp("^"+h.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(y){return!(!i(y)||o(y))&&(r(y)?g:s).test(l(y))}},function(e,t,n){var r=n(9),o=Object.prototype,i=o.hasOwnProperty,l=o.toString,s=r?r.toStringTag:void 0;e.exports=function(c){var f=i.call(c,s),h=c[s];try{c[s]=void 0;var p=!0}catch{}var g=l.call(c);return p&&(f?c[s]=h:delete c[s]),g}},function(e,t){var n=Object.prototype.toString;e.exports=function(r){return n.call(r)}},function(e,t,n){var r,o=n(104),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(l){return!!i&&i in l}},function(e,t,n){var r=n(2)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(n,r){return n==null?void 0:n[r]}},function(e,t,n){var r=n(107),o=n(15),i=n(31);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(e,t,n){var r=n(108),o=n(109),i=n(110),l=n(111),s=n(112);function c(f){var h=-1,p=f==null?0:f.length;for(this.clear();++h0&&c(y)?s>1?i(y,s-1,c,f,h):r(h,y):f||(h[h.length]=y)}return h}},function(e,t,n){var r=n(9),o=n(21),i=n(0),l=r?r.isConcatSpreadable:void 0;e.exports=function(s){return i(s)||o(s)||!!(l&&s&&s[l])}},function(e,t,n){var r=n(25),o=n(195),i=n(197);e.exports=function(l,s){return i(o(l,s,r),l+"")}},function(e,t,n){var r=n(196),o=Math.max;e.exports=function(i,l,s){return l=o(l===void 0?i.length-1:l,0),function(){for(var c=arguments,f=-1,h=o(c.length-l,0),p=Array(h);++f0){if(++o>=800)return arguments[0]}else o=0;return r.apply(void 0,arguments)}}},function(e,t,n){var r=n(68),o=n(201),i=n(206),l=n(69),s=n(207),c=n(42);e.exports=function(f,h,p){var g=-1,y=o,b=f.length,E=!0,O=[],_=O;if(p)E=!1,y=i;else if(b>=200){var w=h?null:s(f);if(w)return c(w);E=!1,y=l,_=new r}else _=h?[]:O;e:for(;++g-1}},function(e,t,n){var r=n(203),o=n(204),i=n(205);e.exports=function(l,s,c){return s==s?i(l,s,c):r(l,o,c)}},function(e,t){e.exports=function(n,r,o,i){for(var l=n.length,s=o+(i?1:-1);i?s--:++s1||l.length===1&&i.hasEdge(l[0],l[0])})}},function(e,t,n){var r=n(1);e.exports=function(i,l,s){return function(c,f,h){var p={},g=c.nodes();return g.forEach(function(y){p[y]={},p[y][y]={distance:0},g.forEach(function(b){y!==b&&(p[y][b]={distance:Number.POSITIVE_INFINITY})}),h(y).forEach(function(b){var E=b.v===y?b.w:b.v,O=f(b);p[y][E]={distance:O,predecessor:y}})}),g.forEach(function(y){var b=p[y];g.forEach(function(E){var O=p[E];g.forEach(function(_){var w=O[y],S=b[_],k=O[_],C=w.distance+S.distance;C0;){if(c=p.removeMin(),r.has(h,c))f.setEdge(c,h[c]);else{if(y)throw new Error("Input graph is not connected: "+l);y=!0}l.nodeEdges(c).forEach(g)}return f}},function(e,t,n){(function(r){function o(s,c){for(var f=0,h=s.length-1;h>=0;h--){var p=s[h];p==="."?s.splice(h,1):p===".."?(s.splice(h,1),f++):f&&(s.splice(h,1),f--)}if(c)for(;f--;f)s.unshift("..");return s}function i(s,c){if(s.filter)return s.filter(c);for(var f=[],h=0;h=-1&&!c;f--){var h=f>=0?arguments[f]:r.cwd();if(typeof h!="string")throw new TypeError("Arguments to path.resolve must be strings");h&&(s=h+"/"+s,c=h.charAt(0)==="/")}return(c?"/":"")+(s=o(i(s.split("/"),function(p){return!!p}),!c).join("/"))||"."},t.normalize=function(s){var c=t.isAbsolute(s),f=l(s,-1)==="/";return(s=o(i(s.split("/"),function(h){return!!h}),!c).join("/"))||c||(s="."),s&&f&&(s+="/"),(c?"/":"")+s},t.isAbsolute=function(s){return s.charAt(0)==="/"},t.join=function(){var s=Array.prototype.slice.call(arguments,0);return t.normalize(i(s,function(c,f){if(typeof c!="string")throw new TypeError("Arguments to path.join must be strings");return c}).join("/"))},t.relative=function(s,c){function f(O){for(var _=0;_=0&&O[w]==="";w--);return _>w?[]:O.slice(_,w-_+1)}s=t.resolve(s).substr(1),c=t.resolve(c).substr(1);for(var h=f(s.split("/")),p=f(c.split("/")),g=Math.min(h.length,p.length),y=g,b=0;b=1;--g)if((c=s.charCodeAt(g))===47){if(!p){h=g;break}}else p=!1;return h===-1?f?"/":".":f&&h===1?"/":s.slice(0,h)},t.basename=function(s,c){var f=function(h){typeof h!="string"&&(h+="");var p,g=0,y=-1,b=!0;for(p=h.length-1;p>=0;--p)if(h.charCodeAt(p)===47){if(!b){g=p+1;break}}else y===-1&&(b=!1,y=p+1);return y===-1?"":h.slice(g,y)}(s);return c&&f.substr(-1*c.length)===c&&(f=f.substr(0,f.length-c.length)),f},t.extname=function(s){typeof s!="string"&&(s+="");for(var c=-1,f=0,h=-1,p=!0,g=0,y=s.length-1;y>=0;--y){var b=s.charCodeAt(y);if(b!==47)h===-1&&(p=!1,h=y+1),b===46?c===-1?c=y:g!==1&&(g=1):c!==-1&&(g=-1);else if(!p){f=y+1;break}}return c===-1||h===-1||g===0||g===1&&c===h-1&&c===f+1?"":s.slice(c,h)};var l="ab".substr(-1)==="b"?function(s,c,f){return s.substr(c,f)}:function(s,c,f){return c<0&&(c=s.length+c),s.substr(c,f)}}).call(this,n(13))},function(e,t,n){function r(l){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s})(l)}var o={file:n(225),http:n(81),https:n(81)},i=(typeof window>"u"?"undefined":r(window))==="object"||typeof importScripts=="function"?o.http:o.file;typeof Promise>"u"&&n(83),e.exports.load=function(l,s){var c=Promise.resolve();return s===void 0&&(s={}),c=(c=c.then(function(){if(l===void 0)throw new TypeError("location is required");if(typeof l!="string")throw new TypeError("location must be a string");if(s!==void 0){if(r(s)!=="object")throw new TypeError("options must be an object");if(s.processContent!==void 0&&typeof s.processContent!="function")throw new TypeError("options.processContent must be a function")}})).then(function(){return new Promise(function(f,h){(function(p){var g=function(b){return b!==void 0&&(b=b.indexOf("://")===-1?"":b.split("://")[0]),b}(p),y=o[g];if(y===void 0){if(g!=="")throw new Error("Unsupported scheme: "+g);y=i}return y})(l).load(l,s||{},function(p,g){p?h(p):f(g)})})}).then(function(f){return s.processContent?new Promise(function(h,p){r(f)!=="object"&&(f={text:f}),f.location=l,s.processContent(f,function(g,y){g?p(g):h(y)})}):r(f)==="object"?f.text:f})}},function(e,t,n){var r=new TypeError("The 'file' scheme is not supported in the browser");e.exports.getBase=function(){throw r},e.exports.load=function(){var o=arguments[arguments.length-1];if(typeof o!="function")throw r;o(r)}},function(e,t,n){function r(k){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C})(k)}var o;typeof window<"u"?o=window:typeof self<"u"?o=self:(console.warn("Using browser-only version of superagent in non-browser environment"),o=this);var i=n(227),l=n(228),s=n(82),c=n(229),f=n(231);function h(){}var p=t=e.exports=function(k,C){return typeof C=="function"?new t.Request("GET",k).end(C):arguments.length==1?new t.Request("GET",k):new t.Request(k,C)};t.Request=w,p.getXHR=function(){if(!(!o.XMLHttpRequest||o.location&&o.location.protocol=="file:"&&o.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch{}throw Error("Browser-only version of superagent could not find XHR")};var g="".trim?function(k){return k.trim()}:function(k){return k.replace(/(^\s*|\s*$)/g,"")};function y(k){if(!s(k))return k;var C=[];for(var $ in k)b(C,$,k[$]);return C.join("&")}function b(k,C,$){if($!=null)if(Array.isArray($))$.forEach(function(U){b(k,C,U)});else if(s($))for(var L in $)b(k,C+"["+L+"]",$[L]);else k.push(encodeURIComponent(C)+"="+encodeURIComponent($));else $===null&&k.push(encodeURIComponent(C))}function E(k){for(var C,$,L={},U=k.split("&"),ce=0,z=U.length;ce=2&&k._responseTimeoutTimer&&clearTimeout(k._responseTimeoutTimer),K==4){var W;try{W=C.status}catch{W=0}if(!W)return k.timedout||k._aborted?void 0:k.crossDomainError();k.emit("end")}};var L=function(K,W){W.total>0&&(W.percent=W.loaded/W.total*100),W.direction=K,k.emit("progress",W)};if(this.hasListeners("progress"))try{C.onprogress=L.bind(null,"download"),C.upload&&(C.upload.onprogress=L.bind(null,"upload"))}catch{}try{this.username&&this.password?C.open(this.method,this.url,!0,this.username,this.password):C.open(this.method,this.url,!0)}catch(K){return this.callback(K)}if(this._withCredentials&&(C.withCredentials=!0),!this._formData&&this.method!="GET"&&this.method!="HEAD"&&typeof $!="string"&&!this._isHost($)){var U=this._header["content-type"],ce=this._serializer||p.serialize[U?U.split(";")[0]:""];!ce&&O(U)&&(ce=p.serialize["application/json"]),ce&&($=ce($))}for(var z in this.header)this.header[z]!=null&&this.header.hasOwnProperty(z)&&C.setRequestHeader(z,this.header[z]);return this._responseType&&(C.responseType=this._responseType),this.emit("request",this),C.send($!==void 0?$:null),this},p.agent=function(){return new f},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(k){f.prototype[k.toLowerCase()]=function(C,$){var L=new p.Request(k,C);return this._setDefaults(L),$&&L.end($),L}}),f.prototype.del=f.prototype.delete,p.get=function(k,C,$){var L=p("GET",k);return typeof C=="function"&&($=C,C=null),C&&L.query(C),$&&L.end($),L},p.head=function(k,C,$){var L=p("HEAD",k);return typeof C=="function"&&($=C,C=null),C&&L.query(C),$&&L.end($),L},p.options=function(k,C,$){var L=p("OPTIONS",k);return typeof C=="function"&&($=C,C=null),C&&L.send(C),$&&L.end($),L},p.del=S,p.delete=S,p.patch=function(k,C,$){var L=p("PATCH",k);return typeof C=="function"&&($=C,C=null),C&&L.send(C),$&&L.end($),L},p.post=function(k,C,$){var L=p("POST",k);return typeof C=="function"&&($=C,C=null),C&&L.send(C),$&&L.end($),L},p.put=function(k,C,$){var L=p("PUT",k);return typeof C=="function"&&($=C,C=null),C&&L.send(C),$&&L.end($),L}},function(e,t,n){function r(o){if(o)return function(i){for(var l in r.prototype)i[l]=r.prototype[l];return i}(o)}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(o,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+o]=this._callbacks["$"+o]||[]).push(i),this},r.prototype.once=function(o,i){function l(){this.off(o,l),i.apply(this,arguments)}return l.fn=i,this.on(o,l),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(o,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var l,s=this._callbacks["$"+o];if(!s)return this;if(arguments.length==1)return delete this._callbacks["$"+o],this;for(var c=0;c=this._maxRetries)return!1;if(this._retryCallback)try{var f=this._retryCallback(s,c);if(f===!0)return!0;if(f===!1)return!1}catch(h){console.error(h)}return!!(c&&c.status&&c.status>=500&&c.status!=501||s&&(s.code&&~l.indexOf(s.code)||s.timeout&&s.code=="ECONNABORTED"||s.crossDomain))},i.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},i.prototype.then=function(s,c){if(!this._fullfilledPromise){var f=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(h,p){f.end(function(g,y){g?p(g):h(y)})})}return this._fullfilledPromise.then(s,c)},i.prototype.catch=function(s){return this.then(void 0,s)},i.prototype.use=function(s){return s(this),this},i.prototype.ok=function(s){if(typeof s!="function")throw Error("Callback required");return this._okCallback=s,this},i.prototype._isResponseOK=function(s){return!!s&&(this._okCallback?this._okCallback(s):s.status>=200&&s.status<300)},i.prototype.get=function(s){return this._header[s.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(s,c){if(o(s)){for(var f in s)this.set(f,s[f]);return this}return this._header[s.toLowerCase()]=c,this.header[s]=c,this},i.prototype.unset=function(s){return delete this._header[s.toLowerCase()],delete this.header[s],this},i.prototype.field=function(s,c){if(s==null)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),o(s)){for(var f in s)this.field(f,s[f]);return this}if(Array.isArray(c)){for(var h in c)this.field(s,c[h]);return this}if(c==null)throw new Error(".field(name, val) val can not be empty");return typeof c=="boolean"&&(c=""+c),this._getFormData().append(s,c),this},i.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},i.prototype._auth=function(s,c,f,h){switch(f.type){case"basic":this.set("Authorization","Basic "+h(s+":"+c));break;case"auto":this.username=s,this.password=c;break;case"bearer":this.set("Authorization","Bearer "+s)}return this},i.prototype.withCredentials=function(s){return s==null&&(s=!0),this._withCredentials=s,this},i.prototype.redirects=function(s){return this._maxRedirects=s,this},i.prototype.maxResponseSize=function(s){if(typeof s!="number")throw TypeError("Invalid argument");return this._maxResponseSize=s,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(s){var c=o(s),f=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),c&&!this._data)Array.isArray(s)?this._data=[]:this._isHost(s)||(this._data={});else if(s&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(c&&o(this._data))for(var h in s)this._data[h]=s[h];else typeof s=="string"?(f||this.type("form"),f=this._header["content-type"],this._data=f=="application/x-www-form-urlencoded"?this._data?this._data+"&"+s:s:(this._data||"")+s):this._data=s;return!c||this._isHost(s)||f||this.type("json"),this},i.prototype.sortQuery=function(s){return this._sort=s===void 0||s,this},i.prototype._finalizeQueryString=function(){var s=this._query.join("&");if(s&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+s),this._query.length=0,this._sort){var c=this.url.indexOf("?");if(c>=0){var f=this.url.substring(c+1).split("&");typeof this._sort=="function"?f.sort(this._sort):f.sort(),this.url=this.url.substring(0,c)+"?"+f.join("&")}}},i.prototype._appendQueryString=function(){console.trace("Unsupported")},i.prototype._timeoutError=function(s,c,f){if(!this._aborted){var h=new Error(s+c+"ms exceeded");h.timeout=c,h.code="ECONNABORTED",h.errno=f,this.timedout=!0,this.abort(),this.callback(h)}},i.prototype._setTimeouts=function(){var s=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){s._timeoutError("Timeout of ",s._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){s._timeoutError("Response timeout of ",s._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},function(e,t,n){var r=n(230);function o(i){if(i)return function(l){for(var s in o.prototype)l[s]=o.prototype[s];return l}(i)}e.exports=o,o.prototype.get=function(i){return this.header[i.toLowerCase()]},o.prototype._setHeaderProperties=function(i){var l=i["content-type"]||"";this.type=r.type(l);var s=r.params(l);for(var c in s)this[c]=s[c];this.links={};try{i.link&&(this.links=r.parseLinks(i.link))}catch{}},o.prototype._setStatusProperties=function(i){var l=i/100|0;this.status=this.statusCode=i,this.statusType=l,this.info=l==1,this.ok=l==2,this.redirect=l==3,this.clientError=l==4,this.serverError=l==5,this.error=(l==4||l==5)&&this.toError(),this.created=i==201,this.accepted=i==202,this.noContent=i==204,this.badRequest=i==400,this.unauthorized=i==401,this.notAcceptable=i==406,this.forbidden=i==403,this.notFound=i==404,this.unprocessableEntity=i==422}},function(e,t,n){t.type=function(r){return r.split(/ *; */).shift()},t.params=function(r){return r.split(/ *; */).reduce(function(o,i){var l=i.split(/ *= */),s=l.shift(),c=l.shift();return s&&c&&(o[s]=c),o},{})},t.parseLinks=function(r){return r.split(/ *, */).reduce(function(o,i){var l=i.split(/ *; */),s=l[0].slice(1,-1);return o[l[1].split(/ *= */)[1].slice(1,-1)]=s,o},{})},t.cleanHeader=function(r,o){return delete r["content-type"],delete r["content-length"],delete r["transfer-encoding"],delete r.host,o&&(delete r.authorization,delete r.cookie),r}},function(e,t){function n(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(r){n.prototype[r]=function(){return this._defaults.push({fn:r,arguments}),this}}),n.prototype._setDefaults=function(r){this._defaults.forEach(function(o){r[o.fn].apply(r,o.arguments)})},e.exports=n},function(e,t,n){(function(r){var o=r!==void 0&&r||typeof self<"u"&&self||window,i=Function.prototype.apply;function l(s,c){this._id=s,this._clearFn=c}t.setTimeout=function(){return new l(i.call(setTimeout,o,arguments),clearTimeout)},t.setInterval=function(){return new l(i.call(setInterval,o,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(s){s&&s.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(o,this._id)},t.enroll=function(s,c){clearTimeout(s._idleTimeoutId),s._idleTimeout=c},t.unenroll=function(s){clearTimeout(s._idleTimeoutId),s._idleTimeout=-1},t._unrefActive=t.active=function(s){clearTimeout(s._idleTimeoutId);var c=s._idleTimeout;c>=0&&(s._idleTimeoutId=setTimeout(function(){s._onTimeout&&s._onTimeout()},c))},n(233),t.setImmediate=typeof self<"u"&&self.setImmediate||r!==void 0&&r.setImmediate||this&&this.setImmediate,t.clearImmediate=typeof self<"u"&&self.clearImmediate||r!==void 0&&r.clearImmediate||this&&this.clearImmediate}).call(this,n(11))},function(e,t,n){(function(r,o){(function(i,l){if(!i.setImmediate){var s,c,f,h,p,g=1,y={},b=!1,E=i.document,O=Object.getPrototypeOf&&Object.getPrototypeOf(i);O=O&&O.setTimeout?O:i,{}.toString.call(i.process)==="[object process]"?s=function(S){o.nextTick(function(){w(S)})}:function(){if(i.postMessage&&!i.importScripts){var S=!0,k=i.onmessage;return i.onmessage=function(){S=!1},i.postMessage("","*"),i.onmessage=k,S}}()?(h="setImmediate$"+Math.random()+"$",p=function(S){S.source===i&&typeof S.data=="string"&&S.data.indexOf(h)===0&&w(+S.data.slice(h.length))},i.addEventListener?i.addEventListener("message",p,!1):i.attachEvent("onmessage",p),s=function(S){i.postMessage(h+S,"*")}):i.MessageChannel?((f=new MessageChannel).port1.onmessage=function(S){w(S.data)},s=function(S){f.port2.postMessage(S)}):E&&"onreadystatechange"in E.createElement("script")?(c=E.documentElement,s=function(S){var k=E.createElement("script");k.onreadystatechange=function(){w(S),k.onreadystatechange=null,c.removeChild(k),k=null},c.appendChild(k)}):s=function(S){setTimeout(w,0,S)},O.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var k=new Array(arguments.length-1),C=0;C"u"?r===void 0?this:r:self)}).call(this,n(11),n(13))},function(e,t,n){t.decode=t.parse=n(235),t.encode=t.stringify=n(236)},function(e,t,n){function r(i,l){return Object.prototype.hasOwnProperty.call(i,l)}e.exports=function(i,l,s,c){l=l||"&",s=s||"=";var f={};if(typeof i!="string"||i.length===0)return f;var h=/\+/g;i=i.split(l);var p=1e3;c&&typeof c.maxKeys=="number"&&(p=c.maxKeys);var g=i.length;p>0&&g>p&&(g=p);for(var y=0;y=0?(b=w.substr(0,S),E=w.substr(S+1)):(b=w,E=""),O=decodeURIComponent(b),_=decodeURIComponent(E),r(f,O)?o(f[O])?f[O].push(_):f[O]=[f[O],_]:f[O]=_}return f};var o=Array.isArray||function(i){return Object.prototype.toString.call(i)==="[object Array]"}},function(e,t,n){function r(c){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f})(c)}var o=function(c){switch(r(c)){case"string":return c;case"boolean":return c?"true":"false";case"number":return isFinite(c)?c:"";default:return""}};e.exports=function(c,f,h,p){return f=f||"&",h=h||"=",c===null&&(c=void 0),r(c)==="object"?l(s(c),function(g){var y=encodeURIComponent(o(g))+h;return i(c[g])?l(c[g],function(b){return y+encodeURIComponent(o(b))}).join(f):y+encodeURIComponent(o(c[g]))}).join(f):p?encodeURIComponent(o(p))+h+encodeURIComponent(o(c)):""};var i=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"};function l(c,f){if(c.map)return c.map(f);for(var h=[],p=0;p1){R[0]=R[0].slice(0,-1);for(var q=R.length-1,V=1;V= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$=Math.floor,L=String.fromCharCode;function U(A){throw new RangeError(C[A])}function ce(A,R){var I=A.split("@"),q="";I.length>1&&(q=I[0]+"@",A=I[1]);var V=function(de,ve){for(var Ge=[],st=de.length;st--;)Ge[st]=ve(de[st]);return Ge}((A=A.replace(k,".")).split("."),R).join(".");return q+V}function z(A){for(var R=[],I=0,q=A.length;I=55296&&V<=56319&&I>1,A+=$(A/R);A>455;q+=36)A=$(A/35);return $(q+36*A/(A+38))},ge=function(A){var R,I=[],q=A.length,V=0,de=128,ve=72,Ge=A.lastIndexOf("-");Ge<0&&(Ge=0);for(var st=0;st=128&&U("not-basic"),I.push(A.charCodeAt(st));for(var Re=Ge>0?Ge+1:0;Re=q&&U("invalid-input");var ut=(R=A.charCodeAt(Re++))-48<10?R-22:R-65<26?R-65:R-97<26?R-97:36;(ut>=36||ut>$((_-V)/lt))&&U("overflow"),V+=ut*lt;var Ht=Ft<=ve?1:Ft>=ve+26?26:Ft-ve;if(ut$(_/bt)&&U("overflow"),lt*=bt}var Tt=I.length+1;ve=W(V-ct,Tt,ct==0),$(V/Tt)>_-de&&U("overflow"),de+=$(V/Tt),V%=Tt,I.splice(V++,0,de)}return String.fromCodePoint.apply(String,I)},he=function(A){var R=[],I=(A=z(A)).length,q=128,V=0,de=72,ve=!0,Ge=!1,st=void 0;try{for(var Re,ct=A[Symbol.iterator]();!(ve=(Re=ct.next()).done);ve=!0){var lt=Re.value;lt<128&&R.push(L(lt))}}catch(Qe){Ge=!0,st=Qe}finally{try{!ve&&ct.return&&ct.return()}finally{if(Ge)throw st}}var Ft=R.length,ut=Ft;for(Ft&&R.push("-");ut=q&&Zn$((_-V)/vn)&&U("overflow"),V+=(Ht-q)*vn,q=Ht;var Xt=!0,Wr=!1,hr=void 0;try{for(var pi,ht=A[Symbol.iterator]();!(Xt=(pi=ht.next()).done);Xt=!0){var mt=pi.value;if(mt_&&U("overflow"),mt==q){for(var ke=V,F=36;;F+=36){var ae=F<=de?1:F>=de+26?26:F-de;if(ke>6|192).toString(16).toUpperCase()+"%"+(63&R|128).toString(16).toUpperCase():"%"+(R>>12|224).toString(16).toUpperCase()+"%"+(R>>6&63|128).toString(16).toUpperCase()+"%"+(63&R|128).toString(16).toUpperCase()}function ne(A){for(var R="",I=0,q=A.length;I=194&&V<224){if(q-I>=6){var de=parseInt(A.substr(I+4,2),16);R+=String.fromCharCode((31&V)<<6|63&de)}else R+=A.substr(I,6);I+=6}else if(V>=224){if(q-I>=9){var ve=parseInt(A.substr(I+4,2),16),Ge=parseInt(A.substr(I+7,2),16);R+=String.fromCharCode((15&V)<<12|(63&ve)<<6|63&Ge)}else R+=A.substr(I,9);I+=9}else R+=A.substr(I,3),I+=3}return R}function _e(A,R){function I(q){var V=ne(q);return V.match(R.UNRESERVED)?V:q}return A.scheme&&(A.scheme=String(A.scheme).replace(R.PCT_ENCODED,I).toLowerCase().replace(R.NOT_SCHEME,"")),A.userinfo!==void 0&&(A.userinfo=String(A.userinfo).replace(R.PCT_ENCODED,I).replace(R.NOT_USERINFO,X).replace(R.PCT_ENCODED,g)),A.host!==void 0&&(A.host=String(A.host).replace(R.PCT_ENCODED,I).toLowerCase().replace(R.NOT_HOST,X).replace(R.PCT_ENCODED,g)),A.path!==void 0&&(A.path=String(A.path).replace(R.PCT_ENCODED,I).replace(A.scheme?R.NOT_PATH:R.NOT_PATH_NOSCHEME,X).replace(R.PCT_ENCODED,g)),A.query!==void 0&&(A.query=String(A.query).replace(R.PCT_ENCODED,I).replace(R.NOT_QUERY,X).replace(R.PCT_ENCODED,g)),A.fragment!==void 0&&(A.fragment=String(A.fragment).replace(R.PCT_ENCODED,I).replace(R.NOT_FRAGMENT,X).replace(R.PCT_ENCODED,g)),A}function N(A){return A.replace(/^0*(.*)/,"$1")||"0"}function G(A,R){var I=A.match(R.IPV4ADDRESS)||[],q=O(I,2)[1];return q?q.split(".").map(N).join("."):A}function oe(A,R){var I=A.match(R.IPV6ADDRESS)||[],q=O(I,3),V=q[1],de=q[2];if(V){for(var ve=V.toLowerCase().split("::").reverse(),Ge=O(ve,2),st=Ge[0],Re=Ge[1],ct=Re?Re.split(":").map(N):[],lt=st.split(":").map(N),Ft=R.IPV4ADDRESS.test(lt[lt.length-1]),ut=Ft?7:8,Ht=lt.length-ut,bt=Array(ut),Tt=0;Tt1){var pr=bt.slice(0,bn.index),Zn=bt.slice(bn.index+bn.length);Un=pr.join(":")+"::"+Zn.join(":")}else Un=bt.join(":");return de&&(Un+="%"+de),Un}return A}var Z=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,ie="".match(/(){0}/)[1]===void 0;function re(A){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I={},q=R.iri!==!1?E:b;R.reference==="suffix"&&(A=(R.scheme?R.scheme+":":"")+"//"+A);var V=A.match(Z);if(V){ie?(I.scheme=V[1],I.userinfo=V[3],I.host=V[4],I.port=parseInt(V[5],10),I.path=V[6]||"",I.query=V[7],I.fragment=V[8],isNaN(I.port)&&(I.port=V[5])):(I.scheme=V[1]||void 0,I.userinfo=A.indexOf("@")!==-1?V[3]:void 0,I.host=A.indexOf("//")!==-1?V[4]:void 0,I.port=parseInt(V[5],10),I.path=V[6]||"",I.query=A.indexOf("?")!==-1?V[7]:void 0,I.fragment=A.indexOf("#")!==-1?V[8]:void 0,isNaN(I.port)&&(I.port=A.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?V[4]:void 0)),I.host&&(I.host=oe(G(I.host,q),q)),I.scheme!==void 0||I.userinfo!==void 0||I.host!==void 0||I.port!==void 0||I.path||I.query!==void 0?I.scheme===void 0?I.reference="relative":I.fragment===void 0?I.reference="absolute":I.reference="uri":I.reference="same-document",R.reference&&R.reference!=="suffix"&&R.reference!==I.reference&&(I.error=I.error||"URI is not a "+R.reference+" reference.");var de=Be[(R.scheme||I.scheme||"").toLowerCase()];if(R.unicodeSupport||de&&de.unicodeSupport)_e(I,q);else{if(I.host&&(R.domainHost||de&&de.domainHost))try{I.host=be(I.host.replace(q.PCT_ENCODED,ne).toLowerCase())}catch(ve){I.error=I.error||"Host's domain name can not be converted to ASCII via punycode: "+ve}_e(I,b)}de&&de.parse&&de.parse(I,R)}else I.error=I.error||"URI can not be parsed.";return I}function Se(A,R){var I=R.iri!==!1?E:b,q=[];return A.userinfo!==void 0&&(q.push(A.userinfo),q.push("@")),A.host!==void 0&&q.push(oe(G(String(A.host),I),I).replace(I.IPV6ADDRESS,function(V,de,ve){return"["+de+(ve?"%25"+ve:"")+"]"})),typeof A.port=="number"&&(q.push(":"),q.push(A.port.toString(10))),q.length?q.join(""):void 0}var Pe=/^\.\.?\//,Fe=/^\/\.(\/|$)/,Ke=/^\/\.\.(\/|$)/,He=/^\/?(?:.|\n)*?(?=\/|$)/;function xe(A){for(var R=[];A.length;)if(A.match(Pe))A=A.replace(Pe,"");else if(A.match(Fe))A=A.replace(Fe,"/");else if(A.match(Ke))A=A.replace(Ke,"/"),R.pop();else if(A==="."||A==="..")A="";else{var I=A.match(He);if(!I)throw new Error("Unexpected dot segment condition");var q=I[0];A=A.slice(q.length),R.push(q)}return R.join("")}function Xe(A){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=R.iri?E:b,q=[],V=Be[(R.scheme||A.scheme||"").toLowerCase()];if(V&&V.serialize&&V.serialize(A,R),A.host&&!I.IPV6ADDRESS.test(A.host)){if(R.domainHost||V&&V.domainHost)try{A.host=R.iri?De(A.host):be(A.host.replace(I.PCT_ENCODED,ne).toLowerCase())}catch(Ge){A.error=A.error||"Host's domain name can not be converted to "+(R.iri?"Unicode":"ASCII")+" via punycode: "+Ge}}_e(A,I),R.reference!=="suffix"&&A.scheme&&(q.push(A.scheme),q.push(":"));var de=Se(A,R);if(de!==void 0&&(R.reference!=="suffix"&&q.push("//"),q.push(de),A.path&&A.path.charAt(0)!=="/"&&q.push("/")),A.path!==void 0){var ve=A.path;R.absolutePath||V&&V.absolutePath||(ve=xe(ve)),de===void 0&&(ve=ve.replace(/^\/\//,"/%2F")),q.push(ve)}return A.query!==void 0&&(q.push("?"),q.push(A.query)),A.fragment!==void 0&&(q.push("#"),q.push(A.fragment)),q.join("")}function rt(A,R){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},q=arguments[3],V={};return q||(A=re(Xe(A,I),I),R=re(Xe(R,I),I)),!(I=I||{}).tolerant&&R.scheme?(V.scheme=R.scheme,V.userinfo=R.userinfo,V.host=R.host,V.port=R.port,V.path=xe(R.path||""),V.query=R.query):(R.userinfo!==void 0||R.host!==void 0||R.port!==void 0?(V.userinfo=R.userinfo,V.host=R.host,V.port=R.port,V.path=xe(R.path||""),V.query=R.query):(R.path?(R.path.charAt(0)==="/"?V.path=xe(R.path):(A.userinfo===void 0&&A.host===void 0&&A.port===void 0||A.path?A.path?V.path=A.path.slice(0,A.path.lastIndexOf("/")+1)+R.path:V.path=R.path:V.path="/"+R.path,V.path=xe(V.path)),V.query=R.query):(V.path=A.path,R.query!==void 0?V.query=R.query:V.query=A.query),V.userinfo=A.userinfo,V.host=A.host,V.port=A.port),V.scheme=A.scheme),V.fragment=R.fragment,V}function Ie(A,R){return A&&A.toString().replace(R&&R.iri?E.PCT_ENCODED:b.PCT_ENCODED,ne)}var Ze={scheme:"http",domainHost:!0,parse:function(A,R){return A.host||(A.error=A.error||"HTTP URIs must have a host."),A},serialize:function(A,R){return A.port!==(String(A.scheme).toLowerCase()!=="https"?80:443)&&A.port!==""||(A.port=void 0),A.path||(A.path="/"),A}},gt={scheme:"https",domainHost:Ze.domainHost,parse:Ze.parse,serialize:Ze.serialize},Mt={},jt="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",yt="[0-9A-Fa-f]",kt=h(h("%[EFef][0-9A-Fa-f]%"+yt+yt+"%"+yt+yt)+"|"+h("%[89A-Fa-f][0-9A-Fa-f]%"+yt+yt)+"|"+h("%"+yt+yt)),$e=f("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Bt=new RegExp(jt,"g"),se=new RegExp(kt,"g"),Oe=new RegExp(f("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',$e),"g"),pt=new RegExp(f("[^]",jt,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Rt=pt;function Yt(A){var R=ne(A);return R.match(Bt)?R:A}var Pn={scheme:"mailto",parse:function(A,R){var I=A,q=I.to=I.path?I.path.split(","):[];if(I.path=void 0,I.query){for(var V=!1,de={},ve=I.query.split("&"),Ge=0,st=ve.length;Get.resolved)}const Dc=e=>typeof e=="object"&&e!==null&&e.toString()==={}.toString(),ff=e=>JSON.parse(JSON.stringify(e)),Dg=(e,t)=>{e=ff(e);for(const n in t)if(t.hasOwnProperty(n)){const r=t[n],o=e[n];Dc(r)&&Dc(o)?e[n]=Dg(o,r):e[n]=r}return e},Bx=function(e,t){const n=e.replace(/^#\/definitions\//,"").split("/"),r=function(i,l){const s=i.shift();return s?l[s]?i.length?r(i,l[s]):l[s]:{}:{}},o=r(n,t);return Dc(o)?ff(o):o},RL=function(e,t){const n=e.length;let r=-1,o={};for(;++r{if(typeof e.default<"u")return e.default;if(typeof e.allOf<"u"){const n=RL(e.allOf,t);return aa(n,t)}else if(typeof e.$ref<"u"){const n=Bx(e.$ref,t);return aa(n,t)}else if(e.type==="object"){if(!e.properties)return{};for(const n in e.properties)e.properties.hasOwnProperty(n)&&(e.properties[n]=aa(e.properties[n],t),typeof e.properties[n]>"u"&&delete e.properties[n]);return e.properties}else if(e.type==="array"){if(!e.items)return[];const n=e.minItems||0;if(e.items.constructor===Array){const o=e.items.map(i=>aa(i,t));for(let i=o.length-1;i>=0&&!(typeof o[i]<"u");i--)i+1>n&&o.pop();return o.every(i=>typeof i>"u")?void 0:o}const r=aa(e.items,t);if(typeof r>"u")return[];{const o=[];for(let i=0;i"u"?t=e.definitions||{}:Dc(e.definitions)&&(t=Dg(t,e.definitions)),aa(ff(e),t)}function NL(){const[e,t]=j.useState({configSchema:null,configDefaults:null});return j.useEffect(()=>{async function n(){const r=await fetch("/runs/config_schema").then(o=>o.json()).then(PL);t({configSchema:r,configDefaults:$L(r)})}n()},[]),e}async function DL(e,t){const n=e.getReader();let r;for(;!(r=await n.read()).done;)t(r.value)}function IL(e){let t,n,r,o=!1;return function(l){t===void 0?(t=l,n=0,r=-1):t=ML(t,l);const s=t.length;let c=0;for(;n0){const c=o.decode(l.subarray(0,s)),f=s+(l[s+1]===32?2:1),h=o.decode(l.subarray(f));switch(c){case"data":r.data=r.data?r.data+` +`+h:h;break;case"event":r.event=h;break;case"id":e(r.id=h);break;case"retry":const p=parseInt(h,10);isNaN(p)||t(r.retry=p);break}}}}function ML(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function o1(){return{data:"",event:"",id:"",retry:void 0}}var FL=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o{const y=Object.assign({},r);y.accept||(y.accept=_h);let b;function E(){b.abort(),document.hidden||C()}c||document.addEventListener("visibilitychange",E);let O=zL,_=0;function w(){document.removeEventListener("visibilitychange",E),window.clearTimeout(_),b.abort()}n==null||n.addEventListener("abort",()=>{w(),p()});const S=f??window.fetch,k=o??BL;async function C(){var $;b=new AbortController;try{const L=await S(e,Object.assign(Object.assign({},h),{headers:y,signal:b.signal}));await k(L),await DL(L.body,IL(LL(U=>{U?y[i1]=U:delete y[i1]},U=>{O=U},i))),l==null||l(),w(),p()}catch(L){if(!b.signal.aborted)try{const U=($=s==null?void 0:s(L))!==null&&$!==void 0?$:O;window.clearTimeout(_),_=window.setTimeout(C,U)}catch(U){w(),g(U)}}}C()})}function BL(e){const t=e.headers.get("content-type");if(!(t!=null&&t.startsWith(_h)))throw new Error(`Expected content-type to be ${_h}, Actual: ${t}`)}function HL(){const[e,t]=j.useState(null),[n,r]=j.useState(null),o=j.useCallback(async(l,s,c)=>{const f=new AbortController;r(f),t({status:"inflight",messages:l.messages,merge:!0}),await UL("/runs",{signal:f.signal,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:l,assistant_id:s,thread_id:c,stream:!0}),onmessage(h){if(h.event==="data"){const{messages:p}=JSON.parse(h.data);t(g=>({status:"inflight",messages:p,run_id:g==null?void 0:g.run_id}))}else if(h.event==="metadata"){const{run_id:p}=JSON.parse(h.data);t(g=>({status:"inflight",messages:g==null?void 0:g.messages,run_id:p}))}else h.event==="error"&&t(p=>({status:"error",messages:p==null?void 0:p.messages,run_id:p==null?void 0:p.run_id}))},onclose(){t(h=>({status:(h==null?void 0:h.status)==="error"?h.status:"done",messages:h==null?void 0:h.messages,run_id:h==null?void 0:h.run_id,merge:h==null?void 0:h.merge})),r(null)},onerror(h){throw t(p=>({status:"error",messages:p==null?void 0:p.messages,run_id:p==null?void 0:p.run_id,merge:p==null?void 0:p.merge})),r(null),h}})},[]),i=j.useCallback((l=!1)=>{n==null||n.abort(),r(null),l&&t(null)},[n]);return{startStream:o,stopStream:i,stream:e}}function WL(e,t){if(e=e??[],!Array.isArray(t)){const n=t;t=[...e.filter(r=>r.assistant_id!==n.assistant_id),n]}return Ux(t,"updated_at","desc")}function GL(){const[e,t]=j.useReducer(WL,null),[n,r]=j.useState(null);j.useEffect(()=>{async function l(){const c=new URLSearchParams(window.location.search).get("shared_id"),[f,h]=await Promise.all([fetch("/assistants/",{headers:{Accept:"application/json"}}).then(p=>p.json()).then(p=>p.map(g=>({...g,mine:!0}))),fetch("/assistants/public/"+(c?`?shared_id=${c}`:""),{headers:{Accept:"application/json"}}).then(p=>p.json())]);t(f.concat(h)),h.find(p=>p.assistant_id===c)&&r(c)}l()},[]);const o=j.useCallback(async(l,s,c,f,h=crypto.randomUUID())=>{const p=c.reduce((y,b)=>(y.append("files",b),y),new FormData);p.append("config",JSON.stringify({configurable:{assistant_id:h}}));const[g]=await Promise.all([fetch(`/assistants/${h}`,{method:"PUT",body:JSON.stringify({name:l,config:s,public:f}),headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(y=>y.json()),c.length?fetch("/ingest",{method:"POST",body:p}):Promise.resolve()]);t({...g,mine:!0}),r(g.assistant_id)},[]),i=j.useCallback(l=>{r(l)},[]);return{configs:e,currentConfig:(e==null?void 0:e.find(l=>l.assistant_id===n))||null,saveConfig:o,enterConfig:i}}function VL(){const[e,t]=j.useState(!1),{configSchema:n,configDefaults:r}=NL(),{chats:o,currentChat:i,createChat:l,enterChat:s}=AL(),{configs:c,currentConfig:f,saveConfig:h,enterConfig:p}=GL(),{startStream:g,stopStream:y,stream:b}=HL(),E=j.useCallback(async(k,C=i)=>{var L;!C||!((L=c==null?void 0:c.find(U=>U.assistant_id===C.assistant_id))!=null&&L.config)||await g({messages:[{content:k,additional_kwargs:{},type:"human",example:!1}]},C.assistant_id,C.thread_id)},[i,g,c]),O=j.useCallback(async k=>{if(!f)return;const C=await l(k,f.assistant_id);return E(k,C)},[l,E,f]),_=j.useCallback(async k=>{i&&(y==null||y(!0)),s(k),e&&t(!1)},[s,y,e,i]),w=i?M.jsx(_C,{chat:i,startStream:E,stopStream:y,stream:b}):M.jsx(Cj,{startChat:O,configSchema:n,configDefaults:r,configs:c,currentConfig:f,saveConfig:h,enterConfig:p}),S=c==null?void 0:c.find(k=>k.assistant_id===(i==null?void 0:i.assistant_id));return M.jsx(mA,{subtitle:S?M.jsxs("span",{className:"inline-flex gap-1 items-center",children:[S.name,M.jsx(q2,{className:"h-5 w-5 cursor-pointer text-indigo-600",onClick:()=>{s(null),p(S.assistant_id)}})]}):null,sidebarOpen:e,setSidebarOpen:t,sidebar:M.jsx(xC,{chats:j.useMemo(()=>c===null||o===null?null:o.filter(k=>c.some(C=>C.assistant_id===k.assistant_id)),[o,c]),currentChat:i,enterChat:_}),children:n?w:null})}document.cookie.indexOf("user_id")===-1&&(document.cookie=`opengpts_user_id=${crypto.randomUUID()}`);ap.createRoot(document.getElementById("root")).render(M.jsx(VL,{})); diff --git a/backend/ui/index.html b/backend/ui/index.html index ba027216..4a61bf3d 100644 --- a/backend/ui/index.html +++ b/backend/ui/index.html @@ -6,7 +6,7 @@ OpenGPTs - + diff --git a/frontend/src/hooks/useChatMessages.ts b/frontend/src/hooks/useChatMessages.ts index 6ede4157..1e5d9ffe 100644 --- a/frontend/src/hooks/useChatMessages.ts +++ b/frontend/src/hooks/useChatMessages.ts @@ -46,6 +46,6 @@ export function useChatMessages( }, [stream?.status]); return stream?.merge - ? [...(messages ?? []), ...stream.messages] + ? [...(messages ?? []), ...(stream.messages ?? [])] : stream?.messages ?? messages; }