@cotal-ai/web 0.163.5 → 0.164.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,110 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-Bfff_dYO.js","assets/rolldown-runtime-XKyaHtl9.js"])))=>i.map(i=>d[i]);
2
- import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`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`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ee=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function L(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ee)}catch(e){ee(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function te(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else L(te.bind(null,e))}var ne={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=te,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=L,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),r=t(((e,t)=>{t.exports=n()})),i=t((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),a=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=i()})),o=e(r(),1),s=e(a(),1),c=e=>e.kind===`msg`?`msg\u0001${e.channel}`:`dm\u0001${e.to}`;function l(e,t){if(e.view===`channel`)return{kind:`msg`,channel:e.channel};if(e.view!==`dm`)return;let n=t??void 0;if(e.with===void 0)return e.peer===n?void 0:{kind:`dm`,to:e.peer};if(e.peer===n)return{kind:`dm`,to:e.with};if(e.with===n)return{kind:`dm`,to:e.peer}}var u=`You'll show on the roster as operator when you post. Replies come to your DMs.`;function d(e){return e.mode===`participant`?u:e.reason===`This dashboard was started with --creds, which can only read.`?"Restart `cotal web` without `--creds` to post here.":``}function f(e){return/^[A-Za-z0-9_@%+=:,./-]+$/.test(e)?e:`'${e.replace(/'/g,`'\\''`)}'`}function p(e){return e.kind===`msg`?`cotal send -c ${f(e.channel)} "<text>"`:`cotal send -t ${f(e.to)} "<text>"`}function m(e,t){return t?{view:`dm`,peer:e,with:t}:{view:`dm`,peer:e}}function h(e,t){if(e!==null)return e.mode===`off`?{text:`Read only`,title:e.reason}:t?{text:`On the roster`,title:`You show on the roster as operator once you post, so agents can reply to you.`}:{text:`Not on the roster`,title:u}}var g=class extends Error{status;error;constructor(e,t){super(t),this.status=e,this.error=t,this.name=`SendRefused`}};async function _(e){let t=``;try{let n=await e.json();n&&typeof n.error==`string`&&(t=n.error)}catch{}return new g(e.status,t)}function v(e,t){let n=t instanceof g?t.status:void 0,r=(t instanceof g?t.error:t instanceof Error?t.message:String(t)).trim()||(n===void 0?`the request failed`:`HTTP ${n}`),i=/[.?!]$/.test(r)?r:`${r}.`;return`Couldn't post to ${e}. ${n===502?`The broker refused it: ${i}`:i} Your message is still here.`}async function y(e,t){if(!e.ok){let n=``;try{let t=await e.json();t&&typeof t.error==`string`&&(n=`: ${t.error}`)}catch{}throw Error(`${t} refused with HTTP ${e.status}${n}`)}return e.json()}async function b(e){let t=await Promise.all(e.map(async e=>{try{return{value:await e.read()}}catch(e){return{error:e}}})),n=[];for(let r=0;r<t.length;r++){let i=t[r];if(`error`in i){let t=i.error;n.push({kind:`refused`,name:e[r].name,reason:t&&t.message?t.message:String(i.error)})}else e[r].apply(i.value)}return n}function x(e){if(!e.length)return``;let t=e.filter(e=>e.kind!==`partial`).map(e=>e.name),n=e.filter(e=>e.kind===`partial`).map(e=>e.name),r=[];return t.length&&r.push(`stale: ${t.join(`, `)}`),n.length&&r.push(`partial: ${n.join(`, `)}`),r.join(` · `)}var S=new Map;function C(e,t){S.set(e,t)}function w(e){if(e.kind===`text`)return e.text;if(e.kind===`artifact`)return`[artifact ${e.name} (${e.mediaType}, ${e.size} bytes) ${e.digest}]`;if(e.kind===`data`){let t=JSON.stringify(e.data);return t===void 0?`[empty data part]`:t}let t=e.kind,n=S.has(t)?S.get(t):void 0;if(typeof n==`function`){let r;try{r=n(e)}catch(e){let n=e;return`[renderer for part kind ${JSON.stringify(t)} failed: ${n&&n.message?n.message:String(e)}]`}return typeof r==`string`?r:`[renderer for part kind ${JSON.stringify(t)} returned ${typeof r}, expected a string]`}let r=JSON.stringify(e.data);return r===void 0?`[unrenderable part kind ${JSON.stringify(t)} \u2014 no renderer for it on this surface]`:`[${t}] ${r}`}function T(e){return(e||[]).map(e=>w(e)).join(` `)}function E(e){if(typeof e!=`object`||!e)return;let t=e;if(t.type!==`CUSTOM`||t.name!==`cotal.toolResult`)return;let n=t.value;if(typeof n!=`object`||!n||Array.isArray(n))return;let r=Object.keys(n);if(r.length!==2||!r.includes(`toolCallId`)||!r.includes(`isError`))return;let i=n;if(typeof i.toolCallId==`string`&&typeof i.isError==`boolean`)return{toolCallId:i.toolCallId,isError:i.isError}}function D(e){if(typeof e!=`number`||!Number.isFinite(e))return;let t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}var O=e=>`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`,k=e=>{let t=D(e);return t&&O(t)},A=2e3,j=`ag-ui.frame`,M=e=>typeof e==`string`?e:void 0,N=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,P=class{label;constructor(e){this.label=e}};function F(e,t){if(typeof e.id!=`string`)return[];let n=Array.isArray(e.parts)?e.parts:[],r=[];for(let i of n){if(typeof i!=`object`||!i||i.kind!==j)continue;let n=i.events,a=r.length===0?e.id:`${e.id}#${r.length}`;r.push({id:a,ts:e.ts,events:Array.isArray(n)&&n.length>0?n:[new P(`A frame with no events`)],live:t})}return r.length>0?r:[{id:e.id,ts:e.ts,events:[new P(T(n))],live:t}]}function I(e){let t=e.lastIndexOf(`__`);return t<0?e:e.slice(t+2)}var ee=new Map([[`Bash`,`command`],[`Edit`,`edit`],[`MultiEdit`,`edit`],[`NotebookEdit`,`edit`],[`Write`,`write`],[`Read`,`read`],[`cotal_send`,`send`],[`cotal_dm`,`dm`],[`cotal_inbox`,`inbox`]]);function L(e){return ee.get(e)??`other`}function te(e){let t=/^events\.([A-Za-z0-9_]+)\.([A-Za-z0-9_]+)$/.exec(e);return t?`${t[1]}.${t[2]}`:void 0}function ne(e){let t=0;for(let n of e)t+=n.events.length;return t}var re=new Map([[`human`,`prompt`],[`sdk`,`prompt`],[`channel`,`mesh`],[`auto-continuation`,`continuation`],[`notification`,`notification`]]);function ie(e){let t=e.cotal,n=typeof t==`object`&&t?M(t.turnSource):void 0;return n===void 0?void 0:re.get(n)}function R(e){let t=[],n=new Map,r=new Map,i=new Map,a=!1,o=(e,t,n,r,i)=>{let a=e.get(t);if(a!==void 0)return a.at=r,a.live=a.live&&i,a;let o={text:``,user:!1,key:n,at:r,live:i};return e.set(t,o),o},s=(e,t,n,r,i)=>{let a=o(e,t,n,r,i);return a.text=``,a.user=!1,a.key=n,a.live=i,a},c=(e,n,r,i,a,o=!0)=>{let s=e.get(n);if(e.delete(n),s===void 0||s.text.length===0)return;let c=r===`said`&&s.user?`prompt`:r;t.push({item:{kind:c,key:s.key,text:s.text,cut:i},at:a??s.at,live:s.live&&o})},l=()=>{for(let e of[...n.keys()])c(n,e,`said`,!0);for(let e of[...r.keys()])c(r,e,`reasoning`,!0)};for(let u of e){let e=N(u.ts);u.events.forEach((d,f)=>{let p=`${u.id}:${f}`,m=u.live;if(d instanceof P){t.push({item:{kind:`unknown`,key:p,label:d.label,ts:e},at:e,live:m});return}let h=d,g=typeof h==`object`&&!!h,_=g?M(h.type):void 0,v=(g?N(h.timestamp):void 0)??e;switch((_===`RUN_STARTED`||_===`RUN_FINISHED`||_===`RUN_ERROR`)&&l(),_){case`RUN_STARTED`:{let e=ie(h);t.push({item:{kind:`turn`,key:p,ts:v,...e?{source:e}:{}},at:v,live:m});break}case`RUN_FINISHED`:t.push({item:{kind:`turnEnd`,key:p,ts:v},at:v,live:m});break;case`RUN_ERROR`:t.push({item:{kind:`runError`,key:p,ts:v},at:v,live:m});break;case`TEXT_MESSAGE_START`:s(n,M(h.messageId)??``,p,v,m).user=M(h.role)===`user`;break;case`TEXT_MESSAGE_CONTENT`:{let e=o(n,M(h.messageId)??``,p,v,m);e.text+=M(h.delta)??``;break}case`TEXT_MESSAGE_END`:c(n,M(h.messageId)??``,`said`,!1,v,m);break;case`REASONING_MESSAGE_START`:s(r,M(h.messageId)??``,p,v,m);break;case`REASONING_MESSAGE_CONTENT`:{let e=o(r,M(h.messageId)??``,p,v,m);e.text+=M(h.delta)??``;break}case`REASONING_MESSAGE_END`:c(r,M(h.messageId)??``,`reasoning`,!1,v,m);break;case`TOOL_CALL_START`:{let e=M(h.toolCallName)??`?`,n=I(e),r={key:p,id:M(h.toolCallId)??``,name:n,full:e,kind:L(n),...v===void 0?{}:{ts:v},live:m};r.id!==``&&i.set(r.id,r),t.push({call:r,at:v,live:m});break}case`TOOL_CALL_END`:case`TOOL_CALL_ARGS`:case`TOOL_CALL_RESULT`:break;case`CUSTOM`:{let e=E(h);if(e!==void 0){a=!0;let t=i.get(e.toolCallId);t!==void 0&&(v!==void 0&&(t.end=v),t.failed=e.isError,t.live=t.live&&m);break}t.push({item:{kind:`unknown`,key:p,label:`Custom event ${M(h.name)===void 0?`(unnamed)`:JSON.stringify(h.name)}`,ts:v},at:v,live:m});break}default:t.push({item:{kind:`unknown`,key:p,label:`Unrecognised event ${JSON.stringify(_??null)}`,ts:v},at:v,live:m})}})}return l(),{flat:t,marked:a}}function z(e,t){return e.filter(e=>t(e.msg)).map((e,t)=>({msg:e.msg,i:t,at:N(e.msg.ts)})).sort((e,t)=>(e.at??1/0)-(t.at??1/0)||e.i-t.i).map(({msg:e,at:t})=>({msg:e,at:t}))}function ae(e,t){let n=(e,t)=>e!==void 0&&t!==void 0&&e<t,r=[],i=0;for(let a of e){for(;i<t.length&&n(t[i].at,a.at);)r.push(t[i++]);r.push(a)}for(;i<t.length;)r.push(t[i++]);return r}function B(e,t){let{flat:n,marked:r}=R(e),i=z(t,e=>typeof e.channel==`string`||typeof e.to==`string`).map(({msg:e,at:t})=>({post:{kind:`post`,key:`post:${e.id}`,msg:e,...typeof e.channel==`string`?{channel:e.channel}:{to:e.to},live:!0},at:t})),a=[],o,s,c=e=>{s=void 0,(o?.steps??a).push(e)},l=(e,t,n)=>{o!==void 0&&(o.outcome=e,t!==void 0&&(o.end=t),o.live=o.live&&n,o=void 0)};for(let e of ae(n,i)){if(`post`in e){c(e.post);continue}if(`call`in e){if(s!==void 0)s.calls.push(e.call),s.live=s.live&&e.call.live;else{let t={kind:`tools`,key:e.call.key,calls:[e.call],live:e.call.live};c(t),s=t}continue}let t=e.item;switch(t.kind){case`turn`:s=void 0,o!==void 0&&(o.superseded=!0),o={kind:`turn`,key:t.key,...t.ts===void 0?{}:{start:t.ts},outcome:`open`,superseded:!1,...t.source?{source:t.source}:{},steps:[],live:e.live},a.push(o);break;case`turnEnd`:s=void 0,o===void 0?a.push({kind:`turnEnd`,key:t.key,...t.ts===void 0?{}:{ts:t.ts},live:e.live}):l(`finished`,t.ts,e.live);break;case`runError`:c({kind:`runError`,key:t.key,...t.ts===void 0?{}:{ts:t.ts},live:e.live}),l(`failed`,t.ts,e.live);break;case`said`:case`prompt`:case`reasoning`:c({...t,...e.at===void 0?{}:{ts:e.at},live:e.live});break;case`unknown`:c({...t,live:e.live})}}let u=a.some(e=>e.kind===`turn`&&e.outcome!==`open`&&e.steps.some(e=>e.kind===`tools`));return{items:a,toolStatus:r||!u}}function V(e,t){if(e.failed!==void 0)return e.failed?`failed`:`done`;if(!t.toolStatus||!t.trailing)return`called`;let n=t.turn;return n===void 0||n.outcome!==`open`||n.superseded?`noResult`:t.status===`working`?`running`:t.status===`waiting`?`pending`:`noResult`}var H={command:{title:{running:`Running a command`,done:`Ran a command`,failed:`A command failed`,pending:`A command hasn't finished`,noResult:`No result arrived for a command`},one:`ran a command`,many:`ran # commands`,noun:[`command`,`commands`]},edit:{title:{running:`Editing a file`,done:`Edited a file`,failed:`An edit failed`,pending:`An edit hasn't finished`,noResult:`No result arrived for an edit`},one:`made an edit`,many:`made # edits`,noun:[`edit`,`edits`]},write:{title:{running:`Writing a file`,done:`Wrote a file`,failed:`A write failed`,pending:`A write hasn't finished`,noResult:`No result arrived for a write`},one:`wrote a file`,many:`wrote # times`,noun:[`write`,`writes`]},read:{title:{running:`Reading a file`,done:`Read a file`,failed:`A read failed`,pending:`A read hasn't finished`,noResult:`No result arrived for a read`},one:`read a file`,many:`read # times`,noun:[`read`,`reads`]},send:{title:{running:`Sending a message`,done:`Sent a message`,failed:`A message failed`,pending:`A message hasn't finished`,noResult:`No result arrived for a message`},one:`sent a message`,many:`sent # messages`,noun:[`message`,`messages`]},dm:{title:{running:`Sending a direct message`,done:`Sent a direct message`,failed:`A direct message failed`,pending:`A direct message hasn't finished`,noResult:`No result arrived for a direct message`},one:`sent a direct message`,many:`sent # direct messages`,noun:[`direct message`,`direct messages`]},inbox:{title:{running:`Checking the inbox`,done:`Checked the inbox`,failed:`An inbox check failed`,pending:`An inbox check hasn't finished`,noResult:`No result arrived for an inbox check`},one:`checked the inbox`,many:`checked the inbox # times`,noun:[`inbox check`,`inbox checks`]},other:{title:{running:`Using a tool`,done:`Used a tool`,failed:`A tool call failed`,pending:`A tool call hasn't finished`,noResult:`No result arrived for a tool call`},one:`called a tool`,many:`called # tools`,noun:[`tool call`,`tool calls`]}},oe={one:`called another tool`,many:`called # other tools`},U=e=>e.charAt(0).toUpperCase()+e.slice(1),se=(e,t)=>t===1?e.one:e.many.replace(`#`,String(t)),ce=(e,t,n)=>`${e} ${e===1?t:n}`;function le(e,t=64){let n=Array.from(e);return n.length>t?`${n.slice(0,t).join(``)}…`:e}function ue(e,t,n){return t===`called`?`Called ${le(n)}`:H[e].title[t]}function de(e,t){let n=e.filter(e=>e.failed===!0).length;if(!t){let t=e.map(e=>le(e.name));return{title:`Called ${t.length<2?t.join(``):`${t.slice(0,-1).join(`, `)} and ${t.at(-1)}`}`,failed:n}}let r=new Map;for(let t of e)r.set(t.kind,(r.get(t.kind)??0)+1);let i=r.size>1;return{title:U([...r].map(([e,t])=>se(e===`other`&&i?oe:H[e],t)).join(`, `)),failed:n}}var fe=e=>e.steps.flatMap(e=>e.kind===`tools`?e.calls:[]);function pe(e,t,n){let r=(e,t)=>e===void 0||t===void 0?void 0:ve(t-e,!1),i=(e,t,n)=>t===void 0?n:`${e} ${t}`,a;a=e.outcome===`finished`?i(`Worked for`,r(e.start,e.end),`Worked`):e.outcome===`failed`?i(`Turn failed after`,r(e.start,e.end),`Turn failed`):e.superseded||t!==`working`&&t!==`waiting`?`No end arrived for this turn`:t===`working`?i(`Working for`,r(e.start,n),`Working`):i(`Open for`,r(e.start,n),`Turn open`);let o=fe(e).filter(e=>e.failed===!0);if(o.length===0)return{title:a};let[s,c]=new Set(o.map(e=>e.kind)).size===1?H[o[0].kind].noun:[`call`,`calls`];return{title:a,failed:`${ce(o.length,s,c)} failed`}}var me={prompt:`started by a prompt`,mesh:`started by a message from the mesh`,continuation:`started by the harness continuing itself`,notification:`started by a notification`};function he(e){let t=[],n=k(e.start),r=k(e.end);e.outcome===`open`?n!==void 0&&t.push(`since ${n}`):n!==void 0&&r!==void 0&&t.push(n===r?n:`${n} to ${r}`),e.source!==void 0&&t.push(me[e.source]);let i=0;for(let t of e.steps)t.kind===`tools`?i+=t.calls.length:(t.kind===`said`||t.kind===`prompt`||t.kind===`reasoning`||t.kind===`post`)&&i++;t.push(ce(i,`step`,`steps`));let a=e.steps.find(e=>e.kind===`post`&&e.channel!==void 0);return a?.kind===`post`&&t.push(`posted in #${a.channel}`),t.join(` · `)}function ge(e,t,n){let r=k(e.ts);if(t===`called`)return r??``;let i;i=t===`done`||t===`failed`?e.ts===void 0||e.end===void 0?void 0:ve(e.end-e.ts,!0):t===`running`?e.ts===void 0?void 0:ve(n-e.ts,!1):r===void 0?void 0:`started ${r}`;let a=le(e.name);return i===void 0?a:`${a} · ${i}`}function _e(e,t){if(t){let t=ce(e.length,`step`,`steps`),n=e.length>0&&e.every(e=>e.ts!==void 0&&e.end!==void 0)?ve(Math.max(...e.map(e=>e.end))-e[0].ts,!0):void 0;return n===void 0?t:`${t} · ${n}`}let n=ce(e.length,`call`,`calls`),r=k(e[0]?.ts),i=k(e.at(-1)?.ts),a=r===void 0?i:i===void 0||i===r?r:`${r} to ${i}`;return a===void 0?n:`${n} · ${a}`}function ve(e,t){if(!Number.isFinite(e)||e<0)return;let n=Math.floor(e/1e3);return n<60?t?`${(Math.floor(e/100)/10).toFixed(1)}s`:`${n}s`:n<3600?`${Math.floor(n/60)}m ${n%60}s`:`${Math.floor(n/3600)}h ${Math.floor(n%3600/60)}m`}var ye=[`work`,`messages`,`profile`],be=e=>ye.includes(e),xe={view:`activity`},Se={view:`topology`},Ce=/^[A-Za-z0-9_]+\.[A-Za-z0-9_]+$/;function we(e){try{return decodeURIComponent(e)}catch{return}}function Te(e){let t=e.replace(/^#/,``).split(`/`);if(t[0]!==``)return;let[,n,r,i,a,...o]=t;if(!(o.length>0||a!==void 0&&n!==`agent`))switch(n){case`channel`:{if(!r||i!==void 0)return;let e=we(r);if(!e)return;let t=te(e);return t?{view:`agent`,id:t,tab:`work`}:{view:`channel`,channel:e}}case`agent`:{if(!r)return;let e=we(r);if(!e||!Ce.test(e))return;if(i===void 0)return{view:`agent`,id:e,tab:`work`};if(a===void 0){if(be(i))return{view:`agent`,id:e,tab:i};let t=i===``?void 0:we(i);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}if(i!==`work`)return;let t=a===``?void 0:we(a);return t?{view:`agent`,id:e,tab:`work`,at:t}:void 0}case`dm`:{if(!r)return;let e=we(r);if(!e)return;if(i===void 0)return{view:`dm`,peer:e};let t=i===``?void 0:we(i);return t?{view:`dm`,peer:e,with:t}:void 0}case`agents`:return i===void 0?r===void 0||r===`status`?{view:`agents`,group:`status`}:r===`host`?{view:`agents`,group:`host`}:void 0:void 0;case`activity`:case`topology`:case`needs`:return r===void 0?{view:n}:void 0;default:return}}function Ee(e,t){return Te(e)??(t===`/graph`?Se:xe)}function De(e){switch(e.view){case`channel`:return`#/channel/${encodeURIComponent(e.channel)}`;case`dm`:return`#/dm/${encodeURIComponent(e.peer)}${e.with===void 0?``:`/${encodeURIComponent(e.with)}`}`;case`agents`:return e.group===`status`?`#/agents`:`#/agents/${e.group}`;case`agent`:{let t=`#/agent/${encodeURIComponent(e.id)}`;return e.at===void 0?e.tab===`work`?t:`${t}/${e.tab}`:`${t}/work/${encodeURIComponent(e.at)}`}default:return`#/${e.view}`}}function Oe(e){return Ee(e.location.hash,e.location.pathname)}function ke(e,t){let n=()=>t(Oe(e));return e.addEventListener(`hashchange`,n),()=>e.removeEventListener(`hashchange`,n)}function Ae(e,t){if(t.view!==`agent`)return;let n=De(t);e.location.hash!==n&&e.history.replaceState(null,``,n)}function je(e,t){e.location.hash=De(t)}function Me(e){let t=new Map;for(let n of e)n.card?.id&&t.set(n.card.id,n.card.name);return t}var Ne=`operator (you)`;function Pe(e,t,n){if(!e)return`?`;if(n&&(typeof e==`object`?e.id:e)===n&&!t.has(n))return Ne;if(typeof e==`object`)return Pe(e.id,t);let r=t.get(e);if(r!==void 0)return r;let i=/^([A-Za-z0-9_]+)\.([A-Za-z0-9_]+)$/.exec(e);return i&&i[2].length>=32?`${i[1]}.${i[2].slice(0,6)}…`:/^[A-Z2-7]{32,}$/.test(e)?e.slice(0,6)+`…`:e}var Fe=``,Ie=(e,t)=>[e,t].sort().join(Fe);function Le(e){let t=new Map;for(let n of e){let e=n.senderId??n.msg.from?.id,r=typeof n.msg.to==`string`?n.msg.to:void 0;if(!e||!r||e===r)continue;let i=[e,r].sort(),a=i.join(Fe),o=t.get(a);o||t.set(a,o={parts:i,messages:[]}),o.messages.push(n)}let n=[];for(let[e,{parts:r,messages:i}]of t){i.sort((e,t)=>e.msg.ts-t.msg.ts);let t=i[0];n.push({key:e,parts:r,opener:t.senderId??t.msg.from?.id??r[0],messages:i,last:i[i.length-1]?.msg.ts??0,verified:i.every(e=>e.senderId!==void 0)})}return n}function Re(e){return Le(e).sort((e,t)=>t.last-e.last)}function ze(e,t){let n=Me(t),r=new Map;for(let e of t)e.card?.id&&r.set(e.card.id,e);let i=e=>r.get(e)?.status??`offline`,a=new Map;for(let{key:t,parts:n,messages:r,last:i,verified:o}of Le(e))for(let e of n){let s=n[0]===e?n[1]:n[0],c=a.get(e);c||a.set(e,c={id:e,conversations:[],last:0}),c.conversations.push({key:t,with:s,messages:r,last:i,verified:o}),c.last=Math.max(c.last,i)}return[...a.values()].map(e=>({id:e.id,name:Pe(e.id,n),role:r.get(e.id)?.card?.role,status:i(e.id),conversations:e.conversations.sort((e,t)=>t.last-e.last),threads:e.conversations.length,last:e.last})).sort((e,t)=>t.last-e.last)}var Be=[`waiting`,`working`,`idle`,`offline`],Ve=(e,t)=>{let n=e?.[t];return typeof n==`string`?n:void 0},He=e=>{let t=Ve(e,`ai.cotal.events`);return t===`on`||t===`off`?{events:t}:{}},Ue=e=>{let t=Be.indexOf(e);return t===-1?Be.length:t};function We(e,t={}){return e.filter(e=>t.includeOffline||e.status!==`offline`).sort((e,t)=>Ue(e.status)-Ue(t.status)||e.card.name.localeCompare(t.card.name)).map(e=>({id:e.card.id,name:e.card.name,role:e.card.role,status:e.status,activity:e.activity,harness:Ve(e.card.meta,`connector`),host:Ve(e.card.meta,`host`),attention:e.attention,model:Ve(e.card.meta,`model`),ts:e.ts,statusSince:e.statusSince,condition:e.condition,activitySince:e.activitySince,activeAt:e.activeAt,...He(e.card.meta)}))}var Ge=e=>e.filter(e=>e.status===`waiting`);function Ke(e){let t=e.filter(e=>e.status!==`offline`&&typeof e.ts==`number`).map(e=>e.ts);return t.length?Math.min(...t):void 0}var qe=e=>e.status;function Je(e){if(!e||e.fresh)return;if(e.state===`unpopulated`)return{kind:`refused`,name:`roster`,reason:`observer presence snapshot still loading`};let t={kind:`refused`,name:`roster`,reason:`observer presence watch silent since ${Number.isFinite(e.staleSince)?new Date(e.staleSince).toISOString():`unknown`}`};return Number.isFinite(e.staleSince)?{...t,since:e.staleSince}:t}function Ye(e,t){let n=()=>t(e.get());return(0,o.useSyncExternalStore)(e.subscribe,n,n)}var W=48,G=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-W-t;return n},Xe=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},Ze=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-W;n+=i>>>1^-(i&1),t[r]=n}return t},Qe=384,$e=[],et=Xe(G(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),tt=Xe(G(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),nt=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,rt=(()=>{let e=et.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=et[n];i<et[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(et[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=et[i];a<et[i+1];a++)n[r++]=e,e+=t[e]}return n})(),it=G(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),at=Xe(G(`123333359346463635126536711576`)),ot=G(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),st=G(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),ct=Ze(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),lt=(()=>{let e=new Int32Array(319).fill(-1),t=Ze(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=Ze(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),ut=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),dt=Ze(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),ft=Ze(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>6ʰ22ʷʺʷʺʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),pt=Ze(`02222222222222222222222222222222222222222222222222222222222222222202021422222222CF2200GJ021042222WZ222IL0ad2c10h2222U00X202[^2w0000120zy|}€22ƒ†…:22z22222222222G000q†OVI00000{˜2™<40000Œ›@00000G¦§000ª00000000000000021K¬«00®“000000000000000000000–222›HGH_1¸222½2¾2222ÇÊ000­°2±`),mt=new Int32Array(987),ht=new Int32Array(987),gt=new Int32Array(987),_t=``,vt=new Int32Array(1022);{let e=new Map,t=0,n=0;for(let r=0;r<dt.length;r++)for(let i of ut[pt[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),vt[a*2]=_t.length,vt[a*2+1]=i.length,_t+=i),mt[n]=dt[r],ht[n]=ft[r],gt[n]=a,n++}}var yt=Ze(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),bt=Xe(G(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),xt=Ze(`2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222`),St=G(`ij`),Ct=G(`—`),wt=G(`1`),Tt={GROUP_COUNT:Qe,customValidatorNames:$e,edgeStart:et,labelStart:tt,labelText:nt,edgeTarget:rt,nodeGroup:it,nodeVlist:lt,vlistPat:at,vlistOps:ot,vlistRef:st,vlistGroup:ct,litAnchor:mt,litGroup:ht,litPool:gt,poolOffsets:vt,poolText:_t,adjGid:yt,adjStart:bt,adjTgt:xt,patGid:St,patTgt:Ct,postfixLookupGroups:wt,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},Et=`line`in Error(),Dt=-1,Ot=-1,kt=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},At=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},jt=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let ee=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(kt(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;ee[n]!==-1;)n=n+1&I-1;ee[n]=e}let L=(e,t,n,r)=>{let i=(kt(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=ee[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},te=n.cacheSize??8192,ne=n.prefix??e.prefix??``,re=ne===``?``:ne+`:`,ie=re.length,R=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),z=/\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$/,ae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,B=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,V=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,H=0,oe=-1,U=-1,se=-1,ce=-1,le=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ue=e=>/\s/.test(String.fromCharCode(e)),de=(e,t,n)=>{if(H=0,oe=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)H=1;else if(r===40&&i===41)H=2;else return;se=t+1,ce=n-1;let a=t+1;if(le(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!le(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(oe=t+1,U=a,se=a+1)}},fe=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},pe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,me=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,he=e=>!!e&&!Number.isNaN(Number(e)),ge=(e,t,n)=>{if(n-t<11||!fe(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&fe(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&fe(e,t+10,t+18,`-normal/`)},_e=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],ve=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),ye=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],be=(e,t,n,r)=>{if(e>=10){if(e>=25)return R[e-25](t.slice(n,r));let i=e-10;if(H!==_e[i])return!1;if(oe>=0){for(let e of ve[i])if(fe(t,oe,U,e))return!0;return!1}switch(ye[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(se,ce);return z.test(e)&&!ae.test(e)}case 3:return he(t.slice(se,ce));case 4:return V.test(t.slice(se,ce));default:return B.test(t.slice(se,ce))}}switch(e){case 0:return!0;case 1:return H===0;case 2:return H===1;case 3:return H===2;case 4:return pe.test(t.slice(n,r));case 5:return he(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&he(t.slice(n,r-1));case 8:return me.test(t.slice(n,r));default:return ge(t,n,r)}},xe=new Set(typeof E==`string`?E.split(` `):E),Se=(e,t,n,r,i,a)=>{let o=kt(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},Ce=new Map,we=new Map,Te=2,Ee=4096,De=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||xe.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=we.get(s);return c===void 0&&we.set(s,c=Te++),c},Oe=new Map,ke=r,Ae=r+4096,je=()=>ke++,Me=2097152,Ne=8192,Pe=new Int32Array(Ne),Fe=Array(Ne).fill(null),Ie=new Int32Array(Ne),Le=new Int32Array(Ne),Re=new Uint8Array(Ne),ze=0,Be=(e,t,n,r,i,a,o,s)=>{let c=e;if(Fe[e]!==null){if(Fe[e|1]===null)c=e|1;else if(!(ze++&3))c=e|ze>>2&1;else return}Fe[c]=t.slice(n,r),Pe[c]=i,Ie[c]=a,Le[c]=o,Re[c]=s},Ve=()=>Fe.fill(null),He=256,Ue=[new Int32Array(He),new Int32Array(He),new Int32Array(He),new Int32Array(He)],[We,Ge,Ke,qe]=Ue,Je=new Uint8Array(He),Ye=new Uint8Array(He),W=()=>{He*=2,Ue=Ue.map(e=>{let t=new Int32Array(He);return t.set(e),t}),[We,Ge,Ke,qe]=Ue;let e=new Uint8Array(He);e.set(Je),Je=e,Ye=new Uint8Array(He)},G=64,Xe=new Int32Array(G),Ze=new Int32Array(G),Qe=new Int32Array(r),$e=2048,et=21,tt=new Float64Array($e),nt=new Int32Array($e),rt=0,it=(e,t)=>{if(e===0&&t<r)return Qe[t]===rt?1:(Qe[t]=rt,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>et;for(;nt[i]===rt;){if(tt[i]===n)return 1;i=i+1&$e-1}return tt[i]=n,nt[i]=rt,0},at=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?Dt:Se(Oe,e,t+1,r,0,je)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Ze[t];if(r>n)continue;let i=Xe[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=L(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;de(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(be(d[t],e,r,n))return p[h+t]}return Dt},ot=e=>{let t=e.length,n=0,c=0,u=!1;(Te>Ee||Ce.size>Ee)&&(Ce=new Map,we=new Map,Te=2,Ve()),ke>Ae&&(Oe=new Map,ke=r,Ve());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ue(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ue(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===He&&W();let _=n++;We[_]=p,Ge[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(Pe[y]===v&&Fe[y]!==null&&Fe[y].length===g?t=y:Pe[y|1]===v&&Fe[y|1]!==null&&Fe[y|1].length===g&&(t=y|1),t>=0){let n=Fe[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Ke[_]=Ie[t],qe[_]=Le[t],Je[_]=Re[t];continue}}}let b=p;if(ie!==0){if(h-p<=ie||!e.startsWith(re,p)){Ke[_]=Dt,Be(y,e,p,h,v,Dt,0,0);continue}b=p+ie}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,ee=-1,L=0;(l[0]>=0||N[0]===1)&&(Xe[0]=0,Ze[0]=M,L=1);let te=Ot,ne=0;for(let t=M;t<D;t++)if(t===A&&(te=F<I?Ot:P,ne=L),P!==Ot){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=ee)):P=Ot;else{let e=i[P],t=i[P+1],c=Ot;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],ee=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(L===G){G*=2;let e=new Int32Array(G);e.set(Xe),Xe=e;let t=new Int32Array(G);t.set(Ze),Ze=t}Xe[L]=r,Ze[L]=t+2,L++}}A===D&&(te=F<I?Ot:P,ne=L);let R=F<I?Ot:P,z,ae=!1;if(A>=0){if(ae=!0,z=at(e,E,A,te,ne),z!==Dt&&z<r&&j[z]){let t=at(e,E,D,R,L);t!==Dt&&t!==z&&(z=t,ae=!1)}else z===Dt&&(z=at(e,E,D,R,L),ae=!1)}else z=at(e,E,D,R,L);let B=0,V=0;z===Dt?Ke[_]=Dt:(V=+!!ae,B=b>=C?+!!O:Se(Ce,e,b,C,+!!O,e=>De(e,O)),Ke[_]=z,Je[_]=V,qe[_]=B),Be(y,e,p,h,v,z,B,V)}if(n===0)return``;if(n===1)return We[0]===0&&Ge[0]===t?e:e.slice(We[0],Ge[0]);if(n*k>$e){for(;n*k>$e;)$e<<=1,et--;tt=new Float64Array($e),nt=new Int32Array($e)}if(Te>=Me||ke>=Me)throw Error(`cn: too many distinct classes in one merge`);rt=rt+1|0,rt===0&&(Qe.fill(0),nt.fill(0),rt=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Ke[e];if(t===Dt){Ye[e]=1;continue}let n=qe[e];if(it(n,t)===1)Ye[e]=0,f=!0;else if(Ye[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)it(n,x[e]);if(Je[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&it(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ye[m]){m++;continue}let t=We[m],r=Ge[m],i=m+1;for(;i<n&&Ye[i]&&We[i]===r+1&&e.charCodeAt(r)===32;)r=Ge[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},st=16384,ct=new Int32Array(st*2),lt=0,ut=1,dt=Object.create(null),ft=Object.create(null),pt=new Map,mt=new Map,ht=0,gt=0,_t=()=>{lt^=st,ut=ut+1|0,gt=0},vt=e=>{let t=dt[e];if(t!==void 0)return t;let n=At(e,0,e.length),r=(n&16383)+lt,i=ct[r]===(n^ut)||ct[r^st]===(n^ut-1);return i&&(t=ft[e],t!==void 0)?(dt[e]=t,t):(t=ot(e),i?(dt[e]=t,++ht>te&&(ht=0,ft=dt,dt=Object.create(null),_t())):(ct[r]=n^ut,++gt>st&&_t()),t)},yt=e=>{let t=pt.get(e);if(t!==void 0)return t;let n=At(e,0,e.length),r=(n&16383)+lt,i=ct[r]===(n^ut)||ct[r^st]===(n^ut-1);return i&&(t=mt.get(e),t!==void 0)?(pt.set(e,t),t):(t=ot(e),i?(pt.set(e,t),++ht>te&&(ht=0,mt=pt,pt=new Map,_t())):(ct[r]=n^ut,++gt>st&&_t()),t)},bt=e=>{let t=At(e,0,e.length),n=(t&16383)+lt;return ct[n]===(t^ut)||ct[n^st]===(t^ut-1)||(ct[n]=t^ut,++gt>st&&_t(),!1)},xt=te===0?ot:Et?e=>{let t=pt.get(e);return t===void 0?yt(e):t}:vt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?xt(arguments[0]):xt(Pt.apply(null,arguments))},mergeString:xt,seenBefore:te===0?()=>!1:bt,mergeUncached:ot}},Mt=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Mt(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Nt=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Mt(i,t);a&&(n&&(n+=` `),n+=a)}return n},Pt=function(){return Nt(arguments,!1)},Ft=256,It=16,Lt=1024,Rt=4096,zt=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(Rt).fill(``),l=Array(Rt).fill(``),u=Array(Rt).fill(``));let i=At(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Mt(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>It&&(_.miss=It,_.skip=Lt,_.e.length=0,_.at=0);let u=_.e;u.length<Ft?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Mt(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},Bt=jt(Tt),K=zt(Bt.mergeString,Bt);Bt.merge;var Vt=Object.defineProperty,Ht=(e,t)=>Vt(e,`name`,{value:t,configurable:!0});function Ut(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ht(Ut,`setRef`);function Wt(...e){return t=>{let n=!1,r=e.map(e=>{let r=Ut(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Ut(e[t],null)}}}}Ht(Wt,`composeRefs`);function Gt(...e){return o.useCallback(Wt(...e),e)}Ht(Gt,`useComposedRefs`);var Kt=Object.defineProperty,qt=(e,t)=>Kt(e,`name`,{value:t,configurable:!0});function Jt(e){let t=o.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,s=!1,c=[];r=on(r),o.Children.forEach(r,e=>{if(tn(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;rn(n)&&typeof un==`function`;)n=un(n._payload);a=Qt(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=o.cloneElement(a,void 0,c):!s&&o.Children.count(r)===1&&o.isValidElement(r)&&(a=r);let l=a?en(a):void 0,u=Gt(n,l);if(!a){if(r||r===0)throw Error(s?ln(e):cn(e));return r}let d=$t(i,a.props??{});return a.type!==o.Fragment&&(d.ref=n?u:l),o.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}qt(Jt,`createSlot`);var Yt=Jt(`Slot`),Xt=Symbol.for(`radix.slottable`);function Zt(e){let t=qt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Xt,t}qt(Zt,`createSlottable`);var Qt=qt((e,t)=>`child`in e.props?o.isValidElement(t)?o.cloneElement(t,void 0,e.props.children(t.props.children)):null:o.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function $t(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=sn(a,i))}return{...e,...n}}qt($t,`mergeProps`);function en(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}qt(en,`getElementRef`);function tn(e){return o.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Xt}qt(tn,`isSlottable`);var nn=Symbol.for(`react.lazy`);function rn(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===nn&&`_payload`in e&&an(e._payload)}qt(rn,`isLazyComponent`);function an(e){return typeof e==`object`&&!!e&&`then`in e}qt(an,`isPromiseLike`);function on(e){let t=e;for(;rn(t)&&typeof un==`function`;)t=un(t._payload);return t}qt(on,`useUnwrappedLazy`);function sn(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}qt(sn,`concatAriaDescribedby`);var cn=qt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),ln=qt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),un=o.use,dn=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),fn=t(((e,t)=>{t.exports=dn()})),q=fn(),pn=Object.defineProperty,mn=(e,t)=>pn(e,`name`,{value:t,configurable:!0}),J=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Jt(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,q.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function hn(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}mn(hn,`dispatchDiscreteCustomEvent`);var gn=Object.defineProperty,_n=(e,t)=>gn(e,`name`,{value:t,configurable:!0}),vn=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),yn=o.forwardRef(_n(function(e,t){return(0,q.jsx)(J.span,{...e,ref:t,style:{...vn,...e.style}})},`VisuallyHidden`)),bn=Object.defineProperty,xn=(e,t)=>bn(e,`name`,{value:t,configurable:!0});function Sn(e,t){let n=o.createContext(t);n.displayName=e+`Context`;let r=xn(e=>{let{children:t,...r}=e,i=o.useMemo(()=>r,Object.values(r));return(0,q.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,s=o.useContext(n);if(s)return s;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return xn(i,`useContext`),[r,i]}xn(Sn,`createContext`);function Cn(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let s=xn(t=>{let{scope:n,children:r,...s}=t,c=n?.[e]?.[a]||i,l=o.useMemo(()=>s,Object.values(s));return(0,q.jsx)(c.Provider,{value:l,children:r})},`Provider`);s.displayName=t+`Provider`;function c(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[a]||i,d=o.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return xn(c,`useContext`),[s,c]}xn(r,`createContext`);let i=xn(()=>{let t=n.map(e=>o.createContext(e));return xn(function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,wn(i,...t)]}xn(Cn,`createContextScope`);function wn(...e){let t=e[0];if(e.length===1)return t;let n=xn(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return xn(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}xn(wn,`composeContextScopes`);var Tn=globalThis?.document?o.useLayoutEffect:()=>{},En=Object.defineProperty,Dn=(e,t)=>En(e,`name`,{value:t,configurable:!0});function On(e){let t=e+`CollectionProvider`,[n,r]=Cn(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=Dn(e=>{let{scope:t,children:n}=e,r=o.useRef(null),a=o.useRef(new Map).current;return(0,q.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);s.displayName=t;let c=e+`CollectionSlot`,l=Jt(c),u=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Gt(t,a(c,n).collectionRef);return(0,q.jsx)(l,{ref:i,children:r})});u.displayName=c;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=Jt(d),m=o.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=o.useRef(null),c=Gt(t,s),l=a(d,n);return o.useEffect(()=>(l.itemMap.set(s,{ref:s,...i}),()=>void l.itemMap.delete(s))),(0,q.jsx)(p,{[f]:``,ref:c,children:r})});m.displayName=d;function h(t){let n=a(e+`CollectionConsumer`,t);return o.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Dn(h,`useCollection`),[{Provider:s,Slot:u,ItemSlot:m},h,r]}Dn(On,`createCollection`);var kn=new WeakMap,An=class e extends Map{static{Dn(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],kn.set(this,!0)}set(e,t){return kn.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=Nn(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=jn(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=jn(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return jn(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function jn(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Mn(e,t);return n===-1?void 0:e[n]}Dn(jn,`at`);function Mn(e,t){let n=e.length,r=Nn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Dn(Mn,`toSafeIndex`);function Nn(e){return e!==e||e===0?0:Math.trunc(e)}Dn(Nn,`toSafeInteger`);function Pn(e){let t=e+`CollectionProvider`,[n,r]=Cn(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[s,c]=n(t);s.displayName=e+`CollectionStatefulContextProvider`;let l=Dn(({state:e,...t})=>e?(0,q.jsx)(d,{...t,state:e}):(0,q.jsx)(u,{...t}),`CollectionProvider`);l.displayName=t;let u=Dn(e=>{let t=v();return(0,q.jsx)(d,{...e,state:t})},`CollectionInit`);u.displayName=e+`CollectionInit`;let d=Dn(e=>{let{scope:t,children:n,state:r}=e,a=o.useRef(null),[c,l]=o.useState(null),u=Gt(a,l),[d,f]=r,p=o.useRef(new An),m=o.useCallback(()=>{let e=p.current;return Ln(e)||e.sort(Rn),e},[]);return o.useEffect(()=>{if(!c)return;let e=zn(()=>{f(e=>{let t=e.toSorted(Rn);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c,f]),(0,q.jsx)(i,{scope:t,collectionElementRef:u,collectionElementRefObject:a,getCollection:m,setCollection:f,registryRef:p,children:(0,q.jsx)(s,{scope:t,collectionElement:c,collection:d,children:n})})},`CollectionProviderImpl`);d.displayName=e+`CollectionProviderImpl`;let f=e+`CollectionSlot`,p=Jt(f),m=o.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Gt(t,a(f,n).collectionElementRef);return(0,q.jsx)(p,{ref:i,children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=Jt(h),_=o.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,s=o.useRef(null),{setCollection:c,registryRef:l}=a(h,n),u=o.useRef(i);Fn(u.current,i)||(u.current=i);let d=u.current,f=Gt(t,o.useCallback(e=>{let t=l.current;e?t.set(e,{...u.current,element:e}):s.current&&t.delete(s.current)},[l]),s);Tn(()=>{let e=s.current,t=l.current;e&&t.has(e)&&t.set(e,{...d,element:e})},[d,l]);let p=o.useRef(null);return o.useEffect(()=>{let e=s.current,t=p.current;((t?.element??null)!==e||e&&t?.itemData!==d)&&(p.current=e?{element:e,itemData:d}:null,c(n=>{let r=new An(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...d,element:e}),r.sort(Rn)}))}),o.useEffect(()=>()=>{let e=p.current;p.current=null,e&&c(t=>{if(!t.has(e.element))return t;let n=new An(t);return n.delete(e.element),n})},[c]),(0,q.jsx)(g,{"data-radix-collection-item":``,ref:f,children:r})});_.displayName=h;function v(){return o.useState(new An)}Dn(v,`useInitCollection`);function y(t){let{collection:n}=c(e+`CollectionConsumer`,t);return n}Dn(y,`useCollection`);function b(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return Dn(b,`useGetCollection`),[{Provider:l,Slot:m,ItemSlot:_},{createCollectionScope:r,useCollection:y,useGetCollection:b,useInitCollection:v}]}Dn(Pn,`createCollection`);function Fn(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Dn(Fn,`shallowEqual`);function In(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Dn(In,`isElementPreceding`);function Ln(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Dn(Ln,`isInDocumentOrder`);function Rn(e,t){return!e[1].element||!t[1].element?0:In(e[1].element,t[1].element)?-1:1}Dn(Rn,`sortByDocumentPosition`);function zn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Dn(zn,`getChildListObserver`);var Bn=Object.defineProperty,Vn=(e,t)=>Bn(e,`name`,{value:t,configurable:!0}),Hn=!!(typeof window<`u`&&window.document&&window.document.createElement);function Y(e,t,{checkForDefaultPrevented:n=!0}={}){return Vn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Vn(Y,`composeEventHandlers`);function Un(e){if(!Hn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Vn(Un,`getOwnerWindow`);function Wn(e){if(!Hn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Vn(Wn,`getOwnerDocument`);function Gn(e,t=!1){let{activeElement:n}=Wn(e);if(!n?.nodeName)return null;if(Kn(n)&&n.contentDocument)return Gn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Wn(n).getElementById(e);if(t)return t}}return n}Vn(Gn,`getActiveElement`);function Kn(e){return e.tagName===`IFRAME`}Vn(Kn,`isFrame`);var qn=Object.defineProperty,Jn=(e,t)=>qn(e,`name`,{value:t,configurable:!0}),Yn=o.useEffectEvent,Xn=o.useInsertionEffect;function Zn(e){if(typeof Yn==`function`)return Yn(e);let t=o.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Xn==`function`?Xn(()=>{t.current=e}):Tn(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Jn(Zn,`useEffectEvent`);var Qn=Object.defineProperty,$n=(e,t)=>Qn(e,`name`,{value:t,configurable:!0}),er=o.useInsertionEffect||Tn;function tr({prop:e,defaultProp:t,onChange:n=$n(()=>{},`onChange`),caller:r}){let[i,a,s]=nr({defaultProp:t,onChange:n}),c=e!==void 0;return[c?e:i,o.useCallback(t=>{if(c){let n=rr(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}$n(tr,`useControllableState`);function nr({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return er(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}$n(nr,`useUncontrolledState`);function rr(e){return typeof e==`function`}$n(rr,`isFunction`);var ir=Symbol(`RADIX:SYNC_STATE`);function ar(e,t,n,r){let{prop:i,defaultProp:a,onChange:s,caller:c}=t,l=i!==void 0,u=Zn(s),d=[{...n,state:a}];r&&d.push(r);let[f,p]=o.useReducer((t,n)=>{if(n.type===ir)return{...t,state:n.state};let r=e(t,n);return l&&!Object.is(r.state,t.state)&&u(r.state),r},...d),m=f.state,h=o.useRef(m);o.useEffect(()=>{h.current!==m&&(h.current=m,l||u(m))},[m,h,l]);let g=o.useMemo(()=>i===void 0?f:{...f,state:i},[f,i]);return o.useEffect(()=>{l&&!Object.is(i,f.state)&&p({type:ir,state:i})},[i,f.state,l]),[g,p]}$n(ar,`useControllableStateReducer`);var or=Object.defineProperty,sr=(e,t)=>or(e,`name`,{value:t,configurable:!0});function cr(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}sr(cr,`useStateMachine`);var lr=sr(e=>{let{present:t,children:n}=e,r=ur(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=fr(r.ref,mr(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null},`Presence`);function ur(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),s=o.useRef(void 0),[c,l]=cr(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{c===`mounted`?(a.current=s.current??pr(r.current),s.current=void 0):a.current=`none`},[c]),Tn(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=pr(t);e?(s.current=o,l(`MOUNT`)):o===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),Tn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=sr(a=>{let o=pr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=sr(e=>{e.target===t&&(a.current=pr(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:o.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=pr(t)}else r.current=null;n(e)},[])}}sr(ur,`usePresence`);function dr(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}sr(dr,`setRef`);function fr(...e){let t=o.useRef(e);return t.current=e,o.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=dr(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():dr(n[e],null)}}},[])}sr(fr,`useStableComposedRefs`);function pr(e){return e?.animationName||`none`}sr(pr,`getAnimationName`);function mr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}sr(mr,`getElementRef`);var hr=Object.defineProperty,gr=(e,t)=>hr(e,`name`,{value:t,configurable:!0}),_r=o.useId||(()=>void 0),vr=0;function yr(e){let[t,n]=o.useState(_r());return Tn(()=>{e||n(e=>e??String(vr++))},[e]),e||(t?`radix-${t}`:``)}gr(yr,`useId`);var br=Object.defineProperty,xr=(e,t)=>br(e,`name`,{value:t,configurable:!0}),Sr=`Collapsible`,[Cr,wr]=Cn(Sr),[Tr,Er]=Cr(Sr),Dr=o.forwardRef(xr(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:s,...c}=e,[l,u]=tr({prop:r,defaultProp:i??!1,onChange:s,caller:Sr});return(0,q.jsx)(Tr,{scope:n,disabled:a,contentId:yr(),open:l,onOpenToggle:o.useCallback(()=>u(e=>!e),[u]),children:(0,q.jsx)(J.div,{"data-state":Nr(l),"data-disabled":a?``:void 0,...c,ref:t})})},`Collapsible`)),Or=`CollapsibleTrigger`,kr=o.forwardRef(xr(function(e,t){let{__scopeCollapsible:n,...r}=e,i=Er(Or,n);return(0,q.jsx)(J.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Nr(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Y(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),Ar=`CollapsibleContent`,jr=o.forwardRef(xr(function(e,t){let{forceMount:n,...r}=e,i=Er(Ar,e.__scopeCollapsible);return(0,q.jsx)(lr,{present:n||i.open,children:({present:e})=>(0,q.jsx)(Mr,{...r,ref:t,present:e})})},`CollapsibleContent`)),Mr=o.forwardRef(xr(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,s=Er(Ar,n),[c,l]=o.useState(r),u=o.useRef(null),d=Gt(t,u),f=o.useRef(0),p=f.current,m=o.useRef(0),h=m.current,g=s.open||c,_=o.useRef(g),v=o.useRef(void 0);return o.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),Tn(()=>{let e=u.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();f.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),l(r)}},[s.open,r]),(0,q.jsx)(J.div,{"data-state":Nr(s.open),"data-disabled":s.disabled?``:void 0,id:s.contentId,hidden:!g,...a,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})},`CollapsibleContentImpl`));function Nr(e){return e?`open`:`closed`}xr(Nr,`getState`);var Pr=Object.defineProperty,Fr=(e,t)=>Pr(e,`name`,{value:t,configurable:!0}),Ir={LTR:`ltr`,RTL:`rtl`},Lr=o.createContext(void 0);function Rr(e){let t=o.useContext(Lr);return e||t||Ir.LTR}Fr(Rr,`useDirection`);var zr=Object.defineProperty,Br=(e,t)=>zr(e,`name`,{value:t,configurable:!0}),Vr=o.useInsertionEffect;function Hr(e){let t=o.useRef(e);return typeof Vr==`function`?Vr(()=>{t.current=e}):Tn(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}Br(Hr,`useCallbackRef`);var Ur=Object.defineProperty,Wr=(e,t)=>Ur(e,`name`,{value:t,configurable:!0}),Gr=`dismissableLayer.update`,Kr=`dismissableLayer.pointerDownOutside`,qr=`dismissableLayer.focusOutside`,Jr,Yr=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Xr=o.forwardRef(Wr(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:l,...u}=e,d=o.useContext(Yr),[f,p]=o.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=o.useState({}),g=Gt(t,p),_=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=o.useRef(!1),w=$r(e=>{a?.(e),c?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return S&&!t},[d.branches,S])}),T=ei(e=>{if(r&&C.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(s?.(e),c?.(e),e.defaultPrevented||l?.())},m),E=f?b===_.length-1:!1,D=Hr(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return o.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),o.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Jr=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ti(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Jr))}},[f,m,n,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ti())},[f,d]),o.useEffect(()=>{let e=Wr(()=>h({}),`handleUpdate`);return document.addEventListener(Gr,e),()=>document.removeEventListener(Gr,e)},[]),(0,q.jsx)(J.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Y(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Y(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Y(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Zr(){let e=o.useContext(Yr),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Wr(Zr,`useDismissableLayerSurface`);var Qr=Wr(()=>!0,`IS_TRUE`);function $r(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=Qr}=t,c=Hr(e),l=o.useRef(!1),u=o.useRef(!1),d=o.useRef(new Map),f=o.useRef(()=>{});return o.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}Wr(e,`resetOutsideInteraction`);function t(){return Array.from(d.current.values()).some(Boolean)}Wr(t,`isOutsideInteractionIntercepted`);function o(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}Wr(o,`handleInteractionCapture`);function p(e){u.current&&d.current.set(e.type,!1)}Wr(p,`handleInteractionBubble`);let m=Wr(a=>{if(a.target&&!l.current){let o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ni(Kr,c,p,{discrete:!0})};if(Wr(o,`handleAndDispatchPointerDownOutsideEvent`),!s(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?o():(n.removeEventListener(`click`,f.current),f.current=o,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,o,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,o,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,s]),{onPointerDownCapture:Wr(()=>l.current=!0,`onPointerDownCapture`)}}Wr($r,`usePointerDownOutside`);function ei(e,t=globalThis?.document){let n=Hr(e),r=o.useRef(!1);return o.useEffect(()=>{let e=Wr(e=>{e.target&&!r.current&&ni(qr,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Wr(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Wr(()=>r.current=!1,`onBlurCapture`)}}Wr(ei,`useFocusOutside`);function ti(){let e=new CustomEvent(Gr);document.dispatchEvent(e)}Wr(ti,`dispatchUpdate`);function ni(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?hn(i,a):i.dispatchEvent(a)}Wr(ni,`handleAndDispatchCustomEvent`);var ri=Object.defineProperty,ii=(e,t)=>ri(e,`name`,{value:t,configurable:!0}),ai=`focusScope.autoFocusOnMount`,oi=`focusScope.autoFocusOnUnmount`,si={bubbles:!1,cancelable:!0},ci=o.forwardRef(ii(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:s,...c}=e,[l,u]=o.useState(null),d=Hr(a),f=Hr(s),p=o.useRef(null),m=Gt(t,u),h=o.useRef(i);o.useEffect(()=>{h.current=i});let g=o.useCallback(e=>e?l?.contains(e)?!0:!!h.current?.some(t=>t.contains(e)):!1,[l]),_=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(r){let e=function(e){if(_.paused||!l)return;let t=e.target;g(t)?p.current=t:yi(p.current,{select:!0})},t=function(e){if(_.paused||!l)return;let t=e.relatedTarget;t!==null&&(g(t)||yi(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&yi(l)};ii(e,`handleFocusIn`),ii(t,`handleFocusOut`),ii(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,_.paused,g]),o.useEffect(()=>{if(l){bi.add(_);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(ai,si);l.addEventListener(ai,d),l.dispatchEvent(t),t.defaultPrevented||(pi(Ci(hi(l)),{select:!0}),document.activeElement===e&&yi(l))}return()=>{l.removeEventListener(ai,d);let t=l.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(oi,si);l.addEventListener(oi,f),l.dispatchEvent(r),r.defaultPrevented||yi(e??t.body,{select:!0}),l.removeEventListener(oi,f),bi.remove(_)},0)}}},[l,d,f,_]);let v=o.useCallback(e=>{if(!n&&!r||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=mi(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&yi(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&yi(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,_.paused]);return(0,q.jsx)(J.div,{tabIndex:-1,...c,ref:m,onKeyDown:v})},`FocusScope`)),li=o.createContext(null);function ui({registry:e,children:t}){return e?(0,q.jsx)(li.Provider,{value:e,children:t}):t}ii(ui,`FocusScopeBranchProvider`);function di(){let[e,t]=o.useState([]);return{nodes:e,registry:o.useMemo(()=>({add:ii(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:ii(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}ii(di,`useFocusScopeBranchRegistry`);function fi(e){let t=o.useContext(li);o.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}ii(fi,`useFocusScopeBranch`);function pi(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(yi(r,{select:t}),document.activeElement!==n)return}ii(pi,`focusFirst`);function mi(e){let t=hi(e);return[gi(t,e),gi(t.reverse(),e)]}ii(mi,`getTabbableEdges`);function hi(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ii(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}ii(hi,`getTabbableCandidates`);function gi(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):_i(r,{upTo:t})))return r}ii(gi,`findVisible`);function _i(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}ii(_i,`isHidden`);function vi(e){return e.tagName===`INPUT`&&typeof e.select==`function`}ii(vi,`isSelectableInput`);function yi(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&vi(e)&&t&&e.select()}}ii(yi,`focus`);var bi=xi();function xi(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Si(e,t),e.unshift(t)},remove(t){e=Si(e,t),e[0]?.resume()}}}ii(xi,`createFocusScopesStack`);function Si(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ii(Si,`arrayRemove`);function Ci(e){return e.filter(e=>e.tagName!==`A`)}ii(Ci,`removeLinks`);var wi=Object.defineProperty,Ti=o.forwardRef(((e,t)=>wi(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=o.useState(!1);Tn(()=>a(!0),[]);let c=n||i&&globalThis?.document?.body;return c?s.createPortal((0,q.jsx)(J.div,{...r,ref:t}),c):null},`Portal`)),Ei=Object.defineProperty,Di=(e,t)=>Ei(e,`name`,{value:t,configurable:!0}),Oi=0,ki=null;function Ai(e){return ji(),e.children}Di(Ai,`FocusGuards`);function ji(){o.useEffect(()=>{ki||={start:Mi(),end:Mi()};let{start:e,end:t}=ki;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Oi++,()=>{Oi===1&&(ki?.start.remove(),ki?.end.remove(),ki=null),Oi=Math.max(0,Oi-1)}},[])}Di(ji,`useFocusGuards`);function Mi(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Di(Mi,`createFocusGuard`);var Ni=function(){return Ni=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ni.apply(this,arguments)};function Pi(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Fi(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ii=`right-scroll-bar-position`,Li=`width-before-scroll-bar`,Ri=`with-scroll-bars-hidden`,zi=`--removed-body-scroll-bar-size`;function Bi(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Vi(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Hi=typeof window<`u`?o.useLayoutEffect:o.useEffect,Ui=new WeakMap;function Wi(e,t){var n=Vi(t||null,function(t){return e.forEach(function(e){return Bi(e,t)})});return Hi(function(){var t=Ui.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Bi(e,null)}),i.forEach(function(e){r.has(e)||Bi(e,a)})}Ui.set(n,e)},[e]),n}function Gi(e){return e}function Ki(e,t){t===void 0&&(t=Gi);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function qi(e){e===void 0&&(e={});var t=Ki(null);return t.options=Ni({async:!0,ssr:!1},e),t}var Ji=function(e){var t=e.sideCar,n=Pi(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,Ni({},n))};Ji.isSideCarExport=!0;function Yi(e,t){return e.useMedium(t),Ji}var Xi=qi(),Zi=function(){},Qi=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:Zi,onWheelCapture:Zi,onTouchMoveCapture:Zi}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Pi(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Wi([n,t]),w=Ni(Ni({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Xi,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),Ni(Ni({},w),{ref:C})):o.createElement(y,Ni({},w,{className:l,ref:C}),c))});Qi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Qi.classNames={fullWidth:Li,zeroRight:Ii};var $i=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ea(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=$i();return t&&e.setAttribute(`nonce`,t),e}function ta(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function na(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ra=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ea())&&(ta(t,n),na(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ia=function(){var e=ra();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},aa=function(){var e=ia();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},oa={left:0,top:0,right:0,gap:0},sa=function(e){return parseInt(e||``,10)||0},ca=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[sa(n),sa(r),sa(i)]},la=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return oa;var t=ca(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ua=aa(),da=`data-scroll-locked`,fa=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
3
- .${Ri} {
4
- overflow: hidden ${r};
5
- padding-right: ${s}px ${r};
6
- }
7
- body[${da}] {
8
- overflow: hidden ${r};
9
- overscroll-behavior: contain;
10
- ${[t&&`position: relative ${r};`,n===`margin`&&`
11
- padding-left: ${i}px;
12
- padding-top: ${a}px;
13
- padding-right: ${o}px;
14
- margin-left:0;
15
- margin-top:0;
16
- margin-right: ${s}px ${r};
17
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
18
- }
19
-
20
- .${Ii} {
21
- right: ${s}px ${r};
22
- }
23
-
24
- .${Li} {
25
- margin-right: ${s}px ${r};
26
- }
27
-
28
- .${Ii} .${Ii} {
29
- right: 0 ${r};
30
- }
31
-
32
- .${Li} .${Li} {
33
- margin-right: 0 ${r};
34
- }
35
-
36
- body[${da}] {
37
- ${zi}: ${s}px;
38
- }
39
- `},pa=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},ma=function(){o.useEffect(function(){return document.body.setAttribute(da,(pa()+1).toString()),function(){var e=pa()-1;e<=0?document.body.removeAttribute(da):document.body.setAttribute(da,e.toString())}},[])},ha=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;ma();var a=o.useMemo(function(){return la(i)},[i]);return o.createElement(ua,{styles:fa(a,!t,i,n?``:`!important`)})},ga=!1;if(typeof window<`u`)try{var _a=Object.defineProperty({},"passive",{get:function(){return ga=!0,!0}});window.addEventListener(`test`,_a,_a),window.removeEventListener(`test`,_a,_a)}catch{ga=!1}var va=ga?{passive:!1}:!1,ya=function(e){return e.tagName===`TEXTAREA`},ba=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ya(e)&&n[t]===`visible`)},xa=function(e){return ba(e,`overflowY`)},Sa=function(e){return ba(e,`overflowX`)},Ca=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Ea(e,r)){var i=Da(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wa=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ta=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Ea=function(e,t){return e===`v`?xa(t):Sa(t)},Da=function(e,t){return e===`v`?wa(t):Ta(t)},Oa=function(e,t){return e===`h`&&t===`rtl`?-1:1},ka=function(e,t,n,r,i){var a=Oa(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Da(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Ea(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Aa=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ja=function(e){return[e.deltaX,e.deltaY]},Ma=function(e){return e&&`current`in e?e.current:e},Na=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Pa=function(e){return`
40
- .block-interactivity-${e} {pointer-events: none;}
41
- .allow-interactivity-${e} {pointer-events: all;}
42
- `},Fa=0,Ia=[];function La(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),i=o.useState(Fa++)[0],a=o.useState(aa)[0],s=o.useRef(e);o.useEffect(function(){s.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Fi([e.lockRef.current],(e.shards||[]).map(Ma),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=o.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!s.current.allowPinchZoom;var i=Aa(e),a=n.current,o=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(o)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Ca(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ca(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(o||c)&&(r.current=l),!l)return!0;var h=r.current||l;return ka(h,t,e,h===`h`?o:c,!0)},[]),l=o.useCallback(function(e){var n=e;if(Ia.length&&Ia[Ia.length-1]===a){var r=`deltaY`in n?ja(n):Aa(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Na(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var o=(s.current.shards||[]).map(Ma).filter(Boolean).filter(function(e){return e.contains(n.target)});(o.length>0?c(n,o[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=o.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ra(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=o.useCallback(function(e){n.current=Aa(e),r.current=void 0},[]),f=o.useCallback(function(t){u(t.type,ja(t),t.target,c(t,e.lockRef.current))},[]),p=o.useCallback(function(t){u(t.type,Aa(t),t.target,c(t,e.lockRef.current))},[]);o.useEffect(function(){return Ia.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,va),document.addEventListener(`touchmove`,l,va),document.addEventListener(`touchstart`,d,va),function(){Ia=Ia.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,va),document.removeEventListener(`touchmove`,l,va),document.removeEventListener(`touchstart`,d,va)}},[]);var m=e.removeScrollBar,h=e.inert;return o.createElement(o.Fragment,null,h?o.createElement(a,{styles:Pa(i)}):null,m?o.createElement(ha,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ra(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var za=Yi(Xi,La),Ba=o.forwardRef(function(e,t){return o.createElement(Qi,Ni({},e,{ref:t,sideCar:za}))});Ba.classNames=Qi.classNames;var Va=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ha=new WeakMap,Ua=new WeakMap,Wa={},Ga=0,Ka=function(e){return e&&(e.host||Ka(e.parentNode))},qa=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ka(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ja=function(e,t,n,r){var i=qa(t,Array.isArray(e)?e:[e]);Wa[n]||(Wa[n]=new WeakMap);var a=Wa[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Ha.get(e)||0)+1,l=(a.get(e)||0)+1;Ha.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ua.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Ga++,function(){o.forEach(function(e){var t=Ha.get(e)-1,i=a.get(e)-1;Ha.set(e,t),a.set(e,i),t||(Ua.has(e)||e.removeAttribute(r),Ua.delete(e)),i||e.removeAttribute(n)}),Ga--,Ga||(Ha=new WeakMap,Ha=new WeakMap,Ua=new WeakMap,Wa={})}},Ya=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Va(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ja(r,i,n,`aria-hidden`)):function(){return null}},Xa=Object.defineProperty,Za=(e,t)=>Xa(e,`name`,{value:t,configurable:!0}),Qa=`Dialog`,[$a,eo]=Cn(Qa),[to,no]=$a(Qa),ro=Za(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,c=o.useRef(null),l=o.useRef(null),{nodes:u,registry:d}=di(),[f,p]=tr({prop:r,defaultProp:i??!1,onChange:a,caller:Qa}),[m,h]=o.useState(0),[g,_]=o.useState(0);return(0,q.jsx)(to,{scope:t,triggerRef:c,contentRef:l,contentId:yr(),titleId:yr(),descriptionId:yr(),titlePresent:m>0,descriptionPresent:g>0,setTitleCount:h,setDescriptionCount:_,open:f,onOpenChange:p,onOpenToggle:o.useCallback(()=>p(e=>!e),[p]),modal:s,branchNodes:u,branchRegistry:d,children:n})},`Dialog`),io=`DialogTrigger`,ao=o.forwardRef(Za(function(e,t){let{__scopeDialog:n,...r}=e,i=no(io,n),a=Gt(t,i.triggerRef);return(0,q.jsx)(J.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":To(i.open),...r,ref:a,onClick:Y(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),oo=`DialogPortal`,[so,co]=$a(oo,{forceMount:void 0}),lo=Za(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=no(oo,t);return(0,q.jsx)(so,{scope:t,forceMount:n,children:o.Children.map(r,e=>(0,q.jsx)(lr,{present:n||a.open,children:(0,q.jsx)(Ti,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),uo=`DialogOverlay`,fo=o.forwardRef(Za(function(e,t){let n=co(uo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=no(uo,e.__scopeDialog);return a.modal?(0,q.jsx)(lr,{present:r||a.open,children:(0,q.jsx)(mo,{...i,ref:t})}):null},`DialogOverlay`)),po=Jt(`DialogOverlay.RemoveScroll`),mo=o.forwardRef(Za(function(e,t){let{__scopeDialog:n,...r}=e,i=no(uo,n),a=Gt(t,Zr());return(0,q.jsx)(Ba,{as:po,allowPinchZoom:!0,shards:o.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,q.jsx)(J.div,{"data-state":To(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ho=`DialogContent`,go=o.forwardRef(Za(function(e,t){let n=co(ho,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=no(ho,e.__scopeDialog);return(0,q.jsx)(lr,{present:r||a.open,children:a.modal?(0,q.jsx)(_o,{...i,ref:t}):(0,q.jsx)(vo,{...i,ref:t})})},`DialogContent`)),_o=o.forwardRef(Za(function(e,t){let n=no(ho,e.__scopeDialog),r=o.useRef(null),i=Gt(t,n.contentRef,r);return o.useEffect(()=>{let e=r.current;if(e)return Ya(e)},[]),(0,q.jsx)(yo,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Y(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Y(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Y(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),vo=o.forwardRef(Za(function(e,t){let n=no(ho,e.__scopeDialog),r=o.useRef(!1),i=o.useRef(!1);return(0,q.jsx)(yo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),yo=o.forwardRef(Za(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=no(ho,n);return ji(),(0,q.jsx)(ui,{registry:l.branchRegistry,children:(0,q.jsx)(ci,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,q.jsx)(Xr,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?wo(o,l.descriptionId):o,"data-state":To(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),bo=o.forwardRef(Za(function(e,t){let{__scopeDialog:n,...r}=e,i=no(`DialogTitle`,n),{setTitleCount:a}=i;return Tn(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,q.jsx)(J.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),xo=o.forwardRef(Za(function(e,t){let{__scopeDialog:n,...r}=e,i=no(`DialogDescription`,n),{setDescriptionCount:a}=i;return Tn(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,q.jsx)(J.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),So=`DialogClose`,Co=o.forwardRef(Za(function(e,t){let{__scopeDialog:n,...r}=e,i=no(So,n);return(0,q.jsx)(J.button,{type:`button`,...r,ref:t,onClick:Y(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function wo(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Za(wo,`concatAriaDescribedby`);function To(e){return e?`open`:`closed`}Za(To,`getState`);var Eo=Object.defineProperty,Do=(e,t)=>Eo(e,`name`,{value:t,configurable:!0}),Oo=`Avatar`,[ko,Ao]=Cn(Oo),jo={Idle:`idle`,Loading:`loading`,Loaded:`loaded`,Error:`error`},Mo=[0,()=>void 0],[No,Po]=ko(Oo),Fo=o.forwardRef(Do(function(e,t){let{__scopeAvatar:n,...r}=e,[i,a]=o.useState(jo.Idle),[s,c]=Bo();return(0,q.jsx)(No,{scope:n,imageLoadingStatus:i,setImageLoadingStatus:a,imageCount:s,setImageCount:c,children:(0,q.jsx)(J.span,{...r,ref:t})})},`Avatar`)),Io=`AvatarFallback`,Lo=o.forwardRef(Do(function(e,t){let{__scopeAvatar:n,delayMs:r,...i}=e,a=Po(Io,n),[s,c]=o.useState(r===void 0);return o.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>c(!0),r);return()=>window.clearTimeout(e)}},[r]),s&&a.imageLoadingStatus!==jo.Loaded?(0,q.jsx)(J.span,{...i,ref:t}):null},`AvatarFallback`));function Ro(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return Tn(()=>{if(!e){n(jo.Error);return}let t=new window.Image,a=Do(e=>{let t=e.currentTarget;n(zo(t))},`handleLoad`),o=Do(()=>n(jo.Error),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(zo(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(jo.Idle)}},[e,i,r,n]),t}Do(Ro,`useImageLoadingStatus`);function zo(e){return e.complete?e.naturalWidth>0?jo.Loaded:jo.Error:jo.Loading}Do(zo,`getImageLoadingStatus`);function Bo(){return Mo}Do(Bo,`useImageCount`);function Vo(e){}Do(Vo,`useUpdateImageCount`);var Ho=Object.defineProperty,Uo=(e,t)=>Ho(e,`name`,{value:t,configurable:!0});function Wo(e){let[t,n]=o.useState(void 0);return Tn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}Uo(Wo,`useSize`);var Go=[`top`,`right`,`bottom`,`left`],Ko=Math.min,qo=Math.max,Jo=Math.round,Yo=Math.floor,Xo=e=>({x:e,y:e}),Zo={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Qo(e,t,n){return qo(e,Ko(t,n))}function $o(e,t){return typeof e==`function`?e(t):e}function es(e){return e.split(`-`)[0]}function ts(e){return e.split(`-`)[1]}function ns(e){return e===`x`?`y`:`x`}function rs(e){return e===`y`?`height`:`width`}function is(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function as(e){return ns(is(e))}function os(e,t,n){n===void 0&&(n=!1);let r=ts(e),i=as(e),a=rs(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=hs(o)),[o,hs(o)]}function ss(e){let t=hs(e);return[cs(e),t,cs(t)]}function cs(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ls=[`left`,`right`],us=[`right`,`left`],ds=[`top`,`bottom`],fs=[`bottom`,`top`];function ps(e,t,n){switch(e){case`top`:case`bottom`:return n?t?us:ls:t?ls:us;case`left`:case`right`:return t?ds:fs;default:return[]}}function ms(e,t,n,r){let i=ts(e),a=ps(es(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(cs)))),a}function hs(e){let t=es(e);return Zo[t]+e.slice(t.length)}function gs(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function _s(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:gs(e)}function vs(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ys(e,t,n){let{reference:r,floating:i}=e,a=is(t),o=as(t),s=rs(o),c=es(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=ts(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function bs(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=$o(t,e),p=_s(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=vs(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=vs(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var xs=50,Ss=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:bs},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ys(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<xs&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ys(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Cs=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=$o(e,t)||{};if(l==null)return{};let d=_s(u),f={x:n,y:r},p=as(i),m=rs(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ko(d[_],T),D=Ko(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Qo(E,k,O),j=!c.arrow&&ts(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),ws=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=$o(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=es(r),_=is(o),v=es(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[hs(o)]:ss(o)),x=p!==`none`;!d&&x&&b.push(...ms(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=os(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===is(t)||T.every(e=>is(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=is(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ts(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Es(e){return Go.some(t=>e[t]>=0)}var Ds=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=$o(e,t);switch(i){case`referenceHidden`:{let e=Ts(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Es(e)}}}case`escaped`:{let e=Ts(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Es(e)}}}default:return{}}}}},Os=new Set([`left`,`top`]);async function ks(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=es(n),s=ts(n),c=is(n)===`y`,l=Os.has(o)?-1:1,u=a&&c?-1:1,d=$o(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var As=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ks(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},js=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=$o(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=is(i),p=ns(f),m=u[p],h=u[f],g=(e,t)=>Qo(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ms=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=$o(e,t),u={x:n,y:r},d=is(i),f=ns(d),p=u[f],m=u[d],h=$o(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Os.has(es(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ns=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=$o(e,t),c=await i.detectOverflow(t,s),l=es(n),u=ts(n),d=is(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ko(p-c[m],g),y=Ko(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*qo(c.left,c.right):S=p-2*qo(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Ps(){return typeof window<`u`}function Fs(e){return Rs(e)?(e.nodeName||``).toLowerCase():`#document`}function Is(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ls(e){return((Rs(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Rs(e){return Ps()?e instanceof Node||e instanceof Is(e).Node:!1}function zs(e){return Ps()?e instanceof Element||e instanceof Is(e).Element:!1}function Bs(e){return Ps()?e instanceof HTMLElement||e instanceof Is(e).HTMLElement:!1}function Vs(e){return!Ps()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Is(e).ShadowRoot}function Hs(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=$s(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Us(e){return/^(table|td|th)$/.test(Fs(e))}function Ws(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Gs=/transform|translate|scale|rotate|perspective|filter/,Ks=/paint|layout|strict|content/,qs=e=>!!e&&e!==`none`,Js;function Ys(e){let t=zs(e)?$s(e):e;return qs(t.transform)||qs(t.translate)||qs(t.scale)||qs(t.rotate)||qs(t.perspective)||!Zs()&&(qs(t.backdropFilter)||qs(t.filter))||Gs.test(t.willChange||``)||Ks.test(t.contain||``)}function Xs(e){let t=tc(e);for(;Bs(t)&&!Qs(t);){if(Ys(t))return t;if(Ws(t))return null;t=tc(t)}return null}function Zs(){return Js??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Js}function Qs(e){return/^(html|body|#document)$/.test(Fs(e))}function $s(e){return Is(e).getComputedStyle(e)}function ec(e){return zs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function tc(e){if(Fs(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Vs(e)&&e.host||Ls(e);return Vs(t)?t.host:t}function nc(e){let t=tc(e);return Qs(t)?(e.ownerDocument||e).body:Bs(t)&&Hs(t)?t:nc(t)}function rc(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=nc(e),i=r===e.ownerDocument?.body,a=Is(r);if(i){let e=ic(a);return t.concat(a,a.visualViewport||[],Hs(r)?r:[],e&&n?rc(e):[])}return t.concat(r,rc(r,[],n))}function ic(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ac(e){let t=$s(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Bs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Jo(n)!==a||Jo(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function oc(e){return zs(e)?e:e.contextElement}function sc(e){let t=oc(e);if(!Bs(t))return Xo(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ac(t),o=(a?Jo(n.width):n.width)/r,s=(a?Jo(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var cc=Xo(0);function lc(e){let t=Is(e);return!Zs()||!t.visualViewport?cc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Is(e)}function dc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=oc(e),o=Xo(1);t&&(r?zs(r)&&(o=sc(r)):o=sc(e));let s=uc(a,n,r)?lc(a):Xo(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Is(a),t=zs(r)?Is(r):r,n=e,i=ic(n);for(;i&&t!==n;){let e=sc(i),t=i.getBoundingClientRect(),r=$s(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Is(i),i=ic(n)}}return vs({width:u,height:d,x:c,y:l})}function fc(e,t){let n=ec(e).scrollLeft;return t?t.left+n:dc(Ls(e)).left+n}function pc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-fc(e,n),y:n.top+t.scrollTop}}function mc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ls(r),s=t?Ws(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Xo(1),u=Xo(0),d=Bs(r);if((d||!a)&&((Fs(r)!==`body`||Hs(o))&&(c=ec(r)),d)){let e=dc(r);l=sc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?pc(o,c):Xo(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function hc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function gc(e){let t=ec(e),n=e.ownerDocument.body,r=qo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=qo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+fc(e),o=-t.scrollTop;return $s(n).direction===`rtl`&&(a+=qo(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var _c=25;function vc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Is(e),a=Ls(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Zs()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(fc(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=_c&&(s-=o)}return{width:s,height:c,x:l,y:u}}function yc(e,t){let n=dc(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=sc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function bc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=vc(e,n,t);else if(t===`document`)r=gc(Ls(e));else if(zs(t))r=yc(t,n);else{let n=lc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return vs(r)}function xc(e,t){let n=t.get(e);if(n)return n;let r=rc(e,[],!1).filter(e=>zs(e)&&Fs(e)!==`body`),i=null,a=$s(e).position===`fixed`,o=a?tc(e):e;for(;zs(o)&&!Qs(o);){let e=$s(o),t=Ys(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=tc(o)}return t.set(e,r),r}function Sc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ws(t)?[]:xc(t,this._c):[].concat(n),r],o=bc(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=bc(t,a[e],i);s=qo(n.top,s),c=Ko(n.right,c),l=Ko(n.bottom,l),u=qo(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Cc(e){let{width:t,height:n}=ac(e);return{width:t,height:n}}function wc(e,t,n){let r=Bs(t),i=Ls(t),a=n===`fixed`,o=dc(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Xo(0);if((r||!a)&&((Fs(t)!==`body`||Hs(i))&&(s=ec(t)),r)){let e=dc(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=fc(i));let l=i&&!r&&!a?pc(i,s):Xo(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Tc(e){return $s(e).position===`static`}function Ec(e,t){if(!Bs(e)||$s(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ls(e)===n&&(n=n.ownerDocument.body),n}function Dc(e,t){let n=Is(e);if(Ws(e))return n;if(!Bs(e)){let t=tc(e);for(;t&&!Qs(t);){if(zs(t)&&!Tc(t))return t;t=tc(t)}return n}let r=Ec(e,t);for(;r&&Us(r)&&Tc(r);)r=Ec(r,t);return r&&Qs(r)&&Tc(r)&&!Ys(r)?n:r||Xs(e)||n}var Oc=async function(e){let t=this.getOffsetParent||Dc,n=this.getDimensions,r=await n(e.floating);return{reference:wc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kc(e){return $s(e).direction===`rtl`}var Ac={convertOffsetParentRelativeRectToViewportRelativeRect:mc,getDocumentElement:Ls,getClippingRect:Sc,getOffsetParent:Dc,getElementRects:Oc,getClientRects:hc,getDimensions:Cc,getScale:sc,isElement:zs,isRTL:kc};function jc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mc(e,t,n){let r=null,i,a=Ls(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Yo(d),h=Yo(a.clientWidth-(u+f)),g=Yo(a.clientHeight-(d+p)),_=Yo(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:qo(0,Ko(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!jc(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Is(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Nc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=oc(e),u=i||a?[...l?rc(l):[],...t?rc(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Mc(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?dc(e):null;c&&g();function g(){let t=dc(e);h&&!jc(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Pc=As,Fc=js,Ic=ws,Lc=Ns,Rc=Ds,zc=Cs,Bc=Ms,Vc=(e,t,n)=>{let r=new Map,i=n??{},a={...Ac,...i.platform,_c:r};return Ss(e,t,{...i,platform:a})},Hc=typeof document<`u`?o.useLayoutEffect:function(){};function Uc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Uc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Uc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Wc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gc(e,t){let n=Wc(e);return Math.round(t*n)/n}function Kc(e){let t=o.useRef(e);return Hc(()=>{t.current=e}),t}function qc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[f,p]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=o.useState(r);Uc(m,r)||h(r);let[g,_]=o.useState(null),[v,y]=o.useState(null),b=o.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=o.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=c||v,w=o.useRef(null),T=o.useRef(null),E=o.useRef(f),D=u!=null,O=Kc(u),k=Kc(i),A=Kc(d),j=o.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),Vc(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Uc(E.current,t)&&(E.current=t,s.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);Hc(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);let M=o.useRef(!1);Hc(()=>(M.current=!0,()=>{M.current=!1}),[]),Hc(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=o.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=o.useMemo(()=>({reference:S,floating:C}),[S,C]),F=o.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Gc(P.floating,f.x),r=Gc(P.floating,f.y);return l?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Wc(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,l,P.floating,f.x,f.y]);return o.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var Jc=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:zc({element:r.current,padding:i}).fn(n):r?zc({element:r,padding:i}).fn(n):{}}}},Yc=(e,t)=>{let n=Pc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xc=(e,t)=>{let n=Fc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zc=(e,t)=>({fn:Bc(e).fn,options:[e,t]}),Qc=(e,t)=>{let n=Ic(e);return{name:n.name,fn:n.fn,options:[e,t]}},$c=(e,t)=>{let n=Lc(e);return{name:n.name,fn:n.fn,options:[e,t]}},el=(e,t)=>{let n=Rc(e);return{name:n.name,fn:n.fn,options:[e,t]}},tl=(e,t)=>{let n=Jc(e);return{name:n.name,fn:n.fn,options:[e,t]}},nl=Object.defineProperty,rl=o.forwardRef(((e,t)=>nl(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,q.jsx)(J.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,q.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),il=Object.defineProperty,al=(e,t)=>il(e,`name`,{value:t,configurable:!0}),ol={Partial:`partial`,Always:`always`},sl={Optimized:`optimized`,Always:`always`},cl=`Popper`,[ll,ul]=Cn(cl),[dl,fl]=ll(cl),pl=al(e=>{let{__scopePopper:t,children:n}=e,[r,i]=o.useState(null),[a,s]=o.useState(void 0);return(0,q.jsx)(dl,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:s,children:n})},`Popper`),ml=`PopperAnchor`,hl=o.forwardRef(al(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=fl(ml,n),s=o.useRef(null),c=a.onAnchorChange,l=Gt(t,o.useCallback(e=>{s.current=e,e&&c(e)},[c])),u=o.useRef(null);o.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&c(u.current)});let d=a.placementState&&Tl(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,q.jsx)(J.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),gl=`PopperContent`,[_l,vl]=ll(gl),yl=o.forwardRef(al(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=ol.Partial,hideWhenDetached:p=!1,updatePositionStrategy:m=sl.Optimized,onPlaced:h,...g}=e,_=fl(gl,n),[v,y]=o.useState(null),b=Gt(t,y),[x,S]=o.useState(null),C=Wo(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},O=Array.isArray(u)?u:[u],k=O.length>0,A={padding:D,boundary:O.filter(Cl),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=qc({strategy:`fixed`,placement:E,whileElementsMounted:al((...e)=>Nc(...e,{animationFrame:m===sl.Always}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[Yc({mainAxis:i+T,alignmentAxis:s}),l&&Xc({mainAxis:!0,crossAxis:!1,...f===ol.Partial?{limiter:Zc()}:{},...A}),l&&Qc({...A}),$c({...A,apply:al(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&tl({element:x,padding:c}),wl({arrowWidth:w,arrowHeight:T}),p&&el(k?{strategy:`referenceHidden`,...A}:{strategy:`referenceHidden`,padding:A.padding,altBoundary:A.altBoundary})]}),I=_.setPlacementState;Tn(()=>(I(N),()=>{I(void 0)}),[N,I]);let[ee,L]=Tl(N),te=Hr(h);Tn(()=>{P&&te?.()},[P,te]);let ne=F.arrow?.x,re=F.arrow?.y,ie=F.arrow?.centerOffset!==0,[R,z]=o.useState();return Tn(()=>{v&&z(window.getComputedStyle(v).zIndex)},[v]),(0,q.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:R,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,q.jsx)(_l,{scope:n,placedSide:ee,placedAlign:L,onArrowChange:S,arrowX:ne,arrowY:re,shouldHideArrow:ie,children:(0,q.jsx)(J.div,{"data-side":ee,"data-align":L,...g,ref:b,style:{...g.style,animation:P?g.style?.animation:`none`}})})})},`PopperContent`)),bl=`PopperArrow`,xl={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Sl=o.forwardRef(al(function(e,t){let{__scopePopper:n,...r}=e,i=vl(bl,n),a=xl[i.placedSide];return(0,q.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,q.jsx)(rl,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Cl(e){return e!==null}al(Cl,`isNotNull`);var wl=al(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Tl(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Tl(e){let[t,n=`center`]=e.split(`-`);return[t,n]}al(Tl,`getSideAndAlignFromPlacement`);var El=Object.defineProperty,Dl=(e,t)=>El(e,`name`,{value:t,configurable:!0}),Ol=!1;function kl(){let[e,t]=o.useState(Ol);return o.useEffect(()=>{Ol||(Ol=!0,t(!0))},[]),e}Dl(kl,`useIsHydrated`);var Al=o.useSyncExternalStore;function jl(){return()=>{}}Dl(jl,`subscribe`);function Ml(){return Al(jl,()=>!0,()=>!1)}Dl(Ml,`useIsHydratedModern`);var Nl=typeof Al==`function`?Ml:kl,Pl=Object.defineProperty,Fl=(e,t)=>Pl(e,`name`,{value:t,configurable:!0}),Il=`rovingFocusGroup.onEntryFocus`,Ll={bubbles:!1,cancelable:!0},Rl=`RovingFocusGroup`,[zl,Bl,Vl]=On(Rl),[Hl,Ul]=Cn(Rl,[Vl]),Wl={Vertical:`vertical`,Horizontal:`horizontal`},Gl={LTR:`ltr`,RTL:`rtl`},[Kl,ql]=Hl(Rl),Jl=o.forwardRef(Fl(function(e,t){return(0,q.jsx)(zl.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,q.jsx)(zl.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,q.jsx)(Yl,{...e,ref:t})})})},`RovingFocusGroup`)),Yl=o.forwardRef(Fl(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=o.useRef(null),m=Gt(t,p),h=Rr(a),[g,_]=tr({prop:s,defaultProp:c??null,onChange:l,caller:Rl}),[v,y]=o.useState(!1),b=Hr(u),x=Bl(n),S=o.useRef(!1),[C,w]=o.useState(0);return o.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(Il,b),()=>e.removeEventListener(Il,b)},[b]),(0,q.jsx)(Kl,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:o.useCallback(e=>_(e),[_]),onItemShiftTab:o.useCallback(()=>y(!0),[]),onFocusableItemAdd:o.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:o.useCallback(()=>w(e=>e-1),[]),children:(0,q.jsx)(J.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:`none`,...e.style},onMouseDown:Y(e.onMouseDown,()=>{S.current=!0}),onFocus:Y(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Il,Ll);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);tu([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),d)}}S.current=!1}),onBlur:Y(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Xl=`RovingFocusGroupItem`,Zl=o.forwardRef(Fl(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:s,...c}=e,l=yr(),u=a||l,d=ql(Xl,n),f=d.currentTabStopId===u,p=Bl(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=d,_=Nl();return Tn(()=>{if(_&&r)return m(),()=>h()},[_,r,m,h]),o.useEffect(()=>{if(!_&&r)return m(),()=>h()},[_,r,m,h]),(0,q.jsx)(zl.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:(0,q.jsx)(J.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...c,ref:t,onMouseDown:Y(e.onMouseDown,e=>{r?d.onItemFocus(u):e.preventDefault()}),onFocus:Y(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:Y(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=eu(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?nu(n,r+1):n.slice(r+1)}setTimeout(()=>tu(n))}}),children:typeof s==`function`?s({isCurrentTabStop:f,hasTabStop:g!=null}):s})})},`RovingFocusGroupItem`)),Ql={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function $l(e,t){return t===Gl.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Fl($l,`getDirectionAwareKey`);function eu(e,t,n){let r=$l(e.key,n);if(!(t===Wl.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Wl.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ql[r]}Fl(eu,`getFocusIntent`);function tu(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Fl(tu,`focusFirst`);function nu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Fl(nu,`wrapArray`);var ru=Object.defineProperty,iu=o.forwardRef(((e,t)=>ru(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,q.jsx)(J.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),au=Object.defineProperty,ou=(e,t)=>au(e,`name`,{value:t,configurable:!0}),su={Horizontal:`horizontal`,Vertical:`vertical`},cu=su.Horizontal,lu=Object.values(su),uu=o.forwardRef(ou(function(e,t){let{decorative:n,orientation:r=cu,...i}=e,a=du(r)?r:cu,o=a===su.Vertical?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,q.jsx)(J.div,{"data-orientation":a,...s,...i,ref:t})},`Separator`));function du(e){return lu.includes(e)}ou(du,`isValidOrientation`);var fu=Object.defineProperty,pu=(e,t)=>fu(e,`name`,{value:t,configurable:!0}),mu={Automatic:`automatic`,Manual:`manual`},hu=`Tabs`,[gu,_u]=Cn(hu,[Ul]),vu=Ul(),[yu,bu]=gu(hu),xu=o.forwardRef(pu(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=mu.Automatic,...l}=e,u=Rr(s),[d,f]=tr({prop:r,onChange:i,defaultProp:a??``,caller:hu});return(0,q.jsx)(yu,{scope:n,baseId:yr(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,q.jsx)(J.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Su=`TabsList`,Cu=o.forwardRef(pu(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=bu(Su,n),o=vu(n);return(0,q.jsx)(Jl,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,q.jsx)(J.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),wu=`TabsTrigger`,Tu=o.forwardRef(pu(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=bu(wu,n),s=vu(n),c=Ou(o.baseId,r),l=ku(o.baseId,r),u=r===o.value;return(0,q.jsx)(Zl,{asChild:!0,...s,focusable:!i,active:u,children:(0,q.jsx)(J.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Y(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),o.onValueChange(r)):e.preventDefault()}),onKeyDown:Y(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:Y(e.onFocus,()=>{let e=o.activationMode!==mu.Manual;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),Eu=`TabsContent`,Du=o.forwardRef(pu(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...s}=e,c=bu(Eu,n),l=Ou(c.baseId,r),u=ku(c.baseId,r),d=r===c.value,f=o.useRef(d);return o.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,q.jsx)(lr,{present:i||d,children:({present:n})=>(0,q.jsx)(J.div,{"data-state":d?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:f.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function Ou(e,t){return`${e}-trigger-${t}`}pu(Ou,`makeTriggerId`);function ku(e,t){return`${e}-content-${t}`}pu(ku,`makeContentId`);var Au=Object.defineProperty,ju=(e,t)=>Au(e,`name`,{value:t,configurable:!0}),Mu=`Toggle`,Nu=o.forwardRef(ju(function(e,t){let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=tr({prop:n,onChange:i,defaultProp:r??!1,caller:Mu});return(0,q.jsx)(J.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:Y(e.onClick,()=>{e.disabled||s(!o)})})},`Toggle`)),Pu=Object.defineProperty,Fu=(e,t)=>Pu(e,`name`,{value:t,configurable:!0}),[Iu,Lu]=Cn(`Tooltip`,[ul]),Ru=ul(),zu=`TooltipProvider`,Bu=700,Vu=`tooltip.open`,[Hu,Uu]=Iu(zu),Wu=Fu(e=>{let{__scopeTooltip:t,delayDuration:n=Bu,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,s=o.useRef(!0),c=o.useRef(!1),l=o.useRef(0);return o.useEffect(()=>{let e=l.current;return()=>window.clearTimeout(e)},[]),(0,q.jsx)(Hu,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:o.useCallback(()=>{r<=0||(window.clearTimeout(l.current),s.current=!1)},[r]),onClose:o.useCallback(()=>{r<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r))},[r]),isPointerInTransitRef:c,onPointerInTransitChange:o.useCallback(e=>{c.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Gu=`Tooltip`,[Ku,qu]=Iu(Gu),Ju=Fu(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:s,delayDuration:c}=e,l=Uu(Gu,e.__scopeTooltip),u=Ru(t),[d,f]=o.useState(null),[p,m]=o.useState(void 0),h=yr(),g=o.useRef(0),_=s??l.disableHoverableContent,v=c??l.delayDuration,y=o.useRef(!1),[b,x]=tr({prop:r,defaultProp:i??!1,onChange:Fu(e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(Vu))):l.onClose(),a?.(e)},`onChange`),caller:Gu}),S=o.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=o.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),w=o.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),T=o.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);o.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let E=p??h;return(0,q.jsx)(pl,{...u,children:(0,q.jsx)(Ku,{scope:t,contentId:E,setContentId:m,open:b,stateAttribute:S,trigger:d,onTriggerChange:f,onTriggerEnter:o.useCallback(()=>{l.isOpenDelayedRef.current?T():C()},[l.isOpenDelayedRef,T,C]),onTriggerLeave:o.useCallback(()=>{_?w():(window.clearTimeout(g.current),g.current=0)},[w,_]),onOpen:C,onClose:w,disableHoverableContent:_,children:n})})},`Tooltip`),Yu=`TooltipTrigger`,Xu=o.forwardRef(Fu(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=qu(Yu,n),s=Uu(Yu,n),c=Ru(n),l=Gt(t,o.useRef(null),a.onTriggerChange),u=o.useRef(!1),d=o.useRef(!1),f=o.useCallback(()=>u.current=!1,[]);return o.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,q.jsx)(hl,{asChild:!0,...c,children:(0,q.jsx)(J.button,{"aria-describedby":a.open?pd(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:l,onPointerMove:Y(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:Y(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:Y(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:Y(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:Y(e.onBlur,a.onClose),onClick:Y(e.onClick,a.onClose)})})},`TooltipTrigger`)),Zu=`TooltipPortal`,[Qu,$u]=Iu(Zu,{forceMount:void 0}),ed=Fu(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=qu(Zu,t);return(0,q.jsx)(Qu,{scope:t,forceMount:n,children:(0,q.jsx)(lr,{present:n||a.open,children:(0,q.jsx)(Ti,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),td=`TooltipContent`,nd=o.forwardRef(Fu(function(e,t){let n=$u(td,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=qu(td,e.__scopeTooltip);return(0,q.jsx)(lr,{present:r||o.open,children:o.disableHoverableContent?(0,q.jsx)(ad,{side:i,...a,ref:t}):(0,q.jsx)(rd,{side:i,...a,ref:t})})},`TooltipContent`)),rd=o.forwardRef(Fu(function(e,t){let n=qu(td,e.__scopeTooltip),r=Uu(td,e.__scopeTooltip),i=o.useRef(null),a=Gt(t,i),[s,c]=o.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=o.useCallback(()=>{c(null),f(!1)},[f]),m=o.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=cd(r,sd(r,n.getBoundingClientRect())),a=ld(t.getBoundingClientRect()),o=dd([...i,...a]);c(o),f(!0)},[f]);return o.useEffect(()=>()=>p(),[p]),o.useEffect(()=>{if(l&&d){let e=Fu(e=>m(e,d),`handleTriggerLeave`),t=Fu(e=>m(e,l),`handleContentLeave`);return l.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{l.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[l,d,m,p]),o.useEffect(()=>{if(s){let e=Fu(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!ud(n,s);r?p():i&&(p(),u())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,s,u,p]),(0,q.jsx)(ad,{...e,ref:a})},`TooltipContentHoverable`)),id=Zt(`TooltipContent`),ad=o.forwardRef(Fu(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=e,u=qu(td,n),d=Ru(n),{onClose:f}=u,[p,m]=o.useState(null),h=Gt(t,m);fi(p),o.useEffect(()=>(document.addEventListener(Vu,f),()=>document.removeEventListener(Vu,f)),[f]),o.useEffect(()=>{if(u.trigger){let e=Fu(e=>{e.target instanceof Node&&e.target.contains(u.trigger)&&f()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[u.trigger,f]);let{setContentId:g}=u;return Tn(()=>(g(a),()=>{g(void 0)}),[a,g]),(0,q.jsx)(Xr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,q.jsxs)(yl,{"data-state":u.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:u.contentId,...d,...l,ref:h,style:{...l.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,q.jsx)(id,{children:r}),i?(0,q.jsx)(yn,{id:u.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),od=o.forwardRef(Fu(function(e,t){let{__scopeTooltip:n,...r}=e,i=Ru(n);return(0,q.jsx)(Sl,{...i,...r,ref:t})},`TooltipArrow`));function sd(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Fu(sd,`getExitSideFromRect`);function cd(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Fu(cd,`getPaddedExitPoints`);function ld(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Fu(ld,`getPointsFromRect`);function ud(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Fu(ud,`isPointInPolygon`);function dd(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),fd(t)}Fu(dd,`getHull`);function fd(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Fu(fd,`getHullPresorted`);function pd(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Fu(pd,`concatAriaDescribedby`);function md(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=md(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function hd(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=md(e))&&(r&&(r+=` `),r+=t);return r}var gd=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,_d=hd,vd=(e,t)=>n=>{if(t?.variants==null)return _d(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=gd(t)||gd(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return _d(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},yd=vd(`group/button inline-flex shrink-0 items-center justify-center rounded-2xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-transparent dark:hover:bg-input/30`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5`,xs:`h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,lg:`h-9 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function bd({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?Yt:`button`;return(0,q.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:K(yd({variant:t,size:n,className:e})),...i})}var xd={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`},Sd=(0,o.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n,absoluteStrokeWidth:r=!1,className:i=``,altIcon:a,showAlt:s=!1,icon:c,primaryColor:l,secondaryColor:u,disableSecondaryOpacity:d=!1,...f},p)=>{let m=n===void 0?void 0:r?Number(n)*24/Number(t):n,h=m===void 0?{}:{strokeWidth:m,stroke:`currentColor`},g={ref:p,...xd,width:t,height:t,color:l||e,className:i,...h,...f},_=[...s&&a?a:c].sort(([,e],[,t])=>{let n=e.opacity!==void 0;return t.opacity===void 0?n?-1:0:1}).map(([t,n])=>{let r=n.opacity!==void 0,i=r&&!d?n.opacity:void 0,a=u?{...n.stroke===void 0?{fill:r?u:l||e}:{stroke:r?u:l||e}}:{};return(0,o.createElement)(t,{...n,...h,...a,opacity:i,key:n.key})});return(0,o.createElement)(`svg`,g,_)});Sd.displayName=`HugeiconsIcon`;var Cd=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 8V12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],wd=[[`path`,{d:`M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Td=[[`path`,{d:`M12 18.502V5.00195`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 13.002C18 13.002 13.5811 19.0019 12 19.002C10.4188 19.002 6 13.002 6 13.002`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Ed=[[`path`,{d:`M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Dd=[[`path`,{d:`M12 5.5V19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M18 11C18 11 13.5811 5.00001 12 5C10.4188 4.99999 6 11 6 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Od=[[`path`,{d:`M9 6.65032C9 6.65032 15.9383 6.10759 16.9154 7.08463C17.8924 8.06167 17.3496 15 17.3496 15M16.5 7.5L6.5 17.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],kd=[[`path`,{d:`M15.6 8.40033V12.9003C15.6 14.3915 16.8088 15.6003 18.3 15.6003C19.7912 15.6003 21 14.3915 21 12.9003V12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C14.0265 21 15.8965 20.3302 17.4009 19.2M15.6 12.0003C15.6 13.9886 13.9882 15.6003 12 15.6003C10.0118 15.6003 8.4 13.9886 8.4 12.0003C8.4 10.0121 10.0118 8.40033 12 8.40033C13.9882 8.40033 15.6 10.0121 15.6 12.0003Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}]],Ad=[[`path`,{d:`M4.22222 21.9948V18.4451C4.22222 17.1737 3.88927 16.5128 3.23482 15.4078C2.4503 14.0833 2 12.5375 2 10.8866C2 5.97866 5.97969 2 10.8889 2C15.7981 2 19.7778 5.97866 19.7778 10.8866C19.7778 11.4663 19.7778 11.7562 19.802 11.9187C19.8598 12.3072 20.0411 12.6414 20.2194 12.9873L22 16.4407L20.6006 17.1402C20.195 17.3429 19.9923 17.4443 19.851 17.6314C19.7097 17.8184 19.67 18.0296 19.5904 18.4519L19.5826 18.4931C19.4004 19.4606 19.1993 20.5286 18.6329 21.2024C18.4329 21.4403 18.1853 21.6336 17.9059 21.7699C17.4447 21.9948 16.8777 21.9948 15.7437 21.9948C15.219 21.9948 14.6928 22.0069 14.1682 21.9942C12.9247 21.9639 12 20.9184 12 19.7044`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M14.388 10.5315C13.9617 10.5315 13.5729 10.3702 13.2784 10.1048M14.388 10.5315C14.388 11.6774 13.7241 12.7658 12.4461 12.7658C11.1681 12.7658 10.5043 13.8541 10.5043 15M14.388 10.5315C16.5373 10.5315 16.5373 7.18017 14.388 7.18017C14.1927 7.18017 14.0053 7.21403 13.8312 7.27624C13.9362 4.77819 10.3349 4.1 9.51923 6.44018M10.5043 8.29729C10.5043 7.52323 10.1133 6.8411 9.51923 6.44018M9.51923 6.44018C7.66742 5.19034 5.19883 7.4331 6.37324 9.43277C4.40226 9.72827 4.61299 12.7658 6.6205 12.7658C7.18344 12.7658 7.68111 12.4844 7.98234 12.0538`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],jd=[[`path`,{d:`M12 21.5C17.2467 21.5 21.5 17.2467 21.5 12C21.5 6.75329 17.2467 2.5 12 2.5C6.75329 2.5 2.5 6.75329 2.5 12C2.5 13.3377 2.66372 14.5604 3.1189 15.6954C3.81756 17.4374 3.68195 18.9241 2.5 20.5C3.86146 21.1644 5.86811 21.1419 7 20.0725C8.45323 20.9748 10.1636 21.5 12 21.5Z`,stroke:`currentColor`,strokeLinecap:`square`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12.2 12.0002H12M7.69961 11.9999H7.49961M16.6996 11.9999H16.4996M12.4 12.0002C12.4 12.2212 12.2209 12.4002 12 12.4002C11.7791 12.4002 11.6 12.2212 11.6 12.0002C11.6 11.7793 11.7791 11.6002 12 11.6002C12.2209 11.6002 12.4 11.7793 12.4 12.0002ZM7.89961 11.9999C7.89961 12.2208 7.72052 12.3999 7.49961 12.3999C7.2787 12.3999 7.09961 12.2208 7.09961 11.9999C7.09961 11.7789 7.2787 11.5999 7.49961 11.5999C7.72052 11.5999 7.89961 11.7789 7.89961 11.9999ZM16.8996 11.9999C16.8996 12.2208 16.7205 12.3999 16.4996 12.3999C16.2787 12.3999 16.0996 12.2208 16.0996 11.9999C16.0996 11.7789 16.2787 11.5999 16.4996 11.5999C16.7205 11.5999 16.8996 11.7789 16.8996 11.9999Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Md=[[`path`,{d:`M18.9991 19L5 5.00098`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19 5L5.00092 18.999`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Nd=[[`path`,{d:`M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M14.9994 15L12 12.0003M12 12.0003L9 9M12 12.0003L9.00064 15M12 12.0003L15 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Pd=[[`path`,{d:`M14 4H10C6.22876 4 4.34315 4 3.17157 5.17157C2 6.34315 2 8.22876 2 12C2 15.7712 2 17.6569 3.17157 18.8284C4.34315 20 6.22876 20 10 20H14C17.7712 20 19.6569 20 20.8284 18.8284C22 17.6569 22 15.7712 22 12C22 8.22876 22 6.34315 20.8284 5.17157C19.6569 4 17.7712 4 14 4Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7 9L8.83981 10.5858C9.61327 11.2525 10 11.5858 10 12C10 12.4142 9.61327 12.7475 8.83981 13.4142L7 15`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M13 16H17`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Fd=[[`path`,{d:`M7.5 14.5C7.5 11.2002 7.5 9.55025 8.52513 8.52513C9.55025 7.5 11.2002 7.5 14.5 7.5C17.7998 7.5 19.4497 7.5 20.4749 8.52513C21.5 9.55025 21.5 11.2002 21.5 14.5C21.5 17.7998 21.5 19.4497 20.4749 20.4749C19.4497 21.5 17.7998 21.5 14.5 21.5C11.2002 21.5 9.55025 21.5 8.52513 20.4749C7.5 19.4497 7.5 17.7998 7.5 14.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M7.5 16.5C6.10355 16.5 5.40533 16.5 4.84402 16.3036C3.83866 15.9518 3.0482 15.1613 2.69641 14.156C2.5 13.5947 2.5 12.8964 2.5 11.5V9.5C2.5 6.20017 2.5 4.55025 3.52513 3.52513C4.55025 2.5 6.20017 2.5 9.5 2.5H11.5C12.8964 2.5 13.5947 2.5 14.156 2.69641C15.1613 3.0482 15.9518 3.83866 16.3036 4.84402C16.5 5.40533 16.5 6.10355 16.5 7.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Id=[[`path`,{d:`M8 7L16 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8 11L12 11`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M13 21.5V21C13 18.1716 13 16.7574 13.8787 15.8787C14.7574 15 16.1716 15 19 15H19.5M20 13.3431V10C20 6.22876 20 4.34315 18.8284 3.17157C17.6569 2 15.7712 2 12 2C8.22877 2 6.34315 2 5.17157 3.17157C4 4.34314 4 6.22876 4 10L4 14.5442C4 17.7892 4 19.4117 4.88607 20.5107C5.06508 20.7327 5.26731 20.9349 5.48933 21.1139C6.58831 22 8.21082 22 11.4558 22C12.1614 22 12.5141 22 12.8372 21.886C12.9044 21.8623 12.9702 21.835 13.0345 21.8043C13.3436 21.6564 13.593 21.407 14.0919 20.9081L18.8284 16.1716C19.4065 15.5935 19.6955 15.3045 19.8478 14.9369C20 14.5694 20 14.1606 20 13.3431Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Ld=[[`path`,{d:`M13 20.8268V22H14.1734C14.5827 22 14.7874 22 14.9715 21.9238C15.1555 21.8475 15.3003 21.7028 15.5897 21.4134L20.4133 16.5894C20.6864 16.3164 20.8229 16.1799 20.8959 16.0327C21.0347 15.7525 21.0347 15.4236 20.8959 15.1434C20.8229 14.9961 20.6864 14.8596 20.4133 14.5866C20.1403 14.3136 20.0038 14.1771 19.8565 14.1041C19.5763 13.9653 19.2473 13.9653 18.9671 14.1041C18.8198 14.1771 18.6833 14.3136 18.4103 14.5866L18.4103 14.5866L13.5867 19.4106C13.2972 19.7 13.1525 19.8447 13.0762 20.0287C13 20.2128 13 20.4174 13 20.8268Z`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M19 11C19 11 19 9.4306 18.8478 9.06306C18.6955 8.69552 18.4065 8.40649 17.8284 7.82843L13.0919 3.09188C12.593 2.593 12.3436 2.34355 12.0345 2.19575C11.9702 2.165 11.9044 2.13772 11.8372 2.11401C11.5141 2 11.1614 2 10.4558 2C7.21082 2 5.58831 2 4.48933 2.88607C4.26731 3.06508 4.06508 3.26731 3.88607 3.48933C3 4.58831 3 6.21082 3 9.45584V14C3 17.7712 3 19.6569 4.17157 20.8284C5.23467 21.8915 6.8857 21.99 10 21.9991M12 2.5V3C12 5.82843 12 7.24264 12.8787 8.12132C13.7574 9 15.1716 9 18 9H18.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Rd=[[`path`,{d:`M14 21L18 3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M6 21L10 3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5 8H21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M3 16H19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],zd=[[`path`,{d:`M4 3H20`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M5.5 3V5.03039C5.5 6.27227 6.07682 7.4437 7.06116 8.20089L12 12L16.9388 8.20089C17.9232 7.44371 18.5 6.27227 18.5 5.03039V3`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5.5 21V18.9696C5.5 17.7277 6.07682 16.5563 7.06116 15.7991L12 12L16.9388 15.7991C17.9232 16.5563 18.5 17.7277 18.5 18.9696V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M4 21H20`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}]],Bd=[[`path`,{d:`M7 2.5C5.59269 2.66536 4.62427 3.01488 3.89124 3.75363C2.5 5.15575 2.5 7.41242 2.5 11.9258C2.5 16.4391 2.5 18.6958 3.89124 20.0979C5.28249 21.5 7.52166 21.5 12 21.5C16.4783 21.5 18.7175 21.5 20.1088 20.0979C21.5 18.6958 21.5 16.4391 21.5 11.9258C21.5 7.41242 21.5 5.15575 20.1088 3.75363C19.3757 3.01488 18.4073 2.66536 17 2.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.5 8C9.99153 8.5057 11.2998 10.5 12 10.5M14.5 8C14.0085 8.5057 12.7002 10.5 12 10.5M12 10.5V2.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M21.5 13.5H16.5743C15.7322 13.5 15.0706 14.2036 14.6995 14.9472C14.2963 15.7551 13.4889 16.5 12 16.5C10.5111 16.5 9.70373 15.7551 9.30054 14.9472C8.92942 14.2036 8.26777 13.5 7.42566 13.5H2.5`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Vd=[[`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 16V12`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12.125 8.25H12M12.25 8.25C12.25 8.11193 12.1381 8 12 8C11.8619 8 11.75 8.11193 11.75 8.25C11.75 8.38807 11.8619 8.5 12 8.5C12.1381 8.5 12.25 8.38807 12.25 8.25Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Hd=[[`path`,{d:`M12 3V6`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M12 18V21`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M21 12L18 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M6 12L3 12`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M18.3635 5.63672L16.2422 7.75804`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M7.75804 16.2422L5.63672 18.3635`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`5`}],[`path`,{d:`M18.3635 18.3635L16.2422 16.2422`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`6`}],[`path`,{d:`M7.75804 7.75804L5.63672 5.63672`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`7`}]],Ud=[[`path`,{d:`M21.9598 12.9919C21.6856 17.2342 18.3536 20.6134 14.1706 20.8915C13.4574 20.9389 12.7285 21.001 12 21.001C10.4054 21.001 8.95127 20.8637 7.44544 20.2902C7.44544 20.2902 5.56108 21.7589 3.69962 21.4587C3.31009 21.3959 3.11532 21.3644 3.00091 21.1343C2.8865 20.9042 3.00788 20.6756 3.25063 20.2185C3.65964 19.4483 3.92248 18.6737 3.80076 17.8306C3.73703 17.3892 3.50433 16.9974 3.27644 16.6136L3.26529 16.5948C2.62637 15.5188 2.12462 14.2975 2.04024 12.9919C1.98659 12.1617 1.98659 11.3019 2.04024 10.4717C2.31441 6.22935 5.64639 2.85011 9.8294 2.57205C11.2536 2.47738 12.7435 2.47719 14.1706 2.57205C18.3536 2.85011 21.6856 6.22935 21.9598 10.4717C22.0134 11.3019 22.0134 12.1617 21.9598 12.9919Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M8.75 14.501H15.25M8.75 9.50098H12.25`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],Wd=[[`path`,{d:`M21.5 14.0784C20.3003 14.7189 18.9301 15.0821 17.4751 15.0821C12.7491 15.0821 8.91792 11.2509 8.91792 6.52485C8.91792 5.06986 9.28105 3.69968 9.92163 2.5C5.66765 3.49698 2.5 7.31513 2.5 11.8731C2.5 17.1899 6.8101 21.5 12.1269 21.5C16.6849 21.5 20.503 18.3324 21.5 14.0784Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Gd=[[`path`,{d:`M15.5 18C15.5 19.933 13.933 21.5 12 21.5C10.067 21.5 8.5 19.933 8.5 18`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M2 2L22 22`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M21 16.2311C21 15.762 20.8136 15.3121 20.4819 14.9803L19.8787 14.3771C19.3161 13.8145 19 13.0514 19 12.2558V9.5C19 5.634 15.866 2.5 12 2.5C10.4497 2.5 9.01706 3.00399 7.85707 3.85707M4.76887 18C3.79195 18 3 17.208 3 16.2311C3 15.762 3.18636 15.3121 3.51809 14.9803L4.12132 14.3771C4.68393 13.8145 5 13.0514 5 12.2558V9.5C5 8.20839 5.34981 6.99849 5.95987 5.95987L18 18H4.76887Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Kd=[[`path`,{d:`M21.0477 3.05293C18.8697 0.707363 2.48648 6.4532 2.50001 8.551C2.51535 10.9299 8.89809 11.6617 10.6672 12.1581C11.7311 12.4565 12.016 12.7625 12.2613 13.8781C13.3723 18.9305 13.9301 21.4435 15.2014 21.4996C17.2278 21.5892 23.1733 5.342 21.0477 3.05293Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M11.4999 12.5L14.9999 9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],qd=[[`path`,{d:`M2 12C2 8.31087 2 6.4663 2.81382 5.15877C3.1149 4.67502 3.48891 4.25427 3.91891 3.91554C5.08116 3 6.72077 3 10 3H14C17.2792 3 18.9188 3 20.0811 3.91554C20.5111 4.25427 20.8851 4.67502 21.1862 5.15877C22 6.4663 22 8.31087 22 12C22 15.6891 22 17.5337 21.1862 18.8412C20.8851 19.325 20.5111 19.7457 20.0811 20.0845C18.9188 21 17.2792 21 14 21H10C6.72077 21 5.08116 21 3.91891 20.0845C3.48891 19.7457 3.1149 19.325 2.81382 18.8412C2 17.5337 2 15.6891 2 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M9.5 3L9.5 21`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5 7H6M5 10H6`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Jd=[[`path`,{d:`M2 12C2 8.3109 2 6.46633 2.81382 5.1588C3.1149 4.67505 3.48891 4.2543 3.91891 3.91557C5.08116 3.00003 6.72077 3.00003 10 3.00003H14C17.2792 3.00003 18.9188 3.00003 20.0811 3.91557C20.5111 4.2543 20.8851 4.67505 21.1862 5.1588C22 6.46633 22 8.3109 22 12C22 15.6892 22 17.5337 21.1862 18.8413C20.8851 19.325 20.5111 19.7458 20.0811 20.0845C18.9188 21 17.2792 21 14 21H10C6.72077 21 5.08116 21 3.91891 20.0845C3.48891 19.7458 3.1149 19.325 2.81382 18.8413C2 17.5337 2 15.6892 2 12Z`,stroke:`currentColor`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M14.5 3.00003L14.5 21`,stroke:`currentColor`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M18 7.00006H19M18 10.0001H19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Yd=[[`path`,{d:`M12 14.5V17.5M13 14.5C13 15.0523 12.5523 15.5 12 15.5C11.4477 15.5 11 15.0523 11 14.5C11 13.9477 11.4477 13.5 12 13.5C12.5523 13.5 13 13.9477 13 14.5Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M16.5 9V6.5C16.5 4.01472 14.4853 2 12 2C9.51471 2 7.49999 4.01472 7.49999 6.5V9`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M4.2678 18.8447C4.49268 20.515 5.87612 21.8235 7.55965 21.9009C8.97627 21.966 10.4153 22 12 22C13.5847 22 15.0237 21.966 16.4403 21.9009C18.1239 21.8235 19.5073 20.515 19.7322 18.8447C19.8789 17.7547 20 16.6376 20 15.5C20 14.3624 19.8789 13.2453 19.7322 12.1553C19.5073 10.485 18.1239 9.17649 16.4403 9.09909C15.0237 9.03397 13.5847 9 12 9C10.4153 9 8.97627 9.03397 7.55965 9.09909C5.87612 9.17649 4.49268 10.485 4.2678 12.1553C4.12104 13.2453 3.99999 14.3624 3.99999 15.5C3.99999 16.6376 4.12104 17.7547 4.2678 18.8447Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Xd=[[`path`,{d:`M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M14 2.20004C13.3538 2.06886 12.6849 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 11.3151 21.9311 10.6462 21.8 10`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M12.0303 11.9625L16.5832 7.4096M19.7404 4.34462L19.1872 2.35748C19.0853 2.03011 18.6914 1.89965 18.4259 2.11662C16.9898 3.29018 15.4254 4.87091 16.703 7.36419C19.2771 8.56455 20.7466 6.94584 21.8733 5.5853C22.0975 5.3146 21.9623 4.90767 21.6247 4.81005L19.7404 4.34462Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}]],Zd=[[`path`,{d:`M5 14L8.5 17.5L19 6.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]],Qd=[[`path`,{d:`M2.25 12C2.25 17.5228 6.72715 22 12.25 22C17.7728 22 22.25 17.5228 22.25 12C22.25 6.47715 17.7728 2 12.25 2C6.72715 2 2.25 6.47715 2.25 12Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M5.25 5L19.25 19`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}]],$d=[[`path`,{d:`M18.4995 20.5C18.2663 17.5685 15.8417 15.2477 12.808 15.0521L11.9995 15C11.7107 15.0076 11.4416 15.0178 11.1877 15.0298C8.18075 15.1723 5.7304 17.5974 5.49951 20.5`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}],[`path`,{d:`M15.2495 9.25C15.2495 11.0449 13.7944 12.5 11.9995 12.5C10.2046 12.5 8.74952 11.0449 8.74952 9.25C8.74952 7.45507 10.2046 6 11.9995 6C13.7944 6 15.2495 7.45507 15.2495 9.25Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`1`}],[`path`,{d:`M5.50249 8.5C5.17908 7.99485 4.99158 7.39432 4.99158 6.75C4.99158 4.95507 6.44665 3.5 8.24157 3.5C8.68752 3.5 9.1125 3.58982 9.49939 3.75235`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`2`}],[`path`,{d:`M18.4963 8.5C18.8197 7.99485 19.0072 7.39432 19.0072 6.75C19.0072 4.95507 17.5521 3.5 15.7572 3.5C15.3113 3.5 14.8863 3.58982 14.4994 3.75235`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`3`}],[`path`,{d:`M22.0007 17.9996C21.8208 15.7374 19.9995 13.5 17.9995 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`4`}],[`path`,{d:`M1.99927 17.9996C2.17923 15.7374 4.00049 13.5 6.00049 13`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`5`}]],ef=[[`path`,{d:`M3.74416 16.1113L8.66248 12.5982C9.18807 12.2228 9.5 11.6167 9.5 10.9708V7.5C9.5 4.73858 11.7386 2.5 14.5 2.5H18L14.9811 6.81268C14.7029 7.2102 14.7501 7.75013 15.0932 8.09325L15.9068 8.90675C16.2499 9.24987 16.7898 9.29714 17.1873 9.01888L21.5 6V9.5C21.5 12.2614 19.2614 14.5 16.5 14.5H13.0292C12.3833 14.5 11.7772 14.8119 11.4018 15.3375L7.88869 20.2558C7.33099 21.0366 6.43055 21.5 5.47105 21.5C3.83018 21.5 2.5 20.1698 2.5 18.529C2.5 17.5695 2.96338 16.669 3.74416 16.1113Z`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`,key:`0`}]];function tf({...e}){return(0,q.jsx)(ro,{"data-slot":`sheet`,...e})}function nf({...e}){return(0,q.jsx)(lo,{"data-slot":`sheet-portal`,...e})}function rf({className:e,...t}){return(0,q.jsx)(fo,{"data-slot":`sheet-overlay`,className:K(`fixed inset-0 z-50 bg-black/30 duration-100 supports-backdrop-filter:backdrop-blur-sm data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function af({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,q.jsxs)(nf,{children:[(0,q.jsx)(rf,{}),(0,q.jsxs)(go,{"data-slot":`sheet-content`,"data-side":n,className:K(`fixed z-50 flex flex-col bg-popover bg-clip-padding text-sm text-popover-foreground shadow-xl transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,e),...i,children:[t,r&&(0,q.jsx)(Co,{"data-slot":`sheet-close`,asChild:!0,children:(0,q.jsxs)(bd,{variant:`ghost`,className:`absolute top-4 right-4 bg-secondary`,size:`icon-sm`,children:[(0,q.jsx)(Sd,{icon:Md,strokeWidth:2}),(0,q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function of({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sheet-header`,className:K(`flex flex-col gap-1.5 p-6`,e),...t})}function sf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sheet-footer`,className:K(`mt-auto flex flex-col gap-2 p-6`,e),...t})}function cf({className:e,...t}){return(0,q.jsx)(bo,{"data-slot":`sheet-title`,className:K(`text-base font-medium text-foreground`,e),...t})}function lf({className:e,...t}){return(0,q.jsx)(xo,{"data-slot":`sheet-description`,className:K(`text-sm text-muted-foreground`,e),...t})}var uf=768;function df(){let[e,t]=o.useState(void 0);return o.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<uf)};return e.addEventListener(`change`,n),t(window.innerWidth<uf),()=>e.removeEventListener(`change`,n)},[]),!!e}function ff({className:e,type:t,...n}){return(0,q.jsx)(`input`,{type:t,"data-slot":`input`,className:K(`h-8 w-full min-w-0 rounded-2xl border border-transparent bg-input/50 px-2.5 py-1 text-base transition-[color,box-shadow] duration-200 outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function pf({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,q.jsx)(uu,{"data-slot":`separator`,decorative:n,orientation:t,className:K(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...r})}function mf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`skeleton`,className:K(`animate-pulse rounded-2xl bg-muted`,e),...t})}function hf({delayDuration:e=0,...t}){return(0,q.jsx)(Wu,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function gf({...e}){return(0,q.jsx)(Ju,{"data-slot":`tooltip`,...e})}function _f({...e}){return(0,q.jsx)(Xu,{"data-slot":`tooltip-trigger`,...e})}function vf({className:e,sideOffset:t=0,children:n,...r}){return(0,q.jsx)(ed,{children:(0,q.jsxs)(nd,{"data-slot":`tooltip-content`,sideOffset:t,className:K(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-xl bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,q.jsx)(od,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=left]:translate-x-[-1.5px] data-[side=right]:translate-x-[1.5px]`})]})})}var yf=`sidebar_state`,bf=604800,xf=`16rem`,Sf=`18rem`,Cf=`3rem`,wf=`b`,Tf=o.createContext(null);function Ef(){let e=o.useContext(Tf);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Df({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...s}){let c=df(),[l,u]=o.useState(!1),[d,f]=o.useState(e),p=t??d,m=o.useCallback(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t),document.cookie=`${yf}=${t}; path=/; max-age=${bf}`},[n,p]),h=o.useCallback(()=>c?u(e=>!e):m(e=>!e),[c,m,u]);o.useEffect(()=>{let e=e=>{e.key===wf&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,_=o.useMemo(()=>({state:g,open:p,setOpen:m,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:h}),[g,p,m,c,l,u,h]);return(0,q.jsx)(Tf.Provider,{value:_,children:(0,q.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":xf,"--sidebar-width-icon":Cf,...i},className:K(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...s,children:a})})}function Of({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,dir:a,...o}){let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=Ef();return n===`none`?(0,q.jsx)(`div`,{"data-slot":`sidebar`,className:K(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...o,children:i}):s?(0,q.jsx)(tf,{open:l,onOpenChange:u,...o,children:(0,q.jsxs)(af,{dir:a,"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":Sf},side:e,children:[(0,q.jsxs)(of,{className:`sr-only`,children:[(0,q.jsx)(cf,{children:`Sidebar`}),(0,q.jsx)(lf,{children:`Displays the mobile sidebar.`})]}),(0,q.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,q.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,q.jsx)(`div`,{"data-slot":`sidebar-gap`,className:K(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,q.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":e,className:K(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...o,children:(0,q.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-2xl group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:i})})]})}function kf({className:e,onClick:t,...n}){let{toggleSidebar:r}=Ef();return(0,q.jsxs)(bd,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,className:K(e),onClick:e=>{t?.(e),r()},...n,children:[(0,q.jsx)(Sd,{icon:qd,strokeWidth:2}),(0,q.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function Af({className:e,...t}){return(0,q.jsx)(`main`,{"data-slot":`sidebar-inset`,className:K(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-2xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function jf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:K(`flex flex-col gap-2 p-2 [--radius:var(--radius-xl)]`,e),...t})}function Mf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:K(`flex flex-col gap-2 p-2`,e),...t})}function Nf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:K(`no-scrollbar flex min-h-0 flex-1 flex-col gap-2 overflow-auto [--radius:var(--radius-xl)] group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function Pf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:K(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function Ff({className:e,asChild:t=!1,...n}){let r=t?Yt:`div`;return(0,q.jsx)(r,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:K(`flex h-8 shrink-0 items-center rounded-xl px-3 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-3 [&>svg]:size-4 [&>svg]:shrink-0`,e),...n})}function If({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:K(`w-full text-sm`,e),...t})}function Lf({className:e,...t}){return(0,q.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:K(`flex w-full min-w-0 flex-col gap-0.5`,e),...t})}function Rf({className:e,...t}){return(0,q.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:K(`group/menu-item relative`,e),...t})}var zf=vd(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-xl px-3 py-2 text-left text-sm whitespace-nowrap ring-sidebar-ring outline-hidden transition-[width,height,padding] duration-200 group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-3 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 has-[>svg:first-child]:pl-2.5 has-[>svg:last-child]:pr-2.5 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 px-3 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function Bf({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let s=e?Yt:`button`,{isMobile:c,state:l}=Ef(),u=(0,q.jsx)(s,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:K(zf({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,q.jsxs)(gf,{children:[(0,q.jsx)(_f,{asChild:!0,children:u}),(0,q.jsx)(vf,{side:`right`,align:`center`,hidden:l!==`collapsed`||c,...i})]})):u}function Vf({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`sidebar-menu-badge`,"data-sidebar":`menu-badge`,className:K(`pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-xl px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground`,e),...t})}function Hf({className:e,showIcon:t=!1,...n}){let[r]=o.useState(()=>`${Math.floor(Math.random()*40)+50}%`);return(0,q.jsxs)(`div`,{"data-slot":`sidebar-menu-skeleton`,"data-sidebar":`menu-skeleton`,className:K(`flex h-8 items-center gap-2 rounded-xl px-2`,e),...n,children:[t&&(0,q.jsx)(mf,{className:`size-4 rounded-xl`,"data-sidebar":`menu-skeleton-icon`}),(0,q.jsx)(mf,{className:`h-4 max-w-(--skeleton-width) flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":r}})]})}var Uf=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),Wf=function(e){return`/`+e},Gf={},Kf=function(e){return e.pathname.endsWith(`.css`)},qf=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Jf=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Wf(t,n);let r=s(t),i=Kf(r);return qf(Gf,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Uf,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Yf=globalThis;Yf.window??=globalThis,Yf.Path2D??=class{},await Jf(()=>import(`./characters-BsW4RWhl.js`),[]);var Xf=Yf.window.CotalArt;function Zf(e,t){return Xf.body(e,t)}function Qf(e){return Xf.mark(e)}function $f(e){return Xf.character({vendor:e,cx:70,cy:66,w:92,look:`right`,mood:`happy`,arms:[{from:[84,50],via:[106,40],to:[112,12],hand:`open`,deg:`auto`}],legs:[{from:[40,94],to:[36,116],dir:-1},{from:[62,94],to:[66,116],dir:1}]})}function ep(){let e=(0,o.useRef)(null);return{onOpenAutoFocus:()=>{e.current=globalThis.document.activeElement},onCloseAutoFocus:t=>{t.preventDefault(),e.current?.focus(),e.current=null}}}function X({icon:e,size:t=18,className:n,"data-icon":r}){return(0,q.jsx)(Sd,{icon:e,size:t,strokeWidth:1.5,className:n,"data-icon":r,"aria-hidden":`true`})}var tp=vd(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-2xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function np({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?Yt:`span`;return(0,q.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:K(tp({variant:t}),e),...r})}function rp({className:e,size:t=`default`,...n}){return(0,q.jsx)(Fo,{"data-slot":`avatar`,"data-size":t,className:K(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,e),...n})}function ip({className:e,...t}){return(0,q.jsx)(Lo,{"data-slot":`avatar-fallback`,className:K(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}var ap=vd(`group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full`,{variants:{variant:{default:`*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80`,secondary:`*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]`,muted:`*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]`,tinted:`*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]`,outline:`*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30`,ghost:`border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50`,destructive:`*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30`}},defaultVariants:{variant:`default`}});function op({variant:e=`default`,align:t=`start`,className:n,...r}){return(0,q.jsx)(`div`,{"data-slot":`bubble`,"data-variant":e,"data-align":t,className:K(ap({variant:e}),n),...r})}function sp({asChild:e=!1,className:t,...n}){let r=e?Yt:`div`;return(0,q.jsx)(r,{"data-slot":`bubble-content`,className:K(`w-fit max-w-full min-w-0 overflow-hidden rounded-3xl border border-transparent px-3 py-2.5 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/30`,t),...n})}function cp({className:e,...t}){return(0,q.jsx)(iu,{"data-slot":`label`,className:K(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var lp=vd(`group/field flex w-full gap-3 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function up({className:e,orientation:t=`vertical`,...n}){return(0,q.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:K(lp({orientation:t}),e),...n})}function dp({className:e,...t}){return(0,q.jsx)(cp,{"data-slot":`field-label`,className:K(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:bg-input/30 has-[>[data-slot=field]]:rounded-2xl has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-input/40 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-3 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-4`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function fp({className:e,...t}){return(0,q.jsx)(`p`,{"data-slot":`field-description`,className:K(`text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function pp({className:e,children:t,errors:n,...r}){let i=(0,o.useMemo)(()=>{if(t)return t;if(!n?.length)return null;let e=[...new Map(n.map(e=>[e?.message,e])).values()];return e?.length==1?e[0]?.message:(0,q.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map((e,t)=>e?.message&&(0,q.jsx)(`li`,{children:e.message},t))})},[t,n]);return i?(0,q.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:K(`text-sm font-normal text-destructive`,e),...r,children:i}):null}function mp({className:e,...t}){return(0,q.jsx)(`textarea`,{"data-slot":`textarea`,className:K(`flex field-sizing-content min-h-16 w-full resize-none rounded-2xl border border-transparent bg-input/50 px-2.5 py-2 text-base transition-[color,box-shadow] duration-200 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function hp({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:K(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-2xl border border-transparent bg-input/50 transition-[color,box-shadow] duration-200 outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var gp=vd(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-2xl **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1.5 [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function _p({className:e,align:t=`inline-start`,...n}){return(0,q.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:K(gp({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var vp=vd(`flex items-center gap-2 rounded-2xl text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-xl px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-xl p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function yp({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,q.jsx)(bd,{type:t,"data-size":r,variant:n,className:K(vp({size:r}),e),...i})}function bp({className:e,...t}){return(0,q.jsx)(`span`,{className:K(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,e),...t})}function xp({className:e,...t}){return(0,q.jsx)(mp,{"data-slot":`input-group-control`,className:K(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent`,e),...t})}function Sp({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`message-group`,className:K(`flex min-w-0 flex-col gap-2`,e),...t})}function Cp({className:e,align:t=`start`,...n}){return(0,q.jsx)(`div`,{"data-slot":`message`,"data-align":t,className:K(`group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse`,e),...n})}function wp({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`message-avatar`,className:K(`flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8`,e),...t})}function Tp({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`message-content`,className:K(`flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end`,e),...t})}function Ep({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`message-header`,className:K(`flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0`,e),...t})}function Dp({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`message-footer`,className:K(`flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end`,e),...t})}function Op({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=kp(Ap(r,i),t);if(!n)return o.createElement(e,a);if(typeof n==`function`)return n(a,r);if(!o.isValidElement(n))return null;let s=n.props,c={...kp(a,s),ref:Np(a.ref,s.ref)};return o.cloneElement(n,c)}function kp(...e){let t={};for(let n of e){if(!n)continue;let e=n;for(let n of Object.keys(e)){let r=e[n];if(r===void 0)continue;let i=t[n];t[n]=n===`className`?[i,r].filter(Boolean).join(` `):n===`style`?{...i,...r}:n===`ref`?Np(i,r):Mp(n)&&typeof i==`function`&&typeof r==`function`?jp(r,i):r}}return t}function Ap(e,t){let n={};for(let r of Object.keys(e)){let i=e[r],a=t?.[r]?.(i);if(a){Object.assign(n,a);continue}if(r===`slot`){n[`data-slot`]=i;continue}let o=`data-${String(r).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;typeof i==`boolean`?n[o]=i?``:void 0:i!=null&&(n[o]=String(i))}return n}function jp(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function Mp(e){return/^on[A-Z]/.test(e)}function Np(...e){let t=e.filter(Boolean);if(t.length!==0)return e=>{for(let n of t)typeof n==`function`?n(e):n&&(n.current=e)}}var Pp=8,Fp=64,Ip=0,Lp=.5,Rp=180,zp=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),Bp={start:!1,end:!1},Vp={currentAnchorId:null,visibleMessageIds:[]};function Hp({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return Bp;let i=em({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function Up({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return Vp;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of Wp(e,r)){let e=t.dataset.messageId;if(!e)continue;let n=t.dataset.scrollAnchor===`true`,r=n||c?t.getBoundingClientRect():null;(c&&r?r.bottom>s&&r.top<o.bottom:a.has(e))&&l.push(e),n&&r&&r.top<=s+Lp&&(u=e)}return l.length===0&&u===null?Vp:{currentAnchorId:u,visibleMessageIds:l}}function Wp(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function Gp(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function Kp(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function qp(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor===`true`&&(n+=1,n>1))return!0;return!1}function Jp(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function Yp({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of Wp(e,t)){if(!n.dataset.messageId)continue;let e=n.getBoundingClientRect();if(e.bottom>r.top&&e.top<r.bottom)return n}return null}function Xp({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=Zp(t,i),o=t.getBoundingClientRect().height,s=rm(r);if(e===`center`){let e=Math.max(0,i.clientHeight-s.start-s.end);return a-s.start-(e-o)/2-n}if(e===`end`)return a-i.clientHeight+o+s.end+n;if(e===`nearest`){let e=a+o,t=i.scrollTop+s.start,r=i.scrollTop+i.clientHeight-s.end;return a>=t&&e<=r?i.scrollTop:a<t?a-s.start-n:e-i.clientHeight+s.end+n}return a-s.start-n}function Zp(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function Qp(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function $p({content:e,scrollTop:t,spacer:n,viewport:r}){let i=em({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function em({content:e,spacer:t,viewport:n}){let r=Wp(e,t),i=nm(e),a=n.getBoundingClientRect(),o=n.scrollTop,s=i.start+i.end;for(let e of r){let t=e.getBoundingClientRect();s=Math.max(s,t.bottom-a.top+o+i.end)}return s}function tm(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function nm(e){let t=window.getComputedStyle(e);return{end:am(t.paddingBlockEnd||t.paddingBottom),start:am(t.paddingBlockStart||t.paddingTop)}}function rm(e){let t=e?.parentElement;return t?nm(t):{end:0,start:0}}function im(e){if(!e)return 0;let t=window.getComputedStyle(e);return am(t.rowGap===`normal`?t.gap:t.rowGap)}function am(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function om(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:e=>{t(n,e)||(n=e,r.forEach(e=>e()))},subscribe:(e,t,n)=>{let i=r.size===0;return r.add(e),i&&t?.(),()=>{r.delete(e),r.size===0&&n?.()}}}}function sm(e,t){return om(e,t)}function cm(){return om(Vp,um)}function lm(e,t){return e.start===t.start&&e.end===t.end}function um(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function dm({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:r,scrollPreviousItemPeek:i}){let a=o.useRef(e),s=o.useRef(!1),c=o.useRef(null),l=o.useRef(!1),u=o.useRef(n),d=o.useRef(0),f=o.useRef(null),p=o.useRef(0),m=o.useRef(e?`following-bottom`:`free-scrolling`),h=o.useRef(new Map),g=o.useRef(null),_=o.useRef(null),v=o.useRef(null),y=o.useRef(i),b=o.useRef(!0),x=o.useRef(null),S=o.useRef(r),C=o.useRef(null),w=o.useRef(0),T=o.useRef(0),E=o.useRef(null),D=o.useRef(null),O=o.useRef(null),k=o.useRef(null),A=o.useRef(null),j=o.useRef(null),M=o.useRef(null),N=o.useRef(null),P=o.useRef(null),F=o.useRef(new Set),I=o.useRef(new WeakSet);return O.current===null&&(O.current=sm(t===`end`||t===`last-anchor`,(e,t)=>e===t)),k.current===null&&(k.current=sm(Bp,lm)),P.current===null&&(P.current=cm()),a.current=e,u.current=n,S.current=r,y.current=i,{autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:A,streamingTurnRef:v,contentRef:c,defaultScrollPositionAppliedRef:l,firstItemRef:f,itemCountRef:d,lastScrollTopRef:p,messageElementsRef:h,modeRef:m,pendingScrollFrameRef:C,pendingScrollToMessageRef:g,prependRestoreRef:_,preserveScrollOnPrependRef:b,pendingDefaultScrollStore:O.current,rootRef:x,scrollEdgeThresholdRef:u,scrollMarginRef:S,scrollPreviousItemPeekRef:y,spacerGapRef:w,spacerHeightRef:T,spacerRef:E,stateFrameRef:D,stateStore:k.current,viewportRef:j,visibilityFrameRef:M,visibilityObserverRef:N,visibilityStore:P.current,visibleMessageIdsRef:F,handledScrollAnchorsRef:I}}function fm(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function pm(e){e.defaultScrollPositionAppliedRef.current=!0,fm(e)}function mm({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:i,autoScrollRef:a,autoscrollingRef:s,autoscrollingTimeoutRef:c,contentRef:l,itemCountRef:u,messageElementsRef:d,modeRef:f,pendingScrollToMessageRef:p,prependRestoreRef:m,scrollMarginRef:h,scrollPreviousItemPeekRef:g,spacerGapRef:_,spacerHeightRef:v,spacerRef:y,viewportRef:b}=e,x=o.useCallback(e=>{c.current!==null&&(window.clearTimeout(c.current),c.current=null),s.current!==e&&(s.current=e,t()),e&&(c.current=window.setTimeout(()=>{c.current=null,s.current=!1,t()},Rp))},[t]),S=o.useCallback(e=>{let t=y.current;if(!t)return;let n=Math.max(0,Math.ceil(e));v.current!==n&&(v.current=n,t.hidden=n===0,t.style.height=`${n}px`,t.style.marginTop=n>0?`${-_.current}px`:``)},[]),C=o.useCallback((e,{behavior:r=`auto`,autoscrolling:i=!1}={})=>{let a=b.current;if(!a)return;let o=Math.max(0,e);Math.abs(a.scrollTop-o)<=Lp?(a.scrollTop=o,t()):(i&&x(!0),a.scrollTo({top:o,behavior:r}),n())},[t,n,x]),w=o.useCallback(({behavior:e=`auto`}={})=>b.current?(S(0),i.current=null,f.current=`free-scrolling`,C(0,{behavior:e}),r(),!0):!1,[r,C,S]),T=o.useCallback(({behavior:e=`auto`}={})=>{let t=b.current;return t?(S(0),i.current=null,f.current=a.current?`following-bottom`:`free-scrolling`,C(tm(t),{autoscrolling:!0,behavior:e}),r(),!0):!1},[r,C,S]),E=o.useCallback((e,{align:t=`start`,behavior:n=`auto`,scrollMargin:a=h.current}={},{keepPreviousPeek:o=!1}={})=>{let s=l.current,c=b.current;if(!s||!c||!s.contains(e))return!1;let u=Xp({align:t,element:e,scrollMargin:o?a+g.current:a,spacer:y.current,viewport:c}),d=$p({content:s,scrollTop:u,spacer:y.current,viewport:c});return S(d),m.current={element:e,viewportTop:Qp(e,c)},f.current=o?`anchored-to-message`:`settling-jump`,i.current=o?e:null,C(u,{behavior:n}),r(),!0},[r,C,S]),D=o.useCallback(()=>{let e=i.current;return!e||!e.isConnected||f.current!==`anchored-to-message`?!1:E(e,{align:`start`},{keepPreviousPeek:!0})},[E]),O=o.useCallback((t,n)=>{let r=d.current.get(t);return r?(pm(e),E(r,n)?(p.current=null,!0):(p.current={messageId:t,options:n},!0)):u.current===0&&(p.current={messageId:t,options:n},pm(e),!0)},[E]);return{flushPendingScrollToMessage:o.useCallback(()=>{let t=p.current;if(!t)return!1;let n=d.current.get(t.messageId);return!n||!E(n,t.options)?!1:(p.current=null,pm(e),!0)},[E]),reanchorToAnchoredMessage:D,scrollToElement:E,scrollToEnd:T,scrollToMessage:O,scrollToStart:w}}function hm(e,t){return o.useCallback(n=>{e.current=n,n&&t()},[e,t])}function gm({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=Pp,scrollPreviousItemPeek:r=Fp,scrollMargin:i=Ip}){let a=dm({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:i,scrollPreviousItemPeek:r}),{streamingTurnRef:s,autoScrollRef:c,autoscrollingRef:l,autoscrollingTimeoutRef:u,contentRef:d,defaultScrollPositionAppliedRef:f,firstItemRef:p,itemCountRef:m,lastScrollTopRef:h,messageElementsRef:g,modeRef:_,pendingScrollFrameRef:v,pendingScrollToMessageRef:y,prependRestoreRef:b,preserveScrollOnPrependRef:x,pendingDefaultScrollStore:S,rootRef:C,scrollEdgeThresholdRef:w,scrollMarginRef:T,scrollPreviousItemPeekRef:E,spacerGapRef:D,spacerHeightRef:O,spacerRef:k,stateFrameRef:A,stateStore:j,viewportRef:M,visibilityFrameRef:N,visibilityObserverRef:P,visibilityStore:F,visibleMessageIdsRef:I,handledScrollAnchorsRef:ee}=a,L=o.useRef(t);L.current!==t&&(L.current=t,f.current=!1);let te=o.useCallback(e=>{let t=C.current,n=M.current,r=[e.start&&`start`,e.end&&`end`].filter(Boolean).join(` `),i=l.current;for(let e of[t,n])e&&(r?e.setAttribute(`data-scrollable`,r):e.removeAttribute(`data-scrollable`),e.toggleAttribute(`data-autoscrolling`,i))},[]),ne=o.useCallback(e=>{let t=M.current?.scrollTop??0,n=t<h.current-Lp;h.current=t,c.current&&!e.end&&_.current!==`settling-jump`&&_.current!==`anchored-to-message`?_.current=`following-bottom`:_.current===`following-bottom`&&e.end&&n&&!l.current&&(_.current=`free-scrolling`)},[]),re=o.useCallback(()=>{let e=Hp({content:d.current,scrollEdgeThreshold:w.current,spacer:k.current,viewport:M.current});ne(e);let t=_.current===`following-bottom`?{...e,end:!1}:e;te(t),j.setSnapshot(t)},[ne,j,te]),ie=o.useCallback(()=>{A.current===null&&(A.current=window.requestAnimationFrame(()=>{A.current=null,re()}))},[re]),R=o.useCallback(()=>{F.hasListeners()&&N.current===null&&(N.current=window.requestAnimationFrame(()=>{N.current=null,F.hasListeners()&&F.setSnapshot(Up({content:d.current,scrollMargin:T.current,scrollPreviousItemPeek:E.current,spacer:k.current,viewport:M.current,visibleMessageIds:I.current}))}))},[F]),{flushPendingScrollToMessage:z,reanchorToAnchoredMessage:ae,scrollToElement:B,scrollToEnd:V,scrollToMessage:H,scrollToStart:oe}=mm({refs:a,commitScrollState:re,scheduleStateCommit:ie,scheduleVisibilitySync:R}),U=o.useCallback(()=>{let e=b.current,t=M.current;if(!e||!t||!e.element.isConnected)return!1;let n=Qp(e.element,t)-e.viewportTop;return Math.abs(n)<=Lp?!1:(t.scrollTop+=n,e.viewportTop=Qp(e.element,t),ie(),R(),!0)},[ie,R]),se=o.useCallback(()=>{let e=d.current,t=M.current;if(!e||!t){b.current=null;return}let n=Yp({content:e,spacer:k.current,viewport:t});b.current=n?{element:n,viewportTop:Qp(n,t)}:null},[]),ce=o.useCallback(()=>{v.current===null&&(v.current=window.requestAnimationFrame(()=>{v.current=null,z()&&se()}))},[se,z]),le=o.useCallback(()=>{if(!t||f.current||m.current===0)return!1;let e=!1;if(t===`last-anchor`){let t=d.current,n=M.current,r=t&&n?Jp(Wp(t,k.current)):null;if(!t||!n||!r)e=V({behavior:`auto`});else{let i=Zp(r,n);e=em({content:t,spacer:k.current,viewport:n})-i<=n.clientHeight?V({behavior:`auto`}):B(r,{align:`start`},{keepPreviousPeek:!0})}}else e=t===`end`?V({behavior:`auto`}):oe({behavior:`auto`});return e?(pm(a),!0):!1},[t,B,V,oe]),ue=o.useCallback(()=>{let e=d.current;if(!e)return;let t=Wp(e,k.current),n=m.current,r=p.current;m.current=t.length,p.current=t[0]??null,(()=>{if(z())return;if(n===0){if(le()||t.length>0&&c.current&&V({behavior:`auto`}))return;re(),R();return}let e=r?t.indexOf(r):-1;if(x.current&&e>0)U();else{if(t.length>n){let e=Gp(t,n);if(e){if(c.current&&_.current===`following-bottom`&&qp(t,n)){V({behavior:`auto`});return}B(e,{align:`start`},{keepPreviousPeek:!0}),ee.current.add(e);return}}if(t.length===n){let e=Kp(t,ee.current);if(e){B(e,{align:`start`},{keepPreviousPeek:!0}),ee.current.add(e);return}}_.current===`following-bottom`&&c.current?V({behavior:`auto`}):(re(),R())}})(),se()},[le,se,re,z,U,R,B,V]),de=o.useCallback(()=>{if(_.current===`following-bottom`&&c.current){V({behavior:`auto`});return}let e=O.current;ae()?c.current&&e>0&&O.current===0&&V({behavior:`auto`}):(ie(),R())},[ae,ie,R,V]),fe=o.useCallback(()=>{let e=M.current;if(e&&F.hasListeners()){if(typeof IntersectionObserver>`u`){R();return}P.current||=new IntersectionObserver(e=>{for(let t of e){let e=t.target.dataset.messageId;e&&(t.isIntersecting?I.current.add(e):I.current.delete(e))}R()},{root:e,rootMargin:`${-(T.current+E.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]}),g.current.forEach(e=>{P.current?.observe(e)}),R()}},[R,F]),pe=o.useCallback(()=>{N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),P.current?.disconnect(),P.current=null,I.current.clear(),F.setSnapshot(Vp)},[F]),me=o.useCallback((e,t,n)=>{t?(g.current.set(e,t),P.current?.observe(t),R(),y.current?.messageId===e&&ce()):n&&g.current.get(e)===n&&(g.current.delete(e),I.current.delete(e),P.current?.unobserve(n),R())},[ce,R]),he=o.useCallback(()=>{(_.current===`following-bottom`||_.current===`anchored-to-message`||_.current===`settling-jump`)&&(s.current=null,_.current=`free-scrolling`)},[]),ge=o.useCallback(()=>te(j.getSnapshot()),[j,te]),_e=hm(C,ge),ve=hm(M,ge),ye=o.useCallback(e=>{d.current=e},[]),be=o.useCallback(e=>{k.current=e,D.current=im(e?.parentElement??null)},[]),xe=o.useCallback(()=>{re(),R(),se()},[se,re,R]),Se=o.useMemo(()=>({handleContentChange:ue,handleResize:de,observeVisibility:fe,pendingDefaultScrollStore:S,preserveScrollOnPrependRef:x,scrollToEnd:V,scrollToMessage:H,scrollToStart:oe,setContentElement:ye,setRootElement:_e,setSpacerElement:be,setViewportElement:ve,stateStore:j,syncAfterScroll:xe,unobserveVisibility:pe,userScrollIntent:he,viewportRef:M,visibilityStore:F}),[ue,de,fe,S,V,H,oe,ye,_e,be,ve,j,xe,pe,he,F]);return o.useLayoutEffect(()=>{le()||m.current===0&&fm(a)},[le]),o.useEffect(()=>()=>{A.current!==null&&(window.cancelAnimationFrame(A.current),A.current=null),N.current!==null&&(window.cancelAnimationFrame(N.current),N.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null),v.current!==null&&(window.cancelAnimationFrame(v.current),v.current=null),P.current?.disconnect(),P.current=null},[]),o.useLayoutEffect(()=>{e&&_.current===`following-bottom`&&m.current>0?V({behavior:`auto`}):re()},[e,re,V]),{context:Se,registerMessage:me}}function _m(e){let t=o.useRef(e);return t.current=e,t}var vm=o.createContext(null),ym=o.createContext(null);function bm(){let e=o.useContext(vm);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function xm(){let e=o.useContext(ym);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function Sm(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=bm();return o.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])}function Cm(){let{stateStore:e}=bm();return o.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function wm({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=gm({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,q.jsx)(vm.Provider,{value:o,children:(0,q.jsx)(ym.Provider,{value:s,children:t})})}function Tm(){let{pendingDefaultScrollStore:e}=bm();return o.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Em({children:e,...t}){let{setRootElement:n}=bm(),r=Tm();return(0,q.jsx)(`div`,{ref:n,...t,...r?{"data-pending-scroll":``}:null,children:e})}function Dm({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:i,onWheel:a,preserveScrollOnPrepend:s=!0,ref:c,role:l,tabIndex:u,...d}){let{handleResize:f,preserveScrollOnPrependRef:p,setViewportElement:m,syncAfterScroll:h,userScrollIntent:g,viewportRef:_}=bm(),v=Tm();p.current=s;let y=o.useCallback(e=>{m(e),Np(c)?.(e)},[c,m]);function b(e){h(),r?.(e)}function x(e){g(),a?.(e)}function S(e){g(),i?.(e)}function C(e){zp.has(e.key)&&g(),n?.(e)}return o.useEffect(()=>{let e=_.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(f)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[f,_]),(0,q.jsx)(`div`,{ref:y,role:l??`region`,"aria-label":e??`Messages`,tabIndex:u??0,onKeyDown:C,onScroll:b,onTouchMove:S,onWheel:x,...d,...v?{"data-pending-scroll":``}:null,children:t})}function Om({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:s,handleResize:c,setContentElement:l,setSpacerElement:u}=bm(),d=o.useRef(null),f=o.useCallback(e=>{d.current=e,l(e),Np(n)?.(e)},[n,l]);return o.useLayoutEffect(()=>{let e=d.current;if(!e||(s(),typeof MutationObserver>`u`))return;let t=new MutationObserver(()=>{s()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[s]),o.useEffect(()=>{let e=d.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(c)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[c]),(0,q.jsxs)(`div`,{ref:f,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,q.jsx)(`div`,{ref:u,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function km({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=xm(),a=o.useRef(null),s=o.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),Np(t)?.(n)},[e,t,i]);return(0,q.jsx)(`div`,{ref:s,"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function Am({behavior:e=`smooth`,children:t,direction:n=`end`,onClick:r,render:i,tabIndex:a,type:s=`button`,...c}){let{scrollToEnd:l,scrollToStart:u,stateStore:d}=bm(),f=_m(r),p=o.useCallback(e=>d.subscribe(e),[d]),m=o.useCallback(()=>{let e=d.getSnapshot();return n===`start`?e.start:e.end},[n,d]),h=o.useSyncExternalStore(p,m,m),g=o.useCallback(t=>{h&&(f.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),n===`start`?u({behavior:e}):l({behavior:e})))},[e,n,h,f,l,u]);return Op({defaultTagName:`button`,props:kp({type:s,inert:!h,tabIndex:h?a:-1,children:t??(0,q.jsxs)(`span`,{children:[`Scroll to `,n]}),onClick:g},c),render:i,state:{active:h,direction:n},stateAttributesMapping:{active:e=>({"data-active":e?`true`:`false`})}})}var jm={Provider:wm,Root:Em,Viewport:Dm,Content:Om,Item:km,Button:Am};function Mm(e){return(0,q.jsx)(jm.Provider,{...e})}function Nm({className:e,...t}){return(0,q.jsx)(jm.Root,{"data-slot":`message-scroller`,className:K(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,e),...t})}function Pm({className:e,...t}){return(0,q.jsx)(jm.Viewport,{"data-slot":`message-scroller-viewport`,className:K(`size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible`,e),...t})}function Fm({className:e,...t}){return(0,q.jsx)(jm.Content,{"data-slot":`message-scroller-content`,className:K(`flex h-max min-h-full flex-col gap-8`,e),...t})}function Im({className:e,scrollAnchor:t=!1,...n}){return(0,q.jsx)(jm.Item,{"data-slot":`message-scroller-item`,scrollAnchor:t,className:K(`min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]`,e),...n})}function Lm({direction:e=`end`,className:t,children:n,render:r,variant:i=`secondary`,size:a=`icon-sm`,...o}){return(0,q.jsx)(jm.Button,{"data-slot":`message-scroller-button`,"data-direction":e,"data-variant":i,"data-size":a,direction:e,className:K(`absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180`,t),render:r??(0,q.jsx)(bd,{variant:i,size:a}),...o,children:n??(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Sd,{icon:Td,strokeWidth:2}),(0,q.jsx)(`span`,{className:`sr-only`,children:e===`end`?`Scroll to end`:`Scroll to start`})]})})}function Rm({className:e,...t}){return(0,q.jsx)(Sd,{icon:Hd,strokeWidth:2,"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:K(`size-4 animate-spin`,e),...t})}function zm(e){let t=globalThis.navigator?.clipboard;t?t.writeText(e).catch(e=>console.error(`copying the command failed:`,e)):console.error(`copying needs the clipboard, which this page cannot reach`)}function Bm({command:e,icon:t}){return(0,q.jsxs)(`span`,{className:`ui-cmd`,children:[t&&(0,q.jsx)(X,{icon:t,size:16,className:`ui-ic ui-ic16`}),(0,q.jsx)(`code`,{children:e}),(0,q.jsxs)(bd,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>zm(e),children:[(0,q.jsx)(X,{icon:Fd,"data-icon":`inline-start`}),`Copy`]})]})}var Vm=(0,o.createContext)(null),Hm=null,Um=new Set;function Wm(e){Hm=c(e);for(let e of Um)e()}var Gm=e=>e.split("`").map((e,t)=>t%2==1?(0,q.jsx)(`code`,{children:e},t):e),Km={text:``,outgoing:[]};function qm({store:e,target:t,where:n,to:r}){let i=c(t),a=Ye(e,e=>e.post),s=Ye(e,e=>e.drafts[i])??Km,l=(0,o.useContext)(Vm),u=Ef().isMobile,f=(0,o.useRef)(null),m=()=>f.current;if((0,o.useLayoutEffect)(()=>{let e=()=>{Hm===i&&(Hm=null,m()?.focus())};return e(),Um.add(e),()=>void Um.delete(e)},[i,a]),a===null)return null;if(a.mode===`off`)return(0,q.jsxs)(up,{children:[(0,q.jsxs)(hp,{"aria-disabled":`true`,children:[(0,q.jsxs)(_p,{align:`block-start`,children:[(0,q.jsx)(X,{icon:Yd}),(0,q.jsx)(bp,{children:a.reason===`This dashboard was started with --creds, which can only read.`?Gm("This dashboard was started with `--creds`, which can only read."):a.reason})]}),(0,q.jsxs)(_p,{align:`block-end`,className:`min-w-0`,children:[(0,q.jsx)(Bm,{command:p(t)}),(0,q.jsxs)(gf,{children:[(0,q.jsx)(_f,{asChild:!0,children:(0,q.jsx)(`span`,{className:`inline-flex shrink-0`,tabIndex:0,children:(0,q.jsx)(yp,{variant:`default`,size:`icon-xs`,disabled:!0,"aria-label":`Send`,children:(0,q.jsx)(X,{icon:Dd})})})}),(0,q.jsx)(vf,{children:a.reason})]})]})]}),(0,q.jsx)(fp,{className:`truncate`,children:Gm(d(a))})]});let h=s.outgoing.some(e=>e.id===void 0),g=s.refused,_=l!==null&&!h&&s.text.trim()!==``,v=()=>{_&&l.send(t,s.text).catch(()=>void 0)},y=(0,q.jsxs)(yp,{size:u?`icon-xs`:`xs`,disabled:l===null,onClick:()=>{l?.draft(t,`${s.text}@`),m()?.focus()},"aria-label":u?`Mention`:void 0,children:[(0,q.jsx)(X,{icon:kd,"data-icon":u?void 0:`inline-start`}),!u&&`Mention`]});return(0,q.jsxs)(up,{"data-invalid":g!==void 0,children:[(0,q.jsxs)(hp,{children:[(0,q.jsx)(xp,{ref:f,className:`max-h-48`,placeholder:`Message ${n}`,"aria-label":`Message ${n}`,"aria-invalid":g!==void 0,value:s.text,readOnly:l===null,onChange:e=>l?.draft(t,e.currentTarget.value),onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),v())}}),(0,q.jsx)(_p,{align:`block-end`,children:g===void 0?(0,q.jsxs)(q.Fragment,{children:[u?(0,q.jsxs)(gf,{children:[(0,q.jsx)(_f,{asChild:!0,children:(0,q.jsx)(`span`,{className:`inline-flex`,tabIndex:l===null?0:void 0,children:y})}),(0,q.jsx)(vf,{children:`Mention`})]}):y,(0,q.jsxs)(bp,{className:`ml-auto min-w-0`,children:[(0,q.jsx)(`i`,{className:`ui-mode-dot`,style:{background:t.kind===`msg`?`var(--multi)`:`var(--uni)`}}),(0,q.jsx)(`span`,{className:`truncate`,children:r})]}),!u&&(0,q.jsx)(bp,{children:`as operator`}),(0,q.jsxs)(gf,{children:[(0,q.jsx)(_f,{asChild:!0,children:(0,q.jsx)(`span`,{className:`inline-flex`,tabIndex:_?void 0:0,children:(0,q.jsx)(yp,{variant:`default`,size:`icon-xs`,"aria-label":h?`Sending`:`Send`,disabled:!_,onClick:v,children:h?(0,q.jsx)(Rm,{}):(0,q.jsx)(X,{icon:Dd})})})}),(0,q.jsx)(vf,{children:h?`Sending`:`Send`})]})]}):(0,q.jsx)(yp,{variant:`outline`,size:`sm`,className:`ml-auto`,disabled:!_,onClick:v,children:`Try again`})})]}),g===void 0?(0,q.jsx)(fp,{className:`truncate`,children:Gm(d(a))}):(0,q.jsxs)(gf,{children:[(0,q.jsx)(_f,{asChild:!0,children:(0,q.jsx)(pp,{className:`truncate`,children:g})}),(0,q.jsx)(vf,{children:g})]})]})}function Jm({store:e,target:t,shown:n}){let r=Ye(e,e=>e.drafts[c(t)])??Km;return(0,q.jsx)(q.Fragment,{children:r.outgoing.filter(e=>e.id===void 0||!n.has(e.id)).map(e=>{let t=new Date(e.ts),n=e.id===void 0;return(0,q.jsx)(Im,{children:(0,q.jsxs)(Cp,{align:`end`,children:[(0,q.jsx)(wp,{children:(0,q.jsx)(rp,{children:(0,q.jsx)(ip,{children:`OP`})})}),(0,q.jsxs)(Tp,{children:[(0,q.jsxs)(Ep,{className:`gap-2`,children:[(0,q.jsx)(`span`,{children:`operator`}),(0,q.jsx)(np,{variant:`secondary`,children:`operator`}),(0,q.jsx)(`time`,{dateTime:t.toISOString(),children:O(t)}),n&&(0,q.jsx)(`span`,{children:`sending`})]}),(0,q.jsx)(op,{variant:n?`muted`:`default`,children:(0,q.jsx)(sp,{className:`whitespace-pre-wrap`,children:e.text})})]})]})},e.seq)})})}function Ym({peer:e,name:t,selfId:n}){return(0,q.jsxs)(hp,{children:[(0,q.jsx)(_p,{align:`block-start`,children:(0,q.jsx)(bp,{children:`This conversation is between two agents.`})}),(0,q.jsx)(_p,{align:`block-end`,children:(0,q.jsx)(yp,{asChild:!0,variant:`outline`,size:`sm`,className:`ml-auto`,children:(0,q.jsx)(`a`,{href:De(m(e,n)),onClick:()=>Wm({kind:`dm`,to:e}),children:`Message ${t}`})})})]})}function Xm(e){let t=e.snapshot;return t!==void 0&&(t.asOf!==void 0||Array.isArray(t.members)&&t.members.length>0)}function Zm(e,t){if(e.unreadable!==void 0)return`unreadable`;if(!Xm(e))return`traffic-only`;let n=e.snapshot.asOf;return(n?t-n:1/0)<45e3?`live`:`stale`}function Qm(e){return Xm(e)&&e.unreadable===void 0}var $m=e=>e.split(`.`).some(e=>e===`*`||e===`>`);function eh(e,t){let n=e.split(`.`),r=t.split(`.`);for(let e=0;e<n.length;e++){if(n[e]===`>`)return e<r.length;if(e>=r.length||n[e]!==`*`&&n[e]!==r[e])return!1}return n.length===r.length}function th(e,t,n,r=[]){let i=new Map,a=!1;for(let t of e)if(t===`>`||t===`*`)a=!0;else if($m(t))for(let e of n)eh(t,e)&&i.set(e,`live`);else i.set(t,`live`);for(let e of t)if($m(e))for(let t of r)!i.has(t)&&eh(e,t)&&i.set(t,`durable`);else i.has(e)||i.set(e,`durable`);return{channels:i,wide:a}}function nh(e,t,n,r){let i=new Set,a=[],o=(e,t)=>{e&&!i.has(e)&&(i.add(e),a.push({id:e,source:t}))};if(Qm(t)){let r=[...n,e];for(let n of t.snapshot.members){let{channels:t,wide:i}=th(n.live??[],n.durable??[],r);(i||t.has(e))&&o(n.id,`membership`)}return a}for(let t of r)t.msg.channel===e&&o(t.senderId??t.msg.from.id,`traffic`);return a}function rh(e,t,n,r,i){let a=new Set,o=!1;if(Qm(t)){let r=t.snapshot.members.find(t=>t.id===e);if(r){let e=th(r.live??[],r.durable??[],n);o=e.wide;for(let t of e.channels.keys())a.add(t)}}else for(let t of r)(t.senderId??t.msg.from?.id)===e&&typeof t.msg.channel==`string`&&a.add(t.msg.channel);let s=new Map;for(let[e,t]of Object.entries(i??{}))(t===`quiet`||t===`muted`)&&s.set(e,t);for(let e of s.keys())a.add(e);return{channels:[...a].sort().map(e=>s.has(e)?{channel:e,mode:s.get(e)}:{channel:e}),wide:o}}function ih({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty`,className:K(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-3xl border-dashed p-12 text-center text-balance`,e),...t})}function ah({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-header`,className:K(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var oh=vd(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-foreground [&_svg:not([class*='size-'])]:size-5`}},defaultVariants:{variant:`default`}});function sh({className:e,variant:t=`default`,...n}){return(0,q.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:K(oh({variant:t,className:e})),...n})}function ch({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-title`,className:K(`text-lg font-medium tracking-tight`,e),...t})}function lh({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-description`,className:K(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function uh({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`empty-content`,className:K(`flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance`,e),...t})}var dh=26;function fh({letter:e,slot:t,size:n,offline:r}){let i=n<dh,a=[`ui-idb`,[...e].length>1&&`ui-idb-2`,i&&`ui-idb-dot`,r&&`ui-idb-off`].filter(Boolean).join(` `);return(0,q.jsx)(`i`,{className:a,style:{"--bf":`var(--id-${t})`},"aria-hidden":`true`,children:i?null:e})}var ph={waiting:zd,working:Hd,idle:Wd,offline:Qd},mh=e=>e.charAt(0).toUpperCase()+e.slice(1);function hh({status:e}){return(0,q.jsx)(`i`,{className:`ui-st ui-st-${e}`,role:`img`,"aria-label":mh(e)})}var gh=(e,t)=>e===`working`?`${t} ox-spin`:t,_h={waiting:`default`,working:`secondary`,idle:`outline`,offline:`outline`};function vh({row:e}){let t=Object.hasOwn(ph,e.status)?ph[e.status]:void 0,n=Object.hasOwn(_h,e.status)?_h[e.status]:`outline`;return(0,q.jsxs)(np,{variant:n,children:[t&&(0,q.jsx)(X,{icon:t,"data-icon":`inline-start`,className:e.status===`working`?`ox-spin`:void 0}),mh(qe(e))]})}var yh={"claude-code":`claude`,claude:`claude`,opencode:`opencode`,codex:`codex`,hermes:`hermes`,pi:`pi`},bh=`guest`,xh={working:{look:`down`},waiting:{mood:`surprised`,look:`up`}};function Sh(e,t){return Zf(e!==void 0&&Object.hasOwn(yh,e)?yh[e]:bh,Object.hasOwn(xh,t)?xh[t]:{})}function Ch({vendor:e,status:t,size:n,badge:r,dot:i=!0}){return(0,q.jsxs)(`span`,{className:t===`offline`?`ui-av ui-av-off`:`ui-av`,style:{"--s":`${n}px`},children:[(0,q.jsx)(`svg`,{viewBox:`-2 -4 112 112`,"aria-hidden":`true`,dangerouslySetInnerHTML:{__html:Sh(e,t)}}),r&&(0,q.jsx)(fh,{letter:r.letter,slot:r.slot,size:n,offline:t===`offline`}),i&&(0,q.jsx)(hh,{status:t})]})}var wh=8;function Th(e){let t=[...e][0];if(t===void 0)return``;let n=/_(\d+)$/.exec(e);return t.toUpperCase()+(n?n[1]:``)}function Eh(e){let[t,...n]=[...e];if(t===void 0)return``;let r=n.find(e=>/\p{L}/u.test(e))??``,i=/_(\d+)$/.exec(e);return t.toUpperCase()+r+(i?i[1]:``)}function Dh(e){let t=new Map;for(let n of e)n.status!==`offline`&&t.set(Th(n.name),(t.get(Th(n.name))??0)+1);let n=new Map;for(let r of e){let e=Th(r.name);n.set(r.id,r.status!==`offline`&&(t.get(e)??0)>1?Eh(r.name):e)}return n}function Oh(e){let t=7;for(let n of e)t=Math.imul(t,31)+n.charCodeAt(0)>>>0;return t%wh+1}var kh=(e,t)=>e.name<t.name?-1:e.name>t.name?1:e.id<t.id?-1:+(e.id>t.id);function Ah(e){let t=new Map,n=new Set,r=e.filter(e=>e.status!==`offline`).sort(kh);for(let e of r){let r=Oh(e.name);if(n.size<wh)for(;n.has(r);)r=r%wh+1;n.add(r),t.set(e.id,r)}for(let n of e)n.status===`offline`&&t.set(n.id,Oh(n.name));return t}var jh=(0,o.createContext)(()=>void 0);function Mh(){return(0,o.useContext)(jh)}function Nh(e){let t=Ah(e),n=Dh(e),r=new Map;for(let i of e){let e=t.get(i.id);e!==void 0&&r.set(i.id,{letter:n.get(i.id)??``,slot:e})}return e=>r.get(e)}var Ph={claude:{label:`Claude Code`,color:`#d97757`,glyph:`◆`,svg:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"/></svg>`},opencode:{label:`OpenCode`,color:`#cdd6e0`,glyph:`▣`,svg:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M22 24H2V0h20zM17 4.8H7v14.4h10z"/></svg>`},codex:{label:`Codex`,color:`#e5e7eb`,glyph:`◉`,svg:`<svg viewBox="0 0 24 24" fill="currentColor"><path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"/></svg>`},hermes:{label:`Hermes`,color:`#a78bfa`,glyph:`➤`,svg:`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 3 3 10.5l7 2.5 2.5 7L21 3Z"/><path d="M21 3 10 13"/></svg>`},jcode:{label:`Jcode`,color:`#4ade80`,glyph:`⟨⟩`,svg:`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 4 3 12l5 8"/><path d="m16 4 5 8-5 8"/></svg>`},pi:{label:`Pi`,color:`#7dd3fc`,glyph:`π`,svg:`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h16"/><path d="M9 7v12"/><path d="M15 7v12c0 1.5 1.5 2 3 1"/></svg>`}};function Fh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ih(e){if(Array.isArray(e))return e}function Lh(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Rh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
43
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zh(e,t){return Ih(e)||Lh(e,t)||Bh(e,t)||Rh()}function Bh(e,t){if(e){if(typeof e==`string`)return Fh(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fh(e,t):void 0}}var Vh=Object.entries,Hh=Object.setPrototypeOf,Uh=Object.isFrozen,Wh=Object.getPrototypeOf,Gh=Object.getOwnPropertyDescriptor,Kh=Object.freeze,qh=Object.seal,Jh=Object.create,Yh=typeof Reflect<`u`&&Reflect,Xh=Yh.apply,Zh=Yh.construct;Kh||=function(e){return e},qh||=function(e){return e},Xh||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Zh||=function(e){return new e(...[...arguments].slice(1))};var Qh=vg(Array.prototype.forEach),$h=vg(Array.prototype.lastIndexOf),eg=vg(Array.prototype.pop),tg=vg(Array.prototype.push),ng=vg(Array.prototype.splice),rg=Array.isArray,ig=vg(String.prototype.toLowerCase),ag=vg(String.prototype.toString),og=vg(String.prototype.match),sg=vg(String.prototype.replace),cg=vg(String.prototype.indexOf),lg=vg(String.prototype.trim),ug=vg(Number.prototype.toString),dg=vg(Boolean.prototype.toString),fg=typeof BigInt>`u`?null:vg(BigInt.prototype.toString),pg=typeof Symbol>`u`?null:vg(Symbol.prototype.toString),mg=vg(Object.prototype.hasOwnProperty),hg=vg(Object.prototype.toString),gg=vg(RegExp.prototype.test),_g=yg(TypeError);function vg(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Xh(e,t,n)}}function yg(e){return function(){return Zh(e,[...arguments])}}function Z(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ig;if(Hh&&Hh(e,null),!rg(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Uh(t)||(t[r]=e),i=e)}e[i]=!0}return e}function bg(e){for(let t=0;t<e.length;t++)mg(e,t)||(e[t]=null);return e}function xg(e){let t=Jh(null);for(let r of Vh(e)){var n=zh(r,2);let i=n[0],a=n[1];mg(e,i)&&(t[i]=rg(a)?bg(a):a&&typeof a==`object`&&a.constructor===Object?xg(a):a)}return t}function Sg(e){switch(typeof e){case`string`:return e;case`number`:return ug(e);case`boolean`:return dg(e);case`bigint`:return fg?fg(e):`0`;case`symbol`:return pg?pg(e):`Symbol()`;case`undefined`:return hg(e);case`function`:case`object`:{if(e===null)return hg(e);let t=e,n=Cg(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:hg(e)}return hg(e)}default:return hg(e)}}function Cg(e,t){for(;e!==null;){let n=Gh(e,t);if(n){if(n.get)return vg(n.get);if(typeof n.value==`function`)return vg(n.value)}e=Wh(e)}function n(){return null}return n}function wg(e){try{return gg(e,``),!0}catch{return!1}}var Tg=Kh(`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.search.section.select.shadow.slot.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`.split(`.`)),Eg=Kh(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Dg=Kh([`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`]),Og=Kh([`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`]),kg=Kh(`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`.split(`.`)),Ag=Kh([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),jg=Kh([`#text`]),Mg=Kh(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.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.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Ng=Kh(`accent-height.accumulate.additive.alignment-baseline.amplitude.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.dominant-baseline.dur.edgemode.elevation.end.exponent.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.intercept.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.mask-type.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.slope.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.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.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`.split(`.`)),Pg=Kh(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.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`.split(`.`)),Fg=Kh([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Ig=qh(/{{[\w\W]*|^[\w\W]*}}/g),Lg=qh(/<%[\w\W]*|^[\w\W]*%>/g),Rg=qh(/\${[\w\W]*/g),zg=qh(/^data-[\-\w.\u00B7-\uFFFF]+$/),Bg=qh(/^aria-[\-\w]+$/),Vg=qh(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hg=qh(/^(?:\w+script|data):/i),Ug=qh(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Wg=qh(/^html$/i),Gg=qh(/^[a-z][.\w]*(-[.\w]+)+$/i),Kg=qh(/<[/\w!]/g),qg=qh(/<[/\w]/g),Jg=qh(/<\/no(script|embed|frames)/i),Yg=qh(/\/>/i),Xg={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Zg=function(){return typeof window>`u`?null:window},Qg=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},$g=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},e_=function(e,t,n,r){return mg(e,t)&&rg(e[t])?Z(r.base?xg(r.base):{},e[t],r.transform):n};function t_(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Zg(),t=e=>t_(e);if(t.version=`3.4.12`,t.removed=[],!e||!e.document||e.document.nodeType!==Xg.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Cg(d,`cloneNode`),p=Cg(d,`remove`),m=Cg(d,`nextSibling`),h=Cg(d,`childNodes`),g=Cg(d,`parentNode`),_=Cg(d,`shadowRoot`),v=Cg(d,`attributes`),y=o&&o.prototype?Cg(o.prototype,`nodeType`):null,b=o&&o.prototype?Cg(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C,w=!1,T=0,E=function(){if(T>0)throw _g(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},D=function(e){E(),T++;try{return x.createHTML(e)}finally{T--}},O=function(e){E(),T++;try{return x.createScriptURL(e)}finally{T--}},k=function(){return w||=(C=Qg(u,i),!0),C},A=n,j=A.implementation,M=A.createNodeIterator,N=A.createDocumentFragment,P=A.getElementsByTagName,F=r.importNode,I=$g();t.isSupported=typeof Vh==`function`&&typeof g==`function`&&j&&j.createHTMLDocument!==void 0;let ee=Ig,L=Lg,te=Rg,ne=zg,re=Bg,ie=Hg,R=Ug,z=Gg,ae=Vg,B=null,V=Z({},[...Tg,...Eg,...Dg,...kg,...jg]),H=null,oe=Z({},[...Mg,...Ng,...Pg,...Fg]),U=Object.seal(Jh(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}})),se=null,ce=null,le=Object.seal(Jh(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ue=!0,de=!0,fe=!1,pe=!0,me=!1,he=!0,ge=!1,_e=!1,ve=null,ye=null,be=!1,xe=!1,Se=!1,Ce=!1,we=!0,Te=!1,Ee=`user-content-`,De=!0,Oe=!1,ke={},Ae=null,je=Z({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Me=null,Ne=Z({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Pe=null,Fe=Z({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ie=`http://www.w3.org/1998/Math/MathML`,Le=`http://www.w3.org/2000/svg`,Re=`http://www.w3.org/1999/xhtml`,ze=Re,Be=!1,Ve=null,He=Z({},[Ie,Le,Re],ag),Ue=Kh([`mi`,`mo`,`mn`,`ms`,`mtext`]),We=Z({},Ue),Ge=Kh([`annotation-xml`]),Ke=Z({},Ge),qe=Z({},[`title`,`style`,`font`,`a`,`script`]),Je=null,Ye=[`application/xhtml+xml`,`text/html`],W=null,G=null,Xe=n.createElement(`form`),Ze=function(e){return e instanceof RegExp||e instanceof Function},Qe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(G&&G===e)return;e&&typeof e==`object`||(e={}),e=xg(e),Je=Ye.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,W=Je===`application/xhtml+xml`?ag:ig,B=e_(e,`ALLOWED_TAGS`,V,{transform:W}),H=e_(e,`ALLOWED_ATTR`,oe,{transform:W}),Ve=e_(e,`ALLOWED_NAMESPACES`,He,{transform:ag}),Pe=e_(e,`ADD_URI_SAFE_ATTR`,Fe,{transform:W,base:Fe}),Me=e_(e,`ADD_DATA_URI_TAGS`,Ne,{transform:W,base:Ne}),Ae=e_(e,`FORBID_CONTENTS`,je,{transform:W}),se=e_(e,`FORBID_TAGS`,xg({}),{transform:W}),ce=e_(e,`FORBID_ATTR`,xg({}),{transform:W}),ke=mg(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?xg(e.USE_PROFILES):e.USE_PROFILES:!1,ue=e.ALLOW_ARIA_ATTR!==!1,de=e.ALLOW_DATA_ATTR!==!1,fe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,me=e.SAFE_FOR_TEMPLATES||!1,he=e.SAFE_FOR_XML!==!1,ge=e.WHOLE_DOCUMENT||!1,xe=e.RETURN_DOM||!1,Se=e.RETURN_DOM_FRAGMENT||!1,Ce=e.RETURN_TRUSTED_TYPE||!1,be=e.FORCE_BODY||!1,we=e.SANITIZE_DOM!==!1,Te=e.SANITIZE_NAMED_PROPS||!1,De=e.KEEP_CONTENT!==!1,Oe=e.IN_PLACE||!1,ae=wg(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Vg,ze=typeof e.NAMESPACE==`string`?e.NAMESPACE:Re,We=mg(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?xg(e.MATHML_TEXT_INTEGRATION_POINTS):Z({},Ue),Ke=mg(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?xg(e.HTML_INTEGRATION_POINTS):Z({},Ge);let t=mg(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?xg(e.CUSTOM_ELEMENT_HANDLING):Jh(null);if(U=Jh(null),mg(t,`tagNameCheck`)&&Ze(t.tagNameCheck)&&(U.tagNameCheck=t.tagNameCheck),mg(t,`attributeNameCheck`)&&Ze(t.attributeNameCheck)&&(U.attributeNameCheck=t.attributeNameCheck),mg(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(U.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),qh(U),me&&(de=!1),Se&&(xe=!0),ke&&(B=Z({},jg),H=Jh(null),ke.html===!0&&(Z(B,Tg),Z(H,Mg)),ke.svg===!0&&(Z(B,Eg),Z(H,Ng),Z(H,Fg)),ke.svgFilters===!0&&(Z(B,Dg),Z(H,Ng),Z(H,Fg)),ke.mathMl===!0&&(Z(B,kg),Z(H,Pg),Z(H,Fg))),le.tagCheck=null,le.attributeCheck=null,mg(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?le.tagCheck=e.ADD_TAGS:rg(e.ADD_TAGS)&&(B===V&&(B=xg(B)),Z(B,e.ADD_TAGS,W))),mg(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?le.attributeCheck=e.ADD_ATTR:rg(e.ADD_ATTR)&&(H===oe&&(H=xg(H)),Z(H,e.ADD_ATTR,W))),mg(e,`ADD_URI_SAFE_ATTR`)&&rg(e.ADD_URI_SAFE_ATTR)&&Z(Pe,e.ADD_URI_SAFE_ATTR,W),mg(e,`FORBID_CONTENTS`)&&rg(e.FORBID_CONTENTS)&&(Ae===je&&(Ae=xg(Ae)),Z(Ae,e.FORBID_CONTENTS,W)),mg(e,`ADD_FORBID_CONTENTS`)&&rg(e.ADD_FORBID_CONTENTS)&&(Ae===je&&(Ae=xg(Ae)),Z(Ae,e.ADD_FORBID_CONTENTS,W)),De&&(B[`#text`]=!0),ge&&Z(B,[`html`,`head`,`body`]),B.table&&(Z(B,[`tbody`]),delete se.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw _g(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw _g(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=D(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=k()),x&&typeof S==`string`&&(S=D(``)));Kh&&Kh(e),G=e},$e=Z({},[...Eg,...Dg,...Og]),et=Z({},[...kg,...Ag]),tt=function(e,t,n){return t.namespaceURI===Re?e===`svg`:t.namespaceURI===Ie?e===`svg`&&(n===`annotation-xml`||We[n]):!!$e[e]},nt=function(e,t,n){return t.namespaceURI===Re?e===`math`:t.namespaceURI===Le?e===`math`&&Ke[n]:!!et[e]},rt=function(e,t,n){return t.namespaceURI===Le&&!Ke[n]||t.namespaceURI===Ie&&!We[n]?!1:!et[e]&&(qe[e]||!$e[e])},it=function(e){let t=g(e);t&&t.tagName||(t={namespaceURI:ze,tagName:`template`});let n=ig(e.tagName),r=ig(t.tagName);return Ve[e.namespaceURI]?e.namespaceURI===Le?tt(n,t,r):e.namespaceURI===Ie?nt(n,t,r):e.namespaceURI===Re?rt(n,t,r):!!(Je===`application/xhtml+xml`&&Ve[e.namespaceURI]):!1},at=function(e){tg(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw _g(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},ot=function(e){lt(e);let t=h(e);if(t){let e=[];Qh(t,t=>{tg(e,t)}),Qh(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},st=function(e,n){try{tg(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{tg(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`){if(xe||Se)try{at(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},ct=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||H[W(i)]))try{e.removeAttribute(i)}catch{}}},lt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===Xg.element&&ct(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},ut=function(e){if(!he)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=y?y(e):e.nodeType;if(n===Xg.processingInstruction||n===Xg.comment&&gg(qg,e.data)){try{p(e)}catch{}continue}if(n===Xg.element){let t=e,n=W(b?b(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},dt=function(e){let t=null,r=null;if(be)e=`<remove></remove>`+e;else{let t=og(e,/^[\r\n\t ]+/);r=t&&t[0]}Je===`application/xhtml+xml`&&ze===Re&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?D(e):e;if(ze===Re)try{t=new l().parseFromString(i,Je)}catch{}if(!t||!t.documentElement){t=j.createDocument(ze,`template`,null);try{t.documentElement.innerHTML=Be?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),ze===Re?P.call(t,ge?`html`:`body`)[0]:ge?t.documentElement:a},ft=function(e){return M.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},pt=function(e){return e=sg(e,ee,` `),e=sg(e,L,` `),e=sg(e,te,` `),e},mt=function(e){e.normalize();let t=M.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=pt(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&Qh(r,e=>{gt(e.content)&&mt(e.content)})},ht=function(e){let t=b?b(e):null;return typeof t!=`string`||W(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},gt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===Xg.documentFragment}catch{return!1}},_t=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function vt(e,n,r){e.length!==0&&Qh(e,e=>{e.call(t,n,r,G)})}let yt=function(e,t){return!!(he&&e.hasChildNodes()&&!_t(e.firstElementChild)&&gg(Kg,e.textContent)&&gg(Kg,e.innerHTML)||he&&e.namespaceURI===Re&&t===`style`&&_t(e.firstElementChild)||e.nodeType===Xg.processingInstruction||he&&e.nodeType===Xg.comment&&gg(qg,e.data))},bt=function(e,t){if(!se[t]&&wt(t)&&(U.tagNameCheck instanceof RegExp&&gg(U.tagNameCheck,t)||U.tagNameCheck instanceof Function&&U.tagNameCheck(t)))return!1;if(De&&!Ae[t]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=Oe?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return at(e),!0},xt=function(e,n){if(vt(I.beforeSanitizeElements,e,null),e!==n&&g(e)===null)return!0;if(ht(e))return at(e),!0;let r=W(b?b(e):e.nodeName);if(vt(I.uponSanitizeElement,e,{tagName:r,allowedTags:B}),e!==n&&g(e)===null)return!0;if(yt(e,r))return at(e),!0;if(se[r]||!(le.tagCheck instanceof Function&&le.tagCheck(r))&&!B[r]){let t=bt(e,r);return t===!1&&vt(I.afterSanitizeElements,e,null),t}if((y?y(e):e.nodeType)===Xg.element&&!it(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&gg(Jg,e.innerHTML))return at(e),!0;if(me&&e.nodeType===Xg.text){let n=pt(e.textContent);e.textContent!==n&&(tg(t.removed,{element:e.cloneNode()}),e.textContent=n)}return vt(I.afterSanitizeElements,e,null),!1},St=function(e,t,r){if(ce[t]||he&&t===`patchsrc`||he&&t===`for`&&e!==`label`&&e!==`output`||we&&(t===`id`||t===`name`)&&(r in n||r in Xe))return!1;let i=H[t]||le.attributeCheck instanceof Function&&le.attributeCheck(t,e);if(!(de&&gg(ne,t))&&!(ue&&gg(re,t))){if(!i){if(!(wt(e)&&(U.tagNameCheck instanceof RegExp&&gg(U.tagNameCheck,e)||U.tagNameCheck instanceof Function&&U.tagNameCheck(e))&&(U.attributeNameCheck instanceof RegExp&&gg(U.attributeNameCheck,t)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(t,e))||t===`is`&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&gg(U.tagNameCheck,r)||U.tagNameCheck instanceof Function&&U.tagNameCheck(r))))return!1}else if(!Pe[t]&&!gg(ae,sg(r,R,``))&&(t!==`src`&&t!==`xlink:href`&&t!==`href`||e===`script`||cg(r,`data:`)!==0||!Me[e])&&(!fe||gg(ie,sg(r,R,``)))&&r)return!1}return!0},Ct=Z({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),wt=function(e){return!Ct[ig(e)]&&gg(z,e)},Tt=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return D(r);case`TrustedScriptURL`:return O(r)}return r},Et=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),ht(e)?at(e):eg(t.removed)}catch{st(n,e)}},Dt=function(e){vt(I.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||ht(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0},r=t.length,i=W(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=W(o),u=c,d=o===`value`?u:lg(u);n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,vt(I.uponSanitizeAttribute,e,n),d=n.attrValue,Te&&(l===`id`||l===`name`)&&cg(d,Ee)!==0&&(st(o,e),d=Ee+d),he&&gg(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)||l===`attributename`&&og(d,`href`)?st(o,e):n.forceKeepAttr||(n.keepAttr?!pe&&gg(Yg,d)?st(o,e):(me&&(d=pt(d)),St(i,l,d)?(d=Tt(i,l,s,d),d!==u&&Et(e,o,s,d)):st(o,e)):st(o,e))}vt(I.afterSanitizeAttributes,e,null)},Ot=function(e){let t=null,n=ft(e);for(vt(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(vt(I.uponSanitizeShadowNode,t,null),xt(t,e),Dt(t),gt(t.content)&&Ot(t.content),(y?y(t):t.nodeType)===Xg.element){let e=_(t);gt(e)&&(kt(e),Ot(e))}vt(I.afterSanitizeShadowDOM,e,null)},kt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Ot(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===Xg.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&W(e)===`template`){let e=n.content;gt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);gt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Be=!e,Be&&(e=`<!-->`),typeof e!=`string`&&!_t(e)&&(e=Sg(e),typeof e!=`string`))throw _g(`dirty is not a string, aborting`);if(!t.isSupported)return e;_e?(B=ve,H=ye):Qe(n),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(B=xg(B)),I.uponSanitizeAttribute.length>0&&(H=xg(H)),t.removed=[];let c=Oe&&typeof e!=`string`&&_t(e);if(c){ut(e);let t=b?b(e):e.nodeName;if(typeof t==`string`){let n=W(t);if(!B[n]||se[n])throw ot(e),_g(`root node is forbidden and cannot be sanitized in-place`)}if(ht(e))throw ot(e),_g(`root node is clobbered and cannot be sanitized in-place`);try{kt(e)}catch(t){throw ot(e),t}}else if(_t(e))i=dt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Xg.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),kt(a);else{if(!xe&&!me&&!ge&&e.indexOf(`<`)===-1)return x&&Ce?D(e):e;if(i=dt(e),!i)return xe?null:Ce?S:``}i&&be&&at(i.firstChild);let l=c?e:i,u=ft(l);try{for(;o=u.nextNode();)xt(o,l),Dt(o),gt(o.content)&&Ot(o.content)}catch(n){throw c&&(ot(e),Qh(t.removed,e=>{e.element&&lt(e.element)})),n}if(c)return Qh(t.removed,e=>{e.element&&lt(e.element)}),me&&mt(e),e;if(xe){if(me&&mt(i),Se)for(s=N.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(H.shadowroot||H.shadowrootmode)&&(s=F.call(r,s,!0)),s}let d=ge?i.outerHTML:i.innerHTML;return ge&&B[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&gg(Wg,i.ownerDocument.doctype.name)&&(d=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
44
- `+d),me&&(d=pt(d)),x&&Ce?D(d):d},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qe(e),_e=!0,ve=B,ye=H},t.clearConfig=function(){G=null,_e=!1,ve=null,ye=null,x=C,S=``},t.isValidAttribute=function(e,t,n){G||Qe({});let r=W(e),i=W(t);return St(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&mg(I,e)&&tg(I[e],t)},t.removeHook=function(e,t){if(mg(I,e)){if(t!==void 0){let n=$h(I[e],t);return n===-1?void 0:ng(I[e],n,1)[0]}return eg(I[e])}},t.removeHooks=function(e){mg(I,e)&&(I[e]=[])},t.removeAllHooks=function(){I=$g()},t}var n_=t_();function r_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var i_=r_();function a_(e){i_=e}var o_={exec:()=>null};function s_(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Q(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(l_.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var c_=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),l_={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:s_(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:s_(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:s_(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:s_(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:s_(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:s_(e=>RegExp(`^ {0,${e}}>`))},u_=/^(?:[ \t]*(?:\n|$))+/,d_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,f_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,p_=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,m_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,h_=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,g_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,__=Q(g_).replace(/bull/g,h_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),v_=Q(g_).replace(/bull/g,h_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),y_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,b_=/^[^\n]+/,x_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,S_=Q(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,x_).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),C_=Q(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,h_).getRegex(),w_=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,T_=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,E_=Q(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n+|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n+|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n+|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,T_).replace(`tag`,w_).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),D_=e=>Q(y_).replace(`hr`,p_).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`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,w_).getRegex(),O_=D_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),k_=D_(/ {0,3}(?:[*+-]|\d{1,9}[.)])[ \t]+[^ \t\n]/),A_={blockquote:Q(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,k_).getRegex(),code:d_,def:S_,fences:f_,heading:m_,hr:p_,html:E_,lheading:__,list:C_,newline:u_,paragraph:O_,table:o_,text:b_},j_=Q(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,p_).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,w_).getRegex(),M_={...A_,lheading:v_,table:j_,paragraph:Q(y_).replace(`hr`,p_).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,j_).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,w_).getRegex()},N_={...A_,html:Q(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,T_).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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:o_,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Q(y_).replace(`hr`,p_).replace(`heading`,` *#{1,6} *[^
45
- ]`).replace(`lheading`,__).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},P_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,F_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,I_=/^( {2,}|\\)\n(?!\s*$)/,L_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,R_=/[\p{P}\p{S}]/u,z_=/[\s\p{P}\p{S}]/u,B_=/[^\s\p{P}\p{S}]/u,V_=Q(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,z_).getRegex(),H_=/(?!~)[\p{P}\p{S}]/u,U_=/(?!~)[\s\p{P}\p{S}]/u,W_=/(?:[^\s\p{P}\p{S}]|~)/u,G_=Q(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,c_?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),K_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,q_=Q(K_,`u`).replace(/punct/g,R_).getRegex(),J_=Q(K_,`u`).replace(/punct/g,H_).getRegex(),Y_=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,X_=Q(Y_,`gu`).replace(/notPunctSpace/g,B_).replace(/punctSpace/g,z_).replace(/punct/g,R_).getRegex(),Z_=Q(Y_,`gu`).replace(/notPunctSpace/g,W_).replace(/punctSpace/g,U_).replace(/punct/g,H_).getRegex(),Q_=Q(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,B_).replace(/punctSpace/g,z_).replace(/punct/g,R_).getRegex(),$_=Q(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,R_).getRegex(),ev=Q(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,B_).replace(/punctSpace/g,z_).replace(/punct/g,R_).getRegex(),tv=Q(/\\(punct)/,`gu`).replace(/punct/g,R_).getRegex(),nv=Q(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),rv=Q(T_).replace(`(?:-->|$)`,`-->`).getRegex(),iv=Q(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,rv).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),av=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ov=Q(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,av).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),sv=Q(/^!?\[(label)\]\[(ref)\]/).replace(`label`,av).replace(`ref`,x_).getRegex(),cv=Q(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,x_).getRegex(),lv=Q(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,sv).replace(`nolink`,cv).getRegex(),uv=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,dv={_backpedal:o_,anyPunctuation:tv,autolink:nv,blockSkip:G_,br:I_,code:F_,del:o_,delLDelim:o_,delRDelim:o_,emStrongLDelim:q_,emStrongRDelimAst:X_,emStrongRDelimUnd:Q_,escape:P_,link:ov,nolink:cv,punctuation:V_,reflink:sv,reflinkSearch:lv,tag:iv,text:L_,url:o_},fv={...dv,link:Q(/^!?\[(label)\]\((.*?)\)/).replace(`label`,av).getRegex(),reflink:Q(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,av).getRegex()},pv={...dv,emStrongRDelimAst:Z_,emStrongLDelim:J_,delLDelim:$_,delRDelim:ev,url:Q(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,uv).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Q(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,uv).getRegex()},mv={...pv,br:Q(I_).replace(`{2,}`,`*`).getRegex(),text:Q(pv.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},hv={normal:A_,gfm:M_,pedantic:N_},gv={normal:dv,gfm:pv,breaks:mv,pedantic:fv},_v={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},vv=e=>_v[e];function yv(e,t){if(t){if(l_.escapeTest.test(e))return e.replace(l_.escapeReplace,vv)}else if(l_.escapeTestNoEncode.test(e))return e.replace(l_.escapeReplaceNoEncode,vv);return e}function bv(e){try{e=encodeURI(e).replace(l_.percentDecode,`%`)}catch{return null}return e}function xv(e,t){let n=e.replace(l_.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(l_.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(l_.slashPipe,`|`);return n}function Sv(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Cv(e){let t=e.split(`
46
- `),n=t.length-1;for(;n>=0&&l_.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
47
- `)}function wv(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Tv(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Ev(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Dv(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
48
- `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
49
- `)}var Ov=class{options;rules;lexer;constructor(e){this.options=e||i_}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Cv(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Dv(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Sv(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Sv(t[0],`
50
- `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Sv(t[0],`
51
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Sv(t[0],`
52
- `).split(`
53
- `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
54
- `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
55
- $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
56
- ${s}`:s,r=r?`${r}
57
- ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
58
- `+e.join(`
59
- `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
60
- `+e.join(`
61
- `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
62
- `)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=Tv(t[2].split(`
63
- `,1)[0],t[1].length),l=e.split(`
64
- `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
65
- `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
66
- `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
67
- `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
68
- `+l}u=!l.trim(),r+=p+`
69
- `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1;if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Cv(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:Sv(t[0],`
70
- `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=xv(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
71
- `):[],a={type:`table`,raw:Sv(t[0],`
72
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(xv(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:Sv(t[0],`
73
- `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
74
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=Sv(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=wv(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Ev(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Ev(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},kv=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||i_,this.options.tokenizer=this.options.tokenizer||new Ov,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:l_,block:hv.normal,inline:gv.normal};this.options.pedantic?(t.block=hv.pedantic,t.inline=gv.pedantic):this.options.gfm&&(t.block=hv.gfm,t.inline=this.options.breaks?gv.breaks:gv.gfm),this.tokenizer.rules=t}static get rules(){return{block:hv,inline:gv}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(l_.carriageReturn,`
75
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(l_.tabCharGlobal,` `).replace(l_.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
76
- `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
77
- `)?``:`
78
- `)+i.raw,n.text+=`
79
- `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
80
- `)?``:`
81
- `)+i.raw,n.text+=`
82
- `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
83
- `)?``:`
84
- `)+i.raw,r.text+=`
85
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
86
- `)?``:`
87
- `)+i.raw,n.text+=`
88
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``,s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if((r=this.tokenizer.escape(e))||(r=this.tokenizer.tag(e))||(r=this.tokenizer.link(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if((r=this.tokenizer.emStrong(e,n,o))||(r=this.tokenizer.codespan(e))||(r=this.tokenizer.br(e))||(r=this.tokenizer.del(e,n,o))||(r=this.tokenizer.autolink(e))||!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},Av=class{options;parser;constructor(e){this.options=e||i_}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(l_.notSpaceStart)?.[0],i=e.replace(l_.endingNewline,``)+`
89
- `;return r?`<pre><code class="language-`+yv(r)+`">`+(n?i:yv(i,!0))+`</code></pre>
90
- `:`<pre><code>`+(n?i:yv(i,!0))+`</code></pre>
91
- `}blockquote({tokens:e}){return`<blockquote>
92
- ${this.parser.parse(e)}</blockquote>
93
- `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
94
- `}hr(e){return`<hr>
95
- `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
96
- `+r+`</`+i+`>
97
- `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
98
- `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
99
- `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
100
- <thead>
101
- `+t+`</thead>
102
- `+r+`</table>
103
- `}tablerow({text:e}){return`<tr>
104
- ${e}</tr>
105
- `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
106
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${yv(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=bv(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+yv(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=bv(e);if(i===null)return yv(n);e=i;let a=`<img src="${e}" alt="${yv(n)}"`;return t&&(a+=` title="${yv(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:yv(e.text)}},jv=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Mv=class e{options;renderer;textRenderer;constructor(e){this.options=e||i_,this.options.renderer=this.options.renderer||new Av,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new jv}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Nv=class{options;block;constructor(e){this.options=e||i_}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?kv.lex:kv.lexInline}provideParser(e=this.block){return e?Mv.parse:Mv.parseInline}},Pv=new class{defaults=r_();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Mv;Renderer=Av;TextRenderer=jv;Lexer=kv;Tokenizer=Ov;Hooks=Nv;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Av(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Ov(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Nv;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Nv.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Nv.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return kv.lex(e,t??this.defaults)}parser(e,t){return Mv.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?kv.lex:kv.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Mv.parse:Mv.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?kv.lex:kv.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Mv.parse:Mv.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
107
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+yv(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return Pv.parse(e,t)}$.options=$.setOptions=function(e){return Pv.setOptions(e),$.defaults=Pv.defaults,a_($.defaults),$},$.getDefaults=r_,$.defaults=i_,$.use=function(...e){return Pv.use(...e),$.defaults=Pv.defaults,a_($.defaults),$},$.walkTokens=function(e,t){return Pv.walkTokens(e,t)},$.parseInline=Pv.parseInline,$.Parser=Mv,$.parser=Mv.parse,$.Renderer=Av,$.TextRenderer=jv,$.Lexer=kv,$.lexer=kv.lex,$.Tokenizer=Ov,$.Hooks=Nv,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,Mv.parse,kv.lex,$.setOptions({gfm:!0,breaks:!0});var Fv={ALLOWED_TAGS:[`p`,`br`,`strong`,`em`,`del`,`code`,`pre`,`blockquote`,`ul`,`ol`,`li`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`a`,`hr`,`span`],ALLOWED_ATTR:[`href`,`title`,`target`,`rel`],ALLOWED_URI_REGEXP:/^(?:https?:|mailto:|#|\/)/i},Iv;function Lv(){if(Iv)return Iv;let e=n_();if(!e.isSupported)throw Error(`renderMarkdown: DOMPurify cannot sanitize in this environment (no usable DOM), so it refuses to render rather than return unsanitized HTML`);return e.addHook(`afterSanitizeAttributes`,e=>{let t=e;t.tagName===`A`&&t.getAttribute(`href`)&&(t.setAttribute(`target`,`_blank`),t.setAttribute(`rel`,`noopener noreferrer nofollow`))}),Iv=e}function Rv(e){return Lv().sanitize(e,Fv)}function zv(e){return e?Rv($.parse(String(e),{async:!1})):``}function Bv(e){let t=[],n=``,r=()=>{let e=zv(n);e&&t.push({kind:`html`,html:e}),n=``};for(let i of $.lexer(String(e)))i.type===`code`&&i.codeBlockStyle!==`indented`?(r(),t.push({kind:`code`,lang:String(i.lang??``).trim().split(/\s+/)[0]??``,text:String(i.text)})):n+=i.raw;return r(),t}function Vv({...e}){return(0,q.jsx)(Dr,{"data-slot":`collapsible`,...e})}function Hv({...e}){return(0,q.jsx)(kr,{"data-slot":`collapsible-trigger`,...e})}function Uv({...e}){return(0,q.jsx)(jr,{"data-slot":`collapsible-content`,...e})}function Wv(e,t){let n=(0,o.useRef)(t);n.current=t,(0,o.useEffect)(()=>{let t=e.current?.parentElement;if(!t)return;let r,i,a=!1,o,s=()=>{clearTimeout(r),r=void 0,i=void 0},c=e=>{a=!1,s(),e.pointerType===`touch`&&(i={id:e.pointerId,x:e.clientX,y:e.clientY},r=setTimeout(()=>{r=void 0,i=void 0,a=!0,n.current()},500))},l=e=>{i!==void 0&&e.pointerId===i.id&&Math.hypot(e.clientX-i.x,e.clientY-i.y)>8&&s()},u=e=>{i!==void 0&&e.pointerId===i.id&&s(),a&&(clearTimeout(o),o=setTimeout(()=>{a=!1},100))},d=e=>{a&&(a=!1,e.preventDefault(),e.stopPropagation())},f=e=>{(r!==void 0||a)&&e.preventDefault()};return t.addEventListener(`pointerdown`,c),t.addEventListener(`pointermove`,l),t.addEventListener(`pointerup`,u),t.addEventListener(`pointercancel`,u),t.addEventListener(`click`,d,!0),t.addEventListener(`contextmenu`,f),()=>{s(),clearTimeout(o),t.removeEventListener(`pointerdown`,c),t.removeEventListener(`pointermove`,l),t.removeEventListener(`pointerup`,u),t.removeEventListener(`pointercancel`,u),t.removeEventListener(`click`,d,!0),t.removeEventListener(`contextmenu`,f)}},[e])}function Gv({msg:e,senderId:t,name:n,peer:r,onViewAgent:i}){let[a,s]=(0,o.useState)(!1),c=(0,o.useRef)(null);Wv(c,()=>s(!0));let l=k(e.ts),u=De({view:`agent`,id:t,tab:`work`,at:e.id}),d=l?`View ${n}'s work at ${l}`:`View ${n}'s work`,f=(0,o.useId)();return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{ref:c,className:`ui-msg-acts`,children:[(0,q.jsxs)(gf,{children:[(0,q.jsx)(_f,{asChild:!0,children:(0,q.jsxs)(`a`,{href:u,"aria-describedby":f,children:[(0,q.jsx)(X,{icon:Od,size:16,className:`ui-ic ui-ic16`}),`View work`]})}),(0,q.jsx)(vf,{children:d})]}),(0,q.jsx)(`span`,{id:f,className:`ui-sr`,children:d})]}),(0,q.jsx)(Kv,{open:a,onOpenChange:s,msg:e,senderId:t,name:n,peer:r,at:l,href:u,onViewAgent:i})]})}function Kv({open:e,onOpenChange:t,msg:n,senderId:r,name:i,peer:a,at:o,href:s,onViewAgent:c}){let l=Mh(),u=ep(),d=()=>t(!1);return(0,q.jsx)(tf,{open:e,onOpenChange:t,children:(0,q.jsxs)(af,{side:`bottom`,...u,children:[(0,q.jsxs)(of,{className:`flex-row items-center gap-3`,children:[(0,q.jsx)(Ch,{vendor:a.harness,status:a.status,size:28,dot:!1,badge:l(r)}),(0,q.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,q.jsx)(cf,{children:i}),(0,q.jsx)(lf,{children:o?`Message at ${o}`:`Message`})]})]}),(0,q.jsxs)(sf,{children:[(0,q.jsx)(bd,{asChild:!0,variant:`ghost`,className:`justify-start`,children:(0,q.jsxs)(`a`,{href:s,onClick:d,children:[(0,q.jsx)(X,{icon:Od,"data-icon":`inline-start`}),`View ${i}'s work here`]})}),(0,q.jsxs)(bd,{type:`button`,variant:`ghost`,className:`justify-start`,onClick:()=>{d(),c(r)},children:[(0,q.jsx)(X,{icon:$d,"data-icon":`inline-start`}),`View agent`]}),(0,q.jsxs)(bd,{type:`button`,variant:`ghost`,className:`justify-start`,onClick:()=>{zm(T(n.parts)),d()},children:[(0,q.jsx)(X,{icon:Fd,"data-icon":`inline-start`}),`Copy text`]})]})]})})}var qv=(0,o.createContext)(null),Jv=280,Yv=`History does not record who sent this message. The sender shown is the one the message names, and it has not been checked.`,Xv=`Anycast: one free agent with this role takes it.`;function Zv(){return(0,q.jsxs)(gf,{children:[(0,q.jsx)(_f,{asChild:!0,children:(0,q.jsxs)(np,{variant:`outline`,children:[`unverified`,(0,q.jsx)(`span`,{className:`ui-sr`,children:` ${Yv}`})]})}),(0,q.jsx)(vf,{children:Yv})]})}function Qv(e){let t=e===`claude-code`?`claude`:e;return Object.hasOwn(Ph,t)?Ph[t].label:e}function $v({msg:e,senderId:t,mode:n,idx:r,peers:i,run:a=`alone`,own:s=!1,mention:c,claim:l,place:u}){let[d,f]=(0,o.useState)(!1),p=(0,o.useContext)(qv),m=Mh(),h=t??e.from?.id,g=h===void 0?void 0:i.get(h),_=T(e.parts),v=_.length>Jv,y=c!==void 0&&(e.mentions??[]).includes(c.toLowerCase()),b=typeof e.toService==`string`?e.toService:void 0,x=Number.isFinite(e.ts)?new Date(e.ts):void 0,S=t===void 0?`alone`:a,C={__html:zv(_)},w=Pe(t??e.from,r),E=t!==void 0&&i.has(t)?m(t):void 0,D=(0,q.jsx)(Ch,{vendor:g?.harness,status:g?.status??`offline`,size:32,dot:!1,badge:E});return(0,q.jsxs)(Cp,{align:s?`end`:`start`,children:[(0,q.jsx)(wp,{className:`overflow-visible`,children:(S===`alone`||S===`last`)&&(p&&t!==void 0?(0,q.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":w,onClick:()=>p(t),children:D}):D)}),(0,q.jsxs)(Tp,{children:[(S===`alone`||S===`first`)&&(0,q.jsxs)(Ep,{className:`flex-wrap gap-2`,children:[p&&t!==void 0?(0,q.jsx)(bd,{type:`button`,variant:`link`,size:`xs`,className:`h-auto p-0`,onClick:()=>p(t),children:w}):(0,q.jsx)(`span`,{children:w}),t===void 0&&(0,q.jsx)(Zv,{}),u&&(0,q.jsx)(np,{variant:`secondary`,children:u}),u===void 0&&g?.role&&(0,q.jsx)(np,{variant:`secondary`,children:g.role}),u===void 0&&g?.harness&&(0,q.jsx)(np,{variant:`outline`,children:Qv(g.harness)}),x&&(0,q.jsx)(`time`,{dateTime:x.toISOString(),children:O(x)})]}),(0,q.jsx)(op,{variant:s?`default`:y?`tinted`:`secondary`,children:(0,q.jsx)(sp,{children:v?(0,q.jsxs)(Vv,{open:d,onOpenChange:f,children:[(0,q.jsx)(Uv,{forceMount:!0,className:d?`ui-tx`:`ui-tx ui-clamp`,dangerouslySetInnerHTML:C}),(0,q.jsx)(Hv,{asChild:!0,children:(0,q.jsxs)(bd,{type:`button`,variant:`ghost`,size:`xs`,children:[d?`Show less`:`Show more`,(0,q.jsx)(X,{icon:wd,"data-icon":`inline-end`,className:`group-data-open/button:rotate-180`})]})})]}):(0,q.jsx)(`div`,{className:`ui-tx`,dangerouslySetInnerHTML:C})})}),n===`anycast`&&b!==void 0&&(0,q.jsxs)(Dp,{className:`flex-wrap gap-1.5`,children:[(0,q.jsxs)(gf,{children:[(0,q.jsx)(_f,{asChild:!0,children:(0,q.jsxs)(np,{variant:`outline`,children:[(0,q.jsx)(`i`,{className:`ui-mode-dot`,style:{background:`var(--any)`}}),`To any ${b}`,(0,q.jsx)(`span`,{className:`ui-sr`,children:` ${Xv}`})]})}),(0,q.jsx)(vf,{children:Xv})]}),l!==void 0&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{children:` · claimed by ${Pe(l.id,r)}`}),!l.verified&&(0,q.jsx)(Zv,{})]})]})]}),t!==void 0&&g!==void 0&&i.has(t)&&(0,q.jsx)(Gv,{msg:e,senderId:t,name:w,peer:g,onViewAgent:p??ey})]})}var ey=()=>void 0,ty=vd(`group/alert relative grid w-full gap-0.5 rounded-2xl border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function ny({className:e,variant:t,...n}){return(0,q.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:K(ty({variant:t}),e),...n})}function ry({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-title`,className:K(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function iy({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-description`,className:K(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function ay({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`alert-action`,className:K(`absolute top-2.5 right-3`,e),...t})}var oy=vd(`group/toggle inline-flex items-center justify-center gap-1 rounded-2xl text-sm font-medium whitespace-nowrap transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent hover:bg-muted`},size:{default:`h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,sm:`h-7 min-w-7 px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5`,lg:`h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`}},defaultVariants:{variant:`default`,size:`default`}});function sy({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,q.jsx)(Nu,{"data-slot":`toggle`,className:K(oy({variant:t,size:n,className:e})),...r})}function cy(){let{isMobile:e,open:t,openMobile:n}=Ef(),r=(0,o.useRef)(null),i=(0,o.useRef)(n);(0,o.useEffect)(()=>{i.current&&!n&&r.current?.focus(),i.current=n},[n]);let a=e?`Open sidebar`:`Toggle sidebar`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(gf,{children:[(0,q.jsx)(_f,{asChild:!0,children:(0,q.jsx)(kf,{ref:r,"aria-label":a,"aria-haspopup":e?`dialog`:void 0,"aria-expanded":e?n:t})}),(0,q.jsx)(vf,{children:a})]}),(0,q.jsx)(pf,{orientation:`vertical`,className:`data-vertical:h-4 data-vertical:self-auto`})]})}var ly=vd(`group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground`,{variants:{variant:{default:``,separator:`before:mr-1 before:h-px before:min-w-0 before:flex-1 before:bg-border after:ml-1 after:h-px after:min-w-0 after:flex-1 after:bg-border`,border:`border-b border-border pb-2`}}});function uy({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?Yt:`div`;return(0,q.jsx)(i,{"data-slot":`marker`,"data-variant":t,className:K(ly({variant:t,className:e})),...r})}function dy({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`marker-icon`,"aria-hidden":`true`,className:K(`size-4 shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...t})}function fy({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`marker-content`,className:K(`min-w-0 wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function py(e){let t=Math.floor(Math.max(0,e)/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}var my=(e,t)=>typeof t==`number`&&Number.isFinite(t)?Math.max(0,e-t):void 0;function hy(e,t){let n=[],r=my(t,e.condition?.since);e.condition&&n.push(`${e.condition.code}${r===void 0?``:` for ${py(r)}`}`);let i=my(t,e.statusSince);i!==void 0&&n.push(`unchanged for ${py(i)}`);let a=my(t,e.activeAt);a!==void 0&&n.push(`active ${py(a)} ago`);let o=e.activity?my(t,e.activitySince):void 0;return o!==void 0&&n.push(`activity set ${py(o)} ago`),n.join(` · `)}var gy=()=>globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0,_y={dnd:{icon:Gd,word:`Do not disturb`,color:`var(--uni-ink)`,title:`Channel messages wait for its next turn. DMs and mentions still wake it.`},focus:{icon:Xd,word:`Focus`,color:`var(--multi-ink)`,title:`Channel messages stay in the channel. DMs and role requests still reach it.`}};function vy({attention:e}){if(e===void 0||!Object.hasOwn(_y,e))return null;let t=_y[e];return(0,q.jsxs)(gf,{children:[(0,q.jsx)(_f,{asChild:!0,children:(0,q.jsxs)(`span`,{className:`v3-meta`,style:{color:t.color},children:[(0,q.jsx)(X,{icon:t.icon,size:16,className:`ui-ic ui-ic16`}),t.word,(0,q.jsx)(`span`,{className:`ui-sr`,children:` ${t.title}`})]})}),(0,q.jsx)(vf,{children:t.title})]})}var yy=[];function by(e,t){(0,o.useEffect)(()=>{if(e)return e.openSession(t),()=>e.closeSession(t)},[e,t])}function xy(e){let t=e?.condition;if(typeof t==`object`&&t&&typeof t.code==`string`)return typeof t.since==`number`?{code:t.code,since:t.since}:{code:t.code}}function Sy(e,t){let n=Ye(e,e=>e.sessions[t]?.posts)??yy,r=Ye(e,e=>e.dms);return(0,o.useMemo)(()=>{let e=new Set(n.map(e=>e.msg.id)),i=r.filter(n=>n.senderId===t&&typeof n.msg.to==`string`&&!e.has(n.msg.id));return i.length===0?n:[...n,...i]},[n,r,t])}function Cy(e){let[t]=(0,o.useState)(e),[n,r]=(0,o.useState)(!1);return!n&&e!==t&&r(!0),n||e!==t?`ui-xfade`:void 0}function wy({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`trace`,className:K(`flex w-full min-w-0 flex-col gap-2 *:has-[>[data-slot=trace-line]]:flex *:has-[>[data-slot=trace-line]]:w-fit *:has-[>[data-slot=trace-line]]:max-w-full *:has-[>[data-slot=trace-line]]:min-w-0 *:has-[>[data-slot=trace-line]]:rounded-lg *:has-[>[data-slot=trace-line]]:text-left *:has-[>[data-slot=trace-line]]:outline-none *:has-[>[data-slot=trace-line]]:focus-visible:ring-3 *:has-[>[data-slot=trace-line]]:focus-visible:ring-ring/30`,e),...t})}function Ty({className:e,status:t,...n}){return(0,q.jsx)(`span`,{"data-slot":`trace-line`,"data-status":t,className:K(`flex w-fit max-w-full min-w-0 items-center gap-2 text-sm text-muted-foreground transition-colors in-[a,button]:cursor-pointer in-[a:hover,button:hover]:text-foreground data-[status=error]:text-destructive data-[status=error]:in-[a:hover,button:hover]:text-destructive data-[status=pending]:opacity-60 data-[status=running]:*:data-[slot=trace-title]:shimmer`,e),...n})}function Ey({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`trace-icon`,"aria-hidden":`true`,className:K(`flex size-4 shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [[data-slot=trace-title]~&]:-ml-1`,e),...t})}function Dy({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`trace-title`,className:K(`min-w-0 truncate motion-reduce:shimmer-none`,e),...t})}function Oy({className:e,...t}){return(0,q.jsx)(`span`,{"data-slot":`trace-description`,className:K(`shrink-0 text-muted-foreground/70 tabular-nums`,e),...t})}function ky({className:e,...t}){return(0,q.jsx)(Vv,{"data-slot":`trace-collapsible`,className:K(`flex w-full min-w-0 flex-col`,e),...t})}function Ay({className:e,children:t,...n}){return(0,q.jsxs)(Hv,{"data-slot":`trace-collapsible-trigger`,className:K(`group/trace-collapsible-trigger flex w-fit max-w-full min-w-0 cursor-pointer items-center gap-1 rounded-lg text-left text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30 has-[[data-status=error]]:text-destructive`,e),...n,children:[t,(0,q.jsx)(Ey,{className:`transition-transform group-aria-expanded/trace-collapsible-trigger:rotate-90`,children:(0,q.jsx)(Sd,{icon:Ed,strokeWidth:2})})]})}function jy({className:e,children:t,...n}){return(0,q.jsx)(Uv,{"data-slot":`trace-collapsible-content`,className:`min-w-0 overflow-hidden duration-200 [--radix-accordion-content-height:var(--radix-collapsible-content-height)] data-open:animate-accordion-down data-closed:animate-accordion-up`,...n,children:(0,q.jsx)(`div`,{"data-slot":`trace-collapsible-content-inner`,className:K(`mt-2 mb-1 ml-[calc(--spacing(2)-1px)] min-w-0 border-l pr-1 pl-4 leading-relaxed wrap-break-word text-muted-foreground`,e),children:t})})}function My({line:e,words:t}){let[n,r]=(0,o.useState)(!1);return(0,q.jsxs)(gf,{open:n,onOpenChange:r,children:[(0,q.jsx)(_f,{type:`button`,className:`ox-tip`,onClick:e=>{e.preventDefault(),r(!n)},children:e}),(0,q.jsx)(vf,{className:`ox-tipc`,sideOffset:4,children:t})]})}function Ny(e){let[t,n]=(0,o.useState)(()=>Date.now()),[r,i]=(0,o.useState)(e);return e!==r&&(i(e),e&&n(Date.now())),(0,o.useEffect)(()=>{if(!e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),t}var Py={command:Pd,edit:Ld,write:Ld,read:Id,send:Kd,dm:Kd,inbox:Bd,other:ef},Fy=e=>Py[e],Iy=`The connector reports the call returned an error. It doesn't publish the error text or the command.`,Ly=`The connector reports the call returned an error. It doesn't publish the error text or the tool's input.`;function Ry(e,t){if(t===`running`)return(0,q.jsx)(Rm,{role:void 0,"aria-label":void 0,"aria-hidden":!0});let n=t===`failed`?Nd:t===`pending`?zd:t===`noResult`?Qd:Fy(e.kind);return(0,q.jsx)(X,{icon:n,size:16})}function zy({call:e,state:t,shimmer:n=!0,className:r}){let i=Ny(t===`running`),a=Cy(t),o=t===`running`?n?`running`:void 0:t===`failed`?`error`:t===`pending`||t===`noResult`?`pending`:void 0,s=ge(e,t,i),c=le(e.name),l=[`ox-line`,r,a].filter(Boolean).join(` `),u=e.full===c?void 0:e.full,d=u===void 0?(0,q.jsx)(`code`,{children:c}):(0,q.jsxs)(`code`,{children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,children:c}),(0,q.jsx)(`span`,{className:`ui-sr`,children:u})]}),f=t===`called`&&u!==void 0,p=(0,q.jsxs)(Dy,{children:[ue(e.kind,t,e.name),f&&(0,q.jsx)(`span`,{className:`ui-sr`,children:` ${u}`})]}),m=(0,q.jsxs)(Ty,{status:o,role:o===`running`?`status`:void 0,className:l,children:[(0,q.jsx)(Ey,{children:Ry(e,t)}),f?(0,q.jsxs)(gf,{children:[(0,q.jsx)(_f,{asChild:!0,children:p}),(0,q.jsx)(vf,{children:u})]}):p,` `,s&&(0,q.jsx)(Oy,{children:t===`called`?s:(0,q.jsxs)(q.Fragment,{children:[u===void 0||t===`failed`?d:(0,q.jsxs)(gf,{children:[(0,q.jsx)(_f,{asChild:!0,children:d}),(0,q.jsx)(vf,{children:u})]}),t===`running`?(0,q.jsx)(`span`,{"aria-hidden":`true`,children:s.slice(c.length)}):s.slice(c.length)]})})]},t);return t===`failed`?(0,q.jsx)(My,{line:m,words:e.kind===`command`?Iy:Ly}):m}function By({className:e,orientation:t=`horizontal`,...n}){return(0,q.jsx)(xu,{"data-slot":`tabs`,"data-orientation":t,className:K(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var Vy=vd(`group/tabs-list inline-flex w-fit items-center justify-center rounded-2xl p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col group-data-vertical/tabs:p-1 data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Hy({className:e,variant:t=`default`,...n}){return(0,q.jsx)(Cu,{"data-slot":`tabs-list`,"data-variant":t,className:K(Vy({variant:t}),e),...n})}function Uy({className:e,...t}){return(0,q.jsx)(Tu,{"data-slot":`tabs-trigger`,className:K(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-2xl border border-transparent! px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start group-data-vertical/tabs:px-3 group-data-vertical/tabs:py-0.5 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function Wy({className:e,...t}){return(0,q.jsx)(Du,{"data-slot":`tabs-content`,className:K(`flex-1 text-sm outline-none`,e),...t})}function Gy({children:e,action:t}){return(0,q.jsxs)(ny,{role:`note`,className:`mb-2`,children:[(0,q.jsx)(X,{icon:Vd}),(0,q.jsx)(iy,{children:e}),t&&(0,q.jsx)(ay,{children:t})]})}function Ky({row:e}){let t=Object.hasOwn(ph,e.status)?ph[e.status]:void 0,n=qe(e),r=Cy(e.status),i=e.activity||void 0,a;if(e.status===`working`||e.status===`waiting`){let t=k(e.statusSince);a=[i&&(/[.!?]$/.test(i)?i:`${i}.`),t&&`Reported ${t}.`].filter(Boolean).join(` `)||void 0}else if(e.status===`offline`){let t=k(e.ts);a=t&&`Last heartbeat ${t}.`}else e.status===`idle`&&(a=`No current activity.`);return(0,q.jsxs)(`div`,{className:r?`ox-foot ${r}`:`ox-foot`,children:[(0,q.jsx)(`span`,{className:`v3-spill v3-s-${e.status}`,children:t&&(0,q.jsx)(X,{icon:t,size:16,className:`ui-ic`})}),(0,q.jsx)(`b`,{children:e.name}),` is ${n} `,a&&(0,q.jsx)(`span`,{className:e.status===`waiting`?`ox-foot-wait`:void 0,children:a})]},e.status)}var qy=()=>Promise.all([Jf(()=>import(`./core-Bfff_dYO.js`),__vite__mapDeps([0,1])),Jf(()=>import(`./engine-javascript-C30F4iNc.js`),[])]),Jy=new Map([[`javascript`,()=>Jf(()=>import(`./javascript-BgS3c2Ky.js`),[])],[`typescript`,()=>Jf(()=>import(`./typescript-bsJCZSQ-.js`),[])],[`json`,()=>Jf(()=>import(`./json-qhed-kSA.js`),[])],[`bash`,()=>Jf(()=>import(`./bash-CLZ0U2zV.js`),[])],[`diff`,()=>Jf(()=>import(`./diff-woXpYk--.js`),[])],[`python`,()=>Jf(()=>import(`./python-gzcpVVnB.js`),[])],[`yaml`,()=>Jf(()=>import(`./yaml-rwi0_p6S.js`),[])],[`markdown`,()=>Jf(()=>import(`./markdown-BYOwaDjH.js`),[])]]),Yy=new Map([[`js`,`javascript`],[`javascript`,`javascript`],[`ts`,`typescript`],[`typescript`,`typescript`],[`json`,`json`],[`bash`,`bash`],[`sh`,`bash`],[`shell`,`bash`],[`zsh`,`bash`],[`diff`,`diff`],[`python`,`python`],[`py`,`python`],[`yaml`,`yaml`],[`yml`,`yaml`],[`markdown`,`markdown`],[`md`,`markdown`]]),Xy=`cotal`,Zy=1e3,Qy,$y=new Map;function eb(){return Qy??=qy().then(([{createHighlighterCore:e,createCssVariablesTheme:t},{createJavaScriptRegexEngine:n}])=>e({themes:[t({name:Xy,variablePrefix:`--shiki-`,fontStyle:!1})],langs:[],engine:n({forgiving:!0})})).catch(e=>{throw Qy=void 0,e}),Qy}function tb(e,t){let n=$y.get(t);return n||(n=e.loadLanguage(Jy.get(t)).catch(e=>{throw $y.delete(t),e}),$y.set(t,n)),n}async function nb(e,t){let n=Yy.get(t.toLowerCase());if(n!==void 0&&!(e.length>2e4))try{let t=await eb();return await tb(t,n),t.codeToTokens(e,{lang:n,theme:Xy,tokenizeMaxLineLength:Zy}).tokens.map(e=>e.map(e=>e.color===void 0?{content:e.content}:{content:e.content,color:e.color}))}catch(e){console.error(`highlighting a code block failed, so it stays plain:`,e);return}}var rb=vd(`group/code-block relative flex w-full min-w-0 flex-col overflow-hidden rounded-2xl text-sm has-[>[data-slot=code-block-content]:focus-visible]:ring-3 has-[>[data-slot=code-block-content]:focus-visible]:ring-ring/30 data-[size=sm]:rounded-xl data-[size=sm]:text-xs`,{variants:{variant:{default:`bg-muted text-foreground ring-1 ring-foreground/5 dark:ring-foreground/10`,destructive:`bg-destructive/5 text-destructive ring-1 ring-destructive/15 dark:bg-destructive/10 dark:ring-destructive/20`}},defaultVariants:{variant:`default`}});function ib({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,q.jsx)(`div`,{"data-slot":`code-block`,"data-variant":t,"data-size":n,className:K(rb({variant:t}),e),...r})}function ab({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`code-block-header`,className:K(`flex min-w-0 shrink-0 items-center gap-2 px-4 pt-4 text-muted-foreground group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:pt-3 group-data-[variant=destructive]/code-block:text-destructive *:has-[>[data-slot=code-block-title]]:min-w-0`,e),...t})}function ob({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`code-block-actions`,className:K(`-my-1 ms-auto -me-1.5 flex shrink-0 items-center gap-1 *:data-[slot=button]:hover:bg-foreground/5 dark:*:data-[slot=button]:hover:bg-foreground/10 [[data-slot=code-block]>&]:absolute [[data-slot=code-block]>&]:end-3 [[data-slot=code-block]>&]:top-3 [[data-slot=code-block]>&]:z-10 [[data-slot=code-block]>&]:m-0 [[data-slot=code-block]>&]:opacity-0 [[data-slot=code-block]>&]:transition-opacity [[data-slot=code-block]>&]:group-focus-within/code-block:opacity-100 [[data-slot=code-block]>&]:group-hover/code-block:opacity-100 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:end-2 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:top-2 [[data-slot=code-block]>&]:pointer-coarse:opacity-100 [[data-slot=code-block]>&]:*:[button]:bg-background [[data-slot=code-block]>&]:*:[button]:ring-1 [[data-slot=code-block]>&]:*:[button]:ring-foreground/10`,e),...t})}function sb({className:e,children:t,style:n,wrap:r=!1,lineNumbers:i=!1,startLine:a=1,...o}){return(0,q.jsx)(`pre`,{"data-slot":`code-block-content`,"data-wrap":r||void 0,"data-numbered":i||void 0,dir:`ltr`,tabIndex:0,style:{counterReset:`line ${a-1}`,...n},className:K(`min-h-0 min-w-0 scroll-fade-x scrollbar-thin overflow-auto px-4 py-4 text-start font-mono leading-relaxed outline-none group-has-data-[slot=code-block-footer]/code-block:pb-2 group-has-data-[slot=code-block-header]/code-block:pt-2 group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:py-3 group-data-[size=sm]/code-block:group-has-data-[slot=code-block-header]/code-block:pt-1.5 data-wrap:scroll-fade-y data-wrap:wrap-break-word data-wrap:whitespace-pre-wrap`,e),...o,children:(0,q.jsx)(`code`,{"data-slot":`code-block-code`,className:`grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0`,children:i&&typeof t==`string`?t.replace(/\n$/,``).split(`
108
- `).map((e,t)=>(0,q.jsx)(lb,{children:e},t)):t})})}var cb=vd(`relative -mx-4 block min-h-lh px-4 group-data-[size=sm]/code-block:-mx-3 group-data-[size=sm]/code-block:px-3 before:min-w-6 before:text-end before:text-muted-foreground after:absolute after:start-1 after:top-0 after:text-muted-foreground after:select-none in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:gap-x-3 in-data-numbered:[counter-increment:line] in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none in-data-numbered:supports-[content:counter(line)_/_'']:before:content-[counter(line)_/_'']`,{variants:{variant:{default:``,added:`bg-foreground/5 after:content-['+']`,removed:`bg-destructive/10 after:text-destructive after:content-['−']`,highlighted:`bg-foreground/5`}},defaultVariants:{variant:`default`}});function lb({className:e,variant:t=`default`,children:n,...r}){let i=n==null||n===``||Array.isArray(n)&&n.length===0;return(0,q.jsx)(`span`,{"data-slot":`code-block-line`,"data-variant":t,className:K(cb({variant:t}),e),...r,children:(0,q.jsx)(`span`,{"data-slot":`code-block-line-content`,className:`min-w-0`,children:i?`
109
- `:n})})}function ub({lang:e,text:t}){let n=(0,o.useRef)(null),[r,i]=(0,o.useState)(void 0);(0,o.useEffect)(()=>{let r=!0,a=()=>void nb(t,e).then(n=>{r&&n&&i({text:t,lang:e,lines:n})}),o=globalThis.IntersectionObserver;if(!o||!n.current)return a(),()=>{r=!1};let s=new o(e=>{e.some(e=>e.isIntersecting)&&(s.disconnect(),a())});return s.observe(n.current),()=>{r=!1,s.disconnect()}},[t,e]);let a=r?.text===t&&r.lang===e?r.lines:void 0,s=e&&le(e,24);return(0,q.jsxs)(ib,{ref:n,size:`sm`,className:`ox-code`,children:[(0,q.jsxs)(ab,{className:`ox-code-h`,children:[s&&(s===e?(0,q.jsx)(`span`,{children:e}):(0,q.jsxs)(gf,{children:[(0,q.jsx)(_f,{asChild:!0,children:(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`span`,{"aria-hidden":`true`,children:s}),(0,q.jsx)(`span`,{className:`ui-sr`,children:e})]})}),(0,q.jsx)(vf,{children:e})]})),` `,(0,q.jsx)(ob,{className:`ox-code-acts`,children:(0,q.jsxs)(bd,{type:`button`,variant:`ghost`,size:`xs`,onClick:()=>zm(t),children:[(0,q.jsx)(X,{icon:Fd,"data-icon":`inline-start`}),`Copy`]})})]}),(0,q.jsx)(sb,{className:`ox-code-c`,children:a?a.map((e,t)=>(0,q.jsx)(lb,{children:e.map((e,t)=>(0,q.jsx)(`span`,{style:e.color===void 0?void 0:{color:e.color},children:e.content},t))},t)):t})]})}var db=280,fb=e=>e.replace(/<[^>]*>/g,``).length;function pb({src:e,className:t,clamp:n=!0}){let r=(0,o.useMemo)(()=>Bv(e),[e]),[i,a]=(0,o.useState)(!1),s=n&&r.some(e=>e.kind===`html`&&fb(e.html)>db);return(0,q.jsxs)(`div`,{className:t,children:[r.map((e,t)=>e.kind===`code`?(0,q.jsx)(ub,{lang:e.lang,text:e.text},t):(0,q.jsx)(`div`,{className:s&&!i&&fb(e.html)>db?`ox-prose ui-clamp`:`ox-prose`,dangerouslySetInnerHTML:{__html:e.html}},t)),s&&(0,q.jsx)(bd,{type:`button`,variant:`link`,size:`sm`,className:`px-0`,"aria-expanded":i,onClick:()=>a(!i),children:i?`Show less`:`Show more`})]})}function mb({ts:e}){let t=D(e);return t?(0,q.jsx)(`time`,{dateTime:t.toISOString(),children:O(t)}):null}function hb({msg:e,agent:t,channel:n,to:r,toName:i,compact:a=!1,highlight:o=!1}){let s=n===void 0,c=[`ox-post`,s&&`ox-post-dm`,o&&`ox-post-hl`].filter(Boolean).join(` `),l=De(s?{view:`dm`,peer:t,...r===void 0?{}:{with:r}}:{view:`channel`,channel:n});return(0,q.jsxs)(`div`,{className:c,"data-post":e.id,children:[(0,q.jsxs)(`div`,{className:`ox-post-h`,children:[(0,q.jsx)(X,{icon:s?jd:Rd,size:16}),(0,q.jsx)(`span`,{children:s?`Sent to ${i??r??``}`:`Posted in #${n}`}),(0,q.jsx)(mb,{ts:e.ts}),!a&&(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`ui-sp`}),(0,q.jsxs)(`a`,{className:`ox-act`,href:l,children:[s?`Open conversation`:`Open in #${n}`,(0,q.jsx)(X,{icon:Od,size:16})]})]})]}),(0,q.jsx)(pb,{className:`ui-tx`,src:T(e.parts),clamp:!a})]})}var gb=(e,t)=>t?`${e} …`:e,_b=/^ {0,3}```/gm;function vb(e,t){return t?(e.match(_b)??[]).length%2==1?`${e}\n\`\`\`\n …`:`${e} …`:e}function yb({text:e,cut:t,compact:n=!1}){return(0,q.jsx)(pb,{className:`ox-said`,src:vb(e,t),clamp:!n})}var bb=280;function xb({text:e,cut:t}){let[n,r]=(0,o.useState)(!1),i=vb(e,t),a=i.length>bb;return(0,q.jsxs)(`div`,{className:`ui-prompt`,children:[(0,q.jsx)(`span`,{children:`Prompt`}),(0,q.jsx)(`div`,{className:a&&!n?`ui-tx ui-clamp`:`ui-tx`,dangerouslySetInnerHTML:{__html:zv(i)}}),a&&(0,q.jsx)(bd,{type:`button`,variant:`link`,size:`sm`,className:`px-0`,"aria-expanded":n,onClick:()=>r(!n),children:n?`Show less`:`Show more`})]})}function Sb({text:e,cut:t}){return(0,q.jsxs)(ky,{children:[(0,q.jsx)(Ay,{className:`ox-trig`,children:(0,q.jsxs)(Ty,{className:`ox-line`,children:[(0,q.jsx)(Ey,{children:(0,q.jsx)(X,{icon:Ad,size:16})}),(0,q.jsx)(Dy,{children:`Reasoning`})]})}),(0,q.jsx)(jy,{className:`ox-cc`,children:(0,q.jsx)(`div`,{className:`ox-think`,children:gb(e,t)})})]})}function Cb({ts:e,condition:t}){return(0,q.jsxs)(ny,{variant:`destructive`,role:`note`,children:[(0,q.jsx)(X,{icon:Cd}),(0,q.jsx)(ry,{children:D(e)?(0,q.jsxs)(q.Fragment,{children:[`Turn failed at `,(0,q.jsx)(mb,{ts:e})]}):`Turn failed`}),(0,q.jsxs)(iy,{children:[(0,q.jsx)(`div`,{children:`The event plane doesn't say why.`}),t!==void 0&&(0,q.jsxs)(`div`,{children:[`Presence reports `,(0,q.jsx)(`code`,{children:t.code}),D(t.since)&&(0,q.jsxs)(q.Fragment,{children:[` since `,(0,q.jsx)(mb,{ts:t.since})]}),`.`]})]})]})}function wb(e,t){if(!t)return ef;let n=new Map;for(let t of e)n.set(t.kind,(n.get(t.kind)??0)+1);let r=Math.max(...n.values()),i=[...n].filter(([,e])=>e===r);return i.length===1?Fy(i[0][0]):ef}function Tb({calls:e,at:t,toolStatus:n,line:r=!1,className:i}){let{title:a,failed:o}=de(e,n),s=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Ey,{children:(0,q.jsx)(X,{icon:wb(e,n),size:16})}),(0,q.jsxs)(Dy,{children:[a,o>0&&(0,q.jsxs)(q.Fragment,{children:[`, `,(0,q.jsxs)(`span`,{className:`ox-fail`,children:[(0,q.jsx)(X,{icon:Nd,size:16}),`${o} failed`]})]})]})]});return r?(0,q.jsx)(Ty,{className:i?`ox-line ${i}`:`ox-line`,children:s}):(0,q.jsxs)(ky,{className:i,children:[(0,q.jsx)(Ay,{className:`ox-trig`,children:(0,q.jsxs)(Ty,{className:`ox-line`,children:[s,` `,(0,q.jsx)(Oy,{children:_e(e,n)})]})}),(0,q.jsx)(jy,{className:`ox-cc`,children:(0,q.jsx)(wy,{className:`ox-calls`,children:e.map(e=>(0,q.jsx)(zy,{call:e,state:V(e,{...t,toolStatus:n})},e.key))})})]})}var Eb=(0,o.createContext)(()=>!1),Db=new Set([`done`,`failed`,`called`]);function Ob({step:e,at:t,toolStatus:n,compact:r}){let i=(0,o.useContext)(Eb),a=e.calls.map(e=>V(e,{...t,toolStatus:n})),s=e.calls.length>=2&&a.every(e=>Db.has(e)),c=Cy(s?`group`:`lines`),[l,u]=(0,o.useState)(s),[d,f]=(0,o.useState)(!1);if(l!==s&&(u(s),f(s)),s)return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Tb,{calls:e.calls,at:t,toolStatus:n,line:r,className:c},`group`),d&&(0,q.jsx)(`div`,{className:`ox-fold`,"aria-hidden":`true`,style:{"--fold-n":e.calls.length-1},onAnimationEnd:()=>f(!1),children:e.calls.slice(1).map((e,t)=>(0,q.jsx)(zy,{call:e,state:a[t+1]},e.key))})]});let p=a.lastIndexOf(`running`);return(0,q.jsx)(q.Fragment,{children:e.calls.map((e,t)=>(0,q.jsx)(zy,{call:e,state:a[t],shimmer:t===p,className:t>0&&i(e)?`ui-in`:void 0},e.key))})}function kb({ts:e}){return(0,q.jsxs)(Ty,{className:`ox-line`,children:[(0,q.jsx)(Ey,{children:(0,q.jsx)(X,{icon:Zd,size:16})}),(0,q.jsx)(Dy,{children:`Turn ended`}),` `,(0,q.jsx)(Oy,{children:(0,q.jsx)(mb,{ts:e})})]})}function Ab({label:e,ts:t}){return(0,q.jsxs)(Ty,{className:`ox-line`,children:[(0,q.jsx)(Ey,{children:(0,q.jsx)(X,{icon:Vd,size:16})}),(0,q.jsx)(Dy,{children:e}),` `,(0,q.jsx)(Oy,{children:(0,q.jsx)(mb,{ts:t})})]})}function jb({step:e,turn:t,trailing:n,ctx:r,condition:i}){switch(e.kind){case`prompt`:return r.compact?null:(0,q.jsx)(xb,{text:e.text,cut:e.cut});case`reasoning`:return r.compact?null:(0,q.jsx)(Sb,{text:e.text,cut:e.cut});case`said`:return(0,q.jsx)(yb,{text:e.text,cut:e.cut,compact:r.compact});case`tools`:return(0,q.jsx)(Ob,{step:e,at:{turn:t,trailing:n,status:r.row.status},toolStatus:r.toolStatus,compact:r.compact});case`post`:return(0,q.jsx)(hb,{msg:e.msg,agent:r.row.id,...e.channel===void 0?{to:e.to,toName:r.nameOf(e.to??``)}:{channel:e.channel},compact:r.compact,highlight:r.highlight!==void 0&&e.msg.id===r.highlight});case`runError`:return(0,q.jsx)(Cb,{ts:e.ts,condition:i});case`unknown`:return(0,q.jsx)(Ab,{label:e.label,ts:e.ts})}}function Mb({turn:e,row:t}){let n=e.outcome===`open`&&!e.superseded,r=n&&t.status===`working`,i=Ny(n&&(t.status===`working`||t.status===`waiting`)),{title:a,failed:o}=pe(e,t.status,i),s=he(e),c=r?(0,q.jsx)(Rm,{className:`ox-live`,role:void 0,"aria-label":void 0,"aria-hidden":!0}):(0,q.jsx)(X,{icon:e.outcome===`finished`?Zd:e.outcome===`failed`?Cd:n&&t.status===`waiting`?zd:Qd,size:16});return(0,q.jsxs)(Ty,{status:e.outcome===`failed`?`error`:void 0,className:`ox-line`,children:[(0,q.jsx)(Ey,{children:c}),(0,q.jsxs)(Dy,{children:[r?(0,q.jsx)(`b`,{children:a}):a,o!==void 0&&(0,q.jsxs)(q.Fragment,{children:[`, `,(0,q.jsxs)(`span`,{className:`ox-fail`,children:[(0,q.jsx)(X,{icon:Nd,size:16}),o]})]})]}),` `,s&&(0,q.jsx)(Oy,{children:s})]})}function Nb({turn:e,row:t,toolStatus:n,defaultOpen:r,highlight:i,condition:a,nameOf:s}){let c=(0,o.useContext)(Eb),[l,u]=(0,o.useState)(void 0),d=l??r,f={row:t,toolStatus:n,compact:!1,nameOf:s,...i===void 0?{}:{highlight:i}},p=e.steps.at(-1),m=e.steps.findLast(e=>e.kind!==`runError`);return(0,q.jsxs)(ky,{open:d,onOpenChange:u,children:[(0,q.jsx)(Ay,{className:`ox-trig`,children:(0,q.jsx)(Mb,{turn:e,row:t})}),(0,q.jsx)(jy,{className:`ox-cc`,children:(0,q.jsx)(wy,{className:`ox-turn`,children:e.steps.map(t=>(0,q.jsx)(`div`,{className:c(t)?`ox-step ui-in`:`ox-step`,children:(0,q.jsx)(jb,{step:t,turn:e,trailing:t===m,ctx:f,condition:t===p?a:void 0})},t.key))})})]})}function Pb(e){let t=[],n=e=>{for(let r of e)t.push(r),r.kind===`turn`?n(r.steps):r.kind===`tools`&&t.push(...r.calls)};return n(e),t}function Fb(e,t){let n=(0,o.useRef)(void 0),r=n.current?.id===t?n.current:void 0;return(0,o.useEffect)(()=>{let r=Pb(e),i=n.current;if(i?.id!==t)n.current={id:t,known:new Set(r.map(e=>e.key)),rising:new Set};else for(let e of r)i.known.has(e.key)||(i.known.add(e.key),e.live&&i.rising.add(e.key))}),e=>r!==void 0&&(r.rising.has(e.key)||e.live&&!r.known.has(e.key))}function Ib(e,t){let n=e.filter(e=>e.kind===`turn`);return(t===void 0?void 0:n.find(e=>e.steps.some(e=>e.kind===`post`&&e.msg.id===t)))??n.findLast(e=>e.outcome===`open`&&!e.superseded)??n.at(-1)}function Lb({work:e,row:t,highlight:n,compact:r=!1,condition:i,nameOf:a}){let o=Fb(e.items,t.id),s=Ib(e.items,n),c={row:t,toolStatus:e.toolStatus,compact:r,nameOf:a,...n===void 0?{}:{highlight:n}},l=e=>!r||e.kind!==`prompt`&&e.kind!==`reasoning`,u=e.items.at(-1),d=(e,t,n,r)=>(0,q.jsx)(`div`,{className:o(e)?`ox-step ui-in`:`ox-step`,children:e.kind===`turnEnd`?(0,q.jsx)(kb,{ts:e.ts}):(0,q.jsx)(jb,{step:e,turn:t,trailing:n,ctx:c,condition:r})},e.key);return(0,q.jsx)(Eb.Provider,{value:o,children:(0,q.jsxs)(wy,{className:r?`ox-work ox-compact`:`ox-work`,children:[!e.toolStatus&&(0,q.jsx)(Gy,{children:`${t.name}'s connector reports which tools it calls but not when they finish, so Work can't show running, done or failed. A connector that reports tool results shows them here once ${t.name} restarts on it.`}),e.items.filter(l).map(c=>{if(c.kind!==`turn`)return d(c,void 0,c===u,c===u?i:void 0);if(r){let e=c.steps.findLast(e=>e.kind!==`runError`),t=c.steps.at(-1);return c.steps.filter(l).map(n=>d(n,c,n===e,c===u&&n===t?i:void 0))}return(0,q.jsx)(`div`,{className:o(c)?`ox-step ui-in`:`ox-step`,children:(0,q.jsx)(Nb,{turn:c,row:t,toolStatus:e.toolStatus,defaultOpen:c===s,highlight:n,condition:c===u?i:void 0,nameOf:a})},c.key)}),!r&&(0,q.jsx)(Ky,{row:t})]})})}var Rb=(0,o.createContext)(e=>je(globalThis,e)),zb=e=>Number.isSafeInteger(e)&&e>=0,Bb=e=>e&&typeof e==`object`?e.msg||e:void 0;function Vb(e){try{let t=Bb(e),n=t&&t.parts;if(!Array.isArray(n))return;for(let e of n)if(e&&typeof e==`object`&&e.kind===`ag-ui.frame`&&zb(e.seq))return e;return}catch{return}}function Hb(e,t){let n=Bb(e),r=n&&n.from;return JSON.stringify([r&&typeof r.id==`string`?r.id:null,typeof t.epoch==`string`?t.epoch:null,typeof t.threadId==`string`?t.threadId:null])}function Ub(){let e=new Map,t=[],n=!1,r=t=>{let n=e.get(t);return n||(n={baseline:void 0,next:void 0,prefixIncomplete:!1,faulted:!1,released:!1,seen:new Set},e.set(t,n)),n},i=(e,t,n,r)=>{let i=[];if(e.seen.has(n))return{emit:!1,notes:i};if(e.seen.add(n),n>e.next){let a={key:t,expected:e.next,got:n,missing:n-e.next};r?i.push({type:`boundary-hole`,...a}):(i.push({type:`gap`,...a}),e.faulted=!0)}return n>=e.next&&(e.next=n+1),{emit:!0,notes:i}};return{live(e){let a=Vb(e);if(!a)return{emit:[e],held:!1,notes:[]};if(!n)return t.push(e),{emit:[],held:!0,notes:[]};let o=Hb(e,a),s=r(o);s.next===void 0&&(s.baseline=a.seq,s.next=a.seq,s.prefixIncomplete=a.seq>1);let c=i(s,o,a.seq);return{emit:c.emit?[e]:[],held:!1,notes:c.notes}},backfill(a){let o=[],s=Array.isArray(a)?a.slice():[];for(let e of s){let t=Vb(e);if(!t)continue;let n=r(Hb(e,t));(n.baseline===void 0||t.seq<n.baseline)&&(n.baseline=t.seq),n.seen.add(t.seq)}for(let[t,n]of e){if(n.baseline===void 0)continue;let e=n.baseline;for(let t of n.seen)t>e&&(e=t);n.next=e+1,n.prefixIncomplete=n.baseline>1,n.prefixIncomplete&&o.push({type:`prefix-incomplete`,key:t,baseline:n.baseline});let r=0;for(let i=n.baseline+1;i<=e;i++)n.seen.has(i)?r>0&&(o.push({type:`gap`,key:t,expected:i-r,got:i,missing:r}),n.faulted=!0,r=0):r++}let c=t.map((e,t)=>({entry:e,frame:Vb(e),i:t})).filter(e=>e.frame!==void 0);c.sort((e,t)=>e.frame.seq-t.frame.seq||e.i-t.i);for(let e of c){let t=Hb(e.entry,e.frame),n=r(t);n.next===void 0&&(n.baseline=e.frame.seq,n.next=e.frame.seq,n.prefixIncomplete=e.frame.seq>1,n.prefixIncomplete&&o.push({type:`prefix-incomplete`,key:t,baseline:n.baseline}));let a=!n.released;n.released=!0;let c=i(n,t,e.frame.seq,a);for(let e of c.notes)o.push(e);c.emit&&s.push(e.entry)}return t.length=0,n=!0,{emit:s,notes:o}},get settled(){return n},get pendingCount(){return t.length},state(t){let n=e.get(t);return n===void 0?void 0:{baseline:n.baseline,next:n.next,prefixIncomplete:n.prefixIncomplete,faulted:n.faulted}},get chainKeys(){return[...e.keys()]}}}var Wb=500,Gb=250,Kb=2e3,qb={text:``,outgoing:[]};function Jb(e,...t){let n=new Map;for(let e of t)for(let t of e)t?.msg?.id!==void 0&&t.senderId!==void 0&&n.set(t.msg.id,t);return n.size?e.map(e=>(e?.msg?.id===void 0?void 0:n.get(e.msg.id))??e):e}var Yb=e=>typeof e==`number`&&Number.isFinite(e)?e:0;function Xb(e,t,n){let r=new Set(e.map(e=>e.id)),i=e;for(let a of t){let t=F(a,n);if(!t.some(e=>r.has(e.id))){i===e&&(i=e.slice());for(let e of t)r.add(e.id),i.push(e)}}return i}function Zb(e){let t=ne(e),n=0;for(;t>2e3&&n<e.length-1;)t-=e[n++].events.length;return{frames:n?e.slice(n):e,dropped:n>0}}function Qb(e,t){let n=new Set,r=[],i=(e,i)=>{e&&i===t&&!n.has(e.id)&&(n.add(e.id),r.push({msg:e,senderId:i}))};for(let t of e.activity)t?.mode===`chat`&&i(t.msg,t.senderId);for(let t of e.open?.messages??[])i(t?.msg,t?.senderId);return r.sort((e,t)=>Yb(e.msg.ts)-Yb(t.msg.ts)).slice(-500)}function $b(e,t,n={}){let r=n.createOrder??(()=>Ub()),i=n.clock??Date.now,a=r(`feed`),o=r(`open`),s=[],l=[],u=null,d=null,f=0,p=new Set,m=(e,t)=>n=>{p.has(e)||t(n)},h=new Map,g=(t,n)=>e.set(e=>({loading:{roster:e.loading.roster&&!t,channels:e.loading.channels&&!n}})),_=t=>{t.length&&e.set(e=>({orderNotes:[...e.orderNotes,...t].slice(-50)}))},y=(t,n)=>e.set(e=>{let r=e.stale.filter(e=>e.name!==t);return{stale:n?[...r,n]:r}}),x=t=>e.set(e=>({membership:{snapshot:e.membership.snapshot,unreadable:t}})),S=(t,n)=>e.set(e=>({drafts:{...e.drafts,[t]:n(e.drafts[t]??qb)}})),C=new Map,w=null,T=(e,t)=>{let n=(C.get(e)??0)+t;n>0?C.set(e,n):C.delete(e)},E=e=>{if(w!==e){C=new Map;for(let t of e)T(t.msg.id,1);w=e}return C},D=0,O=()=>{let t=e.get();if(!Object.values(t.drafts).some(e=>e.outgoing.some(e=>e.id!==void 0)))return;let n=new Set;for(let e of[t.activity,t.dms,t.open?.messages??[]])for(let t of e)t?.msg?.id&&n.add(t.msg.id);let r=e=>e.id!==void 0&&n.has(e.id);Object.values(t.drafts).some(e=>e.outgoing.some(r))&&e.set(e=>({drafts:Object.fromEntries(Object.entries(e.drafts).map(([e,t])=>[e,{...t,outgoing:t.outgoing.filter(e=>!r(e))}]))}))},k=t=>e.set(e=>({space:t.space,post:t.post,operatorId:t.operatorId??e.operatorId??null})),A=0,j=-1,M=!1,N=()=>{if(M||j===A)return;let n=e.get();!n.operatorId&&n.roster.some(e=>e.card.name===`operator`&&e.card.role===`operator`)&&(j=A,M=!0,t.meta().then(k,()=>void 0).finally(()=>{M=!1,N()}))},P=null,F=new Map,I=new Map,ee=(e,t)=>{let n=(I.get(e)??Promise.resolve()).then(t),r=n.catch(()=>void 0);return I.set(e,r),r.then(()=>{I.get(e)===r&&I.delete(e)}),n},L=(t,n)=>e.set(e=>{let r=e.sessions[t];return r?{sessions:{...e.sessions,[t]:n(r)}}:{}}),te=({reason:e,grant:t,...n})=>({...n,load:`ok`});async function re(e,n,r,i){let a=++n.reads,o=()=>F.get(e)===n&&n.reads===a;L(e,e=>({...e,limit:r}));try{let n=P;if(i&&n!==null?await ee(e,()=>t.watch(e,n)):await I.get(e),!o())return;let a=await t.agentEvents(e,r);if(!o())return;if(`refused`in a){L(e,e=>({...e,load:`refused`,reason:a.refused,grant:a.grant}));return}L(e,e=>{let t=Xb(e.frames,a.frames,!1),n=Zb(t===e.frames?t:t.slice().sort((e,t)=>Yb(e.ts)-Yb(t.ts)));return te({...e,frames:n.frames,more:a.more||n.dropped})})}catch(t){if(!o())return;let n=t instanceof Error?t.message:String(t);L(e,({grant:e,...t})=>({...t,load:`failed`,reason:n}))}}let ie=t=>{let n=e.get().roster.find(e=>e.card.id===t);return n!==void 0&&We([n],{includeOffline:!0})[0]?.events===`off`},R=()=>{for(let[n,r]of F){let i=!ie(n);if(i===r.plane)continue;if(r.plane=i,i){L(n,e=>({...e,load:`loading`})),re(n,r,e.get().sessions[n]?.limit??200,!0);continue}r.reads++,L(n,e=>te({...e,more:!1}));let a=P;a!==null&&ee(n,()=>t.unwatch(n,a)).catch(()=>void 0)}},z=(e,t)=>L(e,e=>e.posts.some(e=>e.msg.id===t.msg.id)?e:{...e,posts:[...e.posts,t].slice(-500)}),ae=()=>{f++,d=null,e.set({open:null})};async function B(n){if(n===null)return ae();if(e.set(e=>({unread:{...e.unread,[n]:0}})),d&&d.key===n)return d.promise;let a=++f,s=e.get().open,c=s?.channel===n?s.messages:[],u=r(`open`);o=u;let p=l=[],m,g={key:n,promise:new Promise(e=>m=e)};d=g,e.set({open:{channel:n,messages:c}});let v=[],b=null;try{let r=(await t.history(n,200)).map(e=>({msg:e})),i=e.get().open;v=Jb(r,c,i?.channel===n?i.messages:[],p)}catch(e){b=e instanceof Error?e.message:String(e),v=c,_([{type:`backfill-failed`,channel:n,reason:b}])}finally{let t=u.backfill(v);if(a===f){_(t.notes);let r=new Set(c),a=e.get().open?.channel===n?e.get().open.messages.filter(e=>!r.has(e)):[],o=t.emit.slice(),s=new Set(o.map(e=>e.msg.id));for(let e of a)e&&!s.has(e.msg.id)&&o.push(e);e.set({open:{channel:n,messages:o.slice(-500)}}),O();let l=`#${n} history`;b||h.set(l,i());let u=h.get(l);y(l,b?{kind:`refused`,name:l,reason:b,...u===void 0?{}:{lastRead:u}}:void 0)}d===g&&(d=null),m()}}async function V(){if(u)return u;let n;u=new Promise(e=>n=e),a=r(`feed`),s=[];let o=[],c=null;try{let n=[{name:`space`,read:()=>t.meta(),apply:k},...p.has(`peers`)?[]:[{name:`peers`,read:()=>t.roster(),apply:m(`peers`,t=>e.set({roster:t}))}],{name:`channels`,read:()=>t.channels(),apply:t=>e.set({channels:t})},{name:`direct messages`,read:()=>t.dms(500),apply:t=>e.set(e=>({dms:Jb(t.map(e=>({msg:e})),e.dms).slice(-500),dmsCut:t.length>=500}))},{name:`activity`,read:()=>t.activity(200),apply:e=>{o=e.entries,c=e}},...p.has(`membership`)?[]:[{name:`membership`,read:()=>t.membership(),apply:m(`membership`,t=>e.set({membership:{snapshot:t}}))}]],r=await b(n);R();let a=i(),s=new Set(n.map(e=>e.name).filter(e=>!r.some(t=>t.name===e)));for(let e of s)h.set(e,a);g(s.has(`peers`),s.has(`channels`));let l=r.filter(e=>!p.has(e.name));for(let e of l){let t=h.get(e.name);t!==void 0&&(e.lastRead=t)}let u=c;u&&u.partial&&l.push({kind:`partial`,name:`activity`,reason:u.missing.map(e=>`${e}: ${u.reasons[e]}`).join(`
110
- `),read:u.read,of:u.of,missing:u.missing.slice()});let d=e.get().stale.find(e=>e.name===`roster`);d&&!l.some(e=>e.name===`roster`)&&l.push(d),e.set({stale:l});let f=l.find(e=>e.name===`membership`);f&&x(f.reason);let v=l.find(e=>e.name===`activity`&&e.kind!==`partial`);v&&_([{type:`backfill-failed`,reason:v.reason}]);let y=e.get().open;y&&B(y.channel)}finally{for(let e of o)e?.msg&&(e.msg.channel=e.channel);let t=a.backfill(Jb(o,e.get().activity,s));_(t.notes);let r=t.emit.slice(),i=new Set(r.map(e=>e?.msg?.id));for(let t of e.get().activity)t&&t.msg&&!i.has(t.msg.id)&&r.push(t);e.set({activity:r.slice(-500)}),O(),u=null,n()}}let H=new Set,oe;function U(n){H.has(n)||e.get().channels.some(e=>e.channel===n&&e.deliveryClass!==void 0)||(H.add(n),oe===void 0&&(oe=setTimeout(()=>{oe=void 0,b([{name:`channels`,read:()=>t.channels(),apply:t=>e.set({channels:t})}]).then(e=>{for(let t of e)y(t.name,t)})},Gb)))}function se(t){let n=t.msg;t.arrivedAt=i(),n.channel=t.channel;let r=a.live(t);r.held&&s.push(t),_(r.notes),e.set(e=>{let i=e.activity.slice();for(let e of r.emit)i.some(t=>t.msg.id===e.msg.id)||(i.push(e),i.length>Wb&&i.shift());if(t.mode!==`unicast`||E(e.dms).has(n.id))return{activity:i};let a=Math.max(0,e.dms.length+1-500),o=e.dms.slice(a);o.push({msg:t.msg,senderId:t.senderId});for(let t=0;t<a;t++)T(e.dms[t].msg.id,-1);return T(n.id,1),w=o,{activity:i,dms:o,dmsCut:e.dmsCut||a>0}}),O(),t.mode===`chat`&&t.senderId!==void 0&&e.get().sessions[t.senderId]&&z(t.senderId,{msg:t.msg,senderId:t.senderId});let c=n.channel;if(c){if(e.set(e=>{let t=e.channels.findIndex(e=>e.channel===c),n=e.channels.slice();return t===-1?n.push({channel:c,messages:1}):n[t]={...n[t],messages:(n[t].messages??0)+1},{channels:n}}),U(c),e.get().open?.channel===c){let n={msg:t.msg,senderId:t.senderId},r=o.live(n);r.held&&l.push(n),_(r.notes),e.set(e=>{if(e.open?.channel!==c)return{};let t=e.open.messages.slice();for(let e of r.emit)t.push(e),t.length>Wb&&t.shift();return{open:{channel:c,messages:t}}})}else e.set(e=>({unread:{...e.unread,[c]:(e.unread[c]??0)+1}}))}}return{refresh:V,open:B,onRoster(t){p.add(`peers`),A++,e.set({roster:t}),g(!0,!1),N(),R()},onPresenceView(t){e.set({presenceView:t}),y(`roster`,Je(t))},onMessage:se,onMembership(t){p.add(`membership`),e.set({membership:{snapshot:t}});for(let e of t.members)for(let t of[...e.live??[],...e.durable??[]])/[*>]/.test(t)||U(t)},onMembershipFailed(e){p.add(`membership`),x(e)},async deleteChannel(n){n&&(await t.deleteChannel(n),e.set(e=>({channels:e.channels.filter(e=>e.channel!==n),unread:Object.fromEntries(Object.entries(e.unread).filter(([e])=>e!==n)),activity:e.activity.filter(e=>e.msg.channel!==n),stale:e.stale.filter(e=>e.name!==`#${n} history`)})),e.get().open?.channel===n&&ae())},async send(n,r){let a=c(n);if((e.get().drafts[a]??qb).outgoing.some(e=>e.id===void 0))throw Error(`a post to this target is already in flight`);let o={seq:++D,text:r,ts:i()};S(a,e=>({text:``,outgoing:[...e.outgoing,o]}));let s;try{s=await t.send(n,r)}catch(t){let i=e.get(),s=n.kind===`msg`?`#${n.channel}`:Pe(n.to,Me(i.roster),i.operatorId);throw S(a,e=>({text:e.text?`${r}\n${e.text}`:r,refused:v(s,t),outgoing:e.outgoing.filter(e=>e!==o)})),t}e.set(e=>({operatorId:e.operatorId??s.operatorId,drafts:{...e.drafts,[a]:{...e.drafts[a]??qb,outgoing:(e.drafts[a]??qb).outgoing.map(e=>e===o?{...e,id:s.id}:e)}}})),O()},draft(e,t){S(c(e),e=>({text:t,outgoing:e.outgoing}))},openSession(t){if(e.get().sessions[t])return L(t,e=>({...e,views:e.views+1}));let n=ie(t),r={reads:0,plane:!n};F.set(t,r),e.set(e=>({sessions:{...e.sessions,[t]:{views:1,frames:[],posts:Qb(e,t),load:n?`ok`:`loading`,more:!1,limit:200}}})),r.plane&&re(t,r,200,!0)},closeSession(n){let r=e.get().sessions[n];if(!r)return;if(r.views>1)return L(n,e=>({...e,views:e.views-1}));let i=F.get(n);F.delete(n),e.set(e=>({sessions:Object.fromEntries(Object.entries(e.sessions).filter(([e])=>e!==n))}));let a=P;i?.plane&&a!==null&&ee(n,()=>t.unwatch(n,a)).catch(()=>void 0)},async loadEarlier(t){let n=e.get().sessions[t],r=F.get(t);!n||!r?.plane||!n.more||n.limit>=2e3||ne(n.frames)>=2e3||await re(t,r,Math.min(n.limit+200,Kb),!1)},async reloadSession(t){let n=e.get().sessions[t],r=F.get(t);n&&r?.plane&&(L(t,e=>({...e,load:`loading`})),await re(t,r,n.limit,!0))},onHello(t){P=t;for(let[t,n]of F)n.plane&&re(t,n,e.get().sessions[t]?.limit??200,!0)},onFeedLost(){P=null},onAgentFrame(t){e.set(e=>{let n=e.sessions[t.id];if(!n)return{};let r=Xb(n.frames,[t.msg],!0);if(r===n.frames)return{};let i=Zb(r);return{sessions:{...e.sessions,[t.id]:{...n,frames:i.frames,more:n.more||i.dropped}}}})}}}export{Zm as $,Gt as $n,Yd as $t,$v as A,eo as An,h as Ar,If as At,vh as B,Hr as Bn,Ef as Bt,dy as C,Co as Cn,E as Cr,Qf as Ct,ny as D,lo as Dn,x as Dr,Nf as Dt,oy as E,fo as En,y as Er,Of as Et,Nh as F,ci as Fn,a as Fr,Vf as Ft,lh as G,Y as Gn,mf as Gt,mh as H,yr as Hn,vf as Ht,Mh as I,ui as In,r as Ir,Bf as It,ch as J,J as Jn,tf as Jt,ah as K,On as Kn,ff as Kt,Ch as L,fi as Ln,Rf as Lt,Qv as M,Ba as Mn,p as Mr,jf as Mt,qv as N,ji as Nn,_ as Nr,Af as Nt,iy as O,bo as On,c as Or,Mf as Ot,jh as P,Ti as Pn,f as Pr,Lf as Pt,th as Q,Jt as Qn,Zd as Qt,Sh as R,di as Rn,Hf as Rt,fy as S,ro as Sn,O as Sr,ep as St,sy as T,xo as Tn,C as Tr,Jf as Tt,ih as U,lr as Un,hf as Ut,gh as V,Rr as Vn,gf as Vt,uh as W,tr as Wn,_f as Wt,nh as X,fn as Xn,cf as Xt,rh as Y,hn as Yn,af as Yt,Qm as Z,Yt as Zn,ef as Zt,vy as _,Ul as _n,A as _r,dp as _t,mb as a,Fd as an,qe as ar,Bm as at,py as b,yl as bn,B as br,np as bt,By as c,jd as cn,ze as cr,Lm as ct,Uy as d,Sd as dn,Me as dr,Mm as dt,Jd as en,K as er,Ym as et,zy as f,bd as fn,Oe as fr,Pm as ft,by as g,Zl as gn,De as gr,up as gt,Sy as h,Jl as hn,ke as hr,Sp as ht,Lb as i,Rd as in,We as ir,Wm as it,Zv as j,Ya as jn,m as jr,Ff as jt,ry as k,ao as kn,l as kr,Pf as kt,Wy as l,Od as ln,Ie as lr,Fm as lt,xy as m,Nu as mn,Ae as mr,Cm as mt,$b as n,Hd as nn,Be as nr,qm as nt,pb as o,Nd as on,Ge as or,zm as ot,Ny as p,vd as pn,je as pr,Sm as pt,sh as q,Cn as qn,df as qt,Rb as r,Vd as rn,Ke as rr,Jm as rt,Gy as s,Md as sn,Re as sr,Nm as st,Kb as t,Ud as tn,Ye as tr,Vm as tt,Hy as u,Td as un,Pe as ur,Im as ut,gy as v,pl as vn,V as vr,rp as vt,cy as w,go as wn,T as wr,$f as wt,uy as x,ul as xn,pe as xr,X as xt,hy as y,hl as yn,ne as yr,ip as yt,ph as z,Xr as zn,Df as zt};